diff options
author | Arend van Spriel <arend@broadcom.com> | 2011-12-12 18:14:59 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-13 15:47:54 -0500 |
commit | d3126c52eb7f3239b45481facc4078b08ed1027c (patch) | |
tree | 08dfdfa538e42755831fdf146dbadc99a8a32a7e /drivers | |
parent | dd5f13b8a4b5f86e645e7e6662075004d116d5ad (diff) |
brcm80211: smac: change ai_findcoreidx() to ai_findcore()
Instead of returning the core index the function now returns
the bcma device for the requested core id. This function is
now exposed in the header file.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c index 8d3829a73190..a54cf32d1eb5 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | |||
@@ -884,7 +884,7 @@ uint ai_coreidx(struct si_pub *sih) | |||
884 | } | 884 | } |
885 | 885 | ||
886 | /* return index of coreid or BADIDX if not found */ | 886 | /* return index of coreid or BADIDX if not found */ |
887 | uint ai_findcoreidx(struct si_pub *sih, uint coreid, uint coreunit) | 887 | struct bcma_device *ai_findcore(struct si_pub *sih, u16 coreid, u16 coreunit) |
888 | { | 888 | { |
889 | struct bcma_device *core; | 889 | struct bcma_device *core; |
890 | struct si_info *sii; | 890 | struct si_info *sii; |
@@ -897,11 +897,11 @@ uint ai_findcoreidx(struct si_pub *sih, uint coreid, uint coreunit) | |||
897 | list_for_each_entry(core, &sii->icbus->cores, list) | 897 | list_for_each_entry(core, &sii->icbus->cores, list) |
898 | if (core->id.id == coreid) { | 898 | if (core->id.id == coreid) { |
899 | if (found == coreunit) | 899 | if (found == coreunit) |
900 | return core->core_index; | 900 | return core; |
901 | found++; | 901 | found++; |
902 | } | 902 | } |
903 | 903 | ||
904 | return BADIDX; | 904 | return NULL; |
905 | } | 905 | } |
906 | 906 | ||
907 | /* | 907 | /* |
@@ -912,13 +912,13 @@ uint ai_findcoreidx(struct si_pub *sih, uint coreid, uint coreunit) | |||
912 | */ | 912 | */ |
913 | void __iomem *ai_setcore(struct si_pub *sih, uint coreid, uint coreunit) | 913 | void __iomem *ai_setcore(struct si_pub *sih, uint coreid, uint coreunit) |
914 | { | 914 | { |
915 | uint idx; | 915 | struct bcma_device *core; |
916 | 916 | ||
917 | idx = ai_findcoreidx(sih, coreid, coreunit); | 917 | core = ai_findcore(sih, coreid, coreunit); |
918 | if (idx >= SI_MAXCORES) | 918 | if (core == NULL) |
919 | return NULL; | 919 | return NULL; |
920 | 920 | ||
921 | return ai_setcoreidx(sih, idx); | 921 | return ai_setcoreidx(sih, core->core_index); |
922 | } | 922 | } |
923 | 923 | ||
924 | /* Turn off interrupt as required by ai_setcore, before switch core */ | 924 | /* Turn off interrupt as required by ai_setcore, before switch core */ |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h index 67b378f2f57e..b0b0bfffe162 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | |||
@@ -219,6 +219,8 @@ struct si_info { | |||
219 | 219 | ||
220 | 220 | ||
221 | /* AMBA Interconnect exported externs */ | 221 | /* AMBA Interconnect exported externs */ |
222 | extern struct bcma_device *ai_findcore(struct si_pub *sih, | ||
223 | u16 coreid, u16 coreunit); | ||
222 | extern uint ai_coreidx(struct si_pub *sih); | 224 | extern uint ai_coreidx(struct si_pub *sih); |
223 | extern uint ai_corerev(struct si_pub *sih); | 225 | extern uint ai_corerev(struct si_pub *sih); |
224 | extern u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val); | 226 | extern u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val); |