2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
18 #ifndef __BFA_PORT_H__
19 #define __BFA_PORT_H__
21 #include <defs/bfa_defs_port.h>
23 #include <cs/bfa_trc.h>
24 #include <cs/bfa_log.h>
26 typedef void (*bfa_port_stats_cbfn_t
) (void *dev
, bfa_status_t status
);
27 typedef void (*bfa_port_endis_cbfn_t
) (void *dev
, bfa_status_t status
);
31 struct bfa_ioc_s
*ioc
;
32 struct bfa_trc_mod_s
*trcmod
;
33 struct bfa_log_mod_s
*logmod
;
35 bfa_boolean_t stats_busy
;
36 struct bfa_mbox_cmd_s stats_mb
;
37 bfa_port_stats_cbfn_t stats_cbfn
;
39 bfa_status_t stats_status
;
40 union bfa_pport_stats_u
*stats
;
41 struct bfa_dma_s stats_dma
;
42 bfa_boolean_t endis_pending
;
43 struct bfa_mbox_cmd_s endis_mb
;
44 bfa_port_endis_cbfn_t endis_cbfn
;
46 bfa_status_t endis_status
;
47 struct bfa_ioc_hbfail_notify_s hbfail
;
50 void bfa_port_attach(struct bfa_port_s
*port
, struct bfa_ioc_s
*ioc
,
51 void *dev
, struct bfa_trc_mod_s
*trcmod
,
52 struct bfa_log_mod_s
*logmod
);
53 void bfa_port_detach(struct bfa_port_s
*port
);
54 void bfa_port_hbfail(void *arg
);
56 bfa_status_t
bfa_port_get_stats(struct bfa_port_s
*port
,
57 union bfa_pport_stats_u
*stats
,
58 bfa_port_stats_cbfn_t cbfn
, void *cbarg
);
59 bfa_status_t
bfa_port_clear_stats(struct bfa_port_s
*port
,
60 bfa_port_stats_cbfn_t cbfn
, void *cbarg
);
61 bfa_status_t
bfa_port_enable(struct bfa_port_s
*port
,
62 bfa_port_endis_cbfn_t cbfn
, void *cbarg
);
63 bfa_status_t
bfa_port_disable(struct bfa_port_s
*port
,
64 bfa_port_endis_cbfn_t cbfn
, void *cbarg
);
65 u32
bfa_port_meminfo(void);
66 void bfa_port_mem_claim(struct bfa_port_s
*port
, u8
*dma_kva
,
69 #endif /* __BFA_PORT_H__ */