Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84392
b: refs/heads/master
c: 8b1d034
h: refs/heads/master
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Feb 8, 2008
1 parent 7028523 commit f27e449
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 322d739da83bbff0309c202181f79c08d9534880
refs/heads/master: 8b1d03434ee44b08c57f50403eaeab099facebf5
14 changes: 4 additions & 10 deletions trunk/drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_cmd_task *ctask)
hdr->opcode = ISCSI_OP_SCSI_CMD;
hdr->flags = ISCSI_ATTR_SIMPLE;
int_to_scsilun(sc->device->lun, (struct scsi_lun *)hdr->lun);
hdr->itt = build_itt(ctask->itt, conn->id, session->age);
hdr->itt = build_itt(ctask->itt, session->age);
hdr->data_length = cpu_to_be32(scsi_bufflen(sc));
hdr->cmdsn = cpu_to_be32(session->cmdsn);
session->cmdsn++;
Expand Down Expand Up @@ -705,14 +705,6 @@ int iscsi_verify_itt(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
return ISCSI_ERR_BAD_ITT;
}

if (((__force u32)hdr->itt & ISCSI_CID_MASK) !=
(conn->id << ISCSI_CID_SHIFT)) {
iscsi_conn_printk(KERN_ERR, conn,
"iscsi: received itt %x, expected "
"CID (%x)\n",
(__force u32)hdr->itt, conn->id);
return ISCSI_ERR_BAD_ITT;
}
itt = get_itt(hdr->itt);
} else
itt = ~0U;
Expand Down Expand Up @@ -776,7 +768,7 @@ static void iscsi_prep_mtask(struct iscsi_conn *conn,
*/
nop->cmdsn = cpu_to_be32(session->cmdsn);
if (hdr->itt != RESERVED_ITT) {
hdr->itt = build_itt(mtask->itt, conn->id, session->age);
hdr->itt = build_itt(mtask->itt, session->age);
/*
* TODO: We always use immediate, so we never hit this.
* If we start to send tmfs or nops as non-immediate then
Expand Down Expand Up @@ -2036,6 +2028,8 @@ int iscsi_conn_start(struct iscsi_cls_conn *cls_conn)
conn->stop_stage = 0;
conn->tmf_state = TMF_INITIAL;
session->age++;
if (session->age == 16)
session->age = 0;
break;
case STOP_CONN_TERM:
conn->stop_stage = 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/scsi/iscsi_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
/* initiator tags; opaque for target */
typedef uint32_t __bitwise__ itt_t;
/* below makes sense only for initiator that created this tag */
#define build_itt(itt, id, age) ((__force itt_t)\
((itt) | ((id) << ISCSI_CID_SHIFT) | ((age) << ISCSI_AGE_SHIFT)))
#define build_itt(itt, age) ((__force itt_t)\
((itt) | ((age) << ISCSI_AGE_SHIFT)))
#define get_itt(itt) ((__force uint32_t)(itt_t)(itt) & ISCSI_ITT_MASK)
#define RESERVED_ITT ((__force itt_t)0xffffffff)

Expand Down
2 changes: 0 additions & 2 deletions trunk/include/scsi/libiscsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ enum {
#define ISCSI_SUSPEND_BIT 1

#define ISCSI_ITT_MASK (0xfff)
#define ISCSI_CID_SHIFT 12
#define ISCSI_CID_MASK (0xffff << ISCSI_CID_SHIFT)
#define ISCSI_AGE_SHIFT 28
#define ISCSI_AGE_MASK (0xf << ISCSI_AGE_SHIFT)

Expand Down

0 comments on commit f27e449

Please sign in to comment.