aboutsummaryrefslogtreecommitdiff
path: root/net/mac80211
AgeCommit message (Collapse)Author
2011-11-28mac80211: fix forwarded mesh frame queue mappingThomas Pedersen
We can't rely on ieee80211_select_queue() to do its job at this point since the skb->protocol is not yet known. Instead, factor out and reuse the queue mapping logic for injected frames. Also, to mitigate congestion, forwarded frames should be dropped if the outgoing queue was stopped. This was not correctly implemented as we were not checking the right queue. Furthermore, we were dropping frames that had arrived to their destination if that queue was stopped. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: fix switched HWMP frame addressesThomas Pedersen
HWMP originator and target addresses were switched on the air but also on reception, which is why path selection still worked. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: failed forwarded mesh frame addressingThomas Pedersen
Don't write the TA until next hop is actually known, since we might need the original TA for sending a PERR. Previously we would send a PERR to ourself if path resolution for a forwarded frame failed. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28{nl,cfg,mac}80211: Allow Setting Multicast Rate in MeshChun-Yeow Yeoh
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: Make __check_htcap_disable static.Ben Greear
Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: call skb_put() before copying the data (trivial)Eliad Peller
It doesn't have any actual effect here, but we should skb_put() *before* copying the data. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: fix TX warningJohannes Berg
Emmanuel reported that my previous patches to enable handing all fragments to drivers at once triggered the warning that the SKB queue wasn't empty. This is happening when we actually queue up some frames and don't hand them to the driver (queues are stopped). The reason for it is that my code that splices the frame(s) over to the pending queue didn't re-init the local queue, so skb_queue_empty() was false. Fix this by using the _init versions of the splicing. Also, convert the warning to WARN_ON_ONCE. Reported-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Tested-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: do not pass AP VLAN vif pointers to driversFelix Fietkau
This fixes frequent WARN_ONs when using AP VLAN + aggregation, as these vifs are virtual and not registered with drivers. Use sta_info_get_bss instead of sta_info_get in aggregation callbacks, so that these callbacks can find the station entry when called with the AP vif. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: log reason and initiator when rx agg is stoppedNikolay Martynov
Add additional debug logging of initiator and reason when rx aggregation session is stopped Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: trivial: use WLAN_BACK_RECIPIENT instead of hardcoded 0Nikolay Martynov
Use WLAN_BACK_RECIPIENT instead of hardcoded 0 for clarity Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: timeout tx agg sessions in way similar to rx agg sessionsNikolay Martynov
Currently tx aggregation is not being timed out even if timeout is specified when aggregation is opened. Tx tid stays active until delba arrives from recipient (i.e. recipient times out tid when it is inactive). The problem with this approach is that delba can get lost in the air and tx tid will stay perpetually opened on the originator while closed on recipient thus all data sent via this tid will be lost. This patch implements tx tid timeouting in way very similar to rx tid timeouting. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: don't indicate probe resp change in IBSS modeArik Nemtsov
Due the a fall-through in the switch statement, the IBSS mode got a report for AP_RPOBE_RESPONSE change on reconfig. Change this to an AP only notification. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: dereference RCU protected probe_resp pointer correctlyArik Nemtsov
This fixes a sparse warning: cfg.c:502:13: warning: incorrect type in assignment (different address spaces) cfg.c:502:13: expected struct sk_buff *old cfg.c:502:13: got struct sk_buff [noderef] <asn:4>*probe_resp Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: fix duration calculation for QoS NOACK framesSimon Wunderlich
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: Add NoAck per tid supportSimon Wunderlich
This patch contains the processing changes in mac80211. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: remove debugfs noack testSimon Wunderlich
This feature has been superseded by the NoAck per Queue feature. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: fix race between the AGG SM and the Tx data pathEmmanuel Grumbach
When a packet is supposed to sent be as an a-MPDU, mac80211 sets IEEE80211_TX_CTL_AMPDU to let the driver know. On the other hand, mac80211 configures the driver for aggregration with the ampdu_action callback. There is race between these two mechanisms since the following scenario can occur when the BA agreement is torn down: Tx softIRQ drv configuration ========== ================= check OPERATIONAL bit Set the TX_CTL_AMPDU bit in the packet clear OPERATIONAL bit stop Tx AGG Pass Tx packet to the driver. In that case the driver would get a packet with TX_CTL_AMPDU set although it has already been notified that the BA session has been torn down. To fix this, we need to synchronize all the Qdisc activity after we cleared the OPERATIONAL bit. After that step, all the following packets will be buffered until the driver reports it is ready to get new packets for this RA / TID. This buffering allows not to run into another race that would send packets with TX_CTL_AMPDU unset while the driver hasn't been requested to tear down the BA session yet. This race occurs in practice and iwlwifi complains with a WARN_ON when it happens. Cc: stable@kernel.org Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: fix race condition caused by late addBA responseNikolay Martynov
If addBA responses comes in just after addba_resp_timer has expired mac80211 will still accept it and try to open the aggregation session. This causes drivers to be confused and in some cases even crash. This patch fixes the race condition and makes sure that if addba_resp_timer has expired addBA response is not longer accepted and we do not try to open half-closed session. Cc: stable@vger.kernel.org Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> [some adjustments] Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28mac80211: don't stop a single aggregation session twiceJohannes Berg
Nikolay noticed (by code review) that mac80211 can attempt to stop an aggregation session while it is already being stopped. So to fix it, check whether stop is already being done and bail out if so. Also move setting the STOPPING state into the lock so things are properly atomic. Cc: stable@vger.kernel.org Reported-by: Nikolay Martynov <mar.kolya@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-22Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux Conflicts: drivers/net/wireless/iwlegacy/iwl-debugfs.c drivers/net/wireless/iwlegacy/iwl-rx.c drivers/net/wireless/iwlegacy/iwl-scan.c drivers/net/wireless/iwlegacy/iwl-tx.c include/net/bluetooth/bluetooth.h
2011-11-21mac80211: fix RCU warnings in meshJohannes Berg
Sparse RCU checking reports two warnings in the mesh path table code. These are due to questionable uses of rcu_dereference. To fix the first one, get rid of mesh_gate_add() and just make mesh_path_add_gate() do the correct deref. To fix the second one, simply remove rcu_dereference() in mesh_gate_del() -- it already gets a proper pointer as indicated by the prototype (no __rcu annotation) and confirmed by the code. Cc: Javier Cardona <javier@cozybit.com> Cc: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21mac80211: Support ht-cap over-rides.Ben Greear
This implements ht-cap over-rides for mac80211 drivers. HT may be disabled, making an /a/b/g/n station act like an a/b/g station. HT40 may be disabled forcing the station to be HT20 even if the AP and local hardware support HT40. MAX-AMSDU may be disabled. AMPDU-Density may be increased. AMPDU-Factor may be decreased. This has been successfully tested with ath9k using patched wpa_supplicant and iw. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21cfg80211/mac80211: Revert "move information element parsing logic to cfg80211"Johannes Berg
No other driver ever ended up using this, and the commit forgot to move the prototype so no driver could have used it. Revert it, if any driver shows up and needs it it can be moved again, but until then it's more efficient to have it in mac80211 where the only user is. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21cfg80211: add flags for off-channel capabilitiesJohannes Berg
Currently mac80211 implements these for all devices, but given restrictions of some devices that isn't really true, so prepare for being able to remove the capability for some mac80211 devices. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21mac80211: minor cleanup to mesh state lockingJohannes Berg
First time I tried smatch, and it says: mesh_hwmp.c +870 mesh_queue_preq(21) error: double lock 'bottom_half:' mesh_hwmp.c +873 mesh_queue_preq(24) error: double unlock 'bottom_half:' mesh_hwmp.c +886 mesh_queue_preq(37) error: double unlock 'bottom_half:' Which is indeed true -- there's no point in disabling BHs again if we just did that a few lines earlier, so remove. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21mac80211: remove unused ASSOC_AP flagJohannes Berg
WLAN_STA_ASSOC_AP indicates that the station entry is for an AP we're associated to but isn't used so remove it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21mac80211: transmit fragment list to driversJohannes Berg
Drivers can usually handle fragmented packets much easier when they get the entire list of fragments at once. The only thing they need to do is keep enough space on the queues for up to ten fragments of a single MSDU. This allows them to implement this with a new operation tx_frags. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21mac80211: make TX LED handling independent of fragmentationJohannes Berg
This just prepares for passing the entire fragment list to the driver. No significant changes, but the TX throughput is calculated slightly differently now and we blink only once for each MSDU. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21mac80211: move fragment flag adjustmentJohannes Berg
Instead of adjusting the fragment flags at TX time, adjust them at fragmentation time. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21mac80211: use skb list for fragmentsJohannes Berg
We are currently linking the skbs by using skb->next directly. This works, but the preferred way is to use a struct sk_buff_head instead. That also prepares for passing that to drivers directly. While at it I noticed we calculate the duration for fragments twice -- remove one of them. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21mac80211: Fix endian bug in radiotap header generationHelmut Schaa
I intoduced this bug in commit a2fe81667410723d941a688e1958a49d67ca3346 "mac80211: Build TX radiotap header dynamically" Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21mac80211: Fix AMSDU rate printout in debugfs.Ben Greear
It was flipped. See section 7.3.2.56 of the 802.11n spec for details. Signed-off-by: Ben Greear <greearb@candelatech.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-17mac80211: call ieee80211_recalc_idle() after sending packetsFelix Fietkau
Some drivers (e.g. ath9k) assume that it's safe to go into low-power mode immediately after the idle state changes. To support that, mac80211 even calls drv_flush() before that happens. In some instances, mac80211 sent a packet right after recalculating the idle state, this patch fixes that. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-17minstrel_ht: Remove unused function parametersPatrick Kelle
Remove unused function parameters in the following functions: minstrel_calc_rate_ewma() minstrel_ht_calc_tp() minstrel_aggr_check() minstrel_ht_set_rate() Signed-off-by: Patrick Kelle <patrick.kelle81@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-17mac80211: memory leak in mesh_queue_preq()Dan Carpenter
We recently introduced a return here, but we need to call kfree first. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-17mac80211: use kfree_skb() instead of kfree()Dan Carpenter
sk_buff structs should be freed using kfree_skb(). This was introduced recently in 029458212 "mac80211: Save probe response data for bss". Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-17mac80211: Get rid of search loop for rate group indexHelmut Schaa
Finding the group index for a specific rate is done by looping through all groups and returning if the correct one is found. This code is called for each tx'ed frame and thus it makes sense to reduce its runtime. Do this by calculating the group index by this formula based on the SGI and HT40 flags as well as the stream number: idx = (HT40 * 2 * MINSTREL_MAX_STREAMS) + (SGI * MINSTREL_MAX_STREAMS) + (streams - 1) Hence, the groups are ordered by th HT40 flag first, then by the SGI flag and afterwards by the number of used streams. This should reduce the runtime of minstrel_ht_get_group_idx considerable. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-17mac80211: Check rate->idx before rate->countHelmut Schaa
The drivers are not required to fill in rate->count if rate->idx is set to -1. Hence, we should first check rate->idx before accessing rate->count. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-17mac80211: remove crypto special case for auth framesJohannes Berg
The shared key authentication frame that needs to be encrypted (the third one in the shared key handshake) is directly encrypted in ieee80211_send_auth and the IEEE80211_TX_INTFL_DONT_ENCRYPT is set. All others are not encrypted, so the only way to get to this is erroneously on no-monitor AP side. Remove the special case for authentication frames to fix the AP shared key side when operating without cooked monitor interfaces -- with cooked monitor the IEEE80211_TX_INTFL_DONT_ENCRYPT also gets set, so we never get here -- an AP never encrypts auth frames. Without this patch, an AP operating in WEP mode with my no-monitor patches would erroneously encrypt all authentication frames, instead of none. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11mac80211: fix warning in ieee80211_probe_clientJohannes Berg
The warning is spurious -- if !sta we always exit without using the unassigned qos variable, and if we do find the sta we assign it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11minstrel: Remove unused function parameter in calc_rate_durations()Patrick Kelle
Signed-off-by: Patrick Kelle <patrick.kelle81@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11mac80211: Save probe response data for bssArik Nemtsov
Allow setting a probe response template for an interface operating in AP mode. Low level drivers are notified about changes in the probe response template and are able to retrieve a copy of the current probe response. This data can, for example, be uploaded to hardware as a template. Signed-off-by: Guy Eilam <guy@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11mac80211: make sure hw_key exists before checking its flagsArik Nemtsov
Fixes a bug introduced in: commit 077a9154898b374f20555adc3f620cccd02581d6 Author: Arik Nemtsov <arik@wizery.com> Date: Sun Oct 23 08:21:41 2011 +0200 Reported-by: Arend van Spriel <arend@broadcom.com> Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11mac80211: add recalc PS in ieee80211_reconfig()Eyal Shapira
Driver should be instructed to enter PS AFTER reconfiguring ASSOCIATED (in STA case) using ieee80211_bss_info_change_notify same as it's being done in ieee80211_set_associated() Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11mac80211/cfg80211: report monitor channel in wireless extensionsJohannes Berg
Just add API to get the channel & report it. Trivial really. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11mac80211: simplify scan state machineJohannes Berg
Attempting to micro-optimise the scan by going fully live again when scanning the operating channel just made the code extremely complex and has little gain in most use cases. Remove all that code and simplify the state machine again. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11mac80211: set carrier_on for ibss vifs only while joinedEliad Peller
mac80211 should set carrier_on for ibss vifs only while they are joined (similar to sta vifs) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11mac80211: init rate-control for TDLS sta when supp-rates are knownArik Nemtsov
Initialize rate control algorithms only when supported rates are known for a TDLS peer sta. Direct Tx between peers is not allowed before the link is enabled. In turn, this only occurs after a change_station() call that sets supported rates. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-09net/mac80211/debugfs.c: use kstrtoul, etcJulia Lawall
Use kstrtoul, etc instead of the now deprecated strict_strtoul, etc. A semantic patch rule for the kstrtoul case is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression a,b; {int,long} *c; @@ -strict_strtoul +kstrtoul (a,b,c) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-09mac80211: implement wifi TX statusJohannes Berg
Implement the socket wifi TX status error queue reflection in mac80211. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>