diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.h | 4 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_hwi.c | 8 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_iscsi.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libiscsi.c | 22 |
4 files changed, 10 insertions, 26 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h index 081c171a1ed6..5ce5170254ca 100644 --- a/drivers/scsi/be2iscsi/be_main.h +++ b/drivers/scsi/be2iscsi/be_main.h | |||
@@ -397,7 +397,7 @@ struct amap_pdu_data_out { | |||
397 | }; | 397 | }; |
398 | 398 | ||
399 | struct be_cmd_bhs { | 399 | struct be_cmd_bhs { |
400 | struct iscsi_cmd iscsi_hdr; | 400 | struct iscsi_scsi_req iscsi_hdr; |
401 | unsigned char pad1[16]; | 401 | unsigned char pad1[16]; |
402 | struct pdu_data_out iscsi_data_pdu; | 402 | struct pdu_data_out iscsi_data_pdu; |
403 | unsigned char pad2[BE_SENSE_INFO_SIZE - | 403 | unsigned char pad2[BE_SENSE_INFO_SIZE - |
@@ -428,7 +428,7 @@ struct be_nonio_bhs { | |||
428 | }; | 428 | }; |
429 | 429 | ||
430 | struct be_status_bhs { | 430 | struct be_status_bhs { |
431 | struct iscsi_cmd iscsi_hdr; | 431 | struct iscsi_scsi_req iscsi_hdr; |
432 | unsigned char pad1[16]; | 432 | unsigned char pad1[16]; |
433 | /** | 433 | /** |
434 | * The plus 2 below is to hold the sense info length that gets | 434 | * The plus 2 below is to hold the sense info length that gets |
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 030a96c646c3..9ae80cd5953b 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c | |||
@@ -332,11 +332,11 @@ int bnx2i_send_iscsi_login(struct bnx2i_conn *bnx2i_conn, | |||
332 | { | 332 | { |
333 | struct bnx2i_cmd *bnx2i_cmd; | 333 | struct bnx2i_cmd *bnx2i_cmd; |
334 | struct bnx2i_login_request *login_wqe; | 334 | struct bnx2i_login_request *login_wqe; |
335 | struct iscsi_login *login_hdr; | 335 | struct iscsi_login_req *login_hdr; |
336 | u32 dword; | 336 | u32 dword; |
337 | 337 | ||
338 | bnx2i_cmd = (struct bnx2i_cmd *)task->dd_data; | 338 | bnx2i_cmd = (struct bnx2i_cmd *)task->dd_data; |
339 | login_hdr = (struct iscsi_login *)task->hdr; | 339 | login_hdr = (struct iscsi_login_req *)task->hdr; |
340 | login_wqe = (struct bnx2i_login_request *) | 340 | login_wqe = (struct bnx2i_login_request *) |
341 | bnx2i_conn->ep->qp.sq_prod_qe; | 341 | bnx2i_conn->ep->qp.sq_prod_qe; |
342 | 342 | ||
@@ -1349,7 +1349,7 @@ int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session, | |||
1349 | struct bnx2i_cmd_response *resp_cqe; | 1349 | struct bnx2i_cmd_response *resp_cqe; |
1350 | struct bnx2i_cmd *bnx2i_cmd; | 1350 | struct bnx2i_cmd *bnx2i_cmd; |
1351 | struct iscsi_task *task; | 1351 | struct iscsi_task *task; |
1352 | struct iscsi_cmd_rsp *hdr; | 1352 | struct iscsi_scsi_rsp *hdr; |
1353 | u32 datalen = 0; | 1353 | u32 datalen = 0; |
1354 | 1354 | ||
1355 | resp_cqe = (struct bnx2i_cmd_response *)cqe; | 1355 | resp_cqe = (struct bnx2i_cmd_response *)cqe; |
@@ -1376,7 +1376,7 @@ int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session, | |||
1376 | } | 1376 | } |
1377 | bnx2i_iscsi_unmap_sg_list(bnx2i_cmd); | 1377 | bnx2i_iscsi_unmap_sg_list(bnx2i_cmd); |
1378 | 1378 | ||
1379 | hdr = (struct iscsi_cmd_rsp *)task->hdr; | 1379 | hdr = (struct iscsi_scsi_rsp *)task->hdr; |
1380 | resp_cqe = (struct bnx2i_cmd_response *)cqe; | 1380 | resp_cqe = (struct bnx2i_cmd_response *)cqe; |
1381 | hdr->opcode = resp_cqe->op_code; | 1381 | hdr->opcode = resp_cqe->op_code; |
1382 | hdr->max_cmdsn = cpu_to_be32(resp_cqe->max_cmd_sn); | 1382 | hdr->max_cmdsn = cpu_to_be32(resp_cqe->max_cmd_sn); |
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index 5c55a75ae597..cffd4d75df56 100644 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c | |||
@@ -1213,7 +1213,7 @@ static int bnx2i_task_xmit(struct iscsi_task *task) | |||
1213 | struct bnx2i_conn *bnx2i_conn = conn->dd_data; | 1213 | struct bnx2i_conn *bnx2i_conn = conn->dd_data; |
1214 | struct scsi_cmnd *sc = task->sc; | 1214 | struct scsi_cmnd *sc = task->sc; |
1215 | struct bnx2i_cmd *cmd = task->dd_data; | 1215 | struct bnx2i_cmd *cmd = task->dd_data; |
1216 | struct iscsi_cmd *hdr = (struct iscsi_cmd *) task->hdr; | 1216 | struct iscsi_scsi_req *hdr = (struct iscsi_scsi_req *)task->hdr; |
1217 | 1217 | ||
1218 | if (atomic_read(&bnx2i_conn->ep->num_active_cmds) + 1 > | 1218 | if (atomic_read(&bnx2i_conn->ep->num_active_cmds) + 1 > |
1219 | hba->max_sqes) | 1219 | hba->max_sqes) |
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index d7a4120034a2..256a999d010b 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -84,22 +84,6 @@ MODULE_PARM_DESC(debug_libiscsi_eh, | |||
84 | __func__, ##arg); \ | 84 | __func__, ##arg); \ |
85 | } while (0); | 85 | } while (0); |
86 | 86 | ||
87 | /* Serial Number Arithmetic, 32 bits, less than, RFC1982 */ | ||
88 | #define SNA32_CHECK 2147483648UL | ||
89 | |||
90 | static int iscsi_sna_lt(u32 n1, u32 n2) | ||
91 | { | ||
92 | return n1 != n2 && ((n1 < n2 && (n2 - n1 < SNA32_CHECK)) || | ||
93 | (n1 > n2 && (n2 - n1 < SNA32_CHECK))); | ||
94 | } | ||
95 | |||
96 | /* Serial Number Arithmetic, 32 bits, less than, RFC1982 */ | ||
97 | static int iscsi_sna_lte(u32 n1, u32 n2) | ||
98 | { | ||
99 | return n1 == n2 || ((n1 < n2 && (n2 - n1 < SNA32_CHECK)) || | ||
100 | (n1 > n2 && (n2 - n1 < SNA32_CHECK))); | ||
101 | } | ||
102 | |||
103 | inline void iscsi_conn_queue_work(struct iscsi_conn *conn) | 87 | inline void iscsi_conn_queue_work(struct iscsi_conn *conn) |
104 | { | 88 | { |
105 | struct Scsi_Host *shost = conn->session->host; | 89 | struct Scsi_Host *shost = conn->session->host; |
@@ -360,7 +344,7 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task) | |||
360 | struct iscsi_conn *conn = task->conn; | 344 | struct iscsi_conn *conn = task->conn; |
361 | struct iscsi_session *session = conn->session; | 345 | struct iscsi_session *session = conn->session; |
362 | struct scsi_cmnd *sc = task->sc; | 346 | struct scsi_cmnd *sc = task->sc; |
363 | struct iscsi_cmd *hdr; | 347 | struct iscsi_scsi_req *hdr; |
364 | unsigned hdrlength, cmd_len; | 348 | unsigned hdrlength, cmd_len; |
365 | itt_t itt; | 349 | itt_t itt; |
366 | int rc; | 350 | int rc; |
@@ -374,7 +358,7 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task) | |||
374 | if (rc) | 358 | if (rc) |
375 | return rc; | 359 | return rc; |
376 | } | 360 | } |
377 | hdr = (struct iscsi_cmd *) task->hdr; | 361 | hdr = (struct iscsi_scsi_req *)task->hdr; |
378 | itt = hdr->itt; | 362 | itt = hdr->itt; |
379 | memset(hdr, 0, sizeof(*hdr)); | 363 | memset(hdr, 0, sizeof(*hdr)); |
380 | 364 | ||
@@ -830,7 +814,7 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr, | |||
830 | struct iscsi_task *task, char *data, | 814 | struct iscsi_task *task, char *data, |
831 | int datalen) | 815 | int datalen) |
832 | { | 816 | { |
833 | struct iscsi_cmd_rsp *rhdr = (struct iscsi_cmd_rsp *)hdr; | 817 | struct iscsi_scsi_rsp *rhdr = (struct iscsi_scsi_rsp *)hdr; |
834 | struct iscsi_session *session = conn->session; | 818 | struct iscsi_session *session = conn->session; |
835 | struct scsi_cmnd *sc = task->sc; | 819 | struct scsi_cmnd *sc = task->sc; |
836 | 820 | ||