aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2010-03-05 22:37:57 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-03-07 02:37:00 -0500
commit0a4b1fc0b24fc7adbaf8413f2992ce1395991a78 (patch)
tree9a07aeee614e2e3f3191aee552effc467163fb33 /drivers/scsi/bfa
parentf58e9ebbf78bd36c6cf1ca651280d39efe73a7c0 (diff)
[SCSI] bfa: Replace bfa_get_attr() with specific APIs
bfa_ioc_attr_s is a big structure and some times could cause stack overflow if defined locally, so add specific APIs that are needed to replace the use of ioc_attr local var. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r--drivers/scsi/bfa/bfa_fcport.c33
-rw-r--r--drivers/scsi/bfa/bfa_fcs_lport.c26
-rw-r--r--drivers/scsi/bfa/bfa_ioc.c155
-rw-r--r--drivers/scsi/bfa/bfa_ioc.h10
-rw-r--r--drivers/scsi/bfa/bfa_lps.c6
-rw-r--r--drivers/scsi/bfa/bfad.c4
-rw-r--r--drivers/scsi/bfa/bfad_attr.c62
-rw-r--r--drivers/scsi/bfa/bfad_drv.h13
-rw-r--r--drivers/scsi/bfa/bfad_im.c29
-rw-r--r--drivers/scsi/bfa/fabric.c10
-rw-r--r--drivers/scsi/bfa/fcpim.c15
-rw-r--r--drivers/scsi/bfa/include/bfa.h20
-rw-r--r--drivers/scsi/bfa/include/cs/bfa_log.h2
-rw-r--r--drivers/scsi/bfa/rport.c7
-rw-r--r--drivers/scsi/bfa/vport.c18
15 files changed, 195 insertions, 215 deletions
diff --git a/drivers/scsi/bfa/bfa_fcport.c b/drivers/scsi/bfa/bfa_fcport.c
index a48413c230a5..0da612010787 100644
--- a/drivers/scsi/bfa/bfa_fcport.c
+++ b/drivers/scsi/bfa/bfa_fcport.c
@@ -145,35 +145,12 @@ bfa_fcport_aen_post(struct bfa_fcport_s *fcport, enum bfa_port_aen_event event)
145 struct bfa_log_mod_s *logmod = fcport->bfa->logm; 145 struct bfa_log_mod_s *logmod = fcport->bfa->logm;
146 wwn_t pwwn = fcport->pwwn; 146 wwn_t pwwn = fcport->pwwn;
147 char pwwn_ptr[BFA_STRING_32]; 147 char pwwn_ptr[BFA_STRING_32];
148 struct bfa_ioc_attr_s ioc_attr;
149 148
150 memset(&aen_data, 0, sizeof(aen_data)); 149 memset(&aen_data, 0, sizeof(aen_data));
151 wwn2str(pwwn_ptr, pwwn); 150 wwn2str(pwwn_ptr, pwwn);
152 switch (event) { 151 bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_PORT, event), pwwn_ptr);
153 case BFA_PORT_AEN_ONLINE:
154 bfa_log(logmod, BFA_AEN_PORT_ONLINE, pwwn_ptr);
155 break;
156 case BFA_PORT_AEN_OFFLINE:
157 bfa_log(logmod, BFA_AEN_PORT_OFFLINE, pwwn_ptr);
158 break;
159 case BFA_PORT_AEN_ENABLE:
160 bfa_log(logmod, BFA_AEN_PORT_ENABLE, pwwn_ptr);
161 break;
162 case BFA_PORT_AEN_DISABLE:
163 bfa_log(logmod, BFA_AEN_PORT_DISABLE, pwwn_ptr);
164 break;
165 case BFA_PORT_AEN_DISCONNECT:
166 bfa_log(logmod, BFA_AEN_PORT_DISCONNECT, pwwn_ptr);
167 break;
168 case BFA_PORT_AEN_QOS_NEG:
169 bfa_log(logmod, BFA_AEN_PORT_QOS_NEG, pwwn_ptr);
170 break;
171 default:
172 break;
173 }
174 152
175 bfa_ioc_get_attr(&fcport->bfa->ioc, &ioc_attr); 153 aen_data.port.ioc_type = bfa_get_type(fcport->bfa);
176 aen_data.port.ioc_type = ioc_attr.ioc_type;
177 aen_data.port.pwwn = pwwn; 154 aen_data.port.pwwn = pwwn;
178} 155}
179 156
@@ -2043,11 +2020,15 @@ void
2043bfa_fcport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off) 2020bfa_fcport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off)
2044{ 2021{
2045 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 2022 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
2023 enum bfa_ioc_type_e ioc_type = bfa_get_type(bfa);
2046 2024
2047 bfa_trc(bfa, on_off); 2025 bfa_trc(bfa, on_off);
2048 bfa_trc(bfa, fcport->cfg.qos_enabled); 2026 bfa_trc(bfa, fcport->cfg.qos_enabled);
2049 2027
2050 fcport->cfg.qos_enabled = on_off; 2028 bfa_trc(bfa, ioc_type);
2029
2030 if (ioc_type == BFA_IOC_TYPE_FC)
2031 fcport->cfg.qos_enabled = on_off;
2051} 2032}
2052 2033
2053void 2034void
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index 4a51aac7ab04..7c1251c682d8 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -263,30 +263,8 @@ bfa_fcs_port_aen_post(struct bfa_fcs_port_s *port,
263 263
264 bfa_assert(role <= BFA_PORT_ROLE_FCP_MAX); 264 bfa_assert(role <= BFA_PORT_ROLE_FCP_MAX);
265 265
266 switch (event) { 266 bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_LPORT, event), lpwwn_ptr,
267 case BFA_LPORT_AEN_ONLINE: 267 role_str[role/2]);
268 bfa_log(logmod, BFA_AEN_LPORT_ONLINE, lpwwn_ptr,
269 role_str[role / 2]);
270 break;
271 case BFA_LPORT_AEN_OFFLINE:
272 bfa_log(logmod, BFA_AEN_LPORT_OFFLINE, lpwwn_ptr,
273 role_str[role / 2]);
274 break;
275 case BFA_LPORT_AEN_NEW:
276 bfa_log(logmod, BFA_AEN_LPORT_NEW, lpwwn_ptr,
277 role_str[role / 2]);
278 break;
279 case BFA_LPORT_AEN_DELETE:
280 bfa_log(logmod, BFA_AEN_LPORT_DELETE, lpwwn_ptr,
281 role_str[role / 2]);
282 break;
283 case BFA_LPORT_AEN_DISCONNECT:
284 bfa_log(logmod, BFA_AEN_LPORT_DISCONNECT, lpwwn_ptr,
285 role_str[role / 2]);
286 break;
287 default:
288 break;
289 }
290 268
291 aen_data.lport.vf_id = port->fabric->vf_id; 269 aen_data.lport.vf_id = port->fabric->vf_id;
292 aen_data.lport.roles = role; 270 aen_data.lport.roles = role;
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index 4d9a47ccffe9..e038bc9769f6 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -1679,46 +1679,28 @@ bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc,
1679 struct bfa_adapter_attr_s *ad_attr) 1679 struct bfa_adapter_attr_s *ad_attr)
1680{ 1680{
1681 struct bfi_ioc_attr_s *ioc_attr; 1681 struct bfi_ioc_attr_s *ioc_attr;
1682 char model[BFA_ADAPTER_MODEL_NAME_LEN];
1683 1682
1684 ioc_attr = ioc->attr; 1683 ioc_attr = ioc->attr;
1685 bfa_os_memcpy((void *)&ad_attr->serial_num, 1684
1686 (void *)ioc_attr->brcd_serialnum, 1685 bfa_ioc_get_adapter_serial_num(ioc, ad_attr->serial_num);
1687 BFA_ADAPTER_SERIAL_NUM_LEN); 1686 bfa_ioc_get_adapter_fw_ver(ioc, ad_attr->fw_ver);
1688 1687 bfa_ioc_get_adapter_optrom_ver(ioc, ad_attr->optrom_ver);
1689 bfa_os_memcpy(&ad_attr->fw_ver, ioc_attr->fw_version, BFA_VERSION_LEN); 1688 bfa_ioc_get_adapter_manufacturer(ioc, ad_attr->manufacturer);
1690 bfa_os_memcpy(&ad_attr->optrom_ver, ioc_attr->optrom_version,
1691 BFA_VERSION_LEN);
1692 bfa_os_memcpy(&ad_attr->manufacturer, BFA_MFG_NAME,
1693 BFA_ADAPTER_MFG_NAME_LEN);
1694 bfa_os_memcpy(&ad_attr->vpd, &ioc_attr->vpd, 1689 bfa_os_memcpy(&ad_attr->vpd, &ioc_attr->vpd,
1695 sizeof(struct bfa_mfg_vpd_s)); 1690 sizeof(struct bfa_mfg_vpd_s));
1696 1691
1697 ad_attr->nports = BFI_ADAPTER_GETP(NPORTS, ioc_attr->adapter_prop); 1692 ad_attr->nports = bfa_ioc_get_nports(ioc);
1698 ad_attr->max_speed = BFI_ADAPTER_GETP(SPEED, ioc_attr->adapter_prop); 1693 ad_attr->max_speed = bfa_ioc_speed_sup(ioc);
1699 1694
1700 /** 1695 bfa_ioc_get_adapter_model(ioc, ad_attr->model);
1701 * model name 1696 /* For now, model descr uses same model string */
1702 */ 1697 bfa_ioc_get_adapter_model(ioc, ad_attr->model_descr);
1703 if (BFI_ADAPTER_GETP(SPEED, ioc_attr->adapter_prop) == 10) {
1704 strcpy(model, "BR-10?0");
1705 model[5] = '0' + ad_attr->nports;
1706 } else {
1707 strcpy(model, "Brocade-??5");
1708 model[8] =
1709 '0' + BFI_ADAPTER_GETP(SPEED, ioc_attr->adapter_prop);
1710 model[9] = '0' + ad_attr->nports;
1711 }
1712 1698
1713 if (BFI_ADAPTER_IS_SPECIAL(ioc_attr->adapter_prop)) 1699 if (BFI_ADAPTER_IS_SPECIAL(ioc_attr->adapter_prop))
1714 ad_attr->prototype = 1; 1700 ad_attr->prototype = 1;
1715 else 1701 else
1716 ad_attr->prototype = 0; 1702 ad_attr->prototype = 0;
1717 1703
1718 bfa_os_memcpy(&ad_attr->model, model, BFA_ADAPTER_MODEL_NAME_LEN);
1719 bfa_os_memcpy(&ad_attr->model_descr, &ad_attr->model,
1720 BFA_ADAPTER_MODEL_NAME_LEN);
1721
1722 ad_attr->pwwn = bfa_ioc_get_pwwn(ioc); 1704 ad_attr->pwwn = bfa_ioc_get_pwwn(ioc);
1723 ad_attr->mac = bfa_ioc_get_mac(ioc); 1705 ad_attr->mac = bfa_ioc_get_mac(ioc);
1724 1706
@@ -1726,12 +1708,8 @@ bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc,
1726 ad_attr->pcie_lanes = ioc_attr->pcie_lanes; 1708 ad_attr->pcie_lanes = ioc_attr->pcie_lanes;
1727 ad_attr->pcie_lanes_orig = ioc_attr->pcie_lanes_orig; 1709 ad_attr->pcie_lanes_orig = ioc_attr->pcie_lanes_orig;
1728 ad_attr->asic_rev = ioc_attr->asic_rev; 1710 ad_attr->asic_rev = ioc_attr->asic_rev;
1729 ad_attr->hw_ver[0] = 'R'; 1711
1730 ad_attr->hw_ver[1] = 'e'; 1712 bfa_ioc_get_pci_chip_rev(ioc, ad_attr->hw_ver);
1731 ad_attr->hw_ver[2] = 'v';
1732 ad_attr->hw_ver[3] = '-';
1733 ad_attr->hw_ver[4] = ioc_attr->asic_rev;
1734 ad_attr->hw_ver[5] = '\0';
1735 1713
1736 ad_attr->cna_capable = ioc->cna; 1714 ad_attr->cna_capable = ioc->cna;
1737} 1715}
@@ -1752,11 +1730,91 @@ bfa_ioc_get_type(struct bfa_ioc_s *ioc)
1752} 1730}
1753 1731
1754void 1732void
1733bfa_ioc_get_adapter_serial_num(struct bfa_ioc_s *ioc, char *serial_num)
1734{
1735 bfa_os_memset((void *)serial_num, 0, BFA_ADAPTER_SERIAL_NUM_LEN);
1736 bfa_os_memcpy((void *)serial_num,
1737 (void *)ioc->attr->brcd_serialnum,
1738 BFA_ADAPTER_SERIAL_NUM_LEN);
1739}
1740
1741void
1742bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver)
1743{
1744 bfa_os_memset((void *)fw_ver, 0, BFA_VERSION_LEN);
1745 bfa_os_memcpy(fw_ver, ioc->attr->fw_version, BFA_VERSION_LEN);
1746}
1747
1748void
1749bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev)
1750{
1751 bfa_assert(chip_rev);
1752
1753 bfa_os_memset((void *)chip_rev, 0, BFA_IOC_CHIP_REV_LEN);
1754
1755 chip_rev[0] = 'R';
1756 chip_rev[1] = 'e';
1757 chip_rev[2] = 'v';
1758 chip_rev[3] = '-';
1759 chip_rev[4] = ioc->attr->asic_rev;
1760 chip_rev[5] = '\0';
1761}
1762
1763void
1764bfa_ioc_get_adapter_optrom_ver(struct bfa_ioc_s *ioc, char *optrom_ver)
1765{
1766 bfa_os_memset((void *)optrom_ver, 0, BFA_VERSION_LEN);
1767 bfa_os_memcpy(optrom_ver, ioc->attr->optrom_version,
1768 BFA_VERSION_LEN);
1769}
1770
1771void
1772bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc, char *manufacturer)
1773{
1774 bfa_os_memset((void *)manufacturer, 0, BFA_ADAPTER_MFG_NAME_LEN);
1775 bfa_os_memcpy(manufacturer, BFA_MFG_NAME, BFA_ADAPTER_MFG_NAME_LEN);
1776}
1777
1778void
1779bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model)
1780{
1781 struct bfi_ioc_attr_s *ioc_attr;
1782 u8 nports;
1783 u8 max_speed;
1784
1785 bfa_assert(model);
1786 bfa_os_memset((void *)model, 0, BFA_ADAPTER_MODEL_NAME_LEN);
1787
1788 ioc_attr = ioc->attr;
1789
1790 nports = bfa_ioc_get_nports(ioc);
1791 max_speed = bfa_ioc_speed_sup(ioc);
1792
1793 /**
1794 * model name
1795 */
1796 if (max_speed == 10) {
1797 strcpy(model, "BR-10?0");
1798 model[5] = '0' + nports;
1799 } else {
1800 strcpy(model, "Brocade-??5");
1801 model[8] = '0' + max_speed;
1802 model[9] = '0' + nports;
1803 }
1804}
1805
1806enum bfa_ioc_state
1807bfa_ioc_get_state(struct bfa_ioc_s *ioc)
1808{
1809 return bfa_sm_to_state(ioc_sm_table, ioc->fsm);
1810}
1811
1812void
1755bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr) 1813bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr)
1756{ 1814{
1757 bfa_os_memset((void *)ioc_attr, 0, sizeof(struct bfa_ioc_attr_s)); 1815 bfa_os_memset((void *)ioc_attr, 0, sizeof(struct bfa_ioc_attr_s));
1758 1816
1759 ioc_attr->state = bfa_sm_to_state(ioc_sm_table, ioc->fsm); 1817 ioc_attr->state = bfa_ioc_get_state(ioc);
1760 ioc_attr->port_id = ioc->port_id; 1818 ioc_attr->port_id = ioc->port_id;
1761 1819
1762 ioc_attr->ioc_type = bfa_ioc_get_type(ioc); 1820 ioc_attr->ioc_type = bfa_ioc_get_type(ioc);
@@ -1765,12 +1823,7 @@ bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr)
1765 1823
1766 ioc_attr->pci_attr.device_id = ioc->pcidev.device_id; 1824 ioc_attr->pci_attr.device_id = ioc->pcidev.device_id;
1767 ioc_attr->pci_attr.pcifn = ioc->pcidev.pci_func; 1825 ioc_attr->pci_attr.pcifn = ioc->pcidev.pci_func;
1768 ioc_attr->pci_attr.chip_rev[0] = 'R'; 1826 bfa_ioc_get_pci_chip_rev(ioc, ioc_attr->pci_attr.chip_rev);
1769 ioc_attr->pci_attr.chip_rev[1] = 'e';
1770 ioc_attr->pci_attr.chip_rev[2] = 'v';
1771 ioc_attr->pci_attr.chip_rev[3] = '-';
1772 ioc_attr->pci_attr.chip_rev[4] = ioc_attr->adapter_attr.asic_rev;
1773 ioc_attr->pci_attr.chip_rev[5] = '\0';
1774} 1827}
1775 1828
1776/** 1829/**
@@ -1877,25 +1930,7 @@ bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event)
1877 s32 inst_num = 0; 1930 s32 inst_num = 0;
1878 enum bfa_ioc_type_e ioc_type; 1931 enum bfa_ioc_type_e ioc_type;
1879 1932
1880 switch (event) { 1933 bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, event), inst_num);
1881 case BFA_IOC_AEN_HBGOOD:
1882 bfa_log(logmod, BFA_AEN_IOC_HBGOOD, inst_num);
1883 break;
1884 case BFA_IOC_AEN_HBFAIL:
1885 bfa_log(logmod, BFA_AEN_IOC_HBFAIL, inst_num);
1886 break;
1887 case BFA_IOC_AEN_ENABLE:
1888 bfa_log(logmod, BFA_AEN_IOC_ENABLE, inst_num);
1889 break;
1890 case BFA_IOC_AEN_DISABLE:
1891 bfa_log(logmod, BFA_AEN_IOC_DISABLE, inst_num);
1892 break;
1893 case BFA_IOC_AEN_FWMISMATCH:
1894 bfa_log(logmod, BFA_AEN_IOC_FWMISMATCH, inst_num);
1895 break;
1896 default:
1897 break;
1898 }
1899 1934
1900 memset(&aen_data.ioc.pwwn, 0, sizeof(aen_data.ioc.pwwn)); 1935 memset(&aen_data.ioc.pwwn, 0, sizeof(aen_data.ioc.pwwn));
1901 memset(&aen_data.ioc.mac, 0, sizeof(aen_data.ioc.mac)); 1936 memset(&aen_data.ioc.mac, 0, sizeof(aen_data.ioc.mac));
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
index 4b73efad1ee5..d0804406ea1a 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
@@ -263,6 +263,16 @@ bfa_boolean_t bfa_ioc_is_disabled(struct bfa_ioc_s *ioc);
263bfa_boolean_t bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc); 263bfa_boolean_t bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc);
264bfa_boolean_t bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc); 264bfa_boolean_t bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc);
265void bfa_ioc_cfg_complete(struct bfa_ioc_s *ioc); 265void bfa_ioc_cfg_complete(struct bfa_ioc_s *ioc);
266enum bfa_ioc_type_e bfa_ioc_get_type(struct bfa_ioc_s *ioc);
267void bfa_ioc_get_adapter_serial_num(struct bfa_ioc_s *ioc, char *serial_num);
268void bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver);
269void bfa_ioc_get_adapter_optrom_ver(struct bfa_ioc_s *ioc, char *optrom_ver);
270void bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model);
271void bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc,
272 char *manufacturer);
273void bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev);
274enum bfa_ioc_state bfa_ioc_get_state(struct bfa_ioc_s *ioc);
275
266void bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr); 276void bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr);
267void bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, 277void bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc,
268 struct bfa_adapter_attr_s *ad_attr); 278 struct bfa_adapter_attr_s *ad_attr);
diff --git a/drivers/scsi/bfa/bfa_lps.c b/drivers/scsi/bfa/bfa_lps.c
index d2d48a619c30..ad06f6189092 100644
--- a/drivers/scsi/bfa/bfa_lps.c
+++ b/drivers/scsi/bfa/bfa_lps.c
@@ -631,11 +631,7 @@ bfa_lps_cvl_event(struct bfa_lps_s *lps)
631u32 631u32
632bfa_lps_get_max_vport(struct bfa_s *bfa) 632bfa_lps_get_max_vport(struct bfa_s *bfa)
633{ 633{
634 struct bfa_ioc_attr_s ioc_attr; 634 if (bfa_ioc_devid(&bfa->ioc) == BFA_PCI_DEVICE_ID_CT)
635
636 bfa_get_attr(bfa, &ioc_attr);
637
638 if (ioc_attr.pci_attr.device_id == BFA_PCI_DEVICE_ID_CT)
639 return BFA_LPS_MAX_VPORTS_SUPP_CT; 635 return BFA_LPS_MAX_VPORTS_SUPP_CT;
640 else 636 else
641 return BFA_LPS_MAX_VPORTS_SUPP_CB; 637 return BFA_LPS_MAX_VPORTS_SUPP_CB;
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index a8a529d5fea4..6bff08ea4029 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -978,7 +978,6 @@ bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
978{ 978{
979 struct bfad_s *bfad; 979 struct bfad_s *bfad;
980 int error = -ENODEV, retval; 980 int error = -ENODEV, retval;
981 char buf[16];
982 981
983 /* 982 /*
984 * For single port cards - only claim function 0 983 * For single port cards - only claim function 0
@@ -1009,8 +1008,7 @@ bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
1009 bfa_trc(bfad, bfad_inst); 1008 bfa_trc(bfad, bfad_inst);
1010 1009
1011 bfad->logmod = &bfad->log_data; 1010 bfad->logmod = &bfad->log_data;
1012 sprintf(buf, "%d", bfad_inst); 1011 bfa_log_init(bfad->logmod, (char *)pci_name(pdev), bfa_os_printf);
1013 bfa_log_init(bfad->logmod, buf, bfa_os_printf);
1014 1012
1015 bfad_drv_log_level_set(bfad); 1013 bfad_drv_log_level_set(bfad);
1016 1014
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c
index a691133c31a2..dd5cb20d4b37 100644
--- a/drivers/scsi/bfa/bfad_attr.c
+++ b/drivers/scsi/bfa/bfad_attr.c
@@ -424,12 +424,10 @@ bfad_im_serial_num_show(struct device *dev, struct device_attribute *attr,
424 struct bfad_im_port_s *im_port = 424 struct bfad_im_port_s *im_port =
425 (struct bfad_im_port_s *) shost->hostdata[0]; 425 (struct bfad_im_port_s *) shost->hostdata[0];
426 struct bfad_s *bfad = im_port->bfad; 426 struct bfad_s *bfad = im_port->bfad;
427 struct bfa_ioc_attr_s ioc_attr; 427 char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN];
428 428
429 memset(&ioc_attr, 0, sizeof(ioc_attr)); 429 bfa_get_adapter_serial_num(&bfad->bfa, serial_num);
430 bfa_get_attr(&bfad->bfa, &ioc_attr); 430 return snprintf(buf, PAGE_SIZE, "%s\n", serial_num);
431 return snprintf(buf, PAGE_SIZE, "%s\n",
432 ioc_attr.adapter_attr.serial_num);
433} 431}
434 432
435static ssize_t 433static ssize_t
@@ -440,11 +438,10 @@ bfad_im_model_show(struct device *dev, struct device_attribute *attr,
440 struct bfad_im_port_s *im_port = 438 struct bfad_im_port_s *im_port =
441 (struct bfad_im_port_s *) shost->hostdata[0]; 439 (struct bfad_im_port_s *) shost->hostdata[0];
442 struct bfad_s *bfad = im_port->bfad; 440 struct bfad_s *bfad = im_port->bfad;
443 struct bfa_ioc_attr_s ioc_attr; 441 char model[BFA_ADAPTER_MODEL_NAME_LEN];
444 442
445 memset(&ioc_attr, 0, sizeof(ioc_attr)); 443 bfa_get_adapter_model(&bfad->bfa, model);
446 bfa_get_attr(&bfad->bfa, &ioc_attr); 444 return snprintf(buf, PAGE_SIZE, "%s\n", model);
447 return snprintf(buf, PAGE_SIZE, "%s\n", ioc_attr.adapter_attr.model);
448} 445}
449 446
450static ssize_t 447static ssize_t
@@ -455,12 +452,10 @@ bfad_im_model_desc_show(struct device *dev, struct device_attribute *attr,
455 struct bfad_im_port_s *im_port = 452 struct bfad_im_port_s *im_port =
456 (struct bfad_im_port_s *) shost->hostdata[0]; 453 (struct bfad_im_port_s *) shost->hostdata[0];
457 struct bfad_s *bfad = im_port->bfad; 454 struct bfad_s *bfad = im_port->bfad;
458 struct bfa_ioc_attr_s ioc_attr; 455 char model_descr[BFA_ADAPTER_MODEL_DESCR_LEN];
459 456
460 memset(&ioc_attr, 0, sizeof(ioc_attr)); 457 bfa_get_adapter_model(&bfad->bfa, model_descr);
461 bfa_get_attr(&bfad->bfa, &ioc_attr); 458 return snprintf(buf, PAGE_SIZE, "%s\n", model_descr);
462 return snprintf(buf, PAGE_SIZE, "%s\n",
463 ioc_attr.adapter_attr.model_descr);
464} 459}
465 460
466static ssize_t 461static ssize_t
@@ -485,14 +480,13 @@ bfad_im_symbolic_name_show(struct device *dev, struct device_attribute *attr,
485 struct bfad_im_port_s *im_port = 480 struct bfad_im_port_s *im_port =
486 (struct bfad_im_port_s *) shost->hostdata[0]; 481 (struct bfad_im_port_s *) shost->hostdata[0];
487 struct bfad_s *bfad = im_port->bfad; 482 struct bfad_s *bfad = im_port->bfad;
488 struct bfa_ioc_attr_s ioc_attr; 483 char model[BFA_ADAPTER_MODEL_NAME_LEN];
489 484 char fw_ver[BFA_VERSION_LEN];
490 memset(&ioc_attr, 0, sizeof(ioc_attr));
491 bfa_get_attr(&bfad->bfa, &ioc_attr);
492 485
486 bfa_get_adapter_model(&bfad->bfa, model);
487 bfa_get_adapter_fw_ver(&bfad->bfa, fw_ver);
493 return snprintf(buf, PAGE_SIZE, "Brocade %s FV%s DV%s\n", 488 return snprintf(buf, PAGE_SIZE, "Brocade %s FV%s DV%s\n",
494 ioc_attr.adapter_attr.model, 489 model, fw_ver, BFAD_DRIVER_VERSION);
495 ioc_attr.adapter_attr.fw_ver, BFAD_DRIVER_VERSION);
496} 490}
497 491
498static ssize_t 492static ssize_t
@@ -503,11 +497,10 @@ bfad_im_hw_version_show(struct device *dev, struct device_attribute *attr,
503 struct bfad_im_port_s *im_port = 497 struct bfad_im_port_s *im_port =
504 (struct bfad_im_port_s *) shost->hostdata[0]; 498 (struct bfad_im_port_s *) shost->hostdata[0];
505 struct bfad_s *bfad = im_port->bfad; 499 struct bfad_s *bfad = im_port->bfad;
506 struct bfa_ioc_attr_s ioc_attr; 500 char hw_ver[BFA_VERSION_LEN];
507 501
508 memset(&ioc_attr, 0, sizeof(ioc_attr)); 502 bfa_get_pci_chip_rev(&bfad->bfa, hw_ver);
509 bfa_get_attr(&bfad->bfa, &ioc_attr); 503 return snprintf(buf, PAGE_SIZE, "%s\n", hw_ver);
510 return snprintf(buf, PAGE_SIZE, "%s\n", ioc_attr.adapter_attr.hw_ver);
511} 504}
512 505
513static ssize_t 506static ssize_t
@@ -525,12 +518,10 @@ bfad_im_optionrom_version_show(struct device *dev,
525 struct bfad_im_port_s *im_port = 518 struct bfad_im_port_s *im_port =
526 (struct bfad_im_port_s *) shost->hostdata[0]; 519 (struct bfad_im_port_s *) shost->hostdata[0];
527 struct bfad_s *bfad = im_port->bfad; 520 struct bfad_s *bfad = im_port->bfad;
528 struct bfa_ioc_attr_s ioc_attr; 521 char optrom_ver[BFA_VERSION_LEN];
529 522
530 memset(&ioc_attr, 0, sizeof(ioc_attr)); 523 bfa_get_adapter_optrom_ver(&bfad->bfa, optrom_ver);
531 bfa_get_attr(&bfad->bfa, &ioc_attr); 524 return snprintf(buf, PAGE_SIZE, "%s\n", optrom_ver);
532 return snprintf(buf, PAGE_SIZE, "%s\n",
533 ioc_attr.adapter_attr.optrom_ver);
534} 525}
535 526
536static ssize_t 527static ssize_t
@@ -541,11 +532,10 @@ bfad_im_fw_version_show(struct device *dev, struct device_attribute *attr,
541 struct bfad_im_port_s *im_port = 532 struct bfad_im_port_s *im_port =
542 (struct bfad_im_port_s *) shost->hostdata[0]; 533 (struct bfad_im_port_s *) shost->hostdata[0];
543 struct bfad_s *bfad = im_port->bfad; 534 struct bfad_s *bfad = im_port->bfad;
544 struct bfa_ioc_attr_s ioc_attr; 535 char fw_ver[BFA_VERSION_LEN];
545 536
546 memset(&ioc_attr, 0, sizeof(ioc_attr)); 537 bfa_get_adapter_fw_ver(&bfad->bfa, fw_ver);
547 bfa_get_attr(&bfad->bfa, &ioc_attr); 538 return snprintf(buf, PAGE_SIZE, "%s\n", fw_ver);
548 return snprintf(buf, PAGE_SIZE, "%s\n", ioc_attr.adapter_attr.fw_ver);
549} 539}
550 540
551static ssize_t 541static ssize_t
@@ -556,11 +546,9 @@ bfad_im_num_of_ports_show(struct device *dev, struct device_attribute *attr,
556 struct bfad_im_port_s *im_port = 546 struct bfad_im_port_s *im_port =
557 (struct bfad_im_port_s *) shost->hostdata[0]; 547 (struct bfad_im_port_s *) shost->hostdata[0];
558 struct bfad_s *bfad = im_port->bfad; 548 struct bfad_s *bfad = im_port->bfad;
559 struct bfa_ioc_attr_s ioc_attr;
560 549
561 memset(&ioc_attr, 0, sizeof(ioc_attr)); 550 return snprintf(buf, PAGE_SIZE, "%d\n",
562 bfa_get_attr(&bfad->bfa, &ioc_attr); 551 bfa_get_nports(&bfad->bfa));
563 return snprintf(buf, PAGE_SIZE, "%d\n", ioc_attr.adapter_attr.nports);
564} 552}
565 553
566static ssize_t 554static ssize_t
diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h
index 94f4d84c71c9..8617a1aa8b25 100644
--- a/drivers/scsi/bfa/bfad_drv.h
+++ b/drivers/scsi/bfa/bfad_drv.h
@@ -139,6 +139,18 @@ struct bfad_cfg_param_s {
139 u32 binding_method; 139 u32 binding_method;
140}; 140};
141 141
142union bfad_tmp_buf {
143 /* From struct bfa_adapter_attr_s */
144 char manufacturer[BFA_ADAPTER_MFG_NAME_LEN];
145 char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN];
146 char model[BFA_ADAPTER_MODEL_NAME_LEN];
147 char fw_ver[BFA_VERSION_LEN];
148 char optrom_ver[BFA_VERSION_LEN];
149
150 /* From struct bfa_ioc_pci_attr_s */
151 u8 chip_rev[BFA_IOC_CHIP_REV_LEN]; /* chip revision */
152};
153
142/* 154/*
143 * BFAD (PCI function) data structure 155 * BFAD (PCI function) data structure
144 */ 156 */
@@ -182,6 +194,7 @@ struct bfad_s {
182 struct bfa_plog_s plog_buf; 194 struct bfa_plog_s plog_buf;
183 int ref_count; 195 int ref_count;
184 bfa_boolean_t ipfc_enabled; 196 bfa_boolean_t ipfc_enabled;
197 union bfad_tmp_buf tmp_buf;
185 struct fc_host_statistics link_stats; 198 struct fc_host_statistics link_stats;
186 199
187 struct kobject *bfa_kobj; 200 struct kobject *bfa_kobj;
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index 23390b40b9c3..cee3d89d1412 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -167,17 +167,15 @@ bfad_im_info(struct Scsi_Host *shost)
167 static char bfa_buf[256]; 167 static char bfa_buf[256];
168 struct bfad_im_port_s *im_port = 168 struct bfad_im_port_s *im_port =
169 (struct bfad_im_port_s *) shost->hostdata[0]; 169 (struct bfad_im_port_s *) shost->hostdata[0];
170 struct bfa_ioc_attr_s ioc_attr;
171 struct bfad_s *bfad = im_port->bfad; 170 struct bfad_s *bfad = im_port->bfad;
171 char model[BFA_ADAPTER_MODEL_NAME_LEN];
172 172
173 memset(&ioc_attr, 0, sizeof(ioc_attr)); 173 bfa_get_adapter_model(&bfad->bfa, model);
174 bfa_get_attr(&bfad->bfa, &ioc_attr);
175 174
176 memset(bfa_buf, 0, sizeof(bfa_buf)); 175 memset(bfa_buf, 0, sizeof(bfa_buf));
177 snprintf(bfa_buf, sizeof(bfa_buf), 176 snprintf(bfa_buf, sizeof(bfa_buf),
178 "Brocade FC/FCOE Adapter, " "model: %s hwpath: %s driver: %s", 177 "Brocade FC/FCOE Adapter, " "model: %s hwpath: %s driver: %s",
179 ioc_attr.adapter_attr.model, bfad->pci_name, 178 model, bfad->pci_name, BFAD_DRIVER_VERSION);
180 BFAD_DRIVER_VERSION);
181 return bfa_buf; 179 return bfa_buf;
182} 180}
183 181
@@ -931,10 +929,9 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
931 struct Scsi_Host *host = im_port->shost; 929 struct Scsi_Host *host = im_port->shost;
932 struct bfad_s *bfad = im_port->bfad; 930 struct bfad_s *bfad = im_port->bfad;
933 struct bfad_port_s *port = im_port->port; 931 struct bfad_port_s *port = im_port->port;
934 union attr { 932 struct bfa_pport_attr_s pattr;
935 struct bfa_pport_attr_s pattr; 933 char model[BFA_ADAPTER_MODEL_NAME_LEN];
936 struct bfa_ioc_attr_s ioc_attr; 934 char fw_ver[BFA_VERSION_LEN];
937 } attr;
938 935
939 fc_host_node_name(host) = 936 fc_host_node_name(host) =
940 bfa_os_htonll((bfa_fcs_port_get_nwwn(port->fcs_port))); 937 bfa_os_htonll((bfa_fcs_port_get_nwwn(port->fcs_port)));
@@ -954,20 +951,18 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
954 /* For fibre channel services type 0x20 */ 951 /* For fibre channel services type 0x20 */
955 fc_host_supported_fc4s(host)[7] = 1; 952 fc_host_supported_fc4s(host)[7] = 1;
956 953
957 memset(&attr.ioc_attr, 0, sizeof(attr.ioc_attr)); 954 bfa_get_adapter_model(&bfad->bfa, model);
958 bfa_get_attr(&bfad->bfa, &attr.ioc_attr); 955 bfa_get_adapter_fw_ver(&bfad->bfa, fw_ver);
959 sprintf(fc_host_symbolic_name(host), "Brocade %s FV%s DV%s", 956 sprintf(fc_host_symbolic_name(host), "Brocade %s FV%s DV%s",
960 attr.ioc_attr.adapter_attr.model, 957 model, fw_ver, BFAD_DRIVER_VERSION);
961 attr.ioc_attr.adapter_attr.fw_ver, BFAD_DRIVER_VERSION);
962 958
963 fc_host_supported_speeds(host) = 0; 959 fc_host_supported_speeds(host) = 0;
964 fc_host_supported_speeds(host) |= 960 fc_host_supported_speeds(host) |=
965 FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT | 961 FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT |
966 FC_PORTSPEED_1GBIT; 962 FC_PORTSPEED_1GBIT;
967 963
968 memset(&attr.pattr, 0, sizeof(attr.pattr)); 964 bfa_fcport_get_attr(&bfad->bfa, &pattr);
969 bfa_fcport_get_attr(&bfad->bfa, &attr.pattr); 965 fc_host_maxframe_size(host) = pattr.pport_cfg.maxfrsize;
970 fc_host_maxframe_size(host) = attr.pattr.pport_cfg.maxfrsize;
971} 966}
972 967
973static void 968static void
diff --git a/drivers/scsi/bfa/fabric.c b/drivers/scsi/bfa/fabric.c
index e1a4b312e9d4..b4e05ad1b47e 100644
--- a/drivers/scsi/bfa/fabric.c
+++ b/drivers/scsi/bfa/fabric.c
@@ -1235,14 +1235,8 @@ bfa_fcs_fabric_aen_post(struct bfa_fcs_port_s *port,
1235 wwn2str(pwwn_ptr, pwwn); 1235 wwn2str(pwwn_ptr, pwwn);
1236 wwn2str(fwwn_ptr, fwwn); 1236 wwn2str(fwwn_ptr, fwwn);
1237 1237
1238 switch (event) { 1238 bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_PORT, event),
1239 case BFA_PORT_AEN_FABRIC_NAME_CHANGE: 1239 pwwn_ptr, fwwn_ptr);
1240 bfa_log(logmod, BFA_AEN_PORT_FABRIC_NAME_CHANGE, pwwn_ptr,
1241 fwwn_ptr);
1242 break;
1243 default:
1244 break;
1245 }
1246 1240
1247 aen_data.port.pwwn = pwwn; 1241 aen_data.port.pwwn = pwwn;
1248 aen_data.port.fwwn = fwwn; 1242 aen_data.port.fwwn = fwwn;
diff --git a/drivers/scsi/bfa/fcpim.c b/drivers/scsi/bfa/fcpim.c
index 71d23d19bc9d..ef50ec2a1950 100644
--- a/drivers/scsi/bfa/fcpim.c
+++ b/drivers/scsi/bfa/fcpim.c
@@ -385,19 +385,8 @@ bfa_fcs_itnim_aen_post(struct bfa_fcs_itnim_s *itnim,
385 wwn2str(lpwwn_ptr, lpwwn); 385 wwn2str(lpwwn_ptr, lpwwn);
386 wwn2str(rpwwn_ptr, rpwwn); 386 wwn2str(rpwwn_ptr, rpwwn);
387 387
388 switch (event) { 388 bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_ITNIM, event),
389 case BFA_ITNIM_AEN_ONLINE: 389 rpwwn_ptr, lpwwn_ptr);
390 bfa_log(logmod, BFA_AEN_ITNIM_ONLINE, rpwwn_ptr, lpwwn_ptr);
391 break;
392 case BFA_ITNIM_AEN_OFFLINE:
393 bfa_log(logmod, BFA_AEN_ITNIM_OFFLINE, rpwwn_ptr, lpwwn_ptr);
394 break;
395 case BFA_ITNIM_AEN_DISCONNECT:
396 bfa_log(logmod, BFA_AEN_ITNIM_DISCONNECT, rpwwn_ptr, lpwwn_ptr);
397 break;
398 default:
399 break;
400 }
401 390
402 aen_data.itnim.vf_id = rport->port->fabric->vf_id; 391 aen_data.itnim.vf_id = rport->port->fabric->vf_id;
403 aen_data.itnim.ppwwn = 392 aen_data.itnim.ppwwn =
diff --git a/drivers/scsi/bfa/include/bfa.h b/drivers/scsi/bfa/include/bfa.h
index 17654cae0c75..1f5966cfbd16 100644
--- a/drivers/scsi/bfa/include/bfa.h
+++ b/drivers/scsi/bfa/include/bfa.h
@@ -106,6 +106,26 @@ struct bfa_sge_s {
106 bfa_ioc_fetch_stats(&(__bfa)->ioc, __ioc_stats) 106 bfa_ioc_fetch_stats(&(__bfa)->ioc, __ioc_stats)
107#define bfa_ioc_clear_stats(__bfa) \ 107#define bfa_ioc_clear_stats(__bfa) \
108 bfa_ioc_clr_stats(&(__bfa)->ioc) 108 bfa_ioc_clr_stats(&(__bfa)->ioc)
109#define bfa_get_nports(__bfa) \
110 bfa_ioc_get_nports(&(__bfa)->ioc)
111#define bfa_get_adapter_manufacturer(__bfa, __manufacturer) \
112 bfa_ioc_get_adapter_manufacturer(&(__bfa)->ioc, __manufacturer)
113#define bfa_get_adapter_model(__bfa, __model) \
114 bfa_ioc_get_adapter_model(&(__bfa)->ioc, __model)
115#define bfa_get_adapter_serial_num(__bfa, __serial_num) \
116 bfa_ioc_get_adapter_serial_num(&(__bfa)->ioc, __serial_num)
117#define bfa_get_adapter_fw_ver(__bfa, __fw_ver) \
118 bfa_ioc_get_adapter_fw_ver(&(__bfa)->ioc, __fw_ver)
119#define bfa_get_adapter_optrom_ver(__bfa, __optrom_ver) \
120 bfa_ioc_get_adapter_optrom_ver(&(__bfa)->ioc, __optrom_ver)
121#define bfa_get_pci_chip_rev(__bfa, __chip_rev) \
122 bfa_ioc_get_pci_chip_rev(&(__bfa)->ioc, __chip_rev)
123#define bfa_get_ioc_state(__bfa) \
124 bfa_ioc_get_state(&(__bfa)->ioc)
125#define bfa_get_type(__bfa) \
126 bfa_ioc_get_type(&(__bfa)->ioc)
127#define bfa_get_mac(__bfa) \
128 bfa_ioc_get_mac(&(__bfa)->ioc)
109 129
110/* 130/*
111 * bfa API functions 131 * bfa API functions
diff --git a/drivers/scsi/bfa/include/cs/bfa_log.h b/drivers/scsi/bfa/include/cs/bfa_log.h
index 761cbe22130a..bc334e0a93fa 100644
--- a/drivers/scsi/bfa/include/cs/bfa_log.h
+++ b/drivers/scsi/bfa/include/cs/bfa_log.h
@@ -157,7 +157,7 @@ typedef void (*bfa_log_cb_t)(struct bfa_log_mod_s *log_mod, u32 msg_id,
157 157
158 158
159struct bfa_log_mod_s { 159struct bfa_log_mod_s {
160 char instance_info[16]; /* instance info */ 160 char instance_info[BFA_STRING_32]; /* instance info */
161 int log_level[BFA_LOG_MODULE_ID_MAX + 1]; 161 int log_level[BFA_LOG_MODULE_ID_MAX + 1];
162 /* log level for modules */ 162 /* log level for modules */
163 bfa_log_cb_t cbfn; /* callback function */ 163 bfa_log_cb_t cbfn; /* callback function */
diff --git a/drivers/scsi/bfa/rport.c b/drivers/scsi/bfa/rport.c
index 8c5969c86934..8e73dd9a625a 100644
--- a/drivers/scsi/bfa/rport.c
+++ b/drivers/scsi/bfa/rport.c
@@ -2039,13 +2039,10 @@ bfa_fcs_rport_aen_post(struct bfa_fcs_rport_s *rport,
2039 2039
2040 switch (event) { 2040 switch (event) {
2041 case BFA_RPORT_AEN_ONLINE: 2041 case BFA_RPORT_AEN_ONLINE:
2042 bfa_log(logmod, BFA_AEN_RPORT_ONLINE, rpwwn_ptr, lpwwn_ptr);
2043 break;
2044 case BFA_RPORT_AEN_OFFLINE: 2042 case BFA_RPORT_AEN_OFFLINE:
2045 bfa_log(logmod, BFA_AEN_RPORT_OFFLINE, rpwwn_ptr, lpwwn_ptr);
2046 break;
2047 case BFA_RPORT_AEN_DISCONNECT: 2043 case BFA_RPORT_AEN_DISCONNECT:
2048 bfa_log(logmod, BFA_AEN_RPORT_DISCONNECT, rpwwn_ptr, lpwwn_ptr); 2044 bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_RPORT, event),
2045 rpwwn_ptr, lpwwn_ptr);
2049 break; 2046 break;
2050 case BFA_RPORT_AEN_QOS_PRIO: 2047 case BFA_RPORT_AEN_QOS_PRIO:
2051 aen_data.rport.priv.qos = data->priv.qos; 2048 aen_data.rport.priv.qos = data->priv.qos;
diff --git a/drivers/scsi/bfa/vport.c b/drivers/scsi/bfa/vport.c
index c5e534eb1620..27cd619a227a 100644
--- a/drivers/scsi/bfa/vport.c
+++ b/drivers/scsi/bfa/vport.c
@@ -447,22 +447,8 @@ bfa_fcs_vport_aen_post(bfa_fcs_lport_t *port, enum bfa_lport_aen_event event)
447 447
448 bfa_assert(role <= BFA_PORT_ROLE_FCP_MAX); 448 bfa_assert(role <= BFA_PORT_ROLE_FCP_MAX);
449 449
450 switch (event) { 450 bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_LPORT, event), lpwwn_ptr,
451 case BFA_LPORT_AEN_NPIV_DUP_WWN: 451 role_str[role/2]);
452 bfa_log(logmod, BFA_AEN_LPORT_NPIV_DUP_WWN, lpwwn_ptr,
453 role_str[role / 2]);
454 break;
455 case BFA_LPORT_AEN_NPIV_FABRIC_MAX:
456 bfa_log(logmod, BFA_AEN_LPORT_NPIV_FABRIC_MAX, lpwwn_ptr,
457 role_str[role / 2]);
458 break;
459 case BFA_LPORT_AEN_NPIV_UNKNOWN:
460 bfa_log(logmod, BFA_AEN_LPORT_NPIV_UNKNOWN, lpwwn_ptr,
461 role_str[role / 2]);
462 break;
463 default:
464 break;
465 }
466 452
467 aen_data.lport.vf_id = port->fabric->vf_id; 453 aen_data.lport.vf_id = port->fabric->vf_id;
468 aen_data.lport.roles = role; 454 aen_data.lport.roles = role;