Lines Matching refs:ptp_data
399 if (!efx->ptp_data)
413 if (!efx->ptp_data)
420 stats[i] = *(unsigned int *)((char *)efx->ptp_data +
542 return efx->ptp_data ? efx->ptp_data->channel : NULL;
547 if (efx->ptp_data)
548 efx->ptp_data->channel = channel;
619 struct efx_ptp_data *ptp = efx->ptp_data;
640 struct efx_ptp_data *ptp = efx->ptp_data;
752 efx->ptp_data->ts_corrections.ptp_tx = MCDI_DWORD(outbuf,
754 efx->ptp_data->ts_corrections.ptp_rx = MCDI_DWORD(outbuf,
756 efx->ptp_data->ts_corrections.pps_out = MCDI_DWORD(outbuf,
758 efx->ptp_data->ts_corrections.pps_in = MCDI_DWORD(outbuf,
762 efx->ptp_data->ts_corrections.general_tx = MCDI_DWORD(
765 efx->ptp_data->ts_corrections.general_rx = MCDI_DWORD(
769 efx->ptp_data->ts_corrections.general_tx =
770 efx->ptp_data->ts_corrections.ptp_tx;
771 efx->ptp_data->ts_corrections.general_rx =
772 efx->ptp_data->ts_corrections.ptp_rx;
775 efx->ptp_data->ts_corrections.ptp_tx = 0;
776 efx->ptp_data->ts_corrections.ptp_rx = 0;
777 efx->ptp_data->ts_corrections.pps_out = 0;
778 efx->ptp_data->ts_corrections.pps_in = 0;
779 efx->ptp_data->ts_corrections.general_tx = 0;
780 efx->ptp_data->ts_corrections.general_rx = 0;
800 efx->ptp_data->channel ?
801 efx->ptp_data->channel->channel : 0);
802 MCDI_SET_DWORD(inbuf, PTP_IN_ENABLE_MODE, efx->ptp_data->mode);
816 * Note that this function should never rely on the presence of ptp_data -
868 struct efx_ptp_data *ptp = efx->ptp_data;
939 struct efx_ptp_data *ptp = efx->ptp_data;
1034 struct efx_ptp_data *ptp = efx->ptp_data;
1097 struct efx_ptp_data *ptp_data = efx->ptp_data;
1101 tx_queue = efx_channel_get_tx_queue(ptp_data->channel, type);
1135 struct efx_ptp_data *ptp_data = efx->ptp_data;
1141 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_OP, MC_CMD_PTP_OP_TRANSMIT);
1142 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_PERIPH_ID, 0);
1143 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_TRANSMIT_LENGTH, skb->len);
1156 MCDI_PTR(ptp_data->txbuf,
1160 ptp_data->txbuf, MC_CMD_PTP_IN_TRANSMIT_LEN(skb->len),
1166 timestamps.hwtstamp = ptp_data->nic_to_kernel_time(
1169 ptp_data->ts_corrections.ptp_tx);
1183 struct efx_ptp_data *ptp = efx->ptp_data;
1209 struct efx_ptp_data *ptp = efx->ptp_data;
1257 struct efx_ptp_data *ptp = efx->ptp_data;
1291 struct efx_ptp_data *ptp = efx->ptp_data;
1304 struct efx_ptp_data *ptp = efx->ptp_data;
1353 struct efx_ptp_data *ptp = efx->ptp_data;
1378 struct efx_ptp_data *ptp = efx->ptp_data;
1391 efx_ptp_deliver_rx_queue(&efx->ptp_data->rxq);
1392 skb_queue_purge(&efx->ptp_data->txq);
1395 spin_lock_bh(&efx->ptp_data->evt_lock);
1396 list_for_each_safe(cursor, next, &efx->ptp_data->evt_list) {
1397 list_move(cursor, &efx->ptp_data->evt_free_list);
1399 spin_unlock_bh(&efx->ptp_data->evt_lock);
1406 if (efx->ptp_data && efx->ptp_data->enabled)
1428 struct efx_ptp_data *ptp_data =
1430 struct efx_nic *efx = ptp_data->efx;
1434 if (ptp_data->reset_required) {
1445 while ((skb = skb_dequeue(&ptp_data->txq)))
1446 ptp_data->xmit_skb(efx, skb);
1475 if (efx->ptp_data) {
1476 efx->ptp_data->channel = channel;
1481 efx->ptp_data = ptp;
1482 if (!efx->ptp_data)
1550 ptp_clock_unregister(efx->ptp_data->phc_clock);
1553 destroy_workqueue(efx->ptp_data->workwq);
1559 kfree(efx->ptp_data);
1560 efx->ptp_data = NULL;
1592 if (!efx->ptp_data)
1597 cancel_work_sync(&efx->ptp_data->work);
1598 if (efx->ptp_data->pps_workwq)
1599 cancel_work_sync(&efx->ptp_data->pps_work);
1601 skb_queue_purge(&efx->ptp_data->rxq);
1602 skb_queue_purge(&efx->ptp_data->txq);
1604 if (efx->ptp_data->phc_clock) {
1605 destroy_workqueue(efx->ptp_data->pps_workwq);
1606 ptp_clock_unregister(efx->ptp_data->phc_clock);
1609 destroy_workqueue(efx->ptp_data->workwq);
1611 efx_nic_free_buffer(efx, &efx->ptp_data->start);
1612 kfree(efx->ptp_data);
1613 efx->ptp_data = NULL;
1632 return efx->ptp_data &&
1633 efx->ptp_data->enabled &&
1652 struct efx_ptp_data *ptp = efx->ptp_data;
1738 struct efx_ptp_data *ptp = efx->ptp_data;
1752 return efx->ptp_data->mode;
1758 if ((enable_wanted != efx->ptp_data->enabled) ||
1759 (enable_wanted && (efx->ptp_data->mode != new_mode))) {
1764 if (efx->ptp_data->enabled &&
1765 (efx->ptp_data->mode != new_mode)) {
1766 efx->ptp_data->enabled = false;
1776 efx->ptp_data->mode = new_mode;
1792 efx->ptp_data->enabled = enable_wanted;
1813 efx->ptp_data->config = *init;
1819 struct efx_ptp_data *ptp = efx->ptp_data;
1841 if (primary && primary->ptp_data && primary->ptp_data->phc_clock)
1843 ptp_clock_index(primary->ptp_data->phc_clock);
1854 if (!efx->ptp_data)
1870 if (!efx->ptp_data)
1873 return copy_to_user(ifr->ifr_data, &efx->ptp_data->config,
1874 sizeof(efx->ptp_data->config)) ? -EFAULT : 0;
1879 struct efx_ptp_data *ptp = efx->ptp_data;
1917 evt->hwtimestamp = efx->ptp_data->nic_to_kernel_time(
1951 struct efx_ptp_data *ptp = efx->ptp_data;
2003 struct efx_ptp_data *ptp = efx->ptp_data;
2040 struct efx_ptp_data *ptp = efx->ptp_data;
2095 struct efx_ptp_data *ptp_data = container_of(ptp,
2098 struct efx_nic *efx = ptp_data->efx;
2110 (1 << (ptp_data->adjfreq_ppb_shift - 1))) >>
2111 ptp_data->adjfreq_ppb_shift;
2123 ptp_data->current_adjfreq = adjustment_ns;
2130 struct efx_ptp_data *ptp_data = container_of(ptp,
2133 struct efx_nic *efx = ptp_data->efx;
2136 efx->ptp_data->ns_to_nic_time(delta, &nic_major, &nic_minor);
2140 MCDI_SET_QWORD(inbuf, PTP_IN_ADJUST_FREQ, ptp_data->current_adjfreq);
2149 struct efx_ptp_data *ptp_data = container_of(ptp,
2152 struct efx_nic *efx = ptp_data->efx;
2166 kt = ptp_data->nic_to_kernel_time(
2201 struct efx_ptp_data *ptp_data = container_of(ptp,
2207 ptp_data->nic_ts_enabled = !!enable;