summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-01-03nl80211/mac80211: support full station state in AP modeJohannes Berg
Today, stations are added already associated. That is inefficient if, for example, the driver has no room for stations any more because then the station will go through the entire auth/assoc handshake, only to be kicked out afterwards. To address this a bit better, at least with drivers using the new station state callback, allow hostapd to add stations in unauthenticated mode, just after receiving the AUTH frame, before even replying. Thus if there's no more space at that point, it can send a negative auth frame back. It still needs to handle later state transition errors though, of course. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03cfg80211: move some AP code to right fileJohannes Berg
Some AP code ended up in mlme.c as ap.c didn't exist when it was written, move it now. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: restrict assoc request VHT capabilitiesJohannes Berg
In interoperability testing some APs showed bad behaviour if some of the VHT capabilities of the station are better than their own. Restrict the assoc request parameters - beamformee capabable, - RX STBC and - RX MCS set to the subset that the AP can support. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03cfg80211: move world roaming check for beacon hintsLuis R. Rodriguez
We should not add new beacon hints even if the wiphy is not world roaming. Without this we were always adding a beacon hint if not world roaming for every non world roaming wiphy interface. Tested-by: Ben Greear <greearb@candelatech.com> Reported-by: Ben Greear <greearb@candelatech.com> Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> [fix locking] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03cfg80211: move reg_is_world_roaming()Luis R. Rodriguez
This will be used later by other code. This has no functional change. Tested-by: Ben Greear <greearb@candelatech.com> Reported-by: Ben Greear <greearb@candelatech.com> Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03cfg80211: do not process beacon hints if one is already queuedLuis R. Rodriguez
Regulatory beacon hints are used to help with world roaming and as it is right now we learn from a beacon hint processed on one wiphy to all other wiphys. The processing of beacon hints however is scheduled and if we have a lot of interfaces we may hit the case that we'll queue a the same beacon hint many times until its processed. To avoid this do a lookup on the queued up beacon hints prior to adding a new beacon hint. If the beacon hint is removed from the pending reg beacon hint list then it would be processed and we'd ensure all wiphys would have learned from it, if its on the pending reg beacon list we'd now find it prior to it being processed. Tested-by: Ben Greear <greearb@candelatech.com> Reported-by: Ben Greear <greearb@candelatech.com> Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: assign bss_conf.bssid only onceJohannes Berg
Instead of checking every time bss_info_changed is called, assign the pointer once depending on the interface type and then leave it untouched until the interface type is changed. This makes the ieee80211_bss_info_change_notify() now a simple wrapper to call the driver only. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: further simplify ieee80211_bss_info_change_notifyJohannes Berg
The special case in the function isn't really needed, instead make the suspend code a bit better and also easier to understand and move the warning into the driver op wrapper inline. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: reconfig bss_info_changed only if beaconingJohannes Berg
For AP/IBSS/mesh interfaces, call the driver to reconfigure bss_info_changed only if the interface was beaconing before suspend, otherwise we call the driver and it might interpret the change as going from enabled to disabled. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: track enable_beacon explicitlyJohannes Berg
Instead of calculating in ieee80211_bss_info_change_notify() whether beaconing should be enabled or not, set it in the correct places in the callers. This simplifies the logic in this function at the expense of offchannel, but is also more robust. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: fix channel context iterationJohannes Berg
During suspend/resume channel contexts might be iterated even if they haven't been re-added to the driver, keep track of this and skip them in iteration. Also use the new status for sanity checks. Also clarify the fact that during HW restart all contexts are iterated over (thanks Eliad.) Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: clean up association better in suspendJohannes Berg
When suspending, bss_info_changed() is called to disable beacons, but managed mode interfaces are simply removed (bss_info_changed() is called with "no change" only). This can lead to problems. To fix this and copy the BSS configuration, clear it during suspend and restore it on resume. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: clean up ieee80211_quiesceJohannes Berg
It's a bit odd that there's a return value that only depends on the iftype, move that logic out of the function into the only caller that needs it. Also, since the quiescing could stop timers that trigger the sdata work, move the sdata work cancel into the function and after the actual quiesce. Finally, there's no need to call it on interfaces that are down, so don't. Change-Id: I1632d46d21ba3558ea713d035184f1939905f2f1 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac82011: use frame control to differentiate probe resp/beaconEmmanuel Grumbach
The probe response/beacon management frame RX code passes a bool parameter to differentiate beacons and probe responses. This is useless since we have the frame and can thus use its frame control field. Moreover it is buggy since there is one call to ieee80211_rx_bss_info with a beacon frame that is indicated as a probe response, which is also fixed by using the frame control field, so do that. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: fix ieee80211_ie_build_vht_cap indentationJohannes Berg
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03cfg80211: adjacent 80+80 MHz channel segments are invalidJohannes Berg
In that case, it's really a 160 MHz channel, so disallow this configuration. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: optimise AP stop RCU handlingJohannes Berg
If there are VLANs, stopping an AP is inefficient as it calls rcu_barrier() once for each interface (the VLANs and the AP itself). Optimise this by moving rcu_barrier() out of the station cleanups and calling it only once for all interfaces combined. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: use IS_ERR macro family for freq_reg_infoJohannes Berg
Instead of returning an error and filling a pointer return the pointer and an ERR_PTR value in error cases. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: use RCU to protect last_requestJohannes Berg
This will allow making freq_reg_info() lock-free. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: use RCU to protect global and wiphy regdomainsJohannes Berg
To simplify the locking and not require cfg80211_mutex (which nl80211 uses to access the global regdomain) and also to make it possible for drivers to access their wiphy->regd safely, use RCU to protect these pointers. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: pass new regdomain to reset functionJohannes Berg
Instead of assigning after calling the function do it inside the function. This will later avoid a period of time where the pointer is NULL. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: remove handling of channel bandwidthJohannes Berg
The channel bandwidth handling isn't really quite right, it assumes that a 40 MHz channel is really two 20 MHz channels, which isn't strictly true. This is the way the regulatory database handling is defined right now though so remove the logic to handle other channel widths. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: fix reg_is_valid_request handlingJohannes Berg
There's a bug with the world regulatory domain, it can be updated any time which is different from all other regdomains that can only be updated once after a request for them. Fix this by adding a check for "processed" to the reg_is_valid_request() function and clear that when doing a request. While looking at this I also found another locking bug, last_request is protected by the reg_mutex not the cfg80211_mutex so the code in nl80211 is racy. Remove that code as it only tries to prevent an allocation in an error case, which isn't necessary. Then the function can also become static and locking in nl80211 can have a smaller scope. Also change __set_regdom() to do the checks earlier and not different for world/other regdomains. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: remove locking from wiphy_apply_custom_regulatoryJohannes Berg
wiphy_apply_custom_regulatory() doesn't have to hold the regulatory mutex as it only modifies the given wiphy with the given regulatory domain, it doesn't access any global regulatory data. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: clarify locking rules and assertionsJohannes Berg
Many places that currently check that cfg80211_mutex is held don't actually use any data protected by it. The functions that need to hold the cfg80211_mutex are the ones using the cfg80211_regdomain variable, so add the lock assertion to those and clarify this in the comments. The reason for this is that nl80211 uses the regdom without being able to hold reg_mutex. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: simplify freq_reg_info_regdJohannes Berg
The function itself has dual-purpose: it can retrieve from a given regdomain or from the globally installed one. Change it to have a single purpose only: to look up from a given regdomain. Pass the correct regdomain in the freq_reg_info() function instead. This also changes the locking rules for it, no locking is required any more. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: remove useless warningJohannes Berg
Even if it never happens and is hidden behind the debug config option, it's completely useless: the calltrace will only show module loading. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: remove redundant isalpha() checkJohannes Berg
toupper() only modifies lower-case letters, so the isalpha() check is redundant; remove it. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: simplify restore_regulatory_settingsJohannes Berg
Use list_splice_tail_init() and also simplify the locking. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: remove BUG_ONJohannes Berg
This code is a bit too BUG_ON happy, remove all instances and while doing so make some code a bit smarter by passing the right pointer instead of indices into arrays. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03cfg80211: remove wiphy_idx_validJohannes Berg
This is pretty much useless since get_wiphy_idx() always returns true since it's always called with a valid wiphy pointer. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: use proper enum for return valuesJohannes Berg
Instead of treating special error codes specially, like -EALREADY, introduce a real enum for all the needed possibilities and use it. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: remove useless locking on exitJohannes Berg
It would be a major problem if anything were to run concurrently while the module is being unloaded so remove the locking that doesn't help anything. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: code cleanupJohannes Berg
Clean up various things like indentation, extra parentheses, too many/few line breaks, etc. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: simplify regulatory_hint_11dJohannes Berg
There's no need to unlock before calling queue_regulatory_request(), so simplify the function. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: don't test list before iteratingJohannes Berg
There's no need to test whether a list is empty or not before iterating. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: clean up reg_copy_regd()Johannes Berg
Use ERR_PTR/IS_ERR to return the result or errors, also do some code cleanups. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: clean up regdom_intersectJohannes Berg
As the dummy_rule (also renamed from irule) is only used for output by the reg_rules_intersect() function there's no need to clear it at all, remove that. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: don't allocate too much memoryJohannes Berg
There's no need to allocate one reg rule more than will be used, reduce the allocations. The allocation in nl80211 already doesn't allocate too much space. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03regulatory: don't write past array when intersecting rulesJohannes Berg
When intersecting rules, we count first to know how many rules need to be allocated, and then do the intersection into the allocated array. However, the code doing this writes past the end of the array because it attempts to do all intersections. Make it stop when the right number of rules has been reached. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: remove a bit of dead mesh codeJohannes Berg
In a file that's only built when CONFIG_MAC80211_MESH is defined, having an #ifdef on the same is entirely pointless, so remove it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: optimise roaming time againJohannes Berg
The last fixes re-added the RCU synchronize penalty on roaming to fix the races. Split up sta_info_flush() now to get rid of that again, and let managed mode (and only it) delay the actual destruction. Tested-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: warn if unexpectedly removing stationsJohannes Berg
When an interface is brought down it must have been disconnected (or similar) in all modes other than WDS, so warn if any stations were removed in other modes. Tested-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: remove final sta_info_flush()Johannes Berg
When all interfaces have been removed, there can't be any stations left over, so there's no need to flush again. Remove this, and all code associated with it, which also simplifies the function. Tested-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03wireless: more 'capability info' bitsVladimir Kondratiev
define bits for 'capability info', as in recent spec edition IEEE802.11-2012 Also, add mask for 2-bit field 'bss type', as it is in 802.11ad Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211_hwsim: allow testing paged RXJohannes Berg
Paged RX, i.e. SKBs with (some of) the data in pages instead of the SKB header data (skb->data) can behave differently in the stack and cause other bugs. To make debugging easier add an option to hwsim to test with such SKBs. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: use short slot time in mesh for 5GHzChun-Yeow Yeoh
Use short slot time in 5GHz for mesh. The performance is increased from 16.4Mbps to 23.4Mbps for two directly connected mesh STAs operating in legacy rate using iperf measurement. Almost similar to the results claimed in IBSS mode. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> [call ieee80211_get_sdata_band() only once] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: Allow disabling SGI-20Ben Greear
This allows user-space (wpa_supplicant) to disable short guard interval (SGI) for 20Mhz. The SGI-40 disable option is already handled. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03Merge remote-tracking branch 'mac80211/master' into HEADJohannes Berg
2013-01-03mac80211: fix maximum MTUChaitanya
The maximum MTU shouldn't take the headers into account, the maximum MSDU size is exactly the maximum MTU. Signed-off-by: T Krishna Chaitanya <chaitanyatk@posedge.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>