Lines Matching refs:ptp_data
399 if (!efx->ptp_data) in efx_ptp_describe_stats()
413 if (!efx->ptp_data) in efx_ptp_update_stats()
420 stats[i] = *(unsigned int *)((char *)efx->ptp_data + in efx_ptp_update_stats()
542 return efx->ptp_data ? efx->ptp_data->channel : NULL; in efx_ptp_channel()
547 if (efx->ptp_data) in efx_ptp_update_channel()
548 efx->ptp_data->channel = channel; in efx_ptp_update_channel()
619 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_nic_to_kernel_time()
640 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_get_attributes()
752 efx->ptp_data->ts_corrections.ptp_tx = MCDI_DWORD(outbuf, in efx_ptp_get_timestamp_corrections()
754 efx->ptp_data->ts_corrections.ptp_rx = MCDI_DWORD(outbuf, in efx_ptp_get_timestamp_corrections()
756 efx->ptp_data->ts_corrections.pps_out = MCDI_DWORD(outbuf, in efx_ptp_get_timestamp_corrections()
758 efx->ptp_data->ts_corrections.pps_in = MCDI_DWORD(outbuf, in efx_ptp_get_timestamp_corrections()
762 efx->ptp_data->ts_corrections.general_tx = MCDI_DWORD( in efx_ptp_get_timestamp_corrections()
765 efx->ptp_data->ts_corrections.general_rx = MCDI_DWORD( in efx_ptp_get_timestamp_corrections()
769 efx->ptp_data->ts_corrections.general_tx = in efx_ptp_get_timestamp_corrections()
770 efx->ptp_data->ts_corrections.ptp_tx; in efx_ptp_get_timestamp_corrections()
771 efx->ptp_data->ts_corrections.general_rx = in efx_ptp_get_timestamp_corrections()
772 efx->ptp_data->ts_corrections.ptp_rx; in efx_ptp_get_timestamp_corrections()
775 efx->ptp_data->ts_corrections.ptp_tx = 0; in efx_ptp_get_timestamp_corrections()
776 efx->ptp_data->ts_corrections.ptp_rx = 0; in efx_ptp_get_timestamp_corrections()
777 efx->ptp_data->ts_corrections.pps_out = 0; in efx_ptp_get_timestamp_corrections()
778 efx->ptp_data->ts_corrections.pps_in = 0; in efx_ptp_get_timestamp_corrections()
779 efx->ptp_data->ts_corrections.general_tx = 0; in efx_ptp_get_timestamp_corrections()
780 efx->ptp_data->ts_corrections.general_rx = 0; in efx_ptp_get_timestamp_corrections()
800 efx->ptp_data->channel ? in efx_ptp_enable()
801 efx->ptp_data->channel->channel : 0); in efx_ptp_enable()
802 MCDI_SET_DWORD(inbuf, PTP_IN_ENABLE_MODE, efx->ptp_data->mode); in efx_ptp_enable()
868 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_send_times()
939 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_process_times()
1034 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_synchronize()
1097 struct efx_ptp_data *ptp_data = efx->ptp_data; in efx_ptp_xmit_skb_queue() local
1101 tx_queue = efx_channel_get_tx_queue(ptp_data->channel, type); in efx_ptp_xmit_skb_queue()
1135 struct efx_ptp_data *ptp_data = efx->ptp_data; in efx_ptp_xmit_skb_mc() local
1141 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_OP, MC_CMD_PTP_OP_TRANSMIT); in efx_ptp_xmit_skb_mc()
1142 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_PERIPH_ID, 0); in efx_ptp_xmit_skb_mc()
1143 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_TRANSMIT_LENGTH, skb->len); in efx_ptp_xmit_skb_mc()
1156 MCDI_PTR(ptp_data->txbuf, in efx_ptp_xmit_skb_mc()
1160 ptp_data->txbuf, MC_CMD_PTP_IN_TRANSMIT_LEN(skb->len), in efx_ptp_xmit_skb_mc()
1166 timestamps.hwtstamp = ptp_data->nic_to_kernel_time( in efx_ptp_xmit_skb_mc()
1169 ptp_data->ts_corrections.ptp_tx); in efx_ptp_xmit_skb_mc()
1183 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_drop_time_expired_events()
1209 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_match_rx()
1257 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_process_events()
1291 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_remove_multicast_filters()
1304 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_insert_multicast_filters()
1353 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_start()
1378 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_stop()
1391 efx_ptp_deliver_rx_queue(&efx->ptp_data->rxq); in efx_ptp_stop()
1392 skb_queue_purge(&efx->ptp_data->txq); in efx_ptp_stop()
1395 spin_lock_bh(&efx->ptp_data->evt_lock); in efx_ptp_stop()
1396 list_for_each_safe(cursor, next, &efx->ptp_data->evt_list) { in efx_ptp_stop()
1397 list_move(cursor, &efx->ptp_data->evt_free_list); in efx_ptp_stop()
1399 spin_unlock_bh(&efx->ptp_data->evt_lock); in efx_ptp_stop()
1406 if (efx->ptp_data && efx->ptp_data->enabled) in efx_ptp_restart()
1428 struct efx_ptp_data *ptp_data = in efx_ptp_worker() local
1430 struct efx_nic *efx = ptp_data->efx; in efx_ptp_worker()
1434 if (ptp_data->reset_required) { in efx_ptp_worker()
1445 while ((skb = skb_dequeue(&ptp_data->txq))) in efx_ptp_worker()
1446 ptp_data->xmit_skb(efx, skb); in efx_ptp_worker()
1475 if (efx->ptp_data) { in efx_ptp_probe()
1476 efx->ptp_data->channel = channel; in efx_ptp_probe()
1481 efx->ptp_data = ptp; in efx_ptp_probe()
1482 if (!efx->ptp_data) in efx_ptp_probe()
1550 ptp_clock_unregister(efx->ptp_data->phc_clock); in efx_ptp_probe()
1553 destroy_workqueue(efx->ptp_data->workwq); in efx_ptp_probe()
1559 kfree(efx->ptp_data); in efx_ptp_probe()
1560 efx->ptp_data = NULL; in efx_ptp_probe()
1592 if (!efx->ptp_data) in efx_ptp_remove()
1597 cancel_work_sync(&efx->ptp_data->work); in efx_ptp_remove()
1598 if (efx->ptp_data->pps_workwq) in efx_ptp_remove()
1599 cancel_work_sync(&efx->ptp_data->pps_work); in efx_ptp_remove()
1601 skb_queue_purge(&efx->ptp_data->rxq); in efx_ptp_remove()
1602 skb_queue_purge(&efx->ptp_data->txq); in efx_ptp_remove()
1604 if (efx->ptp_data->phc_clock) { in efx_ptp_remove()
1605 destroy_workqueue(efx->ptp_data->pps_workwq); in efx_ptp_remove()
1606 ptp_clock_unregister(efx->ptp_data->phc_clock); in efx_ptp_remove()
1609 destroy_workqueue(efx->ptp_data->workwq); in efx_ptp_remove()
1611 efx_nic_free_buffer(efx, &efx->ptp_data->start); in efx_ptp_remove()
1612 kfree(efx->ptp_data); in efx_ptp_remove()
1613 efx->ptp_data = NULL; in efx_ptp_remove()
1632 return efx->ptp_data && in efx_ptp_is_ptp_tx()
1633 efx->ptp_data->enabled && in efx_ptp_is_ptp_tx()
1652 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_rx()
1738 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_tx()
1752 return efx->ptp_data->mode; in efx_ptp_get_mode()
1758 if ((enable_wanted != efx->ptp_data->enabled) || in efx_ptp_change_mode()
1759 (enable_wanted && (efx->ptp_data->mode != new_mode))) { in efx_ptp_change_mode()
1764 if (efx->ptp_data->enabled && in efx_ptp_change_mode()
1765 (efx->ptp_data->mode != new_mode)) { in efx_ptp_change_mode()
1766 efx->ptp_data->enabled = false; in efx_ptp_change_mode()
1776 efx->ptp_data->mode = new_mode; in efx_ptp_change_mode()
1792 efx->ptp_data->enabled = enable_wanted; in efx_ptp_change_mode()
1810 efx->ptp_data->config = *init; in efx_ptp_ts_init()
1816 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_get_ts_info()
1838 if (primary && primary->ptp_data && primary->ptp_data->phc_clock) in efx_ptp_get_ts_info()
1840 ptp_clock_index(primary->ptp_data->phc_clock); in efx_ptp_get_ts_info()
1851 if (!efx->ptp_data) in efx_ptp_set_ts_config()
1867 if (!efx->ptp_data) in efx_ptp_get_ts_config()
1870 return copy_to_user(ifr->ifr_data, &efx->ptp_data->config, in efx_ptp_get_ts_config()
1871 sizeof(efx->ptp_data->config)) ? -EFAULT : 0; in efx_ptp_get_ts_config()
1876 struct efx_ptp_data *ptp = efx->ptp_data; in ptp_event_failure()
1914 evt->hwtimestamp = efx->ptp_data->nic_to_kernel_time( in ptp_event_rx()
1948 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_event()
2000 struct efx_ptp_data *ptp = efx->ptp_data; in efx_time_sync_event()
2037 struct efx_ptp_data *ptp = efx->ptp_data; in __efx_rx_skb_attach_timestamp()
2092 struct efx_ptp_data *ptp_data = container_of(ptp, in efx_phc_adjfreq() local
2095 struct efx_nic *efx = ptp_data->efx; in efx_phc_adjfreq()
2107 (1 << (ptp_data->adjfreq_ppb_shift - 1))) >> in efx_phc_adjfreq()
2108 ptp_data->adjfreq_ppb_shift; in efx_phc_adjfreq()
2120 ptp_data->current_adjfreq = adjustment_ns; in efx_phc_adjfreq()
2127 struct efx_ptp_data *ptp_data = container_of(ptp, in efx_phc_adjtime() local
2130 struct efx_nic *efx = ptp_data->efx; in efx_phc_adjtime()
2133 efx->ptp_data->ns_to_nic_time(delta, &nic_major, &nic_minor); in efx_phc_adjtime()
2137 MCDI_SET_QWORD(inbuf, PTP_IN_ADJUST_FREQ, ptp_data->current_adjfreq); in efx_phc_adjtime()
2146 struct efx_ptp_data *ptp_data = container_of(ptp, in efx_phc_gettime() local
2149 struct efx_nic *efx = ptp_data->efx; in efx_phc_gettime()
2163 kt = ptp_data->nic_to_kernel_time( in efx_phc_gettime()
2198 struct efx_ptp_data *ptp_data = container_of(ptp, in efx_phc_enable() local
2204 ptp_data->nic_ts_enabled = !!enable; in efx_phc_enable()