aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c22
1 files changed, 3 insertions, 19 deletions
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
90static 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 */
97static 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
103inline void iscsi_conn_queue_work(struct iscsi_conn *conn) 87inline 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