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. #ifndef __BNA_H__
  14. #define __BNA_H__
  15. #include "bfa_wc.h"
  16. #include "bfa_ioc.h"
  17. #include "cna.h"
  18. #include "bfi_ll.h"
  19. #include "bna_types.h"
  20. extern const u32 bna_napi_dim_vector[][BNA_BIAS_T_MAX];
  21. /**
  22. *
  23. * Macros and constants
  24. *
  25. */
  26. #define BNA_IOC_TIMER_FREQ 200
  27. /* Log string size */
  28. #define BNA_MESSAGE_SIZE 256
  29. /* MBOX API for PORT, TX, RX */
  30. #define bna_mbox_qe_fill(_qe, _cmd, _cmd_len, _cbfn, _cbarg) \
  31. do { \
  32. memcpy(&((_qe)->cmd.msg[0]), (_cmd), (_cmd_len)); \
  33. (_qe)->cbfn = (_cbfn); \
  34. (_qe)->cbarg = (_cbarg); \
  35. } while (0)
  36. #define bna_is_small_rxq(rcb) ((rcb)->id == 1)
  37. #define BNA_MAC_IS_EQUAL(_mac1, _mac2) \
  38. (!memcmp((_mac1), (_mac2), sizeof(mac_t)))
  39. #define BNA_POWER_OF_2(x) (((x) & ((x) - 1)) == 0)
  40. #define BNA_TO_POWER_OF_2(x) \
  41. do { \
  42. int _shift = 0; \
  43. while ((x) && (x) != 1) { \
  44. (x) >>= 1; \
  45. _shift++; \
  46. } \
  47. (x) <<= _shift; \
  48. } while (0)
  49. #define BNA_TO_POWER_OF_2_HIGH(x) \
  50. do { \
  51. int n = 1; \
  52. while (n < (x)) \
  53. n <<= 1; \
  54. (x) = n; \
  55. } while (0)
  56. /*
  57. * input : _addr-> os dma addr in host endian format,
  58. * output : _bna_dma_addr-> pointer to hw dma addr
  59. */
  60. #define BNA_SET_DMA_ADDR(_addr, _bna_dma_addr) \
  61. do { \
  62. u64 tmp_addr = \
  63. cpu_to_be64((u64)(_addr)); \
  64. (_bna_dma_addr)->msb = ((struct bna_dma_addr *)&tmp_addr)->msb; \
  65. (_bna_dma_addr)->lsb = ((struct bna_dma_addr *)&tmp_addr)->lsb; \
  66. } while (0)
  67. /*
  68. * input : _bna_dma_addr-> pointer to hw dma addr
  69. * output : _addr-> os dma addr in host endian format
  70. */
  71. #define BNA_GET_DMA_ADDR(_bna_dma_addr, _addr) \
  72. do { \
  73. (_addr) = ((((u64)ntohl((_bna_dma_addr)->msb))) << 32) \
  74. | ((ntohl((_bna_dma_addr)->lsb) & 0xffffffff)); \
  75. } while (0)
  76. #define containing_rec(addr, type, field) \
  77. ((type *)((unsigned char *)(addr) - \
  78. (unsigned char *)(&((type *)0)->field)))
  79. #define BNA_TXQ_WI_NEEDED(_vectors) (((_vectors) + 3) >> 2)
  80. /* TxQ element is 64 bytes */
  81. #define BNA_TXQ_PAGE_INDEX_MAX (PAGE_SIZE >> 6)
  82. #define BNA_TXQ_PAGE_INDEX_MAX_SHIFT (PAGE_SHIFT - 6)
  83. #define BNA_TXQ_QPGE_PTR_GET(_qe_idx, _qpt_ptr, _qe_ptr, _qe_ptr_range) \
  84. { \
  85. unsigned int page_index; /* index within a page */ \
  86. void *page_addr; \
  87. page_index = (_qe_idx) & (BNA_TXQ_PAGE_INDEX_MAX - 1); \
  88. (_qe_ptr_range) = (BNA_TXQ_PAGE_INDEX_MAX - page_index); \
  89. page_addr = (_qpt_ptr)[((_qe_idx) >> BNA_TXQ_PAGE_INDEX_MAX_SHIFT)];\
  90. (_qe_ptr) = &((struct bna_txq_entry *)(page_addr))[page_index]; \
  91. }
  92. /* RxQ element is 8 bytes */
  93. #define BNA_RXQ_PAGE_INDEX_MAX (PAGE_SIZE >> 3)
  94. #define BNA_RXQ_PAGE_INDEX_MAX_SHIFT (PAGE_SHIFT - 3)
  95. #define BNA_RXQ_QPGE_PTR_GET(_qe_idx, _qpt_ptr, _qe_ptr, _qe_ptr_range) \
  96. { \
  97. unsigned int page_index; /* index within a page */ \
  98. void *page_addr; \
  99. page_index = (_qe_idx) & (BNA_RXQ_PAGE_INDEX_MAX - 1); \
  100. (_qe_ptr_range) = (BNA_RXQ_PAGE_INDEX_MAX - page_index); \
  101. page_addr = (_qpt_ptr)[((_qe_idx) >> \
  102. BNA_RXQ_PAGE_INDEX_MAX_SHIFT)]; \
  103. (_qe_ptr) = &((struct bna_rxq_entry *)(page_addr))[page_index]; \
  104. }
  105. /* CQ element is 16 bytes */
  106. #define BNA_CQ_PAGE_INDEX_MAX (PAGE_SIZE >> 4)
  107. #define BNA_CQ_PAGE_INDEX_MAX_SHIFT (PAGE_SHIFT - 4)
  108. #define BNA_CQ_QPGE_PTR_GET(_qe_idx, _qpt_ptr, _qe_ptr, _qe_ptr_range) \
  109. { \
  110. unsigned int page_index; /* index within a page */ \
  111. void *page_addr; \
  112. \
  113. page_index = (_qe_idx) & (BNA_CQ_PAGE_INDEX_MAX - 1); \
  114. (_qe_ptr_range) = (BNA_CQ_PAGE_INDEX_MAX - page_index); \
  115. page_addr = (_qpt_ptr)[((_qe_idx) >> \
  116. BNA_CQ_PAGE_INDEX_MAX_SHIFT)]; \
  117. (_qe_ptr) = &((struct bna_cq_entry *)(page_addr))[page_index];\
  118. }
  119. #define BNA_QE_INDX_2_PTR(_cast, _qe_idx, _q_base) \
  120. (&((_cast *)(_q_base))[(_qe_idx)])
  121. #define BNA_QE_INDX_RANGE(_qe_idx, _q_depth) ((_q_depth) - (_qe_idx))
  122. #define BNA_QE_INDX_ADD(_qe_idx, _qe_num, _q_depth) \
  123. ((_qe_idx) = ((_qe_idx) + (_qe_num)) & ((_q_depth) - 1))
  124. #define BNA_Q_INDEX_CHANGE(_old_idx, _updated_idx, _q_depth) \
  125. (((_updated_idx) - (_old_idx)) & ((_q_depth) - 1))
  126. #define BNA_QE_FREE_CNT(_q_ptr, _q_depth) \
  127. (((_q_ptr)->consumer_index - (_q_ptr)->producer_index - 1) & \
  128. ((_q_depth) - 1))
  129. #define BNA_QE_IN_USE_CNT(_q_ptr, _q_depth) \
  130. ((((_q_ptr)->producer_index - (_q_ptr)->consumer_index)) & \
  131. (_q_depth - 1))
  132. #define BNA_Q_GET_CI(_q_ptr) ((_q_ptr)->q.consumer_index)
  133. #define BNA_Q_GET_PI(_q_ptr) ((_q_ptr)->q.producer_index)
  134. #define BNA_Q_PI_ADD(_q_ptr, _num) \
  135. (_q_ptr)->q.producer_index = \
  136. (((_q_ptr)->q.producer_index + (_num)) & \
  137. ((_q_ptr)->q.q_depth - 1))
  138. #define BNA_Q_CI_ADD(_q_ptr, _num) \
  139. (_q_ptr)->q.consumer_index = \
  140. (((_q_ptr)->q.consumer_index + (_num)) \
  141. & ((_q_ptr)->q.q_depth - 1))
  142. #define BNA_Q_FREE_COUNT(_q_ptr) \
  143. (BNA_QE_FREE_CNT(&((_q_ptr)->q), (_q_ptr)->q.q_depth))
  144. #define BNA_Q_IN_USE_COUNT(_q_ptr) \
  145. (BNA_QE_IN_USE_CNT(&(_q_ptr)->q, (_q_ptr)->q.q_depth))
  146. /* These macros build the data portion of the TxQ/RxQ doorbell */
  147. #define BNA_DOORBELL_Q_PRD_IDX(_pi) (0x80000000 | (_pi))
  148. #define BNA_DOORBELL_Q_STOP (0x40000000)
  149. /* These macros build the data portion of the IB doorbell */
  150. #define BNA_DOORBELL_IB_INT_ACK(_timeout, _events) \
  151. (0x80000000 | ((_timeout) << 16) | (_events))
  152. #define BNA_DOORBELL_IB_INT_DISABLE (0x40000000)
  153. /* Set the coalescing timer for the given ib */
  154. #define bna_ib_coalescing_timer_set(_i_dbell, _cls_timer) \
  155. ((_i_dbell)->doorbell_ack = BNA_DOORBELL_IB_INT_ACK((_cls_timer), 0));
  156. /* Acks 'events' # of events for a given ib */
  157. #define bna_ib_ack(_i_dbell, _events) \
  158. (writel(((_i_dbell)->doorbell_ack | (_events)), \
  159. (_i_dbell)->doorbell_addr));
  160. #define bna_txq_prod_indx_doorbell(_tcb) \
  161. (writel(BNA_DOORBELL_Q_PRD_IDX((_tcb)->producer_index), \
  162. (_tcb)->q_dbell));
  163. #define bna_rxq_prod_indx_doorbell(_rcb) \
  164. (writel(BNA_DOORBELL_Q_PRD_IDX((_rcb)->producer_index), \
  165. (_rcb)->q_dbell));
  166. #define BNA_LARGE_PKT_SIZE 1000
  167. #define BNA_UPDATE_PKT_CNT(_pkt, _len) \
  168. do { \
  169. if ((_len) > BNA_LARGE_PKT_SIZE) { \
  170. (_pkt)->large_pkt_cnt++; \
  171. } else { \
  172. (_pkt)->small_pkt_cnt++; \
  173. } \
  174. } while (0)
  175. #define call_rxf_stop_cbfn(rxf, status) \
  176. if ((rxf)->stop_cbfn) { \
  177. (*(rxf)->stop_cbfn)((rxf)->stop_cbarg, (status)); \
  178. (rxf)->stop_cbfn = NULL; \
  179. (rxf)->stop_cbarg = NULL; \
  180. }
  181. #define call_rxf_start_cbfn(rxf, status) \
  182. if ((rxf)->start_cbfn) { \
  183. (*(rxf)->start_cbfn)((rxf)->start_cbarg, (status)); \
  184. (rxf)->start_cbfn = NULL; \
  185. (rxf)->start_cbarg = NULL; \
  186. }
  187. #define call_rxf_cam_fltr_cbfn(rxf, status) \
  188. if ((rxf)->cam_fltr_cbfn) { \
  189. (*(rxf)->cam_fltr_cbfn)((rxf)->cam_fltr_cbarg, rxf->rx, \
  190. (status)); \
  191. (rxf)->cam_fltr_cbfn = NULL; \
  192. (rxf)->cam_fltr_cbarg = NULL; \
  193. }
  194. #define call_rxf_pause_cbfn(rxf, status) \
  195. if ((rxf)->oper_state_cbfn) { \
  196. (*(rxf)->oper_state_cbfn)((rxf)->oper_state_cbarg, rxf->rx,\
  197. (status)); \
  198. (rxf)->rxf_flags &= ~BNA_RXF_FL_OPERSTATE_CHANGED; \
  199. (rxf)->oper_state_cbfn = NULL; \
  200. (rxf)->oper_state_cbarg = NULL; \
  201. }
  202. #define call_rxf_resume_cbfn(rxf, status) call_rxf_pause_cbfn(rxf, status)
  203. #define is_xxx_enable(mode, bitmask, xxx) ((bitmask & xxx) && (mode & xxx))
  204. #define is_xxx_disable(mode, bitmask, xxx) ((bitmask & xxx) && !(mode & xxx))
  205. #define xxx_enable(mode, bitmask, xxx) \
  206. do { \
  207. bitmask |= xxx; \
  208. mode |= xxx; \
  209. } while (0)
  210. #define xxx_disable(mode, bitmask, xxx) \
  211. do { \
  212. bitmask |= xxx; \
  213. mode &= ~xxx; \
  214. } while (0)
  215. #define xxx_inactive(mode, bitmask, xxx) \
  216. do { \
  217. bitmask &= ~xxx; \
  218. mode &= ~xxx; \
  219. } while (0)
  220. #define is_promisc_enable(mode, bitmask) \
  221. is_xxx_enable(mode, bitmask, BNA_RXMODE_PROMISC)
  222. #define is_promisc_disable(mode, bitmask) \
  223. is_xxx_disable(mode, bitmask, BNA_RXMODE_PROMISC)
  224. #define promisc_enable(mode, bitmask) \
  225. xxx_enable(mode, bitmask, BNA_RXMODE_PROMISC)
  226. #define promisc_disable(mode, bitmask) \
  227. xxx_disable(mode, bitmask, BNA_RXMODE_PROMISC)
  228. #define promisc_inactive(mode, bitmask) \
  229. xxx_inactive(mode, bitmask, BNA_RXMODE_PROMISC)
  230. #define is_default_enable(mode, bitmask) \
  231. is_xxx_enable(mode, bitmask, BNA_RXMODE_DEFAULT)
  232. #define is_default_disable(mode, bitmask) \
  233. is_xxx_disable(mode, bitmask, BNA_RXMODE_DEFAULT)
  234. #define default_enable(mode, bitmask) \
  235. xxx_enable(mode, bitmask, BNA_RXMODE_DEFAULT)
  236. #define default_disable(mode, bitmask) \
  237. xxx_disable(mode, bitmask, BNA_RXMODE_DEFAULT)
  238. #define default_inactive(mode, bitmask) \
  239. xxx_inactive(mode, bitmask, BNA_RXMODE_DEFAULT)
  240. #define is_allmulti_enable(mode, bitmask) \
  241. is_xxx_enable(mode, bitmask, BNA_RXMODE_ALLMULTI)
  242. #define is_allmulti_disable(mode, bitmask) \
  243. is_xxx_disable(mode, bitmask, BNA_RXMODE_ALLMULTI)
  244. #define allmulti_enable(mode, bitmask) \
  245. xxx_enable(mode, bitmask, BNA_RXMODE_ALLMULTI)
  246. #define allmulti_disable(mode, bitmask) \
  247. xxx_disable(mode, bitmask, BNA_RXMODE_ALLMULTI)
  248. #define allmulti_inactive(mode, bitmask) \
  249. xxx_inactive(mode, bitmask, BNA_RXMODE_ALLMULTI)
  250. #define GET_RXQS(rxp, q0, q1) do { \
  251. switch ((rxp)->type) { \
  252. case BNA_RXP_SINGLE: \
  253. (q0) = rxp->rxq.single.only; \
  254. (q1) = NULL; \
  255. break; \
  256. case BNA_RXP_SLR: \
  257. (q0) = rxp->rxq.slr.large; \
  258. (q1) = rxp->rxq.slr.small; \
  259. break; \
  260. case BNA_RXP_HDS: \
  261. (q0) = rxp->rxq.hds.data; \
  262. (q1) = rxp->rxq.hds.hdr; \
  263. break; \
  264. } \
  265. } while (0)
  266. /**
  267. *
  268. * Function prototypes
  269. *
  270. */
  271. /**
  272. * BNA
  273. */
  274. /* APIs for BNAD */
  275. void bna_res_req(struct bna_res_info *res_info);
  276. void bna_init(struct bna *bna, struct bnad *bnad,
  277. struct bfa_pcidev *pcidev,
  278. struct bna_res_info *res_info);
  279. void bna_uninit(struct bna *bna);
  280. void bna_stats_get(struct bna *bna);
  281. void bna_get_perm_mac(struct bna *bna, u8 *mac);
  282. /* APIs for Rx */
  283. int bna_rit_mod_can_satisfy(struct bna_rit_mod *rit_mod, int seg_size);
  284. /* APIs for RxF */
  285. struct bna_mac *bna_ucam_mod_mac_get(struct bna_ucam_mod *ucam_mod);
  286. void bna_ucam_mod_mac_put(struct bna_ucam_mod *ucam_mod,
  287. struct bna_mac *mac);
  288. struct bna_mac *bna_mcam_mod_mac_get(struct bna_mcam_mod *mcam_mod);
  289. void bna_mcam_mod_mac_put(struct bna_mcam_mod *mcam_mod,
  290. struct bna_mac *mac);
  291. struct bna_rit_segment *
  292. bna_rit_mod_seg_get(struct bna_rit_mod *rit_mod, int seg_size);
  293. void bna_rit_mod_seg_put(struct bna_rit_mod *rit_mod,
  294. struct bna_rit_segment *seg);
  295. /**
  296. * DEVICE
  297. */
  298. /* APIs for BNAD */
  299. void bna_device_enable(struct bna_device *device);
  300. void bna_device_disable(struct bna_device *device,
  301. enum bna_cleanup_type type);
  302. /**
  303. * MBOX
  304. */
  305. /* APIs for PORT, TX, RX */
  306. void bna_mbox_handler(struct bna *bna, u32 intr_status);
  307. void bna_mbox_send(struct bna *bna, struct bna_mbox_qe *mbox_qe);
  308. /**
  309. * PORT
  310. */
  311. /* API for RX */
  312. int bna_port_mtu_get(struct bna_port *port);
  313. void bna_llport_rx_started(struct bna_llport *llport);
  314. void bna_llport_rx_stopped(struct bna_llport *llport);
  315. /* API for BNAD */
  316. void bna_port_enable(struct bna_port *port);
  317. void bna_port_disable(struct bna_port *port, enum bna_cleanup_type type,
  318. void (*cbfn)(void *, enum bna_cb_status));
  319. void bna_port_pause_config(struct bna_port *port,
  320. struct bna_pause_config *pause_config,
  321. void (*cbfn)(struct bnad *, enum bna_cb_status));
  322. void bna_port_mtu_set(struct bna_port *port, int mtu,
  323. void (*cbfn)(struct bnad *, enum bna_cb_status));
  324. void bna_port_mac_get(struct bna_port *port, mac_t *mac);
  325. /* Callbacks for TX, RX */
  326. void bna_port_cb_tx_stopped(struct bna_port *port,
  327. enum bna_cb_status status);
  328. void bna_port_cb_rx_stopped(struct bna_port *port,
  329. enum bna_cb_status status);
  330. /**
  331. * IB
  332. */
  333. /* APIs for BNA */
  334. void bna_ib_mod_init(struct bna_ib_mod *ib_mod, struct bna *bna,
  335. struct bna_res_info *res_info);
  336. void bna_ib_mod_uninit(struct bna_ib_mod *ib_mod);
  337. /**
  338. * TX MODULE AND TX
  339. */
  340. /* APIs for BNA */
  341. void bna_tx_mod_init(struct bna_tx_mod *tx_mod, struct bna *bna,
  342. struct bna_res_info *res_info);
  343. void bna_tx_mod_uninit(struct bna_tx_mod *tx_mod);
  344. int bna_tx_state_get(struct bna_tx *tx);
  345. /* APIs for PORT */
  346. void bna_tx_mod_start(struct bna_tx_mod *tx_mod, enum bna_tx_type type);
  347. void bna_tx_mod_stop(struct bna_tx_mod *tx_mod, enum bna_tx_type type);
  348. void bna_tx_mod_fail(struct bna_tx_mod *tx_mod);
  349. void bna_tx_mod_prio_changed(struct bna_tx_mod *tx_mod, int prio);
  350. void bna_tx_mod_cee_link_status(struct bna_tx_mod *tx_mod, int cee_link);
  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. 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. enum bna_cb_status));
  363. void bna_tx_coalescing_timeo_set(struct bna_tx *tx, int coalescing_timeo);
  364. /**
  365. * RX MODULE, RX, RXF
  366. */
  367. /* Internal APIs */
  368. void rxf_cb_cam_fltr_mbox_cmd(void *arg, int status);
  369. void rxf_cam_mbox_cmd(struct bna_rxf *rxf, u8 cmd,
  370. const struct bna_mac *mac_addr);
  371. void __rxf_vlan_filter_set(struct bna_rxf *rxf, enum bna_status status);
  372. void bna_rxf_adv_init(struct bna_rxf *rxf,
  373. struct bna_rx *rx,
  374. struct bna_rx_config *q_config);
  375. int rxf_process_packet_filter_ucast(struct bna_rxf *rxf);
  376. int rxf_process_packet_filter_promisc(struct bna_rxf *rxf);
  377. int rxf_process_packet_filter_default(struct bna_rxf *rxf);
  378. int rxf_process_packet_filter_allmulti(struct bna_rxf *rxf);
  379. int rxf_clear_packet_filter_ucast(struct bna_rxf *rxf);
  380. int rxf_clear_packet_filter_promisc(struct bna_rxf *rxf);
  381. int rxf_clear_packet_filter_default(struct bna_rxf *rxf);
  382. int rxf_clear_packet_filter_allmulti(struct bna_rxf *rxf);
  383. void rxf_reset_packet_filter_ucast(struct bna_rxf *rxf);
  384. void rxf_reset_packet_filter_promisc(struct bna_rxf *rxf);
  385. void rxf_reset_packet_filter_default(struct bna_rxf *rxf);
  386. void rxf_reset_packet_filter_allmulti(struct bna_rxf *rxf);
  387. /* APIs for BNA */
  388. void bna_rx_mod_init(struct bna_rx_mod *rx_mod, struct bna *bna,
  389. struct bna_res_info *res_info);
  390. void bna_rx_mod_uninit(struct bna_rx_mod *rx_mod);
  391. int bna_rx_state_get(struct bna_rx *rx);
  392. int bna_rxf_state_get(struct bna_rxf *rxf);
  393. /* APIs for PORT */
  394. void bna_rx_mod_start(struct bna_rx_mod *rx_mod, enum bna_rx_type type);
  395. void bna_rx_mod_stop(struct bna_rx_mod *rx_mod, enum bna_rx_type type);
  396. void bna_rx_mod_fail(struct bna_rx_mod *rx_mod);
  397. /* APIs for BNAD */
  398. void bna_rx_res_req(struct bna_rx_config *rx_config,
  399. struct bna_res_info *res_info);
  400. struct bna_rx *bna_rx_create(struct bna *bna, struct bnad *bnad,
  401. struct bna_rx_config *rx_cfg,
  402. struct bna_rx_event_cbfn *rx_cbfn,
  403. struct bna_res_info *res_info, void *priv);
  404. void bna_rx_destroy(struct bna_rx *rx);
  405. void bna_rx_enable(struct bna_rx *rx);
  406. void bna_rx_disable(struct bna_rx *rx, enum bna_cleanup_type type,
  407. void (*cbfn)(void *, struct bna_rx *,
  408. enum bna_cb_status));
  409. void bna_rx_coalescing_timeo_set(struct bna_rx *rx, int coalescing_timeo);
  410. void bna_rx_dim_reconfig(struct bna *bna, const u32 vector[][BNA_BIAS_T_MAX]);
  411. void bna_rx_dim_update(struct bna_ccb *ccb);
  412. enum bna_cb_status
  413. bna_rx_ucast_set(struct bna_rx *rx, u8 *ucmac,
  414. void (*cbfn)(struct bnad *, struct bna_rx *,
  415. enum bna_cb_status));
  416. enum bna_cb_status
  417. bna_rx_mcast_add(struct bna_rx *rx, u8 *mcmac,
  418. void (*cbfn)(struct bnad *, struct bna_rx *,
  419. enum bna_cb_status));
  420. enum bna_cb_status
  421. bna_rx_mcast_listset(struct bna_rx *rx, int count, u8 *mcmac,
  422. void (*cbfn)(struct bnad *, struct bna_rx *,
  423. enum bna_cb_status));
  424. enum bna_cb_status
  425. bna_rx_mode_set(struct bna_rx *rx, enum bna_rxmode rxmode,
  426. enum bna_rxmode bitmask,
  427. void (*cbfn)(struct bnad *, struct bna_rx *,
  428. enum bna_cb_status));
  429. void bna_rx_vlan_add(struct bna_rx *rx, int vlan_id);
  430. void bna_rx_vlan_del(struct bna_rx *rx, int vlan_id);
  431. void bna_rx_vlanfilter_enable(struct bna_rx *rx);
  432. void bna_rx_hds_enable(struct bna_rx *rx, struct bna_rxf_hds *hds_config,
  433. void (*cbfn)(struct bnad *, struct bna_rx *,
  434. enum bna_cb_status));
  435. void bna_rx_hds_disable(struct bna_rx *rx,
  436. void (*cbfn)(struct bnad *, struct bna_rx *,
  437. enum bna_cb_status));
  438. /**
  439. * BNAD
  440. */
  441. /* Callbacks for BNA */
  442. void bnad_cb_stats_get(struct bnad *bnad, enum bna_cb_status status,
  443. struct bna_stats *stats);
  444. /* Callbacks for DEVICE */
  445. void bnad_cb_device_enabled(struct bnad *bnad, enum bna_cb_status status);
  446. void bnad_cb_device_disabled(struct bnad *bnad, enum bna_cb_status status);
  447. void bnad_cb_device_enable_mbox_intr(struct bnad *bnad);
  448. void bnad_cb_device_disable_mbox_intr(struct bnad *bnad);
  449. /* Callbacks for port */
  450. void bnad_cb_port_link_status(struct bnad *bnad,
  451. enum bna_link_status status);
  452. #endif /* __BNA_H__ */