aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmutil
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 /drivers/net/wireless/brcm80211/brcmutil
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>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmutil')
-rw-r--r--drivers/net/wireless/brcm80211/brcmutil/utils.c14
-rw-r--r--drivers/net/wireless/brcm80211/brcmutil/wifi.c93
2 files changed, 0 insertions, 107 deletions
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);