summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* mac80211: a few whitespace fixesJohannes Berg2012-12-101-2/+2
| | | | Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: return if CSA is not handleSimon Wunderlich2012-12-031-0/+1
| | | | | | | | If channel contexts are enabled, the CSA should not be processed further. A return is missing here. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: fix BSS struct IE access racesJohannes Berg2012-11-301-31/+49
| | | | | | | | | | | | | When a BSS struct is updated, the IEs are currently overwritten or freed. This can lead to races if some other CPU is accessing the BSS struct and using the IEs concurrently. Fix this by always allocating the IEs in a new struct that holds the data and length and protecting access to this new struct with RCU. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: support VHT associationJohannes Berg2012-11-271-72/+296
| | | | | | | | | Determine the VHT channel from the AP's VHT operation IE (if present) and configure the hardware to that channel if it is supported. If channel contexts cause a channel to not be usable, try a smaller bandwidth. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: convert to channel definition structJohannes Berg2012-11-261-11/+15
| | | | | | | | | | | | | | Convert mac80211 (and where necessary, some drivers a little bit) to the new channel definition struct. This will allow extending mac80211 for VHT, which is currently restricted to channel contexts since there are no drivers using that which makes it easier. As I also don't care about VHT for drivers not using the channel context API, I won't convert the previous API to VHT support. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: fix managed mode channel flags handlingJohannes Berg2012-11-261-9/+5
| | | | | | | | | | | | | | | | | | | | | If ieee80211_prep_channel() decides that HT should be disabled (because the HT IEs from the AP were invalid) it will set the IEEE80211_STA_DISABLE_HT to not send HT capabilities to the AP when associating. If this happens during authentication, the flag will be lost and we send HT frames, even if the channel config was set up for non-HT. This can lead to issues. Fix this by always resetting the ifmgd flags to zero when the channel context is released so that the flag resetting in ieee80211_mgd_assoc() isn't necessary. To make the code a bit easier move the call to release the channel in ieee80211_set_disassoc() to the end of the function together with the flag resetting (which needs to be at the end to avoid timers setting flags.) Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: disable HT advertising unless AP supports itJohannes Berg2012-11-231-0/+1
| | | | | | | | | | | If the AP doesn't support HT, or more importantly if it does but we have to disable it because its IEs are broken, don't advertise HT support in our association request. Otherwise, we configure our channel to be a 20 MHz non-HT channel but the AP might still think we support HT, or even 40 MHz. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: rename IEEE80211_STA_DISABLE_11N to HTJohannes Berg2012-11-231-8/+8
| | | | | | | | Since the 11n spec amendment was rolled into the 2012 version, "11n" no longer makes sense. Use "HT" instead. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: fix RX chains configurationJohannes Berg2012-11-231-16/+21
| | | | | | | | | | | | | | | | | | | | | | If the driver doesn't support 40 MHz channels, then mac80211 erroneously sets number of RX chains to one although the number of chains is independent of the support for 40 MHz channels. Fix this by checking the 40 MHz support only for the code that sets the 40 MHz channel not the complete HT code block. This also means the HT20 channel type will always be set in the changed code block so there's no need to set it in case we override the AP due to invalid IEs in the probe response/beacon. The indentation is a bit quirky, but I'm rewriting this code for VHT support so this will change again very soon. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: pass P2P powersave parameters to driverJohannes Berg2012-11-061-0/+40
| | | | | | | | While connected to a GO, parse the P2P NoA attribute and pass the CT Window and opportunistic powersave parameters to the driver. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: send deauth only with channel contextJohannes Berg2012-11-051-14/+18
| | | | | | | | | | | | | When userspace asks to deauthenticate and we're just authenticated (or still authenticating) send a deauth frame instead of deleting the auth request. On the other hand, if we've just disassociated and therefore deleted all our state already, drop the deauth request because we no longer have a channel context to send it on. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: handle TX power per virtual interfaceJohannes Berg2012-10-301-15/+17
| | | | | | | | | | | | | | | | | | | Even before channel contexts/multi-channel, having a single global TX power limit was already problematic, in particular if two managed interfaces connected to two APs with different power constraints. The channel context introduction completely broke this though and in fact I had disabled TX power configuration there for drivers using channel contexts. Change everything to track TX power per interface so that different user settings and different channel maxima are treated correctly. Also continue tracking the global TX power though for compatibility with applications that attempt to configure the wiphy's TX power globally. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Merge branch 'for-john' of ↵John W. Linville2012-10-291-5/+4
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
| * mac80211: remove duplicate check in ieee80211_rx_mgmt_beaconRami Rosen2012-10-251-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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 <ramirose@gmail.com> [reword commit message & break long lines and also clean up variable] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | Merge branch 'master' of ↵John W. Linville2012-10-231-11/+23
|\ \ | |/ |/| | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless Conflicts: drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c net/mac80211/mlme.c
| * mac80211: connect with HT20 if HT40 is not permittedJohannes Berg2012-10-171-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some changes to fix issues with HT40 APs in Korea and follow-up changes to allow using HT40 even if the local regulatory database disallows it caused issues with iwlwifi (and could cause issues with other devices); iwlwifi firmware would assert if you tried to connect to an AP that has an invalid configuration (e.g. using HT40- on channel 140.) Fix this, while avoiding the "Korean AP" issue by disabling HT40 and advertising HT20 to the AP when connecting. Cc: stable@vger.kernel.org [3.6] Reported-by: Florian Reitmeir <florian@reitmeir.org> Tested-by: Florian Reitmeir <florian@reitmeir.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * cfg80211/mac80211: avoid state mishmash on deauthStanislaw Gruszka2012-10-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Avoid situation when we are on associate state in mac80211 and on disassociate state in cfg80211. This can results on crash during modules unload (like showed on this thread: http://marc.info/?t=134373976300001&r=1&w=2) and possibly other problems. Reported-by: Pedro Francisco <pedrogfrancisco@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: remove some unused codeJohannes Berg2012-10-181-6/+1
| | | | | | | | | | | | | | | | | | | | There are a number of unused variables that gcc pointed out (when building with W=1) as well as some conditions that can never be true due to the datatypes used: unsigned values can't be less than zero. Remove this code. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: VHT peer STA capsMahesh Palivela2012-10-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Save the AP's VHT capabilities (in managed mode) and make them available to the driver in the station information. Unlike HT capabilities, they aren't restricted to the common capabilities, so drivers must be aware of their own capabilities. Signed-off-by: Mahesh Palivela <maheshp@posedge.com> [fix endian conversion bug ...] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | ieee80211: Rename VHT cap structMahesh Palivela2012-10-171-2/+2
| | | | | | | | | | | | | | | | Rename struct ieee80211_vht_capabilities to ieee80211_vht_cap and renamed its member vht_capabilities_info to vht_cap_info. Signed-off-by: Mahesh Palivela <maheshp@posedge.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: Allow station mode SAE to be implemented in user spaceJouni Malinen2012-10-171-5/+39
| | | | | | | | | | | | | | | | | | | | | | | | SAE uses two rounds of Authentication frames and both rounds require considerable calculation to be done. This commit extends the existing station mode authentication request to allow more control for user space programs to build the SAE fields and to run the authentication step ones. Only the second round with authentication transaction sequence 2 will result in moving to authenticated state. Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: Add debug print on unexpect authentication stateJouni Malinen2012-10-171-1/+6
| | | | | | | | | | | | | | This is useful when debugging authentication process issues. Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: Take status code as parameter to ieee80211_send_authJouni Malinen2012-10-171-2/+2
| | | | | | | | | | | | | | | | Non-zero status code may be needed for Authentication frames, e.g., when using SAE. Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: track needed RX chains for channel contextsJohannes Berg2012-10-171-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On each channel that the device is operating on, it may need to listen using one or more chains depending on the SMPS settings of the interfaces using it. The previous channel context changes completely removed this ability (before, it was available as the SMPS mode). Add per-context tracking of the required static and dynamic RX chains and notify the driver on changes. To achieve this, track the chains and SMPS mode used on each virtual interface and update the channel context whenever this changes. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: use channel contextsJohannes Berg2012-10-171-43/+86
|/ | | | | | | | | | | | | | | | | | | | | | | | | Instead of operating on a single channel only, use the new channel context infrastructure in all mac80211 code. This enables drivers that want to use the new channel context infrastructure to use multiple channels, while nothing should change for all the other drivers that don't support it. Right now this disables both TX power settings and spatial multiplexing powersave. Both need to be re-enabled on a channel context basis. Additionally, when channel contexts are used drop the connection when channel switch is received rather than trying to handle it. This will have to be improved later. [With fixes from Eliad and Emmanuel incorporated] Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: don't send delBA before disassocJohannes Berg2012-09-211-1/+1
| | | | | | | | When we disassociate, it's not really useful to send delBA action frames since we're going to send disassoc/deauth anyway, so change that. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: change locking around ieee80211_recalc_smpsJohannes Berg2012-09-141-1/+1
| | | | | | | Make the function acquire the necessary mutex itself to simplify the callers. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: handle power constraint/country IE betterJohannes Berg2012-09-141-16/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, mac80211 uses the power constraint IE, and reduces the regulatory max TX power by it. This can cause issues if the AP is advertising a large power constraint value matching a high TX power in its country IE, for example in this case: ... Country: US Environment: Indoor/Outdoor ... Channels [157 - 157] @ 30 dBm ... Power constraint: 13 dB ... What happened here is that our local regulatory TX power is 15 dBm, and gets reduced by 13 dB so we end up with only 2 dBm effective TX power, which is way too low. Instead, handle the country IE/power constraint IE combined and restrict our TX power to the max of the regulatory power and the maximum power advertised by the AP, in this case 17 dBm (= 30 dBm - 13 dB). Also print a message when this happens to let the user know and help us debug issues with it. Reported-by: Carl A. Cook <CACook@quantum-equities.com> Tested-by: Carl A. Cook <CACook@quantum-equities.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: move ieee80211_send_deauth_disassoc outside mlme codeAntonio Quartulli2012-09-071-50/+10
| | | | | | | | | Move ieee80211_send_deauth_disassoc() to util.c to make it available for the rest of the mac80211 code. Signed-off-by: Antonio Quartulli <ordex@autistici.org> [reword commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: check power constraint IE size when parsingJohannes Berg2012-09-061-8/+2
| | | | | | | The power constraint IE is always a single byte so check the size when parsing instead of later. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: disconnect if channel switch failsJohannes Berg2012-09-061-18/+37
| | | | | | | Disconnect from the AP if channel switching in the driver failed or if the new channel is unavailable. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Merge remote-tracking branch 'mac80211/master' into mac80211-nextJohannes Berg2012-09-061-0/+6
|\ | | | | | | | | | | | | | | | | | | Pull in mac80211.git to let the next patch apply without conflicts, also resolving a hwsim conflict. Conflicts: drivers/net/wireless/mac80211_hwsim.c Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211: clear bssid on auth/assoc failureEliad Peller2012-09-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | ifmgd->bssid wasn't cleared properly in some auth/assoc failure cases, causing mac80211 and the low-level driver to go out of sync. Clear ifmgd->bssid on failure, and notify the driver. Cc: stable@kernel.org # 3.4+ Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211: clear timer bits when disconnectingJohannes Berg2012-08-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | There's a corner case that can happen when we suspend with a timer running, then resume and disconnect. If we connect again, suspend and resume we might start timers that shouldn't be running. Reset the timer flags to avoid this. This affects both mesh and managed modes. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: pass channel to ieee80211_send_probe_reqJohannes Berg2012-08-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | In multi-channel scenarios, the channel that we will transmit a probe request on isn't always the current channel (which will be NULL anyway) but will instead be the channel that the AP is on. Pass the channel to the ieee80211_send_probe_req() function so it can be used in the different scenarios. The scan code continues to pass the current channel, of course. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: make ieee80211_beacon_connection_loss_work staticJohannes Berg2012-08-201-1/+1
| | | | | | | | | | | | | | | | There's no need to declare the function in the header file since it's only used in a single place, so make it static. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: check size of channel switch IE when parsingJohannes Berg2012-08-201-7/+3
| | | | | | | | | | | | | | | | The channel switch IE has a fixed size, so we can discard it in parsing if it's not the right size and use the right struct pointer. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: fix CSA handling timerJohannes Berg2012-08-201-3/+2
| | | | | | | | | | | | | | | | The time until the channel switch is in TU, not in milliseconds, so use TU_TO_EXP_TIME() to correctly program the timer. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: clean up CSA handling codeJohannes Berg2012-08-201-18/+16
| | | | | | | | | | | | | | | | | | | | | | Clean up the CSA handling code by moving some of it out of the if and using a C99 initializer for the struct passed to the driver method. While at it, also add a comment that we should wait for a beacon after switching the channel. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: remove unneeded 'bssid' variableJohannes Berg2012-08-201-4/+2
| | | | | | | | | | | | | | There's no need to copy the BSSID just to print it, remove the unnecessary variable. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: reset station MLME flags upon new associationJohannes Berg2012-08-011-4/+7
| | | | | | | | | | | | | | | | | | | | When associating anew, the old station MLME flags should be cleared. The only exception is the 40 MHz disable flag as it might have been set while the channel was set in a previous authentication attempt so it needs to be kept intact. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: fix current vs. operating channel in preq/beaconJohannes Berg2012-07-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | When sending probe requests, e.g. during software scanning, these will go out on the *current* channel, so their IEs need to be built from the current channel. At other times, e.g. for beacons or probe request templates, the IEs will be used on the *operating* channel and using the current channel instead might result in errors. Add the appropriate parameters to respect the difference. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: use oper_channel in managed mlmeJohannes Berg2012-07-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | Using hw.conf.channel is wrong as it could be the temporary channel if any function like the beacon get function is called while scanning or during other temporary out-of-channel activities. Use oper_channel instead. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: set channel only once during auth/assocJohannes Berg2012-07-311-26/+43
| | | | | | | | | | | | | | | | | | | | | | There's no need to set up the channel during auth and again during assoc, just do it once. Currently this doesn't result in any changes since calling hw_config() with an unchanged channel will return early, but with the channel context work this has an impact on channel context assignment. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: rename sta to new_staJohannes Berg2012-07-311-8/+8
| | | | | | | | | | | | | | | | In ieee80211_prep_connection(), the station (if not NULL) is the new station (representing the AP) that needs to be added. Rename the variable to "new_sta" to clarify this. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: supress HT/VHT disable if not supportedJohannes Berg2012-07-311-4/+6
| | | | | | | | | | | | | | | | If HT/VHT isn't supported by us we shouldn't print a message that we disabled it, do that only if the AP didn't support WMM and we therefore disable it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: add PS flag to bss_confEliad Peller2012-07-311-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, ps mode is indicated per device (rather than per interface), which doesn't make a lot of sense. Moreover, there are subtle bugs caused by the inability to indicate ps change along with other changes (e.g. when the AP deauth us, we'd like to indicate CHANGED_PS | CHANGED_ASSOC, as changing PS before notifying about disassociation will result in null-packets being sent (if IEEE80211_HW_SUPPORTS_DYNAMIC_PS) while the sta is already disconnected.) Keep the current per-device notifications, and add parallel per-vif notifications. In order to keep it simple, the per-device ps and the per-vif ps are orthogonal - the per-vif ps configuration is determined only by the user configuration (enable/disable) and the connection state, and is not affected by other vifs state and (temporary) dynamic_ps/offchannel operations (unlike per-device ps). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: don't call mgd_prepare_tx when associatedEmmanuel Grumbach2012-07-311-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | This doesn't make any sense since we are expected to be on the medium or at least to Tx only when we are on the right channel and the AP/GO can hear us. Move the call to mgd_prepare_tx() for deauth to be only done in case we're sending a deauth while not associated. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: don't react to beacon loss if HW monitoringJohannes Berg2012-07-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the HW is monitoring connection loss (as advertised by IEEE80211_HW_CONNECTION_MONITOR) but not filtering beacons (IEEE80211_VIF_BEACON_FILTER) then mac80211 will still start the beacon loss timer and if a few beacons are lost, e.g. due to scanning, drop the connection. If the hardware doesn't advertise connection monitoring, then it won't drop the connection right away but probe the AP, which is intended, but due to the logic in the timer when connection monitoring is done it assumes the connection was actually lost. Fix this problem by not starting the timer when the HW does connection monitoring. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: VHT (11ac) associationMahesh Palivela2012-07-311-2/+38
|/ | | | | | | | | Insert VHT IEs into association frames to allow mac80211 to connect as a VHT client. Signed-off-by: Mahesh Palivela <maheshp@posedge.com> [clarify commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>