* [PATCH 0/3] small mac80211 updates
@ 2008-09-08 9:05 Johannes Berg
2008-09-08 9:05 ` [PATCH 1/3] mac80211: move some RCU locking into an if branch Johannes Berg
` (5 more replies)
0 siblings, 6 replies; 9+ messages in thread
From: Johannes Berg @ 2008-09-08 9:05 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
Hi,
This contains just patches I've previously sent, but possibly
slightly modified (I've forgotten). Can you please ignore all
patches I sent on the weekend and apply these instead? I have
already rebased my other patches to apply after the ones from
Tomas that do the disassociation fixes.
I'm resending these mostly to make it easier for you to drop
the ones I don't want applied right now.
johannes
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] mac80211: move some RCU locking into an if branch
2008-09-08 9:05 [PATCH 0/3] small mac80211 updates Johannes Berg
@ 2008-09-08 9:05 ` Johannes Berg
2008-09-08 9:05 ` [PATCH 2/3] mac80211: make conf_tx non-atomic Johannes Berg
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2008-09-08 9:05 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
The if itself doesn't need to be protected, so move in the RCU
locking to avoid doing anything at all when the condition isn't
true.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/mlme.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
--- everything.orig/net/mac80211/mlme.c 2008-09-08 10:20:25.000000000 +0200
+++ everything/net/mac80211/mlme.c 2008-09-08 10:21:09.000000000 +0200
@@ -2613,13 +2613,12 @@ static void ieee80211_rx_bss_info(struct
mesh_peer_accepts_plinks(elems));
}
- rcu_read_lock();
-
if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && elems->supp_rates &&
memcmp(mgmt->bssid, sdata->u.sta.bssid, ETH_ALEN) == 0) {
-
supp_rates = ieee80211_sta_get_rates(local, elems, band);
+ rcu_read_lock();
+
sta = sta_info_get(local, mgmt->sa);
if (sta) {
u64 prev_rates;
@@ -2643,9 +2642,9 @@ static void ieee80211_rx_bss_info(struct
ieee80211_ibss_add_sta(sdata, NULL, mgmt->bssid,
mgmt->sa, supp_rates);
}
- }
- rcu_read_unlock();
+ rcu_read_unlock();
+ }
if (elems->ds_params && elems->ds_params_len == 1)
freq = ieee80211_channel_to_frequency(elems->ds_params[0]);
--
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] mac80211: make conf_tx non-atomic
2008-09-08 9:05 [PATCH 0/3] small mac80211 updates Johannes Berg
2008-09-08 9:05 ` [PATCH 1/3] mac80211: move some RCU locking into an if branch Johannes Berg
@ 2008-09-08 9:05 ` Johannes Berg
2008-09-08 9:05 ` [PATCH 3/3] mac80211: BSS info: check channel first Johannes Berg
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2008-09-08 9:05 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
The conf_tx callback currently needs to be atomic, this requirement
is just because it can be called from scanning. This rearranges it
slightly to only update while not scanning (which is fine, we'll be
getting beacons when associated) and thus removes the atomic
requirement.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/mac80211.h | 2 +-
net/mac80211/mlme.c | 13 ++++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)
--- everything.orig/include/net/mac80211.h 2008-09-08 10:20:24.000000000 +0200
+++ everything/include/net/mac80211.h 2008-09-08 10:21:17.000000000 +0200
@@ -1142,7 +1142,7 @@ enum ieee80211_ampdu_mlme_action {
* of assocaited station or AP.
*
* @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
- * bursting) for a hardware TX queue. Must be atomic.
+ * bursting) for a hardware TX queue.
*
* @get_tx_stats: Get statistics of the current TX queue status. This is used
* to get number of currently queued packets (queue length), maximum queue
--- everything.orig/net/mac80211/mlme.c 2008-09-08 10:21:09.000000000 +0200
+++ everything/net/mac80211/mlme.c 2008-09-08 10:21:17.000000000 +0200
@@ -2873,15 +2873,18 @@ static void ieee80211_rx_mgmt_beacon(str
memcmp(ifsta->bssid, mgmt->bssid, ETH_ALEN) != 0)
return;
- ieee80211_sta_wmm_params(local, ifsta, elems.wmm_param,
- elems.wmm_param_len);
-
/* Do not send changes to driver if we are scanning. This removes
- * requirement that driver's bss_info_changed function needs to be
- * atomic. */
+ * requirement that a driver's bss_info_changed/conf_tx functions
+ * need to be atomic.
+ * This is really ugly code, we should rewrite scanning and make
+ * all this more understandable for humans.
+ */
if (local->sta_sw_scanning || local->sta_hw_scanning)
return;
+ ieee80211_sta_wmm_params(local, ifsta, elems.wmm_param,
+ elems.wmm_param_len);
+
if (elems.erp_info && elems.erp_info_len >= 1)
changed |= ieee80211_handle_erp_ie(sdata, elems.erp_info[0]);
else {
--
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/3] mac80211: BSS info: check channel first
2008-09-08 9:05 [PATCH 0/3] small mac80211 updates Johannes Berg
2008-09-08 9:05 ` [PATCH 1/3] mac80211: move some RCU locking into an if branch Johannes Berg
2008-09-08 9:05 ` [PATCH 2/3] mac80211: make conf_tx non-atomic Johannes Berg
@ 2008-09-08 9:05 ` Johannes Berg
2008-09-08 13:41 ` [PATCH 4/3] mac80211: fix action frame length checks Johannes Berg
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2008-09-08 9:05 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
When we receive information about a BSS we check at some point
whether or not we think we're allowed to use the channel it is
on, but we do that fairly late. I don't think we should do it
that late, so do it earlier to avoid doing IBSS/mesh stuff on
that channel and then getting confused because it's disabled.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/mlme.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
--- everything.orig/net/mac80211/mlme.c 2008-09-08 10:21:17.000000000 +0200
+++ everything/net/mac80211/mlme.c 2008-09-08 10:21:25.000000000 +0200
@@ -2603,7 +2603,15 @@ static void ieee80211_rx_bss_info(struct
DECLARE_MAC_BUF(mac);
DECLARE_MAC_BUF(mac2);
- beacon_timestamp = le64_to_cpu(mgmt->u.beacon.timestamp);
+ if (elems->ds_params && elems->ds_params_len == 1)
+ freq = ieee80211_channel_to_frequency(elems->ds_params[0]);
+ else
+ freq = rx_status->freq;
+
+ channel = ieee80211_get_channel(local->hw.wiphy, freq);
+
+ if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
+ return;
if (ieee80211_vif_is_mesh(&sdata->vif) && elems->mesh_id &&
elems->mesh_config && mesh_matches_local(elems, sdata)) {
@@ -2646,16 +2654,6 @@ static void ieee80211_rx_bss_info(struct
rcu_read_unlock();
}
- if (elems->ds_params && elems->ds_params_len == 1)
- freq = ieee80211_channel_to_frequency(elems->ds_params[0]);
- else
- freq = rx_status->freq;
-
- channel = ieee80211_get_channel(local->hw.wiphy, freq);
-
- if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
- return;
-
#ifdef CONFIG_MAC80211_MESH
if (elems->mesh_config)
bss = ieee80211_rx_mesh_bss_get(local, elems->mesh_id,
@@ -2724,6 +2722,8 @@ static void ieee80211_rx_bss_info(struct
bss->band = band;
+ beacon_timestamp = le64_to_cpu(mgmt->u.beacon.timestamp);
+
bss->timestamp = beacon_timestamp;
bss->last_update = jiffies;
bss->signal = rx_status->signal;
--
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 4/3] mac80211: fix action frame length checks
2008-09-08 9:05 [PATCH 0/3] small mac80211 updates Johannes Berg
` (2 preceding siblings ...)
2008-09-08 9:05 ` [PATCH 3/3] mac80211: BSS info: check channel first Johannes Berg
@ 2008-09-08 13:41 ` Johannes Berg
2008-09-08 14:31 ` [PATCH 5/3] mac80211: fix typo in action frame handling Johannes Berg
2008-09-08 14:40 ` [PATCH 6/3] mac80211: move IE parsing to util file Johannes Berg
5 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2008-09-08 13:41 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, Tomas Winkler, Luis Carlos Cobo
The action frame length checks are one too small, there's not just
an action code as the comment makes you believe, there's a category
code too, and the category code is required in each action frame
(hence part of IEEE80211_MIN_ACTION_SIZE).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/mesh_hwmp.c | 4 ++++
net/mac80211/mesh_plink.c | 4 ++++
net/mac80211/mlme.c | 5 +++--
3 files changed, 11 insertions(+), 2 deletions(-)
--- everything.orig/net/mac80211/mesh_hwmp.c 2008-09-08 15:37:12.000000000 +0200
+++ everything/net/mac80211/mesh_hwmp.c 2008-09-08 15:37:25.000000000 +0200
@@ -581,6 +581,10 @@ void mesh_rx_path_sel_frame(struct ieee8
size_t baselen;
u32 last_hop_metric;
+ /* need action_code */
+ if (len < IEEE80211_MIN_ACTION_SIZE + 1)
+ return;
+
baselen = (u8 *) mgmt->u.action.u.mesh_action.variable - (u8 *) mgmt;
ieee802_11_parse_elems(mgmt->u.action.u.mesh_action.variable,
len - baselen, &elems);
--- everything.orig/net/mac80211/mesh_plink.c 2008-09-08 15:37:12.000000000 +0200
+++ everything/net/mac80211/mesh_plink.c 2008-09-08 15:37:25.000000000 +0200
@@ -421,6 +421,10 @@ void mesh_rx_plink_frame(struct ieee8021
DECLARE_MAC_BUF(mac);
#endif
+ /* need action_code, aux */
+ if (len < IEEE80211_MIN_ACTION_SIZE + 3)
+ return;
+
if (is_multicast_ether_addr(mgmt->da)) {
mpl_dbg("Mesh plink: ignore frame from multicast address");
return;
--- everything.orig/net/mac80211/mlme.c 2008-09-08 15:37:17.000000000 +0200
+++ everything/net/mac80211/mlme.c 2008-09-08 15:37:25.000000000 +0200
@@ -60,7 +60,7 @@
#define ERP_INFO_USE_PROTECTION BIT(1)
-/* mgmt header + 1 byte action code */
+/* mgmt header + 1 byte category code */
#define IEEE80211_MIN_ACTION_SIZE (24 + 1)
#define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002
@@ -2989,7 +2989,8 @@ static void ieee80211_rx_mgmt_action(str
{
struct ieee80211_local *local = sdata->local;
- if (len < IEEE80211_MIN_ACTION_SIZE)
+ /* all categories we currently handle have action_code */
+ if (len < IEEE80211_MIN_ACTION_SIZE + 1)
return;
switch (mgmt->u.action.category) {
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 5/3] mac80211: fix typo in action frame handling
2008-09-08 9:05 [PATCH 0/3] small mac80211 updates Johannes Berg
` (3 preceding siblings ...)
2008-09-08 13:41 ` [PATCH 4/3] mac80211: fix action frame length checks Johannes Berg
@ 2008-09-08 14:31 ` Johannes Berg
2008-09-08 20:58 ` Tomas Winkler
2008-09-08 14:40 ` [PATCH 6/3] mac80211: move IE parsing to util file Johannes Berg
5 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2008-09-08 14:31 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
This says chan_switch.action_code but really means
measurement.action_code, of course the actual offset in
the frame is the same, it's just harder to understand
this way.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/mlme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- everything.orig/net/mac80211/mlme.c 2008-09-08 16:29:54.000000000 +0200
+++ everything/net/mac80211/mlme.c 2008-09-08 16:29:56.000000000 +0200
@@ -2997,7 +2997,7 @@ static void ieee80211_rx_mgmt_action(str
case WLAN_CATEGORY_SPECTRUM_MGMT:
if (local->hw.conf.channel->band != IEEE80211_BAND_5GHZ)
break;
- switch (mgmt->u.action.u.chan_switch.action_code) {
+ switch (mgmt->u.action.u.measurement.action_code) {
case WLAN_ACTION_SPCT_MSR_REQ:
if (len < (IEEE80211_MIN_ACTION_SIZE +
sizeof(mgmt->u.action.u.measurement)))
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 6/3] mac80211: move IE parsing to util file
2008-09-08 9:05 [PATCH 0/3] small mac80211 updates Johannes Berg
` (4 preceding siblings ...)
2008-09-08 14:31 ` [PATCH 5/3] mac80211: fix typo in action frame handling Johannes Berg
@ 2008-09-08 14:40 ` Johannes Berg
5 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2008-09-08 14:40 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
Since IE parsing is required for the mlme and mesh code, it's
not a static function anyway, and it's much better to have it
in util rather than the overly large mlme.c
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/mlme.c | 145 ----------------------------------------------------
net/mac80211/util.c | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 144 insertions(+), 145 deletions(-)
--- everything.orig/net/mac80211/mlme.c 2008-09-08 16:36:43.000000000 +0200
+++ everything/net/mac80211/mlme.c 2008-09-08 16:37:58.000000000 +0200
@@ -91,151 +91,6 @@ static int ieee80211_sta_config_auth(str
static void sta_rx_agg_session_timer_expired(unsigned long data);
-void ieee802_11_parse_elems(u8 *start, size_t len,
- struct ieee802_11_elems *elems)
-{
- size_t left = len;
- u8 *pos = start;
-
- memset(elems, 0, sizeof(*elems));
- elems->ie_start = start;
- elems->total_len = len;
-
- while (left >= 2) {
- u8 id, elen;
-
- id = *pos++;
- elen = *pos++;
- left -= 2;
-
- if (elen > left)
- return;
-
- switch (id) {
- case WLAN_EID_SSID:
- elems->ssid = pos;
- elems->ssid_len = elen;
- break;
- case WLAN_EID_SUPP_RATES:
- elems->supp_rates = pos;
- elems->supp_rates_len = elen;
- break;
- case WLAN_EID_FH_PARAMS:
- elems->fh_params = pos;
- elems->fh_params_len = elen;
- break;
- case WLAN_EID_DS_PARAMS:
- elems->ds_params = pos;
- elems->ds_params_len = elen;
- break;
- case WLAN_EID_CF_PARAMS:
- elems->cf_params = pos;
- elems->cf_params_len = elen;
- break;
- case WLAN_EID_TIM:
- elems->tim = pos;
- elems->tim_len = elen;
- break;
- case WLAN_EID_IBSS_PARAMS:
- elems->ibss_params = pos;
- elems->ibss_params_len = elen;
- break;
- case WLAN_EID_CHALLENGE:
- elems->challenge = pos;
- elems->challenge_len = elen;
- break;
- case WLAN_EID_WPA:
- if (elen >= 4 && pos[0] == 0x00 && pos[1] == 0x50 &&
- pos[2] == 0xf2) {
- /* Microsoft OUI (00:50:F2) */
- if (pos[3] == 1) {
- /* OUI Type 1 - WPA IE */
- elems->wpa = pos;
- elems->wpa_len = elen;
- } else if (elen >= 5 && pos[3] == 2) {
- if (pos[4] == 0) {
- elems->wmm_info = pos;
- elems->wmm_info_len = elen;
- } else if (pos[4] == 1) {
- elems->wmm_param = pos;
- elems->wmm_param_len = elen;
- }
- }
- }
- break;
- case WLAN_EID_RSN:
- elems->rsn = pos;
- elems->rsn_len = elen;
- break;
- case WLAN_EID_ERP_INFO:
- elems->erp_info = pos;
- elems->erp_info_len = elen;
- break;
- case WLAN_EID_EXT_SUPP_RATES:
- elems->ext_supp_rates = pos;
- elems->ext_supp_rates_len = elen;
- break;
- case WLAN_EID_HT_CAPABILITY:
- elems->ht_cap_elem = pos;
- elems->ht_cap_elem_len = elen;
- break;
- case WLAN_EID_HT_EXTRA_INFO:
- elems->ht_info_elem = pos;
- elems->ht_info_elem_len = elen;
- break;
- case WLAN_EID_MESH_ID:
- elems->mesh_id = pos;
- elems->mesh_id_len = elen;
- break;
- case WLAN_EID_MESH_CONFIG:
- elems->mesh_config = pos;
- elems->mesh_config_len = elen;
- break;
- case WLAN_EID_PEER_LINK:
- elems->peer_link = pos;
- elems->peer_link_len = elen;
- break;
- case WLAN_EID_PREQ:
- elems->preq = pos;
- elems->preq_len = elen;
- break;
- case WLAN_EID_PREP:
- elems->prep = pos;
- elems->prep_len = elen;
- break;
- case WLAN_EID_PERR:
- elems->perr = pos;
- elems->perr_len = elen;
- break;
- case WLAN_EID_CHANNEL_SWITCH:
- elems->ch_switch_elem = pos;
- elems->ch_switch_elem_len = elen;
- break;
- case WLAN_EID_QUIET:
- if (!elems->quiet_elem) {
- elems->quiet_elem = pos;
- elems->quiet_elem_len = elen;
- }
- elems->num_of_quiet_elem++;
- break;
- case WLAN_EID_COUNTRY:
- elems->country_elem = pos;
- elems->country_elem_len = elen;
- break;
- case WLAN_EID_PWR_CONSTRAINT:
- elems->pwr_constr_elem = pos;
- elems->pwr_constr_elem_len = elen;
- break;
- default:
- break;
- }
-
- left -= elen;
- pos += elen;
- }
-}
-
-
static u8 * ieee80211_bss_get_ie(struct ieee80211_sta_bss *bss, u8 ie)
{
u8 *end, *pos;
--- everything.orig/net/mac80211/util.c 2008-09-08 16:36:31.000000000 +0200
+++ everything/net/mac80211/util.c 2008-09-08 16:37:58.000000000 +0200
@@ -428,3 +428,147 @@ void ieee80211_iterate_active_interfaces
rcu_read_unlock();
}
EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic);
+
+void ieee802_11_parse_elems(u8 *start, size_t len,
+ struct ieee802_11_elems *elems)
+{
+ size_t left = len;
+ u8 *pos = start;
+
+ memset(elems, 0, sizeof(*elems));
+ elems->ie_start = start;
+ elems->total_len = len;
+
+ while (left >= 2) {
+ u8 id, elen;
+
+ id = *pos++;
+ elen = *pos++;
+ left -= 2;
+
+ if (elen > left)
+ return;
+
+ switch (id) {
+ case WLAN_EID_SSID:
+ elems->ssid = pos;
+ elems->ssid_len = elen;
+ break;
+ case WLAN_EID_SUPP_RATES:
+ elems->supp_rates = pos;
+ elems->supp_rates_len = elen;
+ break;
+ case WLAN_EID_FH_PARAMS:
+ elems->fh_params = pos;
+ elems->fh_params_len = elen;
+ break;
+ case WLAN_EID_DS_PARAMS:
+ elems->ds_params = pos;
+ elems->ds_params_len = elen;
+ break;
+ case WLAN_EID_CF_PARAMS:
+ elems->cf_params = pos;
+ elems->cf_params_len = elen;
+ break;
+ case WLAN_EID_TIM:
+ elems->tim = pos;
+ elems->tim_len = elen;
+ break;
+ case WLAN_EID_IBSS_PARAMS:
+ elems->ibss_params = pos;
+ elems->ibss_params_len = elen;
+ break;
+ case WLAN_EID_CHALLENGE:
+ elems->challenge = pos;
+ elems->challenge_len = elen;
+ break;
+ case WLAN_EID_WPA:
+ if (elen >= 4 && pos[0] == 0x00 && pos[1] == 0x50 &&
+ pos[2] == 0xf2) {
+ /* Microsoft OUI (00:50:F2) */
+ if (pos[3] == 1) {
+ /* OUI Type 1 - WPA IE */
+ elems->wpa = pos;
+ elems->wpa_len = elen;
+ } else if (elen >= 5 && pos[3] == 2) {
+ if (pos[4] == 0) {
+ elems->wmm_info = pos;
+ elems->wmm_info_len = elen;
+ } else if (pos[4] == 1) {
+ elems->wmm_param = pos;
+ elems->wmm_param_len = elen;
+ }
+ }
+ }
+ break;
+ case WLAN_EID_RSN:
+ elems->rsn = pos;
+ elems->rsn_len = elen;
+ break;
+ case WLAN_EID_ERP_INFO:
+ elems->erp_info = pos;
+ elems->erp_info_len = elen;
+ break;
+ case WLAN_EID_EXT_SUPP_RATES:
+ elems->ext_supp_rates = pos;
+ elems->ext_supp_rates_len = elen;
+ break;
+ case WLAN_EID_HT_CAPABILITY:
+ elems->ht_cap_elem = pos;
+ elems->ht_cap_elem_len = elen;
+ break;
+ case WLAN_EID_HT_EXTRA_INFO:
+ elems->ht_info_elem = pos;
+ elems->ht_info_elem_len = elen;
+ break;
+ case WLAN_EID_MESH_ID:
+ elems->mesh_id = pos;
+ elems->mesh_id_len = elen;
+ break;
+ case WLAN_EID_MESH_CONFIG:
+ elems->mesh_config = pos;
+ elems->mesh_config_len = elen;
+ break;
+ case WLAN_EID_PEER_LINK:
+ elems->peer_link = pos;
+ elems->peer_link_len = elen;
+ break;
+ case WLAN_EID_PREQ:
+ elems->preq = pos;
+ elems->preq_len = elen;
+ break;
+ case WLAN_EID_PREP:
+ elems->prep = pos;
+ elems->prep_len = elen;
+ break;
+ case WLAN_EID_PERR:
+ elems->perr = pos;
+ elems->perr_len = elen;
+ break;
+ case WLAN_EID_CHANNEL_SWITCH:
+ elems->ch_switch_elem = pos;
+ elems->ch_switch_elem_len = elen;
+ break;
+ case WLAN_EID_QUIET:
+ if (!elems->quiet_elem) {
+ elems->quiet_elem = pos;
+ elems->quiet_elem_len = elen;
+ }
+ elems->num_of_quiet_elem++;
+ break;
+ case WLAN_EID_COUNTRY:
+ elems->country_elem = pos;
+ elems->country_elem_len = elen;
+ break;
+ case WLAN_EID_PWR_CONSTRAINT:
+ elems->pwr_constr_elem = pos;
+ elems->pwr_constr_elem_len = elen;
+ break;
+ default:
+ break;
+ }
+
+ left -= elen;
+ pos += elen;
+ }
+}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 5/3] mac80211: fix typo in action frame handling
2008-09-08 14:31 ` [PATCH 5/3] mac80211: fix typo in action frame handling Johannes Berg
@ 2008-09-08 20:58 ` Tomas Winkler
2008-09-09 6:30 ` Johannes Berg
0 siblings, 1 reply; 9+ messages in thread
From: Tomas Winkler @ 2008-09-08 20:58 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
On Mon, Sep 8, 2008 at 5:31 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> This says chan_switch.action_code but really means
> measurement.action_code, of course the actual offset in
> the frame is the same, it's just harder to understand
> this way.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> net/mac80211/mlme.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- everything.orig/net/mac80211/mlme.c 2008-09-08 16:29:54.000000000 +0200
> +++ everything/net/mac80211/mlme.c 2008-09-08 16:29:56.000000000 +0200
> @@ -2997,7 +2997,7 @@ static void ieee80211_rx_mgmt_action(str
> case WLAN_CATEGORY_SPECTRUM_MGMT:
> if (local->hw.conf.channel->band != IEEE80211_BAND_5GHZ)
> break;
> - switch (mgmt->u.action.u.chan_switch.action_code) {
> + switch (mgmt->u.action.u.measurement.action_code) {
> case WLAN_ACTION_SPCT_MSR_REQ:
> if (len < (IEEE80211_MIN_ACTION_SIZE +
> sizeof(mgmt->u.action.u.measurement)))
>
>
It doesn't really matter on which action code you doing the switch.
The full code looks like that
switch (mgmt->u.action.u.chan_switch.action_code) {
case WLAN_ACTION_SPCT_MSR_REQ:
if (len < (IEEE80211_MIN_ACTION_SIZE +
sizeof(mgmt->u.action.u.msrment_req)))
break;
ieee80211_sta_process_measurement_req(dev, mgmt);
break;
case WLAN_ACTION_SPCT_CHL_SWITCH:
if (len < (IEEE80211_MIN_ACTION_SIZE +
sizeof(mgmt->u.action.u.chan_switch)))
break;
ieee80211_sta_process_channel_switch(dev, ifsta,
&mgmt->u.action.u.chan_switch.sw_elem);
break;
case WLAN_ACTION_SPCT_TPC_REQ:
ieee80211_sta_process_tpc_req(dev, mgmt, rx_status);
break;
default:
break;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 5/3] mac80211: fix typo in action frame handling
2008-09-08 20:58 ` Tomas Winkler
@ 2008-09-09 6:30 ` Johannes Berg
0 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2008-09-09 6:30 UTC (permalink / raw)
To: Tomas Winkler; +Cc: John Linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]
On Mon, 2008-09-08 at 23:58 +0300, Tomas Winkler wrote:
> It doesn't really matter on which action code you doing the switch.
Oh, I know, but I think it's confusing.
> The full code looks like that
>
> switch (mgmt->u.action.u.chan_switch.action_code) {
> case WLAN_ACTION_SPCT_MSR_REQ:
> if (len < (IEEE80211_MIN_ACTION_SIZE +
> sizeof(mgmt->u.action.u.msrment_req)))
> break;
> ieee80211_sta_process_measurement_req(dev, mgmt);
> break;
> case WLAN_ACTION_SPCT_CHL_SWITCH:
> if (len < (IEEE80211_MIN_ACTION_SIZE +
> sizeof(mgmt->u.action.u.chan_switch)))
> break;
> ieee80211_sta_process_channel_switch(dev, ifsta,
> &mgmt->u.action.u.chan_switch.sw_elem);
> break;
> case WLAN_ACTION_SPCT_TPC_REQ:
> ieee80211_sta_process_tpc_req(dev, mgmt, rx_status);
> break;
> default:
> break;
Does channel switch and measurement have the same category? Can't we
better reflect that in the structure? I thought the union in the struct
had one sub-structure per category.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-09-09 6:30 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08 9:05 [PATCH 0/3] small mac80211 updates Johannes Berg
2008-09-08 9:05 ` [PATCH 1/3] mac80211: move some RCU locking into an if branch Johannes Berg
2008-09-08 9:05 ` [PATCH 2/3] mac80211: make conf_tx non-atomic Johannes Berg
2008-09-08 9:05 ` [PATCH 3/3] mac80211: BSS info: check channel first Johannes Berg
2008-09-08 13:41 ` [PATCH 4/3] mac80211: fix action frame length checks Johannes Berg
2008-09-08 14:31 ` [PATCH 5/3] mac80211: fix typo in action frame handling Johannes Berg
2008-09-08 20:58 ` Tomas Winkler
2008-09-09 6:30 ` Johannes Berg
2008-09-08 14:40 ` [PATCH 6/3] mac80211: move IE parsing to util file Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).