Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2005-2009 Brocade Communications Systems, Inc. |
| 3 | * All rights reserved |
| 4 | * www.brocade.com |
| 5 | * |
| 6 | * Linux driver for Brocade Fibre Channel Host Bus Adapter. |
| 7 | * |
| 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 |
| 11 | * |
| 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. |
| 16 | */ |
| 17 | |
| 18 | #ifndef __BFA_PORT_PRIV_H__ |
| 19 | #define __BFA_PORT_PRIV_H__ |
| 20 | |
| 21 | #include <defs/bfa_defs_pport.h> |
| 22 | #include <bfi/bfi_pport.h> |
| 23 | #include "bfa_intr_priv.h" |
| 24 | |
| 25 | /** |
Krishna Gudipati | 9693e7d | 2010-03-05 19:36:30 -0800 | [diff] [blame] | 26 | * Link notification data structure |
| 27 | */ |
Krishna Gudipati | 1c8a4c3 | 2010-03-05 19:37:37 -0800 | [diff] [blame] | 28 | struct bfa_fcport_ln_s { |
| 29 | struct bfa_fcport_s *fcport; |
Krishna Gudipati | 9693e7d | 2010-03-05 19:36:30 -0800 | [diff] [blame] | 30 | bfa_sm_t sm; |
| 31 | struct bfa_cb_qe_s ln_qe; /* BFA callback queue elem for ln */ |
| 32 | enum bfa_pport_linkstate ln_event; /* ln event for callback */ |
| 33 | }; |
| 34 | |
| 35 | /** |
Krishna Gudipati | 1c8a4c3 | 2010-03-05 19:37:37 -0800 | [diff] [blame] | 36 | * BFA FC port data structure |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 37 | */ |
Krishna Gudipati | 1c8a4c3 | 2010-03-05 19:37:37 -0800 | [diff] [blame] | 38 | struct bfa_fcport_s { |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 39 | struct bfa_s *bfa; /* parent BFA instance */ |
| 40 | bfa_sm_t sm; /* port state machine */ |
| 41 | wwn_t nwwn; /* node wwn of physical port */ |
| 42 | wwn_t pwwn; /* port wwn of physical oprt */ |
| 43 | enum bfa_pport_speed speed_sup; |
| 44 | /* supported speeds */ |
| 45 | enum bfa_pport_speed speed; /* current speed */ |
| 46 | enum bfa_pport_topology topology; /* current topology */ |
| 47 | u8 myalpa; /* my ALPA in LOOP topology */ |
| 48 | u8 rsvd[3]; |
Krishna Gudipati | ca8b432 | 2010-03-05 19:38:07 -0800 | [diff] [blame] | 49 | u32 mypid:24; |
| 50 | u32 rsvd_b:8; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 51 | struct bfa_pport_cfg_s cfg; /* current port configuration */ |
| 52 | struct bfa_qos_attr_s qos_attr; /* QoS Attributes */ |
| 53 | struct bfa_qos_vc_attr_s qos_vc_attr; /* VC info from ELP */ |
| 54 | struct bfa_reqq_wait_s reqq_wait; |
| 55 | /* to wait for room in reqq */ |
| 56 | struct bfa_reqq_wait_s svcreq_wait; |
| 57 | /* to wait for room in reqq */ |
| 58 | struct bfa_reqq_wait_s stats_reqq_wait; |
| 59 | /* to wait for room in reqq (stats) */ |
| 60 | void *event_cbarg; |
| 61 | void (*event_cbfn) (void *cbarg, |
| 62 | bfa_pport_event_t event); |
| 63 | union { |
Krishna Gudipati | ca8b432 | 2010-03-05 19:38:07 -0800 | [diff] [blame] | 64 | union bfi_fcport_i2h_msg_u i2hmsg; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 65 | } event_arg; |
| 66 | void *bfad; /* BFA driver handle */ |
Krishna Gudipati | 1c8a4c3 | 2010-03-05 19:37:37 -0800 | [diff] [blame] | 67 | struct bfa_fcport_ln_s ln; /* Link Notification */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 68 | struct bfa_cb_qe_s hcb_qe; /* BFA callback queue elem */ |
Krishna Gudipati | ca8b432 | 2010-03-05 19:38:07 -0800 | [diff] [blame] | 69 | struct bfa_timer_s timer; /* timer */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 70 | u32 msgtag; /* fimrware msg tag for reply */ |
| 71 | u8 *stats_kva; |
| 72 | u64 stats_pa; |
Krishna Gudipati | ca8b432 | 2010-03-05 19:38:07 -0800 | [diff] [blame] | 73 | union bfa_fcport_stats_u *stats; |
| 74 | union bfa_fcport_stats_u *stats_ret; /* driver stats location */ |
| 75 | bfa_status_t stats_status; /* stats/statsclr status */ |
| 76 | bfa_boolean_t stats_busy; /* outstanding stats/statsclr */ |
| 77 | bfa_boolean_t stats_qfull; |
| 78 | bfa_cb_pport_t stats_cbfn; /* driver callback function */ |
| 79 | void *stats_cbarg; /* *!< user callback arg */ |
| 80 | bfa_boolean_t diag_busy; /* diag busy status */ |
| 81 | bfa_boolean_t beacon; /* port beacon status */ |
| 82 | bfa_boolean_t link_e2e_beacon; /* link beacon status */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 83 | }; |
| 84 | |
Krishna Gudipati | 1c8a4c3 | 2010-03-05 19:37:37 -0800 | [diff] [blame] | 85 | #define BFA_FCPORT_MOD(__bfa) (&(__bfa)->modules.fcport) |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 86 | |
| 87 | /* |
| 88 | * public functions |
| 89 | */ |
Jing Huang | ed96932 | 2010-07-08 19:45:56 -0700 | [diff] [blame^] | 90 | void bfa_fcport_init(struct bfa_s *bfa); |
| 91 | void bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg); |
| 92 | |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 93 | #endif /* __BFA_PORT_PRIV_H__ */ |