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()
111 void fm10k_ts_tx_subtask(struct fm10k_intfc *interface) in fm10k_ts_tx_subtask() argument
113 struct sk_buff_head *list = &interface->ts_tx_skb_queue; in fm10k_ts_tx_subtask()
118 if (test_bit(__FM10K_DOWN, &interface->state) || in fm10k_ts_tx_subtask()
119 test_bit(__FM10K_RESETTING, &interface->state)) in fm10k_ts_tx_subtask()
130 interface->tx_hwtstamp_timeouts++; in fm10k_ts_tx_subtask()
136 static u64 fm10k_systime_read(struct fm10k_intfc *interface) in fm10k_systime_read() argument
138 struct fm10k_hw *hw = &interface->hw; in fm10k_systime_read()
143 void fm10k_ts_reset(struct fm10k_intfc *interface) in fm10k_ts_reset() argument
149 write_lock_irqsave(&interface->systime_lock, flags); in fm10k_ts_reset()
150 interface->ptp_adjust = fm10k_systime_read(interface) - ns; in fm10k_ts_reset()
151 write_unlock_irqrestore(&interface->systime_lock, flags); in fm10k_ts_reset()
154 void fm10k_ts_init(struct fm10k_intfc *interface) in fm10k_ts_init() argument
157 rwlock_init(&interface->systime_lock); in fm10k_ts_init()
160 skb_queue_head_init(&interface->ts_tx_skb_queue); in fm10k_ts_init()
163 fm10k_ts_reset(interface); in fm10k_ts_init()
177 struct fm10k_intfc *interface = netdev_priv(netdev); in fm10k_get_ts_config() local
178 struct hwtstamp_config *config = &interface->ts_config; in fm10k_get_ts_config()
208 struct fm10k_intfc *interface = netdev_priv(netdev); in fm10k_set_ts_config() local
230 interface->flags &= ~FM10K_FLAG_RX_TS_ENABLED; in fm10k_set_ts_config()
245 interface->flags |= FM10K_FLAG_RX_TS_ENABLED; in fm10k_set_ts_config()
253 interface->ts_config = ts_config; in fm10k_set_ts_config()
261 struct fm10k_intfc *interface; in fm10k_ptp_adjfreq() local
265 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); in fm10k_ptp_adjfreq()
266 hw = &interface->hw; in fm10k_ptp_adjfreq()
276 struct fm10k_intfc *interface; in fm10k_ptp_adjtime() local
279 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); in fm10k_ptp_adjtime()
281 write_lock_irqsave(&interface->systime_lock, flags); in fm10k_ptp_adjtime()
282 interface->ptp_adjust += delta; in fm10k_ptp_adjtime()
283 write_unlock_irqrestore(&interface->systime_lock, flags); in fm10k_ptp_adjtime()
290 struct fm10k_intfc *interface; in fm10k_ptp_gettime() local
294 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); in fm10k_ptp_gettime()
296 read_lock_irqsave(&interface->systime_lock, flags); in fm10k_ptp_gettime()
297 now = fm10k_systime_read(interface) + interface->ptp_adjust; in fm10k_ptp_gettime()
298 read_unlock_irqrestore(&interface->systime_lock, flags); in fm10k_ptp_gettime()
308 struct fm10k_intfc *interface; in fm10k_ptp_settime() local
312 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); in fm10k_ptp_settime()
314 write_lock_irqsave(&interface->systime_lock, flags); in fm10k_ptp_settime()
315 interface->ptp_adjust = fm10k_systime_read(interface) - ns; in fm10k_ptp_settime()
316 write_unlock_irqrestore(&interface->systime_lock, flags); in fm10k_ptp_settime()
326 struct fm10k_intfc *interface; in fm10k_ptp_enable() local
348 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); in fm10k_ptp_enable()
349 hw = &interface->hw; in fm10k_ptp_enable()
406 void fm10k_ptp_register(struct fm10k_intfc *interface) in fm10k_ptp_register() argument
408 struct ptp_clock_info *ptp_caps = &interface->ptp_caps; in fm10k_ptp_register()
409 struct device *dev = &interface->pdev->dev; in fm10k_ptp_register()
413 "%s", interface->netdev->name); in fm10k_ptp_register()
427 if (interface->sw_addr) { in fm10k_ptp_register()
446 interface->ptp_clock = ptp_clock; in fm10k_ptp_register()
449 void fm10k_ptp_unregister(struct fm10k_intfc *interface) in fm10k_ptp_unregister() argument
451 struct ptp_clock *ptp_clock = interface->ptp_clock; in fm10k_ptp_unregister()
452 struct device *dev = &interface->pdev->dev; in fm10k_ptp_unregister()
457 interface->ptp_clock = NULL; in fm10k_ptp_unregister()
460 dev_info(dev, "removed PHC %s\n", interface->ptp_caps.name); in fm10k_ptp_unregister()