aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kim <dekim@broadcom.com>2014-03-20 05:18:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-03-20 11:55:40 -0400
commitd23536796011cbeeb93fc866446800c52deb5603 (patch)
treed7c861f6c746f6c39d9942ef9c302050a4b5064f
parent370c5acef0326db3e8c10d42b941289c9c887a4a (diff)
brcmfmac: Enable 40MHz bandwidth in 2GHz band and OBSS scanning operations
This patch enables 40MHz bandwidth in 2GHz band after checking whether cfg80211 allows it or not, and enables OBSS scanning operations to to support 20/40 BSS coexistence. Reviewed-by: Arend Van Spriel <arend@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Daniel Kim <dekim@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/brcmfmac/fwil_types.h10
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c26
2 files changed, 36 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
index af17a5bc8b83..614e4888504f 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
@@ -48,6 +48,11 @@
48 48
49#define BRCMF_MAXRATES_IN_SET 16 /* max # of rates in rateset */ 49#define BRCMF_MAXRATES_IN_SET 16 /* max # of rates in rateset */
50 50
51/* OBSS Coex Auto/On/Off */
52#define BRCMF_OBSS_COEX_AUTO (-1)
53#define BRCMF_OBSS_COEX_OFF 0
54#define BRCMF_OBSS_COEX_ON 1
55
51enum brcmf_fil_p2p_if_types { 56enum brcmf_fil_p2p_if_types {
52 BRCMF_FIL_P2P_IF_CLIENT, 57 BRCMF_FIL_P2P_IF_CLIENT,
53 BRCMF_FIL_P2P_IF_GO, 58 BRCMF_FIL_P2P_IF_GO,
@@ -87,6 +92,11 @@ struct brcmf_fil_bss_enable_le {
87 __le32 enable; 92 __le32 enable;
88}; 93};
89 94
95struct brcmf_fil_bwcap_le {
96 __le32 band;
97 __le32 bw_cap;
98};
99
90/** 100/**
91 * struct tdls_iovar - common structure for tdls iovars. 101 * struct tdls_iovar - common structure for tdls iovars.
92 * 102 *
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 9f75afb3baa0..428b4cb94da1 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -191,6 +191,7 @@ static struct ieee80211_supported_band __wl_band_2ghz = {
191 .n_channels = ARRAY_SIZE(__wl_2ghz_channels), 191 .n_channels = ARRAY_SIZE(__wl_2ghz_channels),
192 .bitrates = wl_g_rates, 192 .bitrates = wl_g_rates,
193 .n_bitrates = wl_g_rates_size, 193 .n_bitrates = wl_g_rates_size,
194 .ht_cap = {IEEE80211_HT_CAP_SUP_WIDTH_20_40, true},
194}; 195};
195 196
196static struct ieee80211_supported_band __wl_band_5ghz_a = { 197static struct ieee80211_supported_band __wl_band_5ghz_a = {
@@ -4929,6 +4930,19 @@ static void init_vif_event(struct brcmf_cfg80211_vif_event *event)
4929 mutex_init(&event->vif_event_lock); 4930 mutex_init(&event->vif_event_lock);
4930} 4931}
4931 4932
4933static int brcmf_set_bwcap(struct brcmf_if *ifp, u32 band, u32 bw_cap)
4934{
4935 struct brcmf_fil_bwcap_le band_bwcap;
4936 int err;
4937
4938 band_bwcap.band = cpu_to_le32(band);
4939 band_bwcap.bw_cap = cpu_to_le32(bw_cap);
4940 err = brcmf_fil_iovar_data_set(ifp, "bw_cap", &band_bwcap,
4941 sizeof(band_bwcap));
4942
4943 return err;
4944}
4945
4932struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, 4946struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
4933 struct device *busdev) 4947 struct device *busdev)
4934{ 4948{
@@ -4986,6 +5000,18 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
4986 goto cfg80211_p2p_attach_out; 5000 goto cfg80211_p2p_attach_out;
4987 } 5001 }
4988 5002
5003 /* If cfg80211 didn't disable 40MHz HT CAP in wiphy_register(),
5004 * setup 40MHz in 2GHz band and enable OBSS scanning.
5005 */
5006 if (wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap.cap &
5007 IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
5008 err = brcmf_set_bwcap(ifp, WLC_BAND_2G, WLC_BW_CAP_40MHZ);
5009 if (!err) {
5010 err = brcmf_fil_iovar_int_set(ifp, "obss_coex",
5011 BRCMF_OBSS_COEX_AUTO);
5012 }
5013 }
5014
4989 err = brcmf_fil_iovar_int_set(ifp, "tdls_enable", 1); 5015 err = brcmf_fil_iovar_int_set(ifp, "tdls_enable", 1);
4990 if (err) { 5016 if (err) {
4991 brcmf_dbg(INFO, "TDLS not enabled (%d)\n", err); 5017 brcmf_dbg(INFO, "TDLS not enabled (%d)\n", err);