nic.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. /*
  2. * Copyright (C) 2015 Cavium, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of version 2 of the GNU General Public License
  6. * as published by the Free Software Foundation.
  7. */
  8. #ifndef NIC_H
  9. #define NIC_H
  10. #include <linux/netdevice.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/pci.h>
  13. #include "thunder_bgx.h"
  14. /* PCI device IDs */
  15. #define PCI_DEVICE_ID_THUNDER_NIC_PF 0xA01E
  16. #define PCI_DEVICE_ID_THUNDER_PASS1_NIC_VF 0x0011
  17. #define PCI_DEVICE_ID_THUNDER_NIC_VF 0xA034
  18. #define PCI_DEVICE_ID_THUNDER_BGX 0xA026
  19. /* Subsystem device IDs */
  20. #define PCI_SUBSYS_DEVID_88XX_NIC_PF 0xA11E
  21. #define PCI_SUBSYS_DEVID_81XX_NIC_PF 0xA21E
  22. #define PCI_SUBSYS_DEVID_83XX_NIC_PF 0xA31E
  23. #define PCI_SUBSYS_DEVID_88XX_PASS1_NIC_VF 0xA11E
  24. #define PCI_SUBSYS_DEVID_88XX_NIC_VF 0xA134
  25. #define PCI_SUBSYS_DEVID_81XX_NIC_VF 0xA234
  26. #define PCI_SUBSYS_DEVID_83XX_NIC_VF 0xA334
  27. /* PCI BAR nos */
  28. #define PCI_CFG_REG_BAR_NUM 0
  29. #define PCI_MSIX_REG_BAR_NUM 4
  30. /* NIC SRIOV VF count */
  31. #define MAX_NUM_VFS_SUPPORTED 128
  32. #define DEFAULT_NUM_VF_ENABLED 8
  33. #define NIC_TNS_BYPASS_MODE 0
  34. #define NIC_TNS_MODE 1
  35. /* NIC priv flags */
  36. #define NIC_SRIOV_ENABLED BIT(0)
  37. /* Min/Max packet size */
  38. #define NIC_HW_MIN_FRS 64
  39. #define NIC_HW_MAX_FRS 9190 /* Excluding L2 header and FCS */
  40. /* Max pkinds */
  41. #define NIC_MAX_PKIND 16
  42. /* Max when CPI_ALG is IP diffserv */
  43. #define NIC_MAX_CPI_PER_LMAC 64
  44. /* NIC VF Interrupts */
  45. #define NICVF_INTR_CQ 0
  46. #define NICVF_INTR_SQ 1
  47. #define NICVF_INTR_RBDR 2
  48. #define NICVF_INTR_PKT_DROP 3
  49. #define NICVF_INTR_TCP_TIMER 4
  50. #define NICVF_INTR_MBOX 5
  51. #define NICVF_INTR_QS_ERR 6
  52. #define NICVF_INTR_CQ_SHIFT 0
  53. #define NICVF_INTR_SQ_SHIFT 8
  54. #define NICVF_INTR_RBDR_SHIFT 16
  55. #define NICVF_INTR_PKT_DROP_SHIFT 20
  56. #define NICVF_INTR_TCP_TIMER_SHIFT 21
  57. #define NICVF_INTR_MBOX_SHIFT 22
  58. #define NICVF_INTR_QS_ERR_SHIFT 23
  59. #define NICVF_INTR_CQ_MASK (0xFF << NICVF_INTR_CQ_SHIFT)
  60. #define NICVF_INTR_SQ_MASK (0xFF << NICVF_INTR_SQ_SHIFT)
  61. #define NICVF_INTR_RBDR_MASK (0x03 << NICVF_INTR_RBDR_SHIFT)
  62. #define NICVF_INTR_PKT_DROP_MASK BIT(NICVF_INTR_PKT_DROP_SHIFT)
  63. #define NICVF_INTR_TCP_TIMER_MASK BIT(NICVF_INTR_TCP_TIMER_SHIFT)
  64. #define NICVF_INTR_MBOX_MASK BIT(NICVF_INTR_MBOX_SHIFT)
  65. #define NICVF_INTR_QS_ERR_MASK BIT(NICVF_INTR_QS_ERR_SHIFT)
  66. /* MSI-X interrupts */
  67. #define NIC_PF_MSIX_VECTORS 10
  68. #define NIC_VF_MSIX_VECTORS 20
  69. #define NIC_PF_INTR_ID_ECC0_SBE 0
  70. #define NIC_PF_INTR_ID_ECC0_DBE 1
  71. #define NIC_PF_INTR_ID_ECC1_SBE 2
  72. #define NIC_PF_INTR_ID_ECC1_DBE 3
  73. #define NIC_PF_INTR_ID_ECC2_SBE 4
  74. #define NIC_PF_INTR_ID_ECC2_DBE 5
  75. #define NIC_PF_INTR_ID_ECC3_SBE 6
  76. #define NIC_PF_INTR_ID_ECC3_DBE 7
  77. #define NIC_PF_INTR_ID_MBOX0 8
  78. #define NIC_PF_INTR_ID_MBOX1 9
  79. /* Minimum FIFO level before all packets for the CQ are dropped
  80. *
  81. * This value ensures that once a packet has been "accepted"
  82. * for reception it will not get dropped due to non-availability
  83. * of CQ descriptor. An errata in HW mandates this value to be
  84. * atleast 0x100.
  85. */
  86. #define NICPF_CQM_MIN_DROP_LEVEL 0x100
  87. /* Global timer for CQ timer thresh interrupts
  88. * Calculated for SCLK of 700Mhz
  89. * value written should be a 1/16th of what is expected
  90. *
  91. * 1 tick per 0.025usec
  92. */
  93. #define NICPF_CLK_PER_INT_TICK 1
  94. /* Time to wait before we decide that a SQ is stuck.
  95. *
  96. * Since both pkt rx and tx notifications are done with same CQ,
  97. * when packets are being received at very high rate (eg: L2 forwarding)
  98. * then freeing transmitted skbs will be delayed and watchdog
  99. * will kick in, resetting interface. Hence keeping this value high.
  100. */
  101. #define NICVF_TX_TIMEOUT (50 * HZ)
  102. struct nicvf_cq_poll {
  103. struct nicvf *nicvf;
  104. u8 cq_idx; /* Completion queue index */
  105. struct napi_struct napi;
  106. };
  107. #define NIC_MAX_RSS_HASH_BITS 8
  108. #define NIC_MAX_RSS_IDR_TBL_SIZE (1 << NIC_MAX_RSS_HASH_BITS)
  109. #define RSS_HASH_KEY_SIZE 5 /* 320 bit key */
  110. struct nicvf_rss_info {
  111. bool enable;
  112. #define RSS_L2_EXTENDED_HASH_ENA BIT(0)
  113. #define RSS_IP_HASH_ENA BIT(1)
  114. #define RSS_TCP_HASH_ENA BIT(2)
  115. #define RSS_TCP_SYN_DIS BIT(3)
  116. #define RSS_UDP_HASH_ENA BIT(4)
  117. #define RSS_L4_EXTENDED_HASH_ENA BIT(5)
  118. #define RSS_ROCE_ENA BIT(6)
  119. #define RSS_L3_BI_DIRECTION_ENA BIT(7)
  120. #define RSS_L4_BI_DIRECTION_ENA BIT(8)
  121. u64 cfg;
  122. u8 hash_bits;
  123. u16 rss_size;
  124. u8 ind_tbl[NIC_MAX_RSS_IDR_TBL_SIZE];
  125. u64 key[RSS_HASH_KEY_SIZE];
  126. } ____cacheline_aligned_in_smp;
  127. struct nicvf_pfc {
  128. u8 autoneg;
  129. u8 fc_rx;
  130. u8 fc_tx;
  131. };
  132. enum rx_stats_reg_offset {
  133. RX_OCTS = 0x0,
  134. RX_UCAST = 0x1,
  135. RX_BCAST = 0x2,
  136. RX_MCAST = 0x3,
  137. RX_RED = 0x4,
  138. RX_RED_OCTS = 0x5,
  139. RX_ORUN = 0x6,
  140. RX_ORUN_OCTS = 0x7,
  141. RX_FCS = 0x8,
  142. RX_L2ERR = 0x9,
  143. RX_DRP_BCAST = 0xa,
  144. RX_DRP_MCAST = 0xb,
  145. RX_DRP_L3BCAST = 0xc,
  146. RX_DRP_L3MCAST = 0xd,
  147. RX_STATS_ENUM_LAST,
  148. };
  149. enum tx_stats_reg_offset {
  150. TX_OCTS = 0x0,
  151. TX_UCAST = 0x1,
  152. TX_BCAST = 0x2,
  153. TX_MCAST = 0x3,
  154. TX_DROP = 0x4,
  155. TX_STATS_ENUM_LAST,
  156. };
  157. struct nicvf_hw_stats {
  158. u64 rx_bytes;
  159. u64 rx_frames;
  160. u64 rx_ucast_frames;
  161. u64 rx_bcast_frames;
  162. u64 rx_mcast_frames;
  163. u64 rx_drops;
  164. u64 rx_drop_red;
  165. u64 rx_drop_red_bytes;
  166. u64 rx_drop_overrun;
  167. u64 rx_drop_overrun_bytes;
  168. u64 rx_drop_bcast;
  169. u64 rx_drop_mcast;
  170. u64 rx_drop_l3_bcast;
  171. u64 rx_drop_l3_mcast;
  172. u64 rx_fcs_errors;
  173. u64 rx_l2_errors;
  174. u64 tx_bytes;
  175. u64 tx_frames;
  176. u64 tx_ucast_frames;
  177. u64 tx_bcast_frames;
  178. u64 tx_mcast_frames;
  179. u64 tx_drops;
  180. };
  181. struct nicvf_drv_stats {
  182. /* CQE Rx errs */
  183. u64 rx_bgx_truncated_pkts;
  184. u64 rx_jabber_errs;
  185. u64 rx_fcs_errs;
  186. u64 rx_bgx_errs;
  187. u64 rx_prel2_errs;
  188. u64 rx_l2_hdr_malformed;
  189. u64 rx_oversize;
  190. u64 rx_undersize;
  191. u64 rx_l2_len_mismatch;
  192. u64 rx_l2_pclp;
  193. u64 rx_ip_ver_errs;
  194. u64 rx_ip_csum_errs;
  195. u64 rx_ip_hdr_malformed;
  196. u64 rx_ip_payload_malformed;
  197. u64 rx_ip_ttl_errs;
  198. u64 rx_l3_pclp;
  199. u64 rx_l4_malformed;
  200. u64 rx_l4_csum_errs;
  201. u64 rx_udp_len_errs;
  202. u64 rx_l4_port_errs;
  203. u64 rx_tcp_flag_errs;
  204. u64 rx_tcp_offset_errs;
  205. u64 rx_l4_pclp;
  206. u64 rx_truncated_pkts;
  207. /* CQE Tx errs */
  208. u64 tx_desc_fault;
  209. u64 tx_hdr_cons_err;
  210. u64 tx_subdesc_err;
  211. u64 tx_max_size_exceeded;
  212. u64 tx_imm_size_oflow;
  213. u64 tx_data_seq_err;
  214. u64 tx_mem_seq_err;
  215. u64 tx_lock_viol;
  216. u64 tx_data_fault;
  217. u64 tx_tstmp_conflict;
  218. u64 tx_tstmp_timeout;
  219. u64 tx_mem_fault;
  220. u64 tx_csum_overlap;
  221. u64 tx_csum_overflow;
  222. /* driver debug stats */
  223. u64 rcv_buffer_alloc_failures;
  224. u64 tx_tso;
  225. u64 tx_timeout;
  226. u64 txq_stop;
  227. u64 txq_wake;
  228. struct u64_stats_sync syncp;
  229. };
  230. struct nicvf {
  231. struct nicvf *pnicvf;
  232. struct net_device *netdev;
  233. struct pci_dev *pdev;
  234. void __iomem *reg_base;
  235. #define MAX_QUEUES_PER_QSET 8
  236. struct queue_set *qs;
  237. struct nicvf_cq_poll *napi[8];
  238. u8 vf_id;
  239. u8 sqs_id;
  240. bool sqs_mode;
  241. bool hw_tso;
  242. bool t88;
  243. /* Receive buffer alloc */
  244. u32 rb_page_offset;
  245. u16 rb_pageref;
  246. bool rb_alloc_fail;
  247. bool rb_work_scheduled;
  248. struct page *rb_page;
  249. struct delayed_work rbdr_work;
  250. struct tasklet_struct rbdr_task;
  251. /* Secondary Qset */
  252. u8 sqs_count;
  253. #define MAX_SQS_PER_VF_SINGLE_NODE 5
  254. #define MAX_SQS_PER_VF 11
  255. struct nicvf *snicvf[MAX_SQS_PER_VF];
  256. /* Queue count */
  257. u8 rx_queues;
  258. u8 tx_queues;
  259. u8 max_queues;
  260. u8 node;
  261. u8 cpi_alg;
  262. bool link_up;
  263. u8 mac_type;
  264. u8 duplex;
  265. u32 speed;
  266. bool tns_mode;
  267. bool loopback_supported;
  268. struct nicvf_rss_info rss_info;
  269. struct nicvf_pfc pfc;
  270. struct tasklet_struct qs_err_task;
  271. struct work_struct reset_task;
  272. /* Interrupt coalescing settings */
  273. u32 cq_coalesce_usecs;
  274. u32 msg_enable;
  275. /* Stats */
  276. struct nicvf_hw_stats hw_stats;
  277. struct nicvf_drv_stats __percpu *drv_stats;
  278. struct bgx_stats bgx_stats;
  279. /* MSI-X */
  280. bool msix_enabled;
  281. u8 num_vec;
  282. struct msix_entry msix_entries[NIC_VF_MSIX_VECTORS];
  283. char irq_name[NIC_VF_MSIX_VECTORS][IFNAMSIZ + 15];
  284. bool irq_allocated[NIC_VF_MSIX_VECTORS];
  285. cpumask_var_t affinity_mask[NIC_VF_MSIX_VECTORS];
  286. /* VF <-> PF mailbox communication */
  287. bool pf_acked;
  288. bool pf_nacked;
  289. bool set_mac_pending;
  290. } ____cacheline_aligned_in_smp;
  291. /* PF <--> VF Mailbox communication
  292. * Eight 64bit registers are shared between PF and VF.
  293. * Separate set for each VF.
  294. * Writing '1' into last register mbx7 means end of message.
  295. */
  296. /* PF <--> VF mailbox communication */
  297. #define NIC_PF_VF_MAILBOX_SIZE 2
  298. #define NIC_MBOX_MSG_TIMEOUT 2000 /* ms */
  299. /* Mailbox message types */
  300. #define NIC_MBOX_MSG_READY 0x01 /* Is PF ready to rcv msgs */
  301. #define NIC_MBOX_MSG_ACK 0x02 /* ACK the message received */
  302. #define NIC_MBOX_MSG_NACK 0x03 /* NACK the message received */
  303. #define NIC_MBOX_MSG_QS_CFG 0x04 /* Configure Qset */
  304. #define NIC_MBOX_MSG_RQ_CFG 0x05 /* Configure receive queue */
  305. #define NIC_MBOX_MSG_SQ_CFG 0x06 /* Configure Send queue */
  306. #define NIC_MBOX_MSG_RQ_DROP_CFG 0x07 /* Configure receive queue */
  307. #define NIC_MBOX_MSG_SET_MAC 0x08 /* Add MAC ID to DMAC filter */
  308. #define NIC_MBOX_MSG_SET_MAX_FRS 0x09 /* Set max frame size */
  309. #define NIC_MBOX_MSG_CPI_CFG 0x0A /* Config CPI, RSSI */
  310. #define NIC_MBOX_MSG_RSS_SIZE 0x0B /* Get RSS indir_tbl size */
  311. #define NIC_MBOX_MSG_RSS_CFG 0x0C /* Config RSS table */
  312. #define NIC_MBOX_MSG_RSS_CFG_CONT 0x0D /* RSS config continuation */
  313. #define NIC_MBOX_MSG_RQ_BP_CFG 0x0E /* RQ backpressure config */
  314. #define NIC_MBOX_MSG_RQ_SW_SYNC 0x0F /* Flush inflight pkts to RQ */
  315. #define NIC_MBOX_MSG_BGX_STATS 0x10 /* Get stats from BGX */
  316. #define NIC_MBOX_MSG_BGX_LINK_CHANGE 0x11 /* BGX:LMAC link status */
  317. #define NIC_MBOX_MSG_ALLOC_SQS 0x12 /* Allocate secondary Qset */
  318. #define NIC_MBOX_MSG_NICVF_PTR 0x13 /* Send nicvf ptr to PF */
  319. #define NIC_MBOX_MSG_PNICVF_PTR 0x14 /* Get primary qset nicvf ptr */
  320. #define NIC_MBOX_MSG_SNICVF_PTR 0x15 /* Send sqet nicvf ptr to PVF */
  321. #define NIC_MBOX_MSG_LOOPBACK 0x16 /* Set interface in loopback */
  322. #define NIC_MBOX_MSG_RESET_STAT_COUNTER 0x17 /* Reset statistics counters */
  323. #define NIC_MBOX_MSG_PFC 0x18 /* Pause frame control */
  324. #define NIC_MBOX_MSG_CFG_DONE 0xF0 /* VF configuration done */
  325. #define NIC_MBOX_MSG_SHUTDOWN 0xF1 /* VF is being shutdown */
  326. struct nic_cfg_msg {
  327. u8 msg;
  328. u8 vf_id;
  329. u8 node_id;
  330. u8 tns_mode:1;
  331. u8 sqs_mode:1;
  332. u8 loopback_supported:1;
  333. u8 mac_addr[ETH_ALEN];
  334. };
  335. /* Qset configuration */
  336. struct qs_cfg_msg {
  337. u8 msg;
  338. u8 num;
  339. u8 sqs_count;
  340. u64 cfg;
  341. };
  342. /* Receive queue configuration */
  343. struct rq_cfg_msg {
  344. u8 msg;
  345. u8 qs_num;
  346. u8 rq_num;
  347. u64 cfg;
  348. };
  349. /* Send queue configuration */
  350. struct sq_cfg_msg {
  351. u8 msg;
  352. u8 qs_num;
  353. u8 sq_num;
  354. bool sqs_mode;
  355. u64 cfg;
  356. };
  357. /* Set VF's MAC address */
  358. struct set_mac_msg {
  359. u8 msg;
  360. u8 vf_id;
  361. u8 mac_addr[ETH_ALEN];
  362. };
  363. /* Set Maximum frame size */
  364. struct set_frs_msg {
  365. u8 msg;
  366. u8 vf_id;
  367. u16 max_frs;
  368. };
  369. /* Set CPI algorithm type */
  370. struct cpi_cfg_msg {
  371. u8 msg;
  372. u8 vf_id;
  373. u8 rq_cnt;
  374. u8 cpi_alg;
  375. };
  376. /* Get RSS table size */
  377. struct rss_sz_msg {
  378. u8 msg;
  379. u8 vf_id;
  380. u16 ind_tbl_size;
  381. };
  382. /* Set RSS configuration */
  383. struct rss_cfg_msg {
  384. u8 msg;
  385. u8 vf_id;
  386. u8 hash_bits;
  387. u8 tbl_len;
  388. u8 tbl_offset;
  389. #define RSS_IND_TBL_LEN_PER_MBX_MSG 8
  390. u8 ind_tbl[RSS_IND_TBL_LEN_PER_MBX_MSG];
  391. };
  392. struct bgx_stats_msg {
  393. u8 msg;
  394. u8 vf_id;
  395. u8 rx;
  396. u8 idx;
  397. u64 stats;
  398. };
  399. /* Physical interface link status */
  400. struct bgx_link_status {
  401. u8 msg;
  402. u8 mac_type;
  403. u8 link_up;
  404. u8 duplex;
  405. u32 speed;
  406. };
  407. /* Get Extra Qset IDs */
  408. struct sqs_alloc {
  409. u8 msg;
  410. u8 vf_id;
  411. u8 qs_count;
  412. };
  413. struct nicvf_ptr {
  414. u8 msg;
  415. u8 vf_id;
  416. bool sqs_mode;
  417. u8 sqs_id;
  418. u64 nicvf;
  419. };
  420. /* Set interface in loopback mode */
  421. struct set_loopback {
  422. u8 msg;
  423. u8 vf_id;
  424. bool enable;
  425. };
  426. /* Reset statistics counters */
  427. struct reset_stat_cfg {
  428. u8 msg;
  429. /* Bitmap to select NIC_PF_VNIC(vf_id)_RX_STAT(0..13) */
  430. u16 rx_stat_mask;
  431. /* Bitmap to select NIC_PF_VNIC(vf_id)_TX_STAT(0..4) */
  432. u8 tx_stat_mask;
  433. /* Bitmap to select NIC_PF_QS(0..127)_RQ(0..7)_STAT(0..1)
  434. * bit14, bit15 NIC_PF_QS(vf_id)_RQ7_STAT(0..1)
  435. * bit12, bit13 NIC_PF_QS(vf_id)_RQ6_STAT(0..1)
  436. * ..
  437. * bit2, bit3 NIC_PF_QS(vf_id)_RQ1_STAT(0..1)
  438. * bit0, bit1 NIC_PF_QS(vf_id)_RQ0_STAT(0..1)
  439. */
  440. u16 rq_stat_mask;
  441. /* Bitmap to select NIC_PF_QS(0..127)_SQ(0..7)_STAT(0..1)
  442. * bit14, bit15 NIC_PF_QS(vf_id)_SQ7_STAT(0..1)
  443. * bit12, bit13 NIC_PF_QS(vf_id)_SQ6_STAT(0..1)
  444. * ..
  445. * bit2, bit3 NIC_PF_QS(vf_id)_SQ1_STAT(0..1)
  446. * bit0, bit1 NIC_PF_QS(vf_id)_SQ0_STAT(0..1)
  447. */
  448. u16 sq_stat_mask;
  449. };
  450. struct pfc {
  451. u8 msg;
  452. u8 get; /* Get or set PFC settings */
  453. u8 autoneg;
  454. u8 fc_rx;
  455. u8 fc_tx;
  456. };
  457. /* 128 bit shared memory between PF and each VF */
  458. union nic_mbx {
  459. struct { u8 msg; } msg;
  460. struct nic_cfg_msg nic_cfg;
  461. struct qs_cfg_msg qs;
  462. struct rq_cfg_msg rq;
  463. struct sq_cfg_msg sq;
  464. struct set_mac_msg mac;
  465. struct set_frs_msg frs;
  466. struct cpi_cfg_msg cpi_cfg;
  467. struct rss_sz_msg rss_size;
  468. struct rss_cfg_msg rss_cfg;
  469. struct bgx_stats_msg bgx_stats;
  470. struct bgx_link_status link_status;
  471. struct sqs_alloc sqs_alloc;
  472. struct nicvf_ptr nicvf;
  473. struct set_loopback lbk;
  474. struct reset_stat_cfg reset_stat;
  475. struct pfc pfc;
  476. };
  477. #define NIC_NODE_ID_MASK 0x03
  478. #define NIC_NODE_ID_SHIFT 44
  479. static inline int nic_get_node_id(struct pci_dev *pdev)
  480. {
  481. u64 addr = pci_resource_start(pdev, PCI_CFG_REG_BAR_NUM);
  482. return ((addr >> NIC_NODE_ID_SHIFT) & NIC_NODE_ID_MASK);
  483. }
  484. static inline bool pass1_silicon(struct pci_dev *pdev)
  485. {
  486. return (pdev->revision < 8) &&
  487. (pdev->subsystem_device == PCI_SUBSYS_DEVID_88XX_NIC_PF);
  488. }
  489. static inline bool pass2_silicon(struct pci_dev *pdev)
  490. {
  491. return (pdev->revision >= 8) &&
  492. (pdev->subsystem_device == PCI_SUBSYS_DEVID_88XX_NIC_PF);
  493. }
  494. int nicvf_set_real_num_queues(struct net_device *netdev,
  495. int tx_queues, int rx_queues);
  496. int nicvf_open(struct net_device *netdev);
  497. int nicvf_stop(struct net_device *netdev);
  498. int nicvf_send_msg_to_pf(struct nicvf *vf, union nic_mbx *mbx);
  499. void nicvf_config_rss(struct nicvf *nic);
  500. void nicvf_set_rss_key(struct nicvf *nic);
  501. void nicvf_set_ethtool_ops(struct net_device *netdev);
  502. void nicvf_update_stats(struct nicvf *nic);
  503. void nicvf_update_lmac_stats(struct nicvf *nic);
  504. #endif /* NIC_H */