aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohank@serverengines.com>2010-07-21 18:46:00 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:05:28 -0400
commit457ff3b7dc3796d8778286217ad304ff122e948f (patch)
tree32a0a7e6c67d2bb564efc9238abefa9239d38c72
parentbbe56c734cc1ecccd7b2b143e1767bf2b1eafc76 (diff)
[SCSI] be2iscsi: Fix warnings from new checkpatch.pl
The latest checkpatch.pl throws some new warnings. Fixing it to get rid of a bunch of warnings Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/be2iscsi/be.h6
-rw-r--r--drivers/scsi/be2iscsi/be_cmds.c24
-rw-r--r--drivers/scsi/be2iscsi/be_cmds.h20
-rw-r--r--drivers/scsi/be2iscsi/be_iscsi.c32
-rw-r--r--drivers/scsi/be2iscsi/be_main.c141
-rw-r--r--drivers/scsi/be2iscsi/be_main.h20
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c6
7 files changed, 126 insertions, 123 deletions
diff --git a/drivers/scsi/be2iscsi/be.h b/drivers/scsi/be2iscsi/be.h
index 136b49cea791..1cb8a5e85c7f 100644
--- a/drivers/scsi/be2iscsi/be.h
+++ b/drivers/scsi/be2iscsi/be.h
@@ -128,8 +128,8 @@ struct be_ctrl_info {
128#define mcc_timeout 120000 /* 5s timeout */ 128#define mcc_timeout 120000 /* 5s timeout */
129 129
130/* Returns number of pages spanned by the data starting at the given addr */ 130/* Returns number of pages spanned by the data starting at the given addr */
131#define PAGES_4K_SPANNED(_address, size) \ 131#define PAGES_4K_SPANNED(_address, size) \
132 ((u32)((((size_t)(_address) & (PAGE_SIZE_4K - 1)) + \ 132 ((u32)((((size_t)(_address) & (PAGE_SIZE_4K - 1)) + \
133 (size) + (PAGE_SIZE_4K - 1)) >> PAGE_SHIFT_4K)) 133 (size) + (PAGE_SIZE_4K - 1)) >> PAGE_SHIFT_4K))
134 134
135/* Byte offset into the page corresponding to given address */ 135/* Byte offset into the page corresponding to given address */
@@ -137,7 +137,7 @@ struct be_ctrl_info {
137 ((size_t)(addr) & (PAGE_SIZE_4K-1)) 137 ((size_t)(addr) & (PAGE_SIZE_4K-1))
138 138
139/* Returns bit offset within a DWORD of a bitfield */ 139/* Returns bit offset within a DWORD of a bitfield */
140#define AMAP_BIT_OFFSET(_struct, field) \ 140#define AMAP_BIT_OFFSET(_struct, field) \
141 (((size_t)&(((_struct *)0)->field))%32) 141 (((size_t)&(((_struct *)0)->field))%32)
142 142
143/* Returns the bit mask of the field that is NOT shifted into location. */ 143/* Returns the bit mask of the field that is NOT shifted into location. */
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
index cda6642c7368..4f19030c1e3e 100644
--- a/drivers/scsi/be2iscsi/be_cmds.c
+++ b/drivers/scsi/be2iscsi/be_cmds.c
@@ -151,20 +151,20 @@ void beiscsi_async_link_state_process(struct beiscsi_hba *phba,
151{ 151{
152 switch (evt->port_link_status) { 152 switch (evt->port_link_status) {
153 case ASYNC_EVENT_LINK_DOWN: 153 case ASYNC_EVENT_LINK_DOWN:
154 SE_DEBUG(DBG_LVL_1, "Link Down on Physical Port %d \n", 154 SE_DEBUG(DBG_LVL_1, "Link Down on Physical Port %d\n",
155 evt->physical_port); 155 evt->physical_port);
156 phba->state |= BE_ADAPTER_LINK_DOWN; 156 phba->state |= BE_ADAPTER_LINK_DOWN;
157 iscsi_host_for_each_session(phba->shost, 157 iscsi_host_for_each_session(phba->shost,
158 be2iscsi_fail_session); 158 be2iscsi_fail_session);
159 break; 159 break;
160 case ASYNC_EVENT_LINK_UP: 160 case ASYNC_EVENT_LINK_UP:
161 phba->state = BE_ADAPTER_UP; 161 phba->state = BE_ADAPTER_UP;
162 SE_DEBUG(DBG_LVL_1, "Link UP on Physical Port %d \n", 162 SE_DEBUG(DBG_LVL_1, "Link UP on Physical Port %d\n",
163 evt->physical_port); 163 evt->physical_port);
164 break; 164 break;
165 default: 165 default:
166 SE_DEBUG(DBG_LVL_1, "Unexpected Async Notification %d on" 166 SE_DEBUG(DBG_LVL_1, "Unexpected Async Notification %d on"
167 "Physical Port %d \n", 167 "Physical Port %d\n",
168 evt->port_link_status, 168 evt->port_link_status,
169 evt->physical_port); 169 evt->physical_port);
170 } 170 }
@@ -199,7 +199,7 @@ int beiscsi_process_mcc(struct beiscsi_hba *phba)
199 else 199 else
200 SE_DEBUG(DBG_LVL_1, 200 SE_DEBUG(DBG_LVL_1,
201 " Unsupported Async Event, flags" 201 " Unsupported Async Event, flags"
202 " = 0x%08x \n", compl->flags); 202 " = 0x%08x\n", compl->flags);
203 203
204 } else if (compl->flags & CQE_FLAGS_COMPLETED_MASK) { 204 } else if (compl->flags & CQE_FLAGS_COMPLETED_MASK) {
205 status = be_mcc_compl_process(ctrl, compl); 205 status = be_mcc_compl_process(ctrl, compl);
@@ -286,7 +286,7 @@ int be_mbox_notify(struct be_ctrl_info *ctrl)
286 286
287 status = be_mbox_db_ready_wait(ctrl); 287 status = be_mbox_db_ready_wait(ctrl);
288 if (status != 0) { 288 if (status != 0) {
289 SE_DEBUG(DBG_LVL_1, " be_mbox_db_ready_wait failed 1\n"); 289 SE_DEBUG(DBG_LVL_1, " be_mbox_db_ready_wait failed\n");
290 return status; 290 return status;
291 } 291 }
292 val = 0; 292 val = 0;
@@ -297,14 +297,14 @@ int be_mbox_notify(struct be_ctrl_info *ctrl)
297 297
298 status = be_mbox_db_ready_wait(ctrl); 298 status = be_mbox_db_ready_wait(ctrl);
299 if (status != 0) { 299 if (status != 0) {
300 SE_DEBUG(DBG_LVL_1, " be_mbox_db_ready_wait failed 2\n"); 300 SE_DEBUG(DBG_LVL_1, " be_mbox_db_ready_wait failed\n");
301 return status; 301 return status;
302 } 302 }
303 if (be_mcc_compl_is_new(compl)) { 303 if (be_mcc_compl_is_new(compl)) {
304 status = be_mcc_compl_process(ctrl, &mbox->compl); 304 status = be_mcc_compl_process(ctrl, &mbox->compl);
305 be_mcc_compl_use(compl); 305 be_mcc_compl_use(compl);
306 if (status) { 306 if (status) {
307 SE_DEBUG(DBG_LVL_1, "After be_mcc_compl_process \n"); 307 SE_DEBUG(DBG_LVL_1, "After be_mcc_compl_process\n");
308 return status; 308 return status;
309 } 309 }
310 } else { 310 } else {
@@ -500,7 +500,7 @@ int be_cmd_fw_initialize(struct be_ctrl_info *ctrl)
500 500
501 status = be_mbox_notify(ctrl); 501 status = be_mbox_notify(ctrl);
502 if (status) 502 if (status)
503 SE_DEBUG(DBG_LVL_1, "be_cmd_fw_initialize Failed \n"); 503 SE_DEBUG(DBG_LVL_1, "be_cmd_fw_initialize Failed\n");
504 504
505 spin_unlock(&ctrl->mbox_lock); 505 spin_unlock(&ctrl->mbox_lock);
506 return status; 506 return status;
@@ -517,7 +517,7 @@ int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl,
517 void *ctxt = &req->context; 517 void *ctxt = &req->context;
518 int status; 518 int status;
519 519
520 SE_DEBUG(DBG_LVL_8, "In beiscsi_cmd_cq_create \n"); 520 SE_DEBUG(DBG_LVL_8, "In beiscsi_cmd_cq_create\n");
521 spin_lock(&ctrl->mbox_lock); 521 spin_lock(&ctrl->mbox_lock);
522 memset(wrb, 0, sizeof(*wrb)); 522 memset(wrb, 0, sizeof(*wrb));
523 523
@@ -550,7 +550,7 @@ int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl,
550 cq->id = le16_to_cpu(resp->cq_id); 550 cq->id = le16_to_cpu(resp->cq_id);
551 cq->created = true; 551 cq->created = true;
552 } else 552 } else
553 SE_DEBUG(DBG_LVL_1, "In be_cmd_cq_create, status=ox%08x \n", 553 SE_DEBUG(DBG_LVL_1, "In be_cmd_cq_create, status=ox%08x\n",
554 status); 554 status);
555 spin_unlock(&ctrl->mbox_lock); 555 spin_unlock(&ctrl->mbox_lock);
556 556
@@ -619,7 +619,7 @@ int beiscsi_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q,
619 u8 subsys = 0, opcode = 0; 619 u8 subsys = 0, opcode = 0;
620 int status; 620 int status;
621 621
622 SE_DEBUG(DBG_LVL_8, "In beiscsi_cmd_q_destroy \n"); 622 SE_DEBUG(DBG_LVL_8, "In beiscsi_cmd_q_destroy\n");
623 spin_lock(&ctrl->mbox_lock); 623 spin_lock(&ctrl->mbox_lock);
624 memset(wrb, 0, sizeof(*wrb)); 624 memset(wrb, 0, sizeof(*wrb));
625 be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); 625 be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h
index 49fcc787ee8b..f94df6cdebc8 100644
--- a/drivers/scsi/be2iscsi/be_cmds.h
+++ b/drivers/scsi/be2iscsi/be_cmds.h
@@ -47,8 +47,8 @@ struct be_mcc_wrb {
47 47
48#define CQE_FLAGS_VALID_MASK (1 << 31) 48#define CQE_FLAGS_VALID_MASK (1 << 31)
49#define CQE_FLAGS_ASYNC_MASK (1 << 30) 49#define CQE_FLAGS_ASYNC_MASK (1 << 30)
50#define CQE_FLAGS_COMPLETED_MASK (1 << 28) 50#define CQE_FLAGS_COMPLETED_MASK (1 << 28)
51#define CQE_FLAGS_CONSUMED_MASK (1 << 27) 51#define CQE_FLAGS_CONSUMED_MASK (1 << 27)
52 52
53/* Completion Status */ 53/* Completion Status */
54#define MCC_STATUS_SUCCESS 0x0 54#define MCC_STATUS_SUCCESS 0x0
@@ -143,14 +143,14 @@ struct be_mcc_mailbox {
143 */ 143 */
144#define OPCODE_COMMON_CQ_CREATE 12 144#define OPCODE_COMMON_CQ_CREATE 12
145#define OPCODE_COMMON_EQ_CREATE 13 145#define OPCODE_COMMON_EQ_CREATE 13
146#define OPCODE_COMMON_MCC_CREATE 21 146#define OPCODE_COMMON_MCC_CREATE 21
147#define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32 147#define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32
148#define OPCODE_COMMON_GET_FW_VERSION 35 148#define OPCODE_COMMON_GET_FW_VERSION 35
149#define OPCODE_COMMON_MODIFY_EQ_DELAY 41 149#define OPCODE_COMMON_MODIFY_EQ_DELAY 41
150#define OPCODE_COMMON_FIRMWARE_CONFIG 42 150#define OPCODE_COMMON_FIRMWARE_CONFIG 42
151#define OPCODE_COMMON_MCC_DESTROY 53 151#define OPCODE_COMMON_MCC_DESTROY 53
152#define OPCODE_COMMON_CQ_DESTROY 54 152#define OPCODE_COMMON_CQ_DESTROY 54
153#define OPCODE_COMMON_EQ_DESTROY 55 153#define OPCODE_COMMON_EQ_DESTROY 55
154#define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58 154#define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
155#define OPCODE_COMMON_FUNCTION_RESET 61 155#define OPCODE_COMMON_FUNCTION_RESET 61
156 156
@@ -164,9 +164,9 @@ struct be_mcc_mailbox {
164#define OPCODE_COMMON_ISCSI_NTWK_GET_NIC_CONFIG 7 164#define OPCODE_COMMON_ISCSI_NTWK_GET_NIC_CONFIG 7
165#define OPCODE_COMMON_ISCSI_SET_FRAGNUM_BITS_FOR_SGL_CRA 61 165#define OPCODE_COMMON_ISCSI_SET_FRAGNUM_BITS_FOR_SGL_CRA 61
166#define OPCODE_COMMON_ISCSI_DEFQ_CREATE 64 166#define OPCODE_COMMON_ISCSI_DEFQ_CREATE 64
167#define OPCODE_COMMON_ISCSI_DEFQ_DESTROY 65 167#define OPCODE_COMMON_ISCSI_DEFQ_DESTROY 65
168#define OPCODE_COMMON_ISCSI_WRBQ_CREATE 66 168#define OPCODE_COMMON_ISCSI_WRBQ_CREATE 66
169#define OPCODE_COMMON_ISCSI_WRBQ_DESTROY 67 169#define OPCODE_COMMON_ISCSI_WRBQ_DESTROY 67
170 170
171struct be_cmd_req_hdr { 171struct be_cmd_req_hdr {
172 u8 opcode; /* dword 0 */ 172 u8 opcode; /* dword 0 */
@@ -875,7 +875,7 @@ struct be_fw_cfg {
875 */ 875 */
876#define UNSOL_HDR_NOTIFY 28 /* Unsolicited header notify.*/ 876#define UNSOL_HDR_NOTIFY 28 /* Unsolicited header notify.*/
877#define UNSOL_DATA_NOTIFY 29 /* Unsolicited data notify.*/ 877#define UNSOL_DATA_NOTIFY 29 /* Unsolicited data notify.*/
878#define UNSOL_DATA_DIGEST_ERROR_NOTIFY 30 /* Unsolicited data digest 878#define UNSOL_DATA_DIGEST_ERROR_NOTIFY 30 /* Unsolicited data digest
879 * error notify. 879 * error notify.
880 */ 880 */
881#define DRIVERMSG_NOTIFY 31 /* TCP acknowledge based 881#define DRIVERMSG_NOTIFY 31 /* TCP acknowledge based
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index 454027ccbf16..d9321ee01534 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -52,7 +52,7 @@ struct iscsi_cls_session *beiscsi_session_create(struct iscsi_endpoint *ep,
52 SE_DEBUG(DBG_LVL_8, "In beiscsi_session_create\n"); 52 SE_DEBUG(DBG_LVL_8, "In beiscsi_session_create\n");
53 53
54 if (!ep) { 54 if (!ep) {
55 SE_DEBUG(DBG_LVL_1, "beiscsi_session_create: invalid ep \n"); 55 SE_DEBUG(DBG_LVL_1, "beiscsi_session_create: invalid ep\n");
56 return NULL; 56 return NULL;
57 } 57 }
58 beiscsi_ep = ep->dd_data; 58 beiscsi_ep = ep->dd_data;
@@ -157,7 +157,7 @@ static int beiscsi_bindconn_cid(struct beiscsi_hba *phba,
157 "Connection table already occupied. Detected clash\n"); 157 "Connection table already occupied. Detected clash\n");
158 return -EINVAL; 158 return -EINVAL;
159 } else { 159 } else {
160 SE_DEBUG(DBG_LVL_8, "phba->conn_table[%d]=%p(beiscsi_conn) \n", 160 SE_DEBUG(DBG_LVL_8, "phba->conn_table[%d]=%p(beiscsi_conn)\n",
161 cid, beiscsi_conn); 161 cid, beiscsi_conn);
162 phba->conn_table[cid] = beiscsi_conn; 162 phba->conn_table[cid] = beiscsi_conn;
163 } 163 }
@@ -196,7 +196,7 @@ int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
196 196
197 if (beiscsi_ep->phba != phba) { 197 if (beiscsi_ep->phba != phba) {
198 SE_DEBUG(DBG_LVL_8, 198 SE_DEBUG(DBG_LVL_8,
199 "beiscsi_ep->hba=%p not equal to phba=%p \n", 199 "beiscsi_ep->hba=%p not equal to phba=%p\n",
200 beiscsi_ep->phba, phba); 200 beiscsi_ep->phba, phba);
201 return -EEXIST; 201 return -EEXIST;
202 } 202 }
@@ -204,7 +204,7 @@ int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
204 beiscsi_conn->beiscsi_conn_cid = beiscsi_ep->ep_cid; 204 beiscsi_conn->beiscsi_conn_cid = beiscsi_ep->ep_cid;
205 beiscsi_conn->ep = beiscsi_ep; 205 beiscsi_conn->ep = beiscsi_ep;
206 beiscsi_ep->conn = beiscsi_conn; 206 beiscsi_ep->conn = beiscsi_conn;
207 SE_DEBUG(DBG_LVL_8, "beiscsi_conn=%p conn=%p ep_cid=%d \n", 207 SE_DEBUG(DBG_LVL_8, "beiscsi_conn=%p conn=%p ep_cid=%d\n",
208 beiscsi_conn, conn, beiscsi_ep->ep_cid); 208 beiscsi_conn, conn, beiscsi_ep->ep_cid);
209 return beiscsi_bindconn_cid(phba, beiscsi_conn, beiscsi_ep->ep_cid); 209 return beiscsi_bindconn_cid(phba, beiscsi_conn, beiscsi_ep->ep_cid);
210} 210}
@@ -308,7 +308,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,
308 case ISCSI_HOST_PARAM_HWADDRESS: 308 case ISCSI_HOST_PARAM_HWADDRESS:
309 tag = be_cmd_get_mac_addr(phba); 309 tag = be_cmd_get_mac_addr(phba);
310 if (!tag) { 310 if (!tag) {
311 SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed \n"); 311 SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed\n");
312 return -1; 312 return -1;
313 } else 313 } else
314 wait_event_interruptible(phba->ctrl.mcc_wait[tag], 314 wait_event_interruptible(phba->ctrl.mcc_wait[tag],
@@ -319,7 +319,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,
319 status = phba->ctrl.mcc_numtag[tag] & 0x000000FF; 319 status = phba->ctrl.mcc_numtag[tag] & 0x000000FF;
320 if (status || extd_status) { 320 if (status || extd_status) {
321 SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed" 321 SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed"
322 " status = %d extd_status = %d \n", 322 " status = %d extd_status = %d\n",
323 status, extd_status); 323 status, extd_status);
324 free_mcc_tag(&phba->ctrl, tag); 324 free_mcc_tag(&phba->ctrl, tag);
325 return -1; 325 return -1;
@@ -493,7 +493,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
493 SE_DEBUG(DBG_LVL_1, "No free cid available\n"); 493 SE_DEBUG(DBG_LVL_1, "No free cid available\n");
494 return ret; 494 return ret;
495 } 495 }
496 SE_DEBUG(DBG_LVL_8, "In beiscsi_open_conn, ep_cid=%d ", 496 SE_DEBUG(DBG_LVL_8, "In beiscsi_open_conn, ep_cid=%d\n",
497 beiscsi_ep->ep_cid); 497 beiscsi_ep->ep_cid);
498 phba->ep_array[beiscsi_ep->ep_cid - 498 phba->ep_array[beiscsi_ep->ep_cid -
499 phba->fw_config.iscsi_cid_start] = ep; 499 phba->fw_config.iscsi_cid_start] = ep;
@@ -507,7 +507,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
507 tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep); 507 tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep);
508 if (!tag) { 508 if (!tag) {
509 SE_DEBUG(DBG_LVL_1, 509 SE_DEBUG(DBG_LVL_1,
510 "mgmt_open_connection Failed for cid=%d \n", 510 "mgmt_open_connection Failed for cid=%d\n",
511 beiscsi_ep->ep_cid); 511 beiscsi_ep->ep_cid);
512 } else { 512 } else {
513 wait_event_interruptible(phba->ctrl.mcc_wait[tag], 513 wait_event_interruptible(phba->ctrl.mcc_wait[tag],
@@ -526,7 +526,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
526 wrb = queue_get_wrb(mccq, wrb_num); 526 wrb = queue_get_wrb(mccq, wrb_num);
527 free_mcc_tag(&phba->ctrl, tag); 527 free_mcc_tag(&phba->ctrl, tag);
528 528
529 ptcpcnct_out = embedded_payload(wrb); 529 ptcpcnct_out = embedded_payload(wrb);
530 beiscsi_ep = ep->dd_data; 530 beiscsi_ep = ep->dd_data;
531 beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle; 531 beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle;
532 beiscsi_ep->cid_vld = 1; 532 beiscsi_ep->cid_vld = 1;
@@ -556,18 +556,18 @@ beiscsi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
556 struct iscsi_endpoint *ep; 556 struct iscsi_endpoint *ep;
557 int ret; 557 int ret;
558 558
559 SE_DEBUG(DBG_LVL_8, "In beiscsi_ep_connect \n"); 559 SE_DEBUG(DBG_LVL_8, "In beiscsi_ep_connect\n");
560 if (shost) 560 if (shost)
561 phba = iscsi_host_priv(shost); 561 phba = iscsi_host_priv(shost);
562 else { 562 else {
563 ret = -ENXIO; 563 ret = -ENXIO;
564 SE_DEBUG(DBG_LVL_1, "shost is NULL \n"); 564 SE_DEBUG(DBG_LVL_1, "shost is NULL\n");
565 return ERR_PTR(ret); 565 return ERR_PTR(ret);
566 } 566 }
567 567
568 if (phba->state != BE_ADAPTER_UP) { 568 if (phba->state != BE_ADAPTER_UP) {
569 ret = -EBUSY; 569 ret = -EBUSY;
570 SE_DEBUG(DBG_LVL_1, "The Adapter state is Not UP \n"); 570 SE_DEBUG(DBG_LVL_1, "The Adapter state is Not UP\n");
571 return ERR_PTR(ret); 571 return ERR_PTR(ret);
572 } 572 }
573 573
@@ -581,7 +581,7 @@ beiscsi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
581 beiscsi_ep->phba = phba; 581 beiscsi_ep->phba = phba;
582 beiscsi_ep->openiscsi_ep = ep; 582 beiscsi_ep->openiscsi_ep = ep;
583 if (beiscsi_open_conn(ep, NULL, dst_addr, non_blocking)) { 583 if (beiscsi_open_conn(ep, NULL, dst_addr, non_blocking)) {
584 SE_DEBUG(DBG_LVL_1, "Failed in beiscsi_open_conn \n"); 584 SE_DEBUG(DBG_LVL_1, "Failed in beiscsi_open_conn\n");
585 ret = -ENOMEM; 585 ret = -ENOMEM;
586 goto free_ep; 586 goto free_ep;
587 } 587 }
@@ -624,7 +624,7 @@ static int beiscsi_close_conn(struct beiscsi_endpoint *beiscsi_ep, int flag)
624 624
625 tag = mgmt_upload_connection(phba, beiscsi_ep->ep_cid, flag); 625 tag = mgmt_upload_connection(phba, beiscsi_ep->ep_cid, flag);
626 if (!tag) { 626 if (!tag) {
627 SE_DEBUG(DBG_LVL_8, "upload failed for cid 0x%x", 627 SE_DEBUG(DBG_LVL_8, "upload failed for cid 0x%x\n",
628 beiscsi_ep->ep_cid); 628 beiscsi_ep->ep_cid);
629 ret = -1; 629 ret = -1;
630 } else { 630 } else {
@@ -646,7 +646,7 @@ static int beiscsi_unbind_conn_to_cid(struct beiscsi_hba *phba,
646 if (phba->conn_table[cid]) 646 if (phba->conn_table[cid])
647 phba->conn_table[cid] = NULL; 647 phba->conn_table[cid] = NULL;
648 else { 648 else {
649 SE_DEBUG(DBG_LVL_8, "Connection table Not occupied. \n"); 649 SE_DEBUG(DBG_LVL_8, "Connection table Not occupied.\n");
650 return -EINVAL; 650 return -EINVAL;
651 } 651 }
652 return 0; 652 return 0;
@@ -687,7 +687,7 @@ void beiscsi_ep_disconnect(struct iscsi_endpoint *ep)
687 savecfg_flag); 687 savecfg_flag);
688 if (!tag) { 688 if (!tag) {
689 SE_DEBUG(DBG_LVL_1, 689 SE_DEBUG(DBG_LVL_1,
690 "mgmt_invalidate_connection Failed for cid=%d \n", 690 "mgmt_invalidate_connection Failed for cid=%d\n",
691 beiscsi_ep->ep_cid); 691 beiscsi_ep->ep_cid);
692 } else { 692 } else {
693 wait_event_interruptible(phba->ctrl.mcc_wait[tag], 693 wait_event_interruptible(phba->ctrl.mcc_wait[tag],
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 0d35bf6c6acc..001888b0c842 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -216,7 +216,7 @@ static struct beiscsi_hba *beiscsi_hba_alloc(struct pci_dev *pcidev)
216 shost = iscsi_host_alloc(&beiscsi_sht, sizeof(*phba), 0); 216 shost = iscsi_host_alloc(&beiscsi_sht, sizeof(*phba), 0);
217 if (!shost) { 217 if (!shost) {
218 dev_err(&pcidev->dev, "beiscsi_hba_alloc -" 218 dev_err(&pcidev->dev, "beiscsi_hba_alloc -"
219 "iscsi_host_alloc failed \n"); 219 "iscsi_host_alloc failed\n");
220 return NULL; 220 return NULL;
221 } 221 }
222 shost->dma_boundary = pcidev->dma_mask; 222 shost->dma_boundary = pcidev->dma_mask;
@@ -371,7 +371,7 @@ static void beiscsi_get_params(struct beiscsi_hba *phba)
371 + BE2_TMFS) / 512) + 1) * 512; 371 + BE2_TMFS) / 512) + 1) * 512;
372 phba->params.num_eq_entries = (phba->params.num_eq_entries < 1024) 372 phba->params.num_eq_entries = (phba->params.num_eq_entries < 1024)
373 ? 1024 : phba->params.num_eq_entries; 373 ? 1024 : phba->params.num_eq_entries;
374 SE_DEBUG(DBG_LVL_8, "phba->params.num_eq_entries=%d \n", 374 SE_DEBUG(DBG_LVL_8, "phba->params.num_eq_entries=%d\n",
375 phba->params.num_eq_entries); 375 phba->params.num_eq_entries);
376 phba->params.num_cq_entries = 376 phba->params.num_cq_entries =
377 (((BE2_CMDS_PER_CXN * 2 + phba->fw_config.iscsi_cid_count * 2 377 (((BE2_CMDS_PER_CXN * 2 + phba->fw_config.iscsi_cid_count * 2
@@ -692,7 +692,7 @@ beiscsi_process_async_pdu(struct beiscsi_conn *beiscsi_conn,
692 break; 692 break;
693 default: 693 default:
694 shost_printk(KERN_WARNING, phba->shost, 694 shost_printk(KERN_WARNING, phba->shost,
695 "Unrecognized opcode 0x%x in async msg \n", 695 "Unrecognized opcode 0x%x in async msg\n",
696 (ppdu-> 696 (ppdu->
697 dw[offsetof(struct amap_pdu_base, opcode) / 32] 697 dw[offsetof(struct amap_pdu_base, opcode) / 32]
698 & PDUBASE_OPCODE_MASK)); 698 & PDUBASE_OPCODE_MASK));
@@ -711,7 +711,7 @@ static struct sgl_handle *alloc_io_sgl_handle(struct beiscsi_hba *phba)
711 711
712 if (phba->io_sgl_hndl_avbl) { 712 if (phba->io_sgl_hndl_avbl) {
713 SE_DEBUG(DBG_LVL_8, 713 SE_DEBUG(DBG_LVL_8,
714 "In alloc_io_sgl_handle,io_sgl_alloc_index=%d \n", 714 "In alloc_io_sgl_handle,io_sgl_alloc_index=%d\n",
715 phba->io_sgl_alloc_index); 715 phba->io_sgl_alloc_index);
716 psgl_handle = phba->io_sgl_hndl_base[phba-> 716 psgl_handle = phba->io_sgl_hndl_base[phba->
717 io_sgl_alloc_index]; 717 io_sgl_alloc_index];
@@ -730,7 +730,7 @@ static struct sgl_handle *alloc_io_sgl_handle(struct beiscsi_hba *phba)
730static void 730static void
731free_io_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle) 731free_io_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
732{ 732{
733 SE_DEBUG(DBG_LVL_8, "In free_,io_sgl_free_index=%d \n", 733 SE_DEBUG(DBG_LVL_8, "In free_,io_sgl_free_index=%d\n",
734 phba->io_sgl_free_index); 734 phba->io_sgl_free_index);
735 if (phba->io_sgl_hndl_base[phba->io_sgl_free_index]) { 735 if (phba->io_sgl_hndl_base[phba->io_sgl_free_index]) {
736 /* 736 /*
@@ -739,7 +739,7 @@ free_io_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
739 */ 739 */
740 SE_DEBUG(DBG_LVL_8, 740 SE_DEBUG(DBG_LVL_8,
741 "Double Free in IO SGL io_sgl_free_index=%d," 741 "Double Free in IO SGL io_sgl_free_index=%d,"
742 "value there=%p \n", phba->io_sgl_free_index, 742 "value there=%p\n", phba->io_sgl_free_index,
743 phba->io_sgl_hndl_base[phba->io_sgl_free_index]); 743 phba->io_sgl_hndl_base[phba->io_sgl_free_index]);
744 return; 744 return;
745 } 745 }
@@ -804,7 +804,7 @@ free_wrb_handle(struct beiscsi_hba *phba, struct hwi_wrb_context *pwrb_context,
804 804
805 SE_DEBUG(DBG_LVL_8, 805 SE_DEBUG(DBG_LVL_8,
806 "FREE WRB: pwrb_handle=%p free_index=0x%x" 806 "FREE WRB: pwrb_handle=%p free_index=0x%x"
807 "wrb_handles_available=%d \n", 807 "wrb_handles_available=%d\n",
808 pwrb_handle, pwrb_context->free_index, 808 pwrb_handle, pwrb_context->free_index,
809 pwrb_context->wrb_handles_available); 809 pwrb_context->wrb_handles_available);
810} 810}
@@ -816,7 +816,7 @@ static struct sgl_handle *alloc_mgmt_sgl_handle(struct beiscsi_hba *phba)
816 if (phba->eh_sgl_hndl_avbl) { 816 if (phba->eh_sgl_hndl_avbl) {
817 psgl_handle = phba->eh_sgl_hndl_base[phba->eh_sgl_alloc_index]; 817 psgl_handle = phba->eh_sgl_hndl_base[phba->eh_sgl_alloc_index];
818 phba->eh_sgl_hndl_base[phba->eh_sgl_alloc_index] = NULL; 818 phba->eh_sgl_hndl_base[phba->eh_sgl_alloc_index] = NULL;
819 SE_DEBUG(DBG_LVL_8, "mgmt_sgl_alloc_index=%d=0x%x \n", 819 SE_DEBUG(DBG_LVL_8, "mgmt_sgl_alloc_index=%d=0x%x\n",
820 phba->eh_sgl_alloc_index, phba->eh_sgl_alloc_index); 820 phba->eh_sgl_alloc_index, phba->eh_sgl_alloc_index);
821 phba->eh_sgl_hndl_avbl--; 821 phba->eh_sgl_hndl_avbl--;
822 if (phba->eh_sgl_alloc_index == 822 if (phba->eh_sgl_alloc_index ==
@@ -834,7 +834,7 @@ void
834free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle) 834free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
835{ 835{
836 836
837 SE_DEBUG(DBG_LVL_8, "In free_mgmt_sgl_handle,eh_sgl_free_index=%d \n", 837 SE_DEBUG(DBG_LVL_8, "In free_mgmt_sgl_handle,eh_sgl_free_index=%d\n",
838 phba->eh_sgl_free_index); 838 phba->eh_sgl_free_index);
839 if (phba->eh_sgl_hndl_base[phba->eh_sgl_free_index]) { 839 if (phba->eh_sgl_hndl_base[phba->eh_sgl_free_index]) {
840 /* 840 /*
@@ -842,7 +842,7 @@ free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
842 * failed in xmit_task or alloc_pdu. 842 * failed in xmit_task or alloc_pdu.
843 */ 843 */
844 SE_DEBUG(DBG_LVL_8, 844 SE_DEBUG(DBG_LVL_8,
845 "Double Free in eh SGL ,eh_sgl_free_index=%d \n", 845 "Double Free in eh SGL ,eh_sgl_free_index=%d\n",
846 phba->eh_sgl_free_index); 846 phba->eh_sgl_free_index);
847 return; 847 return;
848 } 848 }
@@ -1081,7 +1081,7 @@ static void hwi_complete_cmd(struct beiscsi_conn *beiscsi_conn,
1081 case HWH_TYPE_LOGIN: 1081 case HWH_TYPE_LOGIN:
1082 SE_DEBUG(DBG_LVL_1, 1082 SE_DEBUG(DBG_LVL_1,
1083 "\t\t No HWH_TYPE_LOGIN Expected in hwi_complete_cmd" 1083 "\t\t No HWH_TYPE_LOGIN Expected in hwi_complete_cmd"
1084 "- Solicited path \n"); 1084 "- Solicited path\n");
1085 break; 1085 break;
1086 1086
1087 case HWH_TYPE_NOP: 1087 case HWH_TYPE_NOP:
@@ -1164,7 +1164,7 @@ hwi_get_async_handle(struct beiscsi_hba *phba,
1164 default: 1164 default:
1165 pbusy_list = NULL; 1165 pbusy_list = NULL;
1166 shost_printk(KERN_WARNING, phba->shost, 1166 shost_printk(KERN_WARNING, phba->shost,
1167 "Unexpected code=%d \n", 1167 "Unexpected code=%d\n",
1168 pdpdu_cqe->dw[offsetof(struct amap_i_t_dpdu_cqe, 1168 pdpdu_cqe->dw[offsetof(struct amap_i_t_dpdu_cqe,
1169 code) / 32] & PDUCQE_CODE_MASK); 1169 code) / 32] & PDUCQE_CODE_MASK);
1170 return NULL; 1170 return NULL;
@@ -1552,7 +1552,7 @@ static void beiscsi_process_mcc_isr(struct beiscsi_hba *phba)
1552 else 1552 else
1553 SE_DEBUG(DBG_LVL_1, 1553 SE_DEBUG(DBG_LVL_1,
1554 " Unsupported Async Event, flags" 1554 " Unsupported Async Event, flags"
1555 " = 0x%08x \n", mcc_compl->flags); 1555 " = 0x%08x\n", mcc_compl->flags);
1556 } else if (mcc_compl->flags & CQE_FLAGS_COMPLETED_MASK) { 1556 } else if (mcc_compl->flags & CQE_FLAGS_COMPLETED_MASK) {
1557 be_mcc_compl_process_isr(&phba->ctrl, mcc_compl); 1557 be_mcc_compl_process_isr(&phba->ctrl, mcc_compl);
1558 atomic_dec(&phba->ctrl.mcc_obj.q.used); 1558 atomic_dec(&phba->ctrl.mcc_obj.q.used);
@@ -1611,7 +1611,7 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
1611 hwi_complete_cmd(beiscsi_conn, phba, sol); 1611 hwi_complete_cmd(beiscsi_conn, phba, sol);
1612 break; 1612 break;
1613 case DRIVERMSG_NOTIFY: 1613 case DRIVERMSG_NOTIFY:
1614 SE_DEBUG(DBG_LVL_8, "Received DRIVERMSG_NOTIFY \n"); 1614 SE_DEBUG(DBG_LVL_8, "Received DRIVERMSG_NOTIFY\n");
1615 dmsg = (struct dmsg_cqe *)sol; 1615 dmsg = (struct dmsg_cqe *)sol;
1616 hwi_complete_drvr_msgs(beiscsi_conn, phba, sol); 1616 hwi_complete_drvr_msgs(beiscsi_conn, phba, sol);
1617 break; 1617 break;
@@ -1782,9 +1782,9 @@ hwi_write_sgl(struct iscsi_wrb *pwrb, struct scatterlist *sg,
1782 sg_len = sg_dma_len(sg); 1782 sg_len = sg_dma_len(sg);
1783 addr = (u64) sg_dma_address(sg); 1783 addr = (u64) sg_dma_address(sg);
1784 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_addr_lo, pwrb, 1784 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_addr_lo, pwrb,
1785 (addr & 0xFFFFFFFF)); 1785 ((u32)(addr & 0xFFFFFFFF)));
1786 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_addr_hi, pwrb, 1786 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_addr_hi, pwrb,
1787 (addr >> 32)); 1787 ((u32)(addr >> 32)));
1788 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_len, pwrb, 1788 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_len, pwrb,
1789 sg_len); 1789 sg_len);
1790 sge_len = sg_len; 1790 sge_len = sg_len;
@@ -1794,9 +1794,9 @@ hwi_write_sgl(struct iscsi_wrb *pwrb, struct scatterlist *sg,
1794 sg_len = sg_dma_len(sg); 1794 sg_len = sg_dma_len(sg);
1795 addr = (u64) sg_dma_address(sg); 1795 addr = (u64) sg_dma_address(sg);
1796 AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_addr_lo, pwrb, 1796 AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_addr_lo, pwrb,
1797 (addr & 0xFFFFFFFF)); 1797 ((u32)(addr & 0xFFFFFFFF)));
1798 AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_addr_hi, pwrb, 1798 AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_addr_hi, pwrb,
1799 (addr >> 32)); 1799 ((u32)(addr >> 32)));
1800 AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_len, pwrb, 1800 AMAP_SET_BITS(struct amap_iscsi_wrb, sge1_len, pwrb,
1801 sg_len); 1801 sg_len);
1802 } 1802 }
@@ -1872,9 +1872,9 @@ static void hwi_write_buffer(struct iscsi_wrb *pwrb, struct iscsi_task *task)
1872 addr = 0; 1872 addr = 0;
1873 } 1873 }
1874 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_addr_lo, pwrb, 1874 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_addr_lo, pwrb,
1875 (addr & 0xFFFFFFFF)); 1875 ((u32)(addr & 0xFFFFFFFF)));
1876 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_addr_hi, pwrb, 1876 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_addr_hi, pwrb,
1877 (addr >> 32)); 1877 ((u32)(addr >> 32)));
1878 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_len, pwrb, 1878 AMAP_SET_BITS(struct amap_iscsi_wrb, sge0_len, pwrb,
1879 task->data_count); 1879 task->data_count);
1880 1880
@@ -1904,9 +1904,9 @@ static void hwi_write_buffer(struct iscsi_wrb *pwrb, struct iscsi_task *task)
1904 psgl++; 1904 psgl++;
1905 if (task->data) { 1905 if (task->data) {
1906 AMAP_SET_BITS(struct amap_iscsi_sge, addr_lo, psgl, 1906 AMAP_SET_BITS(struct amap_iscsi_sge, addr_lo, psgl,
1907 (addr & 0xFFFFFFFF)); 1907 ((u32)(addr & 0xFFFFFFFF)));
1908 AMAP_SET_BITS(struct amap_iscsi_sge, addr_hi, psgl, 1908 AMAP_SET_BITS(struct amap_iscsi_sge, addr_hi, psgl,
1909 (addr >> 32)); 1909 ((u32)(addr >> 32)));
1910 } 1910 }
1911 AMAP_SET_BITS(struct amap_iscsi_sge, len, psgl, 0x106); 1911 AMAP_SET_BITS(struct amap_iscsi_sge, len, psgl, 0x106);
1912 } 1912 }
@@ -2054,7 +2054,8 @@ free_mem:
2054 mem_descr->mem_array[j - 1].size, 2054 mem_descr->mem_array[j - 1].size,
2055 mem_descr->mem_array[j - 1]. 2055 mem_descr->mem_array[j - 1].
2056 virtual_address, 2056 virtual_address,
2057 mem_descr->mem_array[j - 1]. 2057 (unsigned long)mem_descr->
2058 mem_array[j - 1].
2058 bus_address.u.a64.address); 2059 bus_address.u.a64.address);
2059 } 2060 }
2060 if (i) { 2061 if (i) {
@@ -2223,10 +2224,10 @@ static void hwi_init_async_pdu_ctx(struct beiscsi_hba *phba)
2223 if (mem_descr->mem_array[0].virtual_address) { 2224 if (mem_descr->mem_array[0].virtual_address) {
2224 SE_DEBUG(DBG_LVL_8, 2225 SE_DEBUG(DBG_LVL_8,
2225 "hwi_init_async_pdu_ctx HWI_MEM_ASYNC_HEADER_BUF" 2226 "hwi_init_async_pdu_ctx HWI_MEM_ASYNC_HEADER_BUF"
2226 "va=%p \n", mem_descr->mem_array[0].virtual_address); 2227 "va=%p\n", mem_descr->mem_array[0].virtual_address);
2227 } else 2228 } else
2228 shost_printk(KERN_WARNING, phba->shost, 2229 shost_printk(KERN_WARNING, phba->shost,
2229 "No Virtual address \n"); 2230 "No Virtual address\n");
2230 2231
2231 pasync_ctx->async_header.va_base = 2232 pasync_ctx->async_header.va_base =
2232 mem_descr->mem_array[0].virtual_address; 2233 mem_descr->mem_array[0].virtual_address;
@@ -2239,10 +2240,10 @@ static void hwi_init_async_pdu_ctx(struct beiscsi_hba *phba)
2239 if (mem_descr->mem_array[0].virtual_address) { 2240 if (mem_descr->mem_array[0].virtual_address) {
2240 SE_DEBUG(DBG_LVL_8, 2241 SE_DEBUG(DBG_LVL_8,
2241 "hwi_init_async_pdu_ctx HWI_MEM_ASYNC_HEADER_RING" 2242 "hwi_init_async_pdu_ctx HWI_MEM_ASYNC_HEADER_RING"
2242 "va=%p \n", mem_descr->mem_array[0].virtual_address); 2243 "va=%p\n", mem_descr->mem_array[0].virtual_address);
2243 } else 2244 } else
2244 shost_printk(KERN_WARNING, phba->shost, 2245 shost_printk(KERN_WARNING, phba->shost,
2245 "No Virtual address \n"); 2246 "No Virtual address\n");
2246 pasync_ctx->async_header.ring_base = 2247 pasync_ctx->async_header.ring_base =
2247 mem_descr->mem_array[0].virtual_address; 2248 mem_descr->mem_array[0].virtual_address;
2248 2249
@@ -2251,10 +2252,10 @@ static void hwi_init_async_pdu_ctx(struct beiscsi_hba *phba)
2251 if (mem_descr->mem_array[0].virtual_address) { 2252 if (mem_descr->mem_array[0].virtual_address) {
2252 SE_DEBUG(DBG_LVL_8, 2253 SE_DEBUG(DBG_LVL_8,
2253 "hwi_init_async_pdu_ctx HWI_MEM_ASYNC_HEADER_HANDLE" 2254 "hwi_init_async_pdu_ctx HWI_MEM_ASYNC_HEADER_HANDLE"
2254 "va=%p \n", mem_descr->mem_array[0].virtual_address); 2255 "va=%p\n", mem_descr->mem_array[0].virtual_address);
2255 } else 2256 } else
2256 shost_printk(KERN_WARNING, phba->shost, 2257 shost_printk(KERN_WARNING, phba->shost,
2257 "No Virtual address \n"); 2258 "No Virtual address\n");
2258 2259
2259 pasync_ctx->async_header.handle_base = 2260 pasync_ctx->async_header.handle_base =
2260 mem_descr->mem_array[0].virtual_address; 2261 mem_descr->mem_array[0].virtual_address;
@@ -2266,10 +2267,10 @@ static void hwi_init_async_pdu_ctx(struct beiscsi_hba *phba)
2266 if (mem_descr->mem_array[0].virtual_address) { 2267 if (mem_descr->mem_array[0].virtual_address) {
2267 SE_DEBUG(DBG_LVL_8, 2268 SE_DEBUG(DBG_LVL_8,
2268 "hwi_init_async_pdu_ctx HWI_MEM_ASYNC_DATA_BUF" 2269 "hwi_init_async_pdu_ctx HWI_MEM_ASYNC_DATA_BUF"
2269 "va=%p \n", mem_descr->mem_array[0].virtual_address); 2270 "va=%p\n", mem_descr->mem_array[0].virtual_address);
2270 } else 2271 } else
2271 shost_printk(KERN_WARNING, phba->shost, 2272 shost_printk(KERN_WARNING, phba->shost,
2272 "No Virtual address \n"); 2273 "No Virtual address\n");
2273 pasync_ctx->async_data.va_base = 2274 pasync_ctx->async_data.va_base =
2274 mem_descr->mem_array[0].virtual_address; 2275 mem_descr->mem_array[0].virtual_address;
2275 pasync_ctx->async_data.pa_base.u.a64.address = 2276 pasync_ctx->async_data.pa_base.u.a64.address =
@@ -2280,10 +2281,10 @@ static void hwi_init_async_pdu_ctx(struct beiscsi_hba *phba)
2280 if (mem_descr->mem_array[0].virtual_address) { 2281 if (mem_descr->mem_array[0].virtual_address) {
2281 SE_DEBUG(DBG_LVL_8, 2282 SE_DEBUG(DBG_LVL_8,
2282 "hwi_init_async_pdu_ctx HWI_MEM_ASYNC_DATA_RING" 2283 "hwi_init_async_pdu_ctx HWI_MEM_ASYNC_DATA_RING"
2283 "va=%p \n", mem_descr->mem_array[0].virtual_address); 2284 "va=%p\n", mem_descr->mem_array[0].virtual_address);
2284 } else 2285 } else
2285 shost_printk(KERN_WARNING, phba->shost, 2286 shost_printk(KERN_WARNING, phba->shost,
2286 "No Virtual address \n"); 2287 "No Virtual address\n");
2287 2288
2288 pasync_ctx->async_data.ring_base = 2289 pasync_ctx->async_data.ring_base =
2289 mem_descr->mem_array[0].virtual_address; 2290 mem_descr->mem_array[0].virtual_address;
@@ -2292,7 +2293,7 @@ static void hwi_init_async_pdu_ctx(struct beiscsi_hba *phba)
2292 mem_descr += HWI_MEM_ASYNC_DATA_HANDLE; 2293 mem_descr += HWI_MEM_ASYNC_DATA_HANDLE;
2293 if (!mem_descr->mem_array[0].virtual_address) 2294 if (!mem_descr->mem_array[0].virtual_address)
2294 shost_printk(KERN_WARNING, phba->shost, 2295 shost_printk(KERN_WARNING, phba->shost,
2295 "No Virtual address \n"); 2296 "No Virtual address\n");
2296 2297
2297 pasync_ctx->async_data.handle_base = 2298 pasync_ctx->async_data.handle_base =
2298 mem_descr->mem_array[0].virtual_address; 2299 mem_descr->mem_array[0].virtual_address;
@@ -2364,7 +2365,7 @@ be_sgl_create_contiguous(void *virtual_address,
2364 WARN_ON(!sgl); 2365 WARN_ON(!sgl);
2365 2366
2366 sgl->va = virtual_address; 2367 sgl->va = virtual_address;
2367 sgl->dma = physical_address; 2368 sgl->dma = (unsigned long)physical_address;
2368 sgl->size = length; 2369 sgl->size = length;
2369 2370
2370 return 0; 2371 return 0;
@@ -2447,7 +2448,7 @@ static int beiscsi_create_eqs(struct beiscsi_hba *phba,
2447 sizeof(struct be_eq_entry), eq_vaddress); 2448 sizeof(struct be_eq_entry), eq_vaddress);
2448 if (ret) { 2449 if (ret) {
2449 shost_printk(KERN_ERR, phba->shost, 2450 shost_printk(KERN_ERR, phba->shost,
2450 "be_fill_queue Failed for EQ \n"); 2451 "be_fill_queue Failed for EQ\n");
2451 goto create_eq_error; 2452 goto create_eq_error;
2452 } 2453 }
2453 2454
@@ -2457,7 +2458,7 @@ static int beiscsi_create_eqs(struct beiscsi_hba *phba,
2457 if (ret) { 2458 if (ret) {
2458 shost_printk(KERN_ERR, phba->shost, 2459 shost_printk(KERN_ERR, phba->shost,
2459 "beiscsi_cmd_eq_create" 2460 "beiscsi_cmd_eq_create"
2460 "Failedfor EQ \n"); 2461 "Failedfor EQ\n");
2461 goto create_eq_error; 2462 goto create_eq_error;
2462 } 2463 }
2463 SE_DEBUG(DBG_LVL_8, "eqid = %d\n", phwi_context->be_eq[i].q.id); 2464 SE_DEBUG(DBG_LVL_8, "eqid = %d\n", phwi_context->be_eq[i].q.id);
@@ -2505,7 +2506,7 @@ static int beiscsi_create_cqs(struct beiscsi_hba *phba,
2505 sizeof(struct sol_cqe), cq_vaddress); 2506 sizeof(struct sol_cqe), cq_vaddress);
2506 if (ret) { 2507 if (ret) {
2507 shost_printk(KERN_ERR, phba->shost, 2508 shost_printk(KERN_ERR, phba->shost,
2508 "be_fill_queue Failed for ISCSI CQ \n"); 2509 "be_fill_queue Failed for ISCSI CQ\n");
2509 goto create_cq_error; 2510 goto create_cq_error;
2510 } 2511 }
2511 2512
@@ -2515,7 +2516,7 @@ static int beiscsi_create_cqs(struct beiscsi_hba *phba,
2515 if (ret) { 2516 if (ret) {
2516 shost_printk(KERN_ERR, phba->shost, 2517 shost_printk(KERN_ERR, phba->shost,
2517 "beiscsi_cmd_eq_create" 2518 "beiscsi_cmd_eq_create"
2518 "Failed for ISCSI CQ \n"); 2519 "Failed for ISCSI CQ\n");
2519 goto create_cq_error; 2520 goto create_cq_error;
2520 } 2521 }
2521 SE_DEBUG(DBG_LVL_8, "iscsi cq_id is %d for eq_id %d\n", 2522 SE_DEBUG(DBG_LVL_8, "iscsi cq_id is %d for eq_id %d\n",
@@ -2565,7 +2566,8 @@ beiscsi_create_def_hdr(struct beiscsi_hba *phba,
2565 "be_fill_queue Failed for DEF PDU HDR\n"); 2566 "be_fill_queue Failed for DEF PDU HDR\n");
2566 return ret; 2567 return ret;
2567 } 2568 }
2568 mem->dma = mem_descr->mem_array[idx].bus_address.u.a64.address; 2569 mem->dma = (unsigned long)mem_descr->mem_array[idx].
2570 bus_address.u.a64.address;
2569 ret = be_cmd_create_default_pdu_queue(&phba->ctrl, cq, dq, 2571 ret = be_cmd_create_default_pdu_queue(&phba->ctrl, cq, dq,
2570 def_pdu_ring_sz, 2572 def_pdu_ring_sz,
2571 phba->params.defpdu_hdr_sz); 2573 phba->params.defpdu_hdr_sz);
@@ -2609,7 +2611,8 @@ beiscsi_create_def_data(struct beiscsi_hba *phba,
2609 "be_fill_queue Failed for DEF PDU DATA\n"); 2611 "be_fill_queue Failed for DEF PDU DATA\n");
2610 return ret; 2612 return ret;
2611 } 2613 }
2612 mem->dma = mem_descr->mem_array[idx].bus_address.u.a64.address; 2614 mem->dma = (unsigned long)mem_descr->mem_array[idx].
2615 bus_address.u.a64.address;
2613 ret = be_cmd_create_default_pdu_queue(&phba->ctrl, cq, dataq, 2616 ret = be_cmd_create_default_pdu_queue(&phba->ctrl, cq, dataq,
2614 def_pdu_ring_sz, 2617 def_pdu_ring_sz,
2615 phba->params.defpdu_data_sz); 2618 phba->params.defpdu_data_sz);
@@ -2623,7 +2626,7 @@ beiscsi_create_def_data(struct beiscsi_hba *phba,
2623 SE_DEBUG(DBG_LVL_8, "iscsi def data id is %d\n", 2626 SE_DEBUG(DBG_LVL_8, "iscsi def data id is %d\n",
2624 phwi_context->be_def_dataq.id); 2627 phwi_context->be_def_dataq.id);
2625 hwi_post_async_buffers(phba, 0); 2628 hwi_post_async_buffers(phba, 0);
2626 SE_DEBUG(DBG_LVL_8, "DEFAULT PDU DATA RING CREATED \n"); 2629 SE_DEBUG(DBG_LVL_8, "DEFAULT PDU DATA RING CREATED\n");
2627 return 0; 2630 return 0;
2628} 2631}
2629 2632
@@ -2655,7 +2658,7 @@ beiscsi_post_pages(struct beiscsi_hba *phba)
2655 } 2658 }
2656 pm_arr++; 2659 pm_arr++;
2657 } 2660 }
2658 SE_DEBUG(DBG_LVL_8, "POSTED PAGES \n"); 2661 SE_DEBUG(DBG_LVL_8, "POSTED PAGES\n");
2659 return 0; 2662 return 0;
2660} 2663}
2661 2664
@@ -2885,7 +2888,7 @@ static int find_num_cpus(void)
2885 if (num_cpus >= MAX_CPUS) 2888 if (num_cpus >= MAX_CPUS)
2886 num_cpus = MAX_CPUS - 1; 2889 num_cpus = MAX_CPUS - 1;
2887 2890
2888 SE_DEBUG(DBG_LVL_8, "num_cpus = %d \n", num_cpus); 2891 SE_DEBUG(DBG_LVL_8, "num_cpus = %d\n", num_cpus);
2889 return num_cpus; 2892 return num_cpus;
2890} 2893}
2891 2894
@@ -2908,7 +2911,7 @@ static int hwi_init_port(struct beiscsi_hba *phba)
2908 2911
2909 status = beiscsi_create_eqs(phba, phwi_context); 2912 status = beiscsi_create_eqs(phba, phwi_context);
2910 if (status != 0) { 2913 if (status != 0) {
2911 shost_printk(KERN_ERR, phba->shost, "EQ not created \n"); 2914 shost_printk(KERN_ERR, phba->shost, "EQ not created\n");
2912 goto error; 2915 goto error;
2913 } 2916 }
2914 2917
@@ -2919,7 +2922,7 @@ static int hwi_init_port(struct beiscsi_hba *phba)
2919 status = mgmt_check_supported_fw(ctrl, phba); 2922 status = mgmt_check_supported_fw(ctrl, phba);
2920 if (status != 0) { 2923 if (status != 0) {
2921 shost_printk(KERN_ERR, phba->shost, 2924 shost_printk(KERN_ERR, phba->shost,
2922 "Unsupported fw version \n"); 2925 "Unsupported fw version\n");
2923 goto error; 2926 goto error;
2924 } 2927 }
2925 2928
@@ -2975,7 +2978,7 @@ static int hwi_init_controller(struct beiscsi_hba *phba)
2975 if (1 == phba->init_mem[HWI_MEM_ADDN_CONTEXT].num_elements) { 2978 if (1 == phba->init_mem[HWI_MEM_ADDN_CONTEXT].num_elements) {
2976 phwi_ctrlr->phwi_ctxt = (struct hwi_context_memory *)phba-> 2979 phwi_ctrlr->phwi_ctxt = (struct hwi_context_memory *)phba->
2977 init_mem[HWI_MEM_ADDN_CONTEXT].mem_array[0].virtual_address; 2980 init_mem[HWI_MEM_ADDN_CONTEXT].mem_array[0].virtual_address;
2978 SE_DEBUG(DBG_LVL_8, " phwi_ctrlr->phwi_ctxt=%p \n", 2981 SE_DEBUG(DBG_LVL_8, " phwi_ctrlr->phwi_ctxt=%p\n",
2979 phwi_ctrlr->phwi_ctxt); 2982 phwi_ctrlr->phwi_ctxt);
2980 } else { 2983 } else {
2981 shost_printk(KERN_ERR, phba->shost, 2984 shost_printk(KERN_ERR, phba->shost,
@@ -3008,8 +3011,8 @@ static void beiscsi_free_mem(struct beiscsi_hba *phba)
3008 pci_free_consistent(phba->pcidev, 3011 pci_free_consistent(phba->pcidev,
3009 mem_descr->mem_array[j - 1].size, 3012 mem_descr->mem_array[j - 1].size,
3010 mem_descr->mem_array[j - 1].virtual_address, 3013 mem_descr->mem_array[j - 1].virtual_address,
3011 mem_descr->mem_array[j - 1].bus_address. 3014 (unsigned long)mem_descr->mem_array[j - 1].
3012 u.a64.address); 3015 bus_address.u.a64.address);
3013 } 3016 }
3014 kfree(mem_descr->mem_array); 3017 kfree(mem_descr->mem_array);
3015 mem_descr++; 3018 mem_descr++;
@@ -3025,7 +3028,7 @@ static int beiscsi_init_controller(struct beiscsi_hba *phba)
3025 ret = beiscsi_get_memory(phba); 3028 ret = beiscsi_get_memory(phba);
3026 if (ret < 0) { 3029 if (ret < 0) {
3027 shost_printk(KERN_ERR, phba->shost, "beiscsi_dev_probe -" 3030 shost_printk(KERN_ERR, phba->shost, "beiscsi_dev_probe -"
3028 "Failed in beiscsi_alloc_memory \n"); 3031 "Failed in beiscsi_alloc_memory\n");
3029 return ret; 3032 return ret;
3030 } 3033 }
3031 3034
@@ -3102,12 +3105,12 @@ static int beiscsi_init_sgl_handle(struct beiscsi_hba *phba)
3102 } 3105 }
3103 SE_DEBUG(DBG_LVL_8, 3106 SE_DEBUG(DBG_LVL_8,
3104 "phba->io_sgl_hndl_avbl=%d" 3107 "phba->io_sgl_hndl_avbl=%d"
3105 "phba->eh_sgl_hndl_avbl=%d \n", 3108 "phba->eh_sgl_hndl_avbl=%d\n",
3106 phba->io_sgl_hndl_avbl, 3109 phba->io_sgl_hndl_avbl,
3107 phba->eh_sgl_hndl_avbl); 3110 phba->eh_sgl_hndl_avbl);
3108 mem_descr_sg = phba->init_mem; 3111 mem_descr_sg = phba->init_mem;
3109 mem_descr_sg += HWI_MEM_SGE; 3112 mem_descr_sg += HWI_MEM_SGE;
3110 SE_DEBUG(DBG_LVL_8, "\n mem_descr_sg->num_elements=%d \n", 3113 SE_DEBUG(DBG_LVL_8, "\n mem_descr_sg->num_elements=%d\n",
3111 mem_descr_sg->num_elements); 3114 mem_descr_sg->num_elements);
3112 arr_index = 0; 3115 arr_index = 0;
3113 idx = 0; 3116 idx = 0;
@@ -3156,7 +3159,7 @@ static int hba_setup_cid_tbls(struct beiscsi_hba *phba)
3156 if (!phba->ep_array) { 3159 if (!phba->ep_array) {
3157 shost_printk(KERN_ERR, phba->shost, 3160 shost_printk(KERN_ERR, phba->shost,
3158 "Failed to allocate memory in " 3161 "Failed to allocate memory in "
3159 "hba_setup_cid_tbls \n"); 3162 "hba_setup_cid_tbls\n");
3160 kfree(phba->cid_array); 3163 kfree(phba->cid_array);
3161 return -ENOMEM; 3164 return -ENOMEM;
3162 } 3165 }
@@ -3185,21 +3188,21 @@ static unsigned char hwi_enable_intr(struct beiscsi_hba *phba)
3185 addr = (u8 __iomem *) ((u8 __iomem *) ctrl->pcicfg + 3188 addr = (u8 __iomem *) ((u8 __iomem *) ctrl->pcicfg +
3186 PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET); 3189 PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET);
3187 reg = ioread32(addr); 3190 reg = ioread32(addr);
3188 SE_DEBUG(DBG_LVL_8, "reg =x%08x \n", reg); 3191 SE_DEBUG(DBG_LVL_8, "reg =x%08x\n", reg);
3189 3192
3190 enabled = reg & MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK; 3193 enabled = reg & MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
3191 if (!enabled) { 3194 if (!enabled) {
3192 reg |= MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK; 3195 reg |= MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
3193 SE_DEBUG(DBG_LVL_8, "reg =x%08x addr=%p \n", reg, addr); 3196 SE_DEBUG(DBG_LVL_8, "reg =x%08x addr=%p\n", reg, addr);
3194 iowrite32(reg, addr); 3197 iowrite32(reg, addr);
3195 if (!phba->msix_enabled) { 3198 if (!phba->msix_enabled) {
3196 eq = &phwi_context->be_eq[0].q; 3199 eq = &phwi_context->be_eq[0].q;
3197 SE_DEBUG(DBG_LVL_8, "eq->id=%d \n", eq->id); 3200 SE_DEBUG(DBG_LVL_8, "eq->id=%d\n", eq->id);
3198 hwi_ring_eq_db(phba, eq->id, 0, 0, 1, 1); 3201 hwi_ring_eq_db(phba, eq->id, 0, 0, 1, 1);
3199 } else { 3202 } else {
3200 for (i = 0; i <= phba->num_cpus; i++) { 3203 for (i = 0; i <= phba->num_cpus; i++) {
3201 eq = &phwi_context->be_eq[i].q; 3204 eq = &phwi_context->be_eq[i].q;
3202 SE_DEBUG(DBG_LVL_8, "eq->id=%d \n", eq->id); 3205 SE_DEBUG(DBG_LVL_8, "eq->id=%d\n", eq->id);
3203 hwi_ring_eq_db(phba, eq->id, 0, 0, 1, 1); 3206 hwi_ring_eq_db(phba, eq->id, 0, 0, 1, 1);
3204 } 3207 }
3205 } 3208 }
@@ -3220,7 +3223,7 @@ static void hwi_disable_intr(struct beiscsi_hba *phba)
3220 iowrite32(reg, addr); 3223 iowrite32(reg, addr);
3221 } else 3224 } else
3222 shost_printk(KERN_WARNING, phba->shost, 3225 shost_printk(KERN_WARNING, phba->shost,
3223 "In hwi_disable_intr, Already Disabled \n"); 3226 "In hwi_disable_intr, Already Disabled\n");
3224} 3227}
3225 3228
3226static int beiscsi_init_port(struct beiscsi_hba *phba) 3229static int beiscsi_init_port(struct beiscsi_hba *phba)
@@ -3231,14 +3234,14 @@ static int beiscsi_init_port(struct beiscsi_hba *phba)
3231 if (ret < 0) { 3234 if (ret < 0) {
3232 shost_printk(KERN_ERR, phba->shost, 3235 shost_printk(KERN_ERR, phba->shost,
3233 "beiscsi_dev_probe - Failed in" 3236 "beiscsi_dev_probe - Failed in"
3234 "beiscsi_init_controller \n"); 3237 "beiscsi_init_controller\n");
3235 return ret; 3238 return ret;
3236 } 3239 }
3237 ret = beiscsi_init_sgl_handle(phba); 3240 ret = beiscsi_init_sgl_handle(phba);
3238 if (ret < 0) { 3241 if (ret < 0) {
3239 shost_printk(KERN_ERR, phba->shost, 3242 shost_printk(KERN_ERR, phba->shost,
3240 "beiscsi_dev_probe - Failed in" 3243 "beiscsi_dev_probe - Failed in"
3241 "beiscsi_init_sgl_handle \n"); 3244 "beiscsi_init_sgl_handle\n");
3242 goto do_cleanup_ctrlr; 3245 goto do_cleanup_ctrlr;
3243 } 3246 }
3244 3247
@@ -3297,7 +3300,7 @@ static void beiscsi_clean_port(struct beiscsi_hba *phba)
3297 mgmt_status = mgmt_epfw_cleanup(phba, CMD_CONNECTION_CHUTE_0); 3300 mgmt_status = mgmt_epfw_cleanup(phba, CMD_CONNECTION_CHUTE_0);
3298 if (mgmt_status) 3301 if (mgmt_status)
3299 shost_printk(KERN_WARNING, phba->shost, 3302 shost_printk(KERN_WARNING, phba->shost,
3300 "mgmt_epfw_cleanup FAILED \n"); 3303 "mgmt_epfw_cleanup FAILED\n");
3301 3304
3302 hwi_purge_eq(phba); 3305 hwi_purge_eq(phba);
3303 hwi_cleanup(phba); 3306 hwi_cleanup(phba);
@@ -3487,7 +3490,7 @@ free_hndls:
3487 io_task->pwrb_handle = NULL; 3490 io_task->pwrb_handle = NULL;
3488 pci_pool_free(beiscsi_sess->bhs_pool, io_task->cmd_bhs, 3491 pci_pool_free(beiscsi_sess->bhs_pool, io_task->cmd_bhs,
3489 io_task->bhs_pa.u.a64.address); 3492 io_task->bhs_pa.u.a64.address);
3490 SE_DEBUG(DBG_LVL_1, "Alloc of SGL_ICD Failed \n"); 3493 SE_DEBUG(DBG_LVL_1, "Alloc of SGL_ICD Failed\n");
3491 return -ENOMEM; 3494 return -ENOMEM;
3492} 3495}
3493 3496
@@ -3654,7 +3657,7 @@ static int beiscsi_mtask(struct iscsi_task *task)
3654 break; 3657 break;
3655 3658
3656 default: 3659 default:
3657 SE_DEBUG(DBG_LVL_1, "opcode =%d Not supported \n", 3660 SE_DEBUG(DBG_LVL_1, "opcode =%d Not supported\n",
3658 task->hdr->opcode & ISCSI_OPCODE_MASK); 3661 task->hdr->opcode & ISCSI_OPCODE_MASK);
3659 return -EINVAL; 3662 return -EINVAL;
3660 } 3663 }
@@ -3696,7 +3699,7 @@ static int beiscsi_task_xmit(struct iscsi_task *task)
3696 sg = scsi_sglist(sc); 3699 sg = scsi_sglist(sc);
3697 if (sc->sc_data_direction == DMA_TO_DEVICE) { 3700 if (sc->sc_data_direction == DMA_TO_DEVICE) {
3698 writedir = 1; 3701 writedir = 1;
3699 SE_DEBUG(DBG_LVL_4, "task->imm_count=0x%08x \n", 3702 SE_DEBUG(DBG_LVL_4, "task->imm_count=0x%08x\n",
3700 task->imm_count); 3703 task->imm_count);
3701 } else 3704 } else
3702 writedir = 0; 3705 writedir = 0;
@@ -3713,7 +3716,7 @@ static void beiscsi_remove(struct pci_dev *pcidev)
3713 3716
3714 phba = (struct beiscsi_hba *)pci_get_drvdata(pcidev); 3717 phba = (struct beiscsi_hba *)pci_get_drvdata(pcidev);
3715 if (!phba) { 3718 if (!phba) {
3716 dev_err(&pcidev->dev, "beiscsi_remove called with no phba \n"); 3719 dev_err(&pcidev->dev, "beiscsi_remove called with no phba\n");
3717 return; 3720 return;
3718 } 3721 }
3719 3722
@@ -3782,7 +3785,7 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
3782 phba = beiscsi_hba_alloc(pcidev); 3785 phba = beiscsi_hba_alloc(pcidev);
3783 if (!phba) { 3786 if (!phba) {
3784 dev_err(&pcidev->dev, "beiscsi_dev_probe-" 3787 dev_err(&pcidev->dev, "beiscsi_dev_probe-"
3785 " Failed in beiscsi_hba_alloc \n"); 3788 " Failed in beiscsi_hba_alloc\n");
3786 goto disable_pci; 3789 goto disable_pci;
3787 } 3790 }
3788 3791
@@ -3805,7 +3808,7 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
3805 else 3808 else
3806 num_cpus = 1; 3809 num_cpus = 1;
3807 phba->num_cpus = num_cpus; 3810 phba->num_cpus = num_cpus;
3808 SE_DEBUG(DBG_LVL_8, "num_cpus = %d \n", phba->num_cpus); 3811 SE_DEBUG(DBG_LVL_8, "num_cpus = %d\n", phba->num_cpus);
3809 3812
3810 if (enable_msix) 3813 if (enable_msix)
3811 beiscsi_msix_enable(phba); 3814 beiscsi_msix_enable(phba);
@@ -3877,7 +3880,7 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
3877 "Failed to hwi_enable_intr\n"); 3880 "Failed to hwi_enable_intr\n");
3878 goto free_ctrlr; 3881 goto free_ctrlr;
3879 } 3882 }
3880 SE_DEBUG(DBG_LVL_8, "\n\n\n SUCCESS - DRIVER LOADED \n\n\n"); 3883 SE_DEBUG(DBG_LVL_8, "\n\n\n SUCCESS - DRIVER LOADED\n\n\n");
3881 return 0; 3884 return 0;
3882 3885
3883free_ctrlr: 3886free_ctrlr:
@@ -3989,7 +3992,7 @@ static int __init beiscsi_module_init(void)
3989 "transport.\n"); 3992 "transport.\n");
3990 return -ENOMEM; 3993 return -ENOMEM;
3991 } 3994 }
3992 SE_DEBUG(DBG_LVL_8, "In beiscsi_module_init, tt=%p \n", 3995 SE_DEBUG(DBG_LVL_8, "In beiscsi_module_init, tt=%p\n",
3993 &beiscsi_iscsi_transport); 3996 &beiscsi_iscsi_transport);
3994 3997
3995 ret = pci_register_driver(&beiscsi_pci_driver); 3998 ret = pci_register_driver(&beiscsi_pci_driver);
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index 87ec21280a37..e6ddddbbae7a 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -39,7 +39,7 @@
39 "Linux iSCSI Driver version" BUILD_STR 39 "Linux iSCSI Driver version" BUILD_STR
40#define DRV_DESC BE_NAME " " "Driver" 40#define DRV_DESC BE_NAME " " "Driver"
41 41
42#define BE_VENDOR_ID 0x19A2 42#define BE_VENDOR_ID 0x19A2
43/* DEVICE ID's for BE2 */ 43/* DEVICE ID's for BE2 */
44#define BE_DEVICE_ID1 0x212 44#define BE_DEVICE_ID1 0x212
45#define OC_DEVICE_ID1 0x702 45#define OC_DEVICE_ID1 0x702
@@ -68,8 +68,8 @@
68#define BEISCSI_NUM_MAX_LUN 256 /* scsi_host->max_lun */ 68#define BEISCSI_NUM_MAX_LUN 256 /* scsi_host->max_lun */
69#define BEISCSI_NUM_DEVICES_SUPPORTED 0x01 69#define BEISCSI_NUM_DEVICES_SUPPORTED 0x01
70#define BEISCSI_MAX_FRAGS_INIT 192 70#define BEISCSI_MAX_FRAGS_INIT 192
71#define BE_NUM_MSIX_ENTRIES 1 71#define BE_NUM_MSIX_ENTRIES 1
72#define MPU_EP_SEMAPHORE 0xac 72#define MPU_EP_SEMAPHORE 0xac
73 73
74#define BE_SENSE_INFO_SIZE 258 74#define BE_SENSE_INFO_SIZE 258
75#define BE_ISCSI_PDU_HEADER_SIZE 64 75#define BE_ISCSI_PDU_HEADER_SIZE 64
@@ -105,7 +105,7 @@ do { \
105#define HWI_GET_ASYNC_PDU_CTX(phwi) (phwi->phwi_ctxt->pasync_ctx) 105#define HWI_GET_ASYNC_PDU_CTX(phwi) (phwi->phwi_ctxt->pasync_ctx)
106 106
107/********* Memory BAR register ************/ 107/********* Memory BAR register ************/
108#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc 108#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc
109/** 109/**
110 * Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt 110 * Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt
111 * Disable" may still globally block interrupts in addition to individual 111 * Disable" may still globally block interrupts in addition to individual
@@ -116,7 +116,7 @@ do { \
116#define MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK (1 << 29) /* bit 29 */ 116#define MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK (1 << 29) /* bit 29 */
117 117
118/********* ISR0 Register offset **********/ 118/********* ISR0 Register offset **********/
119#define CEV_ISR0_OFFSET 0xC18 119#define CEV_ISR0_OFFSET 0xC18
120#define CEV_ISR_SIZE 4 120#define CEV_ISR_SIZE 4
121 121
122/** 122/**
@@ -139,12 +139,12 @@ do { \
139#define DB_EQ_REARM_SHIFT (29) /* bit 29 */ 139#define DB_EQ_REARM_SHIFT (29) /* bit 29 */
140 140
141/********* Compl Q door bell *************/ 141/********* Compl Q door bell *************/
142#define DB_CQ_OFFSET 0x120 142#define DB_CQ_OFFSET 0x120
143#define DB_CQ_RING_ID_MASK 0x3FF /* bits 0 - 9 */ 143#define DB_CQ_RING_ID_MASK 0x3FF /* bits 0 - 9 */
144/* Number of event entries processed */ 144/* Number of event entries processed */
145#define DB_CQ_NUM_POPPED_SHIFT (16) /* bits 16 - 28 */ 145#define DB_CQ_NUM_POPPED_SHIFT (16) /* bits 16 - 28 */
146/* Rearm bit */ 146/* Rearm bit */
147#define DB_CQ_REARM_SHIFT (29) /* bit 29 */ 147#define DB_CQ_REARM_SHIFT (29) /* bit 29 */
148 148
149#define GET_HWI_CONTROLLER_WS(pc) (pc->phwi_ctrlr) 149#define GET_HWI_CONTROLLER_WS(pc) (pc->phwi_ctrlr)
150#define HWI_GET_DEF_BUFQ_ID(pc) (((struct hwi_controller *)\ 150#define HWI_GET_DEF_BUFQ_ID(pc) (((struct hwi_controller *)\
@@ -161,12 +161,12 @@ enum be_mem_enum {
161 HWI_MEM_WRBH, 161 HWI_MEM_WRBH,
162 HWI_MEM_SGLH, 162 HWI_MEM_SGLH,
163 HWI_MEM_SGE, 163 HWI_MEM_SGE,
164 HWI_MEM_ASYNC_HEADER_BUF, /* 5 */ 164 HWI_MEM_ASYNC_HEADER_BUF, /* 5 */
165 HWI_MEM_ASYNC_DATA_BUF, 165 HWI_MEM_ASYNC_DATA_BUF,
166 HWI_MEM_ASYNC_HEADER_RING, 166 HWI_MEM_ASYNC_HEADER_RING,
167 HWI_MEM_ASYNC_DATA_RING, 167 HWI_MEM_ASYNC_DATA_RING,
168 HWI_MEM_ASYNC_HEADER_HANDLE, 168 HWI_MEM_ASYNC_HEADER_HANDLE,
169 HWI_MEM_ASYNC_DATA_HANDLE, /* 10 */ 169 HWI_MEM_ASYNC_DATA_HANDLE, /* 10 */
170 HWI_MEM_ASYNC_PDU_CONTEXT, 170 HWI_MEM_ASYNC_PDU_CONTEXT,
171 ISCSI_MEM_GLOBAL_HEADER, 171 ISCSI_MEM_GLOBAL_HEADER,
172 SE_MEM_MAX 172 SE_MEM_MAX
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 350cbeaae160..7d4ac5c1a868 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -58,7 +58,7 @@ unsigned char mgmt_get_fw_config(struct be_ctrl_info *ctrl,
58 } 58 }
59 } else { 59 } else {
60 shost_printk(KERN_WARNING, phba->shost, 60 shost_printk(KERN_WARNING, phba->shost,
61 "Failed in mgmt_get_fw_config \n"); 61 "Failed in mgmt_get_fw_config\n");
62 } 62 }
63 63
64 spin_unlock(&ctrl->mbox_lock); 64 spin_unlock(&ctrl->mbox_lock);
@@ -167,7 +167,7 @@ unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba,
167 &nonemb_cmd.dma); 167 &nonemb_cmd.dma);
168 if (nonemb_cmd.va == NULL) { 168 if (nonemb_cmd.va == NULL) {
169 SE_DEBUG(DBG_LVL_1, 169 SE_DEBUG(DBG_LVL_1,
170 "Failed to allocate memory for mgmt_invalidate_icds\n"); 170 "Failed to alloc memory for mgmt_invalidate_icds\n");
171 spin_unlock(&ctrl->mbox_lock); 171 spin_unlock(&ctrl->mbox_lock);
172 return 0; 172 return 0;
173 } 173 }
@@ -339,7 +339,7 @@ int mgmt_open_connection(struct beiscsi_hba *phba,
339 if (phba->nxt_cqid == phba->num_cpus) 339 if (phba->nxt_cqid == phba->num_cpus)
340 phba->nxt_cqid = 0; 340 phba->nxt_cqid = 0;
341 req->cq_id = phwi_context->be_cq[i].id; 341 req->cq_id = phwi_context->be_cq[i].id;
342 SE_DEBUG(DBG_LVL_8, "i=%d cq_id=%d \n", i, req->cq_id); 342 SE_DEBUG(DBG_LVL_8, "i=%d cq_id=%d\n", i, req->cq_id);
343 req->defq_id = def_hdr_id; 343 req->defq_id = def_hdr_id;
344 req->hdr_ring_id = def_hdr_id; 344 req->hdr_ring_id = def_hdr_id;
345 req->data_ring_id = def_data_id; 345 req->data_ring_id = def_data_id;