summaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.c
diff options
context:
space:
mode:
authorChun-Yeow Yeoh <yeohchunyeow@cozybit.com>2013-10-14 19:08:29 -0700
committerJohannes Berg <johannes.berg@intel.com>2013-10-28 15:05:28 +0100
commitc0f17eb9b2d4d322c099a0700437209149224583 (patch)
treeed32c2de60b9dc2dc50e2125ce49fae54e5507a8 /net/mac80211/ibss.c
parent06be6b149f7e406bcf16098567f5a6c9f042bced (diff)
downloadop-kernel-dev-c0f17eb9b2d4d322c099a0700437209149224583.zip
op-kernel-dev-c0f17eb9b2d4d322c099a0700437209149224583.tar.gz
mac80211: refactor the parsing of chan switch ie
Refactor the channel switch IE parsing to reduce the number of function parameters. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r--net/mac80211/ibss.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 275bbb2..a0ae027 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -836,13 +836,13 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
bool beacon)
{
struct cfg80211_csa_settings params;
+ struct ieee80211_csa_ie csa_ie;
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
struct ieee80211_chanctx_conf *chanctx_conf;
struct ieee80211_chanctx *chanctx;
enum nl80211_channel_type ch_type;
int err, num_chanctx;
u32 sta_flags;
- u8 mode;
if (sdata->vif.csa_active)
return true;
@@ -865,12 +865,10 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
}
memset(&params, 0, sizeof(params));
+ memset(&csa_ie, 0, sizeof(csa_ie));
err = ieee80211_parse_ch_switch_ie(sdata, elems, beacon,
ifibss->chandef.chan->band,
- sta_flags, ifibss->bssid,
- &params.count, &mode,
- &params.chandef);
-
+ sta_flags, ifibss->bssid, &csa_ie);
/* can't switch to destination channel, fail */
if (err < 0)
goto disconnect;
@@ -879,6 +877,9 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
if (err)
return false;
+ params.count = csa_ie.count;
+ params.chandef = csa_ie.chandef;
+
if (ifibss->chandef.chan->band != params.chandef.chan->band)
goto disconnect;
@@ -965,7 +966,7 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
"received channel switch announcement to go to channel %d MHz\n",
params.chandef.chan->center_freq);
- params.block_tx = !!mode;
+ params.block_tx = !!csa_ie.mode;
ieee80211_ibss_csa_beacon(sdata, &params);
sdata->csa_radar_required = params.radar_required;
OpenPOWER on IntegriCloud