summaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2005-08-31 15:18:35 -0700
committerJames Bottomley <jejb@mulgrave.(none)>2005-09-10 11:10:43 -0500
commit218fba0004390b0101e681f6db1b8920c1109e54 (patch)
tree571c6477b4fff4808ab0faace6a5aef7517ca81a /include/scsi
parent37be6eeb4990c05fc7dd683ceaf1501d46ebe9a4 (diff)
[SCSI] fc_transport: Generalize WWN to u64 interger conversions.
On some platforms the hard-casting of 8 byte node_name and port_name arrays to an u64 would cause unaligned-access warnings. Generalize the conversions with a transport helper function which performs consistent shifting of WWN bytes. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/scsi_transport_fc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 70ad16315a1..115db056dc6 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -439,4 +439,12 @@ int fc_remote_port_block(struct fc_rport *rport);
void fc_remote_port_unblock(struct fc_rport *rport);
int scsi_is_fc_rport(const struct device *);
+static inline u64 wwn_to_u64(u8 *wwn)
+{
+ return (u64)wwn[0] << 56 | (u64)wwn[1] << 48 |
+ (u64)wwn[2] << 40 | (u64)wwn[3] << 32 |
+ (u64)wwn[4] << 24 | (u64)wwn[5] << 16 |
+ (u64)wwn[6] << 8 | (u64)wwn[7];
+}
+
#endif /* SCSI_TRANSPORT_FC_H */