aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2010-03-19 20:04:02 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 10:45:53 -0400
commit6c452a45e5d8a93812360a5581e93ac5a8776025 (patch)
treed8629b01efa870dc8273158306e35f46259e98a2 /drivers
parentbfdaa761d3f9663a4721f572e093dd2894cedaf9 (diff)
[SCSI] qla2xxx: General checkpatch corrections.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c6
-rw-r--r--drivers/scsi/qla2xxx/qla_bsg.c95
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c4
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c22
5 files changed, 69 insertions, 60 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 90bf7ad42f67..0710e3c8760f 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1177,15 +1177,13 @@ qla24xx_84xx_fw_version_show(struct device *dev,
1177 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); 1177 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1178 struct qla_hw_data *ha = vha->hw; 1178 struct qla_hw_data *ha = vha->hw;
1179 1179
1180 if (IS_QLA84XX(ha) && ha->cs84xx) { 1180 if (IS_QLA84XX(ha) && ha->cs84xx)
1181 if (ha->cs84xx->op_fw_version == 0) { 1181 if (ha->cs84xx->op_fw_version == 0)
1182 rval = qla84xx_verify_chip(vha, status); 1182 rval = qla84xx_verify_chip(vha, status);
1183 }
1184 1183
1185 if ((rval == QLA_SUCCESS) && (status[0] == 0)) 1184 if ((rval == QLA_SUCCESS) && (status[0] == 0))
1186 return snprintf(buf, PAGE_SIZE, "%u\n", 1185 return snprintf(buf, PAGE_SIZE, "%u\n",
1187 (uint32_t)ha->cs84xx->op_fw_version); 1186 (uint32_t)ha->cs84xx->op_fw_version);
1188 }
1189 1187
1190 return snprintf(buf, PAGE_SIZE, "\n"); 1188 return snprintf(buf, PAGE_SIZE, "\n");
1191} 1189}
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index 584c52d134fa..21e5bcd4bb51 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -274,7 +274,7 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
274 274
275 if (!vha->flags.online) { 275 if (!vha->flags.online) {
276 DEBUG2(qla_printk(KERN_WARNING, ha, 276 DEBUG2(qla_printk(KERN_WARNING, ha,
277 "host not online\n")); 277 "host not online\n"));
278 rval = -EIO; 278 rval = -EIO;
279 goto done; 279 goto done;
280 } 280 }
@@ -286,16 +286,16 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
286 rval = -ENOMEM; 286 rval = -ENOMEM;
287 goto done_free_fcport; 287 goto done_free_fcport;
288 } 288 }
289 rsp_sg_cnt = dma_map_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, 289
290 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); 290 rsp_sg_cnt = dma_map_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list,
291 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE);
291 if (!rsp_sg_cnt) { 292 if (!rsp_sg_cnt) {
292 rval = -ENOMEM; 293 rval = -ENOMEM;
293 goto done_free_fcport; 294 goto done_free_fcport;
294 } 295 }
295 296
296 if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) || 297 if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) ||
297 (rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) 298 (rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) {
298 {
299 DEBUG2(printk(KERN_INFO 299 DEBUG2(printk(KERN_INFO
300 "dma mapping resulted in different sg counts \ 300 "dma mapping resulted in different sg counts \
301 [request_sg_cnt: %x dma_request_sg_cnt: %x\ 301 [request_sg_cnt: %x dma_request_sg_cnt: %x\
@@ -310,7 +310,7 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
310 sp = qla2x00_get_ctx_bsg_sp(vha, fcport, sizeof(struct srb_bsg)); 310 sp = qla2x00_get_ctx_bsg_sp(vha, fcport, sizeof(struct srb_bsg));
311 if (!sp) { 311 if (!sp) {
312 rval = -ENOMEM; 312 rval = -ENOMEM;
313 goto done_unmap_sg; 313 goto done_unmap_sg;
314 } 314 }
315 315
316 els = sp->ctx; 316 els = sp->ctx;
@@ -364,10 +364,10 @@ qla2x00_process_ct(struct fc_bsg_job *bsg_job)
364 struct srb_bsg *ct; 364 struct srb_bsg *ct;
365 365
366 /* pass through is supported only for ISP 4Gb or higher */ 366 /* pass through is supported only for ISP 4Gb or higher */
367 if (!IS_FWI2_CAPABLE(ha)) { 367 if (!IS_FWI2_CAPABLE(ha)) {
368 DEBUG2(qla_printk(KERN_INFO, ha, 368 DEBUG2(qla_printk(KERN_INFO, ha,
369 "scsi(%ld):Firmware is not capable to support FC " 369 "scsi(%ld):Firmware is not capable to support FC "
370 "CT pass thru\n", vha->host_no)); 370 "CT pass thru\n", vha->host_no));
371 rval = -EPERM; 371 rval = -EPERM;
372 goto done; 372 goto done;
373 } 373 }
@@ -375,7 +375,7 @@ qla2x00_process_ct(struct fc_bsg_job *bsg_job)
375 req_sg_cnt = 375 req_sg_cnt =
376 dma_map_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, 376 dma_map_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list,
377 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); 377 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE);
378 if (!req_sg_cnt) { 378 if (!req_sg_cnt) {
379 rval = -ENOMEM; 379 rval = -ENOMEM;
380 goto done; 380 goto done;
381 } 381 }
@@ -388,15 +388,14 @@ qla2x00_process_ct(struct fc_bsg_job *bsg_job)
388 } 388 }
389 389
390 if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) || 390 if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) ||
391 (rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) 391 (rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) {
392 {
393 DEBUG2(qla_printk(KERN_WARNING, ha, 392 DEBUG2(qla_printk(KERN_WARNING, ha,
394 "[request_sg_cnt: %x dma_request_sg_cnt: %x\ 393 "[request_sg_cnt: %x dma_request_sg_cnt: %x\
395 reply_sg_cnt: %x dma_reply_sg_cnt: %x]\n", 394 reply_sg_cnt: %x dma_reply_sg_cnt: %x]\n",
396 bsg_job->request_payload.sg_cnt, req_sg_cnt, 395 bsg_job->request_payload.sg_cnt, req_sg_cnt,
397 bsg_job->reply_payload.sg_cnt, rsp_sg_cnt)); 396 bsg_job->reply_payload.sg_cnt, rsp_sg_cnt));
398 rval = -EAGAIN; 397 rval = -EAGAIN;
399 goto done_unmap_sg; 398 goto done_unmap_sg;
400 } 399 }
401 400
402 if (!vha->flags.online) { 401 if (!vha->flags.online) {
@@ -410,17 +409,17 @@ qla2x00_process_ct(struct fc_bsg_job *bsg_job)
410 (bsg_job->request->rqst_data.h_ct.preamble_word1 & 0xFF000000) 409 (bsg_job->request->rqst_data.h_ct.preamble_word1 & 0xFF000000)
411 >> 24; 410 >> 24;
412 switch (loop_id) { 411 switch (loop_id) {
413 case 0xFC: 412 case 0xFC:
414 loop_id = cpu_to_le16(NPH_SNS); 413 loop_id = cpu_to_le16(NPH_SNS);
415 break; 414 break;
416 case 0xFA: 415 case 0xFA:
417 loop_id = vha->mgmt_svr_loop_id; 416 loop_id = vha->mgmt_svr_loop_id;
418 break; 417 break;
419 default: 418 default:
420 DEBUG2(qla_printk(KERN_INFO, ha, 419 DEBUG2(qla_printk(KERN_INFO, ha,
421 "Unknown loop id: %x\n", loop_id)); 420 "Unknown loop id: %x\n", loop_id));
422 rval = -EINVAL; 421 rval = -EINVAL;
423 goto done_unmap_sg; 422 goto done_unmap_sg;
424 } 423 }
425 424
426 /* Allocate a dummy fcport structure, since functions preparing the 425 /* Allocate a dummy fcport structure, since functions preparing the
@@ -429,10 +428,9 @@ qla2x00_process_ct(struct fc_bsg_job *bsg_job)
429 * no fcport structure allocated 428 * no fcport structure allocated
430 */ 429 */
431 fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); 430 fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL);
432 if (!fcport) 431 if (!fcport) {
433 {
434 rval = -ENOMEM; 432 rval = -ENOMEM;
435 goto done_unmap_sg; 433 goto done_unmap_sg;
436 } 434 }
437 435
438 /* Initialize all required fields of fcport */ 436 /* Initialize all required fields of fcport */
@@ -492,7 +490,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
492 char *type; 490 char *type;
493 struct msg_echo_lb elreq; 491 struct msg_echo_lb elreq;
494 uint16_t response[MAILBOX_REGISTER_COUNT]; 492 uint16_t response[MAILBOX_REGISTER_COUNT];
495 uint8_t* fw_sts_ptr; 493 uint8_t *fw_sts_ptr;
496 uint8_t *req_data = NULL; 494 uint8_t *req_data = NULL;
497 dma_addr_t req_data_dma; 495 dma_addr_t req_data_dma;
498 uint32_t req_data_len; 496 uint32_t req_data_len;
@@ -524,7 +522,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
524 if (!elreq.rsp_sg_cnt) { 522 if (!elreq.rsp_sg_cnt) {
525 rval = -ENOMEM; 523 rval = -ENOMEM;
526 goto done_unmap_req_sg; 524 goto done_unmap_req_sg;
527} 525 }
528 526
529 if ((elreq.req_sg_cnt != bsg_job->request_payload.sg_cnt) || 527 if ((elreq.req_sg_cnt != bsg_job->request_payload.sg_cnt) ||
530 (elreq.rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) { 528 (elreq.rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) {
@@ -586,21 +584,21 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
586 } else { 584 } else {
587 type = "FC_BSG_HST_VENDOR_ECHO_DIAG"; 585 type = "FC_BSG_HST_VENDOR_ECHO_DIAG";
588 DEBUG2(qla_printk(KERN_INFO, ha, 586 DEBUG2(qla_printk(KERN_INFO, ha,
589 "scsi(%ld) bsg rqst type: %s\n" ,vha->host_no, type)); 587 "scsi(%ld) bsg rqst type: %s\n", vha->host_no, type));
590 command_sent = INT_DEF_LB_ECHO_CMD; 588 command_sent = INT_DEF_LB_ECHO_CMD;
591 rval = qla2x00_echo_test(vha, &elreq, response); 589 rval = qla2x00_echo_test(vha, &elreq, response);
592 } 590 }
593 591
594 if (rval) { 592 if (rval) {
595 DEBUG2(qla_printk(KERN_WARNING, ha, "scsi(%ld) Vendor " 593 DEBUG2(qla_printk(KERN_WARNING, ha, "scsi(%ld) Vendor "
596 "request %s failed\n", vha->host_no, type)); 594 "request %s failed\n", vha->host_no, type));
597 595
598 fw_sts_ptr = ((uint8_t *)bsg_job->req->sense) + 596 fw_sts_ptr = ((uint8_t *)bsg_job->req->sense) +
599 sizeof(struct fc_bsg_reply); 597 sizeof(struct fc_bsg_reply);
600 598
601 memcpy(fw_sts_ptr, response, sizeof(response)); 599 memcpy(fw_sts_ptr, response, sizeof(response));
602 fw_sts_ptr += sizeof(response); 600 fw_sts_ptr += sizeof(response);
603 *fw_sts_ptr = command_sent; 601 *fw_sts_ptr = command_sent;
604 rval = 0; 602 rval = 0;
605 bsg_job->reply->reply_payload_rcv_len = 0; 603 bsg_job->reply->reply_payload_rcv_len = 0;
606 bsg_job->reply->result = (DID_ERROR << 16); 604 bsg_job->reply->result = (DID_ERROR << 16);
@@ -637,7 +635,7 @@ done_unmap_req_sg:
637 dma_unmap_sg(&ha->pdev->dev, 635 dma_unmap_sg(&ha->pdev->dev,
638 bsg_job->request_payload.sg_list, 636 bsg_job->request_payload.sg_list,
639 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); 637 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE);
640 return rval; 638 return rval;
641} 639}
642 640
643static int 641static int
@@ -975,7 +973,8 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
975 bsg_job->reply_payload.payload_len; 973 bsg_job->reply_payload.payload_len;
976 974
977 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, 975 sg_copy_from_buffer(bsg_job->reply_payload.sg_list,
978 bsg_job->reply_payload.sg_cnt, mgmt_b, data_len); 976 bsg_job->reply_payload.sg_cnt, mgmt_b,
977 data_len);
979 } 978 }
980 } 979 }
981 980
@@ -1062,7 +1061,8 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
1062 1061
1063 if (rval) { 1062 if (rval) {
1064 DEBUG16(printk(KERN_ERR "scsi(%ld): iIDMA cmd failed for " 1063 DEBUG16(printk(KERN_ERR "scsi(%ld): iIDMA cmd failed for "
1065 "%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n", 1064 "%02x%02x%02x%02x%02x%02x%02x%02x -- "
1065 "%04x %x %04x %04x.\n",
1066 vha->host_no, fcport->port_name[0], 1066 vha->host_no, fcport->port_name[0],
1067 fcport->port_name[1], 1067 fcport->port_name[1],
1068 fcport->port_name[2], fcport->port_name[3], 1068 fcport->port_name[2], fcport->port_name[3],
@@ -1142,7 +1142,7 @@ qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
1142 default: 1142 default:
1143 DEBUG2(printk("qla2xxx: unsupported BSG request\n")); 1143 DEBUG2(printk("qla2xxx: unsupported BSG request\n"));
1144 break; 1144 break;
1145 } 1145 }
1146 return ret; 1146 return ret;
1147} 1147}
1148 1148
@@ -1164,23 +1164,26 @@ qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job)
1164 if (!req) 1164 if (!req)
1165 continue; 1165 continue;
1166 1166
1167 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++ ) { 1167 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
1168 sp = req->outstanding_cmds[cnt]; 1168 sp = req->outstanding_cmds[cnt];
1169
1170 if (sp) { 1169 if (sp) {
1171 sp_bsg = (struct srb_bsg*)sp->ctx; 1170 sp_bsg = (struct srb_bsg *)sp->ctx;
1172 1171
1173 if (((sp_bsg->ctx.type == SRB_CT_CMD) || 1172 if (((sp_bsg->ctx.type == SRB_CT_CMD) ||
1174 (sp_bsg->ctx.type == SRB_ELS_CMD_HST)) 1173 (sp_bsg->ctx.type == SRB_ELS_CMD_HST))
1175 && (sp_bsg->bsg_job == bsg_job)) { 1174 && (sp_bsg->bsg_job == bsg_job)) {
1176 if (ha->isp_ops->abort_command(sp)) { 1175 if (ha->isp_ops->abort_command(sp)) {
1177 DEBUG2(qla_printk(KERN_INFO, ha, 1176 DEBUG2(qla_printk(KERN_INFO, ha,
1178 "scsi(%ld): mbx abort_command failed\n", vha->host_no)); 1177 "scsi(%ld): mbx "
1178 "abort_command failed\n",
1179 vha->host_no));
1179 bsg_job->req->errors = 1180 bsg_job->req->errors =
1180 bsg_job->reply->result = -EIO; 1181 bsg_job->reply->result = -EIO;
1181 } else { 1182 } else {
1182 DEBUG2(qla_printk(KERN_INFO, ha, 1183 DEBUG2(qla_printk(KERN_INFO, ha,
1183 "scsi(%ld): mbx abort_command success\n", vha->host_no)); 1184 "scsi(%ld): mbx "
1185 "abort_command success\n",
1186 vha->host_no));
1184 bsg_job->req->errors = 1187 bsg_job->req->errors =
1185 bsg_job->reply->result = 0; 1188 bsg_job->reply->result = 0;
1186 } 1189 }
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index e7fe11486bb8..8517aa49744a 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -340,7 +340,7 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
340 ha->flags.chip_reset_done = 1; 340 ha->flags.chip_reset_done = 1;
341 341
342 if (rval == QLA_SUCCESS && IS_QLA84XX(ha)) { 342 if (rval == QLA_SUCCESS && IS_QLA84XX(ha)) {
343 /* Issue verify 84xx FW IOCB to complete 84xx initialization */ 343 /* Issue verify 84xx FW IOCB to complete 84xx initialization */
344 rval = qla84xx_init_chip(vha); 344 rval = qla84xx_init_chip(vha);
345 if (rval != QLA_SUCCESS) { 345 if (rval != QLA_SUCCESS) {
346 qla_printk(KERN_ERR, ha, 346 qla_printk(KERN_ERR, ha,
@@ -4924,7 +4924,7 @@ qla81xx_update_fw_options(scsi_qla_host_t *vha)
4924 * fcport = port structure pointer. 4924 * fcport = port structure pointer.
4925 * 4925 *
4926 * Return: 4926 * Return:
4927 * non-zero (if found) 4927 * non-zero (if found)
4928 * 0 (if not found) 4928 * 0 (if not found)
4929 * 4929 *
4930 * Context: 4930 * Context:
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index e9c9f82c1d87..bce6cd47e3c3 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -3840,7 +3840,7 @@ qla2x00_write_ram_word(scsi_qla_host_t *vha, uint32_t risc_addr, uint32_t data)
3840 mbx_cmd_t *mcp = &mc; 3840 mbx_cmd_t *mcp = &mc;
3841 3841
3842 if (!IS_FWI2_CAPABLE(vha->hw)) 3842 if (!IS_FWI2_CAPABLE(vha->hw))
3843 return QLA_FUNCTION_FAILED; 3843 return QLA_FUNCTION_FAILED;
3844 3844
3845 DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no)); 3845 DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no));
3846 3846
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 48c37e38ed01..6bdc7de82c5b 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1130,18 +1130,26 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)
1130 qla2x00_sp_compl(ha, sp); 1130 qla2x00_sp_compl(ha, sp);
1131 } else { 1131 } else {
1132 ctx = sp->ctx; 1132 ctx = sp->ctx;
1133 if (ctx->type == SRB_LOGIN_CMD || ctx->type == SRB_LOGOUT_CMD) { 1133 if (ctx->type == SRB_LOGIN_CMD ||
1134 ctx->type == SRB_LOGOUT_CMD) {
1134 del_timer_sync(&ctx->timer); 1135 del_timer_sync(&ctx->timer);
1135 ctx->free(sp); 1136 ctx->free(sp);
1136 } else { 1137 } else {
1137 struct srb_bsg* sp_bsg = (struct srb_bsg*)sp->ctx; 1138 struct srb_bsg *sp_bsg =
1138 if (sp_bsg->bsg_job->request->msgcode == FC_BSG_HST_CT) 1139 (struct srb_bsg *)sp->ctx;
1140 struct fc_bsg_job *bsg_job =
1141 sp_bsg->bsg_job;
1142
1143 if (bsg_job->request->msgcode
1144 == FC_BSG_HST_CT)
1139 kfree(sp->fcport); 1145 kfree(sp->fcport);
1140 sp_bsg->bsg_job->req->errors = 0; 1146 bsg_job->req->errors = 0;
1141 sp_bsg->bsg_job->reply->result = res; 1147 bsg_job->reply->result = res;
1142 sp_bsg->bsg_job->job_done(sp_bsg->bsg_job); 1148 bsg_job->job_done(
1149 sp_bsg->bsg_job);
1143 kfree(sp->ctx); 1150 kfree(sp->ctx);
1144 mempool_free(sp, ha->srb_mempool); 1151 mempool_free(sp,
1152 ha->srb_mempool);
1145 } 1153 }
1146 } 1154 }
1147 } 1155 }