Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Krishna Gudipati and committed by
James Bottomley
b480a32e ea5d7c9e

+11 -10
+2 -2
drivers/scsi/bfa/bfa_fcs.h
··· 642 642 u8 model[16]; 643 643 u8 model_desc[256]; 644 644 u8 hw_version[8]; 645 - u8 driver_version[8]; 645 + u8 driver_version[BFA_VERSION_LEN]; 646 646 u8 option_rom_ver[BFA_VERSION_LEN]; 647 - u8 fw_version[8]; 647 + u8 fw_version[BFA_VERSION_LEN]; 648 648 u8 os_name[256]; 649 649 __be32 max_ct_pyld; 650 650 };
+7 -7
drivers/scsi/bfa/bfa_fcs_lport.c
··· 2014 2014 sizeof(templen)); 2015 2015 } 2016 2016 2017 - /* 2018 - * f/w Version = driver version 2019 - */ 2020 2017 attr = (struct fdmi_attr_s *) curr_ptr; 2021 2018 attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_FW_VERSION); 2022 - templen = (u16) strlen(fcs_hba_attr->driver_version); 2023 - memcpy(attr->value, fcs_hba_attr->driver_version, templen); 2019 + templen = (u16) strlen(fcs_hba_attr->fw_version); 2020 + memcpy(attr->value, fcs_hba_attr->fw_version, templen); 2024 2021 templen = fc_roundup(templen, sizeof(u32)); 2025 2022 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; 2026 2023 len += templen; ··· 2419 2422 { 2420 2423 struct bfa_fcs_lport_s *port = fdmi->ms->port; 2421 2424 struct bfa_fcs_driver_info_s *driver_info = &port->fcs->driver_info; 2425 + struct bfa_fcs_fdmi_port_attr_s fcs_port_attr; 2422 2426 2423 2427 memset(hba_attr, 0, sizeof(struct bfa_fcs_fdmi_hba_attr_s)); 2424 2428 ··· 2455 2457 sizeof(driver_info->host_os_patch)); 2456 2458 } 2457 2459 2458 - hba_attr->max_ct_pyld = cpu_to_be32(FC_MAX_PDUSZ); 2460 + /* Retrieve the max frame size from the port attr */ 2461 + bfa_fcs_fdmi_get_portattr(fdmi, &fcs_port_attr); 2462 + hba_attr->max_ct_pyld = fcs_port_attr.max_frm_size; 2459 2463 } 2460 2464 2461 2465 static void ··· 2517 2517 /* 2518 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 2523 * OS device Name
+2 -1
drivers/scsi/bfa/bfa_ioc.h
··· 761 761 #define bfa_ioc_maxfrsize(__ioc) ((__ioc)->attr->maxfrsize) 762 762 #define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit) 763 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 766 #define bfa_ioc_get_nports(__ioc) \ 766 767 BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop) 767 768