diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2010-03-05 22:36:47 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-03-07 02:31:23 -0500 |
commit | 2993cc71d1bff61999ade7f2b6b3ea2dd1e2c8d9 (patch) | |
tree | d4efc1c68195a0cbf4d30abcc891a78b76439755 /drivers/scsi/bfa/bfa_ioc.c | |
parent | 9693e7dff5c2911b4e445f5f656ef57b3a5bffac (diff) |
[SCSI] bfa: AEN and byte alignment fixes.
Replace enum types with int and rearrange the fields to fix some
alignment issue.
Local var ioc_attr is causing the stack to overflow, so removed the
usage of the local ioc_attr var and now invoking an API to return the
ioc_type.
Fix some AEN issues.
Signed-off-by: Krishna Gudipati <kgudipat@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 | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 0019ff7359db..2f09d17730cc 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c | |||
@@ -1731,6 +1731,21 @@ bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, | |||
1731 | ad_attr->cna_capable = ioc->cna; | 1731 | ad_attr->cna_capable = ioc->cna; |
1732 | } | 1732 | } |
1733 | 1733 | ||
1734 | enum bfa_ioc_type_e | ||
1735 | bfa_ioc_get_type(struct bfa_ioc_s *ioc) | ||
1736 | { | ||
1737 | if (!ioc->ctdev || ioc->fcmode) | ||
1738 | return BFA_IOC_TYPE_FC; | ||
1739 | else if (ioc->ioc_mc == BFI_MC_IOCFC) | ||
1740 | return BFA_IOC_TYPE_FCoE; | ||
1741 | else if (ioc->ioc_mc == BFI_MC_LL) | ||
1742 | return BFA_IOC_TYPE_LL; | ||
1743 | else { | ||
1744 | bfa_assert(ioc->ioc_mc == BFI_MC_LL); | ||
1745 | return BFA_IOC_TYPE_LL; | ||
1746 | } | ||
1747 | } | ||
1748 | |||
1734 | void | 1749 | void |
1735 | bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr) | 1750 | bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr) |
1736 | { | 1751 | { |
@@ -1739,12 +1754,7 @@ bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr) | |||
1739 | ioc_attr->state = bfa_sm_to_state(ioc_sm_table, ioc->fsm); | 1754 | ioc_attr->state = bfa_sm_to_state(ioc_sm_table, ioc->fsm); |
1740 | ioc_attr->port_id = ioc->port_id; | 1755 | ioc_attr->port_id = ioc->port_id; |
1741 | 1756 | ||
1742 | if (!ioc->ctdev || ioc->fcmode) | 1757 | ioc_attr->ioc_type = bfa_ioc_get_type(ioc); |
1743 | ioc_attr->ioc_type = BFA_IOC_TYPE_FC; | ||
1744 | else if (ioc->ioc_mc == BFI_MC_IOCFC) | ||
1745 | ioc_attr->ioc_type = BFA_IOC_TYPE_FCoE; | ||
1746 | else if (ioc->ioc_mc == BFI_MC_LL) | ||
1747 | ioc_attr->ioc_type = BFA_IOC_TYPE_LL; | ||
1748 | 1758 | ||
1749 | bfa_ioc_get_adapter_attr(ioc, &ioc_attr->adapter_attr); | 1759 | bfa_ioc_get_adapter_attr(ioc, &ioc_attr->adapter_attr); |
1750 | 1760 | ||
@@ -1860,7 +1870,7 @@ bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event) | |||
1860 | union bfa_aen_data_u aen_data; | 1870 | union bfa_aen_data_u aen_data; |
1861 | struct bfa_log_mod_s *logmod = ioc->logm; | 1871 | struct bfa_log_mod_s *logmod = ioc->logm; |
1862 | s32 inst_num = 0; | 1872 | s32 inst_num = 0; |
1863 | struct bfa_ioc_attr_s ioc_attr; | 1873 | enum bfa_ioc_type_e ioc_type; |
1864 | 1874 | ||
1865 | switch (event) { | 1875 | switch (event) { |
1866 | case BFA_IOC_AEN_HBGOOD: | 1876 | case BFA_IOC_AEN_HBGOOD: |
@@ -1884,8 +1894,8 @@ bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event) | |||
1884 | 1894 | ||
1885 | memset(&aen_data.ioc.pwwn, 0, sizeof(aen_data.ioc.pwwn)); | 1895 | memset(&aen_data.ioc.pwwn, 0, sizeof(aen_data.ioc.pwwn)); |
1886 | memset(&aen_data.ioc.mac, 0, sizeof(aen_data.ioc.mac)); | 1896 | memset(&aen_data.ioc.mac, 0, sizeof(aen_data.ioc.mac)); |
1887 | bfa_ioc_get_attr(ioc, &ioc_attr); | 1897 | ioc_type = bfa_ioc_get_type(ioc); |
1888 | switch (ioc_attr.ioc_type) { | 1898 | switch (ioc_type) { |
1889 | case BFA_IOC_TYPE_FC: | 1899 | case BFA_IOC_TYPE_FC: |
1890 | aen_data.ioc.pwwn = bfa_ioc_get_pwwn(ioc); | 1900 | aen_data.ioc.pwwn = bfa_ioc_get_pwwn(ioc); |
1891 | break; | 1901 | break; |
@@ -1897,10 +1907,10 @@ bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event) | |||
1897 | aen_data.ioc.mac = bfa_ioc_get_mac(ioc); | 1907 | aen_data.ioc.mac = bfa_ioc_get_mac(ioc); |
1898 | break; | 1908 | break; |
1899 | default: | 1909 | default: |
1900 | bfa_assert(ioc_attr.ioc_type == BFA_IOC_TYPE_FC); | 1910 | bfa_assert(ioc_type == BFA_IOC_TYPE_FC); |
1901 | break; | 1911 | break; |
1902 | } | 1912 | } |
1903 | aen_data.ioc.ioc_type = ioc_attr.ioc_type; | 1913 | aen_data.ioc.ioc_type = ioc_type; |
1904 | } | 1914 | } |
1905 | 1915 | ||
1906 | /** | 1916 | /** |