[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>
This commit is contained in:
Krishna Gudipati 2012-09-21 17:25:20 -07:00 committed by James Bottomley
parent ea5d7c9ecb
commit b480a32e69
3 changed files with 11 additions and 10 deletions

View File

@ -642,9 +642,9 @@ struct bfa_fcs_fdmi_hba_attr_s {
u8 model[16]; u8 model[16];
u8 model_desc[256]; u8 model_desc[256];
u8 hw_version[8]; u8 hw_version[8];
u8 driver_version[8]; u8 driver_version[BFA_VERSION_LEN];
u8 option_rom_ver[BFA_VERSION_LEN]; u8 option_rom_ver[BFA_VERSION_LEN];
u8 fw_version[8]; u8 fw_version[BFA_VERSION_LEN];
u8 os_name[256]; u8 os_name[256];
__be32 max_ct_pyld; __be32 max_ct_pyld;
}; };

View File

@ -2014,13 +2014,10 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
sizeof(templen)); sizeof(templen));
} }
/*
* f/w Version = driver version
*/
attr = (struct fdmi_attr_s *) curr_ptr; attr = (struct fdmi_attr_s *) curr_ptr;
attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_FW_VERSION); attr->type = cpu_to_be16(FDMI_HBA_ATTRIB_FW_VERSION);
templen = (u16) strlen(fcs_hba_attr->driver_version); templen = (u16) strlen(fcs_hba_attr->fw_version);
memcpy(attr->value, fcs_hba_attr->driver_version, templen); memcpy(attr->value, fcs_hba_attr->fw_version, templen);
templen = fc_roundup(templen, sizeof(u32)); templen = fc_roundup(templen, sizeof(u32));
curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
len += templen; len += templen;
@ -2422,6 +2419,7 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s *fdmi,
{ {
struct bfa_fcs_lport_s *port = fdmi->ms->port; struct bfa_fcs_lport_s *port = fdmi->ms->port;
struct bfa_fcs_driver_info_s *driver_info = &port->fcs->driver_info; struct bfa_fcs_driver_info_s *driver_info = &port->fcs->driver_info;
struct bfa_fcs_fdmi_port_attr_s fcs_port_attr;
memset(hba_attr, 0, sizeof(struct bfa_fcs_fdmi_hba_attr_s)); memset(hba_attr, 0, sizeof(struct bfa_fcs_fdmi_hba_attr_s));
@ -2457,7 +2455,9 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s *fdmi,
sizeof(driver_info->host_os_patch)); sizeof(driver_info->host_os_patch));
} }
hba_attr->max_ct_pyld = cpu_to_be32(FC_MAX_PDUSZ); /* Retrieve the max frame size from the port attr */
bfa_fcs_fdmi_get_portattr(fdmi, &fcs_port_attr);
hba_attr->max_ct_pyld = fcs_port_attr.max_frm_size;
} }
static void static void
@ -2517,7 +2517,7 @@ bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi,
/* /*
* Max PDU Size. * Max PDU Size.
*/ */
port_attr->max_frm_size = cpu_to_be32(FC_MAX_PDUSZ); port_attr->max_frm_size = cpu_to_be32(pport_attr.pport_cfg.maxfrsize);
/* /*
* OS device Name * OS device Name

View File

@ -761,7 +761,8 @@ bfa_status_t bfa_dconf_update(struct bfa_s *bfa);
#define bfa_ioc_maxfrsize(__ioc) ((__ioc)->attr->maxfrsize) #define bfa_ioc_maxfrsize(__ioc) ((__ioc)->attr->maxfrsize)
#define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit) #define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit)
#define bfa_ioc_speed_sup(__ioc) \ #define bfa_ioc_speed_sup(__ioc) \
BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop) ((bfa_ioc_is_cna(__ioc)) ? BFA_PORT_SPEED_10GBPS : \
BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop))
#define bfa_ioc_get_nports(__ioc) \ #define bfa_ioc_get_nports(__ioc) \
BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop) BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop)