diff options
author | Neerav Parikh <Neerav.Parikh@intel.com> | 2011-05-16 16:45:29 -0700 |
---|---|---|
committer | James Bottomley <jbottomley@parallels.com> | 2011-05-24 12:36:29 -0400 |
commit | bdf252183e58654fcceedbf3fdcfd878b9e4f2d6 (patch) | |
tree | b02db1a5baab6cde3fb77f2e9c7c1c302e996ce1 /drivers/scsi/fcoe/fcoe.h | |
parent | c051ad2e57e379e07e4ec28b2a54eeb0d04c5d59 (diff) |
[SCSI] fcoe: Prevent creation of an NPIV port with duplicate WWPN
This patch adds a validation step before allowing creation of a new NPIV port.
It checks whether the WWPN passed for the new NPIV port to be created is unique
for the given physical port.
Signed-off-by: Neerav Parikh <Neerav.Parikh@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.h')
-rw-r--r-- | drivers/scsi/fcoe/fcoe.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/scsi/fcoe/fcoe.h b/drivers/scsi/fcoe/fcoe.h index 408a6fd78fb4..c4a93993c0cf 100644 --- a/drivers/scsi/fcoe/fcoe.h +++ b/drivers/scsi/fcoe/fcoe.h @@ -99,4 +99,14 @@ static inline struct net_device *fcoe_netdev(const struct fc_lport *lport) ((struct fcoe_port *)lport_priv(lport))->priv)->netdev; } +static inline void wwn_to_str(u64 wwn, char *buf, int len) +{ + u8 wwpn[8]; + + u64_to_wwn(wwn, wwpn); + snprintf(buf, len, "%02x%02x%02x%02x%02x%02x%02x%02x", + wwpn[0], wwpn[1], wwpn[2], wwpn[3], + wwpn[4], wwpn[5], wwpn[6], wwpn[7]); +} + #endif /* _FCOE_H_ */ |