Commit 50f61b55 authored by James Bottomley's avatar James Bottomley

qla2100 fabric fixes

From: "Andrew Vasquez" <andrew.vasquez@qlogic.com>

Ok, well there aren't too many folks using an QLA2100 in a fabric
topology, if there were, they wouldn't have gotten very far in the
driver load sequence.  I've been able to scrape-up a QLA2100, 1Gig
switch, and an JBOD.  Upon loading the 8.00.00b12k driver, the
firmware successfully logs into the switch, the driver receives a
LOOP_UP event, but, the kernel panics due to NULL pointer dereference
while trying to perform an RFT_ID  -- the attached patch against
current scsi-misc-2.6 fixes that problem.
parent d512a35f
......@@ -1926,10 +1926,6 @@ struct ct_sns_pkt {
#define RFT_ID_SNS_CMD_SIZE 60
#define RFT_ID_SNS_DATA_SIZE 16
#define RFF_ID_SNS_SCMD_LEN 8
#define RFF_ID_SNS_CMD_SIZE 32
#define RFF_ID_SNS_DATA_SIZE 16
#define RNN_ID_SNS_SCMD_LEN 10
#define RNN_ID_SNS_CMD_SIZE 36
#define RNN_ID_SNS_DATA_SIZE 16
......@@ -1965,7 +1961,6 @@ struct sns_cmd_pkt {
} cmd;
uint8_t rft_data[RFT_ID_SNS_DATA_SIZE];
uint8_t rff_data[RFF_ID_SNS_DATA_SIZE];
uint8_t rnn_data[RNN_ID_SNS_DATA_SIZE];
uint8_t gan_data[GA_NXT_SNS_DATA_SIZE];
uint8_t gid_data[GID_PT_SNS_DATA_SIZE];
......
......@@ -34,7 +34,6 @@ static int qla2x00_sns_gid_pt(scsi_qla_host_t *, sw_info_t *);
static int qla2x00_sns_gpn_id(scsi_qla_host_t *, sw_info_t *);
static int qla2x00_sns_gnn_id(scsi_qla_host_t *, sw_info_t *);
static int qla2x00_sns_rft_id(scsi_qla_host_t *);
static int qla2x00_sns_rff_id(scsi_qla_host_t *);
static int qla2x00_sns_rnn_id(scsi_qla_host_t *);
/**
......@@ -113,7 +112,7 @@ qla2x00_ga_nxt(scsi_qla_host_t *ha, fc_port_t *fcport)
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
if (IS_QLA2200(ha)) {
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
return (qla2x00_sns_ga_nxt(ha, fcport));
}
......@@ -201,7 +200,7 @@ qla2x00_gid_pt(scsi_qla_host_t *ha, sw_info_t *list)
struct ct_sns_gid_pt_data *gid_data;
if (IS_QLA2200(ha)) {
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
return (qla2x00_sns_gid_pt(ha, list));
}
......@@ -278,7 +277,7 @@ qla2x00_gpn_id(scsi_qla_host_t *ha, sw_info_t *list)
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
if (IS_QLA2200(ha)) {
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
return (qla2x00_sns_gpn_id(ha, list));
}
......@@ -343,7 +342,7 @@ qla2x00_gnn_id(scsi_qla_host_t *ha, sw_info_t *list)
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
if (IS_QLA2200(ha)) {
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
return (qla2x00_sns_gnn_id(ha, list));
}
......@@ -422,7 +421,7 @@ qla2x00_rft_id(scsi_qla_host_t *ha)
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
if (IS_QLA2200(ha)) {
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
return (qla2x00_sns_rft_id(ha));
}
......@@ -479,8 +478,10 @@ qla2x00_rff_id(scsi_qla_host_t *ha)
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
if (IS_QLA2200(ha)) {
return (qla2x00_sns_rff_id(ha));
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
DEBUG2(printk("scsi(%ld): RFF_ID call unsupported on "
"ISP2100/ISP2200.\n", ha->host_no));
return (QLA_SUCCESS);
}
/* Issue RFF_ID */
......@@ -536,7 +537,7 @@ qla2x00_rnn_id(scsi_qla_host_t *ha)
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
if (IS_QLA2200(ha)) {
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
return (qla2x00_sns_rnn_id(ha));
}
......@@ -595,9 +596,9 @@ qla2x00_rsnn_nn(scsi_qla_host_t *ha)
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
if (IS_QLA2200(ha)) {
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
DEBUG2(printk("scsi(%ld): RSNN_ID call unsupported on "
"ISP2200.\n", ha->host_no));
"ISP2100/ISP2200.\n", ha->host_no));
return (QLA_SUCCESS);
}
......@@ -1003,55 +1004,6 @@ qla2x00_sns_rft_id(scsi_qla_host_t *ha)
return (rval);
}
/**
* qla2x00_sns_rff_id() - SNS Register FC-4 Features (RFF_ID) supported by the
* HBA.
* @ha: HA context
*
* This command uses the old Exectute SNS Command mailbox routine.
*
* Returns 0 on success.
*/
static int
qla2x00_sns_rff_id(scsi_qla_host_t *ha)
{
int rval;
struct sns_cmd_pkt *sns_cmd;
/* Issue RFF_ID. */
/* Prepare SNS command request. */
sns_cmd = qla2x00_prep_sns_cmd(ha, RFF_ID_CMD, RFF_ID_SNS_SCMD_LEN,
RFF_ID_SNS_DATA_SIZE);
/* Prepare SNS command arguments -- port_id, FC-4 feature, FC-4 type */
sns_cmd->p.cmd.param[0] = ha->d_id.b.al_pa;
sns_cmd->p.cmd.param[1] = ha->d_id.b.area;
sns_cmd->p.cmd.param[2] = ha->d_id.b.domain;
sns_cmd->p.cmd.param[6] = 0x08; /* SCSI - FCP */
/* Execute SNS command. */
rval = qla2x00_send_sns(ha, ha->sns_cmd_dma, RFF_ID_SNS_CMD_SIZE / 2,
sizeof(struct sns_cmd_pkt));
if (rval != QLA_SUCCESS) {
/*EMPTY*/
DEBUG2_3(printk("scsi(%ld): RFF_ID Send SNS failed (%d).\n",
ha->host_no, rval));
} else if (sns_cmd->p.rff_data[8] != 0x80 ||
sns_cmd->p.rff_data[9] != 0x02) {
DEBUG2_3(printk("scsi(%ld): RFF_ID failed, rejected request, "
"rff_rsp:\n", ha->host_no));
DEBUG2_3(qla2x00_dump_buffer(sns_cmd->p.rff_data, 16));
rval = QLA_FUNCTION_FAILED;
} else {
DEBUG2(printk("scsi(%ld): RFF_ID exiting normally.\n",
ha->host_no));
}
return (rval);
}
/**
* qla2x00_sns_rnn_id() - SNS Register Node Name (RNN_ID) of the HBA.
* HBA.
......
......@@ -1022,10 +1022,6 @@ qla2x00_configure_hba(scsi_qla_host_t *ha)
ha->loop_id = loop_id;
/* Make sure 2100 only has loop, in case of any firmware bug. */
if (IS_QLA2100(ha))
topo = 0;
/* initialize */
ha->min_external_loopid = SNS_FIRST_LOOP_ID;
ha->operating_mode = LOOP;
......
......@@ -2930,7 +2930,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
}
/* Allocate memory for SNS commands */
if (IS_QLA2200(ha)) {
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
/* Get consistent memory allocated for SNS commands */
ha->sns_cmd = pci_alloc_consistent(ha->pdev,
sizeof(struct sns_cmd_pkt), &ha->sns_cmd_dma);
......@@ -2946,7 +2946,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
continue;
}
memset(ha->sns_cmd, 0, sizeof(struct sns_cmd_pkt));
} else if (!IS_QLA2100(ha)) {
} else {
/* Get consistent memory allocated for MS IOCB */
ha->ms_iocb = pci_alloc_consistent(ha->pdev,
sizeof(ms_iocb_entry_t), &ha->ms_iocb_dma);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment