aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorHarish Zunjarrao <harish.zunjarrao@qlogic.com>2010-07-23 06:28:33 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:06:14 -0400
commit08f71e090d3f0d8136c3f350e5082f9217fb7d5b (patch)
tree1aec52da2b9b481b71948c534991c7c1b02af18c /drivers/scsi/qla2xxx
parent9bc4f4fb44d22e5edc9369c87585a3b492073b8b (diff)
[SCSI] qla2xxx: Do not allow ELS Passthru commands for ISP23xx adapters
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_bsg.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index 04ead0620d5f..6b863f789c4d 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -229,7 +229,7 @@ static int
229qla2x00_process_els(struct fc_bsg_job *bsg_job) 229qla2x00_process_els(struct fc_bsg_job *bsg_job)
230{ 230{
231 struct fc_rport *rport; 231 struct fc_rport *rport;
232 fc_port_t *fcport; 232 fc_port_t *fcport = NULL;
233 struct Scsi_Host *host; 233 struct Scsi_Host *host;
234 scsi_qla_host_t *vha; 234 scsi_qla_host_t *vha;
235 struct qla_hw_data *ha; 235 struct qla_hw_data *ha;
@@ -240,6 +240,29 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
240 uint16_t nextlid = 0; 240 uint16_t nextlid = 0;
241 struct srb_ctx *els; 241 struct srb_ctx *els;
242 242
243 if (bsg_job->request->msgcode == FC_BSG_RPT_ELS) {
244 rport = bsg_job->rport;
245 fcport = *(fc_port_t **) rport->dd_data;
246 host = rport_to_shost(rport);
247 vha = shost_priv(host);
248 ha = vha->hw;
249 type = "FC_BSG_RPT_ELS";
250 } else {
251 host = bsg_job->shost;
252 vha = shost_priv(host);
253 ha = vha->hw;
254 type = "FC_BSG_HST_ELS_NOLOGIN";
255 }
256
257 /* pass through is supported only for ISP 4Gb or higher */
258 if (!IS_FWI2_CAPABLE(ha)) {
259 DEBUG2(qla_printk(KERN_INFO, ha,
260 "scsi(%ld):ELS passthru not supported for ISP23xx based "
261 "adapters\n", vha->host_no));
262 rval = -EPERM;
263 goto done;
264 }
265
243 /* Multiple SG's are not supported for ELS requests */ 266 /* Multiple SG's are not supported for ELS requests */
244 if (bsg_job->request_payload.sg_cnt > 1 || 267 if (bsg_job->request_payload.sg_cnt > 1 ||
245 bsg_job->reply_payload.sg_cnt > 1) { 268 bsg_job->reply_payload.sg_cnt > 1) {
@@ -254,13 +277,6 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
254 277
255 /* ELS request for rport */ 278 /* ELS request for rport */
256 if (bsg_job->request->msgcode == FC_BSG_RPT_ELS) { 279 if (bsg_job->request->msgcode == FC_BSG_RPT_ELS) {
257 rport = bsg_job->rport;
258 fcport = *(fc_port_t **) rport->dd_data;
259 host = rport_to_shost(rport);
260 vha = shost_priv(host);
261 ha = vha->hw;
262 type = "FC_BSG_RPT_ELS";
263
264 /* make sure the rport is logged in, 280 /* make sure the rport is logged in,
265 * if not perform fabric login 281 * if not perform fabric login
266 */ 282 */
@@ -272,11 +288,6 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
272 goto done; 288 goto done;
273 } 289 }
274 } else { 290 } else {
275 host = bsg_job->shost;
276 vha = shost_priv(host);
277 ha = vha->hw;
278 type = "FC_BSG_HST_ELS_NOLOGIN";
279
280 /* Allocate a dummy fcport structure, since functions 291 /* Allocate a dummy fcport structure, since functions
281 * preparing the IOCB and mailbox command retrieves port 292 * preparing the IOCB and mailbox command retrieves port
282 * specific information from fcport structure. For Host based 293 * specific information from fcport structure. For Host based