fm10k.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. /* Intel Ethernet Switch Host Interface Driver
  2. * Copyright(c) 2013 - 2015 Intel Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * The full GNU General Public License is included in this distribution in
  14. * the file called "COPYING".
  15. *
  16. * Contact Information:
  17. * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  18. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  19. */
  20. #ifndef _FM10K_H_
  21. #define _FM10K_H_
  22. #include <linux/types.h>
  23. #include <linux/etherdevice.h>
  24. #include <linux/cpumask.h>
  25. #include <linux/rtnetlink.h>
  26. #include <linux/if_vlan.h>
  27. #include <linux/pci.h>
  28. #include <linux/net_tstamp.h>
  29. #include <linux/clocksource.h>
  30. #include <linux/ptp_clock_kernel.h>
  31. #include "fm10k_pf.h"
  32. #include "fm10k_vf.h"
  33. #define FM10K_MAX_JUMBO_FRAME_SIZE 15342 /* Maximum supported size 15K */
  34. #define MAX_QUEUES FM10K_MAX_QUEUES_PF
  35. #define FM10K_MIN_RXD 128
  36. #define FM10K_MAX_RXD 4096
  37. #define FM10K_DEFAULT_RXD 256
  38. #define FM10K_MIN_TXD 128
  39. #define FM10K_MAX_TXD 4096
  40. #define FM10K_DEFAULT_TXD 256
  41. #define FM10K_DEFAULT_TX_WORK 256
  42. #define FM10K_RXBUFFER_256 256
  43. #define FM10K_RX_HDR_LEN FM10K_RXBUFFER_256
  44. #define FM10K_RXBUFFER_2048 2048
  45. #define FM10K_RX_BUFSZ FM10K_RXBUFFER_2048
  46. /* How many Rx Buffers do we bundle into one write to the hardware ? */
  47. #define FM10K_RX_BUFFER_WRITE 16 /* Must be power of 2 */
  48. #define FM10K_MAX_STATIONS 63
  49. struct fm10k_l2_accel {
  50. int size;
  51. u16 count;
  52. u16 dglort;
  53. struct rcu_head rcu;
  54. struct net_device *macvlan[0];
  55. };
  56. enum fm10k_ring_state_t {
  57. __FM10K_TX_DETECT_HANG,
  58. __FM10K_HANG_CHECK_ARMED,
  59. __FM10K_TX_XPS_INIT_DONE,
  60. };
  61. #define check_for_tx_hang(ring) \
  62. test_bit(__FM10K_TX_DETECT_HANG, &(ring)->state)
  63. #define set_check_for_tx_hang(ring) \
  64. set_bit(__FM10K_TX_DETECT_HANG, &(ring)->state)
  65. #define clear_check_for_tx_hang(ring) \
  66. clear_bit(__FM10K_TX_DETECT_HANG, &(ring)->state)
  67. struct fm10k_tx_buffer {
  68. struct fm10k_tx_desc *next_to_watch;
  69. struct sk_buff *skb;
  70. unsigned int bytecount;
  71. u16 gso_segs;
  72. u16 tx_flags;
  73. DEFINE_DMA_UNMAP_ADDR(dma);
  74. DEFINE_DMA_UNMAP_LEN(len);
  75. };
  76. struct fm10k_rx_buffer {
  77. dma_addr_t dma;
  78. struct page *page;
  79. u32 page_offset;
  80. };
  81. struct fm10k_queue_stats {
  82. u64 packets;
  83. u64 bytes;
  84. };
  85. struct fm10k_tx_queue_stats {
  86. u64 restart_queue;
  87. u64 csum_err;
  88. u64 tx_busy;
  89. u64 tx_done_old;
  90. u64 csum_good;
  91. };
  92. struct fm10k_rx_queue_stats {
  93. u64 alloc_failed;
  94. u64 csum_err;
  95. u64 errors;
  96. u64 csum_good;
  97. u64 switch_errors;
  98. u64 drops;
  99. u64 pp_errors;
  100. u64 link_errors;
  101. u64 length_errors;
  102. };
  103. struct fm10k_ring {
  104. struct fm10k_q_vector *q_vector;/* backpointer to host q_vector */
  105. struct net_device *netdev; /* netdev ring belongs to */
  106. struct device *dev; /* device for DMA mapping */
  107. struct fm10k_l2_accel __rcu *l2_accel; /* L2 acceleration list */
  108. void *desc; /* descriptor ring memory */
  109. union {
  110. struct fm10k_tx_buffer *tx_buffer;
  111. struct fm10k_rx_buffer *rx_buffer;
  112. };
  113. u32 __iomem *tail;
  114. unsigned long state;
  115. dma_addr_t dma; /* phys. address of descriptor ring */
  116. unsigned int size; /* length in bytes */
  117. u8 queue_index; /* needed for queue management */
  118. u8 reg_idx; /* holds the special value that gets
  119. * the hardware register offset
  120. * associated with this ring, which is
  121. * different for DCB and RSS modes
  122. */
  123. u8 qos_pc; /* priority class of queue */
  124. u16 vid; /* default VLAN ID of queue */
  125. u16 count; /* amount of descriptors */
  126. u16 next_to_alloc;
  127. u16 next_to_use;
  128. u16 next_to_clean;
  129. struct fm10k_queue_stats stats;
  130. struct u64_stats_sync syncp;
  131. union {
  132. /* Tx */
  133. struct fm10k_tx_queue_stats tx_stats;
  134. /* Rx */
  135. struct {
  136. struct fm10k_rx_queue_stats rx_stats;
  137. struct sk_buff *skb;
  138. };
  139. };
  140. } ____cacheline_internodealigned_in_smp;
  141. struct fm10k_ring_container {
  142. struct fm10k_ring *ring; /* pointer to linked list of rings */
  143. unsigned int total_bytes; /* total bytes processed this int */
  144. unsigned int total_packets; /* total packets processed this int */
  145. u16 work_limit; /* total work allowed per interrupt */
  146. u16 itr; /* interrupt throttle rate value */
  147. u8 itr_scale; /* ITR adjustment based on PCI speed */
  148. u8 count; /* total number of rings in vector */
  149. };
  150. #define FM10K_ITR_MAX 0x0FFF /* maximum value for ITR */
  151. #define FM10K_ITR_10K 100 /* 100us */
  152. #define FM10K_ITR_20K 50 /* 50us */
  153. #define FM10K_ITR_40K 25 /* 25us */
  154. #define FM10K_ITR_ADAPTIVE 0x8000 /* adaptive interrupt moderation flag */
  155. #define ITR_IS_ADAPTIVE(itr) (!!(itr & FM10K_ITR_ADAPTIVE))
  156. #define FM10K_TX_ITR_DEFAULT FM10K_ITR_40K
  157. #define FM10K_RX_ITR_DEFAULT FM10K_ITR_20K
  158. #define FM10K_ITR_ENABLE (FM10K_ITR_AUTOMASK | FM10K_ITR_MASK_CLEAR)
  159. static inline struct netdev_queue *txring_txq(const struct fm10k_ring *ring)
  160. {
  161. return &ring->netdev->_tx[ring->queue_index];
  162. }
  163. /* iterator for handling rings in ring container */
  164. #define fm10k_for_each_ring(pos, head) \
  165. for (pos = &(head).ring[(head).count]; (--pos) >= (head).ring;)
  166. #define MAX_Q_VECTORS 256
  167. #define MIN_Q_VECTORS 1
  168. enum fm10k_non_q_vectors {
  169. FM10K_MBX_VECTOR,
  170. #define NON_Q_VECTORS_VF NON_Q_VECTORS_PF
  171. NON_Q_VECTORS_PF
  172. };
  173. #define NON_Q_VECTORS(hw) (((hw)->mac.type == fm10k_mac_pf) ? \
  174. NON_Q_VECTORS_PF : \
  175. NON_Q_VECTORS_VF)
  176. #define MIN_MSIX_COUNT(hw) (MIN_Q_VECTORS + NON_Q_VECTORS(hw))
  177. struct fm10k_q_vector {
  178. struct fm10k_intfc *interface;
  179. u32 __iomem *itr; /* pointer to ITR register for this vector */
  180. u16 v_idx; /* index of q_vector within interface array */
  181. struct fm10k_ring_container rx, tx;
  182. struct napi_struct napi;
  183. cpumask_t affinity_mask;
  184. char name[IFNAMSIZ + 9];
  185. #ifdef CONFIG_DEBUG_FS
  186. struct dentry *dbg_q_vector;
  187. #endif /* CONFIG_DEBUG_FS */
  188. struct rcu_head rcu; /* to avoid race with update stats on free */
  189. /* for dynamic allocation of rings associated with this q_vector */
  190. struct fm10k_ring ring[0] ____cacheline_internodealigned_in_smp;
  191. };
  192. enum fm10k_ring_f_enum {
  193. RING_F_RSS,
  194. RING_F_QOS,
  195. RING_F_ARRAY_SIZE /* must be last in enum set */
  196. };
  197. struct fm10k_ring_feature {
  198. u16 limit; /* upper limit on feature indices */
  199. u16 indices; /* current value of indices */
  200. u16 mask; /* Mask used for feature to ring mapping */
  201. u16 offset; /* offset to start of feature */
  202. };
  203. struct fm10k_iov_data {
  204. unsigned int num_vfs;
  205. unsigned int next_vf_mbx;
  206. struct rcu_head rcu;
  207. struct fm10k_vf_info vf_info[0];
  208. };
  209. #define fm10k_vxlan_port_for_each(vp, intfc) \
  210. list_for_each_entry(vp, &(intfc)->vxlan_port, list)
  211. struct fm10k_vxlan_port {
  212. struct list_head list;
  213. sa_family_t sa_family;
  214. __be16 port;
  215. };
  216. /* one work queue for entire driver */
  217. extern struct workqueue_struct *fm10k_workqueue;
  218. struct fm10k_intfc {
  219. unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
  220. struct net_device *netdev;
  221. struct fm10k_l2_accel *l2_accel; /* pointer to L2 acceleration list */
  222. struct pci_dev *pdev;
  223. unsigned long state;
  224. u32 flags;
  225. #define FM10K_FLAG_RESET_REQUESTED (u32)(1 << 0)
  226. #define FM10K_FLAG_RSS_FIELD_IPV4_UDP (u32)(1 << 1)
  227. #define FM10K_FLAG_RSS_FIELD_IPV6_UDP (u32)(1 << 2)
  228. #define FM10K_FLAG_RX_TS_ENABLED (u32)(1 << 3)
  229. #define FM10K_FLAG_SWPRI_CONFIG (u32)(1 << 4)
  230. #define FM10K_FLAG_DEBUG_STATS (u32)(1 << 5)
  231. int xcast_mode;
  232. /* Tx fast path data */
  233. int num_tx_queues;
  234. u16 tx_itr;
  235. /* Rx fast path data */
  236. int num_rx_queues;
  237. u16 rx_itr;
  238. /* TX */
  239. struct fm10k_ring *tx_ring[MAX_QUEUES] ____cacheline_aligned_in_smp;
  240. u64 restart_queue;
  241. u64 tx_busy;
  242. u64 tx_csum_errors;
  243. u64 alloc_failed;
  244. u64 rx_csum_errors;
  245. u64 tx_bytes_nic;
  246. u64 tx_packets_nic;
  247. u64 rx_bytes_nic;
  248. u64 rx_packets_nic;
  249. u64 rx_drops_nic;
  250. u64 rx_overrun_pf;
  251. u64 rx_overrun_vf;
  252. /* Debug Statistics */
  253. u64 hw_sm_mbx_full;
  254. u64 hw_csum_tx_good;
  255. u64 hw_csum_rx_good;
  256. u64 rx_switch_errors;
  257. u64 rx_drops;
  258. u64 rx_pp_errors;
  259. u64 rx_link_errors;
  260. u64 rx_length_errors;
  261. u32 tx_timeout_count;
  262. /* RX */
  263. struct fm10k_ring *rx_ring[MAX_QUEUES];
  264. /* Queueing vectors */
  265. struct fm10k_q_vector *q_vector[MAX_Q_VECTORS];
  266. struct msix_entry *msix_entries;
  267. int num_q_vectors; /* current number of q_vectors for device */
  268. struct fm10k_ring_feature ring_feature[RING_F_ARRAY_SIZE];
  269. /* SR-IOV information management structure */
  270. struct fm10k_iov_data *iov_data;
  271. struct fm10k_hw_stats stats;
  272. struct fm10k_hw hw;
  273. u32 __iomem *uc_addr;
  274. u32 __iomem *sw_addr;
  275. u16 msg_enable;
  276. u16 tx_ring_count;
  277. u16 rx_ring_count;
  278. struct timer_list service_timer;
  279. struct work_struct service_task;
  280. unsigned long next_stats_update;
  281. unsigned long next_tx_hang_check;
  282. unsigned long last_reset;
  283. unsigned long link_down_event;
  284. bool host_ready;
  285. u32 reta[FM10K_RETA_SIZE];
  286. u32 rssrk[FM10K_RSSRK_SIZE];
  287. /* VXLAN port tracking information */
  288. struct list_head vxlan_port;
  289. #ifdef CONFIG_DEBUG_FS
  290. struct dentry *dbg_intfc;
  291. #endif /* CONFIG_DEBUG_FS */
  292. struct ptp_clock_info ptp_caps;
  293. struct ptp_clock *ptp_clock;
  294. struct sk_buff_head ts_tx_skb_queue;
  295. u32 tx_hwtstamp_timeouts;
  296. struct hwtstamp_config ts_config;
  297. /* We are unable to actually adjust the clock beyond the frequency
  298. * value. Once the clock is started there is no resetting it. As
  299. * such we maintain a separate offset from the actual hardware clock
  300. * to allow for offset adjustment.
  301. */
  302. s64 ptp_adjust;
  303. rwlock_t systime_lock;
  304. #ifdef CONFIG_DCB
  305. u8 pfc_en;
  306. #endif
  307. u8 rx_pause;
  308. /* GLORT resources in use by PF */
  309. u16 glort;
  310. u16 glort_count;
  311. /* VLAN ID for updating multicast/unicast lists */
  312. u16 vid;
  313. };
  314. enum fm10k_state_t {
  315. __FM10K_RESETTING,
  316. __FM10K_DOWN,
  317. __FM10K_SERVICE_SCHED,
  318. __FM10K_SERVICE_DISABLE,
  319. __FM10K_MBX_LOCK,
  320. __FM10K_LINK_DOWN,
  321. };
  322. static inline void fm10k_mbx_lock(struct fm10k_intfc *interface)
  323. {
  324. /* busy loop if we cannot obtain the lock as some calls
  325. * such as ndo_set_rx_mode may be made in atomic context
  326. */
  327. while (test_and_set_bit(__FM10K_MBX_LOCK, &interface->state))
  328. udelay(20);
  329. }
  330. static inline void fm10k_mbx_unlock(struct fm10k_intfc *interface)
  331. {
  332. /* flush memory to make sure state is correct */
  333. smp_mb__before_atomic();
  334. clear_bit(__FM10K_MBX_LOCK, &interface->state);
  335. }
  336. static inline int fm10k_mbx_trylock(struct fm10k_intfc *interface)
  337. {
  338. return !test_and_set_bit(__FM10K_MBX_LOCK, &interface->state);
  339. }
  340. /* fm10k_test_staterr - test bits in Rx descriptor status and error fields */
  341. static inline __le32 fm10k_test_staterr(union fm10k_rx_desc *rx_desc,
  342. const u32 stat_err_bits)
  343. {
  344. return rx_desc->d.staterr & cpu_to_le32(stat_err_bits);
  345. }
  346. /* fm10k_desc_unused - calculate if we have unused descriptors */
  347. static inline u16 fm10k_desc_unused(struct fm10k_ring *ring)
  348. {
  349. s16 unused = ring->next_to_clean - ring->next_to_use - 1;
  350. return likely(unused < 0) ? unused + ring->count : unused;
  351. }
  352. #define FM10K_TX_DESC(R, i) \
  353. (&(((struct fm10k_tx_desc *)((R)->desc))[i]))
  354. #define FM10K_RX_DESC(R, i) \
  355. (&(((union fm10k_rx_desc *)((R)->desc))[i]))
  356. #define FM10K_MAX_TXD_PWR 14
  357. #define FM10K_MAX_DATA_PER_TXD BIT(FM10K_MAX_TXD_PWR)
  358. /* Tx Descriptors needed, worst case */
  359. #define TXD_USE_COUNT(S) DIV_ROUND_UP((S), FM10K_MAX_DATA_PER_TXD)
  360. #define DESC_NEEDED (MAX_SKB_FRAGS + 4)
  361. enum fm10k_tx_flags {
  362. /* Tx offload flags */
  363. FM10K_TX_FLAGS_CSUM = 0x01,
  364. };
  365. /* This structure is stored as little endian values as that is the native
  366. * format of the Rx descriptor. The ordering of these fields is reversed
  367. * from the actual ftag header to allow for a single bswap to take care
  368. * of placing all of the values in network order
  369. */
  370. union fm10k_ftag_info {
  371. __le64 ftag;
  372. struct {
  373. /* dglort and sglort combined into a single 32bit desc read */
  374. __le32 glort;
  375. /* upper 16 bits of VLAN are reserved 0 for swpri_type_user */
  376. __le32 vlan;
  377. } d;
  378. struct {
  379. __le16 dglort;
  380. __le16 sglort;
  381. __le16 vlan;
  382. __le16 swpri_type_user;
  383. } w;
  384. };
  385. struct fm10k_cb {
  386. union {
  387. __le64 tstamp;
  388. unsigned long ts_tx_timeout;
  389. };
  390. union fm10k_ftag_info fi;
  391. };
  392. #define FM10K_CB(skb) ((struct fm10k_cb *)(skb)->cb)
  393. /* main */
  394. extern char fm10k_driver_name[];
  395. extern const char fm10k_driver_version[];
  396. int fm10k_init_queueing_scheme(struct fm10k_intfc *interface);
  397. void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface);
  398. __be16 fm10k_tx_encap_offload(struct sk_buff *skb);
  399. netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb,
  400. struct fm10k_ring *tx_ring);
  401. void fm10k_tx_timeout_reset(struct fm10k_intfc *interface);
  402. bool fm10k_check_tx_hang(struct fm10k_ring *tx_ring);
  403. void fm10k_alloc_rx_buffers(struct fm10k_ring *rx_ring, u16 cleaned_count);
  404. /* PCI */
  405. void fm10k_mbx_free_irq(struct fm10k_intfc *);
  406. int fm10k_mbx_request_irq(struct fm10k_intfc *);
  407. void fm10k_qv_free_irq(struct fm10k_intfc *interface);
  408. int fm10k_qv_request_irq(struct fm10k_intfc *interface);
  409. int fm10k_register_pci_driver(void);
  410. void fm10k_unregister_pci_driver(void);
  411. void fm10k_up(struct fm10k_intfc *interface);
  412. void fm10k_down(struct fm10k_intfc *interface);
  413. void fm10k_update_stats(struct fm10k_intfc *interface);
  414. void fm10k_service_event_schedule(struct fm10k_intfc *interface);
  415. void fm10k_update_rx_drop_en(struct fm10k_intfc *interface);
  416. #ifdef CONFIG_NET_POLL_CONTROLLER
  417. void fm10k_netpoll(struct net_device *netdev);
  418. #endif
  419. /* Netdev */
  420. struct net_device *fm10k_alloc_netdev(const struct fm10k_info *info);
  421. int fm10k_setup_rx_resources(struct fm10k_ring *);
  422. int fm10k_setup_tx_resources(struct fm10k_ring *);
  423. void fm10k_free_rx_resources(struct fm10k_ring *);
  424. void fm10k_free_tx_resources(struct fm10k_ring *);
  425. void fm10k_clean_all_rx_rings(struct fm10k_intfc *);
  426. void fm10k_clean_all_tx_rings(struct fm10k_intfc *);
  427. void fm10k_unmap_and_free_tx_resource(struct fm10k_ring *,
  428. struct fm10k_tx_buffer *);
  429. void fm10k_restore_rx_state(struct fm10k_intfc *);
  430. void fm10k_reset_rx_state(struct fm10k_intfc *);
  431. int fm10k_setup_tc(struct net_device *dev, u8 tc);
  432. int fm10k_open(struct net_device *netdev);
  433. int fm10k_close(struct net_device *netdev);
  434. /* Ethtool */
  435. void fm10k_set_ethtool_ops(struct net_device *dev);
  436. /* IOV */
  437. s32 fm10k_iov_event(struct fm10k_intfc *interface);
  438. s32 fm10k_iov_mbx(struct fm10k_intfc *interface);
  439. void fm10k_iov_suspend(struct pci_dev *pdev);
  440. int fm10k_iov_resume(struct pci_dev *pdev);
  441. void fm10k_iov_disable(struct pci_dev *pdev);
  442. int fm10k_iov_configure(struct pci_dev *pdev, int num_vfs);
  443. s32 fm10k_iov_update_pvid(struct fm10k_intfc *interface, u16 glort, u16 pvid);
  444. int fm10k_ndo_set_vf_mac(struct net_device *netdev, int vf_idx, u8 *mac);
  445. int fm10k_ndo_set_vf_vlan(struct net_device *netdev,
  446. int vf_idx, u16 vid, u8 qos);
  447. int fm10k_ndo_set_vf_bw(struct net_device *netdev, int vf_idx, int rate,
  448. int unused);
  449. int fm10k_ndo_get_vf_config(struct net_device *netdev,
  450. int vf_idx, struct ifla_vf_info *ivi);
  451. /* DebugFS */
  452. #ifdef CONFIG_DEBUG_FS
  453. void fm10k_dbg_q_vector_init(struct fm10k_q_vector *q_vector);
  454. void fm10k_dbg_q_vector_exit(struct fm10k_q_vector *q_vector);
  455. void fm10k_dbg_intfc_init(struct fm10k_intfc *interface);
  456. void fm10k_dbg_intfc_exit(struct fm10k_intfc *interface);
  457. void fm10k_dbg_init(void);
  458. void fm10k_dbg_exit(void);
  459. #else
  460. static inline void fm10k_dbg_q_vector_init(struct fm10k_q_vector *q_vector) {}
  461. static inline void fm10k_dbg_q_vector_exit(struct fm10k_q_vector *q_vector) {}
  462. static inline void fm10k_dbg_intfc_init(struct fm10k_intfc *interface) {}
  463. static inline void fm10k_dbg_intfc_exit(struct fm10k_intfc *interface) {}
  464. static inline void fm10k_dbg_init(void) {}
  465. static inline void fm10k_dbg_exit(void) {}
  466. #endif /* CONFIG_DEBUG_FS */
  467. /* Time Stamping */
  468. void fm10k_systime_to_hwtstamp(struct fm10k_intfc *interface,
  469. struct skb_shared_hwtstamps *hwtstamp,
  470. u64 systime);
  471. void fm10k_ts_tx_enqueue(struct fm10k_intfc *interface, struct sk_buff *skb);
  472. void fm10k_ts_tx_hwtstamp(struct fm10k_intfc *interface, __le16 dglort,
  473. u64 systime);
  474. void fm10k_ts_reset(struct fm10k_intfc *interface);
  475. void fm10k_ts_init(struct fm10k_intfc *interface);
  476. void fm10k_ts_tx_subtask(struct fm10k_intfc *interface);
  477. void fm10k_ptp_register(struct fm10k_intfc *interface);
  478. void fm10k_ptp_unregister(struct fm10k_intfc *interface);
  479. int fm10k_get_ts_config(struct net_device *netdev, struct ifreq *ifr);
  480. int fm10k_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
  481. /* DCB */
  482. #ifdef CONFIG_DCB
  483. void fm10k_dcbnl_set_ops(struct net_device *dev);
  484. #else
  485. static inline void fm10k_dcbnl_set_ops(struct net_device *dev) {}
  486. #endif
  487. #endif /* _FM10K_H_ */