bna.h 17 KB

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