aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJitendra Bhivare <jitendra.bhivare@broadcom.com>2016-02-04 05:19:12 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2016-02-23 21:27:02 -0500
commit88840332a0f05833b2fea6c69584b5d20eb19ad8 (patch)
tree5ec656b3fe3e92405815c530b6f0a05387c6a990
parent2e4e8f6574ab14937ca6aac9c9551876e744154d (diff)
be2iscsi: Rename MCC and BMBX processing functions
beiscsi_mccq_compl -> beiscsi_mccq_compl_wait - indicate blocking call. be_mcc_wait_compl -> be_mcc_compl_poll - indicate polling for completion. be_mbox_db_ready_wait -> be_mbox_db_ready_poll - indicate polling for RDY. be_mcc_compl_process -> beiscsi_process_mbox_compl - indicate BMBX compl. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/be2iscsi/be_cmds.c38
-rw-r--r--drivers/scsi/be2iscsi/be_cmds.h6
-rw-r--r--drivers/scsi/be2iscsi/be_iscsi.c8
-rw-r--r--drivers/scsi/be2iscsi/be_main.c8
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c12
5 files changed, 36 insertions, 36 deletions
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
index f59dbdf465f5..1fe8eb84333a 100644
--- a/drivers/scsi/be2iscsi/be_cmds.c
+++ b/drivers/scsi/be2iscsi/be_cmds.c
@@ -140,7 +140,7 @@ unsigned int alloc_mcc_tag(struct beiscsi_hba *phba)
140} 140}
141 141
142/* 142/*
143 * beiscsi_mccq_compl()- Wait for completion of MBX 143 * beiscsi_mccq_compl_wait()- Process completion in MCC CQ
144 * @phba: Driver private structure 144 * @phba: Driver private structure
145 * @tag: Tag for the MBX Command 145 * @tag: Tag for the MBX Command
146 * @wrb: the WRB used for the MBX Command 146 * @wrb: the WRB used for the MBX Command
@@ -152,9 +152,9 @@ unsigned int alloc_mcc_tag(struct beiscsi_hba *phba)
152 * Success: 0 152 * Success: 0
153 * Failure: Non-Zero 153 * Failure: Non-Zero
154 **/ 154 **/
155int beiscsi_mccq_compl(struct beiscsi_hba *phba, 155int beiscsi_mccq_compl_wait(struct beiscsi_hba *phba,
156 uint32_t tag, struct be_mcc_wrb **wrb, 156 uint32_t tag, struct be_mcc_wrb **wrb,
157 struct be_dma_mem *mbx_cmd_mem) 157 struct be_dma_mem *mbx_cmd_mem)
158{ 158{
159 int rc = 0; 159 int rc = 0;
160 uint32_t mcc_tag_status; 160 uint32_t mcc_tag_status;
@@ -283,7 +283,7 @@ static inline void be_mcc_compl_use(struct be_mcc_compl *compl)
283} 283}
284 284
285/* 285/*
286 * be_mcc_compl_process()- Check the MBX comapletion status 286 * beiscsi_process_mbox_compl()- Check the MBX completion status
287 * @ctrl: Function specific MBX data structure 287 * @ctrl: Function specific MBX data structure
288 * @compl: Completion status of MBX Command 288 * @compl: Completion status of MBX Command
289 * 289 *
@@ -293,8 +293,8 @@ static inline void be_mcc_compl_use(struct be_mcc_compl *compl)
293 * Success: Zero 293 * Success: Zero
294 * Failure: Non-Zero 294 * Failure: Non-Zero
295 **/ 295 **/
296static int be_mcc_compl_process(struct be_ctrl_info *ctrl, 296static int beiscsi_process_mbox_compl(struct be_ctrl_info *ctrl,
297 struct be_mcc_compl *compl) 297 struct be_mcc_compl *compl)
298{ 298{
299 u16 compl_status, extd_status; 299 u16 compl_status, extd_status;
300 struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); 300 struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
@@ -520,7 +520,7 @@ int beiscsi_process_mcc_compl(struct be_ctrl_info *ctrl,
520} 520}
521 521
522/* 522/*
523 * be_mcc_wait_compl()- Wait for MBX completion 523 * be_mcc_compl_poll()- Wait for MBX completion
524 * @phba: driver private structure 524 * @phba: driver private structure
525 * 525 *
526 * Wait till no more pending mcc requests are present 526 * Wait till no more pending mcc requests are present
@@ -556,7 +556,7 @@ int be_mcc_compl_poll(struct beiscsi_hba *phba, unsigned int tag)
556} 556}
557 557
558/* 558/*
559 * be_mbox_db_ready_wait()- Check ready status 559 * be_mbox_db_ready_poll()- Check ready status
560 * @ctrl: Function specific MBX data structure 560 * @ctrl: Function specific MBX data structure
561 * 561 *
562 * Check for the ready status of FW to send BMBX 562 * Check for the ready status of FW to send BMBX
@@ -566,7 +566,7 @@ int be_mcc_compl_poll(struct beiscsi_hba *phba, unsigned int tag)
566 * Success: 0 566 * Success: 0
567 * Failure: Non-Zero 567 * Failure: Non-Zero
568 **/ 568 **/
569static int be_mbox_db_ready_wait(struct be_ctrl_info *ctrl) 569static int be_mbox_db_ready_poll(struct be_ctrl_info *ctrl)
570{ 570{
571 /* wait 30s for generic non-flash MBOX operation */ 571 /* wait 30s for generic non-flash MBOX operation */
572#define BEISCSI_MBX_RDY_BIT_TIMEOUT 30000 572#define BEISCSI_MBX_RDY_BIT_TIMEOUT 30000
@@ -628,7 +628,7 @@ int be_mbox_notify(struct be_ctrl_info *ctrl)
628 struct be_mcc_compl *compl = &mbox->compl; 628 struct be_mcc_compl *compl = &mbox->compl;
629 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); 629 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
630 630
631 status = be_mbox_db_ready_wait(ctrl); 631 status = be_mbox_db_ready_poll(ctrl);
632 if (status) 632 if (status)
633 return status; 633 return status;
634 634
@@ -637,7 +637,7 @@ int be_mbox_notify(struct be_ctrl_info *ctrl)
637 val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2; 637 val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2;
638 iowrite32(val, db); 638 iowrite32(val, db);
639 639
640 status = be_mbox_db_ready_wait(ctrl); 640 status = be_mbox_db_ready_poll(ctrl);
641 if (status) 641 if (status)
642 return status; 642 return status;
643 643
@@ -647,7 +647,7 @@ int be_mbox_notify(struct be_ctrl_info *ctrl)
647 val |= (u32) (mbox_mem->dma >> 4) << 2; 647 val |= (u32) (mbox_mem->dma >> 4) << 2;
648 iowrite32(val, db); 648 iowrite32(val, db);
649 649
650 status = be_mbox_db_ready_wait(ctrl); 650 status = be_mbox_db_ready_poll(ctrl);
651 if (status) 651 if (status)
652 return status; 652 return status;
653 653
@@ -655,12 +655,12 @@ int be_mbox_notify(struct be_ctrl_info *ctrl)
655 udelay(1); 655 udelay(1);
656 656
657 if (be_mcc_compl_is_new(compl)) { 657 if (be_mcc_compl_is_new(compl)) {
658 status = be_mcc_compl_process(ctrl, &mbox->compl); 658 status = beiscsi_process_mbox_compl(ctrl, compl);
659 be_mcc_compl_use(compl); 659 be_mcc_compl_use(compl);
660 if (status) { 660 if (status) {
661 beiscsi_log(phba, KERN_ERR, 661 beiscsi_log(phba, KERN_ERR,
662 BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX, 662 BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
663 "BC_%d : After be_mcc_compl_process\n"); 663 "BC_%d : After beiscsi_process_mbox_compl\n");
664 664
665 return status; 665 return status;
666 } 666 }
@@ -688,7 +688,7 @@ static int be_mbox_notify_wait(struct beiscsi_hba *phba)
688 struct be_mcc_compl *compl = &mbox->compl; 688 struct be_mcc_compl *compl = &mbox->compl;
689 struct be_ctrl_info *ctrl = &phba->ctrl; 689 struct be_ctrl_info *ctrl = &phba->ctrl;
690 690
691 status = be_mbox_db_ready_wait(ctrl); 691 status = be_mbox_db_ready_poll(ctrl);
692 if (status) 692 if (status)
693 return status; 693 return status;
694 694
@@ -698,7 +698,7 @@ static int be_mbox_notify_wait(struct beiscsi_hba *phba)
698 iowrite32(val, db); 698 iowrite32(val, db);
699 699
700 /* wait for ready to be set */ 700 /* wait for ready to be set */
701 status = be_mbox_db_ready_wait(ctrl); 701 status = be_mbox_db_ready_poll(ctrl);
702 if (status != 0) 702 if (status != 0)
703 return status; 703 return status;
704 704
@@ -707,13 +707,13 @@ static int be_mbox_notify_wait(struct beiscsi_hba *phba)
707 val |= (u32)(mbox_mem->dma >> 4) << 2; 707 val |= (u32)(mbox_mem->dma >> 4) << 2;
708 iowrite32(val, db); 708 iowrite32(val, db);
709 709
710 status = be_mbox_db_ready_wait(ctrl); 710 status = be_mbox_db_ready_poll(ctrl);
711 if (status != 0) 711 if (status != 0)
712 return status; 712 return status;
713 713
714 /* A cq entry has been made now */ 714 /* A cq entry has been made now */
715 if (be_mcc_compl_is_new(compl)) { 715 if (be_mcc_compl_is_new(compl)) {
716 status = be_mcc_compl_process(ctrl, &mbox->compl); 716 status = beiscsi_process_mbox_compl(ctrl, &mbox->compl);
717 be_mcc_compl_use(compl); 717 be_mcc_compl_use(compl);
718 if (status) 718 if (status)
719 return status; 719 return status;
diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h
index f50b32ac72ee..b14ac015b5ea 100644
--- a/drivers/scsi/be2iscsi/be_cmds.h
+++ b/drivers/scsi/be2iscsi/be_cmds.h
@@ -732,9 +732,9 @@ void free_mcc_tag(struct be_ctrl_info *ctrl, unsigned int tag);
732 732
733int be_cmd_modify_eq_delay(struct beiscsi_hba *phba, struct be_set_eqd *, 733int be_cmd_modify_eq_delay(struct beiscsi_hba *phba, struct be_set_eqd *,
734 int num); 734 int num);
735int beiscsi_mccq_compl(struct beiscsi_hba *phba, 735int beiscsi_mccq_compl_wait(struct beiscsi_hba *phba,
736 uint32_t tag, struct be_mcc_wrb **wrb, 736 uint32_t tag, struct be_mcc_wrb **wrb,
737 struct be_dma_mem *mbx_cmd_mem); 737 struct be_dma_mem *mbx_cmd_mem);
738/*ISCSI Functuions */ 738/*ISCSI Functuions */
739int be_cmd_fw_initialize(struct be_ctrl_info *ctrl); 739int be_cmd_fw_initialize(struct be_ctrl_info *ctrl);
740int be_cmd_fw_uninit(struct be_ctrl_info *ctrl); 740int be_cmd_fw_uninit(struct be_ctrl_info *ctrl);
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index 633257b5ab85..09f89a3eaa87 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -735,7 +735,7 @@ static int beiscsi_get_initname(char *buf, struct beiscsi_hba *phba)
735 return -EBUSY; 735 return -EBUSY;
736 } 736 }
737 737
738 rc = beiscsi_mccq_compl(phba, tag, &wrb, NULL); 738 rc = beiscsi_mccq_compl_wait(phba, tag, &wrb, NULL);
739 if (rc) { 739 if (rc) {
740 beiscsi_log(phba, KERN_ERR, 740 beiscsi_log(phba, KERN_ERR,
741 BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX, 741 BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
@@ -1143,7 +1143,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
1143 return -EAGAIN; 1143 return -EAGAIN;
1144 } 1144 }
1145 1145
1146 ret = beiscsi_mccq_compl(phba, tag, NULL, &nonemb_cmd); 1146 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, &nonemb_cmd);
1147 if (ret) { 1147 if (ret) {
1148 beiscsi_log(phba, KERN_ERR, 1148 beiscsi_log(phba, KERN_ERR,
1149 BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX, 1149 BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
@@ -1302,7 +1302,7 @@ static int beiscsi_close_conn(struct beiscsi_endpoint *beiscsi_ep, int flag)
1302 ret = -EAGAIN; 1302 ret = -EAGAIN;
1303 } 1303 }
1304 1304
1305 ret = beiscsi_mccq_compl(phba, tag, NULL, NULL); 1305 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, NULL);
1306 1306
1307 /* Flush the CQ entries */ 1307 /* Flush the CQ entries */
1308 beiscsi_flush_cq(phba); 1308 beiscsi_flush_cq(phba);
@@ -1377,7 +1377,7 @@ void beiscsi_ep_disconnect(struct iscsi_endpoint *ep)
1377 beiscsi_ep->ep_cid); 1377 beiscsi_ep->ep_cid);
1378 } 1378 }
1379 1379
1380 beiscsi_mccq_compl(phba, tag, NULL, NULL); 1380 beiscsi_mccq_compl_wait(phba, tag, NULL, NULL);
1381 beiscsi_close_conn(beiscsi_ep, tcp_upload_flag); 1381 beiscsi_close_conn(beiscsi_ep, tcp_upload_flag);
1382free_ep: 1382free_ep:
1383 msleep(BEISCSI_LOGOUT_SYNC_DELAY); 1383 msleep(BEISCSI_LOGOUT_SYNC_DELAY);
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 8b9d01a765fc..dfc2ee9d5836 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -286,7 +286,7 @@ static int beiscsi_eh_abort(struct scsi_cmnd *sc)
286 return FAILED; 286 return FAILED;
287 } 287 }
288 288
289 rc = beiscsi_mccq_compl(phba, tag, NULL, &nonemb_cmd); 289 rc = beiscsi_mccq_compl_wait(phba, tag, NULL, &nonemb_cmd);
290 if (rc != -EBUSY) 290 if (rc != -EBUSY)
291 pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size, 291 pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size,
292 nonemb_cmd.va, nonemb_cmd.dma); 292 nonemb_cmd.va, nonemb_cmd.dma);
@@ -367,7 +367,7 @@ static int beiscsi_eh_device_reset(struct scsi_cmnd *sc)
367 return FAILED; 367 return FAILED;
368 } 368 }
369 369
370 rc = beiscsi_mccq_compl(phba, tag, NULL, &nonemb_cmd); 370 rc = beiscsi_mccq_compl_wait(phba, tag, NULL, &nonemb_cmd);
371 if (rc != -EBUSY) 371 if (rc != -EBUSY)
372 pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size, 372 pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size,
373 nonemb_cmd.va, nonemb_cmd.dma); 373 nonemb_cmd.va, nonemb_cmd.dma);
@@ -4394,7 +4394,7 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
4394 goto boot_freemem; 4394 goto boot_freemem;
4395 } 4395 }
4396 4396
4397 ret = beiscsi_mccq_compl(phba, tag, NULL, &nonemb_cmd); 4397 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, &nonemb_cmd);
4398 if (ret) { 4398 if (ret) {
4399 beiscsi_log(phba, KERN_ERR, 4399 beiscsi_log(phba, KERN_ERR,
4400 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG, 4400 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG,
@@ -5424,7 +5424,7 @@ static void be_eqd_update(struct beiscsi_hba *phba)
5424 if (num) { 5424 if (num) {
5425 tag = be_cmd_modify_eq_delay(phba, set_eqd, num); 5425 tag = be_cmd_modify_eq_delay(phba, set_eqd, num);
5426 if (tag) 5426 if (tag)
5427 beiscsi_mccq_compl(phba, tag, NULL, NULL); 5427 beiscsi_mccq_compl_wait(phba, tag, NULL, NULL);
5428 } 5428 }
5429} 5429}
5430 5430
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index a88e63666b1f..85044b855be2 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -942,7 +942,7 @@ unsigned int mgmt_get_all_if_id(struct beiscsi_hba *phba)
942 be_mcc_notify(phba, tag); 942 be_mcc_notify(phba, tag);
943 mutex_unlock(&ctrl->mbox_lock); 943 mutex_unlock(&ctrl->mbox_lock);
944 944
945 status = beiscsi_mccq_compl(phba, tag, &wrb, NULL); 945 status = beiscsi_mccq_compl_wait(phba, tag, &wrb, NULL);
946 if (status) { 946 if (status) {
947 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, 947 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
948 "BG_%d : Failed in mgmt_get_all_if_id\n"); 948 "BG_%d : Failed in mgmt_get_all_if_id\n");
@@ -993,7 +993,7 @@ static int mgmt_exec_nonemb_cmd(struct beiscsi_hba *phba,
993 be_mcc_notify(phba, tag); 993 be_mcc_notify(phba, tag);
994 mutex_unlock(&ctrl->mbox_lock); 994 mutex_unlock(&ctrl->mbox_lock);
995 995
996 rc = beiscsi_mccq_compl(phba, tag, NULL, nonemb_cmd); 996 rc = beiscsi_mccq_compl_wait(phba, tag, NULL, nonemb_cmd);
997 997
998 if (resp_buf) 998 if (resp_buf)
999 memcpy(resp_buf, nonemb_cmd->va, resp_buf_len); 999 memcpy(resp_buf, nonemb_cmd->va, resp_buf_len);
@@ -1427,7 +1427,7 @@ int be_mgmt_get_boot_shandle(struct beiscsi_hba *phba,
1427 return -EAGAIN; 1427 return -EAGAIN;
1428 } 1428 }
1429 1429
1430 rc = beiscsi_mccq_compl(phba, tag, &wrb, NULL); 1430 rc = beiscsi_mccq_compl_wait(phba, tag, &wrb, NULL);
1431 if (rc) { 1431 if (rc) {
1432 beiscsi_log(phba, KERN_ERR, 1432 beiscsi_log(phba, KERN_ERR,
1433 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG, 1433 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG,
@@ -1461,7 +1461,7 @@ int be_mgmt_get_boot_shandle(struct beiscsi_hba *phba,
1461 return -EAGAIN; 1461 return -EAGAIN;
1462 } 1462 }
1463 1463
1464 rc = beiscsi_mccq_compl(phba, tag, NULL, NULL); 1464 rc = beiscsi_mccq_compl_wait(phba, tag, NULL, NULL);
1465 if (rc) { 1465 if (rc) {
1466 beiscsi_log(phba, KERN_ERR, 1466 beiscsi_log(phba, KERN_ERR,
1467 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG, 1467 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG,
@@ -1503,7 +1503,7 @@ int mgmt_set_vlan(struct beiscsi_hba *phba,
1503 return -EBUSY; 1503 return -EBUSY;
1504 } 1504 }
1505 1505
1506 rc = beiscsi_mccq_compl(phba, tag, NULL, NULL); 1506 rc = beiscsi_mccq_compl_wait(phba, tag, NULL, NULL);
1507 if (rc) { 1507 if (rc) {
1508 beiscsi_log(phba, KERN_ERR, 1508 beiscsi_log(phba, KERN_ERR,
1509 (BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX), 1509 (BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX),
@@ -1869,7 +1869,7 @@ int beiscsi_logout_fw_sess(struct beiscsi_hba *phba,
1869 be_mcc_notify(phba, tag); 1869 be_mcc_notify(phba, tag);
1870 mutex_unlock(&ctrl->mbox_lock); 1870 mutex_unlock(&ctrl->mbox_lock);
1871 1871
1872 rc = beiscsi_mccq_compl(phba, tag, &wrb, NULL); 1872 rc = beiscsi_mccq_compl_wait(phba, tag, &wrb, NULL);
1873 if (rc) { 1873 if (rc) {
1874 beiscsi_log(phba, KERN_ERR, 1874 beiscsi_log(phba, KERN_ERR,
1875 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG, 1875 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG,