Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314785
b: refs/heads/master
c: 2ab631f
h: refs/heads/master
i:
  314783: 90a0458
v: v3
  • Loading branch information
Seth Forshee authored and John W. Linville committed Jun 20, 2012
1 parent 234b1c3 commit fd69eaa
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 42 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: cf03c5dac83609f09d9f0e9fa3c09d86daed614d
refs/heads/master: 2ab631f48cac65864a61007215187cb7511b0846
67 changes: 26 additions & 41 deletions trunk/drivers/net/wireless/brcm80211/brcmsmac/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,46 +677,6 @@ 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;
uint chan;

/* search for the existence of any valid channel */
for (chan = 0; chan < MAXCHANNEL; chan++) {
if (brcms_c_valid_channel20_db(wlc->cmi, chan))
break;
}
if (chan == MAXCHANNEL)
chan = INVCHANNEL;

/*
* based on the channel search above, set or
* clear WL_RADIO_COUNTRY_DISABLE.
*/
if (chan == INVCHANNEL) {
/*
* country/locale with no valid channels, set
* the radio disable bit
*/
mboolset(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE);
wiphy_err(wlc->wiphy, "wl%d: %s: no valid channel for \"%s\" "
"nbands %d bandlocked %d\n", wlc->pub->unit,
__func__, wlc_cm->world_regd->regdomain->alpha2,
wlc->pub->_nbands, wlc->bandlocked);
} else if (mboolisset(wlc->pub->radio_disabled,
WL_RADIO_COUNTRY_DISABLE)) {
/*
* country/locale with valid channel, clear
* the radio disable bit
*/
mboolclr(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE);
}
}

static int
brcms_c_channels_init(struct brcms_cm_info *wlc_cm,
const struct country_info *country)
Expand Down Expand Up @@ -762,7 +722,6 @@ brcms_c_channels_init(struct brcms_cm_info *wlc_cm,
}

brcms_c_quiet_channels_reset(wlc_cm);
brcms_c_channels_commit(wlc_cm);

return 0;
}
Expand Down Expand Up @@ -1235,12 +1194,38 @@ static int brcms_reg_notifier(struct wiphy *wiphy,
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
struct brcms_info *wl = hw->priv;
struct brcms_c_info *wlc = wl->wlc;
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
int band, i;
bool ch_found = false;

brcms_reg_apply_radar_flags(wiphy);

if (request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)
brcms_reg_apply_beaconing_flags(wiphy, request->initiator);

/* Disable radio if all channels disallowed by regulatory */
for (band = 0; !ch_found && band < IEEE80211_NUM_BANDS; band++) {
sband = wiphy->bands[band];
if (!sband)
continue;

for (i = 0; !ch_found && i < sband->n_channels; i++) {
ch = &sband->channels[i];

if (!(ch->flags & IEEE80211_CHAN_DISABLED))
ch_found = true;
}
}

if (ch_found) {
mboolclr(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE);
} else {
mboolset(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE);
wiphy_err(wlc->wiphy, "wl%d: %s: no valid channel for \"%s\"\n",
wlc->pub->unit, __func__, request->alpha2);
}

if (wlc->pub->_nbands > 1 || wlc->band->bandtype == BRCM_BAND_2G)
wlc_phy_chanspec_ch14_widefilter_set(wlc->band->pi,
brcms_c_japan_ccode(request->alpha2));
Expand Down

0 comments on commit fd69eaa

Please sign in to comment.