diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2012-09-21 20:25:20 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-10-07 06:15:13 -0400 |
commit | b480a32e69b7b3c88c8459c229146f1d47763a02 (patch) | |
tree | 7cb8421700e8017083456831b58177e0aa5ee87e /drivers/scsi/bfa | |
parent | ea5d7c9ecb08d65af9ebf8db113e576430a6a14f (diff) |
[SCSI] bfa: Fix few attributes in the RHBA CT passthru command
- Made changes to set the RHBA command max payload based on
the port configured frame size.
- Made changes to fix the driver/fw version size in FMDI structure.
- Fix to pass the fw version for FDMI attribute type
FDMI_HBA_ATTRIB_FW_VERSION rather than driver version.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs.h | 4 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs_lport.c | 14 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.h | 3 |
3 files changed, 11 insertions, 10 deletions
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h index f2a6a3c0e002..a449706c6bc0 100644 --- a/drivers/scsi/bfa/bfa_fcs.h +++ b/drivers/scsi/bfa/bfa_fcs.h | |||
@@ -642,9 +642,9 @@ struct bfa_fcs_fdmi_hba_attr_s { | |||
642 | u8 model[16]; | 642 | u8 model[16]; |
643 | u8 model_desc[256]; | 643 | u8 model_desc[256]; |
644 | u8 hw_version[8]; | 644 | u8 hw_version[8]; |
645 | u8 driver_version[8]; | 645 | u8 driver_version[BFA_VERSION_LEN]; |
646 | u8 option_rom_ver[BFA_VERSION_LEN]; | 646 | u8 option_rom_ver[BFA_VERSION_LEN]; |
647 | u8 fw_version[8]; | 647 | u8 fw_version[BFA_VERSION_LEN]; |
648 | u8 os_name[256]; | 648 | u8 os_name[256]; |
649 | __be32 max_ct_pyld; | 649 | __be32 max_ct_pyld; |
650 | }; | 650 | }; |
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index c58a5e03d56f..1224d0462a49 100644 --- a/drivers/scsi/bfa/bfa_fcs_lport.c +++ b/drivers/scsi/bfa/bfa_fcs_lport.c | |||
@@ -2014,13 +2014,10 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld) | |||
2014 | sizeof(templen)); | 2014 | sizeof(templen)); |
2015 | } | 2015 | } |
2016 | 2016 | ||
2017 | /* | ||
2018 | * f/w Version = driver version | ||
2019 | */ | ||
2020 | attr = (struct fdmi_attr_s *) curr_ptr; | 2017 | attr = (struct fdmi_attr_s *) curr_ptr; |
2021 | attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_FW_VERSION); | 2018 | attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_FW_VERSION); |
2022 | templen = (u16) strlen(fcs_hba_attr->driver_version); | 2019 | templen = (u16) strlen(fcs_hba_attr->fw_version); |
2023 | memcpy(attr->value, fcs_hba_attr->driver_version, templen); | 2020 | memcpy(attr->value, fcs_hba_attr->fw_version, templen); |
2024 | templen = fc_roundup(templen, sizeof(u32)); | 2021 | templen = fc_roundup(templen, sizeof(u32)); |
2025 | curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; | 2022 | curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; |
2026 | len += templen; | 2023 | len += templen; |
@@ -2422,6 +2419,7 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s *fdmi, | |||
2422 | { | 2419 | { |
2423 | struct bfa_fcs_lport_s *port = fdmi->ms->port; | 2420 | struct bfa_fcs_lport_s *port = fdmi->ms->port; |
2424 | struct bfa_fcs_driver_info_s *driver_info = &port->fcs->driver_info; | 2421 | struct bfa_fcs_driver_info_s *driver_info = &port->fcs->driver_info; |
2422 | struct bfa_fcs_fdmi_port_attr_s fcs_port_attr; | ||
2425 | 2423 | ||
2426 | memset(hba_attr, 0, sizeof(struct bfa_fcs_fdmi_hba_attr_s)); | 2424 | memset(hba_attr, 0, sizeof(struct bfa_fcs_fdmi_hba_attr_s)); |
2427 | 2425 | ||
@@ -2457,7 +2455,9 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s *fdmi, | |||
2457 | sizeof(driver_info->host_os_patch)); | 2455 | sizeof(driver_info->host_os_patch)); |
2458 | } | 2456 | } |
2459 | 2457 | ||
2460 | hba_attr->max_ct_pyld = cpu_to_be32(FC_MAX_PDUSZ); | 2458 | /* Retrieve the max frame size from the port attr */ |
2459 | bfa_fcs_fdmi_get_portattr(fdmi, &fcs_port_attr); | ||
2460 | hba_attr->max_ct_pyld = fcs_port_attr.max_frm_size; | ||
2461 | } | 2461 | } |
2462 | 2462 | ||
2463 | static void | 2463 | static void |
@@ -2517,7 +2517,7 @@ bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi, | |||
2517 | /* | 2517 | /* |
2518 | * Max PDU Size. | 2518 | * Max PDU Size. |
2519 | */ | 2519 | */ |
2520 | port_attr->max_frm_size = cpu_to_be32(FC_MAX_PDUSZ); | 2520 | port_attr->max_frm_size = cpu_to_be32(pport_attr.pport_cfg.maxfrsize); |
2521 | 2521 | ||
2522 | /* | 2522 | /* |
2523 | * OS device Name | 2523 | * OS device Name |
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index b2856f96567c..f16ebc92d1ef 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h | |||
@@ -761,7 +761,8 @@ bfa_status_t bfa_dconf_update(struct bfa_s *bfa); | |||
761 | #define bfa_ioc_maxfrsize(__ioc) ((__ioc)->attr->maxfrsize) | 761 | #define bfa_ioc_maxfrsize(__ioc) ((__ioc)->attr->maxfrsize) |
762 | #define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit) | 762 | #define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit) |
763 | #define bfa_ioc_speed_sup(__ioc) \ | 763 | #define bfa_ioc_speed_sup(__ioc) \ |
764 | BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop) | 764 | ((bfa_ioc_is_cna(__ioc)) ? BFA_PORT_SPEED_10GBPS : \ |
765 | BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop)) | ||
765 | #define bfa_ioc_get_nports(__ioc) \ | 766 | #define bfa_ioc_get_nports(__ioc) \ |
766 | BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop) | 767 | BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop) |
767 | 768 | ||