linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	"Alwin Beukers" <alwin@broadcom.com>,
	"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH 15/22] brcm80211: removed unused functions
Date: Wed, 12 Oct 2011 20:51:25 +0200	[thread overview]
Message-ID: <1318445492-24207-16-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1318445492-24207-1-git-send-email-arend@broadcom.com>

From: Alwin Beukers <alwin@broadcom.com>

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>
---
 drivers/net/wireless/brcm80211/brcmsmac/stf.c      |    2 -
 drivers/net/wireless/brcm80211/brcmutil/utils.c    |   14 ---
 drivers/net/wireless/brcm80211/brcmutil/wifi.c     |   93 --------------------
 .../net/wireless/brcm80211/include/brcmu_utils.h   |    1 -
 .../net/wireless/brcm80211/include/brcmu_wifi.h    |   28 ------
 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 f1bd1bf..d8f528e 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/stf.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/stf.c
@@ -30,8 +30,6 @@
 #define BRCMS_STF_SS_STBC_RX(wlc) (BRCMS_ISNPHY(wlc->band) && \
 	NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6))
 
-#define BRCMS_BITSCNT(x)	brcmu_bitcount((u8 *)&(x), sizeof(u8))
-
 #define NSTS_1	1
 #define NSTS_2	2
 #define NSTS_3	3
diff --git a/drivers/net/wireless/brcm80211/brcmutil/utils.c b/drivers/net/wireless/brcm80211/brcmutil/utils.c
index e96bdbf..990cb2e 100644
--- a/drivers/net/wireless/brcm80211/brcmutil/utils.c
+++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c
@@ -585,17 +585,3 @@ u8 brcmu_mw_to_qdbm(u16 mw)
 }
 EXPORT_SYMBOL(brcmu_mw_to_qdbm);
 
-uint brcmu_bitcount(u8 *bitmap, uint length)
-{
-	uint bitcount = 0, i;
-	u8 tmp;
-	for (i = 0; i < length; i++) {
-		tmp = bitmap[i];
-		while (tmp) {
-			bitcount++;
-			tmp &= (tmp - 1);
-		}
-	}
-	return bitcount;
-}
-EXPORT_SYMBOL(brcmu_bitcount);
diff --git a/drivers/net/wireless/brcm80211/brcmutil/wifi.c b/drivers/net/wireless/brcm80211/brcmutil/wifi.c
index 509e25c..e8d3bf2 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)
 	return false;
 }
 EXPORT_SYMBOL(brcmu_chspec_malformed);
-
-/*
- * This function returns the channel number that control traffic is being sent
- * on, for legacy channels this is just the channel number, for 40MHZ channels
- * it is the upper or lower 20MHZ sideband depending on the chanspec selected.
- */
-u8 brcmu_chspec_ctlchan(u16 chspec)
-{
-	u8 ctl_chan;
-
-	/* Is there a sideband ? */
-	if (CHSPEC_CTL_SB(chspec) == WL_CHANSPEC_CTL_SB_NONE) {
-		return CHSPEC_CHANNEL(chspec);
-	} else {
-		/*
-		 * we only support 40MHZ with sidebands. chanspec channel holds
-		 * the centre frequency, use that and the side band information
-		 * to reconstruct the control channel number
-		 */
-		if (CHSPEC_CTL_SB(chspec) == WL_CHANSPEC_CTL_SB_UPPER)
-			/*
-			 * control chan is the upper 20 MHZ SB of the
-			 * 40MHZ channel
-			 */
-			ctl_chan = upper_20_sb(CHSPEC_CHANNEL(chspec));
-		else
-			/*
-			 * control chan is the lower 20 MHZ SB of the
-			 * 40MHZ channel
-			 */
-			ctl_chan = lower_20_sb(CHSPEC_CHANNEL(chspec));
-	}
-
-	return ctl_chan;
-}
-EXPORT_SYMBOL(brcmu_chspec_ctlchan);
-
-/*
- * Return the channel number for a given frequency and base frequency.
- * The returned channel number is relative to the given base frequency.
- * If the given base frequency is zero, a base frequency of 5 GHz is assumed for
- * frequencies from 5 - 6 GHz, and 2.407 GHz is assumed for 2.4 - 2.5 GHz.
- *
- * Frequency is specified in MHz.
- * The base frequency is specified as (start_factor * 500 kHz).
- * Constants WF_CHAN_FACTOR_2_4_G, WF_CHAN_FACTOR_5_G are defined for
- * 2.4 GHz and 5 GHz bands.
- *
- * The returned channel will be in the range [1, 14] in the 2.4 GHz band
- * and [0, 200] otherwise.
- * -1 is returned if the start_factor is WF_CHAN_FACTOR_2_4_G and the
- * frequency is not a 2.4 GHz channel, or if the frequency is not and even
- * multiple of 5 MHz from the base frequency to the base plus 1 GHz.
- *
- * Reference 802.11 REVma, section 17.3.8.3, and 802.11B section 18.4.6.2
- */
-int brcmu_mhz2channel(uint freq, uint start_factor)
-{
-	int ch = -1;
-	uint base;
-	int offset;
-
-	/* take the default channel start frequency */
-	if (start_factor == 0) {
-		if (freq >= 2400 && freq <= 2500)
-			start_factor = WF_CHAN_FACTOR_2_4_G;
-		else if (freq >= 5000 && freq <= 6000)
-			start_factor = WF_CHAN_FACTOR_5_G;
-	}
-
-	if (freq == 2484 && start_factor == WF_CHAN_FACTOR_2_4_G)
-		return 14;
-
-	base = start_factor / 2;
-
-	/* check that the frequency is in 1GHz range of the base */
-	if ((freq < base) || (freq > base + 1000))
-		return -1;
-
-	offset = freq - base;
-	ch = offset / 5;
-
-	/* check that frequency is a 5MHz multiple from the base */
-	if (offset != (ch * 5))
-		return -1;
-
-	/* restricted channel range check for 2.4G */
-	if (start_factor == WF_CHAN_FACTOR_2_4_G && (ch < 1 || ch > 13))
-		return -1;
-
-	return ch;
-}
-EXPORT_SYMBOL(brcmu_mhz2channel);
diff --git a/drivers/net/wireless/brcm80211/include/brcmu_utils.h b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
index a7d3df2..96f05d7 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);
 
 extern uint brcmu_mkiovar(char *name, char *data, uint datalen,
 			  char *buf, uint len);
-extern uint brcmu_bitcount(u8 *bitmap, uint bytelength);
 
 #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 452bd42..5b1aca7 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)
  */
 extern bool brcmu_chspec_malformed(u16 chanspec);
 
-/*
- * This function returns the channel number that control traffic is being sent
- * on, for legacy channels this is just the channel number, for 40MHZ channels
- * it is the upper or lower 20MHZ sideband depending on the chanspec selected.
- */
-extern u8 brcmu_chspec_ctlchan(u16 chspec);
-
-/*
- * Return the channel number for a given frequency and base frequency.
- * The returned channel number is relative to the given base frequency.
- * If the given base frequency is zero, a base frequency of 5 GHz is assumed for
- * frequencies from 5 - 6 GHz, and 2.407 GHz is assumed for 2.4 - 2.5 GHz.
- *
- * Frequency is specified in MHz.
- * The base frequency is specified as (start_factor * 500 kHz).
- * Constants WF_CHAN_FACTOR_2_4_G, WF_CHAN_FACTOR_5_G are defined for
- * 2.4 GHz and 5 GHz bands.
- *
- * The returned channel will be in the range [1, 14] in the 2.4 GHz band
- * and [0, 200] otherwise.
- * -1 is returned if the start_factor is WF_CHAN_FACTOR_2_4_G and the
- * frequency is not a 2.4 GHz channel, or if the frequency is not and even
- * multiple of 5 MHz from the base frequency to the base plus 1 GHz.
- *
- * Reference 802.11 REVma, section 17.3.8.3, and 802.11B section 18.4.6.2
- */
-extern int brcmu_mhz2channel(uint freq, uint start_factor);
-
 /* Enumerate crypto algorithms */
 #define	CRYPTO_ALGO_OFF			0
 #define	CRYPTO_ALGO_WEP1		1
-- 
1.7.4.1



  parent reply	other threads:[~2011-10-12 18:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12 18:51 [PATCH 00/22] brcm80211: mainline patch related cleanup Arend van Spriel
2011-10-12 18:51 ` [PATCH 01/22] brcm80211: smac: removed redundant timer function parameters Arend van Spriel
2011-10-12 18:51 ` [PATCH 02/22] brcm80211: smac: decreased timer callback irq level Arend van Spriel
2011-10-12 18:51 ` [PATCH 03/22] brcm80211: cleanup function prototypes Arend van Spriel
2011-10-12 18:51 ` [PATCH 04/22] brcm80211: remove sparse warning in fullmac debug function Arend van Spriel
2011-10-12 18:51 ` [PATCH 05/22] brcm80211: fix sparse endianess error in mac80211_if.c Arend van Spriel
2011-10-12 18:51 ` [PATCH 06/22] brcm80211: add endian annotation to packet filter structures Arend van Spriel
2011-10-12 18:51 ` [PATCH 07/22] brcm80211: rename variable in _brcmf_set_multicast_list() Arend van Spriel
2011-10-12 18:51 ` [PATCH 08/22] brcm80211: fix annotations in TOE configuration functions Arend van Spriel
2011-10-12 18:51 ` [PATCH 09/22] brcm80211: use endian annotations in scan related function Arend van Spriel
2011-10-12 18:51 ` [PATCH 10/22] brcm80211: use endian annotation for pmk related structure Arend van Spriel
2011-10-12 18:51 ` [PATCH 11/22] brcm80211: use endian annotations for assoc ie length request Arend van Spriel
2011-10-12 18:51 ` [PATCH 12/22] brcm80211: use endian annotation for roaming related parameters Arend van Spriel
2011-10-12 18:51 ` [PATCH 13/22] brcm80211: use endian annotation for scan time configuration Arend van Spriel
2011-10-12 18:51 ` [PATCH 14/22] brcm80211: fmac: fixed weird indentation Arend van Spriel
2011-10-12 18:51 ` Arend van Spriel [this message]
2011-10-12 18:51 ` [PATCH 16/22] brcm80211: moved power conversion functions Arend van Spriel
2011-10-12 18:51 ` [PATCH 17/22] brcm80211: moved function brcmu_chipname Arend van Spriel
2011-10-12 18:51 ` [PATCH 18/22] brcm80211: moved function brcmu_parse_tlvs Arend van Spriel
2011-10-12 18:51 ` [PATCH 19/22] brcm80211: moved function brcmu_chspec_malformed Arend van Spriel
2011-10-12 18:51 ` [PATCH 20/22] brcm80211: moved function brcmu_mkiovar Arend van Spriel
2011-10-12 18:51 ` [PATCH 21/22] brcm80211: moved function brcmu_format_flags Arend van Spriel
2011-10-12 18:51 ` [PATCH 22/22] brcm80211: removed file wifi.c Arend van Spriel
2011-10-12 19:13   ` Johannes Berg
2011-10-12 19:20     ` Arend van Spriel
2011-10-12 19:28       ` Johannes Berg
2011-10-12 21:54   ` Luis R. Rodriguez
2011-10-13  8:51     ` Arend van Spriel
2011-10-13 18:08       ` Luis R. Rodriguez
2011-10-13 18:23         ` John W. Linville
2011-10-13 18:32           ` Arend van Spriel
2011-10-13 18:27         ` Arend van Spriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318445492-24207-16-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=alwin@broadcom.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).