Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260827
b: refs/heads/master
c: 8304bbc
h: refs/heads/master
i:
  260825: cc23e4b
  260823: d77c23c
v: v3
  • Loading branch information
Nicholas Bellinger committed Jul 25, 2011
1 parent ba46b97 commit 817c56c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 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: 55bdabdf41b6ee99e22e9d78a895b001fb1d852e
refs/heads/master: 8304bbceee505742925b487fd8ea56e1f8b4b805
16 changes: 0 additions & 16 deletions trunk/drivers/scsi/libiscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,6 @@ MODULE_PARM_DESC(debug_libiscsi_eh,
__func__, ##arg); \
} while (0);

/* Serial Number Arithmetic, 32 bits, less than, RFC1982 */
#define SNA32_CHECK 2147483648UL

static int iscsi_sna_lt(u32 n1, u32 n2)
{
return n1 != n2 && ((n1 < n2 && (n2 - n1 < SNA32_CHECK)) ||
(n1 > n2 && (n2 - n1 < SNA32_CHECK)));
}

/* Serial Number Arithmetic, 32 bits, less than, RFC1982 */
static int iscsi_sna_lte(u32 n1, u32 n2)
{
return n1 == n2 || ((n1 < n2 && (n2 - n1 < SNA32_CHECK)) ||
(n1 > n2 && (n2 - n1 < SNA32_CHECK)));
}

inline void iscsi_conn_queue_work(struct iscsi_conn *conn)
{
struct Scsi_Host *shost = conn->session->host;
Expand Down
30 changes: 30 additions & 0 deletions trunk/include/scsi/iscsi_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,39 @@
/* default iSCSI listen port for incoming connections */
#define ISCSI_LISTEN_PORT 3260

/* iSCSI header length */
#define ISCSI_HDR_LEN 48

/* iSCSI CRC32C length */
#define ISCSI_CRC_LEN 4

/* Padding word length */
#define ISCSI_PAD_LEN 4

/*
* Serial Number Arithmetic, 32 bits, RFC1982
*/

static inline int iscsi_sna_lt(u32 n1, u32 n2)
{
return (s32)(n1 - n2) < 0;
}

static inline int iscsi_sna_lte(u32 n1, u32 n2)
{
return (s32)(n1 - n2) <= 0;
}

static inline int iscsi_sna_gt(u32 n1, u32 n2)
{
return (s32)(n1 - n2) > 0;
}

static inline int iscsi_sna_gte(u32 n1, u32 n2)
{
return (s32)(n1 - n2) >= 0;
}

/*
* useful common(control and data pathes) macro
*/
Expand Down

0 comments on commit 817c56c

Please sign in to comment.