From 746a336582a7e05082ab4efbb43f5357858f629a Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 22 Oct 2012 15:20:53 +0200 Subject: mac80211: fix WDS channel context test WDS is (currently) not allowed when channel contexts are *supported*, not when they're *not* supported. Fix the inverted test. Reported-by: Ronald Tested-by: Ronald Signed-off-by: Johannes Berg --- net/mac80211/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/mac80211') diff --git a/net/mac80211/main.c b/net/mac80211/main.c index c42094b..fd8345c 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -751,7 +751,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) if (comb->num_different_channels > 1) return -EINVAL; } - + } else { /* * WDS is currently prohibited when channel contexts are used * because there's no clear definition of which channel WDS -- cgit v1.1 From 9a90bc81914ee77edcd6eb7e881639b7f7bf1667 Mon Sep 17 00:00:00 2001 From: Thomas Pedersen Date: Sat, 20 Oct 2012 19:03:10 -0700 Subject: mac80211: mesh STAs only process mesh beacons Before, a mesh STA would execute some code on behalf of AP or IBSS beacons. Since the mesh stack currently does not consider anything but other mesh STAs interesting, limit processing to just these and save a little overhead. Signed-off-by: Thomas Pedersen Signed-off-by: Johannes Berg --- net/mac80211/mesh.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'net/mac80211') diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 5bed4fd..a350cab 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -703,8 +703,10 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, ieee802_11_parse_elems(mgmt->u.probe_resp.variable, len - baselen, &elems); - /* ignore beacons from secure mesh peers if our security is off */ - if (elems.rsn_len && sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) + /* ignore non-mesh or secure / unsecure mismatch */ + if ((!elems.mesh_id || !elems.mesh_config) || + (elems.rsn && sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) || + (!elems.rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE)) return; if (elems.ds_params && elems.ds_params_len == 1) @@ -717,8 +719,7 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, if (!channel || channel->flags & IEEE80211_CHAN_DISABLED) return; - if (elems.mesh_id && elems.mesh_config && - mesh_matches_local(sdata, &elems)) + if (mesh_matches_local(sdata, &elems)) mesh_neighbour_update(sdata, mgmt->sa, &elems); if (ifmsh->sync_ops) -- cgit v1.1 From 5d0d04e477c44993f995f35b728ce9dd57a4615e Mon Sep 17 00:00:00 2001 From: Assaf Krauss Date: Wed, 1 Aug 2012 15:12:48 +0300 Subject: mac80211: expose AES-CMAC subkey calculation Expose a function for the AES-CMAC subkey calculation to drivers. This is the first step of the AES-CMAC cipher key setup and may be required for CMAC hardware offloading. Signed-off-by: Assaf Krauss Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- net/mac80211/aes_cmac.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'net/mac80211') diff --git a/net/mac80211/aes_cmac.c b/net/mac80211/aes_cmac.c index a04752e..4933535 100644 --- a/net/mac80211/aes_cmac.c +++ b/net/mac80211/aes_cmac.c @@ -126,3 +126,20 @@ void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm) { crypto_free_cipher(tfm); } + +void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf, + u8 *k1, u8 *k2) +{ + u8 l[AES_BLOCK_SIZE] = {}; + struct ieee80211_key *key = + container_of(keyconf, struct ieee80211_key, conf); + + crypto_cipher_encrypt_one(key->u.aes_cmac.tfm, l, l); + + memcpy(k1, l, AES_BLOCK_SIZE); + gf_mulx(k1); + + memcpy(k2, k1, AES_BLOCK_SIZE); + gf_mulx(k2); +} +EXPORT_SYMBOL(ieee80211_aes_cmac_calculate_k1_k2); -- cgit v1.1 From f87ad637b60a3b789030b3ef969d56a8caec9fed Mon Sep 17 00:00:00 2001 From: Rami Rosen Date: Thu, 25 Oct 2012 10:16:23 +0200 Subject: mac80211: remove duplicate check in ieee80211_rx_mgmt_beacon Remove a duplicate check in ieee80211_rx_mgmt_beacon, there is no need to make again the same check for the IEEE80211_HW_PS_NULLFUNC_STACK twice; the two ifs can be consolidated. Signed-off-by: Rami Rosen [reword commit message & break long lines and also clean up variable] Signed-off-by: Johannes Berg --- net/mac80211/mlme.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'net/mac80211') diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 469d864..2bdf776 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -2433,7 +2433,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_channel *chan; u32 changed = 0; - bool erp_valid, directed_tim = false; + bool erp_valid; u8 erp_value = 0; u32 ncrc; u8 *bssid; @@ -2564,11 +2564,10 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, len - baselen, &elems, care_about_ies, ncrc); - if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) - directed_tim = ieee80211_check_tim(elems.tim, elems.tim_len, - ifmgd->aid); - if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) { + bool directed_tim = ieee80211_check_tim(elems.tim, + elems.tim_len, + ifmgd->aid); if (directed_tim) { if (local->hw.conf.dynamic_ps_timeout > 0) { if (local->hw.conf.flags & IEEE80211_CONF_PS) { -- cgit v1.1 From 5df45690e78fd6355b3eb17ba15a1659e608db5d Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 24 Oct 2012 14:22:37 +0200 Subject: mac80211: use non-atomic bitmap operation for local variable For a local variable there's no need to use the atomic set_bit() operation, use __set_bit() instead. Signed-off-by: Johannes Berg --- net/mac80211/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/mac80211') diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 51a4a25..ea8a674 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -821,7 +821,7 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len, if (elem_parse_failed) elems->parse_error = true; else - set_bit(id, seen_elems); + __set_bit(id, seen_elems); left -= elen; pos += elen; -- cgit v1.1 From 1724ffbc7439de679d536163e03f54f35574d449 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 24 Oct 2012 11:38:30 +0200 Subject: mac80211: complete bss_info tracing Some fields have been added but were missed in tracing, add them now. Signed-off-by: Johannes Berg --- net/mac80211/trace.h | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'net/mac80211') diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index 6293647..0638541 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -315,20 +315,33 @@ TRACE_EVENT(drv_bss_info_changed, TP_STRUCT__entry( LOCAL_ENTRY VIF_ENTRY + __field(u32, changed) __field(bool, assoc) + __field(bool, ibss_joined) + __field(bool, ibss_creator) __field(u16, aid) __field(bool, cts) __field(bool, shortpre) __field(bool, shortslot) + __field(bool, enable_beacon) __field(u8, dtimper) __field(u16, bcnint) __field(u16, assoc_cap) __field(u64, sync_tsf) __field(u32, sync_device_ts) __field(u32, basic_rates) - __field(u32, changed) - __field(bool, enable_beacon) + __array(int, mcast_rate, IEEE80211_NUM_BANDS) __field(u16, ht_operation_mode) + __field(s32, cqm_rssi_thold); + __field(s32, cqm_rssi_hyst); + __field(u32, channel_type); + __dynamic_array(u32, arp_addr_list, info->arp_addr_cnt); + __field(bool, arp_filter_enabled); + __field(bool, qos); + __field(bool, idle); + __field(bool, ps); + __dynamic_array(u8, ssid, info->ssid_len); + __field(bool, hidden_ssid); ), TP_fast_assign( @@ -337,17 +350,32 @@ TRACE_EVENT(drv_bss_info_changed, __entry->changed = changed; __entry->aid = info->aid; __entry->assoc = info->assoc; + __entry->ibss_joined = info->ibss_joined; + __entry->ibss_creator = info->ibss_creator; __entry->shortpre = info->use_short_preamble; __entry->cts = info->use_cts_prot; __entry->shortslot = info->use_short_slot; + __entry->enable_beacon = info->enable_beacon; __entry->dtimper = info->dtim_period; __entry->bcnint = info->beacon_int; __entry->assoc_cap = info->assoc_capability; __entry->sync_tsf = info->sync_tsf; __entry->sync_device_ts = info->sync_device_ts; __entry->basic_rates = info->basic_rates; - __entry->enable_beacon = info->enable_beacon; + memcpy(__entry->mcast_rate, info->mcast_rate, + sizeof(__entry->mcast_rate)); __entry->ht_operation_mode = info->ht_operation_mode; + __entry->cqm_rssi_thold = info->cqm_rssi_thold; + __entry->cqm_rssi_hyst = info->cqm_rssi_hyst; + __entry->channel_type = info->channel_type; + memcpy(__get_dynamic_array(arp_addr_list), info->arp_addr_list, + sizeof(u32) * info->arp_addr_cnt); + __entry->arp_filter_enabled = info->arp_filter_enabled; + __entry->qos = info->qos; + __entry->idle = info->idle; + __entry->ps = info->ps; + memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len); + __entry->hidden_ssid = info->hidden_ssid; ), TP_printk( -- cgit v1.1