aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx
diff options
context:
space:
mode:
authorVikas Chaudhary <vikas.chaudhary@qlogic.com>2010-07-30 04:57:45 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-08-06 12:59:28 -0400
commit2ccdf0dce41a39db3721fe801dac5c5effa8e4be (patch)
tree47d765c0d9a207f13548a1ae6fc86cff6fec0a4e /drivers/scsi/qla4xxx
parent0753b4871d5b09687cee652b380a6ca15aee330e (diff)
[SCSI] qla4xxx: updated mbx_sys_info struct to sync with FW 4.6.x
Also, changed boundary checking from size of total structure to verification that we received the amount of data needed to cache inernally. This change will provide compatibility with mbx_sys_info structure sizes in both older and newer firmware versions. Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: Ravi Anand <ravi.anand@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r--drivers/scsi/qla4xxx/ql4_fw.h20
-rw-r--r--drivers/scsi/qla4xxx/ql4_nx.c3
2 files changed, 12 insertions, 11 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index c94c9ddfb3a6..0336c6db8cb3 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -673,17 +673,17 @@ struct flash_sys_info {
673}; /* 200 */ 673}; /* 200 */
674 674
675struct mbx_sys_info { 675struct mbx_sys_info {
676 uint8_t board_id_str[16]; /* Keep board ID string first */ 676 uint8_t board_id_str[16]; /* 0-f Keep board ID string first */
677 /* in this structure for GUI. */ 677 /* in this structure for GUI. */
678 uint16_t board_id; /* board ID code */ 678 uint16_t board_id; /* 10-11 board ID code */
679 uint16_t phys_port_cnt; /* number of physical network ports */ 679 uint16_t phys_port_cnt; /* 12-13 number of physical network ports */
680 uint16_t port_num; /* network port for this PCI function */ 680 uint16_t port_num; /* 14-15 network port for this PCI function */
681 /* (port 0 is first port) */ 681 /* (port 0 is first port) */
682 uint8_t mac_addr[6]; /* MAC address for this PCI function */ 682 uint8_t mac_addr[6]; /* 16-1b MAC address for this PCI function */
683 uint32_t iscsi_pci_func_cnt; /* number of iSCSI PCI functions */ 683 uint32_t iscsi_pci_func_cnt; /* 1c-1f number of iSCSI PCI functions */
684 uint32_t pci_func; /* this PCI function */ 684 uint32_t pci_func; /* 20-23 this PCI function */
685 unsigned char serial_number[16]; /* serial number string */ 685 unsigned char serial_number[16]; /* 24-33 serial number string */
686 uint8_t reserved[16]; 686 uint8_t reserved[12]; /* 34-3f */
687}; 687};
688 688
689struct crash_record { 689struct crash_record {
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index 3e119ae78397..ec46651100cb 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -2145,7 +2145,8 @@ int qla4_8xxx_get_sys_info(struct scsi_qla_host *ha)
2145 goto exit_validate_mac82; 2145 goto exit_validate_mac82;
2146 } 2146 }
2147 2147
2148 if (mbox_sts[4] < sizeof(*sys_info)) { 2148 /* Make sure we receive the minimum required data to cache internally */
2149 if (mbox_sts[4] < offsetof(struct mbx_sys_info, reserved)) {
2149 DEBUG2(printk("scsi%ld: %s: GET_SYS_INFO data receive" 2150 DEBUG2(printk("scsi%ld: %s: GET_SYS_INFO data receive"
2150 " error (%x)\n", ha->host_no, __func__, mbox_sts[4])); 2151 " error (%x)\n", ha->host_no, __func__, mbox_sts[4]));
2151 goto exit_validate_mac82; 2152 goto exit_validate_mac82;