diff options
author | Jing Huang <huangj@brocade.com> | 2010-07-08 22:59:24 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:04:21 -0400 |
commit | 07b2838669dc7704e02e079b1a96602656893d78 (patch) | |
tree | fdb8305a2748775fa2a825ba9f3c4a0facec9f28 | |
parent | 56d218fc93ede28a2a5b71c5db334f193b39988f (diff) |
[SCSI] bfa: update to support BOFM
Update bfa driver API and data structure to support BOFM (IBM BladeCenter
Open Fabric Manager).
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.c | 44 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/bfa.h | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/bfi/bfi_ioc.h | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/defs/bfa_defs_status.h | 16 |
4 files changed, 36 insertions, 28 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index c4922fb995d5..8e78f20110a5 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c | |||
@@ -84,6 +84,7 @@ static void bfa_ioc_reset(struct bfa_ioc_s *ioc, bfa_boolean_t force); | |||
84 | static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc); | 84 | static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc); |
85 | static void bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc); | 85 | static void bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc); |
86 | static void bfa_ioc_recover(struct bfa_ioc_s *ioc); | 86 | static void bfa_ioc_recover(struct bfa_ioc_s *ioc); |
87 | static void bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc); | ||
87 | static void bfa_ioc_disable_comp(struct bfa_ioc_s *ioc); | 88 | static void bfa_ioc_disable_comp(struct bfa_ioc_s *ioc); |
88 | static void bfa_ioc_lpu_stop(struct bfa_ioc_s *ioc); | 89 | static void bfa_ioc_lpu_stop(struct bfa_ioc_s *ioc); |
89 | 90 | ||
@@ -429,6 +430,7 @@ bfa_ioc_sm_getattr(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
429 | switch (event) { | 430 | switch (event) { |
430 | case IOC_E_FWRSP_GETATTR: | 431 | case IOC_E_FWRSP_GETATTR: |
431 | bfa_ioc_timer_stop(ioc); | 432 | bfa_ioc_timer_stop(ioc); |
433 | bfa_ioc_check_attr_wwns(ioc); | ||
432 | bfa_fsm_set_state(ioc, bfa_ioc_sm_op); | 434 | bfa_fsm_set_state(ioc, bfa_ioc_sm_op); |
433 | break; | 435 | break; |
434 | 436 | ||
@@ -977,8 +979,13 @@ bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force) | |||
977 | /** | 979 | /** |
978 | * If IOC function is disabled and firmware version is same, | 980 | * If IOC function is disabled and firmware version is same, |
979 | * just re-enable IOC. | 981 | * just re-enable IOC. |
982 | * | ||
983 | * If option rom, IOC must not be in operational state. With | ||
984 | * convergence, IOC will be in operational state when 2nd driver | ||
985 | * is loaded. | ||
980 | */ | 986 | */ |
981 | if (ioc_fwstate == BFI_IOC_DISABLED || ioc_fwstate == BFI_IOC_OP) { | 987 | if (ioc_fwstate == BFI_IOC_DISABLED || |
988 | (!bfa_ioc_is_optrom(ioc) && ioc_fwstate == BFI_IOC_OP)) { | ||
982 | bfa_trc(ioc, ioc_fwstate); | 989 | bfa_trc(ioc, ioc_fwstate); |
983 | 990 | ||
984 | /** | 991 | /** |
@@ -1281,6 +1288,7 @@ bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type, u32 boot_param) | |||
1281 | bfa_reg_write((rb + BFA_IOC1_STATE_REG), BFI_IOC_INITING); | 1288 | bfa_reg_write((rb + BFA_IOC1_STATE_REG), BFI_IOC_INITING); |
1282 | } | 1289 | } |
1283 | 1290 | ||
1291 | bfa_ioc_msgflush(ioc); | ||
1284 | bfa_ioc_download_fw(ioc, boot_type, boot_param); | 1292 | bfa_ioc_download_fw(ioc, boot_type, boot_param); |
1285 | 1293 | ||
1286 | /** | 1294 | /** |
@@ -1788,28 +1796,17 @@ void | |||
1788 | bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model) | 1796 | bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model) |
1789 | { | 1797 | { |
1790 | struct bfi_ioc_attr_s *ioc_attr; | 1798 | struct bfi_ioc_attr_s *ioc_attr; |
1791 | u8 nports; | ||
1792 | u8 max_speed; | ||
1793 | 1799 | ||
1794 | bfa_assert(model); | 1800 | bfa_assert(model); |
1795 | bfa_os_memset((void *)model, 0, BFA_ADAPTER_MODEL_NAME_LEN); | 1801 | bfa_os_memset((void *)model, 0, BFA_ADAPTER_MODEL_NAME_LEN); |
1796 | 1802 | ||
1797 | ioc_attr = ioc->attr; | 1803 | ioc_attr = ioc->attr; |
1798 | 1804 | ||
1799 | nports = bfa_ioc_get_nports(ioc); | ||
1800 | max_speed = bfa_ioc_speed_sup(ioc); | ||
1801 | |||
1802 | /** | 1805 | /** |
1803 | * model name | 1806 | * model name |
1804 | */ | 1807 | */ |
1805 | if (max_speed == 10) { | 1808 | snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, "%s-%u", |
1806 | strcpy(model, "BR-10?0"); | 1809 | BFA_MFG_NAME, ioc_attr->card_type); |
1807 | model[5] = '0' + nports; | ||
1808 | } else { | ||
1809 | strcpy(model, "Brocade-??5"); | ||
1810 | model[8] = '0' + max_speed; | ||
1811 | model[9] = '0' + nports; | ||
1812 | } | ||
1813 | } | 1810 | } |
1814 | 1811 | ||
1815 | enum bfa_ioc_state | 1812 | enum bfa_ioc_state |
@@ -2048,19 +2045,16 @@ bfa_ioc_recover(struct bfa_ioc_s *ioc) | |||
2048 | bfa_fsm_send_event(ioc, IOC_E_HBFAIL); | 2045 | bfa_fsm_send_event(ioc, IOC_E_HBFAIL); |
2049 | } | 2046 | } |
2050 | 2047 | ||
2051 | #else | ||
2052 | |||
2053 | void | ||
2054 | bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event) | ||
2055 | { | ||
2056 | } | ||
2057 | |||
2058 | static void | 2048 | static void |
2059 | bfa_ioc_recover(struct bfa_ioc_s *ioc) | 2049 | bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc) |
2060 | { | 2050 | { |
2061 | bfa_assert(0); | 2051 | if (bfa_ioc_get_type(ioc) == BFA_IOC_TYPE_LL) |
2052 | return; | ||
2053 | |||
2054 | if (ioc->attr->nwwn == 0) | ||
2055 | bfa_ioc_aen_post(ioc, BFA_IOC_AEN_INVALID_NWWN); | ||
2056 | if (ioc->attr->pwwn == 0) | ||
2057 | bfa_ioc_aen_post(ioc, BFA_IOC_AEN_INVALID_PWWN); | ||
2062 | } | 2058 | } |
2063 | 2059 | ||
2064 | #endif | 2060 | #endif |
2065 | |||
2066 | |||
diff --git a/drivers/scsi/bfa/include/bfa.h b/drivers/scsi/bfa/include/bfa.h index 9519a6d81045..d52b32f5695c 100644 --- a/drivers/scsi/bfa/include/bfa.h +++ b/drivers/scsi/bfa/include/bfa.h | |||
@@ -126,6 +126,8 @@ struct bfa_sge_s { | |||
126 | bfa_ioc_get_type(&(__bfa)->ioc) | 126 | bfa_ioc_get_type(&(__bfa)->ioc) |
127 | #define bfa_get_mac(__bfa) \ | 127 | #define bfa_get_mac(__bfa) \ |
128 | bfa_ioc_get_mac(&(__bfa)->ioc) | 128 | bfa_ioc_get_mac(&(__bfa)->ioc) |
129 | #define bfa_get_mfg_mac(__bfa) \ | ||
130 | bfa_ioc_get_mfg_mac(&(__bfa)->ioc) | ||
129 | #define bfa_get_fw_clock_res(__bfa) \ | 131 | #define bfa_get_fw_clock_res(__bfa) \ |
130 | ((__bfa)->iocfc.cfgrsp->fwcfg.fw_tick_res) | 132 | ((__bfa)->iocfc.cfgrsp->fwcfg.fw_tick_res) |
131 | 133 | ||
diff --git a/drivers/scsi/bfa/include/bfi/bfi_ioc.h b/drivers/scsi/bfa/include/bfi/bfi_ioc.h index 7c5e6d5716df..450ded6e9bc2 100644 --- a/drivers/scsi/bfa/include/bfi/bfi_ioc.h +++ b/drivers/scsi/bfa/include/bfi/bfi_ioc.h | |||
@@ -50,7 +50,7 @@ struct bfi_ioc_getattr_req_s { | |||
50 | struct bfi_ioc_attr_s { | 50 | struct bfi_ioc_attr_s { |
51 | wwn_t mfg_pwwn; /* Mfg port wwn */ | 51 | wwn_t mfg_pwwn; /* Mfg port wwn */ |
52 | wwn_t mfg_nwwn; /* Mfg node wwn */ | 52 | wwn_t mfg_nwwn; /* Mfg node wwn */ |
53 | mac_t mfg_mac; | 53 | mac_t mfg_mac; /* Mfg mac */ |
54 | u16 rsvd_a; | 54 | u16 rsvd_a; |
55 | wwn_t pwwn; | 55 | wwn_t pwwn; |
56 | wwn_t nwwn; | 56 | wwn_t nwwn; |
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_status.h b/drivers/scsi/bfa/include/defs/bfa_defs_status.h index c8bc60ad2df6..6eb4e62096fc 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_status.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_status.h | |||
@@ -256,8 +256,20 @@ enum bfa_status { | |||
256 | * configuration */ | 256 | * configuration */ |
257 | BFA_STATUS_DEVID_MISSING = 155, /* Boot image is not for the adapter(s) | 257 | BFA_STATUS_DEVID_MISSING = 155, /* Boot image is not for the adapter(s) |
258 | * installed */ | 258 | * installed */ |
259 | BFA_STATUS_BAD_FWCFG = 156, /* Bad firmware configuration */ | 259 | BFA_STATUS_BAD_FWCFG = 156, /* Bad firmware configuration */ |
260 | BFA_STATUS_MAX_VAL /* Unknown error code */ | 260 | BFA_STATUS_CREATE_FILE = 157, /* Failed to create temporary file */ |
261 | BFA_STATUS_INVALID_VENDOR = 158, /* Invalid switch vendor */ | ||
262 | BFA_STATUS_SFP_NOT_READY = 159, /* SFP info is not ready. Retry */ | ||
263 | BFA_STATUS_NO_TOPOLOGY_FOR_CNA = 160, /* Topology command not | ||
264 | * applicable to CNA */ | ||
265 | BFA_STATUS_BOOT_CODE_UPDATED = 161, /* reboot -- -r is needed after | ||
266 | * boot code updated */ | ||
267 | BFA_STATUS_BOOT_VERSION = 162, /* Boot code version not compatible with | ||
268 | * the driver installed */ | ||
269 | BFA_STATUS_CARDTYPE_MISSING = 163, /* Boot image is not for the | ||
270 | * adapter(s) installed */ | ||
271 | BFA_STATUS_INVALID_CARDTYPE = 164, /* Invalid card type provided */ | ||
272 | BFA_STATUS_MAX_VAL /* Unknown error code */ | ||
261 | }; | 273 | }; |
262 | #define bfa_status_t enum bfa_status | 274 | #define bfa_status_t enum bfa_status |
263 | 275 | ||