diff options
author | Jing Huang <huangj@brocade.com> | 2010-07-08 19:48:12 -0700 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 12:04:06 -0500 |
commit | 15b64a835def4c784c6e62ad762677f5cb56eba2 (patch) | |
tree | 0d6ca06f6472c2bb71d254dbbc255ea6f18f8988 /drivers/scsi/bfa/bfa_ioc.c | |
parent | 1769f990fc182695bc215ce4369688064addcd1e (diff) |
[SCSI] bfa: ioc attributes fix
This patch fixes the APIs to obtain ioc attributes
- fix API to obtain wwpn, wwnn, and mac.
- add API to get mfg wwpn, wwnn, and mac.
- fix API to obtain wwn of boot target.
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 268c071ce67..1600f747eb6 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c @@ -1838,54 +1838,54 @@ bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr) } /** - * hal_wwn_public + * bfa_wwn_public */ wwn_t bfa_ioc_get_pwwn(struct bfa_ioc_s *ioc) { - union { - wwn_t wwn; - u8 byte[sizeof(wwn_t)]; - } - w; - - w.wwn = ioc->attr->mfg_wwn; - - if (bfa_ioc_portid(ioc) == 1) - w.byte[7]++; - - return w.wwn; + return ioc->attr->pwwn; } wwn_t bfa_ioc_get_nwwn(struct bfa_ioc_s *ioc) { - union { - wwn_t wwn; - u8 byte[sizeof(wwn_t)]; - } - w; - - w.wwn = ioc->attr->mfg_wwn; - - if (bfa_ioc_portid(ioc) == 1) - w.byte[7]++; - - w.byte[0] = 0x20; - - return w.wwn; + return ioc->attr->nwwn; } u64 bfa_ioc_get_adid(struct bfa_ioc_s *ioc) { - return ioc->attr->mfg_wwn; + return ioc->attr->mfg_pwwn; } mac_t bfa_ioc_get_mac(struct bfa_ioc_s *ioc) { - mac_t mac; + /* + * Currently mfg mac is used as FCoE enode mac (not configured by PBC) + */ + if (bfa_ioc_get_type(ioc) == BFA_IOC_TYPE_FCoE) + return bfa_ioc_get_mfg_mac(ioc); + else + return ioc->attr->mac; +} + +wwn_t +bfa_ioc_get_mfg_pwwn(struct bfa_ioc_s *ioc) +{ + return ioc->attr->mfg_pwwn; +} + +wwn_t +bfa_ioc_get_mfg_nwwn(struct bfa_ioc_s *ioc) +{ + return ioc->attr->mfg_nwwn; +} + +mac_t +bfa_ioc_get_mfg_mac(struct bfa_ioc_s *ioc) +{ + mac_t mac; mac = ioc->attr->mfg_mac; mac.mac[MAC_ADDRLEN - 1] += bfa_ioc_pcifn(ioc); |