summaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.c
Commit message (Collapse)AuthorAgeFilesLines
* mac80211: deinitialize ibss-internals after emptiness checkSimon Wunderlich2012-11-131-4/+4
| | | | | | | | | | | | | | | | | | The check whether the IBSS is active and can be removed should be performed before deinitializing the fields used for the check/search. Otherwise, the configured BSS will not be found and removed properly. To make it more clear for the future, rename sdata->u.ibss to the local pointer ifibss which is used within the checks. This behaviour was introduced by f3209bea110cade12e2b133da8b8499689cb0e2e ("mac80211: fix IBSS teardown race") Cc: stable@vger.kernel.org Cc: Ignacy Gawedzki <i@lri.fr> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: fix SSID copy on IBSS JOINAntonio Quartulli2012-10-261-1/+1
| | | | | | | | | | | | | | The 'ssid' field of the cfg80211_ibss_params is a u8 pointer and its length is likely to be less than IEEE80211_MAX_SSID_LEN most of the time. This patch fixes the ssid copy in ieee80211_ibss_join() by using the SSID length to prevent it from reading beyond the string. Cc: stable@vger.kernel.org Signed-off-by: Antonio Quartulli <ordex@autistici.org> [rewrapped commit message, small rewording] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: fix IBSS auth TX debug messageSylvain Roger Rieunier2012-09-201-1/+1
| | | | | | | | | In the IBSS auth TX debug message the BSSID and DA address are reversed, fix that. Signed-off-by: Sylvain Roger Rieunier <sylvain.roger.rieunier@gmail.com> [reword commit message and make it fit 72 cols] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: reply to AUTH with DEAUTH if sta allocation fails in IBSSAntonio Quartulli2012-09-071-1/+32
| | | | | | | | | | | Whenever a host gets an AUTH frame it first allocates a new station and then replies with another AUTH frame. However, if sta allocations fails the host should send a DEAUTH frame instead to tell the other end that something went wrong. Signed-off-by: Antonio Quartulli <ordex@autistici.org> [reword commit message a bit] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: add supported rates change notification in IBSSAntonio Quartulli2012-08-201-1/+4
| | | | | | | | | | | | | | | | In IBSS it is possible that the supported rates set for a station changes over time (e.g. it gets first initialised as an empty set because of no available information about rates and updated later). In this case the driver has to be notified about the change in order to update its internal table accordingly (if needed). This behaviour is needed by all those drivers that handle rc internally but leave stations management to mac80211 Reported-by: Gui Iribarren <gui@altermundi.net> Signed-off-by: Antonio Quartulli <ordex@autistici.org> [Johannes - add docs, validate IBSS mode only, fix compilation] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: use eth_broadcast_addrJohannes Berg2012-07-311-1/+1
| | | | | | Instead of memset(). Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: use oper_channel in ibssJohannes Berg2012-07-311-4/+4
| | | | | | | | | | | 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: clean up debuggingJohannes Berg2012-06-241-46/+43
| | | | | | | | | | | | | | | | | | There are a few things that make the logging and debugging in mac80211 less useful than it should be right now: * a lot of messages should be pr_info, not pr_debug * wholesale use of pr_debug makes it require *both* Kconfig and dynamic configuration * there are still a lot of ifdefs * the style is very inconsistent, sometimes the sdata->name is printed in front Clean up everything, introducing new macros and separating out the station MLME debugging into a new Kconfig symbol. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: two small verbose debug cleanupsJohannes Berg2012-06-221-1/+1
| | | | | | | Two instances of CONFIG_MAC80211_VERBOSE_DEBUG should be different, fix them. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: send auth in IBSS only if userspace isn't handling itWill Hawkins2012-06-201-1/+1
| | | | | | | | | | | | Check the auth frame registration count before sending "open system" authentication messages when a new station registers on a particular IBSS network. This stops us from sending out multiple authentication messages with different authentication algorithms. Signed-off-by: Will Hawkins <hawkinsw@opentechinstitute.org> [reword commit message a bit] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: simplify cfg80211_can_beacon_sec_chan APIJohannes Berg2012-06-051-2/+1
| | | | | | | | | | | | | Change cfg80211_can_beacon_sec_chan() to return true if there is no secondary channel to simplify all the current users of it. They all check the channel type before calling the function because it returns false if there's no secondary channel. Also actually document the return value. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* net: mac80211: Add and use ibss_vdbg debugging macroJoe Perches2012-06-051-51/+28
| | | | | | | | | | Simplify the use of #ifdef CONFIG_MAC80211_IBSS_DEBUG/#endif by adding a logging macro to encapsulate the test. Convert the appropriate uses too. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* net: mac80211: Convert printk(KERN_DEBUG to pr_debugJoe Perches2012-06-051-49/+39
| | | | | | | | | Standardize the debugging to be able to use dynamic_debug. Coalesce formats, align arguments. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-nextJohn W. Linville2012-05-221-0/+5
|\
| * mac80211: Push the deleted comment to correct placeAshok Nagarajan2012-05-161-0/+5
| | | | | | | | | | | | | | | | This comment is deleted in the patch "mac80211: Advertise HT protection mode in IEs". Moving the comment to the now corrected place. Signed-off-by: Ashok Nagarajan <ashok@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | net: Convert net_ratelimit uses to net_<level>_ratelimitedJoe Perches2012-05-151-6/+4
| | | | | | | | | | | | | | | | | | | | Standardize the net core ratelimited logging functions. Coalesce formats, align arguments. Change a printk then vprintk sequence to use printf extension %pV. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'master' of ↵David S. Miller2012-05-141-1/+1
|\ \ | |/ | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
| * mac80211: Advertise HT protection mode in IEsAshok Nagarajan2012-05-081-1/+1
| | | | | | | | | | | | Signed-off-by: Ashok Nagarajan <ashok@cozybit.com> Reviewed-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211: Convert compare_ether_addr to ether_addr_equalJoe Perches2012-05-091-6/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new bool function ether_addr_equal to add some clarity and reduce the likelihood for misuse of compare_ether_addr for sorting. Done via cocci script: $ cat compare_ether_addr.cocci @@ expression a,b; @@ - !compare_ether_addr(a, b) + ether_addr_equal(a, b) @@ expression a,b; @@ - compare_ether_addr(a, b) + !ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) == 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) != 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) == 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) != 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !!ether_addr_equal(a, b) + ether_addr_equal(a, b) Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-04-231-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | Fix merge between commit 3adadc08cc1e ("net ax25: Reorder ax25_exit to remove races") and commit 0ca7a4c87d27 ("net ax25: Simplify and cleanup the ax25 sysctl handling") The former moved around the sysctl register/unregister calls, the later simply removed them. With help from Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
| * mac80211: fix logic error in ibss channel type checkFelix Fietkau2012-04-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The broken check leads to rate control attempting to use HT40 while the driver is configured for HT20. This leads to interesting hardware issues. HT40 can only be used if the channel type is either HT40- or HT40+ and if the channel type of the cell matches the local type. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@vger.kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211: Modify sta_get_rates to give basic ratesAshok Nagarajan2012-04-111-2/+2
| | | | | | | | | | | | Signed-off-by: Ashok Nagarajan <ashok@cozybit.com> Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211: use IEEE80211_NUM_ACSJohannes Berg2012-04-101-1/+1
| | | | | | | | | | | | | | | | | | When comparing hw->queues to determine if the device is QoS capable, use IEEE80211_NUM_ACS instead of just 4. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | wireless: rename ht_info to ht_operationJohannes Berg2012-04-091-9/+7
|/ | | | | | | | | | | | | | | Since some of the HT code pre-dates 802.11n-2009 some names are wrong. The one that bothers me most is that "HT operation" is called "HT information" in our code and that causes confusion. Rename "HT information" to "HT operation" and also the control_chan field to primary_chan to match the name used in the spec. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: use compare_ether_addr on MAC addresses instead of memcmpFelix Fietkau2012-03-051-5/+5
| | | | | | | | | Because of the constant size and guaranteed 16 bit alignment, the inline compare_ether_addr function is much cheaper than calling memcmp. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: clean up asm/unaligned.h inclusionJohannes Berg2012-02-271-1/+0
| | | | | | | | | | | Some files implicitly get this via mesh.h which itself doesn't need it, so move the inclusion into the right files. Some other files don't need it at all but include it, so remove it from there. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* cfg80211/mac80211: userspace peer authorization in IBSSAntonio Quartulli2012-02-061-1/+5
| | | | | | | | If the IBSS network is RSN-protected, let userspace authorize the stations instead of adding them as AUTHORIZED by default. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2012-02-011-0/+1
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
| * mac80211: update oper_channel on ibss joinEliad Peller2012-01-241-0/+1
| | | | | | | | | | | | | | | | | | | | Commit 13c40c5 ("mac80211: Add HT operation modes for IBSS") broke ibss operation by mistakenly removing the local->oper_channel update (causing ibss to start on the wrong channel). fix it. Signed-off-by: Eliad Peller <eliad@wizery.com> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211: station state transition error handlingJohannes Berg2012-01-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the future, when we start notifying drivers, state transitions could potentially fail. To make it easier to distinguish between programming bugs and driver failures: * rename sta_info_move_state() to sta_info_pre_move_state() which can only be called before the station is inserted (and check this with a new station flag). * rename sta_info_move_state_checked() to just plain sta_info_move_state(), as it will be the regular function that can fail for more than just one reason (bad transition or an error from the driver) This makes the programming model easier -- one of the functions can only be called before insertion and can't fail, the other can fail. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | Revert "mac80211: Do not scan for IBSS merge with a fixed BSSID."John W. Linville2012-01-301-3/+2
| | | | | | | | | | | | | | | | | | This reverts commit f1e3be1561c43b6bbe2426e34849fb1486dc313b. Johannes Berg <johannes@sipsolutions.net> thinks that this patch is incorrect. I'll defer to his judgment. Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211: Do not scan for IBSS merge with a fixed BSSID.Nicolas Cavallari2012-01-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when we are on an IBSS network with no active station, we would scan for other BSSID, even if fixed_bssid is on, due to a bug in ibss.c, where fixed_channel would be checked instead of fixed_bssid. This would trigger useless scans where scan results would not be used anyway. This patch also reverts commit 39d02a7d90602d4557ee05db2a157a4e0, which assumed that the ifibss->fixed_channel check was legitimate to disable single-channel scans. IBSS single-channel scan should now be fixed. Signed-off-by: Nicolas Cavallari <cavallar@lri.fr> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211: in IBSS use the Auth frame to trigger STA reinsertionAntonio Quartulli2012-01-241-36/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | In case of a node re-joining the cell the sta_info structure belonging to it is first destroyed and then reinserted. In this way its internal state is reset. The joining operation is recognised thank the Auth frame being received. This operation is helpful in case of a node being rebooted that is joining the ad-hoc cell again, before its purge timeout on other nodes expires. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211: add a 2-way Authentication challenge to IBSS modeAntonio Quartulli2012-01-241-0/+7
| | | | | | | | | | | | | | | | | | In IBSS mode, whenever a new station is added a 2-way authentication challenge is performed. Actually this event can be used to recognise a new station joining the cell even if its sta_info entry is already in the list. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211: remove useless DA checking in ieee80211_rx_mgmt_probe_resp()Antonio Quartulli2012-01-241-3/+0
| | | | | | | | | | | | | | | | Actually the DA field has already been checked along the rx path (in prepare_for_handlers()) and this check is therefore useless at this point. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211: In IBSS the DA field of auth frames is different from BSSIDAntonio Quartulli2012-01-241-1/+1
| | | | | | | | | | | | | | | | In case of authentication frame exchange between two IBSS STAs, the DA field must contain the destinatioin address (instead of the BSSID). Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211: minor cleanupMohammed Shafi Shajakhan2012-01-241-2/+1
|/ | | | | | | | | | we would have bailed out if 'ifibss->fixed_channel' is valid i.e. we had used 'fixed-freq' parameter in iw ibss join command. this is with the state 'IEEE80211_IBSS_MLME_JOINED' so no need to check for it Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* net: reintroduce missing rcu_assign_pointer() callsEric Dumazet2012-01-121-1/+1
| | | | | | | | | | | | | | commit a9b3cd7f32 (rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER) did a lot of incorrect changes, since it did a complete conversion of rcu_assign_pointer(x, y) to RCU_INIT_POINTER(x, y). We miss needed barriers, even on x86, when y is not NULL. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> CC: Stephen Hemminger <shemminger@vyatta.com> CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mac80211: delay IBSS station insertionJohannes Berg2011-12-151-32/+122
| | | | | | | | | | | | | | | In order to notify drivers and simplify the station management code, defer IBSS station insertion to a work item and don't do it directly while receiving a frame. This increases the complexity in IBSS a little bit, but it's pretty straight forward and it allows us to reduce the station management complexity (next patch) considerably. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: refactor station state transitionsJohannes Berg2011-12-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Station entries can have various states, the most important ones being auth, assoc and authorized. This patch prepares us for telling the driver about these states, we don't want to confuse drivers with strange transitions, so with this we enforce that they move in the right order between them (back and forth); some transitions might happen before the driver even knows about the station, but at least runtime transitions will be ordered correctly. As a consequence, IBSS and MESH stations will now have the ASSOC flag set (so they can transition to AUTHORIZED), and we can get rid of a special case in TX processing. When freeing a station, unwind the state so that other parts of the code (or drivers later) can rely on the transitions. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: free skb on error path of ieee80211_ibss_join()Simon Wunderlich2011-12-141-0/+1
| | | | | | | | Our new return also created a memleak. The skb should be freed before returning an error. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: unlock on error path in ieee80211_ibss_join()Dan Carpenter2011-12-131-1/+3
| | | | | | | We recently introduced a new return here but it needs an unlock first. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Add HT operation modes for IBSSAlexander Simon2011-12-061-9/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HT mode is set by iw (previous patchsets). The interface is set into the specified HT mode. HT mode and capabilities are announced in beacons. If we add a station that uses HT also, the fastest matching HT mode will be used for transmission. That means if we are using HT40+ and we add a station running on HT40-, we would transfer at HT20. If we join an IBSS with HT40, but the secondary channel is not available, we will fall back into HT20 as well. Allow frame aggregation to start in IBSS mode. Signed-off-by: Alexander Simon <an.alexsimon@googlemail.com> [siwu@hrz.tu-chemnitz.de: Updates] * remove implicit channel_type enum assumptions * use rate_control_rate_init() if channel type changed * remove channel flags check * activate HT IBSS feature support * slightly reword commit message * rebase on wireless-testing Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: handle protection mode, RIFS and ADDBA for HT IBSSSimon Wunderlich2011-12-061-0/+18
| | | | | | | | | | * Follow 802.11n-2009 9.13.3.1 for protection mode and ADDBA * Send ADDBA only to HT STAs - implement 11.5.1.1 partially Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: set carrier_on for ibss vifs only while joinedEliad Peller2011-11-111-0/+3
| | | | | | | | 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>
* Merge branch 'master' of ↵John W. Linville2011-10-111-2/+2
|\ | | | | | | | | | | | | git://git.infradead.org/users/linville/wireless-next into for-davem Conflicts: Documentation/feature-removal-schedule.txt
| * mac80211: optimise station flagsJohannes Berg2011-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The flaglock in struct sta_info has long been something that I wanted to get rid of, this finally does the conversion to atomic bitops. The conversion itself is straight-forward in most places, a few things needed to change a bit since we can no longer use multiple bits at the same time. On x86-64, this is a fairly significant code size reduction: text data bss dec hex 427861 23648 1008 452517 6e7a5 before 425383 23648 976 450007 6ddd7 after Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | Merge branch 'master' of ↵John W. Linville2011-09-301-3/+3
|\ \ | |/ | | | | | | | | | | | | git://git.infradead.org/users/linville/wireless-next into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-pci.c drivers/net/wireless/wl12xx/main.c
| * mac80211: add ieee80211_vif param to tsf functionsEliad Peller2011-09-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | TSF can be kept per vif. Add ieee80211_vif param to set/get/reset_tsf, and move the debugfs entries to the per-vif directory. Update all the drivers that implement these callbacks. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mac80211: fix indentationAlexander Simon2011-09-201-1/+1
| | | | | | | | | | Signed-off-by: Alexander Simon <an.alexsimon@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud