* Re: [RFC] mac80211: support for IEEE80211N in IBSS
From: Johannes Berg @ 2011-01-19 14:35 UTC (permalink / raw)
To: Alexander Simon; +Cc: linux-wireless
In-Reply-To: <201101191438.01161.alexander.simon@saxnet.de>
On Wed, 2011-01-19 at 14:38 +0100, Alexander Simon wrote:
> Hey list,
>
> finally i got my (in ath9ks list announced) patch for HT rates in ad-hoc
> networks ready that has been requested quite often.
> I took the initial patches from Benoît Papillault and worked on them.
Didn't he have versions that refactored more, like the IE building?
That'd be good in any case.
Can you split this up into a few patches and repost inline (not
attached) so we can review it more easily?
johannes
^ permalink raw reply
* [RFC] mac80211: ieee80211_ibss_add_sta called uneccessarily
From: Alexander Simon @ 2011-01-19 13:43 UTC (permalink / raw)
To: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 873 bytes --]
Hi,
while creating a patch for IEEE802.11n with IBSS, i found that
ieee80211_ibss_add_sta is called way to often by prepare_for_handlers in
net/mac80211/rx.c.
In net/mac80211/rx.c we check if the IBSSs match with ieee80211_bssid_match().
If they dont and we are not scanning, we are leaving.
But ieee80211_bssid_match() will also return true if our BSSID is set to
broadcast. And the interface is set to broadcast if we are scanning witch
happens if we created an IBSS and are still "alone". So we will never return.
So i would change !ieee80211_bssid_match just into compare_ether_addr.
Well, this only affects CPU (and my printk output) as ieee80211_ibss_add_sta
checks the BSSIDs on its own again, but we safe some needless function calls.
Hope i could give a understandable explanation of my patch
Signed-off-by: Alexander Simon <alexander.simon@saxnet.de>
[-- Attachment #2: fix_ieee80211_ibss_add_sta_call.patch --]
[-- Type: text/x-patch, Size: 656 bytes --]
diff -Nrup compat-wireless-2011-01-17.orig/net/mac80211/rx.c compat-wireless-2011-01-17/net/mac80211/rx.c
--- compat-wireless-2011-01-17.orig/net/mac80211/rx.c 2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/rx.c 2011-01-18 15:42:46.000000000 +0100
@@ -2601,7 +2601,7 @@ static int prepare_for_handlers(struct i
if (ieee80211_is_beacon(hdr->frame_control)) {
return 1;
}
- else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) {
+ else if (compare_ether_addr(bssid, sdata->u.ibss.bssid)) {
if (!(status->rx_flags & IEEE80211_RX_IN_SCAN))
return 0;
status->rx_flags &= ~IEEE80211_RX_RA_MATCH;
^ permalink raw reply
* [RFC] mac80211: support for IEEE80211N in IBSS
From: Alexander Simon @ 2011-01-19 13:38 UTC (permalink / raw)
To: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]
Hey list,
finally i got my (in ath9ks list announced) patch for HT rates in ad-hoc
networks ready that has been requested quite often.
I took the initial patches from Benoît Papillault and worked on them.
Benoît already implemented setting the HT mode with iw, building and
receiving IEs.
I added processing of the IEs when a new station joins the network into the
internal station capabilities (struct sta_cap). This is necessary for eg. the
rate algo to choose HT rates.
I had to change packet aggretation code to also work in ADHOC iftype.
As already said, the interface mode is set with iw. That mode will also be
advertised in the IEs, the additional HT capabilities are taken from the
interface capabilities. So there is no option to disable single capabilities
as in hostapd yet.
If a station is added through main receive path (ie. a third station sending
data to another station), HT is not threat yet. So there may be a initial
delay of maximum 100ms (beacon interval) running in legacy. It would
require disproportionally much work to implement this.
I tested this with with ath9k and iwlagn cards. Note that for ath9k i worked
with minstrel_ht.
You will also need Benoît's patch for iw to set HT mode.
http://ns3.spinics.net/lists/linux-wireless/msg50200.html
You would then be able to setup an IBSS with eg.:
iw wlan0 ibss join my_ht_ibss 2412 HT40+
Alex
Signed-off-by: Alexander Simon <alexander.simon@saxnet.de>
[-- Attachment #2: enable_ieee80211_n_for_ibss.patch --]
[-- Type: text/x-patch, Size: 13725 bytes --]
diff -Nrup compat-wireless-2011-01-17.orig//include/net/cfg80211.h compat-wireless-2011-01-17/include/net/cfg80211.h
--- compat-wireless-2011-01-17.orig//include/net/cfg80211.h 2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/include/net/cfg80211.h 2011-01-18 15:47:56.000000000 +0100
@@ -960,6 +960,7 @@ struct cfg80211_ibss_params {
u8 *ssid;
u8 *bssid;
struct ieee80211_channel *channel;
+ enum nl80211_channel_type channel_type;
u8 *ie;
u8 ssid_len, ie_len;
u16 beacon_interval;
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/agg-rx.c compat-wireless-2011-01-17/net/mac80211/agg-rx.c
--- compat-wireless-2011-01-17.orig//net/mac80211/agg-rx.c 2011-01-17 21:03:25.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/agg-rx.c 2011-01-18 15:47:56.000000000 +0100
@@ -160,6 +160,8 @@ static void ieee80211_send_addba_resp(st
memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
else if (sdata->vif.type == NL80211_IFTYPE_STATION)
memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+ else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+ memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_ACTION);
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/agg-tx.c compat-wireless-2011-01-17/net/mac80211/agg-tx.c
--- compat-wireless-2011-01-17.orig//net/mac80211/agg-tx.c 2011-01-17 21:03:25.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/agg-tx.c 2011-01-18 15:47:56.000000000 +0100
@@ -83,6 +83,8 @@ static void ieee80211_send_addba_request
memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
else if (sdata->vif.type == NL80211_IFTYPE_STATION)
memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+ else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+ memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_ACTION);
@@ -376,7 +378,8 @@ int ieee80211_start_tx_ba_session(struct
*/
if (sdata->vif.type != NL80211_IFTYPE_STATION &&
sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
- sdata->vif.type != NL80211_IFTYPE_AP)
+ sdata->vif.type != NL80211_IFTYPE_AP &&
+ sdata->vif.type != NL80211_IFTYPE_ADHOC)
return -EINVAL;
if (test_sta_flags(sta, WLAN_STA_BLOCK_BA)) {
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/ht.c compat-wireless-2011-01-17/net/mac80211/ht.c
--- compat-wireless-2011-01-17.orig//net/mac80211/ht.c 2011-01-17 21:03:25.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/ht.c 2011-01-18 15:47:56.000000000 +0100
@@ -179,6 +179,8 @@ void ieee80211_send_delba(struct ieee802
memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
else if (sdata->vif.type == NL80211_IFTYPE_STATION)
memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN);
+ else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+ memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN);
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_ACTION);
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/ibss.c compat-wireless-2011-01-17/net/mac80211/ibss.c
--- compat-wireless-2011-01-17.orig//net/mac80211/ibss.c 2011-01-17 21:03:25.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/ibss.c 2011-01-18 15:47:56.000000000 +0100
@@ -66,6 +66,7 @@ static void ieee80211_rx_mgmt_auth_ibss(
static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
const u8 *bssid, const int beacon_int,
struct ieee80211_channel *chan,
+ enum nl80211_channel_type channel_type,
const u32 basic_rates,
const u16 capability, u64 tsf)
{
@@ -107,7 +108,7 @@ static void __ieee80211_sta_join_ibss(st
sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
local->oper_channel = chan;
- WARN_ON(!ieee80211_set_channel_type(local, sdata, NL80211_CHAN_NO_HT));
+ WARN_ON(!ieee80211_set_channel_type(local, sdata, channel_type));
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
sband = local->hw.wiphy->bands[chan->band];
@@ -173,6 +174,64 @@ static void __ieee80211_sta_join_ibss(st
memcpy(skb_put(skb, ifibss->ie_len),
ifibss->ie, ifibss->ie_len);
+ if (channel_type != NL80211_CHAN_NO_HT && sband->ht_cap.ht_supported) {
+ u16 cap = sband->ht_cap.cap;
+ struct ieee80211_ht_cap *ht_cap;
+ struct ieee80211_ht_info *ht_info;
+
+ /* Build HT Capabilities */
+ if (ieee80211_disable_40mhz_24ghz &&
+ sband->band == IEEE80211_BAND_2GHZ) {
+ cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
+ cap &= ~IEEE80211_HT_CAP_SGI_40;
+ }
+
+ pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_cap));
+ *pos++ = WLAN_EID_HT_CAPABILITY;
+ *pos++ = sizeof(struct ieee80211_ht_cap);
+ ht_cap = (struct ieee80211_ht_cap *)pos;
+
+ ht_cap->cap_info = cpu_to_le16(cap);
+ ht_cap->ampdu_params_info = sband->ht_cap.ampdu_factor |
+ (sband->ht_cap.ampdu_density <<
+ IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
+ memcpy(&ht_cap->mcs, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
+ ht_cap->extended_ht_cap_info = 0x0000;
+ ht_cap->tx_BF_cap_info = 0x00000000;
+ ht_cap->antenna_selection_info = 0x00;
+
+ /* Build HT Information */
+ pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_info));
+ *pos++ = WLAN_EID_HT_INFORMATION;
+ *pos++ = sizeof(struct ieee80211_ht_info);
+ ht_info = (struct ieee80211_ht_info *)pos;
+
+ ht_info->control_chan =
+ ieee80211_frequency_to_channel(chan->center_freq);
+ ht_info->ht_param = 0x00;
+ switch (local->_oper_channel_type) {
+ case NL80211_CHAN_HT40MINUS:
+ ht_info->ht_param |= IEEE80211_HT_PARAM_CHA_SEC_BELOW;
+ break;
+ case NL80211_CHAN_HT40PLUS:
+ ht_info->ht_param |= IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
+ break;
+ case NL80211_CHAN_HT20:
+ default:
+ ht_info->ht_param |= IEEE80211_HT_PARAM_CHA_SEC_NONE;
+ break;
+ }
+ if (sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
+ ht_info->ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
+ ht_info->operation_mode = 0x0000; //<-- is this correct?
+ ht_info->stbc_param = 0x0000;
+
+ /* It seems that Basic MCS set and Supported MCS set
+ are identical for the first 10 bytes */
+ memset(&ht_info->basic_set, 0, 16);
+ memcpy(&ht_info->basic_set, &sband->ht_cap.mcs, 10);
+ }
+
if (local->hw.queues >= 4) {
pos = skb_put(skb, 9);
*pos++ = WLAN_EID_VENDOR_SPECIFIC;
@@ -221,6 +280,9 @@ static void ieee80211_sta_join_ibss(stru
u32 basic_rates;
int i, j;
u16 beacon_int = cbss->beacon_interval;
+ const u8 *ht_info_ie;
+ enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
+
lockdep_assert_held(&sdata->u.ibss.mtx);
@@ -244,9 +306,29 @@ static void ieee80211_sta_join_ibss(stru
}
}
+ /* parse HT Information IE, if present */
+ ht_info_ie = ieee80211_bss_get_ie(cbss, WLAN_EID_HT_INFORMATION);
+ if (ht_info_ie) {
+ const struct ieee80211_ht_info *ht_info =
+ (const struct ieee80211_ht_info *)(ht_info_ie + 2);
+
+ switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
+ case IEEE80211_HT_PARAM_CHA_SEC_NONE:
+ channel_type = NL80211_CHAN_HT20;
+ break;
+ case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
+ channel_type = NL80211_CHAN_HT40PLUS;
+ break;
+ case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
+ channel_type = NL80211_CHAN_HT40MINUS;
+ break;
+ }
+ }
+
__ieee80211_sta_join_ibss(sdata, cbss->bssid,
beacon_int,
cbss->channel,
+ channel_type,
basic_rates,
cbss->capability,
cbss->tsf);
@@ -310,7 +392,7 @@ static void ieee80211_rx_bss_info(struct
}
} else
sta = ieee80211_ibss_add_sta(sdata, mgmt->bssid,
- mgmt->sa, supp_rates,
+ mgmt->sa, supp_rates, elems->ht_cap_elem,
GFP_ATOMIC);
}
@@ -409,7 +491,7 @@ static void ieee80211_rx_bss_info(struct
ieee80211_sta_join_ibss(sdata, bss);
supp_rates = ieee80211_sta_get_rates(local, elems, band);
ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa,
- supp_rates, GFP_KERNEL);
+ supp_rates, elems->ht_cap_elem, GFP_KERNEL);
}
put_bss:
@@ -422,8 +504,8 @@ static void ieee80211_rx_bss_info(struct
* must be callable in atomic context.
*/
struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
- u8 *bssid,u8 *addr, u32 supp_rates,
- gfp_t gfp)
+ u8 *bssid, u8 *addr, u32 supp_rates,
+ struct ieee80211_ht_cap *ht_cap, gfp_t gfp)
{
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
struct ieee80211_local *local = sdata->local;
@@ -463,6 +545,10 @@ struct sta_info *ieee80211_ibss_add_sta(
sta->sta.supp_rates[band] = supp_rates |
ieee80211_mandatory_rates(local, band);
+ if (ht_cap)
+ ieee80211_ht_cap_ie_to_sta_ht_cap(local->hw.wiphy->bands[band],
+ ht_cap, &sta->sta.ht_cap);
+
rate_control_rate_init(sta);
/* If it fails, maybe we raced another insertion? */
@@ -565,7 +651,7 @@ static void ieee80211_sta_create_ibss(st
sdata->drop_unencrypted = 0;
__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
- ifibss->channel, ifibss->basic_rates,
+ ifibss->channel, ifibss->channel_type, ifibss->basic_rates,
capability, 0);
}
@@ -901,11 +987,16 @@ int ieee80211_ibss_join(struct ieee80211
struct sk_buff *skb;
skb = dev_alloc_skb(sdata->local->hw.extra_tx_headroom +
- 36 /* bitrates */ +
- 34 /* SSID */ +
- 3 /* DS params */ +
- 4 /* IBSS params */ +
- params->ie_len);
+ sizeof(struct ieee80211_hdr_3addr) +
+ 12 /* struct ieee80211_mgmt.u.beacon */ +
+ 2 + IEEE80211_MAX_SSID_LEN /* max SSID */ +
+ 2 + 8 /* max Supported Rates */ +
+ 3 /* max DS params */ +
+ 4 /* IBSS params */ +
+ 2 + (IEEE80211_MAX_SUPP_RATES - 8) /* max Ext Rates */ +
+ 2 + sizeof(struct ieee80211_ht_cap) +
+ 2 + sizeof(struct ieee80211_ht_info) +
+ params->ie_len);
if (!skb)
return -ENOMEM;
@@ -925,13 +1016,14 @@ int ieee80211_ibss_join(struct ieee80211
sdata->vif.bss_conf.beacon_int = params->beacon_interval;
sdata->u.ibss.channel = params->channel;
+ sdata->u.ibss.channel_type = params->channel_type;
sdata->u.ibss.fixed_channel = params->channel_fixed;
/* fix ourselves to that channel now already */
if (params->channel_fixed) {
sdata->local->oper_channel = params->channel;
WARN_ON(!ieee80211_set_channel_type(sdata->local, sdata,
- NL80211_CHAN_NO_HT));
+ params->channel_type));
}
if (params->ie) {
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/ieee80211_i.h compat-wireless-2011-01-17/net/mac80211/ieee80211_i.h
--- compat-wireless-2011-01-17.orig//net/mac80211/ieee80211_i.h 2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/ieee80211_i.h 2011-01-18 15:47:56.000000000 +0100
@@ -438,6 +438,7 @@ struct ieee80211_if_ibss {
u8 ssid_len, ie_len;
u8 *ie;
struct ieee80211_channel *channel;
+ enum nl80211_channel_type channel_type;
unsigned long ibss_join_req;
/* probe response/beacon for IBSS */
@@ -1110,7 +1111,7 @@ void ieee80211_ibss_notify_scan_complete
void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata);
struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
u8 *bssid, u8 *addr, u32 supp_rates,
- gfp_t gfp);
+ struct ieee80211_ht_cap *ht_cap, gfp_t gfp);
int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
struct cfg80211_ibss_params *params);
int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata);
diff -Nrup compat-wireless-2011-01-17.orig//net/mac80211/rx.c compat-wireless-2011-01-17/net/mac80211/rx.c
--- compat-wireless-2011-01-17.orig//net/mac80211/rx.c 2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/rx.c 2011-01-18 15:47:56.000000000 +0100
@@ -2063,7 +2063,8 @@ ieee80211_rx_h_action(struct ieee80211_r
*/
if (sdata->vif.type != NL80211_IFTYPE_STATION &&
sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
- sdata->vif.type != NL80211_IFTYPE_AP)
+ sdata->vif.type != NL80211_IFTYPE_AP &&
+ sdata->vif.type != NL80211_IFTYPE_ADHOC)
break;
/* verify action_code is present */
@@ -2618,7 +2619,7 @@ static int prepare_for_handlers(struct i
else
rate_idx = status->rate_idx;
rx->sta = ieee80211_ibss_add_sta(sdata, bssid,
- hdr->addr2, BIT(rate_idx), GFP_ATOMIC);
+ hdr->addr2, BIT(rate_idx), NULL, GFP_ATOMIC);
}
break;
case NL80211_IFTYPE_MESH_POINT:
diff -Nrup compat-wireless-2011-01-17.orig//net/wireless/nl80211.c compat-wireless-2011-01-17/net/wireless/nl80211.c
--- compat-wireless-2011-01-17.orig//net/wireless/nl80211.c 2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/net/wireless/nl80211.c 2011-01-18 15:47:56.000000000 +0100
@@ -3907,8 +3907,24 @@ static int nl80211_join_ibss(struct sk_b
ibss.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
}
- ibss.channel = ieee80211_get_channel(wiphy,
- nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
+ if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
+ enum nl80211_channel_type channel_type;
+
+ channel_type = nla_get_u32(
+ info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
+ if (channel_type != NL80211_CHAN_NO_HT &&
+ channel_type != NL80211_CHAN_HT20 &&
+ channel_type != NL80211_CHAN_HT40PLUS &&
+ channel_type != NL80211_CHAN_HT40MINUS)
+ return -EINVAL;
+ ibss.channel_type = channel_type;
+ } else {
+ ibss.channel_type = NL80211_CHAN_NO_HT;
+ }
+
+ ibss.channel = rdev_freq_to_chan(rdev,
+ nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]),
+ ibss.channel_type);
if (!ibss.channel ||
ibss.channel->flags & IEEE80211_CHAN_NO_IBSS ||
ibss.channel->flags & IEEE80211_CHAN_DISABLED)
^ permalink raw reply
* Re: [PATCH 5/8] ath5k: Add 802.11j 4.9GHz channels to allowed channels
From: Bruno Randolf @ 2011-01-19 11:52 UTC (permalink / raw)
To: Bob Copeland; +Cc: linville, linux-wireless
In-Reply-To: <AANLkTi=2crGZhucAhNHU-iaOkRamg33tQo_-K5h9d64v@mail.gmail.com>
On Wed January 19 2011 20:14:41 Bob Copeland wrote:
> On Wed, Jan 19, 2011 at 4:20 AM, Bruno Randolf <br1@einfach.org> wrote:
> > Add the 802.11j (20MHz channel width) channels to the allowed channels.
> > This still does not enable 802.11j in ath5k since these frequencies are
> > out of the configured range. A later patch will deal with that.
> >
> > Signed-off-by: Bruno Randolf <br1@einfach.org>
> > ---
> >
> > -static bool ath5k_is_standard_channel(short chan)
> > +static bool ath5k_is_standard_channel(short chan, enum ieee80211_band
> > band) {
> > - return ((chan <= 14) ||
> > - /* UNII 1,2 */
> > - ((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
> > + if (band == IEEE80211_BAND_2GHZ && chan <= 14)
> > + return true;
>
> This routine is only used to post-filter the channels so I don't
> think we need to check the band. It's mostly just to weed out all
> of the 10 mhz-spaced 5 ghz channels we used to export.
>
> > - ((chan & 3) == 1 && chan >= 149 && chan <= 165));
> > + ((chan & 3) == 1 && chan >= 149 && chan <= 165) ||
> > + /* 802.11j 5.030-5.080 GHz (20MHz) */
> > + (chan == 8 || chan == 12 || chan == 16) ||
>
> Ok I was also going to complain that some channel numbers < 14 were
> valid in the 5 ghz band but you know that :)
That's also the reason why we need to know the band:
in 2GHz all channels < 14 are allowed.
in 5GHz only a few.
Thanks for your review!
bruno
^ permalink raw reply
* [PATCH] mac80211: use DECLARE_EVENT_CLASS
From: Johannes Berg @ 2011-01-19 11:50 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless@vger.kernel.org
From: Johannes Berg <johannes.berg@intel.com>
For events that include only the local struct as
their parameter, we can use DECLARE_EVENT_CLASS
and save quite some binary size across segments
as well lines of code.
text data bss dec hex filename
375745 19296 916 395957 60ab5 mac80211.ko.before
367473 17888 916 386277 5e4e5 mac80211.ko.after
-8272 -1408 0 -9680 -25d0 delta
Some more tracepoints with identical arguments
could be combined like this but for now this is
the one that benefits most.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/driver-trace.h | 197 ++++++--------------------------------------
1 file changed, 28 insertions(+), 169 deletions(-)
--- wireless-testing.orig/net/mac80211/driver-trace.h 2011-01-19 12:46:39.000000000 +0100
+++ wireless-testing/net/mac80211/driver-trace.h 2011-01-19 12:47:23.000000000 +0100
@@ -38,7 +38,7 @@ static inline void trace_ ## name(proto)
* Tracing for driver callbacks.
*/
-TRACE_EVENT(drv_return_void,
+DECLARE_EVENT_CLASS(local_only_evt,
TP_PROTO(struct ieee80211_local *local),
TP_ARGS(local),
TP_STRUCT__entry(
@@ -50,6 +50,11 @@ TRACE_EVENT(drv_return_void,
TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
);
+DEFINE_EVENT(local_only_evt, drv_return_void,
+ TP_PROTO(struct ieee80211_local *local),
+ TP_ARGS(local)
+);
+
TRACE_EVENT(drv_return_int,
TP_PROTO(struct ieee80211_local *local, int ret),
TP_ARGS(local, ret),
@@ -78,40 +83,14 @@ TRACE_EVENT(drv_return_u64,
TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
);
-TRACE_EVENT(drv_start,
+DEFINE_EVENT(local_only_evt, drv_start,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT, LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
-TRACE_EVENT(drv_stop,
+DEFINE_EVENT(local_only_evt, drv_stop,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT, LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
TRACE_EVENT(drv_add_interface,
@@ -439,40 +418,14 @@ TRACE_EVENT(drv_hw_scan,
)
);
-TRACE_EVENT(drv_sw_scan_start,
+DEFINE_EVENT(local_only_evt, drv_sw_scan_start,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT, LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
-TRACE_EVENT(drv_sw_scan_complete,
+DEFINE_EVENT(local_only_evt, drv_sw_scan_complete,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT, LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
TRACE_EVENT(drv_get_stats,
@@ -702,23 +655,9 @@ TRACE_EVENT(drv_conf_tx,
)
);
-TRACE_EVENT(drv_get_tsf,
+DEFINE_EVENT(local_only_evt, drv_get_tsf,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT,
- LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
TRACE_EVENT(drv_set_tsf,
@@ -742,41 +681,14 @@ TRACE_EVENT(drv_set_tsf,
)
);
-TRACE_EVENT(drv_reset_tsf,
+DEFINE_EVENT(local_only_evt, drv_reset_tsf,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT, LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
-TRACE_EVENT(drv_tx_last_beacon,
+DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT,
- LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
TRACE_EVENT(drv_ampdu_action,
@@ -962,22 +874,9 @@ TRACE_EVENT(drv_remain_on_channel,
)
);
-TRACE_EVENT(drv_cancel_remain_on_channel,
+DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT, LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
/*
@@ -1072,23 +971,9 @@ TRACE_EVENT(api_stop_tx_ba_cb,
)
);
-TRACE_EVENT(api_restart_hw,
+DEFINE_EVENT(local_only_evt, api_restart_hw,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT,
- LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
TRACE_EVENT(api_beacon_loss,
@@ -1217,40 +1102,14 @@ TRACE_EVENT(api_chswitch_done,
)
);
-TRACE_EVENT(api_ready_on_channel,
+DEFINE_EVENT(local_only_evt, api_ready_on_channel,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT, LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
-TRACE_EVENT(api_remain_on_channel_expired,
+DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
TP_PROTO(struct ieee80211_local *local),
-
- TP_ARGS(local),
-
- TP_STRUCT__entry(
- LOCAL_ENTRY
- ),
-
- TP_fast_assign(
- LOCAL_ASSIGN;
- ),
-
- TP_printk(
- LOCAL_PR_FMT, LOCAL_PR_ARG
- )
+ TP_ARGS(local)
);
/*
^ permalink raw reply
* Re: [PATCH 2/8] ath5k: Simplify loop when setting up channels
From: Bruno Randolf @ 2011-01-19 11:51 UTC (permalink / raw)
To: Bob Copeland; +Cc: linville, linux-wireless
In-Reply-To: <AANLkTinNaMK_QUDVRxQ32XtKiQXmyDeuHGoCv2rWnW=e@mail.gmail.com>
On Wed January 19 2011 20:07:28 you wrote:
> On Wed, Jan 19, 2011 at 4:20 AM, Bruno Randolf <br1@einfach.org> wrote:
> > Simplify confusing code and get rid of an unnecessary variable.
> >
> > Signed-off-by: Bruno Randolf <br1@einfach.org>
> >
> >
> > @@ -285,8 +285,8 @@ ath5k_copy_channels(struct ath5k_hw *ah,
> > return 0;
> > }
> >
> > - for (i = 0, count = 0; i < size && max > 0; i++) {
> > - ch = i + 1 ;
> > + count = 0;
> > + for (ch = 1; ch < size && count <= max; ch++) {
>
> Should be <= size now, right? And maybe rename size to max_channel
> or something like that.
Oh, yeah. Will fix.
bruno
^ permalink raw reply
* Re: [PATCH 8/8] ath5k: Remove redundant sc->curband
From: Bob Copeland @ 2011-01-19 11:19 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092113.19628.33322.stgit@localhost6.localdomain6>
On Wed, Jan 19, 2011 at 4:21 AM, Bruno Randolf <br1@einfach.org> wrote:
> Remove sc->curband because the band is already stored in the current channel.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
Nice cleanup series!
Acked-by: Bob Copeland <me@bobcopeland.com>
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: [PATCH 7/8] ath5k: Remove unused sc->curmode
From: Bob Copeland @ 2011-01-19 11:17 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092108.19628.43971.stgit@localhost6.localdomain6>
On Wed, Jan 19, 2011 at 4:21 AM, Bruno Randolf <br1@einfach.org> wrote:
> sc->curmode is set but never used. Remove it and the helper function. Also the
> ath5k_rate_update which is refered to in the comment does not exist (any more?)
> so we don't need to setup the band in that place.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: [PATCH 6/8] ath5: Remove unused CTL definitions
From: Bob Copeland @ 2011-01-19 11:15 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092102.19628.68971.stgit@localhost6.localdomain6>
On Wed, Jan 19, 2011 at 4:21 AM, Bruno Randolf <br1@einfach.org> wrote:
> They are unused in ath5k and a more detailled definition is in
> ath/regd_common.h.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: [PATCH 5/8] ath5k: Add 802.11j 4.9GHz channels to allowed channels
From: Bob Copeland @ 2011-01-19 11:14 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092057.19628.9296.stgit@localhost6.localdomain6>
On Wed, Jan 19, 2011 at 4:20 AM, Bruno Randolf <br1@einfach.org> wrote:
> Add the 802.11j (20MHz channel width) channels to the allowed channels. This
> still does not enable 802.11j in ath5k since these frequencies are out of the
> configured range. A later patch will deal with that.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
> -static bool ath5k_is_standard_channel(short chan)
> +static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band)
> {
> - return ((chan <= 14) ||
> - /* UNII 1,2 */
> - ((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
> + if (band == IEEE80211_BAND_2GHZ && chan <= 14)
> + return true;
This routine is only used to post-filter the channels so I don't
think we need to check the band. It's mostly just to weed out all
of the 10 mhz-spaced 5 ghz channels we used to export.
> - ((chan & 3) == 1 && chan >= 149 && chan <= 165));
> + ((chan & 3) == 1 && chan >= 149 && chan <= 165) ||
> + /* 802.11j 5.030-5.080 GHz (20MHz) */
> + (chan == 8 || chan == 12 || chan == 16) ||
Ok I was also going to complain that some channel numbers < 14 were
valid in the 5 ghz band but you know that :)
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: [PATCH 4/8] ath5k: ath5k_setup_channels cleanup and whitespace
From: Bob Copeland @ 2011-01-19 11:09 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092052.19628.61933.stgit@localhost6.localdomain6>
On Wed, Jan 19, 2011 at 4:20 AM, Bruno Randolf <br1@einfach.org> wrote:
> Remove useless test_bit - it's not going to happen because of the way this
> function is called only when that bit is set.
>
> And fix some whitespace.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: [PATCH 3/8] ath5k: Rename ath5k_copy_channels
From: Bob Copeland @ 2011-01-19 11:08 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092047.19628.99228.stgit@localhost6.localdomain6>
On Wed, Jan 19, 2011 at 4:20 AM, Bruno Randolf <br1@einfach.org> wrote:
> Rename ath5k_copy_channels() to ath5k_setup_channels() - nothing is copied
> here.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
> drivers/net/wireless/ath/ath5k/base.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index 0387acb..9e8b1f4 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -256,7 +256,7 @@ static bool ath5k_is_standard_channel(short chan)
> }
>
> static unsigned int
> -ath5k_copy_channels(struct ath5k_hw *ah,
> +ath5k_setup_channels(struct ath5k_hw *ah,
> struct ieee80211_channel *channels,
> unsigned int mode,
> unsigned int max)
> @@ -356,7 +356,7 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
> sband->n_bitrates = 12;
>
> sband->channels = sc->channels;
> - sband->n_channels = ath5k_copy_channels(ah, sband->channels,
> + sband->n_channels = ath5k_setup_channels(ah, sband->channels,
> AR5K_MODE_11G, max_c);
>
> hw->wiphy->bands[IEEE80211_BAND_2GHZ] = sband;
> @@ -382,7 +382,7 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
> }
>
> sband->channels = sc->channels;
> - sband->n_channels = ath5k_copy_channels(ah, sband->channels,
> + sband->n_channels = ath5k_setup_channels(ah, sband->channels,
> AR5K_MODE_11B, max_c);
>
> hw->wiphy->bands[IEEE80211_BAND_2GHZ] = sband;
> @@ -402,7 +402,7 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
> sband->n_bitrates = 8;
>
> sband->channels = &sc->channels[count_c];
> - sband->n_channels = ath5k_copy_channels(ah, sband->channels,
> + sband->n_channels = ath5k_setup_channels(ah, sband->channels,
> AR5K_MODE_11A, max_c);
>
> hw->wiphy->bands[IEEE80211_BAND_5GHZ] = sband;
>
Acked-by: Bob Copeland <me@bobcopeland.com>
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: [PATCH 2/8] ath5k: Simplify loop when setting up channels
From: Bob Copeland @ 2011-01-19 11:07 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, linux-wireless
In-Reply-To: <20110119092042.19628.81667.stgit@localhost6.localdomain6>
On Wed, Jan 19, 2011 at 4:20 AM, Bruno Randolf <br1@einfach.org> wrote:
> Simplify confusing code and get rid of an unnecessary variable.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> @@ -285,8 +285,8 @@ ath5k_copy_channels(struct ath5k_hw *ah,
> return 0;
> }
>
> - for (i = 0, count = 0; i < size && max > 0; i++) {
> - ch = i + 1 ;
> + count = 0;
> + for (ch = 1; ch < size && count <= max; ch++) {
Should be <= size now, right? And maybe rename size to max_channel
or something like that.
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: [2.6.38-rc1] iwlagn lock misuse...
From: Daniel J Blueman @ 2011-01-19 10:11 UTC (permalink / raw)
To: Johannes Berg
Cc: Reinette Chatre, Wey-Yi Guy, Intel Linux Wireless, linux-wireless,
Linux Kernel
In-Reply-To: <1295430682.4685.1.camel@jlt3.sipsolutions.net>
Hi Johannes,
On 19 January 2011 16:51, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Wed, 2011-01-19 at 16:44 +0700, Daniel J Blueman wrote:
>> Booting an instrumented 2.6.38-rc1 kernel with an Intel WiFi Link 5300
>> card and associating with an access point, I see a lockdep warning
>> [attached].
>>
>> This is essentially (struct iwl_priv)->lock being taken with
>> interrupts disabled in iwl-agn-ict.c:152 [1] and the same lock taken
>> with interrupts enabled in rx.c:2476 [2] (confirmed via disassembly).
>>
>> It feels like this would have been introduced in this commit:
>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6e8cc38d5b05bb812f89a35bd9bf52405e67d0df
>
> I think you're running into a lockdep false positive, it's not actually
> the same lock and lockdep confuses a few skb queue locks. Please apply
> this patch
> http://git.kernel.org/?p=linux/kernel/git/linville/wireless-testing.git;a=commitdiff;h=53c16b8e752e8e58f4313f1155f3afadf78311bb
> and see if the problem persists.
Good move; it addresses the false-positive. I hope it can hit 2.6.38-rc2.
Thanks,
Daniel
--
Daniel J Blueman
^ permalink raw reply
* Re: [2.6.38-rc1] iwlagn lock misuse...
From: Johannes Berg @ 2011-01-19 9:51 UTC (permalink / raw)
To: Daniel J Blueman
Cc: Reinette Chatre, Wey-Yi Guy, Intel Linux Wireless, linux-wireless,
Linux Kernel
In-Reply-To: <AANLkTi=DLpfpLYAftktUKa5grNyTeT0-reyjEsrr-NwR@mail.gmail.com>
On Wed, 2011-01-19 at 16:44 +0700, Daniel J Blueman wrote:
> Booting an instrumented 2.6.38-rc1 kernel with an Intel WiFi Link 5300
> card and associating with an access point, I see a lockdep warning
> [attached].
>
> This is essentially (struct iwl_priv)->lock being taken with
> interrupts disabled in iwl-agn-ict.c:152 [1] and the same lock taken
> with interrupts enabled in rx.c:2476 [2] (confirmed via disassembly).
>
> It feels like this would have been introduced in this commit:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6e8cc38d5b05bb812f89a35bd9bf52405e67d0df
I think you're running into a lockdep false positive, it's not actually
the same lock and lockdep confuses a few skb queue locks. Please apply
this patch
http://git.kernel.org/?p=linux/kernel/git/linville/wireless-testing.git;a=commitdiff;h=53c16b8e752e8e58f4313f1155f3afadf78311bb
and see if the problem persists.
johannes
^ permalink raw reply
* [2.6.38-rc1] iwlagn lock misuse...
From: Daniel J Blueman @ 2011-01-19 9:44 UTC (permalink / raw)
To: Reinette Chatre, Wey-Yi Guy, Intel Linux Wireless
Cc: linux-wireless, Linux Kernel
[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]
Booting an instrumented 2.6.38-rc1 kernel with an Intel WiFi Link 5300
card and associating with an access point, I see a lockdep warning
[attached].
This is essentially (struct iwl_priv)->lock being taken with
interrupts disabled in iwl-agn-ict.c:152 [1] and the same lock taken
with interrupts enabled in rx.c:2476 [2] (confirmed via disassembly).
It feels like this would have been introduced in this commit:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6e8cc38d5b05bb812f89a35bd9bf52405e67d0df
Shall I raise a kernel.org bugzilla entry?
Thanks,
Daniel
--- [1] iwl-agn-ict.c:152
static irqreturn_t iwl_isr(int irq, void *data)
{
struct iwl_priv *priv = data;
u32 inta, inta_mask;
unsigned long flags;
#ifdef CONFIG_IWLWIFI_DEBUG
u32 inta_fh;
#endif
if (!priv)
return IRQ_NONE;
spin_lock_irqsave(&priv->lock, flags); <---
--- [2] rx.c:2476
static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx)
{
ieee80211_rx_result res = RX_DROP_MONITOR;
struct sk_buff *skb;
#define CALL_RXH(rxh) \
do { \
res = rxh(rx); \
if (res != RX_CONTINUE) \
goto rxh_next; \
} while (0);
spin_lock(&rx->local->rx_skb_queue.lock); <---
--
Daniel J Blueman
[-- Attachment #2: 2.6.38-rc1-iwlagn.txt --]
[-- Type: text/plain, Size: 32260 bytes --]
[ 32.034539] ======================================================
[ 32.034544] [ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ]
[ 32.034547] 2.6.38-rc1-340cd+ #3
[ 32.034549] ------------------------------------------------------
[ 32.034553] dbus-daemon/490 [HC0[0]:SC1[1]:HE0:SE0] is trying to acquire:
[ 32.034557] (&(&list->lock)->rlock#4){+.-...}, at: [<ffffffff81562a46>] skb_queue_tail+0x26/0x60
[ 32.034568]
[ 32.034569] and this task is already holding:
[ 32.034572] (&(&priv->sta_lock)->rlock){..-...}, at: [<ffffffffa01f4a3c>] iwlagn_rx_reply_tx+0x14c/0xc20 [iwlagn]
[ 32.034586] which would create a new lock dependency:
[ 32.034589] (&(&priv->sta_lock)->rlock){..-...} -> (&(&list->lock)->rlock#4){+.-...}
[ 32.034599]
[ 32.034599] but this new dependency connects a HARDIRQ-irq-safe lock:
[ 32.034602] (&(&priv->lock)->rlock){-.-...}
[ 32.034606] ... which became HARDIRQ-irq-safe at:
[ 32.034608] [<ffffffff810a7644>] __lock_acquire+0xc74/0x1d10
[ 32.034616] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.034621] [<ffffffff816d32eb>] _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.034628] [<ffffffffa02008ff>] iwl_isr_ict+0x4bf/0x1510 [iwlagn]
[ 32.034638] [<ffffffff810db4bd>] handle_IRQ_event+0x7d/0x350
[ 32.034645] [<ffffffff810ddf86>] handle_edge_irq+0xb6/0x160
[ 32.034650] [<ffffffff81006824>] handle_irq+0x44/0x90
[ 32.034656] [<ffffffff810058d8>] do_IRQ+0x58/0xd0
[ 32.034661] [<ffffffff816d4613>] ret_from_intr+0x0/0x1a
[ 32.034666] [<ffffffff8136a0a8>] __udelay+0x28/0x30
[ 32.034672] [<ffffffffa00180c1>] sclhi+0x71/0x90 [i2c_algo_bit]
[ 32.034679] [<ffffffffa0018548>] bit_xfer+0x198/0x4c0 [i2c_algo_bit]
[ 32.034684] [<ffffffff814d31c9>] i2c_transfer+0xc9/0x110
[ 32.034691] [<ffffffffa00a4cca>] drm_do_probe_ddc_edid+0x4a/0x60 [drm]
[ 32.034704] [<ffffffffa00a4f0c>] drm_get_edid+0x8c/0x240 [drm]
[ 32.034715] [<ffffffffa0267fad>] radeon_modeset_init+0x4cd/0x8f0 [radeon]
[ 32.034737] [<ffffffffa02414c8>] radeon_driver_load_kms+0x108/0x180 [radeon]
[ 32.034752] [<ffffffffa009c032>] drm_get_pci_dev+0x192/0x2b0 [drm]
[ 32.034764] [<ffffffffa02d5a91>] radeon_pci_probe+0xaa/0x619 [radeon]
[ 32.034782] [<ffffffff8138753a>] local_pci_probe+0x5a/0xd0
[ 32.034787] [<ffffffff813886e9>] pci_device_probe+0x109/0x110
[ 32.034793] [<ffffffff8140f5c6>] driver_probe_device+0x96/0x1c0
[ 32.034799] [<ffffffff8140f78b>] __driver_attach+0x9b/0xa0
[ 32.034804] [<ffffffff8140ec68>] bus_for_each_dev+0x68/0x90
[ 32.034809] [<ffffffff8140f3e9>] driver_attach+0x19/0x20
[ 32.034814] [<ffffffff8140e4d8>] bus_add_driver+0x1b8/0x280
[ 32.034819] [<ffffffff8140fa98>] driver_register+0x78/0x140
[ 32.034824] [<ffffffff81388941>] __pci_register_driver+0x61/0xe0
[ 32.034830] [<ffffffffa009c21f>] drm_pci_init+0xcf/0xe0 [drm]
[ 32.034842] [<ffffffffa0093763>] drm_init+0x53/0x70 [drm]
[ 32.034852] [<ffffffffa03180c4>] 0xffffffffa03180c4
[ 32.034857] [<ffffffff810001de>] do_one_initcall+0x3e/0x1a0
[ 32.034862] [<ffffffff810b7e12>] sys_init_module+0xf2/0x250
[ 32.034868] [<ffffffff81003192>] system_call_fastpath+0x16/0x1b
[ 32.034874]
[ 32.034874] to a HARDIRQ-irq-unsafe lock:
[ 32.034877] (&(&list->lock)->rlock#4){+.-...}
[ 32.034881] ... which became HARDIRQ-irq-unsafe at:
[ 32.034884] ... [<ffffffff810a74ed>] __lock_acquire+0xb1d/0x1d10
[ 32.034890] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.034896] [<ffffffff816d317b>] _raw_spin_lock+0x3b/0x70
[ 32.034901] [<ffffffffa0058686>] ieee80211_rx_handlers+0x36/0x1e80 [mac80211]
[ 32.034914] [<ffffffffa005a6e4>] ieee80211_prepare_and_rx_handle+0x214/0xa70 [mac80211]
[ 32.034926] [<ffffffffa005b3e7>] ieee80211_rx+0x3c7/0xbb0 [mac80211]
[ 32.034938] [<ffffffffa01eee68>] iwlagn_rx_reply_rx+0x428/0x670 [iwlagn]
[ 32.034948] [<ffffffffa01b9250>] iwl_rx_handle+0x160/0x710 [iwlagn]
[ 32.034956] [<ffffffffa01bb9e5>] iwl_irq_tasklet+0x525/0x1aa0 [iwlagn]
[ 32.034964] [<ffffffff8106e759>] tasklet_action+0x159/0x230
[ 32.034970] [<ffffffff8106f915>] __do_softirq+0xf5/0x420
[ 32.034975] [<ffffffff8100411c>] call_softirq+0x1c/0x30
[ 32.034980] [<ffffffff81006775>] do_softirq+0x85/0xf0
[ 32.034984] [<ffffffff8106f605>] irq_exit+0xa5/0xb0
[ 32.034989] [<ffffffff810058e1>] do_IRQ+0x61/0xd0
[ 32.034994] [<ffffffff816d4613>] ret_from_intr+0x0/0x1a
[ 32.034999]
[ 32.035000] other info that might help us debug this:
[ 32.035001]
[ 32.035004] 2 locks held by dbus-daemon/490:
[ 32.035006] #0: (&mm->mmap_sem){++++++}, at: [<ffffffff810334e3>] do_page_fault+0x113/0x510
[ 32.035016] #1: (&(&priv->sta_lock)->rlock){..-...}, at: [<ffffffffa01f4a3c>] iwlagn_rx_reply_tx+0x14c/0xc20 [iwlagn]
[ 32.035030]
[ 32.035031] the dependencies between HARDIRQ-irq-safe lock and the holding lock:
[ 32.035052] -> (&(&priv->lock)->rlock){-.-...} ops: 3571 {
[ 32.035060] IN-HARDIRQ-W at:
[ 32.035063] [<ffffffff810a7644>] __lock_acquire+0xc74/0x1d10
[ 32.035070] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.035075] [<ffffffff816d32eb>] _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.035082] [<ffffffffa02008ff>] iwl_isr_ict+0x4bf/0x1510 [iwlagn]
[ 32.035092] [<ffffffff810db4bd>] handle_IRQ_event+0x7d/0x350
[ 32.035099] [<ffffffff810ddf86>] handle_edge_irq+0xb6/0x160
[ 32.035104] [<ffffffff81006824>] handle_irq+0x44/0x90
[ 32.035110] [<ffffffff810058d8>] do_IRQ+0x58/0xd0
[ 32.035115] [<ffffffff816d4613>] ret_from_intr+0x0/0x1a
[ 32.035121] [<ffffffff8136a0a8>] __udelay+0x28/0x30
[ 32.035126] [<ffffffffa00180c1>] sclhi+0x71/0x90 [i2c_algo_bit]
[ 32.035133] [<ffffffffa0018548>] bit_xfer+0x198/0x4c0 [i2c_algo_bit]
[ 32.035139] [<ffffffff814d31c9>] i2c_transfer+0xc9/0x110
[ 32.035145] [<ffffffffa00a4cca>] drm_do_probe_ddc_edid+0x4a/0x60 [drm]
[ 32.035157] [<ffffffffa00a4f0c>] drm_get_edid+0x8c/0x240 [drm]
[ 32.035169] [<ffffffffa0267fad>] radeon_modeset_init+0x4cd/0x8f0 [radeon]
[ 32.035190] [<ffffffffa02414c8>] radeon_driver_load_kms+0x108/0x180 [radeon]
[ 32.035206] [<ffffffffa009c032>] drm_get_pci_dev+0x192/0x2b0 [drm]
[ 32.035219] [<ffffffffa02d5a91>] radeon_pci_probe+0xaa/0x619 [radeon]
[ 32.035237] [<ffffffff8138753a>] local_pci_probe+0x5a/0xd0
[ 32.035243] [<ffffffff813886e9>] pci_device_probe+0x109/0x110
[ 32.035249] [<ffffffff8140f5c6>] driver_probe_device+0x96/0x1c0
[ 32.035255] [<ffffffff8140f78b>] __driver_attach+0x9b/0xa0
[ 32.035261] [<ffffffff8140ec68>] bus_for_each_dev+0x68/0x90
[ 32.035267] [<ffffffff8140f3e9>] driver_attach+0x19/0x20
[ 32.035272] [<ffffffff8140e4d8>] bus_add_driver+0x1b8/0x280
[ 32.035278] [<ffffffff8140fa98>] driver_register+0x78/0x140
[ 32.035284] [<ffffffff81388941>] __pci_register_driver+0x61/0xe0
[ 32.035290] [<ffffffffa009c21f>] drm_pci_init+0xcf/0xe0 [drm]
[ 32.035303] [<ffffffffa0093763>] drm_init+0x53/0x70 [drm]
[ 32.035314] [<ffffffffa03180c4>] 0xffffffffa03180c4
[ 32.035319] [<ffffffff810001de>] do_one_initcall+0x3e/0x1a0
[ 32.035325] [<ffffffff810b7e12>] sys_init_module+0xf2/0x250
[ 32.035331] [<ffffffff81003192>] system_call_fastpath+0x16/0x1b
[ 32.035337] IN-SOFTIRQ-W at:
[ 32.035341] [<ffffffff810a74c8>] __lock_acquire+0xaf8/0x1d10
[ 32.035347] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.035353] [<ffffffff816d32eb>] _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.035359] [<ffffffffa01bb4e3>] iwl_irq_tasklet+0x23/0x1aa0 [iwlagn]
[ 32.035368] [<ffffffff8106e759>] tasklet_action+0x159/0x230
[ 32.035374] [<ffffffff8106f915>] __do_softirq+0xf5/0x420
[ 32.035380] [<ffffffff8100411c>] call_softirq+0x1c/0x30
[ 32.035385] [<ffffffff81006775>] do_softirq+0x85/0xf0
[ 32.035390] [<ffffffff8106f605>] irq_exit+0xa5/0xb0
[ 32.035396] [<ffffffff810058e1>] do_IRQ+0x61/0xd0
[ 32.035401] [<ffffffff816d4613>] ret_from_intr+0x0/0x1a
[ 32.035407] [<ffffffff8136a0a8>] __udelay+0x28/0x30
[ 32.035412] [<ffffffffa00180c1>] sclhi+0x71/0x90 [i2c_algo_bit]
[ 32.035419] [<ffffffffa0018548>] bit_xfer+0x198/0x4c0 [i2c_algo_bit]
[ 32.035425] [<ffffffff814d31c9>] i2c_transfer+0xc9/0x110
[ 32.035431] [<ffffffffa00a4cca>] drm_do_probe_ddc_edid+0x4a/0x60 [drm]
[ 32.035444] [<ffffffffa00a4f0c>] drm_get_edid+0x8c/0x240 [drm]
[ 32.035456] [<ffffffffa0267fad>] radeon_modeset_init+0x4cd/0x8f0 [radeon]
[ 32.035476] [<ffffffffa02414c8>] radeon_driver_load_kms+0x108/0x180 [radeon]
[ 32.035492] [<ffffffffa009c032>] drm_get_pci_dev+0x192/0x2b0 [drm]
[ 32.035505] [<ffffffffa02d5a91>] radeon_pci_probe+0xaa/0x619 [radeon]
[ 32.035523] [<ffffffff8138753a>] local_pci_probe+0x5a/0xd0
[ 32.035529] [<ffffffff813886e9>] pci_device_probe+0x109/0x110
[ 32.035535] [<ffffffff8140f5c6>] driver_probe_device+0x96/0x1c0
[ 32.035541] [<ffffffff8140f78b>] __driver_attach+0x9b/0xa0
[ 32.035547] [<ffffffff8140ec68>] bus_for_each_dev+0x68/0x90
[ 32.035553] [<ffffffff8140f3e9>] driver_attach+0x19/0x20
[ 32.035558] [<ffffffff8140e4d8>] bus_add_driver+0x1b8/0x280
[ 32.035564] [<ffffffff8140fa98>] driver_register+0x78/0x140
[ 32.035570] [<ffffffff81388941>] __pci_register_driver+0x61/0xe0
[ 32.035576] [<ffffffffa009c21f>] drm_pci_init+0xcf/0xe0 [drm]
[ 32.035589] [<ffffffffa0093763>] drm_init+0x53/0x70 [drm]
[ 32.035600] [<ffffffffa03180c4>] 0xffffffffa03180c4
[ 32.035605] [<ffffffff810001de>] do_one_initcall+0x3e/0x1a0
[ 32.035611] [<ffffffff810b7e12>] sys_init_module+0xf2/0x250
[ 32.035617] [<ffffffff81003192>] system_call_fastpath+0x16/0x1b
[ 32.035624] INITIAL USE at:
[ 32.035627] [<ffffffff810a6e3a>] __lock_acquire+0x46a/0x1d10
[ 32.035633] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.035639] [<ffffffff816d32eb>] _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.035645] [<ffffffffa01b37f9>] iwl_pci_probe+0xac9/0x1db0 [iwlagn]
[ 32.035654] [<ffffffff8138753a>] local_pci_probe+0x5a/0xd0
[ 32.035660] [<ffffffff813886e9>] pci_device_probe+0x109/0x110
[ 32.035665] [<ffffffff8140f5c6>] driver_probe_device+0x96/0x1c0
[ 32.035671] [<ffffffff8140f78b>] __driver_attach+0x9b/0xa0
[ 32.035677] [<ffffffff8140ec68>] bus_for_each_dev+0x68/0x90
[ 32.035683] [<ffffffff8140f3e9>] driver_attach+0x19/0x20
[ 32.035689] [<ffffffff8140e4d8>] bus_add_driver+0x1b8/0x280
[ 32.035695] [<ffffffff8140fa98>] driver_register+0x78/0x140
[ 32.035700] [<ffffffff81388941>] __pci_register_driver+0x61/0xe0
[ 32.035706] [<ffffffffa012b05c>] arc4_set_key+0x5c/0x90 [arc4]
[ 32.035712] [<ffffffff810001de>] do_one_initcall+0x3e/0x1a0
[ 32.035718] [<ffffffff810b7e12>] sys_init_module+0xf2/0x250
[ 32.035724] [<ffffffff81003192>] system_call_fastpath+0x16/0x1b
[ 32.035730] }
[ 32.035732] ... key at: [<ffffffffa021b25a>] __key.56621+0x0/0xfffffffffffecda6 [iwlagn]
[ 32.035741] ... acquired at:
[ 32.035743] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.035748] [<ffffffff816d317b>] _raw_spin_lock+0x3b/0x70
[ 32.035754] [<ffffffffa01e43d9>] iwlagn_tx_skb+0x199/0x1570 [iwlagn]
[ 32.035763] [<ffffffffa01b7845>] iwlagn_mac_tx+0x125/0x1c0 [iwlagn]
[ 32.035771] [<ffffffffa005c767>] __ieee80211_tx+0x147/0x230 [mac80211]
[ 32.035784] [<ffffffffa005def6>] ieee80211_tx+0x106/0x300 [mac80211]
[ 32.035796] [<ffffffffa005e1d2>] ieee80211_xmit+0xe2/0x2e0 [mac80211]
[ 32.035807] [<ffffffffa005e41f>] ieee80211_tx_skb+0x4f/0x60 [mac80211]
[ 32.035820] [<ffffffffa0062136>] ieee80211_send_auth+0x176/0x1f0 [mac80211]
[ 32.035832] [<ffffffffa004f6e3>] ieee80211_work_work+0xac3/0x1570 [mac80211]
[ 32.035843] [<ffffffff810888d8>] process_one_work+0x1c8/0x6b0
[ 32.035849] [<ffffffff810891bd>] worker_thread+0x15d/0x3c0
[ 32.035854] [<ffffffff8108d456>] kthread+0xb6/0xc0
[ 32.035859] [<ffffffff81004024>] kernel_thread_helper+0x4/0x10
[ 32.035864]
[ 32.035866] -> (&(&priv->sta_lock)->rlock){..-...} ops: 37 {
[ 32.035874] IN-SOFTIRQ-W at:
[ 32.035877] [<ffffffff810a74c8>] __lock_acquire+0xaf8/0x1d10
[ 32.035883] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.035889] [<ffffffff816d32eb>] _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.035895] [<ffffffffa01f4a3c>] iwlagn_rx_reply_tx+0x14c/0xc20 [iwlagn]
[ 32.035905] [<ffffffffa01b9250>] iwl_rx_handle+0x160/0x710 [iwlagn]
[ 32.035915] [<ffffffffa01bb9e5>] iwl_irq_tasklet+0x525/0x1aa0 [iwlagn]
[ 32.035923] [<ffffffff8106e759>] tasklet_action+0x159/0x230
[ 32.035929] [<ffffffff8106f915>] __do_softirq+0xf5/0x420
[ 32.035935] [<ffffffff8100411c>] call_softirq+0x1c/0x30
[ 32.035940] [<ffffffff81006775>] do_softirq+0x85/0xf0
[ 32.035945] [<ffffffff8106f605>] irq_exit+0xa5/0xb0
[ 32.035951] [<ffffffff810058e1>] do_IRQ+0x61/0xd0
[ 32.035956] [<ffffffff816d4613>] ret_from_intr+0x0/0x1a
[ 32.035962] [<ffffffff81371b0f>] __debug_check_no_obj_freed+0x16f/0x200
[ 32.035968] [<ffffffff81371bb5>] debug_check_no_obj_freed+0x15/0x20
[ 32.035973] [<ffffffff81111f44>] free_pages_prepare+0x114/0x230
[ 32.035980] [<ffffffff81112282>] free_hot_cold_page+0x42/0x220
[ 32.035986] [<ffffffff81112495>] __free_pages+0x35/0x40
[ 32.035991] [<ffffffff811317f7>] __pte_alloc+0x127/0x1c0
[ 32.035997] [<ffffffff811319d6>] handle_mm_fault+0x146/0x300
[ 32.036003] [<ffffffff81033551>] do_page_fault+0x181/0x510
[ 32.036008] [<ffffffff816d4915>] page_fault+0x25/0x30
[ 32.036014] INITIAL USE at:
[ 32.036018] [<ffffffff810a6e3a>] __lock_acquire+0x46a/0x1d10
[ 32.036024] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.036030] [<ffffffff816d32eb>] _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.036036] [<ffffffffa01fc361>] iwlagn_alloc_bcast_station+0x31/0x120 [iwlagn]
[ 32.036047] [<ffffffffa01b0188>] __iwl_up+0x8e8/0x14a0 [iwlagn]
[ 32.036055] [<ffffffffa01b7977>] iwlagn_mac_start+0x97/0x2b0 [iwlagn]
[ 32.036064] [<ffffffffa0051d34>] ieee80211_do_open+0x354/0x6b0 [mac80211]
[ 32.036077] [<ffffffffa00520eb>] ieee80211_open+0x5b/0x80 [mac80211]
[ 32.036089] [<ffffffff81572797>] __dev_open+0xb7/0x100
[ 32.036096] [<ffffffff8156e8bc>] __dev_change_flags+0x9c/0x180
[ 32.036102] [<ffffffff81572693>] dev_change_flags+0x23/0x70
[ 32.036108] [<ffffffff81580ca2>] do_setlink+0x1f2/0x8c0
[ 32.036113] [<ffffffff81581462>] rtnl_setlink+0xf2/0x140
[ 32.036119] [<ffffffff81581d57>] rtnetlink_rcv_msg+0x177/0x2a0
[ 32.036125] [<ffffffff81598d21>] netlink_rcv_skb+0xa1/0xd0
[ 32.036131] [<ffffffff81581bd0>] rtnetlink_rcv+0x20/0x30
[ 32.036137] [<ffffffff8159896a>] netlink_unicast+0x2ba/0x300
[ 32.036142] [<ffffffff81599344>] netlink_sendmsg+0x274/0x3f0
[ 32.036148] [<ffffffff81559824>] sock_sendmsg+0xe4/0x110
[ 32.036154] [<ffffffff8155a863>] sys_sendmsg+0x253/0x3b0
[ 32.036159] [<ffffffff81003192>] system_call_fastpath+0x16/0x1b
[ 32.036165] }
[ 32.036167] ... key at: [<ffffffffa021b282>] __key.56503+0x0/0xfffffffffffecd7e [iwlagn]
[ 32.036176] ... acquired at:
[ 32.036178] [<ffffffff810a52b0>] check_irq_usage+0x60/0xf0
[ 32.036184] [<ffffffff810a7b53>] __lock_acquire+0x1183/0x1d10
[ 32.036189] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.036194] [<ffffffff816d32eb>] _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.036200] [<ffffffff81562a46>] skb_queue_tail+0x26/0x60
[ 32.036204] [<ffffffffa00413d8>] ieee80211_tx_status_irqsafe+0x38/0xa0 [mac80211]
[ 32.036214] [<ffffffffa01d9278>] iwlagn_tx_queue_reclaim+0xc8/0x240 [iwlagn]
[ 32.036223] [<ffffffffa01f525e>] iwlagn_rx_reply_tx+0x96e/0xc20 [iwlagn]
[ 32.036233] [<ffffffffa01b9250>] iwl_rx_handle+0x160/0x710 [iwlagn]
[ 32.036242] [<ffffffffa01bb9e5>] iwl_irq_tasklet+0x525/0x1aa0 [iwlagn]
[ 32.036250] [<ffffffff8106e759>] tasklet_action+0x159/0x230
[ 32.036255] [<ffffffff8106f915>] __do_softirq+0xf5/0x420
[ 32.036261] [<ffffffff8100411c>] call_softirq+0x1c/0x30
[ 32.036265] [<ffffffff81006775>] do_softirq+0x85/0xf0
[ 32.036270] [<ffffffff8106f605>] irq_exit+0xa5/0xb0
[ 32.036275] [<ffffffff810058e1>] do_IRQ+0x61/0xd0
[ 32.036279] [<ffffffff816d4613>] ret_from_intr+0x0/0x1a
[ 32.036284] [<ffffffff81371b0f>] __debug_check_no_obj_freed+0x16f/0x200
[ 32.036289] [<ffffffff81371bb5>] debug_check_no_obj_freed+0x15/0x20
[ 32.036294] [<ffffffff81111f44>] free_pages_prepare+0x114/0x230
[ 32.036300] [<ffffffff81112282>] free_hot_cold_page+0x42/0x220
[ 32.036305] [<ffffffff81112495>] __free_pages+0x35/0x40
[ 32.036310] [<ffffffff811317f7>] __pte_alloc+0x127/0x1c0
[ 32.036315] [<ffffffff811319d6>] handle_mm_fault+0x146/0x300
[ 32.036320] [<ffffffff81033551>] do_page_fault+0x181/0x510
[ 32.036325] [<ffffffff816d4915>] page_fault+0x25/0x30
[ 32.036330]
[ 32.036332]
[ 32.036332] the dependencies between the lock to be acquired and HARDIRQ-irq-unsafe lock:
[ 32.036354] -> (&(&list->lock)->rlock#4){+.-...} ops: 2437 {
[ 32.036363] HARDIRQ-ON-W at:
[ 32.036366] [<ffffffff810a74ed>] __lock_acquire+0xb1d/0x1d10
[ 32.036372] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.036378] [<ffffffff816d317b>] _raw_spin_lock+0x3b/0x70
[ 32.036384] [<ffffffffa0058686>] ieee80211_rx_handlers+0x36/0x1e80 [mac80211]
[ 32.036397] [<ffffffffa005a6e4>] ieee80211_prepare_and_rx_handle+0x214/0xa70 [mac80211]
[ 32.036410] [<ffffffffa005b3e7>] ieee80211_rx+0x3c7/0xbb0 [mac80211]
[ 32.036422] [<ffffffffa01eee68>] iwlagn_rx_reply_rx+0x428/0x670 [iwlagn]
[ 32.036433] [<ffffffffa01b9250>] iwl_rx_handle+0x160/0x710 [iwlagn]
[ 32.036442] [<ffffffffa01bb9e5>] iwl_irq_tasklet+0x525/0x1aa0 [iwlagn]
[ 32.036451] [<ffffffff8106e759>] tasklet_action+0x159/0x230
[ 32.036457] [<ffffffff8106f915>] __do_softirq+0xf5/0x420
[ 32.036462] [<ffffffff8100411c>] call_softirq+0x1c/0x30
[ 32.036468] [<ffffffff81006775>] do_softirq+0x85/0xf0
[ 32.036473] [<ffffffff8106f605>] irq_exit+0xa5/0xb0
[ 32.036479] [<ffffffff810058e1>] do_IRQ+0x61/0xd0
[ 32.036484] [<ffffffff816d4613>] ret_from_intr+0x0/0x1a
[ 32.036490] IN-SOFTIRQ-W at:
[ 32.036493] [<ffffffff810a74c8>] __lock_acquire+0xaf8/0x1d10
[ 32.036499] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.036505] [<ffffffff816d32eb>] _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.036511] [<ffffffff81562a46>] skb_queue_tail+0x26/0x60
[ 32.036516] [<ffffffffa005a6dc>] ieee80211_prepare_and_rx_handle+0x20c/0xa70 [mac80211]
[ 32.036529] [<ffffffffa005b3e7>] ieee80211_rx+0x3c7/0xbb0 [mac80211]
[ 32.036542] [<ffffffffa01eee68>] iwlagn_rx_reply_rx+0x428/0x670 [iwlagn]
[ 32.036552] [<ffffffffa01b9250>] iwl_rx_handle+0x160/0x710 [iwlagn]
[ 32.036561] [<ffffffffa01bb9e5>] iwl_irq_tasklet+0x525/0x1aa0 [iwlagn]
[ 32.036570] [<ffffffff8106e759>] tasklet_action+0x159/0x230
[ 32.036576] [<ffffffff8106f915>] __do_softirq+0xf5/0x420
[ 32.036582] [<ffffffff8100411c>] call_softirq+0x1c/0x30
[ 32.036587] [<ffffffff81006775>] do_softirq+0x85/0xf0
[ 32.036593] [<ffffffff8106f605>] irq_exit+0xa5/0xb0
[ 32.036598] [<ffffffff810058e1>] do_IRQ+0x61/0xd0
[ 32.036603] [<ffffffff816d4613>] ret_from_intr+0x0/0x1a
[ 32.036609] INITIAL USE at:
[ 32.036613] [<ffffffff810a6e3a>] __lock_acquire+0x46a/0x1d10
[ 32.036619] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.036625] [<ffffffff816d32eb>] _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.036631] [<ffffffff81562a46>] skb_queue_tail+0x26/0x60
[ 32.036636] [<ffffffffa005a6dc>] ieee80211_prepare_and_rx_handle+0x20c/0xa70 [mac80211]
[ 32.036649] [<ffffffffa005b3e7>] ieee80211_rx+0x3c7/0xbb0 [mac80211]
[ 32.036661] [<ffffffffa01eee68>] iwlagn_rx_reply_rx+0x428/0x670 [iwlagn]
[ 32.036672] [<ffffffffa01b9250>] iwl_rx_handle+0x160/0x710 [iwlagn]
[ 32.036681] [<ffffffffa01bb9e5>] iwl_irq_tasklet+0x525/0x1aa0 [iwlagn]
[ 32.036690] [<ffffffff8106e759>] tasklet_action+0x159/0x230
[ 32.036696] [<ffffffff8106f915>] __do_softirq+0xf5/0x420
[ 32.036702] [<ffffffff8100411c>] call_softirq+0x1c/0x30
[ 32.036707] [<ffffffff81006775>] do_softirq+0x85/0xf0
[ 32.036712] [<ffffffff8106f605>] irq_exit+0xa5/0xb0
[ 32.036718] [<ffffffff810058e1>] do_IRQ+0x61/0xd0
[ 32.036723] [<ffffffff816d4613>] ret_from_intr+0x0/0x1a
[ 32.036729] }
[ 32.036731] ... key at: [<ffffffffa00706b2>] __key.26244+0x0/0xffffffffffffb94e [mac80211]
[ 32.036741] ... acquired at:
[ 32.036743] [<ffffffff810a52b0>] check_irq_usage+0x60/0xf0
[ 32.036748] [<ffffffff810a7b53>] __lock_acquire+0x1183/0x1d10
[ 32.036754] [<ffffffff810a87a6>] lock_acquire+0xc6/0x280
[ 32.036759] [<ffffffff816d32eb>] _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.036764] [<ffffffff81562a46>] skb_queue_tail+0x26/0x60
[ 32.036769] [<ffffffffa00413d8>] ieee80211_tx_status_irqsafe+0x38/0xa0 [mac80211]
[ 32.036778] [<ffffffffa01d9278>] iwlagn_tx_queue_reclaim+0xc8/0x240 [iwlagn]
[ 32.036788] [<ffffffffa01f525e>] iwlagn_rx_reply_tx+0x96e/0xc20 [iwlagn]
[ 32.036798] [<ffffffffa01b9250>] iwl_rx_handle+0x160/0x710 [iwlagn]
[ 32.036806] [<ffffffffa01bb9e5>] iwl_irq_tasklet+0x525/0x1aa0 [iwlagn]
[ 32.036815] [<ffffffff8106e759>] tasklet_action+0x159/0x230
[ 32.036820] [<ffffffff8106f915>] __do_softirq+0xf5/0x420
[ 32.036825] [<ffffffff8100411c>] call_softirq+0x1c/0x30
[ 32.036829] [<ffffffff81006775>] do_softirq+0x85/0xf0
[ 32.036834] [<ffffffff8106f605>] irq_exit+0xa5/0xb0
[ 32.036839] [<ffffffff810058e1>] do_IRQ+0x61/0xd0
[ 32.036844] [<ffffffff816d4613>] ret_from_intr+0x0/0x1a
[ 32.036849] [<ffffffff81371b0f>] __debug_check_no_obj_freed+0x16f/0x200
[ 32.036854] [<ffffffff81371bb5>] debug_check_no_obj_freed+0x15/0x20
[ 32.036859] [<ffffffff81111f44>] free_pages_prepare+0x114/0x230
[ 32.036864] [<ffffffff81112282>] free_hot_cold_page+0x42/0x220
[ 32.036869] [<ffffffff81112495>] __free_pages+0x35/0x40
[ 32.036875] [<ffffffff811317f7>] __pte_alloc+0x127/0x1c0
[ 32.036880] [<ffffffff811319d6>] handle_mm_fault+0x146/0x300
[ 32.036885] [<ffffffff81033551>] do_page_fault+0x181/0x510
[ 32.036889] [<ffffffff816d4915>] page_fault+0x25/0x30
[ 32.036895]
[ 32.036896]
[ 32.036897] stack backtrace:
[ 32.036901] Pid: 490, comm: dbus-daemon Not tainted 2.6.38-rc1-340cd+ #3
[ 32.036904] Call Trace:
[ 32.036907] <IRQ> [<ffffffff810a51a8>] ? check_usage+0x4c8/0x570
[ 32.036919] [<ffffffff810a52b0>] ? check_irq_usage+0x60/0xf0
[ 32.036924] [<ffffffff810a7b53>] ? __lock_acquire+0x1183/0x1d10
[ 32.036929] [<ffffffff8100bdfc>] ? native_sched_clock+0x2c/0x80
[ 32.036936] [<ffffffff810a87a6>] ? lock_acquire+0xc6/0x280
[ 32.036940] [<ffffffff81562a46>] ? skb_queue_tail+0x26/0x60
[ 32.036945] [<ffffffff8100bdfc>] ? native_sched_clock+0x2c/0x80
[ 32.036950] [<ffffffff816d32eb>] ? _raw_spin_lock_irqsave+0x6b/0xb0
[ 32.036955] [<ffffffff81562a46>] ? skb_queue_tail+0x26/0x60
[ 32.036959] [<ffffffff81562a46>] ? skb_queue_tail+0x26/0x60
[ 32.036968] [<ffffffffa00413d8>] ? ieee80211_tx_status_irqsafe+0x38/0xa0 [mac80211]
[ 32.036978] [<ffffffffa01d9278>] ? iwlagn_tx_queue_reclaim+0xc8/0x240 [iwlagn]
[ 32.036987] [<ffffffffa01d930e>] ? iwlagn_tx_queue_reclaim+0x15e/0x240 [iwlagn]
[ 32.036996] [<ffffffffa01f4a3c>] ? iwlagn_rx_reply_tx+0x14c/0xc20 [iwlagn]
[ 32.037006] [<ffffffffa01f525e>] ? iwlagn_rx_reply_tx+0x96e/0xc20 [iwlagn]
[ 32.037012] [<ffffffff8137fb69>] ? debug_dma_unmap_page+0x59/0x60
[ 32.037021] [<ffffffffa01b9250>] ? iwl_rx_handle+0x160/0x710 [iwlagn]
[ 32.037027] [<ffffffff810a41f7>] ? trace_hardirqs_on_caller+0x67/0x1b0
[ 32.037035] [<ffffffffa01bb9e5>] ? iwl_irq_tasklet+0x525/0x1aa0 [iwlagn]
[ 32.037041] [<ffffffff810a3f97>] ? mark_held_locks+0x67/0x90
[ 32.037046] [<ffffffff8106e665>] ? tasklet_action+0x65/0x230
[ 32.037051] [<ffffffff8106e759>] ? tasklet_action+0x159/0x230
[ 32.037056] [<ffffffff8106f915>] ? __do_softirq+0xf5/0x420
[ 32.037061] [<ffffffff8100411c>] ? call_softirq+0x1c/0x30
[ 32.037065] [<ffffffff81006775>] ? do_softirq+0x85/0xf0
[ 32.037070] [<ffffffff8106f605>] ? irq_exit+0xa5/0xb0
[ 32.037075] [<ffffffff810058e1>] ? do_IRQ+0x61/0xd0
[ 32.037080] [<ffffffff816d4613>] ? ret_from_intr+0x0/0x1a
[ 32.037083] <EOI> [<ffffffff816d3f74>] ? _raw_spin_unlock_irqrestore+0x84/0xa0
[ 32.037092] [<ffffffff81371b0f>] ? __debug_check_no_obj_freed+0x16f/0x200
[ 32.037098] [<ffffffff810a42ed>] ? trace_hardirqs_on_caller+0x15d/0x1b0
[ 32.037103] [<ffffffff810a434d>] ? trace_hardirqs_on+0xd/0x10
[ 32.037108] [<ffffffff81371bb5>] ? debug_check_no_obj_freed+0x15/0x20
[ 32.037113] [<ffffffff81111f44>] ? free_pages_prepare+0x114/0x230
[ 32.037118] [<ffffffff81112282>] ? free_hot_cold_page+0x42/0x220
[ 32.037124] [<ffffffff81055ce1>] ? get_parent_ip+0x11/0x50
[ 32.037130] [<ffffffff81112495>] ? __free_pages+0x35/0x40
[ 32.037134] [<ffffffff811317f7>] ? __pte_alloc+0x127/0x1c0
[ 32.037139] [<ffffffff811319d6>] ? handle_mm_fault+0x146/0x300
[ 32.037144] [<ffffffff81033551>] ? do_page_fault+0x181/0x510
[ 32.037150] [<ffffffff8116dfdf>] ? fget_light+0x1df/0x3c0
[ 32.037156] [<ffffffff816d2f28>] ? trace_hardirqs_off_thunk+0x3a/0x3c
[ 32.037161] [<ffffffff816d4915>] ? page_fault+0x25/0x30
^ permalink raw reply
* [PATCH] RFC: ath5k: Enable 802.11j 4.9GHz frequencies
From: Bruno Randolf @ 2011-01-19 9:22 UTC (permalink / raw)
To: linux-wireless; +Cc: bob, lrodriguez, bprodoehl, mickflemm
RFC:
This enables 4.9GHz frequencies in ath5k if the regdomain is set to MKK9_MKKC
(0xfe).
I have added a helper function to common ath/regd.c since we know about
MKK9_MKKC there, however in the place where i'm using the function we don't
have an ath_regulatory structure yet, so i'm passing the regdomain code as u16.
I'm using MKK9_MKKC only because this is the regdomain in the 802.11j enabled
sample cards we got from our vendor. I'm not sure if this is commonly used or
if there are other domain codes which indicate 802.11j support for Atheros
hardware (allthough some comments in the HAL suggest that). Also I don't know
if this is common between ath9k and ath5k.
Could someone from Atheros shed some light on this? Other comments?
---
drivers/net/wireless/ath/ath5k/caps.c | 13 ++++++++-----
drivers/net/wireless/ath/regd.c | 6 ++++++
drivers/net/wireless/ath/regd.h | 1 +
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/caps.c b/drivers/net/wireless/ath/ath5k/caps.c
index 31cad80..52fa808 100644
--- a/drivers/net/wireless/ath/ath5k/caps.c
+++ b/drivers/net/wireless/ath/ath5k/caps.c
@@ -56,9 +56,8 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
* XXX current ieee80211 implementation because the IEEE
* XXX channel mapping does not support negative channel
* XXX numbers (2312MHz is channel -19). Of course, this
- * XXX doesn't matter because these channels are out of range
- * XXX but some regulation domains like MKK (Japan) will
- * XXX support frequencies somewhere around 4.8GHz.
+ * XXX doesn't matter because these channels are out of the
+ * XXX legal range.
*/
/*
@@ -66,8 +65,12 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
*/
if (AR5K_EEPROM_HDR_11A(ee_header)) {
- /* 4920 */
- ah->ah_capabilities.cap_range.range_5ghz_min = 5005;
+ if (ath_is_11j_regd(
+ ah->ah_capabilities.cap_eeprom.ee_regdomain))
+ /* 802.11j enabled card */
+ ah->ah_capabilities.cap_range.range_5ghz_min = 4920; /* 4910? */
+ else
+ ah->ah_capabilities.cap_range.range_5ghz_min = 5005;
ah->ah_capabilities.cap_range.range_5ghz_max = 6100;
/* Set supported modes */
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 2b14775..8d60089 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -158,6 +158,12 @@ ieee80211_regdomain *ath_world_regdomain(struct ath_regulatory *reg)
}
}
+bool ath_is_11j_regd(u16 regdomain)
+{
+ return regdomain == MKK9_MKKC;
+}
+EXPORT_SYMBOL(ath_is_11j_regd);
+
/* Frequency is one where radar detection is required */
static bool ath_is_radar_freq(u16 center_freq)
{
diff --git a/drivers/net/wireless/ath/regd.h b/drivers/net/wireless/ath/regd.h
index 345dd97..18d9acb 100644
--- a/drivers/net/wireless/ath/regd.h
+++ b/drivers/net/wireless/ath/regd.h
@@ -250,6 +250,7 @@ enum CountryCode {
};
bool ath_is_world_regd(struct ath_regulatory *reg);
+bool ath_is_11j_regd(u16 redomain);
int ath_regd_init(struct ath_regulatory *reg, struct wiphy *wiphy,
int (*reg_notifier)(struct wiphy *wiphy,
struct regulatory_request *request));
^ permalink raw reply related
* [PATCH 8/8] ath5k: Remove redundant sc->curband
From: Bruno Randolf @ 2011-01-19 9:21 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
In-Reply-To: <20110119091949.19628.28309.stgit@localhost6.localdomain6>
Remove sc->curband because the band is already stored in the current channel.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/base.c | 11 ++++-------
drivers/net/wireless/ath/ath5k/base.h | 2 --
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index a00cc11..0e39ee8 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -551,7 +551,7 @@ ath5k_hw_to_driver_rix(struct ath5k_softc *sc, int hw_rix)
"hw_rix out of bounds: %x\n", hw_rix))
return 0;
- rix = sc->rate_idx[sc->curband->band][hw_rix];
+ rix = sc->rate_idx[sc->curchan->band][hw_rix];
if (WARN(rix < 0, "invalid hw_rix: %x\n", hw_rix))
rix = 0;
@@ -1361,7 +1361,7 @@ ath5k_receive_frame(struct ath5k_softc *sc, struct sk_buff *skb,
rxs->flag |= RX_FLAG_TSFT;
rxs->freq = sc->curchan->center_freq;
- rxs->band = sc->curband->band;
+ rxs->band = sc->curchan->band;
rxs->signal = sc->ah->ah_noise_floor + rs->rs_rssi;
@@ -1376,7 +1376,7 @@ ath5k_receive_frame(struct ath5k_softc *sc, struct sk_buff *skb,
rxs->flag |= ath5k_rx_decrypted(sc, skb, rs);
if (rxs->rate_idx >= 0 && rs->rs_rate ==
- sc->curband->bitrates[rxs->rate_idx].hw_value_short)
+ sc->sbands[sc->curchan->band].bitrates[rxs->rate_idx].hw_value_short)
rxs->flag |= RX_FLAG_SHORTPRE;
ath5k_debug_dump_skb(sc, skb, "RX ", 0);
@@ -2536,7 +2536,6 @@ ath5k_init_hw(struct ath5k_softc *sc)
* and then setup of the interrupt mask.
*/
sc->curchan = sc->hw->conf.channel;
- sc->curband = &sc->sbands[sc->curchan->band];
sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL |
AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL |
AR5K_INT_FATAL | AR5K_INT_GLOBAL | AR5K_INT_MIB;
@@ -2663,10 +2662,8 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
* so we should also free any remaining
* tx buffers */
ath5k_drain_tx_buffs(sc);
- if (chan) {
+ if (chan)
sc->curchan = chan;
- sc->curband = &sc->sbands[chan->band];
- }
ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, chan != NULL,
skip_pcu);
if (ret) {
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index 58660e4..8f919dc 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -183,8 +183,6 @@ struct ath5k_softc {
enum nl80211_iftype opmode;
struct ath5k_hw *ah; /* Atheros HW */
- struct ieee80211_supported_band *curband;
-
#ifdef CONFIG_ATH5K_DEBUG
struct ath5k_dbg_info debug; /* debug info */
#endif /* CONFIG_ATH5K_DEBUG */
^ permalink raw reply related
* [PATCH 7/8] ath5k: Remove unused sc->curmode
From: Bruno Randolf @ 2011-01-19 9:21 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
In-Reply-To: <20110119091949.19628.28309.stgit@localhost6.localdomain6>
sc->curmode is set but never used. Remove it and the helper function. Also the
ath5k_rate_update which is refered to in the comment does not exist (any more?)
so we don't need to setup the band in that place.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/base.c | 18 ------------------
drivers/net/wireless/ath/ath5k/base.h | 1 -
2 files changed, 0 insertions(+), 19 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 6900543..a00cc11 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -439,18 +439,6 @@ ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan)
return ath5k_reset(sc, chan, true);
}
-static void
-ath5k_setcurmode(struct ath5k_softc *sc, unsigned int mode)
-{
- sc->curmode = mode;
-
- if (mode == AR5K_MODE_11A) {
- sc->curband = &sc->sbands[IEEE80211_BAND_5GHZ];
- } else {
- sc->curband = &sc->sbands[IEEE80211_BAND_2GHZ];
- }
-}
-
struct ath_vif_iter_data {
const u8 *hw_macaddr;
u8 mask[ETH_ALEN];
@@ -2776,12 +2764,6 @@ ath5k_init(struct ieee80211_hw *hw)
goto err;
}
- /* NB: setup here so ath5k_rate_update is happy */
- if (test_bit(AR5K_MODE_11A, ah->ah_modes))
- ath5k_setcurmode(sc, AR5K_MODE_11A);
- else
- ath5k_setcurmode(sc, AR5K_MODE_11B);
-
/*
* Allocate tx+rx descriptors and populate the lists.
*/
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index 6d51147..58660e4 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -202,7 +202,6 @@ struct ath5k_softc {
#define ATH_STAT_STARTED 4 /* opened & irqs enabled */
unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */
- unsigned int curmode; /* current phy mode */
struct ieee80211_channel *curchan; /* current h/w channel */
u16 nvifs;
^ permalink raw reply related
* [PATCH 6/8] ath5: Remove unused CTL definitions
From: Bruno Randolf @ 2011-01-19 9:21 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
In-Reply-To: <20110119091949.19628.28309.stgit@localhost6.localdomain6>
They are unused in ath5k and a more detailled definition is in
ath/regd_common.h.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/eeprom.h | 23 -----------------------
1 files changed, 0 insertions(+), 23 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.h b/drivers/net/wireless/ath/ath5k/eeprom.h
index d46f105..6511c27 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.h
+++ b/drivers/net/wireless/ath/ath5k/eeprom.h
@@ -268,29 +268,6 @@ enum ath5k_ctl_mode {
AR5K_CTL_MODE_M = 15,
};
-/* Default CTL ids for the 3 main reg domains.
- * Atheros only uses these by default but vendors
- * can have up to 32 different CTLs for different
- * scenarios. Note that theese values are ORed with
- * the mode id (above) so we can have up to 24 CTL
- * datasets out of these 3 main regdomains. That leaves
- * 8 ids that can be used by vendors and since 0x20 is
- * missing from HAL sources i guess this is the set of
- * custom CTLs vendors can use. */
-#define AR5K_CTL_FCC 0x10
-#define AR5K_CTL_CUSTOM 0x20
-#define AR5K_CTL_ETSI 0x30
-#define AR5K_CTL_MKK 0x40
-
-/* Indicates a CTL with only mode set and
- * no reg domain mapping, such CTLs are used
- * for world roaming domains or simply when
- * a reg domain is not set */
-#define AR5K_CTL_NO_REGDOMAIN 0xf0
-
-/* Indicates an empty (invalid) CTL */
-#define AR5K_CTL_NO_CTL 0xff
-
/* Per channel calibration data, used for power table setup */
struct ath5k_chan_pcal_info_rf5111 {
/* Power levels in half dbm units
^ permalink raw reply related
* [PATCH 5/8] ath5k: Add 802.11j 4.9GHz channels to allowed channels
From: Bruno Randolf @ 2011-01-19 9:20 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
In-Reply-To: <20110119091949.19628.28309.stgit@localhost6.localdomain6>
Add the 802.11j (20MHz channel width) channels to the allowed channels. This
still does not enable 802.11j in ath5k since these frequencies are out of the
configured range. A later patch will deal with that.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/base.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index a28ad58..6900543 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -244,15 +244,21 @@ static int ath5k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *re
/*
* Returns true for the channel numbers used without all_channels modparam.
*/
-static bool ath5k_is_standard_channel(short chan)
+static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band)
{
- return ((chan <= 14) ||
- /* UNII 1,2 */
- ((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
+ if (band == IEEE80211_BAND_2GHZ && chan <= 14)
+ return true;
+
+ return /* UNII 1,2 */
+ (((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
/* midband */
((chan & 3) == 0 && chan >= 100 && chan <= 140) ||
/* UNII-3 */
- ((chan & 3) == 1 && chan >= 149 && chan <= 165));
+ ((chan & 3) == 1 && chan >= 149 && chan <= 165) ||
+ /* 802.11j 5.030-5.080 GHz (20MHz) */
+ (chan == 8 || chan == 12 || chan == 16) ||
+ /* 802.11j 4.9GHz (20MHz) */
+ (chan == 184 || chan == 188 || chan == 192 || chan == 196));
}
static unsigned int
@@ -291,7 +297,8 @@ ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
if (!ath5k_channel_ok(ah, freq, chfreq))
continue;
- if (!modparam_all_channels && !ath5k_is_standard_channel(ch))
+ if (!modparam_all_channels &&
+ !ath5k_is_standard_channel(ch, band))
continue;
/* Write channel info and increment counter */
^ permalink raw reply related
* [PATCH 4/8] ath5k: ath5k_setup_channels cleanup and whitespace
From: Bruno Randolf @ 2011-01-19 9:20 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
In-Reply-To: <20110119091949.19628.28309.stgit@localhost6.localdomain6>
Remove useless test_bit - it's not going to happen because of the way this
function is called only when that bit is set.
And fix some whitespace.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/base.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 9e8b1f4..a28ad58 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -256,21 +256,16 @@ static bool ath5k_is_standard_channel(short chan)
}
static unsigned int
-ath5k_setup_channels(struct ath5k_hw *ah,
- struct ieee80211_channel *channels,
- unsigned int mode,
- unsigned int max)
+ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
+ unsigned int mode, unsigned int max)
{
unsigned int count, size, chfreq, freq, ch;
enum ieee80211_band band;
- if (!test_bit(mode, ah->ah_modes))
- return 0;
-
switch (mode) {
case AR5K_MODE_11A:
/* 1..220, but 2GHz frequencies are filtered by check_channel */
- size = 220 ;
+ size = 220;
chfreq = CHANNEL_5GHZ;
band = IEEE80211_BAND_5GHZ;
break;
^ permalink raw reply related
* [PATCH 3/8] ath5k: Rename ath5k_copy_channels
From: Bruno Randolf @ 2011-01-19 9:20 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
In-Reply-To: <20110119091949.19628.28309.stgit@localhost6.localdomain6>
Rename ath5k_copy_channels() to ath5k_setup_channels() - nothing is copied
here.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/base.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 0387acb..9e8b1f4 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -256,7 +256,7 @@ static bool ath5k_is_standard_channel(short chan)
}
static unsigned int
-ath5k_copy_channels(struct ath5k_hw *ah,
+ath5k_setup_channels(struct ath5k_hw *ah,
struct ieee80211_channel *channels,
unsigned int mode,
unsigned int max)
@@ -356,7 +356,7 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
sband->n_bitrates = 12;
sband->channels = sc->channels;
- sband->n_channels = ath5k_copy_channels(ah, sband->channels,
+ sband->n_channels = ath5k_setup_channels(ah, sband->channels,
AR5K_MODE_11G, max_c);
hw->wiphy->bands[IEEE80211_BAND_2GHZ] = sband;
@@ -382,7 +382,7 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
}
sband->channels = sc->channels;
- sband->n_channels = ath5k_copy_channels(ah, sband->channels,
+ sband->n_channels = ath5k_setup_channels(ah, sband->channels,
AR5K_MODE_11B, max_c);
hw->wiphy->bands[IEEE80211_BAND_2GHZ] = sband;
@@ -402,7 +402,7 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
sband->n_bitrates = 8;
sband->channels = &sc->channels[count_c];
- sband->n_channels = ath5k_copy_channels(ah, sband->channels,
+ sband->n_channels = ath5k_setup_channels(ah, sband->channels,
AR5K_MODE_11A, max_c);
hw->wiphy->bands[IEEE80211_BAND_5GHZ] = sband;
^ permalink raw reply related
* [PATCH 2/8] ath5k: Simplify loop when setting up channels
From: Bruno Randolf @ 2011-01-19 9:20 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
In-Reply-To: <20110119091949.19628.28309.stgit@localhost6.localdomain6>
Simplify confusing code and get rid of an unnecessary variable.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/base.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 6850112..0387acb 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -261,7 +261,7 @@ ath5k_copy_channels(struct ath5k_hw *ah,
unsigned int mode,
unsigned int max)
{
- unsigned int i, count, size, chfreq, freq, ch;
+ unsigned int count, size, chfreq, freq, ch;
enum ieee80211_band band;
if (!test_bit(mode, ah->ah_modes))
@@ -285,8 +285,8 @@ ath5k_copy_channels(struct ath5k_hw *ah,
return 0;
}
- for (i = 0, count = 0; i < size && max > 0; i++) {
- ch = i + 1 ;
+ count = 0;
+ for (ch = 1; ch < size && count <= max; ch++) {
freq = ieee80211_channel_to_frequency(ch, band);
if (freq == 0) /* mapping failed - not a standard channel */
@@ -312,7 +312,6 @@ ath5k_copy_channels(struct ath5k_hw *ah,
}
count++;
- max--;
}
return count;
^ permalink raw reply related
* [PATCH 1/8] ath5k: Use mac80211 channel mapping function
From: Bruno Randolf @ 2011-01-19 9:20 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
In-Reply-To: <20110119091949.19628.28309.stgit@localhost6.localdomain6>
Use mac80211 channel mapping function instead of own homegrown version.
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
drivers/net/wireless/ath/ath5k/base.c | 23 ++++++++---------------
1 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 09ae4ef..6850112 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -242,18 +242,6 @@ static int ath5k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *re
\********************/
/*
- * Convert IEEE channel number to MHz frequency.
- */
-static inline short
-ath5k_ieee2mhz(short chan)
-{
- if (chan <= 14 || chan >= 27)
- return ieee80211chan2mhz(chan);
- else
- return 2212 + chan * 20;
-}
-
-/*
* Returns true for the channel numbers used without all_channels modparam.
*/
static bool ath5k_is_standard_channel(short chan)
@@ -274,6 +262,7 @@ ath5k_copy_channels(struct ath5k_hw *ah,
unsigned int max)
{
unsigned int i, count, size, chfreq, freq, ch;
+ enum ieee80211_band band;
if (!test_bit(mode, ah->ah_modes))
return 0;
@@ -283,11 +272,13 @@ ath5k_copy_channels(struct ath5k_hw *ah,
/* 1..220, but 2GHz frequencies are filtered by check_channel */
size = 220 ;
chfreq = CHANNEL_5GHZ;
+ band = IEEE80211_BAND_5GHZ;
break;
case AR5K_MODE_11B:
case AR5K_MODE_11G:
size = 26;
chfreq = CHANNEL_2GHZ;
+ band = IEEE80211_BAND_2GHZ;
break;
default:
ATH5K_WARN(ah->ah_sc, "bad mode, not copying channels\n");
@@ -296,7 +287,10 @@ ath5k_copy_channels(struct ath5k_hw *ah,
for (i = 0, count = 0; i < size && max > 0; i++) {
ch = i + 1 ;
- freq = ath5k_ieee2mhz(ch);
+ freq = ieee80211_channel_to_frequency(ch, band);
+
+ if (freq == 0) /* mapping failed - not a standard channel */
+ continue;
/* Check if channel is supported by the chipset */
if (!ath5k_channel_ok(ah, freq, chfreq))
@@ -307,8 +301,7 @@ ath5k_copy_channels(struct ath5k_hw *ah,
/* Write channel info and increment counter */
channels[count].center_freq = freq;
- channels[count].band = (chfreq == CHANNEL_2GHZ) ?
- IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
+ channels[count].band = band;
switch (mode) {
case AR5K_MODE_11A:
case AR5K_MODE_11G:
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox