Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

brcm80211: smac: remove phy api bypass in rate.h

Obviously the phy api should be used to interface with the phy. In
rate.h a table within phy was accessed directly by declaring the
table extern in rate.h itself. This patch fixes this using the
provided api function to obtain the table reference. This bypass
was found by a sparse warning on the table not being defined static.

Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Arend van Spriel and committed by
John W. Linville
1433c59b 094b199b

+3 -4
+1 -1
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c
··· 112 112 {216, 50800} 113 113 }; 114 114 115 - const u8 ofdm_rate_lookup[] = { 115 + static const u8 ofdm_rate_lookup[] = { 116 116 117 117 BRCM_RATE_48M, 118 118 BRCM_RATE_24M,
+2 -3
drivers/net/wireless/brcm80211/brcmsmac/rate.h
··· 19 19 20 20 #include "types.h" 21 21 #include "d11.h" 22 + #include "phy_hal.h" 22 23 23 24 extern const u8 rate_info[]; 24 25 extern const struct brcms_c_rateset cck_ofdm_mimo_rates; ··· 199 198 200 199 /* Convert encoded rate value in plcp header to numerical rates in 500 KHz 201 200 * increments */ 202 - extern const u8 ofdm_rate_lookup[]; 203 - 204 201 static inline u8 ofdm_phy2mac_rate(u8 rlpt) 205 202 { 206 - return ofdm_rate_lookup[rlpt & 0x7]; 203 + return wlc_phy_get_ofdm_rate_lookup()[rlpt & 0x7]; 207 204 } 208 205 209 206 static inline u8 cck_phy2mac_rate(u8 signal)