aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_gs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_gs.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_gs.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 97fbc62ec669..ec5b2dd90d6a 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -127,8 +127,8 @@ qla2x00_chk_ms_status(scsi_qla_host_t *ha, ms_iocb_entry_t *ms_pkt,
127 ha->host_no, routine, ms_pkt->entry_status)); 127 ha->host_no, routine, ms_pkt->entry_status));
128 } else { 128 } else {
129 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) 129 if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
130 comp_status = 130 comp_status = le16_to_cpu(
131 ((struct ct_entry_24xx *)ms_pkt)->comp_status; 131 ((struct ct_entry_24xx *)ms_pkt)->comp_status);
132 else 132 else
133 comp_status = le16_to_cpu(ms_pkt->status); 133 comp_status = le16_to_cpu(ms_pkt->status);
134 switch (comp_status) { 134 switch (comp_status) {
@@ -143,6 +143,7 @@ qla2x00_chk_ms_status(scsi_qla_host_t *ha, ms_iocb_entry_t *ms_pkt,
143 DEBUG2_3(qla2x00_dump_buffer( 143 DEBUG2_3(qla2x00_dump_buffer(
144 (uint8_t *)&ct_rsp->header, 144 (uint8_t *)&ct_rsp->header,
145 sizeof(struct ct_rsp_hdr))); 145 sizeof(struct ct_rsp_hdr)));
146 rval = QLA_INVALID_COMMAND;
146 } else 147 } else
147 rval = QLA_SUCCESS; 148 rval = QLA_SUCCESS;
148 break; 149 break;
@@ -1683,7 +1684,7 @@ qla2x00_gfpn_id(scsi_qla_host_t *ha, sw_info_t *list)
1683 memset(list[i].fabric_port_name, 0, WWN_SIZE); 1684 memset(list[i].fabric_port_name, 0, WWN_SIZE);
1684 1685
1685 /* Prepare common MS IOCB */ 1686 /* Prepare common MS IOCB */
1686 ms_pkt = qla2x00_prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, 1687 ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GFPN_ID_REQ_SIZE,
1687 GFPN_ID_RSP_SIZE); 1688 GFPN_ID_RSP_SIZE);
1688 1689
1689 /* Prepare CT request */ 1690 /* Prepare CT request */
@@ -1784,6 +1785,8 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
1784 1785
1785 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) 1786 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
1786 return QLA_FUNCTION_FAILED; 1787 return QLA_FUNCTION_FAILED;
1788 if (!ha->flags.gpsc_supported)
1789 return QLA_FUNCTION_FAILED;
1787 1790
1788 rval = qla2x00_mgmt_svr_login(ha); 1791 rval = qla2x00_mgmt_svr_login(ha);
1789 if (rval) 1792 if (rval)
@@ -1813,8 +1816,19 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
1813 /*EMPTY*/ 1816 /*EMPTY*/
1814 DEBUG2_3(printk("scsi(%ld): GPSC issue IOCB " 1817 DEBUG2_3(printk("scsi(%ld): GPSC issue IOCB "
1815 "failed (%d).\n", ha->host_no, rval)); 1818 "failed (%d).\n", ha->host_no, rval));
1816 } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, 1819 } else if ((rval = qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp,
1817 "GPSC") != QLA_SUCCESS) { 1820 "GPSC")) != QLA_SUCCESS) {
1821 /* FM command unsupported? */
1822 if (rval == QLA_INVALID_COMMAND &&
1823 ct_rsp->header.reason_code ==
1824 CT_REASON_INVALID_COMMAND_CODE) {
1825 DEBUG2(printk("scsi(%ld): GPSC command "
1826 "unsupported, disabling query...\n",
1827 ha->host_no));
1828 ha->flags.gpsc_supported = 0;
1829 rval = QLA_FUNCTION_FAILED;
1830 break;
1831 }
1818 rval = QLA_FUNCTION_FAILED; 1832 rval = QLA_FUNCTION_FAILED;
1819 } else { 1833 } else {
1820 /* Save portname */ 1834 /* Save portname */