Lines Matching refs:ptp_data
359 if (!efx->ptp_data) in efx_ptp_describe_stats()
373 if (!efx->ptp_data) in efx_ptp_update_stats()
380 stats[i] = *(unsigned int *)((char *)efx->ptp_data + in efx_ptp_update_stats()
479 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_get_attributes()
550 efx->ptp_data->ts_corrections.tx = MCDI_DWORD(outbuf, in efx_ptp_get_timestamp_corrections()
552 efx->ptp_data->ts_corrections.rx = MCDI_DWORD(outbuf, in efx_ptp_get_timestamp_corrections()
554 efx->ptp_data->ts_corrections.pps_out = MCDI_DWORD(outbuf, in efx_ptp_get_timestamp_corrections()
556 efx->ptp_data->ts_corrections.pps_in = MCDI_DWORD(outbuf, in efx_ptp_get_timestamp_corrections()
559 efx->ptp_data->ts_corrections.tx = 0; in efx_ptp_get_timestamp_corrections()
560 efx->ptp_data->ts_corrections.rx = 0; in efx_ptp_get_timestamp_corrections()
561 efx->ptp_data->ts_corrections.pps_out = 0; in efx_ptp_get_timestamp_corrections()
562 efx->ptp_data->ts_corrections.pps_in = 0; in efx_ptp_get_timestamp_corrections()
582 efx->ptp_data->channel ? in efx_ptp_enable()
583 efx->ptp_data->channel->channel : 0); in efx_ptp_enable()
584 MCDI_SET_DWORD(inbuf, PTP_IN_ENABLE_MODE, efx->ptp_data->mode); in efx_ptp_enable()
650 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_send_times()
723 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_process_times()
818 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_synchronize()
881 struct efx_ptp_data *ptp_data = efx->ptp_data; in efx_ptp_xmit_skb() local
887 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_OP, MC_CMD_PTP_OP_TRANSMIT); in efx_ptp_xmit_skb()
888 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_PERIPH_ID, 0); in efx_ptp_xmit_skb()
889 MCDI_SET_DWORD(ptp_data->txbuf, PTP_IN_TRANSMIT_LENGTH, skb->len); in efx_ptp_xmit_skb()
902 MCDI_PTR(ptp_data->txbuf, in efx_ptp_xmit_skb()
906 ptp_data->txbuf, MC_CMD_PTP_IN_TRANSMIT_LEN(skb->len), in efx_ptp_xmit_skb()
912 timestamps.hwtstamp = ptp_data->nic_to_kernel_time( in efx_ptp_xmit_skb()
915 ptp_data->ts_corrections.tx); in efx_ptp_xmit_skb()
929 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_drop_time_expired_events()
957 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_match_rx()
1005 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_process_events()
1039 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_remove_multicast_filters()
1052 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_insert_multicast_filters()
1101 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_start()
1126 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_stop()
1139 efx_ptp_deliver_rx_queue(&efx->ptp_data->rxq); in efx_ptp_stop()
1140 skb_queue_purge(&efx->ptp_data->txq); in efx_ptp_stop()
1143 spin_lock_bh(&efx->ptp_data->evt_lock); in efx_ptp_stop()
1144 list_for_each_safe(cursor, next, &efx->ptp_data->evt_list) { in efx_ptp_stop()
1145 list_move(cursor, &efx->ptp_data->evt_free_list); in efx_ptp_stop()
1147 spin_unlock_bh(&efx->ptp_data->evt_lock); in efx_ptp_stop()
1154 if (efx->ptp_data && efx->ptp_data->enabled) in efx_ptp_restart()
1176 struct efx_ptp_data *ptp_data = in efx_ptp_worker() local
1178 struct efx_nic *efx = ptp_data->efx; in efx_ptp_worker()
1182 if (ptp_data->reset_required) { in efx_ptp_worker()
1193 while ((skb = skb_dequeue(&ptp_data->txq))) in efx_ptp_worker()
1224 efx->ptp_data = ptp; in efx_ptp_probe()
1225 if (!efx->ptp_data) in efx_ptp_probe()
1285 ptp_clock_unregister(efx->ptp_data->phc_clock); in efx_ptp_probe()
1288 destroy_workqueue(efx->ptp_data->workwq); in efx_ptp_probe()
1294 kfree(efx->ptp_data); in efx_ptp_probe()
1295 efx->ptp_data = NULL; in efx_ptp_probe()
1317 if (!efx->ptp_data) in efx_ptp_remove()
1322 cancel_work_sync(&efx->ptp_data->work); in efx_ptp_remove()
1323 cancel_work_sync(&efx->ptp_data->pps_work); in efx_ptp_remove()
1325 skb_queue_purge(&efx->ptp_data->rxq); in efx_ptp_remove()
1326 skb_queue_purge(&efx->ptp_data->txq); in efx_ptp_remove()
1328 if (efx->ptp_data->phc_clock) { in efx_ptp_remove()
1329 destroy_workqueue(efx->ptp_data->pps_workwq); in efx_ptp_remove()
1330 ptp_clock_unregister(efx->ptp_data->phc_clock); in efx_ptp_remove()
1333 destroy_workqueue(efx->ptp_data->workwq); in efx_ptp_remove()
1335 efx_nic_free_buffer(efx, &efx->ptp_data->start); in efx_ptp_remove()
1336 kfree(efx->ptp_data); in efx_ptp_remove()
1355 return efx->ptp_data && in efx_ptp_is_ptp_tx()
1356 efx->ptp_data->enabled && in efx_ptp_is_ptp_tx()
1375 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_rx()
1461 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_tx()
1475 return efx->ptp_data->mode; in efx_ptp_get_mode()
1481 if ((enable_wanted != efx->ptp_data->enabled) || in efx_ptp_change_mode()
1482 (enable_wanted && (efx->ptp_data->mode != new_mode))) { in efx_ptp_change_mode()
1487 if (efx->ptp_data->enabled && in efx_ptp_change_mode()
1488 (efx->ptp_data->mode != new_mode)) { in efx_ptp_change_mode()
1489 efx->ptp_data->enabled = false; in efx_ptp_change_mode()
1499 efx->ptp_data->mode = new_mode; in efx_ptp_change_mode()
1515 efx->ptp_data->enabled = enable_wanted; in efx_ptp_change_mode()
1536 efx->ptp_data->config = *init; in efx_ptp_ts_init()
1542 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_get_ts_info()
1553 if (primary && primary->ptp_data && primary->ptp_data->phc_clock) in efx_ptp_get_ts_info()
1555 ptp_clock_index(primary->ptp_data->phc_clock); in efx_ptp_get_ts_info()
1566 if (!efx->ptp_data) in efx_ptp_set_ts_config()
1582 if (!efx->ptp_data) in efx_ptp_get_ts_config()
1585 return copy_to_user(ifr->ifr_data, &efx->ptp_data->config, in efx_ptp_get_ts_config()
1586 sizeof(efx->ptp_data->config)) ? -EFAULT : 0; in efx_ptp_get_ts_config()
1591 struct efx_ptp_data *ptp = efx->ptp_data; in ptp_event_failure()
1629 evt->hwtimestamp = efx->ptp_data->nic_to_kernel_time( in ptp_event_rx()
1663 struct efx_ptp_data *ptp = efx->ptp_data; in efx_ptp_event()
1754 (u32) efx->ptp_data->ts_corrections.rx) & in __efx_rx_skb_attach_timestamp()
1799 struct efx_ptp_data *ptp_data = container_of(ptp, in efx_phc_adjfreq() local
1802 struct efx_nic *efx = ptp_data->efx; in efx_phc_adjfreq()
1826 ptp_data->current_adjfreq = adjustment_ns; in efx_phc_adjfreq()
1833 struct efx_ptp_data *ptp_data = container_of(ptp, in efx_phc_adjtime() local
1836 struct efx_nic *efx = ptp_data->efx; in efx_phc_adjtime()
1839 efx->ptp_data->ns_to_nic_time(delta, &nic_major, &nic_minor); in efx_phc_adjtime()
1843 MCDI_SET_QWORD(inbuf, PTP_IN_ADJUST_FREQ, ptp_data->current_adjfreq); in efx_phc_adjtime()
1852 struct efx_ptp_data *ptp_data = container_of(ptp, in efx_phc_gettime() local
1855 struct efx_nic *efx = ptp_data->efx; in efx_phc_gettime()
1869 kt = ptp_data->nic_to_kernel_time( in efx_phc_gettime()
1904 struct efx_ptp_data *ptp_data = container_of(ptp, in efx_phc_enable() local
1910 ptp_data->nic_ts_enabled = !!enable; in efx_phc_enable()