aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlwin Beukers <alwin@broadcom.com>2011-10-12 14:51:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-10-14 14:48:18 -0400
commitf53b170f465d52546c33faa962c3d2609a6bf5b3 (patch)
treee579a547aa62831b3ddfd51333e5b485590cc2cf
parenta718e2fed1a31239922d06d7877fc3436eb05288 (diff)
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>
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/stf.c2
-rw-r--r--drivers/net/wireless/brcm80211/brcmutil/utils.c14
-rw-r--r--drivers/net/wireless/brcm80211/brcmutil/wifi.c93
-rw-r--r--drivers/net/wireless/brcm80211/include/brcmu_utils.h1
-rw-r--r--drivers/net/wireless/brcm80211/include/brcmu_wifi.h28
5 files changed, 0 insertions, 138 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/stf.c b/drivers/net/wireless/brcm80211/brcmsmac/stf.c
index f1bd1bf54854..d8f528eb180c 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/stf.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/stf.c
@@ -30,8 +30,6 @@
30#define BRCMS_STF_SS_STBC_RX(wlc) (BRCMS_ISNPHY(wlc->band) && \ 30#define BRCMS_STF_SS_STBC_RX(wlc) (BRCMS_ISNPHY(wlc->band) && \
31 NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6)) 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#define NSTS_1 1 33#define NSTS_1 1
36#define NSTS_2 2 34#define NSTS_2 2
37#define NSTS_3 3 35#define NSTS_3 3
diff --git a/drivers/net/wireless/brcm80211/brcmutil/utils.c b/drivers/net/wireless/brcm80211/brcmutil/utils.c
index 62bcc71eadf6..0bb104f784fe 100644
--- a/drivers/net/wireless/brcm80211/brcmutil/utils.c
+++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c
@@ -584,17 +584,3 @@ u8 brcmu_mw_to_qdbm(u16 mw)
584} 584}
585EXPORT_SYMBOL(brcmu_mw_to_qdbm); 585EXPORT_SYMBOL(brcmu_mw_to_qdbm);
586 586
587uint 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}
600EXPORT_SYMBOL(brcmu_bitcount);
diff --git a/drivers/net/wireless/brcm80211/brcmutil/wifi.c b/drivers/net/wireless/brcm80211/brcmutil/wifi.c
index 509e25c9c864..e8d3bf240b28 100644
--- a/drivers/net/wireless/brcm80211/brcmutil/wifi.c
+++ b/drivers/net/wireless/brcm80211/brcmutil/wifi.c
@@ -41,96 +41,3 @@ bool brcmu_chspec_malformed(u16 chanspec)
41 return false; 41 return false;
42} 42}
43EXPORT_SYMBOL(brcmu_chspec_malformed); 43EXPORT_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 */
50u8 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}
79EXPORT_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 */
100int 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}
136EXPORT_SYMBOL(brcmu_mhz2channel);
diff --git a/drivers/net/wireless/brcm80211/include/brcmu_utils.h b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
index a7d3df23661f..96f05d7a5d23 100644
--- a/drivers/net/wireless/brcm80211/include/brcmu_utils.h
+++ b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
@@ -218,6 +218,5 @@ extern u8 brcmu_mw_to_qdbm(u16 mw);
218 218
219extern uint brcmu_mkiovar(char *name, char *data, uint datalen, 219extern uint brcmu_mkiovar(char *name, char *data, uint datalen,
220 char *buf, uint len); 220 char *buf, uint len);
221extern uint brcmu_bitcount(u8 *bitmap, uint bytelength);
222 221
223#endif /* _BRCMU_UTILS_H_ */ 222#endif /* _BRCMU_UTILS_H_ */
diff --git a/drivers/net/wireless/brcm80211/include/brcmu_wifi.h b/drivers/net/wireless/brcm80211/include/brcmu_wifi.h
index 452bd420df76..5b1aca7d9829 100644
--- a/drivers/net/wireless/brcm80211/include/brcmu_wifi.h
+++ b/drivers/net/wireless/brcm80211/include/brcmu_wifi.h
@@ -176,34 +176,6 @@ static inline bool ac_bitmap_tst(u8 bitmap, int prec)
176 */ 176 */
177extern bool brcmu_chspec_malformed(u16 chanspec); 177extern 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 */
184extern 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 */
205extern int brcmu_mhz2channel(uint freq, uint start_factor);
206
207/* Enumerate crypto algorithms */ 179/* Enumerate crypto algorithms */
208#define CRYPTO_ALGO_OFF 0 180#define CRYPTO_ALGO_OFF 0
209#define CRYPTO_ALGO_WEP1 1 181#define CRYPTO_ALGO_WEP1 1