bnx2x_cmn.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. /* bnx2x_cmn.h: Broadcom Everest network driver.
  2. *
  3. * Copyright (c) 2007-2010 Broadcom Corporation
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation.
  8. *
  9. * Maintained by: Eilon Greenstein <eilong@broadcom.com>
  10. * Written by: Eliezer Tamir
  11. * Based on code from Michael Chan's bnx2 driver
  12. * UDP CSUM errata workaround by Arik Gendelman
  13. * Slowpath and fastpath rework by Vladislav Zolotarov
  14. * Statistics and Link management by Yitchak Gertner
  15. *
  16. */
  17. #ifndef BNX2X_CMN_H
  18. #define BNX2X_CMN_H
  19. #include <linux/types.h>
  20. #include <linux/netdevice.h>
  21. #include "bnx2x.h"
  22. /*********************** Interfaces ****************************
  23. * Functions that need to be implemented by each driver version
  24. */
  25. /**
  26. * Initialize link parameters structure variables.
  27. *
  28. * @param bp
  29. * @param load_mode
  30. *
  31. * @return u8
  32. */
  33. u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode);
  34. /**
  35. * Configure hw according to link parameters structure.
  36. *
  37. * @param bp
  38. */
  39. void bnx2x_link_set(struct bnx2x *bp);
  40. /**
  41. * Query link status
  42. *
  43. * @param bp
  44. * @param is_serdes
  45. *
  46. * @return 0 - link is UP
  47. */
  48. u8 bnx2x_link_test(struct bnx2x *bp, u8 is_serdes);
  49. /**
  50. * Handles link status change
  51. *
  52. * @param bp
  53. */
  54. void bnx2x__link_status_update(struct bnx2x *bp);
  55. /**
  56. * MSI-X slowpath interrupt handler
  57. *
  58. * @param irq
  59. * @param dev_instance
  60. *
  61. * @return irqreturn_t
  62. */
  63. irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance);
  64. /**
  65. * non MSI-X interrupt handler
  66. *
  67. * @param irq
  68. * @param dev_instance
  69. *
  70. * @return irqreturn_t
  71. */
  72. irqreturn_t bnx2x_interrupt(int irq, void *dev_instance);
  73. #ifdef BCM_CNIC
  74. /**
  75. * Send command to cnic driver
  76. *
  77. * @param bp
  78. * @param cmd
  79. */
  80. int bnx2x_cnic_notify(struct bnx2x *bp, int cmd);
  81. /**
  82. * Provides cnic information for proper interrupt handling
  83. *
  84. * @param bp
  85. */
  86. void bnx2x_setup_cnic_irq_info(struct bnx2x *bp);
  87. #endif
  88. /**
  89. * Enable HW interrupts.
  90. *
  91. * @param bp
  92. */
  93. void bnx2x_int_enable(struct bnx2x *bp);
  94. /**
  95. * Disable interrupts. This function ensures that there are no
  96. * ISRs or SP DPCs (sp_task) are running after it returns.
  97. *
  98. * @param bp
  99. * @param disable_hw if true, disable HW interrupts.
  100. */
  101. void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw);
  102. /**
  103. * Loads device firmware
  104. *
  105. * @param bp
  106. *
  107. * @return int
  108. */
  109. int bnx2x_init_firmware(struct bnx2x *bp);
  110. /**
  111. * Init HW blocks according to current initialization stage:
  112. * COMMON, PORT or FUNCTION.
  113. *
  114. * @param bp
  115. * @param load_code: COMMON, PORT or FUNCTION
  116. *
  117. * @return int
  118. */
  119. int bnx2x_init_hw(struct bnx2x *bp, u32 load_code);
  120. /**
  121. * Init driver internals:
  122. * - rings
  123. * - status blocks
  124. * - etc.
  125. *
  126. * @param bp
  127. * @param load_code COMMON, PORT or FUNCTION
  128. */
  129. void bnx2x_nic_init(struct bnx2x *bp, u32 load_code);
  130. /**
  131. * Allocate driver's memory.
  132. *
  133. * @param bp
  134. *
  135. * @return int
  136. */
  137. int bnx2x_alloc_mem(struct bnx2x *bp);
  138. /**
  139. * Release driver's memory.
  140. *
  141. * @param bp
  142. */
  143. void bnx2x_free_mem(struct bnx2x *bp);
  144. /**
  145. * Bring up a leading (the first) eth Client.
  146. *
  147. * @param bp
  148. *
  149. * @return int
  150. */
  151. int bnx2x_setup_leading(struct bnx2x *bp);
  152. /**
  153. * Setup non-leading eth Client.
  154. *
  155. * @param bp
  156. * @param fp
  157. *
  158. * @return int
  159. */
  160. int bnx2x_setup_multi(struct bnx2x *bp, int index);
  161. /**
  162. * Set number of quueus according to mode and number of available
  163. * msi-x vectors
  164. *
  165. * @param bp
  166. *
  167. */
  168. void bnx2x_set_num_queues_msix(struct bnx2x *bp);
  169. /**
  170. * Cleanup chip internals:
  171. * - Cleanup MAC configuration.
  172. * - Close clients.
  173. * - etc.
  174. *
  175. * @param bp
  176. * @param unload_mode
  177. */
  178. void bnx2x_chip_cleanup(struct bnx2x *bp, int unload_mode);
  179. /**
  180. * Acquire HW lock.
  181. *
  182. * @param bp
  183. * @param resource Resource bit which was locked
  184. *
  185. * @return int
  186. */
  187. int bnx2x_acquire_hw_lock(struct bnx2x *bp, u32 resource);
  188. /**
  189. * Release HW lock.
  190. *
  191. * @param bp driver handle
  192. * @param resource Resource bit which was locked
  193. *
  194. * @return int
  195. */
  196. int bnx2x_release_hw_lock(struct bnx2x *bp, u32 resource);
  197. /**
  198. * Configure eth MAC address in the HW according to the value in
  199. * netdev->dev_addr for 57711
  200. *
  201. * @param bp driver handle
  202. * @param set
  203. */
  204. void bnx2x_set_eth_mac_addr_e1h(struct bnx2x *bp, int set);
  205. /**
  206. * Configure eth MAC address in the HW according to the value in
  207. * netdev->dev_addr for 57710
  208. *
  209. * @param bp driver handle
  210. * @param set
  211. */
  212. void bnx2x_set_eth_mac_addr_e1(struct bnx2x *bp, int set);
  213. #ifdef BCM_CNIC
  214. /**
  215. * Set iSCSI MAC(s) at the next enties in the CAM after the ETH
  216. * MAC(s). The function will wait until the ramrod completion
  217. * returns.
  218. *
  219. * @param bp driver handle
  220. * @param set set or clear the CAM entry
  221. *
  222. * @return 0 if cussess, -ENODEV if ramrod doesn't return.
  223. */
  224. int bnx2x_set_iscsi_eth_mac_addr(struct bnx2x *bp, int set);
  225. #endif
  226. /**
  227. * Initialize status block in FW and HW
  228. *
  229. * @param bp driver handle
  230. * @param sb host_status_block
  231. * @param dma_addr_t mapping
  232. * @param int sb_id
  233. */
  234. void bnx2x_init_sb(struct bnx2x *bp, struct host_status_block *sb,
  235. dma_addr_t mapping, int sb_id);
  236. /**
  237. * Reconfigure FW/HW according to dev->flags rx mode
  238. *
  239. * @param dev net_device
  240. *
  241. */
  242. void bnx2x_set_rx_mode(struct net_device *dev);
  243. /**
  244. * Configure MAC filtering rules in a FW.
  245. *
  246. * @param bp driver handle
  247. */
  248. void bnx2x_set_storm_rx_mode(struct bnx2x *bp);
  249. /* Parity errors related */
  250. void bnx2x_inc_load_cnt(struct bnx2x *bp);
  251. u32 bnx2x_dec_load_cnt(struct bnx2x *bp);
  252. bool bnx2x_chk_parity_attn(struct bnx2x *bp);
  253. bool bnx2x_reset_is_done(struct bnx2x *bp);
  254. void bnx2x_disable_close_the_gate(struct bnx2x *bp);
  255. /**
  256. * Perform statistics handling according to event
  257. *
  258. * @param bp driver handle
  259. * @param even tbnx2x_stats_event
  260. */
  261. void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event);
  262. /**
  263. * Configures FW with client paramteres (like HW VLAN removal)
  264. * for each active client.
  265. *
  266. * @param bp
  267. */
  268. void bnx2x_set_client_config(struct bnx2x *bp);
  269. /**
  270. * Handle sp events
  271. *
  272. * @param fp fastpath handle for the event
  273. * @param rr_cqe eth_rx_cqe
  274. */
  275. void bnx2x_sp_event(struct bnx2x_fastpath *fp, union eth_rx_cqe *rr_cqe);
  276. static inline void bnx2x_update_fpsb_idx(struct bnx2x_fastpath *fp)
  277. {
  278. struct host_status_block *fpsb = fp->status_blk;
  279. barrier(); /* status block is written to by the chip */
  280. fp->fp_c_idx = fpsb->c_status_block.status_block_index;
  281. fp->fp_u_idx = fpsb->u_status_block.status_block_index;
  282. }
  283. static inline void bnx2x_update_rx_prod(struct bnx2x *bp,
  284. struct bnx2x_fastpath *fp,
  285. u16 bd_prod, u16 rx_comp_prod,
  286. u16 rx_sge_prod)
  287. {
  288. struct ustorm_eth_rx_producers rx_prods = {0};
  289. int i;
  290. /* Update producers */
  291. rx_prods.bd_prod = bd_prod;
  292. rx_prods.cqe_prod = rx_comp_prod;
  293. rx_prods.sge_prod = rx_sge_prod;
  294. /*
  295. * Make sure that the BD and SGE data is updated before updating the
  296. * producers since FW might read the BD/SGE right after the producer
  297. * is updated.
  298. * This is only applicable for weak-ordered memory model archs such
  299. * as IA-64. The following barrier is also mandatory since FW will
  300. * assumes BDs must have buffers.
  301. */
  302. wmb();
  303. for (i = 0; i < sizeof(struct ustorm_eth_rx_producers)/4; i++)
  304. REG_WR(bp, BAR_USTRORM_INTMEM +
  305. USTORM_RX_PRODS_OFFSET(BP_PORT(bp), fp->cl_id) + i*4,
  306. ((u32 *)&rx_prods)[i]);
  307. mmiowb(); /* keep prod updates ordered */
  308. DP(NETIF_MSG_RX_STATUS,
  309. "queue[%d]: wrote bd_prod %u cqe_prod %u sge_prod %u\n",
  310. fp->index, bd_prod, rx_comp_prod, rx_sge_prod);
  311. }
  312. static inline void bnx2x_ack_sb(struct bnx2x *bp, u8 sb_id,
  313. u8 storm, u16 index, u8 op, u8 update)
  314. {
  315. u32 hc_addr = (HC_REG_COMMAND_REG + BP_PORT(bp)*32 +
  316. COMMAND_REG_INT_ACK);
  317. struct igu_ack_register igu_ack;
  318. igu_ack.status_block_index = index;
  319. igu_ack.sb_id_and_flags =
  320. ((sb_id << IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT) |
  321. (storm << IGU_ACK_REGISTER_STORM_ID_SHIFT) |
  322. (update << IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT) |
  323. (op << IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT));
  324. DP(BNX2X_MSG_OFF, "write 0x%08x to HC addr 0x%x\n",
  325. (*(u32 *)&igu_ack), hc_addr);
  326. REG_WR(bp, hc_addr, (*(u32 *)&igu_ack));
  327. /* Make sure that ACK is written */
  328. mmiowb();
  329. barrier();
  330. }
  331. static inline u16 bnx2x_ack_int(struct bnx2x *bp)
  332. {
  333. u32 hc_addr = (HC_REG_COMMAND_REG + BP_PORT(bp)*32 +
  334. COMMAND_REG_SIMD_MASK);
  335. u32 result = REG_RD(bp, hc_addr);
  336. DP(BNX2X_MSG_OFF, "read 0x%08x from HC addr 0x%x\n",
  337. result, hc_addr);
  338. return result;
  339. }
  340. /*
  341. * fast path service functions
  342. */
  343. static inline int bnx2x_has_tx_work_unload(struct bnx2x_fastpath *fp)
  344. {
  345. /* Tell compiler that consumer and producer can change */
  346. barrier();
  347. return (fp->tx_pkt_prod != fp->tx_pkt_cons);
  348. }
  349. static inline u16 bnx2x_tx_avail(struct bnx2x_fastpath *fp)
  350. {
  351. s16 used;
  352. u16 prod;
  353. u16 cons;
  354. prod = fp->tx_bd_prod;
  355. cons = fp->tx_bd_cons;
  356. /* NUM_TX_RINGS = number of "next-page" entries
  357. It will be used as a threshold */
  358. used = SUB_S16(prod, cons) + (s16)NUM_TX_RINGS;
  359. #ifdef BNX2X_STOP_ON_ERROR
  360. WARN_ON(used < 0);
  361. WARN_ON(used > fp->bp->tx_ring_size);
  362. WARN_ON((fp->bp->tx_ring_size - used) > MAX_TX_AVAIL);
  363. #endif
  364. return (s16)(fp->bp->tx_ring_size) - used;
  365. }
  366. static inline int bnx2x_has_tx_work(struct bnx2x_fastpath *fp)
  367. {
  368. u16 hw_cons;
  369. /* Tell compiler that status block fields can change */
  370. barrier();
  371. hw_cons = le16_to_cpu(*fp->tx_cons_sb);
  372. return hw_cons != fp->tx_pkt_cons;
  373. }
  374. static inline void bnx2x_free_rx_sge(struct bnx2x *bp,
  375. struct bnx2x_fastpath *fp, u16 index)
  376. {
  377. struct sw_rx_page *sw_buf = &fp->rx_page_ring[index];
  378. struct page *page = sw_buf->page;
  379. struct eth_rx_sge *sge = &fp->rx_sge_ring[index];
  380. /* Skip "next page" elements */
  381. if (!page)
  382. return;
  383. dma_unmap_page(&bp->pdev->dev, dma_unmap_addr(sw_buf, mapping),
  384. SGE_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE);
  385. __free_pages(page, PAGES_PER_SGE_SHIFT);
  386. sw_buf->page = NULL;
  387. sge->addr_hi = 0;
  388. sge->addr_lo = 0;
  389. }
  390. static inline void bnx2x_free_rx_sge_range(struct bnx2x *bp,
  391. struct bnx2x_fastpath *fp, int last)
  392. {
  393. int i;
  394. for (i = 0; i < last; i++)
  395. bnx2x_free_rx_sge(bp, fp, i);
  396. }
  397. static inline int bnx2x_alloc_rx_sge(struct bnx2x *bp,
  398. struct bnx2x_fastpath *fp, u16 index)
  399. {
  400. struct page *page = alloc_pages(GFP_ATOMIC, PAGES_PER_SGE_SHIFT);
  401. struct sw_rx_page *sw_buf = &fp->rx_page_ring[index];
  402. struct eth_rx_sge *sge = &fp->rx_sge_ring[index];
  403. dma_addr_t mapping;
  404. if (unlikely(page == NULL))
  405. return -ENOMEM;
  406. mapping = dma_map_page(&bp->pdev->dev, page, 0,
  407. SGE_PAGE_SIZE*PAGES_PER_SGE, DMA_FROM_DEVICE);
  408. if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
  409. __free_pages(page, PAGES_PER_SGE_SHIFT);
  410. return -ENOMEM;
  411. }
  412. sw_buf->page = page;
  413. dma_unmap_addr_set(sw_buf, mapping, mapping);
  414. sge->addr_hi = cpu_to_le32(U64_HI(mapping));
  415. sge->addr_lo = cpu_to_le32(U64_LO(mapping));
  416. return 0;
  417. }
  418. static inline int bnx2x_alloc_rx_skb(struct bnx2x *bp,
  419. struct bnx2x_fastpath *fp, u16 index)
  420. {
  421. struct sk_buff *skb;
  422. struct sw_rx_bd *rx_buf = &fp->rx_buf_ring[index];
  423. struct eth_rx_bd *rx_bd = &fp->rx_desc_ring[index];
  424. dma_addr_t mapping;
  425. skb = netdev_alloc_skb(bp->dev, bp->rx_buf_size);
  426. if (unlikely(skb == NULL))
  427. return -ENOMEM;
  428. mapping = dma_map_single(&bp->pdev->dev, skb->data, bp->rx_buf_size,
  429. DMA_FROM_DEVICE);
  430. if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
  431. dev_kfree_skb(skb);
  432. return -ENOMEM;
  433. }
  434. rx_buf->skb = skb;
  435. dma_unmap_addr_set(rx_buf, mapping, mapping);
  436. rx_bd->addr_hi = cpu_to_le32(U64_HI(mapping));
  437. rx_bd->addr_lo = cpu_to_le32(U64_LO(mapping));
  438. return 0;
  439. }
  440. /* note that we are not allocating a new skb,
  441. * we are just moving one from cons to prod
  442. * we are not creating a new mapping,
  443. * so there is no need to check for dma_mapping_error().
  444. */
  445. static inline void bnx2x_reuse_rx_skb(struct bnx2x_fastpath *fp,
  446. struct sk_buff *skb, u16 cons, u16 prod)
  447. {
  448. struct bnx2x *bp = fp->bp;
  449. struct sw_rx_bd *cons_rx_buf = &fp->rx_buf_ring[cons];
  450. struct sw_rx_bd *prod_rx_buf = &fp->rx_buf_ring[prod];
  451. struct eth_rx_bd *cons_bd = &fp->rx_desc_ring[cons];
  452. struct eth_rx_bd *prod_bd = &fp->rx_desc_ring[prod];
  453. dma_sync_single_for_device(&bp->pdev->dev,
  454. dma_unmap_addr(cons_rx_buf, mapping),
  455. RX_COPY_THRESH, DMA_FROM_DEVICE);
  456. prod_rx_buf->skb = cons_rx_buf->skb;
  457. dma_unmap_addr_set(prod_rx_buf, mapping,
  458. dma_unmap_addr(cons_rx_buf, mapping));
  459. *prod_bd = *cons_bd;
  460. }
  461. static inline void bnx2x_clear_sge_mask_next_elems(struct bnx2x_fastpath *fp)
  462. {
  463. int i, j;
  464. for (i = 1; i <= NUM_RX_SGE_PAGES; i++) {
  465. int idx = RX_SGE_CNT * i - 1;
  466. for (j = 0; j < 2; j++) {
  467. SGE_MASK_CLEAR_BIT(fp, idx);
  468. idx--;
  469. }
  470. }
  471. }
  472. static inline void bnx2x_init_sge_ring_bit_mask(struct bnx2x_fastpath *fp)
  473. {
  474. /* Set the mask to all 1-s: it's faster to compare to 0 than to 0xf-s */
  475. memset(fp->sge_mask, 0xff,
  476. (NUM_RX_SGE >> RX_SGE_MASK_ELEM_SHIFT)*sizeof(u64));
  477. /* Clear the two last indices in the page to 1:
  478. these are the indices that correspond to the "next" element,
  479. hence will never be indicated and should be removed from
  480. the calculations. */
  481. bnx2x_clear_sge_mask_next_elems(fp);
  482. }
  483. static inline void bnx2x_free_tpa_pool(struct bnx2x *bp,
  484. struct bnx2x_fastpath *fp, int last)
  485. {
  486. int i;
  487. for (i = 0; i < last; i++) {
  488. struct sw_rx_bd *rx_buf = &(fp->tpa_pool[i]);
  489. struct sk_buff *skb = rx_buf->skb;
  490. if (skb == NULL) {
  491. DP(NETIF_MSG_IFDOWN, "tpa bin %d empty on free\n", i);
  492. continue;
  493. }
  494. if (fp->tpa_state[i] == BNX2X_TPA_START)
  495. dma_unmap_single(&bp->pdev->dev,
  496. dma_unmap_addr(rx_buf, mapping),
  497. bp->rx_buf_size, DMA_FROM_DEVICE);
  498. dev_kfree_skb(skb);
  499. rx_buf->skb = NULL;
  500. }
  501. }
  502. static inline void bnx2x_init_tx_ring(struct bnx2x *bp)
  503. {
  504. int i, j;
  505. for_each_queue(bp, j) {
  506. struct bnx2x_fastpath *fp = &bp->fp[j];
  507. for (i = 1; i <= NUM_TX_RINGS; i++) {
  508. struct eth_tx_next_bd *tx_next_bd =
  509. &fp->tx_desc_ring[TX_DESC_CNT * i - 1].next_bd;
  510. tx_next_bd->addr_hi =
  511. cpu_to_le32(U64_HI(fp->tx_desc_mapping +
  512. BCM_PAGE_SIZE*(i % NUM_TX_RINGS)));
  513. tx_next_bd->addr_lo =
  514. cpu_to_le32(U64_LO(fp->tx_desc_mapping +
  515. BCM_PAGE_SIZE*(i % NUM_TX_RINGS)));
  516. }
  517. fp->tx_db.data.header.header = DOORBELL_HDR_DB_TYPE;
  518. fp->tx_db.data.zero_fill1 = 0;
  519. fp->tx_db.data.prod = 0;
  520. fp->tx_pkt_prod = 0;
  521. fp->tx_pkt_cons = 0;
  522. fp->tx_bd_prod = 0;
  523. fp->tx_bd_cons = 0;
  524. fp->tx_cons_sb = BNX2X_TX_SB_INDEX;
  525. fp->tx_pkt = 0;
  526. }
  527. }
  528. static inline int bnx2x_has_rx_work(struct bnx2x_fastpath *fp)
  529. {
  530. u16 rx_cons_sb;
  531. /* Tell compiler that status block fields can change */
  532. barrier();
  533. rx_cons_sb = le16_to_cpu(*fp->rx_cons_sb);
  534. if ((rx_cons_sb & MAX_RCQ_DESC_CNT) == MAX_RCQ_DESC_CNT)
  535. rx_cons_sb++;
  536. return (fp->rx_comp_cons != rx_cons_sb);
  537. }
  538. /* HW Lock for shared dual port PHYs */
  539. void bnx2x_acquire_phy_lock(struct bnx2x *bp);
  540. void bnx2x_release_phy_lock(struct bnx2x *bp);
  541. void bnx2x_link_report(struct bnx2x *bp);
  542. int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget);
  543. int bnx2x_tx_int(struct bnx2x_fastpath *fp);
  544. void bnx2x_init_rx_rings(struct bnx2x *bp);
  545. netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev);
  546. int bnx2x_change_mac_addr(struct net_device *dev, void *p);
  547. void bnx2x_tx_timeout(struct net_device *dev);
  548. void bnx2x_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp);
  549. void bnx2x_netif_start(struct bnx2x *bp);
  550. void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw);
  551. void bnx2x_free_irq(struct bnx2x *bp, bool disable_only);
  552. int bnx2x_suspend(struct pci_dev *pdev, pm_message_t state);
  553. int bnx2x_resume(struct pci_dev *pdev);
  554. void bnx2x_free_skbs(struct bnx2x *bp);
  555. int bnx2x_change_mtu(struct net_device *dev, int new_mtu);
  556. int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode);
  557. int bnx2x_nic_load(struct bnx2x *bp, int load_mode);
  558. int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state);
  559. #endif /* BNX2X_CMN_H */