Lines Matching refs:ptp_data
398 if (!efx->ptp_data)
412 if (!efx->ptp_data)
419 stats[i] = *(unsigned int *)((char *)efx->ptp_data +
522 return efx->ptp_data ? efx->ptp_data->channel : NULL;
527 if (efx->ptp_data)
528 efx->ptp_data->channel = channel;
599 struct efx_ptp_data *ptp = efx->ptp_data;
620 struct efx_ptp_data *ptp = efx->ptp_data;
726 efx->ptp_data->ts_corrections.ptp_tx = MCDI_DWORD(outbuf,
728 efx->ptp_data->ts_corrections.ptp_rx = MCDI_DWORD(outbuf,
730 efx->ptp_data->ts_corrections.pps_out = MCDI_DWORD(outbuf,
732 efx->ptp_data->ts_corrections.pps_in = MCDI_DWORD(outbuf,
736 efx->ptp_data->ts_corrections.general_tx = MCDI_DWORD(
739 efx->ptp_data->ts_corrections.general_rx = MCDI_DWORD(
743 efx->ptp_data->ts_corrections.general_tx =
744 efx->ptp_data->ts_corrections.ptp_tx;
745 efx->ptp_data->ts_corrections.general_rx =
746 efx->ptp_data->ts_corrections.ptp_rx;
749 efx->ptp_data->ts_corrections.ptp_tx = 0;
750 efx->ptp_data->ts_corrections.ptp_rx = 0;
751 efx->ptp_data->ts_corrections.pps_out = 0;
752 efx->ptp_data->ts_corrections.pps_in = 0;
753 efx->ptp_data->ts_corrections.general_tx = 0;
754 efx->ptp_data->ts_corrections.general_rx = 0;
774 efx->ptp_data->channel ?
775 efx->ptp_data->channel->channel : 0);
776 MCDI_SET_DWORD(inbuf, PTP_IN_ENABLE_MODE, efx->ptp_data->mode);
790 * Note that this function should never rely on the presence of ptp_data -
842 struct efx_ptp_data *ptp = efx->ptp_data;
913 struct efx_ptp_data *ptp = efx->ptp_data;
1008 struct efx_ptp_data *ptp = efx->ptp_data;
1071 struct efx_ptp_data *ptp_data = efx->ptp_data;
1075 tx_queue = efx_channel_get_tx_queue(ptp_data->channel, type);
1119 struct efx_ptp_data *ptp_data = efx->ptp_data;
1124 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_OP, MC_CMD_PTP_OP_TRANSMIT);
1125 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_PERIPH_ID, 0);
1126 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_TRANSMIT_LENGTH, skb->len);
1139 MCDI_PTR(ptp_data->txbuf,
1143 ptp_data->txbuf, MC_CMD_PTP_IN_TRANSMIT_LEN(skb->len),
1149 timestamps.hwtstamp = ptp_data->nic_to_kernel_time(
1152 ptp_data->ts_corrections.ptp_tx);
1173 struct efx_ptp_data *ptp = efx->ptp_data;
1238 struct efx_channel *channel = efx->ptp_data->channel;
1250 struct efx_ptp_data *ptp = efx->ptp_data;
1311 struct efx_ptp_data *ptp = efx->ptp_data;
1324 struct efx_ptp_data *ptp = efx->ptp_data;
1394 struct efx_ptp_data *ptp = efx->ptp_data;
1434 struct efx_ptp_data *ptp = efx->ptp_data;
1459 struct efx_ptp_data *ptp = efx->ptp_data;
1471 efx_ptp_deliver_rx_queue(&efx->ptp_data->rxq);
1472 skb_queue_purge(&efx->ptp_data->txq);
1479 if (efx->ptp_data && efx->ptp_data->enabled)
1501 struct efx_ptp_data *ptp_data =
1503 struct efx_nic *efx = ptp_data->efx;
1507 if (ptp_data->reset_required) {
1516 while ((skb = skb_dequeue(&ptp_data->txq)))
1517 ptp_data->xmit_skb(efx, skb);
1562 if (efx->ptp_data) {
1563 efx->ptp_data->channel = channel;
1568 efx->ptp_data = ptp;
1569 if (!efx->ptp_data)
1634 ptp_clock_unregister(efx->ptp_data->phc_clock);
1637 destroy_workqueue(efx->ptp_data->workwq);
1643 kfree(efx->ptp_data);
1644 efx->ptp_data = NULL;
1676 if (!efx->ptp_data)
1681 cancel_work_sync(&efx->ptp_data->work);
1682 cancel_delayed_work_sync(&efx->ptp_data->cleanup_work);
1683 if (efx->ptp_data->pps_workwq)
1684 cancel_work_sync(&efx->ptp_data->pps_work);
1686 skb_queue_purge(&efx->ptp_data->rxq);
1687 skb_queue_purge(&efx->ptp_data->txq);
1689 if (efx->ptp_data->phc_clock) {
1690 destroy_workqueue(efx->ptp_data->pps_workwq);
1691 ptp_clock_unregister(efx->ptp_data->phc_clock);
1694 destroy_workqueue(efx->ptp_data->workwq);
1696 efx_nic_free_buffer(efx, &efx->ptp_data->start);
1697 kfree(efx->ptp_data);
1698 efx->ptp_data = NULL;
1717 return efx->ptp_data &&
1718 efx->ptp_data->enabled &&
1737 struct efx_ptp_data *ptp = efx->ptp_data;
1790 struct efx_ptp_data *ptp = efx->ptp_data;
1804 return efx->ptp_data->mode;
1810 if ((enable_wanted != efx->ptp_data->enabled) ||
1811 (enable_wanted && (efx->ptp_data->mode != new_mode))) {
1816 if (efx->ptp_data->enabled &&
1817 (efx->ptp_data->mode != new_mode)) {
1818 efx->ptp_data->enabled = false;
1828 efx->ptp_data->mode = new_mode;
1844 efx->ptp_data->enabled = enable_wanted;
1862 efx->ptp_data->config = *init;
1868 struct efx_ptp_data *ptp = efx->ptp_data;
1890 if (primary && primary->ptp_data && primary->ptp_data->phc_clock)
1892 ptp_clock_index(primary->ptp_data->phc_clock);
1903 if (!efx->ptp_data)
1919 if (!efx->ptp_data)
1922 return copy_to_user(ifr->ifr_data, &efx->ptp_data->config,
1923 sizeof(efx->ptp_data->config)) ? -EFAULT : 0;
1928 struct efx_ptp_data *ptp = efx->ptp_data;
1956 struct efx_ptp_data *ptp = efx->ptp_data;
2005 struct efx_ptp_data *ptp = efx->ptp_data;
2042 struct efx_ptp_data *ptp = efx->ptp_data;
2097 struct efx_ptp_data *ptp_data = container_of(ptp,
2101 struct efx_nic *efx = ptp_data->efx;
2113 (1 << (ptp_data->adjfreq_ppb_shift - 1))) >>
2114 ptp_data->adjfreq_ppb_shift;
2126 ptp_data->current_adjfreq = adjustment_ns;
2133 struct efx_ptp_data *ptp_data = container_of(ptp,
2136 struct efx_nic *efx = ptp_data->efx;
2139 efx->ptp_data->ns_to_nic_time(delta, &nic_major, &nic_minor);
2143 MCDI_SET_QWORD(inbuf, PTP_IN_ADJUST_FREQ, ptp_data->current_adjfreq);
2152 struct efx_ptp_data *ptp_data = container_of(ptp,
2155 struct efx_nic *efx = ptp_data->efx;
2169 kt = ptp_data->nic_to_kernel_time(
2204 struct efx_ptp_data *ptp_data = container_of(ptp,
2210 ptp_data->nic_ts_enabled = !!enable;