bnx2x_cmn.h 16 KB

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