aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohan.kallickal@emulex.com>2012-04-04 00:41:47 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-04-25 04:26:24 -0400
commit9728d8d035a539072bf4dc6162a9f4e7f35ce012 (patch)
treecd5667cc76f6b8c9a9b071de91e14fcac692de66 /drivers/scsi/be2iscsi
parent76d15dbd5d3ecfb9bf9355ca3395036fc2f7a751 (diff)
[SCSI] be2iscsi: Check ASYNC PDU Handle corresponds to HDR/DATA Handle
For each ASYNC PDU received there is an HDR and DATA handle for it. There will be only 1 HDR ASYNC Handle, but DATA Handle can be more than 1 for each ASYNC PDU received. Checking if the ASYNC Handle correspongs to HDR or DATA while returning the Handle to the free list. hwi_free_async_msg just return the handles to the free list. No return values are needed so changing the return type to void. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r--drivers/scsi/be2iscsi/be_main.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 3843bbc77211..dad66de50aa0 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1471,14 +1471,13 @@ hwi_update_async_writables(struct hwi_async_pdu_context *pasync_ctx,
1471 return 0; 1471 return 0;
1472} 1472}
1473 1473
1474static unsigned int hwi_free_async_msg(struct beiscsi_hba *phba, 1474static void hwi_free_async_msg(struct beiscsi_hba *phba,
1475 unsigned int cri) 1475 unsigned int cri)
1476{ 1476{
1477 struct hwi_controller *phwi_ctrlr; 1477 struct hwi_controller *phwi_ctrlr;
1478 struct hwi_async_pdu_context *pasync_ctx; 1478 struct hwi_async_pdu_context *pasync_ctx;
1479 struct async_pdu_handle *pasync_handle, *tmp_handle; 1479 struct async_pdu_handle *pasync_handle, *tmp_handle;
1480 struct list_head *plist; 1480 struct list_head *plist;
1481 unsigned int i = 0;
1482 1481
1483 phwi_ctrlr = phba->phwi_ctrlr; 1482 phwi_ctrlr = phba->phwi_ctrlr;
1484 pasync_ctx = HWI_GET_ASYNC_PDU_CTX(phwi_ctrlr); 1483 pasync_ctx = HWI_GET_ASYNC_PDU_CTX(phwi_ctrlr);
@@ -1488,23 +1487,20 @@ static unsigned int hwi_free_async_msg(struct beiscsi_hba *phba,
1488 list_for_each_entry_safe(pasync_handle, tmp_handle, plist, link) { 1487 list_for_each_entry_safe(pasync_handle, tmp_handle, plist, link) {
1489 list_del(&pasync_handle->link); 1488 list_del(&pasync_handle->link);
1490 1489
1491 if (i == 0) { 1490 if (pasync_handle->is_header) {
1492 list_add_tail(&pasync_handle->link, 1491 list_add_tail(&pasync_handle->link,
1493 &pasync_ctx->async_header.free_list); 1492 &pasync_ctx->async_header.free_list);
1494 pasync_ctx->async_header.free_entries++; 1493 pasync_ctx->async_header.free_entries++;
1495 i++;
1496 } else { 1494 } else {
1497 list_add_tail(&pasync_handle->link, 1495 list_add_tail(&pasync_handle->link,
1498 &pasync_ctx->async_data.free_list); 1496 &pasync_ctx->async_data.free_list);
1499 pasync_ctx->async_data.free_entries++; 1497 pasync_ctx->async_data.free_entries++;
1500 i++;
1501 } 1498 }
1502 } 1499 }
1503 1500
1504 INIT_LIST_HEAD(&pasync_ctx->async_entry[cri].wait_queue.list); 1501 INIT_LIST_HEAD(&pasync_ctx->async_entry[cri].wait_queue.list);
1505 pasync_ctx->async_entry[cri].wait_queue.hdr_received = 0; 1502 pasync_ctx->async_entry[cri].wait_queue.hdr_received = 0;
1506 pasync_ctx->async_entry[cri].wait_queue.bytes_received = 0; 1503 pasync_ctx->async_entry[cri].wait_queue.bytes_received = 0;
1507 return 0;
1508} 1504}
1509 1505
1510static struct phys_addr * 1506static struct phys_addr *