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

brcm80211: removed unused functions

Removed brcmu_bitcount, brcmu_mhz2channel, brcmu_chspec_ctlchan.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Alwin Beukers and committed by
John W. Linville
f53b170f a718e2fe

-138
-2
drivers/net/wireless/brcm80211/brcmsmac/stf.c
··· 30 30 #define BRCMS_STF_SS_STBC_RX(wlc) (BRCMS_ISNPHY(wlc->band) && \ 31 31 NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6)) 32 32 33 - #define BRCMS_BITSCNT(x) brcmu_bitcount((u8 *)&(x), sizeof(u8)) 34 - 35 33 #define NSTS_1 1 36 34 #define NSTS_2 2 37 35 #define NSTS_3 3
-14
drivers/net/wireless/brcm80211/brcmutil/utils.c
··· 584 584 } 585 585 EXPORT_SYMBOL(brcmu_mw_to_qdbm); 586 586 587 - uint brcmu_bitcount(u8 *bitmap, uint length) 588 - { 589 - uint bitcount = 0, i; 590 - u8 tmp; 591 - for (i = 0; i < length; i++) { 592 - tmp = bitmap[i]; 593 - while (tmp) { 594 - bitcount++; 595 - tmp &= (tmp - 1); 596 - } 597 - } 598 - return bitcount; 599 - } 600 - EXPORT_SYMBOL(brcmu_bitcount);
-93
drivers/net/wireless/brcm80211/brcmutil/wifi.c
··· 41 41 return false; 42 42 } 43 43 EXPORT_SYMBOL(brcmu_chspec_malformed); 44 - 45 - /* 46 - * This function returns the channel number that control traffic is being sent 47 - * on, for legacy channels this is just the channel number, for 40MHZ channels 48 - * it is the upper or lower 20MHZ sideband depending on the chanspec selected. 49 - */ 50 - u8 brcmu_chspec_ctlchan(u16 chspec) 51 - { 52 - u8 ctl_chan; 53 - 54 - /* Is there a sideband ? */ 55 - if (CHSPEC_CTL_SB(chspec) == WL_CHANSPEC_CTL_SB_NONE) { 56 - return CHSPEC_CHANNEL(chspec); 57 - } else { 58 - /* 59 - * we only support 40MHZ with sidebands. chanspec channel holds 60 - * the centre frequency, use that and the side band information 61 - * to reconstruct the control channel number 62 - */ 63 - if (CHSPEC_CTL_SB(chspec) == WL_CHANSPEC_CTL_SB_UPPER) 64 - /* 65 - * control chan is the upper 20 MHZ SB of the 66 - * 40MHZ channel 67 - */ 68 - ctl_chan = upper_20_sb(CHSPEC_CHANNEL(chspec)); 69 - else 70 - /* 71 - * control chan is the lower 20 MHZ SB of the 72 - * 40MHZ channel 73 - */ 74 - ctl_chan = lower_20_sb(CHSPEC_CHANNEL(chspec)); 75 - } 76 - 77 - return ctl_chan; 78 - } 79 - EXPORT_SYMBOL(brcmu_chspec_ctlchan); 80 - 81 - /* 82 - * Return the channel number for a given frequency and base frequency. 83 - * The returned channel number is relative to the given base frequency. 84 - * If the given base frequency is zero, a base frequency of 5 GHz is assumed for 85 - * frequencies from 5 - 6 GHz, and 2.407 GHz is assumed for 2.4 - 2.5 GHz. 86 - * 87 - * Frequency is specified in MHz. 88 - * The base frequency is specified as (start_factor * 500 kHz). 89 - * Constants WF_CHAN_FACTOR_2_4_G, WF_CHAN_FACTOR_5_G are defined for 90 - * 2.4 GHz and 5 GHz bands. 91 - * 92 - * The returned channel will be in the range [1, 14] in the 2.4 GHz band 93 - * and [0, 200] otherwise. 94 - * -1 is returned if the start_factor is WF_CHAN_FACTOR_2_4_G and the 95 - * frequency is not a 2.4 GHz channel, or if the frequency is not and even 96 - * multiple of 5 MHz from the base frequency to the base plus 1 GHz. 97 - * 98 - * Reference 802.11 REVma, section 17.3.8.3, and 802.11B section 18.4.6.2 99 - */ 100 - int brcmu_mhz2channel(uint freq, uint start_factor) 101 - { 102 - int ch = -1; 103 - uint base; 104 - int offset; 105 - 106 - /* take the default channel start frequency */ 107 - if (start_factor == 0) { 108 - if (freq >= 2400 && freq <= 2500) 109 - start_factor = WF_CHAN_FACTOR_2_4_G; 110 - else if (freq >= 5000 && freq <= 6000) 111 - start_factor = WF_CHAN_FACTOR_5_G; 112 - } 113 - 114 - if (freq == 2484 && start_factor == WF_CHAN_FACTOR_2_4_G) 115 - return 14; 116 - 117 - base = start_factor / 2; 118 - 119 - /* check that the frequency is in 1GHz range of the base */ 120 - if ((freq < base) || (freq > base + 1000)) 121 - return -1; 122 - 123 - offset = freq - base; 124 - ch = offset / 5; 125 - 126 - /* check that frequency is a 5MHz multiple from the base */ 127 - if (offset != (ch * 5)) 128 - return -1; 129 - 130 - /* restricted channel range check for 2.4G */ 131 - if (start_factor == WF_CHAN_FACTOR_2_4_G && (ch < 1 || ch > 13)) 132 - return -1; 133 - 134 - return ch; 135 - } 136 - EXPORT_SYMBOL(brcmu_mhz2channel);
-1
drivers/net/wireless/brcm80211/include/brcmu_utils.h
··· 218 218 219 219 extern uint brcmu_mkiovar(char *name, char *data, uint datalen, 220 220 char *buf, uint len); 221 - extern uint brcmu_bitcount(u8 *bitmap, uint bytelength); 222 221 223 222 #endif /* _BRCMU_UTILS_H_ */
-28
drivers/net/wireless/brcm80211/include/brcmu_wifi.h
··· 176 176 */ 177 177 extern bool brcmu_chspec_malformed(u16 chanspec); 178 178 179 - /* 180 - * This function returns the channel number that control traffic is being sent 181 - * on, for legacy channels this is just the channel number, for 40MHZ channels 182 - * it is the upper or lower 20MHZ sideband depending on the chanspec selected. 183 - */ 184 - extern u8 brcmu_chspec_ctlchan(u16 chspec); 185 - 186 - /* 187 - * Return the channel number for a given frequency and base frequency. 188 - * The returned channel number is relative to the given base frequency. 189 - * If the given base frequency is zero, a base frequency of 5 GHz is assumed for 190 - * frequencies from 5 - 6 GHz, and 2.407 GHz is assumed for 2.4 - 2.5 GHz. 191 - * 192 - * Frequency is specified in MHz. 193 - * The base frequency is specified as (start_factor * 500 kHz). 194 - * Constants WF_CHAN_FACTOR_2_4_G, WF_CHAN_FACTOR_5_G are defined for 195 - * 2.4 GHz and 5 GHz bands. 196 - * 197 - * The returned channel will be in the range [1, 14] in the 2.4 GHz band 198 - * and [0, 200] otherwise. 199 - * -1 is returned if the start_factor is WF_CHAN_FACTOR_2_4_G and the 200 - * frequency is not a 2.4 GHz channel, or if the frequency is not and even 201 - * multiple of 5 MHz from the base frequency to the base plus 1 GHz. 202 - * 203 - * Reference 802.11 REVma, section 17.3.8.3, and 802.11B section 18.4.6.2 204 - */ 205 - extern int brcmu_mhz2channel(uint freq, uint start_factor); 206 - 207 179 /* Enumerate crypto algorithms */ 208 180 #define CRYPTO_ALGO_OFF 0 209 181 #define CRYPTO_ALGO_WEP1 1