Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268618
b: refs/heads/master
c: f9be749
h: refs/heads/master
v: v3
  • Loading branch information
Roland Vossen authored and Greg Kroah-Hartman committed Oct 3, 2011
1 parent 3d5f677 commit aa1af11
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8298f41150c3e063eb6b3dec58349f652c564fbf
refs/heads/master: f9be7492782a584e61724c6f84d5ca2c71f7bed0
29 changes: 17 additions & 12 deletions trunk/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "pub.h"
#include "ucode_loader.h"
#include "mac80211_if.h"
#include "main.h"

#define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */

Expand Down Expand Up @@ -225,7 +226,7 @@ static struct ieee80211_rate legacy_ratetable[] = {
RATE(540, 0),
};

static struct ieee80211_supported_band brcms_band_2GHz_nphy = {
static const struct ieee80211_supported_band brcms_band_2GHz_nphy_template = {
.band = IEEE80211_BAND_2GHZ,
.channels = brcms_2ghz_chantable,
.n_channels = ARRAY_SIZE(brcms_2ghz_chantable),
Expand All @@ -247,7 +248,7 @@ static struct ieee80211_supported_band brcms_band_2GHz_nphy = {
}
};

static struct ieee80211_supported_band brcms_band_5GHz_nphy = {
static const struct ieee80211_supported_band brcms_band_5GHz_nphy_template = {
.band = IEEE80211_BAND_5GHZ,
.channels = brcms_5ghz_nphy_chantable,
.n_channels = ARRAY_SIZE(brcms_5ghz_nphy_chantable),
Expand Down Expand Up @@ -981,34 +982,38 @@ static irqreturn_t brcms_isr(int irq, void *dev_id)
static int ieee_hw_rate_init(struct ieee80211_hw *hw)
{
struct brcms_info *wl = hw->priv;
int has_5g;
struct brcms_c_info *wlc = wl->wlc;
struct ieee80211_supported_band *band;
int has_5g = 0;
u16 phy_type;

has_5g = 0;

hw->wiphy->bands[IEEE80211_BAND_2GHZ] = NULL;
hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;

phy_type = brcms_c_get_phy_type(wl->wlc, 0);
if (phy_type == PHY_TYPE_N || phy_type == PHY_TYPE_LCN) {
band = &wlc->bandstate[BAND_2G_INDEX]->band;
*band = brcms_band_2GHz_nphy_template;
if (phy_type == PHY_TYPE_LCN) {
/* Single stream */
brcms_band_2GHz_nphy.ht_cap.mcs.rx_mask[1] = 0;
brcms_band_2GHz_nphy.ht_cap.mcs.rx_highest = 72;
band->ht_cap.mcs.rx_mask[1] = 0;
band->ht_cap.mcs.rx_highest = 72;
}
hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &brcms_band_2GHz_nphy;
hw->wiphy->bands[IEEE80211_BAND_2GHZ] = band;
} else {
return -EPERM;
}

/* Assume all bands use the same phy. True for 11n devices. */
if (wl->pub->_nbands > 1) {
has_5g++;
if (phy_type == PHY_TYPE_N || phy_type == PHY_TYPE_LCN)
hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
&brcms_band_5GHz_nphy;
else
if (phy_type == PHY_TYPE_N || phy_type == PHY_TYPE_LCN) {
band = &wlc->bandstate[BAND_5G_INDEX]->band;
*band = brcms_band_5GHz_nphy_template;
hw->wiphy->bands[IEEE80211_BAND_5GHZ] = band;
} else {
return -EPERM;
}
}
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/brcm80211/brcmsmac/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ struct brcms_band {

u16 CWmin; /* minimum size of contention window, in unit of aSlotTime */
u16 CWmax; /* maximum size of contention window, in unit of aSlotTime */
struct ieee80211_supported_band band;
};

/* module control blocks */
Expand Down

0 comments on commit aa1af11

Please sign in to comment.