bna.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. /*
  2. * Linux network driver for Brocade Converged Network Adapter.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License (GPL) Version 2 as
  6. * published by the Free Software Foundation
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * General Public License for more details.
  12. */
  13. /*
  14. * Copyright (c) 2005-2011 Brocade Communications Systems, Inc.
  15. * All rights reserved
  16. * www.brocade.com
  17. */
  18. #ifndef __BNA_H__
  19. #define __BNA_H__
  20. #include "bfa_defs.h"
  21. #include "bfa_ioc.h"
  22. #include "bfi_enet.h"
  23. #include "bna_types.h"
  24. extern const u32 bna_napi_dim_vector[][BNA_BIAS_T_MAX];
  25. /* Macros and constants */
  26. #define BNA_IOC_TIMER_FREQ 200
  27. /* Log string size */
  28. #define BNA_MESSAGE_SIZE 256
  29. #define bna_is_small_rxq(_id) ((_id) & 0x1)
  30. #define BNA_MAC_IS_EQUAL(_mac1, _mac2) \
  31. (!memcmp((_mac1), (_mac2), sizeof(mac_t)))
  32. #define BNA_POWER_OF_2(x) (((x) & ((x) - 1)) == 0)
  33. #define BNA_TO_POWER_OF_2(x) \
  34. do { \
  35. int _shift = 0; \
  36. while ((x) && (x) != 1) { \
  37. (x) >>= 1; \
  38. _shift++; \
  39. } \
  40. (x) <<= _shift; \
  41. } while (0)
  42. #define BNA_TO_POWER_OF_2_HIGH(x) \
  43. do { \
  44. int n = 1; \
  45. while (n < (x)) \
  46. n <<= 1; \
  47. (x) = n; \
  48. } while (0)
  49. /*
  50. * input : _addr-> os dma addr in host endian format,
  51. * output : _bna_dma_addr-> pointer to hw dma addr
  52. */
  53. #define BNA_SET_DMA_ADDR(_addr, _bna_dma_addr) \
  54. do { \
  55. u64 tmp_addr = \
  56. cpu_to_be64((u64)(_addr)); \
  57. (_bna_dma_addr)->msb = ((struct bna_dma_addr *)&tmp_addr)->msb; \
  58. (_bna_dma_addr)->lsb = ((struct bna_dma_addr *)&tmp_addr)->lsb; \
  59. } while (0)
  60. /*
  61. * input : _bna_dma_addr-> pointer to hw dma addr
  62. * output : _addr-> os dma addr in host endian format
  63. */
  64. #define BNA_GET_DMA_ADDR(_bna_dma_addr, _addr) \
  65. do { \
  66. (_addr) = ((((u64)ntohl((_bna_dma_addr)->msb))) << 32) \
  67. | ((ntohl((_bna_dma_addr)->lsb) & 0xffffffff)); \
  68. } while (0)
  69. #define containing_rec(addr, type, field) \
  70. ((type *)((unsigned char *)(addr) - \
  71. (unsigned char *)(&((type *)0)->field)))
  72. #define BNA_TXQ_WI_NEEDED(_vectors) (((_vectors) + 3) >> 2)
  73. /* TxQ element is 64 bytes */
  74. #define BNA_TXQ_PAGE_INDEX_MAX (PAGE_SIZE >> 6)
  75. #define BNA_TXQ_PAGE_INDEX_MAX_SHIFT (PAGE_SHIFT - 6)
  76. #define BNA_TXQ_QPGE_PTR_GET(_qe_idx, _qpt_ptr, _qe_ptr, _qe_ptr_range) \
  77. { \
  78. unsigned int page_index; /* index within a page */ \
  79. void *page_addr; \
  80. page_index = (_qe_idx) & (BNA_TXQ_PAGE_INDEX_MAX - 1); \
  81. (_qe_ptr_range) = (BNA_TXQ_PAGE_INDEX_MAX - page_index); \
  82. page_addr = (_qpt_ptr)[((_qe_idx) >> BNA_TXQ_PAGE_INDEX_MAX_SHIFT)];\
  83. (_qe_ptr) = &((struct bna_txq_entry *)(page_addr))[page_index]; \
  84. }
  85. /* RxQ element is 8 bytes */
  86. #define BNA_RXQ_PAGE_INDEX_MAX (PAGE_SIZE >> 3)
  87. #define BNA_RXQ_PAGE_INDEX_MAX_SHIFT (PAGE_SHIFT - 3)
  88. #define BNA_RXQ_QPGE_PTR_GET(_qe_idx, _qpt_ptr, _qe_ptr, _qe_ptr_range) \
  89. { \
  90. unsigned int page_index; /* index within a page */ \
  91. void *page_addr; \
  92. page_index = (_qe_idx) & (BNA_RXQ_PAGE_INDEX_MAX - 1); \
  93. (_qe_ptr_range) = (BNA_RXQ_PAGE_INDEX_MAX - page_index); \
  94. page_addr = (_qpt_ptr)[((_qe_idx) >> \
  95. BNA_RXQ_PAGE_INDEX_MAX_SHIFT)]; \
  96. (_qe_ptr) = &((struct bna_rxq_entry *)(page_addr))[page_index]; \
  97. }
  98. /* CQ element is 16 bytes */
  99. #define BNA_CQ_PAGE_INDEX_MAX (PAGE_SIZE >> 4)
  100. #define BNA_CQ_PAGE_INDEX_MAX_SHIFT (PAGE_SHIFT - 4)
  101. #define BNA_CQ_QPGE_PTR_GET(_qe_idx, _qpt_ptr, _qe_ptr, _qe_ptr_range) \
  102. { \
  103. unsigned int page_index; /* index within a page */ \
  104. void *page_addr; \
  105. \
  106. page_index = (_qe_idx) & (BNA_CQ_PAGE_INDEX_MAX - 1); \
  107. (_qe_ptr_range) = (BNA_CQ_PAGE_INDEX_MAX - page_index); \
  108. page_addr = (_qpt_ptr)[((_qe_idx) >> \
  109. BNA_CQ_PAGE_INDEX_MAX_SHIFT)]; \
  110. (_qe_ptr) = &((struct bna_cq_entry *)(page_addr))[page_index];\
  111. }
  112. #define BNA_QE_INDX_2_PTR(_cast, _qe_idx, _q_base) \
  113. (&((_cast *)(_q_base))[(_qe_idx)])
  114. #define BNA_QE_INDX_RANGE(_qe_idx, _q_depth) ((_q_depth) - (_qe_idx))
  115. #define BNA_QE_INDX_ADD(_qe_idx, _qe_num, _q_depth) \
  116. ((_qe_idx) = ((_qe_idx) + (_qe_num)) & ((_q_depth) - 1))
  117. #define BNA_Q_INDEX_CHANGE(_old_idx, _updated_idx, _q_depth) \
  118. (((_updated_idx) - (_old_idx)) & ((_q_depth) - 1))
  119. #define BNA_QE_FREE_CNT(_q_ptr, _q_depth) \
  120. (((_q_ptr)->consumer_index - (_q_ptr)->producer_index - 1) & \
  121. ((_q_depth) - 1))
  122. #define BNA_QE_IN_USE_CNT(_q_ptr, _q_depth) \
  123. ((((_q_ptr)->producer_index - (_q_ptr)->consumer_index)) & \
  124. (_q_depth - 1))
  125. #define BNA_Q_GET_CI(_q_ptr) ((_q_ptr)->q.consumer_index)
  126. #define BNA_Q_GET_PI(_q_ptr) ((_q_ptr)->q.producer_index)
  127. #define BNA_Q_PI_ADD(_q_ptr, _num) \
  128. (_q_ptr)->q.producer_index = \
  129. (((_q_ptr)->q.producer_index + (_num)) & \
  130. ((_q_ptr)->q.q_depth - 1))
  131. #define BNA_Q_CI_ADD(_q_ptr, _num) \
  132. (_q_ptr)->q.consumer_index = \
  133. (((_q_ptr)->q.consumer_index + (_num)) \
  134. & ((_q_ptr)->q.q_depth - 1))
  135. #define BNA_Q_FREE_COUNT(_q_ptr) \
  136. (BNA_QE_FREE_CNT(&((_q_ptr)->q), (_q_ptr)->q.q_depth))
  137. #define BNA_Q_IN_USE_COUNT(_q_ptr) \
  138. (BNA_QE_IN_USE_CNT(&(_q_ptr)->q, (_q_ptr)->q.q_depth))
  139. #define BNA_LARGE_PKT_SIZE 1000
  140. #define BNA_UPDATE_PKT_CNT(_pkt, _len) \
  141. do { \
  142. if ((_len) > BNA_LARGE_PKT_SIZE) { \
  143. (_pkt)->large_pkt_cnt++; \
  144. } else { \
  145. (_pkt)->small_pkt_cnt++; \
  146. } \
  147. } while (0)
  148. #define call_rxf_stop_cbfn(rxf) \
  149. do { \
  150. if ((rxf)->stop_cbfn) { \
  151. void (*cbfn)(struct bna_rx *); \
  152. struct bna_rx *cbarg; \
  153. cbfn = (rxf)->stop_cbfn; \
  154. cbarg = (rxf)->stop_cbarg; \
  155. (rxf)->stop_cbfn = NULL; \
  156. (rxf)->stop_cbarg = NULL; \
  157. cbfn(cbarg); \
  158. } \
  159. } while (0)
  160. #define call_rxf_start_cbfn(rxf) \
  161. do { \
  162. if ((rxf)->start_cbfn) { \
  163. void (*cbfn)(struct bna_rx *); \
  164. struct bna_rx *cbarg; \
  165. cbfn = (rxf)->start_cbfn; \
  166. cbarg = (rxf)->start_cbarg; \
  167. (rxf)->start_cbfn = NULL; \
  168. (rxf)->start_cbarg = NULL; \
  169. cbfn(cbarg); \
  170. } \
  171. } while (0)
  172. #define call_rxf_cam_fltr_cbfn(rxf) \
  173. do { \
  174. if ((rxf)->cam_fltr_cbfn) { \
  175. void (*cbfn)(struct bnad *, struct bna_rx *); \
  176. struct bnad *cbarg; \
  177. cbfn = (rxf)->cam_fltr_cbfn; \
  178. cbarg = (rxf)->cam_fltr_cbarg; \
  179. (rxf)->cam_fltr_cbfn = NULL; \
  180. (rxf)->cam_fltr_cbarg = NULL; \
  181. cbfn(cbarg, rxf->rx); \
  182. } \
  183. } while (0)
  184. #define call_rxf_pause_cbfn(rxf) \
  185. do { \
  186. if ((rxf)->oper_state_cbfn) { \
  187. void (*cbfn)(struct bnad *, struct bna_rx *); \
  188. struct bnad *cbarg; \
  189. cbfn = (rxf)->oper_state_cbfn; \
  190. cbarg = (rxf)->oper_state_cbarg; \
  191. (rxf)->oper_state_cbfn = NULL; \
  192. (rxf)->oper_state_cbarg = NULL; \
  193. cbfn(cbarg, rxf->rx); \
  194. } \
  195. } while (0)
  196. #define call_rxf_resume_cbfn(rxf) call_rxf_pause_cbfn(rxf)
  197. #define is_xxx_enable(mode, bitmask, xxx) ((bitmask & xxx) && (mode & xxx))
  198. #define is_xxx_disable(mode, bitmask, xxx) ((bitmask & xxx) && !(mode & xxx))
  199. #define xxx_enable(mode, bitmask, xxx) \
  200. do { \
  201. bitmask |= xxx; \
  202. mode |= xxx; \
  203. } while (0)
  204. #define xxx_disable(mode, bitmask, xxx) \
  205. do { \
  206. bitmask |= xxx; \
  207. mode &= ~xxx; \
  208. } while (0)
  209. #define xxx_inactive(mode, bitmask, xxx) \
  210. do { \
  211. bitmask &= ~xxx; \
  212. mode &= ~xxx; \
  213. } while (0)
  214. #define is_promisc_enable(mode, bitmask) \
  215. is_xxx_enable(mode, bitmask, BNA_RXMODE_PROMISC)
  216. #define is_promisc_disable(mode, bitmask) \
  217. is_xxx_disable(mode, bitmask, BNA_RXMODE_PROMISC)
  218. #define promisc_enable(mode, bitmask) \
  219. xxx_enable(mode, bitmask, BNA_RXMODE_PROMISC)
  220. #define promisc_disable(mode, bitmask) \
  221. xxx_disable(mode, bitmask, BNA_RXMODE_PROMISC)
  222. #define promisc_inactive(mode, bitmask) \
  223. xxx_inactive(mode, bitmask, BNA_RXMODE_PROMISC)
  224. #define is_default_enable(mode, bitmask) \
  225. is_xxx_enable(mode, bitmask, BNA_RXMODE_DEFAULT)
  226. #define is_default_disable(mode, bitmask) \
  227. is_xxx_disable(mode, bitmask, BNA_RXMODE_DEFAULT)
  228. #define default_enable(mode, bitmask) \
  229. xxx_enable(mode, bitmask, BNA_RXMODE_DEFAULT)
  230. #define default_disable(mode, bitmask) \
  231. xxx_disable(mode, bitmask, BNA_RXMODE_DEFAULT)
  232. #define default_inactive(mode, bitmask) \
  233. xxx_inactive(mode, bitmask, BNA_RXMODE_DEFAULT)
  234. #define is_allmulti_enable(mode, bitmask) \
  235. is_xxx_enable(mode, bitmask, BNA_RXMODE_ALLMULTI)
  236. #define is_allmulti_disable(mode, bitmask) \
  237. is_xxx_disable(mode, bitmask, BNA_RXMODE_ALLMULTI)
  238. #define allmulti_enable(mode, bitmask) \
  239. xxx_enable(mode, bitmask, BNA_RXMODE_ALLMULTI)
  240. #define allmulti_disable(mode, bitmask) \
  241. xxx_disable(mode, bitmask, BNA_RXMODE_ALLMULTI)
  242. #define allmulti_inactive(mode, bitmask) \
  243. xxx_inactive(mode, bitmask, BNA_RXMODE_ALLMULTI)
  244. #define GET_RXQS(rxp, q0, q1) do { \
  245. switch ((rxp)->type) { \
  246. case BNA_RXP_SINGLE: \
  247. (q0) = rxp->rxq.single.only; \
  248. (q1) = NULL; \
  249. break; \
  250. case BNA_RXP_SLR: \
  251. (q0) = rxp->rxq.slr.large; \
  252. (q1) = rxp->rxq.slr.small; \
  253. break; \
  254. case BNA_RXP_HDS: \
  255. (q0) = rxp->rxq.hds.data; \
  256. (q1) = rxp->rxq.hds.hdr; \
  257. break; \
  258. } \
  259. } while (0)
  260. #define bna_tx_rid_mask(_bna) ((_bna)->tx_mod.rid_mask)
  261. #define bna_rx_rid_mask(_bna) ((_bna)->rx_mod.rid_mask)
  262. #define bna_tx_from_rid(_bna, _rid, _tx) \
  263. do { \
  264. struct bna_tx_mod *__tx_mod = &(_bna)->tx_mod; \
  265. struct bna_tx *__tx; \
  266. struct list_head *qe; \
  267. _tx = NULL; \
  268. list_for_each(qe, &__tx_mod->tx_active_q) { \
  269. __tx = (struct bna_tx *)qe; \
  270. if (__tx->rid == (_rid)) { \
  271. (_tx) = __tx; \
  272. break; \
  273. } \
  274. } \
  275. } while (0)
  276. #define bna_rx_from_rid(_bna, _rid, _rx) \
  277. do { \
  278. struct bna_rx_mod *__rx_mod = &(_bna)->rx_mod; \
  279. struct bna_rx *__rx; \
  280. struct list_head *qe; \
  281. _rx = NULL; \
  282. list_for_each(qe, &__rx_mod->rx_active_q) { \
  283. __rx = (struct bna_rx *)qe; \
  284. if (__rx->rid == (_rid)) { \
  285. (_rx) = __rx; \
  286. break; \
  287. } \
  288. } \
  289. } while (0)
  290. /* Inline functions */
  291. static inline struct bna_mac *bna_mac_find(struct list_head *q, u8 *addr)
  292. {
  293. struct bna_mac *mac = NULL;
  294. struct list_head *qe;
  295. list_for_each(qe, q) {
  296. if (BNA_MAC_IS_EQUAL(((struct bna_mac *)qe)->addr, addr)) {
  297. mac = (struct bna_mac *)qe;
  298. break;
  299. }
  300. }
  301. return mac;
  302. }
  303. #define bna_attr(_bna) (&(_bna)->ioceth.attr)
  304. /* Function prototypes */
  305. /* BNA */
  306. /* FW response handlers */
  307. void bna_bfi_stats_clr_rsp(struct bna *bna, struct bfi_msgq_mhdr *msghdr);
  308. /* APIs for BNAD */
  309. void bna_res_req(struct bna_res_info *res_info);
  310. void bna_mod_res_req(struct bna *bna, struct bna_res_info *res_info);
  311. void bna_init(struct bna *bna, struct bnad *bnad,
  312. struct bfa_pcidev *pcidev,
  313. struct bna_res_info *res_info);
  314. void bna_mod_init(struct bna *bna, struct bna_res_info *res_info);
  315. void bna_uninit(struct bna *bna);
  316. int bna_num_txq_set(struct bna *bna, int num_txq);
  317. int bna_num_rxp_set(struct bna *bna, int num_rxp);
  318. void bna_hw_stats_get(struct bna *bna);
  319. /* APIs for RxF */
  320. struct bna_mac *bna_ucam_mod_mac_get(struct bna_ucam_mod *ucam_mod);
  321. void bna_ucam_mod_mac_put(struct bna_ucam_mod *ucam_mod,
  322. struct bna_mac *mac);
  323. struct bna_mac *bna_mcam_mod_mac_get(struct bna_mcam_mod *mcam_mod);
  324. void bna_mcam_mod_mac_put(struct bna_mcam_mod *mcam_mod,
  325. struct bna_mac *mac);
  326. struct bna_mcam_handle *bna_mcam_mod_handle_get(struct bna_mcam_mod *mod);
  327. void bna_mcam_mod_handle_put(struct bna_mcam_mod *mcam_mod,
  328. struct bna_mcam_handle *handle);
  329. /* MBOX */
  330. /* API for BNAD */
  331. void bna_mbox_handler(struct bna *bna, u32 intr_status);
  332. /* ETHPORT */
  333. /* Callbacks for RX */
  334. void bna_ethport_cb_rx_started(struct bna_ethport *ethport);
  335. void bna_ethport_cb_rx_stopped(struct bna_ethport *ethport);
  336. /* TX MODULE AND TX */
  337. /* FW response handelrs */
  338. void bna_bfi_tx_enet_start_rsp(struct bna_tx *tx,
  339. struct bfi_msgq_mhdr *msghdr);
  340. void bna_bfi_tx_enet_stop_rsp(struct bna_tx *tx,
  341. struct bfi_msgq_mhdr *msghdr);
  342. void bna_bfi_bw_update_aen(struct bna_tx_mod *tx_mod);
  343. /* APIs for BNA */
  344. void bna_tx_mod_init(struct bna_tx_mod *tx_mod, struct bna *bna,
  345. struct bna_res_info *res_info);
  346. void bna_tx_mod_uninit(struct bna_tx_mod *tx_mod);
  347. /* APIs for ENET */
  348. void bna_tx_mod_start(struct bna_tx_mod *tx_mod, enum bna_tx_type type);
  349. void bna_tx_mod_stop(struct bna_tx_mod *tx_mod, enum bna_tx_type type);
  350. void bna_tx_mod_fail(struct bna_tx_mod *tx_mod);
  351. /* APIs for BNAD */
  352. void bna_tx_res_req(int num_txq, int txq_depth,
  353. struct bna_res_info *res_info);
  354. struct bna_tx *bna_tx_create(struct bna *bna, struct bnad *bnad,
  355. struct bna_tx_config *tx_cfg,
  356. const struct bna_tx_event_cbfn *tx_cbfn,
  357. struct bna_res_info *res_info, void *priv);
  358. void bna_tx_destroy(struct bna_tx *tx);
  359. void bna_tx_enable(struct bna_tx *tx);
  360. void bna_tx_disable(struct bna_tx *tx, enum bna_cleanup_type type,
  361. void (*cbfn)(void *, struct bna_tx *));
  362. void bna_tx_cleanup_complete(struct bna_tx *tx);
  363. void bna_tx_coalescing_timeo_set(struct bna_tx *tx, int coalescing_timeo);
  364. /* RX MODULE, RX, RXF */
  365. /* FW response handlers */
  366. void bna_bfi_rx_enet_start_rsp(struct bna_rx *rx,
  367. struct bfi_msgq_mhdr *msghdr);
  368. void bna_bfi_rx_enet_stop_rsp(struct bna_rx *rx,
  369. struct bfi_msgq_mhdr *msghdr);
  370. void bna_bfi_rxf_cfg_rsp(struct bna_rxf *rxf, struct bfi_msgq_mhdr *msghdr);
  371. void bna_bfi_rxf_mcast_add_rsp(struct bna_rxf *rxf,
  372. struct bfi_msgq_mhdr *msghdr);
  373. /* APIs for BNA */
  374. void bna_rx_mod_init(struct bna_rx_mod *rx_mod, struct bna *bna,
  375. struct bna_res_info *res_info);
  376. void bna_rx_mod_uninit(struct bna_rx_mod *rx_mod);
  377. /* APIs for ENET */
  378. void bna_rx_mod_start(struct bna_rx_mod *rx_mod, enum bna_rx_type type);
  379. void bna_rx_mod_stop(struct bna_rx_mod *rx_mod, enum bna_rx_type type);
  380. void bna_rx_mod_fail(struct bna_rx_mod *rx_mod);
  381. /* APIs for BNAD */
  382. void bna_rx_res_req(struct bna_rx_config *rx_config,
  383. struct bna_res_info *res_info);
  384. struct bna_rx *bna_rx_create(struct bna *bna, struct bnad *bnad,
  385. struct bna_rx_config *rx_cfg,
  386. const struct bna_rx_event_cbfn *rx_cbfn,
  387. struct bna_res_info *res_info, void *priv);
  388. void bna_rx_destroy(struct bna_rx *rx);
  389. void bna_rx_enable(struct bna_rx *rx);
  390. void bna_rx_disable(struct bna_rx *rx, enum bna_cleanup_type type,
  391. void (*cbfn)(void *, struct bna_rx *));
  392. void bna_rx_cleanup_complete(struct bna_rx *rx);
  393. void bna_rx_coalescing_timeo_set(struct bna_rx *rx, int coalescing_timeo);
  394. void bna_rx_dim_reconfig(struct bna *bna, const u32 vector[][BNA_BIAS_T_MAX]);
  395. void bna_rx_dim_update(struct bna_ccb *ccb);
  396. enum bna_cb_status
  397. bna_rx_ucast_set(struct bna_rx *rx, u8 *ucmac,
  398. void (*cbfn)(struct bnad *, struct bna_rx *));
  399. enum bna_cb_status
  400. bna_rx_ucast_add(struct bna_rx *rx, u8* ucmac,
  401. void (*cbfn)(struct bnad *, struct bna_rx *));
  402. enum bna_cb_status
  403. bna_rx_ucast_del(struct bna_rx *rx, u8 *ucmac,
  404. void (*cbfn)(struct bnad *, struct bna_rx *));
  405. enum bna_cb_status
  406. bna_rx_mcast_add(struct bna_rx *rx, u8 *mcmac,
  407. void (*cbfn)(struct bnad *, struct bna_rx *));
  408. enum bna_cb_status
  409. bna_rx_mcast_listset(struct bna_rx *rx, int count, u8 *mcmac,
  410. void (*cbfn)(struct bnad *, struct bna_rx *));
  411. enum bna_cb_status
  412. bna_rx_mode_set(struct bna_rx *rx, enum bna_rxmode rxmode,
  413. enum bna_rxmode bitmask,
  414. void (*cbfn)(struct bnad *, struct bna_rx *));
  415. void bna_rx_vlan_add(struct bna_rx *rx, int vlan_id);
  416. void bna_rx_vlan_del(struct bna_rx *rx, int vlan_id);
  417. void bna_rx_vlanfilter_enable(struct bna_rx *rx);
  418. /* ENET */
  419. /* API for RX */
  420. int bna_enet_mtu_get(struct bna_enet *enet);
  421. /* Callbacks for TX, RX */
  422. void bna_enet_cb_tx_stopped(struct bna_enet *enet);
  423. void bna_enet_cb_rx_stopped(struct bna_enet *enet);
  424. /* API for BNAD */
  425. void bna_enet_enable(struct bna_enet *enet);
  426. void bna_enet_disable(struct bna_enet *enet, enum bna_cleanup_type type,
  427. void (*cbfn)(void *));
  428. void bna_enet_pause_config(struct bna_enet *enet,
  429. struct bna_pause_config *pause_config,
  430. void (*cbfn)(struct bnad *));
  431. void bna_enet_mtu_set(struct bna_enet *enet, int mtu,
  432. void (*cbfn)(struct bnad *));
  433. void bna_enet_perm_mac_get(struct bna_enet *enet, mac_t *mac);
  434. /* IOCETH */
  435. /* APIs for BNAD */
  436. void bna_ioceth_enable(struct bna_ioceth *ioceth);
  437. void bna_ioceth_disable(struct bna_ioceth *ioceth,
  438. enum bna_cleanup_type type);
  439. /* BNAD */
  440. /* Callbacks for ENET */
  441. void bnad_cb_ethport_link_status(struct bnad *bnad,
  442. enum bna_link_status status);
  443. /* Callbacks for IOCETH */
  444. void bnad_cb_ioceth_ready(struct bnad *bnad);
  445. void bnad_cb_ioceth_failed(struct bnad *bnad);
  446. void bnad_cb_ioceth_disabled(struct bnad *bnad);
  447. void bnad_cb_mbox_intr_enable(struct bnad *bnad);
  448. void bnad_cb_mbox_intr_disable(struct bnad *bnad);
  449. /* Callbacks for BNA */
  450. void bnad_cb_stats_get(struct bnad *bnad, enum bna_cb_status status,
  451. struct bna_stats *stats);
  452. #endif /* __BNA_H__ */