Lines Matching refs:interface
28 void fm10k_systime_to_hwtstamp(struct fm10k_intfc *interface, in fm10k_systime_to_hwtstamp() argument
34 read_lock_irqsave(&interface->systime_lock, flags); in fm10k_systime_to_hwtstamp()
35 systime += interface->ptp_adjust; in fm10k_systime_to_hwtstamp()
36 read_unlock_irqrestore(&interface->systime_lock, flags); in fm10k_systime_to_hwtstamp()
41 static struct sk_buff *fm10k_ts_tx_skb(struct fm10k_intfc *interface, in fm10k_ts_tx_skb() argument
44 struct sk_buff_head *list = &interface->ts_tx_skb_queue; in fm10k_ts_tx_skb()
55 void fm10k_ts_tx_enqueue(struct fm10k_intfc *interface, struct sk_buff *skb) in fm10k_ts_tx_enqueue() argument
57 struct sk_buff_head *list = &interface->ts_tx_skb_queue; in fm10k_ts_tx_enqueue()
72 skb = fm10k_ts_tx_skb(interface, FM10K_CB(clone)->fi.w.dglort); in fm10k_ts_tx_enqueue()
85 void fm10k_ts_tx_hwtstamp(struct fm10k_intfc *interface, __le16 dglort, in fm10k_ts_tx_hwtstamp() argument
89 struct sk_buff_head *list = &interface->ts_tx_skb_queue; in fm10k_ts_tx_hwtstamp()
96 skb = fm10k_ts_tx_skb(interface, dglort); in fm10k_ts_tx_hwtstamp()
107 fm10k_systime_to_hwtstamp(interface, &shhwtstamps, systime); in fm10k_ts_tx_hwtstamp()
112 void fm10k_ts_tx_subtask(struct fm10k_intfc *interface) in fm10k_ts_tx_subtask() argument
114 struct sk_buff_head *list = &interface->ts_tx_skb_queue; in fm10k_ts_tx_subtask()
119 if (test_bit(__FM10K_DOWN, &interface->state) || in fm10k_ts_tx_subtask()
120 test_bit(__FM10K_RESETTING, &interface->state)) in fm10k_ts_tx_subtask()
131 interface->tx_hwtstamp_timeouts++; in fm10k_ts_tx_subtask()
137 static u64 fm10k_systime_read(struct fm10k_intfc *interface) in fm10k_systime_read() argument
139 struct fm10k_hw *hw = &interface->hw; in fm10k_systime_read()
144 void fm10k_ts_reset(struct fm10k_intfc *interface) in fm10k_ts_reset() argument
150 write_lock_irqsave(&interface->systime_lock, flags); in fm10k_ts_reset()
151 interface->ptp_adjust = fm10k_systime_read(interface) - ns; in fm10k_ts_reset()
152 write_unlock_irqrestore(&interface->systime_lock, flags); in fm10k_ts_reset()
155 void fm10k_ts_init(struct fm10k_intfc *interface) in fm10k_ts_init() argument
158 rwlock_init(&interface->systime_lock); in fm10k_ts_init()
161 skb_queue_head_init(&interface->ts_tx_skb_queue); in fm10k_ts_init()
164 fm10k_ts_reset(interface); in fm10k_ts_init()
178 struct fm10k_intfc *interface = netdev_priv(netdev); in fm10k_get_ts_config() local
179 struct hwtstamp_config *config = &interface->ts_config; in fm10k_get_ts_config()
209 struct fm10k_intfc *interface = netdev_priv(netdev); in fm10k_set_ts_config() local
231 interface->flags &= ~FM10K_FLAG_RX_TS_ENABLED; in fm10k_set_ts_config()
246 interface->flags |= FM10K_FLAG_RX_TS_ENABLED; in fm10k_set_ts_config()
254 interface->ts_config = ts_config; in fm10k_set_ts_config()
262 struct fm10k_intfc *interface; in fm10k_ptp_adjfreq() local
266 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); in fm10k_ptp_adjfreq()
267 hw = &interface->hw; in fm10k_ptp_adjfreq()
277 struct fm10k_intfc *interface; in fm10k_ptp_adjtime() local
280 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); in fm10k_ptp_adjtime()
282 write_lock_irqsave(&interface->systime_lock, flags); in fm10k_ptp_adjtime()
283 interface->ptp_adjust += delta; in fm10k_ptp_adjtime()
284 write_unlock_irqrestore(&interface->systime_lock, flags); in fm10k_ptp_adjtime()
291 struct fm10k_intfc *interface; in fm10k_ptp_gettime() local
295 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); in fm10k_ptp_gettime()
297 read_lock_irqsave(&interface->systime_lock, flags); in fm10k_ptp_gettime()
298 now = fm10k_systime_read(interface) + interface->ptp_adjust; in fm10k_ptp_gettime()
299 read_unlock_irqrestore(&interface->systime_lock, flags); in fm10k_ptp_gettime()
309 struct fm10k_intfc *interface; in fm10k_ptp_settime() local
313 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); in fm10k_ptp_settime()
315 write_lock_irqsave(&interface->systime_lock, flags); in fm10k_ptp_settime()
316 interface->ptp_adjust = fm10k_systime_read(interface) - ns; in fm10k_ptp_settime()
317 write_unlock_irqrestore(&interface->systime_lock, flags); in fm10k_ptp_settime()
327 struct fm10k_intfc *interface; in fm10k_ptp_enable() local
349 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); in fm10k_ptp_enable()
350 hw = &interface->hw; in fm10k_ptp_enable()
407 void fm10k_ptp_register(struct fm10k_intfc *interface) in fm10k_ptp_register() argument
409 struct ptp_clock_info *ptp_caps = &interface->ptp_caps; in fm10k_ptp_register()
410 struct device *dev = &interface->pdev->dev; in fm10k_ptp_register()
414 "%s", interface->netdev->name); in fm10k_ptp_register()
428 if (interface->sw_addr) { in fm10k_ptp_register()
447 interface->ptp_clock = ptp_clock; in fm10k_ptp_register()
450 void fm10k_ptp_unregister(struct fm10k_intfc *interface) in fm10k_ptp_unregister() argument
452 struct ptp_clock *ptp_clock = interface->ptp_clock; in fm10k_ptp_unregister()
453 struct device *dev = &interface->pdev->dev; in fm10k_ptp_unregister()
458 interface->ptp_clock = NULL; in fm10k_ptp_unregister()
461 dev_info(dev, "removed PHC %s\n", interface->ptp_caps.name); in fm10k_ptp_unregister()