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