aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-06-24mac80211: clean up debuggingJohannes Berg1-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>
2012-06-22mac80211: two small verbose debug cleanupsJohannes Berg1-1/+1
Two instances of CONFIG_MAC80211_VERBOSE_DEBUG should be different, fix them. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-20mac80211: send auth in IBSS only if userspace isn't handling itWill Hawkins1-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>
2012-06-05cfg80211: simplify cfg80211_can_beacon_sec_chan APIJohannes Berg1-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>
2012-06-05net: mac80211: Add and use ibss_vdbg debugging macroJoe Perches1-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>
2012-06-05net: mac80211: Convert printk(KERN_DEBUG to pr_debugJoe Perches1-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>
2012-05-22Merge git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-nextJohn W. Linville1-0/+5
2012-05-16mac80211: Push the deleted comment to correct placeAshok Nagarajan1-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>
2012-05-15net: Convert net_ratelimit uses to net_<level>_ratelimitedJoe Perches1-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>
2012-05-14Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-nextDavid S. Miller1-1/+1
2012-05-09mac80211: Convert compare_ether_addr to ether_addr_equalJoe Perches1-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>
2012-05-08mac80211: Advertise HT protection mode in IEsAshok Nagarajan1-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>
2012-04-23Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-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>
2012-04-17mac80211: fix logic error in ibss channel type checkFelix Fietkau1-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>
2012-04-11mac80211: Modify sta_get_rates to give basic ratesAshok Nagarajan1-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>
2012-04-10mac80211: use IEEE80211_NUM_ACSJohannes Berg1-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>
2012-04-09wireless: rename ht_info to ht_operationJohannes Berg1-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>
2012-03-05mac80211: use compare_ether_addr on MAC addresses instead of memcmpFelix Fietkau1-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>
2012-02-27mac80211: clean up asm/unaligned.h inclusionJohannes Berg1-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>
2012-02-06cfg80211/mac80211: userspace peer authorization in IBSSAntonio Quartulli1-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>
2012-02-01Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirelessJohn W. Linville1-0/+1
2012-01-30mac80211: station state transition error handlingJohannes Berg1-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>
2012-01-30Revert "mac80211: Do not scan for IBSS merge with a fixed BSSID."John W. Linville1-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>
2012-01-27mac80211: Do not scan for IBSS merge with a fixed BSSID.Nicolas Cavallari1-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>
2012-01-24mac80211: update oper_channel on ibss joinEliad Peller1-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>
2012-01-24mac80211: in IBSS use the Auth frame to trigger STA reinsertionAntonio Quartulli1-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>
2012-01-24mac80211: add a 2-way Authentication challenge to IBSS modeAntonio Quartulli1-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>
2012-01-24mac80211: remove useless DA checking in ieee80211_rx_mgmt_probe_resp()Antonio Quartulli1-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>
2012-01-24mac80211: In IBSS the DA field of auth frames is different from BSSIDAntonio Quartulli1-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>
2012-01-24mac80211: minor cleanupMohammed Shafi Shajakhan1-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>
2012-01-12net: reintroduce missing rcu_assign_pointer() callsEric Dumazet1-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>
2011-12-15mac80211: delay IBSS station insertionJohannes Berg1-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>
2011-12-15mac80211: refactor station state transitionsJohannes Berg1-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>
2011-12-14mac80211: free skb on error path of ieee80211_ibss_join()Simon Wunderlich1-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>
2011-12-13mac80211: unlock on error path in ieee80211_ibss_join()Dan Carpenter1-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>
2011-12-06mac80211: Add HT operation modes for IBSSAlexander Simon1-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>
2011-12-06mac80211: handle protection mode, RIFS and ADDBA for HT IBSSSimon Wunderlich1-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>
2011-11-11mac80211: set carrier_on for ibss vifs only while joinedEliad Peller1-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>
2011-10-11Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into for-davemJohn W. Linville1-2/+2
Conflicts: Documentation/feature-removal-schedule.txt
2011-09-30mac80211: optimise station flagsJohannes Berg1-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>
2011-09-30Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into for-davemJohn W. Linville1-3/+3
Conflicts: drivers/net/wireless/iwlwifi/iwl-pci.c drivers/net/wireless/wl12xx/main.c
2011-09-27mac80211: add ieee80211_vif param to tsf functionsEliad Peller1-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>
2011-09-20mac80211: fix indentationAlexander Simon1-1/+1
Signed-off-by: Alexander Simon <an.alexsimon@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-02rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTERStephen Hemminger1-3/+3
When assigning a NULL value to an RCU protected pointer, no barrier is needed. The rcu_assign_pointer, used to handle that but will soon change to not handle the special case. Convert all rcu_assign_pointer of NULL value. //smpl @@ expression P; @@ - rcu_assign_pointer(P, NULL) + RCU_INIT_POINTER(P, NULL) // </smpl> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-08mac80211: fix IBSS teardown raceJohannes Berg1-2/+4
Ignacy reports that sometimes after leaving an IBSS joining a new one didn't work because there still were stations on the list. He fixed it by flushing stations when attempting to join a new IBSS, but this shouldn't be happening in the first case. When I looked into it I saw a race condition in teardown that could cause stations to be added after flush, and thus cause this situation. Ignacy confirms that after applying my patch he hasn't seen this happen again. Reported-by: Ignacy Gawedzki <i@lri.fr> Debugged-by: Ignacy Gawedzki <i@lri.fr> Tested-by: Ignacy Gawedzki <i@lri.fr> Cc: stable@kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-16mac80211: sparse RCU annotationsJohannes Berg1-3/+8
This adds sparse RCU annotations to most of mac80211, only the mesh code remains to be done. Due the the previous patches, the annotations are pretty simple. The only thing that this actually changes is removing the RCU usage of key->sta in debugfs since this pointer isn't actually an RCU-managed pointer (it only has a single assignment done before the key even goes live). As that is otherwise harmless, I decided to make it part of this patch. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-26mac80211: Fix warnings due to -Wunused-but-set-variableRajkumar Manoharan1-6/+1
These warnings are exposed by gcc 4.6. net/mac80211/sta_info.c: In function 'sta_info_cleanup_expire_buffered': net/mac80211/sta_info.c:590:32: warning: variable 'sdata' set but not used net/mac80211/ibss.c: In function 'ieee80211_rx_mgmt_auth_ibss': net/mac80211/ibss.c:43:34: warning: variable 'status_code' set but not used net/mac80211/work.c: In function 'ieee80211_send_assoc': net/mac80211/work.c:203:9: warning: variable 'len' set but not used net/mac80211/tx.c: In function '__ieee80211_parse_tx_radiotap': net/mac80211/tx.c:1039:35: warning: variable 'sband' set but not used net/mac80211/mesh.c: In function 'ieee80211_mesh_rx_queued_mgmt': net/mac80211/mesh.c:616:28: warning: variable 'ifmsh' set but not used ... Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-04mac80211: fix suppressing probe responses in ad-hoc modeFelix Fietkau1-2/+1
The commit "mac80211: reply to directed probes in IBSS" changed ad-hoc specific code to respond to unicast probe requests, even if drv_tx_last_beacon returns false, however due to confusion over the meaning of the IEEE80211_RX_RA_MATCH flag, it also unconditionally enabled responding to multicast probe requests. Fix this by explicitly checking for a multicast destination address instead. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-25mac80211: remove IBSS merge delayJohannes Berg1-5/+0
This reverts 4a332a38 ("mac80211: Give it some time to do the TSF sync"). There's no point in waiting with a new IBSS merge just because the hardware hasn't merged up with the old IBSS yet, and since 34e8f082 we no longer attempt to merge with the IBSS we're already in. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23mac80211: rename RX_FLAG_TSFTJohannes Berg1-1/+1
The flag isn't very descriptive -- the intention is that the driver provides a TSF timestamp at the beginning of the MPDU -- make that clearer by renaming the flag to RX_FLAG_MACTIME_MPDU. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>