diff options
Diffstat (limited to 'include/scsi/libfc.h')
-rw-r--r-- | include/scsi/libfc.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 8d0d1b2d8258..a26bb50c0c8b 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -47,13 +47,18 @@ | |||
47 | #define ntohll(x) be64_to_cpu(x) | 47 | #define ntohll(x) be64_to_cpu(x) |
48 | #define htonll(x) cpu_to_be64(x) | 48 | #define htonll(x) cpu_to_be64(x) |
49 | 49 | ||
50 | #define ntoh24(p) (((p)[0] << 16) | ((p)[1] << 8) | ((p)[2])) | ||
51 | 50 | ||
52 | #define hton24(p, v) do { \ | 51 | static inline u32 ntoh24(const u8 *p) |
53 | p[0] = (((v) >> 16) & 0xFF); \ | 52 | { |
54 | p[1] = (((v) >> 8) & 0xFF); \ | 53 | return (p[0] << 16) | (p[1] << 8) | p[2]; |
55 | p[2] = ((v) & 0xFF); \ | 54 | } |
56 | } while (0) | 55 | |
56 | static inline void hton24(u8 *p, u32 v) | ||
57 | { | ||
58 | p[0] = (v >> 16) & 0xff; | ||
59 | p[1] = (v >> 8) & 0xff; | ||
60 | p[2] = v & 0xff; | ||
61 | } | ||
57 | 62 | ||
58 | /** | 63 | /** |
59 | * enum fc_lport_state - Local port states | 64 | * enum fc_lport_state - Local port states |