Seth Forshee | 25 Jun 2012 19:01
Favicon

[pull-request][Quantal] brcmsmac regulatory rework

brcmsmac has it's own internal implementation for adhering to regulatory
rules governing wireless spectrum use. This is an inferior duplication
of the support contained in mac80211. These two implementations can be
in conflict, causing wireless frequencies that should be usable to be
disabled.

These patches represent an extensive rewrite of brcmsmac's regulatory
support to remove the internal implementation and integrate with the
support in mac80211. These are all clean cherry-picks from
wireless-testing. I've been testing the patches for the past couple of
months while working to get them accepted upstream. I'm proposing we
pick them up for quantal to increase test coverage and to improve the
behavior of brcmsmac if we end up releasing with a 3.5 kernel.

The pull request follows. I'm also sending the patches to ease
reviewing.

Thanks,
Seth

The following changes since commit ee611cc51e4f742d0d950cbf631cfff694395f8a:

  UBUNTU: Ubuntu-3.5.0-1.1 (2012-06-19 00:03:29 -0700)

are available in the git repository at:

  git://kernel.ubuntu.com/sforshee/ubuntu-quantal.git lp950320

for you to fetch changes up to 505c3befd7de19832411022aa2d96ff133eab6d0:

(Continue reading)

Seth Forshee | 25 Jun 2012 19:01
Favicon

[PATCH 01/10] UBUNTU: SAUCE: (drop after 3.5) brcm80211: smac: don't set up tx power limits during initialization

This code is unnecessary, and in fact it's never executed because the
interface is never up when brcms_c_channels_commit() is called. Removing
it helps simplify the implementation of proper regulatory support.

Reviewed-by: Arend Van Spriel <arend <at> broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg <at> broadcom.com>
Reviewed-by: Brett Rudley <brudley <at> broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee <at> canonical.com>
Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
(cherry picked from commit 0bd8b79fe928b88ebaf36f2621f921a2fc09ea9c wireless-testing)
BugLink: http://bugs.launchpad.net/bugs/950320
---
 drivers/net/wireless/brcm80211/brcmsmac/channel.c |    8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index eb77ac3..049d78f 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
 <at>  <at>  -908,7 +908,6  <at>  <at>  static void brcms_c_channels_commit(struct brcms_cm_info *wlc_cm)
 {
 	struct brcms_c_info *wlc = wlc_cm->wlc;
 	uint chan;
-	struct txpwr_limits txpwr;

 	/* search for the existence of any valid channel */
 	for (chan = 0; chan < MAXCHANNEL; chan++) {
 <at>  <at>  -949,13 +948,6  <at>  <at>  static void brcms_c_channels_commit(struct brcms_cm_info *wlc_cm)
 		wlc_phy_chanspec_ch14_widefilter_set(wlc->band->pi,
 						     brcms_c_japan(wlc) ? true :
(Continue reading)

Seth Forshee | 25 Jun 2012 19:01
Favicon

[PATCH 02/10] UBUNTU: SAUCE: (drop after 3.5) brcm80211: smac: always set channel specified by mac80211

In some situations brcmsmac is choosing a channel internally. This makes
it difficult at times to know what channel to use for enforcing
regulatory constraints, so instead always use the channel from the
mac80211 configuration.

Reviewed-by: Arend Van Spriel <arend <at> broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg <at> broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee <at> canonical.com>
Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
(cherry picked from commit 91691295527d3fd63f12079222df0fd8048acccb wireless-testing)
BugLink: http://bugs.launchpad.net/bugs/950320
---
 drivers/net/wireless/brcm80211/brcmsmac/main.c |   30 +++++-------------------
 1 file changed, 6 insertions(+), 24 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 19db405..93c865d 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
 <at>  <at>  -3139,20 +3139,6  <at>  <at>  void brcms_c_reset(struct brcms_c_info *wlc)
 	brcms_b_reset(wlc->hw);
 }

-/* Return the channel the driver should initialize during brcms_c_init.
- * the channel may have to be changed from the currently configured channel
- * if other configurations are in conflict (bandlocked, 11n mode disabled,
- * invalid channel for current country, etc.)
- */
-static u16 brcms_c_init_chanspec(struct brcms_c_info *wlc)
-{
(Continue reading)

Seth Forshee | 25 Jun 2012 19:01
Favicon

[PATCH 03/10] UBUNTU: SAUCE: (drop after 3.5) brcm80211: smac: remove unused code for 40MHz channels

This code has been kept around in anticipation of adding support for
40MHz channels, but subsequent patches to better integrate with mac80211
regulatory support will render it completely broken. Therefore we should
go ahead and remove it.

Keep these changes separate from other cleanup patches in order to make
it easier to resurrect 40MHz channel support at some point in the
future.

Reviewed-by: Arend Van Spriel <arend <at> broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee <at> canonical.com>
Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
(cherry picked from commit a3ce5cc1a60fd2e237599d4b9bc247422a7523c2 wireless-testing)
BugLink: http://bugs.launchpad.net/bugs/950320
---
 drivers/net/wireless/brcm80211/brcmsmac/channel.c |  116 ---------------------
 1 file changed, 116 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index 049d78f..089cc87 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
 <at>  <at>  -512,83 +512,6  <at>  <at>  static const struct {
 	"X2", LOCALES(i, 11, bn, 11n)},	/* Worldwide RoW 2 */
 };

-#ifdef SUPPORT_40MHZ
-/* 20MHz channel info for 40MHz pairing support */
-struct chan20_info {
-	u8 sb;
(Continue reading)

Seth Forshee | 25 Jun 2012 19:01
Favicon

[PATCH 05/10] UBUNTU: SAUCE: (drop after 3.5) brcm80211: smac: inform mac80211 of the X2 regulatory domain

brcmsmac implements enforcement of regulatory constraints internally,
using a Broadcom-specific world roaming domain named X2. Besides being
duplication of functionality this can also conflict with mac80211's
regulatory implementation, as mac80211 is unaware of the X2 domain and
thus might apply a more restrictive domain.

This patch is the first step in making brcmsmac cooperate with
mac80211's regulatory support. X2 is registered as a custom domain with
mac80211, so that at least both implementations will be enforcing the
same set of constraints. The internal enforcement of rules is kept for
now; this will be converted over to relying on mac80211 regulatory
enforcement in later patches.

Reviewed-by: Arend Van Spriel <arend <at> broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg <at> broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee <at> canonical.com>
Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
(cherry picked from commit cf03c5dac83609f09d9f0e9fa3c09d86daed614d wireless-testing)
BugLink: http://bugs.launchpad.net/bugs/950320
---
 drivers/net/wireless/brcm80211/brcmsmac/channel.c  |  385 +++++++++++---------
 drivers/net/wireless/brcm80211/brcmsmac/channel.h  |    1 +
 .../net/wireless/brcm80211/brcmsmac/mac80211_if.c  |    2 +
 3 files changed, 210 insertions(+), 178 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index c311ef7..65ef60b 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
 <at>  <at>  -15,7 +15,9  <at>  <at> 
(Continue reading)

Seth Forshee | 25 Jun 2012 19:01
Favicon

[PATCH 06/10] UBUNTU: SAUCE: (drop after 3.5) brcm80211: smac: enable/disable radio on regulatory updates

Currently the radio disable state is only updated during initialization,
and it's only checked against the internal world domain. This is
unnecessary, as there are always valid channels against this domain.
Instead, check whether any channels are enabled in the regulatory
notifier and update the radio state accordingly.

Reviewed-by: Arend Van Spriel <arend <at> broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg <at> broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee <at> canonical.com>
Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
(cherry picked from commit 2ab631f48cac65864a61007215187cb7511b0846 wireless-testing)
BugLink: http://bugs.launchpad.net/bugs/950320
---
 drivers/net/wireless/brcm80211/brcmsmac/channel.c |   67 ++++++++-------------
 1 file changed, 26 insertions(+), 41 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index 65ef60b..3951ccf 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
 <at>  <at>  -677,46 +677,6  <at>  <at>  brcms_c_channel_min_txpower_limits_with_local_constraint(

 }

-/* Update the radio state (enable/disable) and tx power targets
- * based on a new set of channel/regulatory information
- */
-static void brcms_c_channels_commit(struct brcms_cm_info *wlc_cm)
-{
-	struct brcms_c_info *wlc = wlc_cm->wlc;
(Continue reading)

Seth Forshee | 25 Jun 2012 19:01
Favicon

[PATCH 07/10] UBUNTU: SAUCE: (drop after 3.5) brcm80211: smac: use mac80211 channel data for tx power limits

Currently the limits from the internal X2 domain are used, regardless
of what regulatory rules are in effect. Instead use the power limits set
by the higher-level regulatory support.

The rules for the MIMO power limits are still always derived from the
world domain, pending guidance from Broadcom as to how these need to be
handled. This will be fixed later, but using the limits from the world
domain works for now.

Reviewed-by: Arend Van Spriel <arend <at> broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg <at> broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee <at> canonical.com>
Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
(cherry picked from commit 2cf5089ed5ae4a8f73427234cb83c42eaaf34d46 wireless-testing)
BugLink: http://bugs.launchpad.net/bugs/950320
---
 drivers/net/wireless/brcm80211/brcmsmac/channel.c |   73 ++++-----------------
 1 file changed, 14 insertions(+), 59 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index 3951ccf..bdb11ff 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
 <at>  <at>  -74,15 +74,6  <at>  <at> 
 /* max of BAND_5G_PWR_LVLS and 14 for 2.4 GHz */
 #define BRCMS_MAXPWR_MIMO_TBL_SIZE	14

-/* power level in group of 2.4GHz band channels:
- * maxpwr[0] - CCK  channels [1]
- * maxpwr[1] - CCK  channels [2-10]
(Continue reading)

Seth Forshee | 25 Jun 2012 19:01
Favicon

[PATCH 04/10] UBUNTU: SAUCE: (drop after 3.5) brcm80211: smac: clean up channel.c

Much of the code is either unsed or never put to any useful purpose.
Remove this code in advance of reworking the driver's regulatory
support.

Reviewed-by: Arend Van Spriel <arend <at> broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg <at> broadcom.com>
Reviewed-by: Brett Rudley <brudley <at> broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee <at> canonical.com>
Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
(cherry picked from commit 2810a619ca5716e315090119e5695e97814b1e60 wireless-testing)
BugLink: http://bugs.launchpad.net/bugs/950320
---
 drivers/net/wireless/brcm80211/brcmsmac/channel.c |  138 +--------------------
 1 file changed, 5 insertions(+), 133 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index 089cc87..c311ef7 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
 <at>  <at>  -58,18 +58,8  <at>  <at> 
 				 LOCALE_CHAN_12_13 | \
 				 LOCALE_CHAN_14)

-#define  LOCALE_RADAR_SET_NONE		  0
-#define  LOCALE_RADAR_SET_1		  1
-
 #define  LOCALE_RESTRICTED_NONE		  0
 #define  LOCALE_RESTRICTED_SET_2G_SHORT   1
-#define  LOCALE_RESTRICTED_CHAN_165       2
-#define  LOCALE_CHAN_ALL_5G		  3
(Continue reading)

Seth Forshee | 25 Jun 2012 19:01
Favicon

[PATCH 08/10] UBUNTU: SAUCE: (drop after 3.5) brcm80211: smac: don't validate channels against internal regulatory data

The core regulatory support will disable channels not allowed by
regulatory rules, so brcmsmac doesn't need to check whether or not the
requested channel is permitted by regulatory.

Reviewed-by: Arend Van Spriel <arend <at> broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg <at> broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee <at> canonical.com>
Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
(cherry picked from commit 853346d8b60738467581d1cd9ccb678aeb086121 wireless-testing)
BugLink: http://bugs.launchpad.net/bugs/950320
---
 drivers/net/wireless/brcm80211/brcmsmac/channel.c |  344 +--------------------
 1 file changed, 6 insertions(+), 338 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index bdb11ff..04e6a6e 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
 <at>  <at>  -30,40 +30,6  <at>  <at> 
 /* QDB() macro takes a dB value and converts to a quarter dB value */
 #define QDB(n) ((n) * BRCMS_TXPWR_DB_FACTOR)

-#define  LOCALE_CHAN_01_11	 (1<<0)
-#define  LOCALE_CHAN_12_13	 (1<<1)
-#define  LOCALE_CHAN_14		 (1<<2)
-#define  LOCALE_SET_5G_LOW_JP1   (1<<3)	/* 34-48, step 2 */
-#define  LOCALE_SET_5G_LOW_JP2   (1<<4)	/* 34-46, step 4 */
-#define  LOCALE_SET_5G_LOW1      (1<<5)	/* 36-48, step 4 */
-#define  LOCALE_SET_5G_LOW2      (1<<6)	/* 52 */
-#define  LOCALE_SET_5G_LOW3      (1<<7)	/* 56-64, step 4 */
(Continue reading)

Seth Forshee | 25 Jun 2012 19:01
Favicon

[PATCH 10/10] UBUNTU: SAUCE: (drop after 3.5) brcmsmac: fix NULL pointer crash in brcms_c_regd_init()

From: Arend van Spriel <arend <at> broadcom.com>

In the function brcms_c_regd_init() the channels are validated
against the device capabilities. This is done for both 2.4G and
5G band, but there are devices that are 2.4G only, ie. BCM4313.
For that device this leads to a NULL dereference. This patch adds
a check in brcms_c_regd_init() to fix this.

Issue introduced in wireless-next tree by following commit:
cf03c5d brcm80211: smac: inform mac80211 of the X2 regulatory domain

Cc: Seth Forshee <seth.forshee <at> canonical.com>
Signed-off-by: Arend van Spriel <arend <at> broadcom.com>
Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
(cherry picked from commit c49aa4aa2bc89e88672dc419a293d7b8c1f094d2 wireless-testing)
BugLink: http://bugs.launchpad.net/bugs/950320
Signed-off-by: Seth Forshee <seth.forshee <at> canonical.com>
---
 drivers/net/wireless/brcm80211/brcmsmac/channel.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index d3c7260..2d365d3 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
 <at>  <at>  -768,6 +768,11  <at>  <at>  void brcms_c_regd_init(struct brcms_c_info *wlc)
 			band = wlc->bandstate[BAND_2G_INDEX];
 		else
 			band = wlc->bandstate[BAND_5G_INDEX];
+
(Continue reading)

Seth Forshee | 25 Jun 2012 19:01
Favicon

[PATCH 09/10] UBUNTU: SAUCE: (drop after 3.5) brcm80211: smac: use current regulatory domain when checking whether OFDM is allowed

The brcmsmac internal regulatory data is being used to determine whether
OFDM should be allowed, and this is only done once during
initialization. To be effective this needs to be checked against
mac80211's regulatory rules for the current channel.

Reviewed-by: Arend Van Spriel <arend <at> broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg <at> broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee <at> canonical.com>
Signed-off-by: John W. Linville <linville <at> tuxdriver.com>
(cherry picked from commit edc7651f3a4ffa7fca37d92401562694121512ad wireless-testing)
BugLink: http://bugs.launchpad.net/bugs/950320
---
 drivers/net/wireless/brcm80211/brcmsmac/channel.c |  132 +++------------------
 drivers/net/wireless/brcm80211/brcmsmac/channel.h |    3 -
 drivers/net/wireless/brcm80211/brcmsmac/main.c    |    6 +-
 3 files changed, 15 insertions(+), 126 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index 04e6a6e..d3c7260 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
 <at>  <at>  -30,13 +30,9  <at>  <at> 
 /* QDB() macro takes a dB value and converts to a quarter dB value */
 #define QDB(n) ((n) * BRCMS_TXPWR_DB_FACTOR)

-#define LOCALE_2G_IDX_i			0
-#define LOCALE_5G_IDX_11		0
 #define LOCALE_MIMO_IDX_bn		0
 #define LOCALE_MIMO_IDX_11n		0

(Continue reading)

Tim Gardner | 25 Jun 2012 20:00
Favicon

APPLIED: [pull-request][Quantal] brcmsmac regulatory rework


--

-- 
Tim Gardner tim.gardner <at> canonical.com


Gmane