Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195640
b: refs/heads/master
c: 0b2f74a
h: refs/heads/master
v: v3
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Apr 11, 2010
1 parent 6451dd2 commit 1aeac16
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 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: 3b719d01617288f4c11307fcb933997d7ca895c3
refs/heads/master: 0b2f74a47f2b10bd4c70324820a93c070b3960a5
17 changes: 11 additions & 6 deletions trunk/include/scsi/libfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,18 @@
#define ntohll(x) be64_to_cpu(x)
#define htonll(x) cpu_to_be64(x)

#define ntoh24(p) (((p)[0] << 16) | ((p)[1] << 8) | ((p)[2]))

#define hton24(p, v) do { \
p[0] = (((v) >> 16) & 0xFF); \
p[1] = (((v) >> 8) & 0xFF); \
p[2] = ((v) & 0xFF); \
} while (0)
static inline u32 ntoh24(const u8 *p)
{
return (p[0] << 16) | (p[1] << 8) | p[2];
}

static inline void hton24(u8 *p, u32 v)
{
p[0] = (v >> 16) & 0xff;
p[1] = (v >> 8) & 0xff;
p[2] = v & 0xff;
}

/**
* enum fc_lport_state - Local port states
Expand Down

0 comments on commit 1aeac16

Please sign in to comment.