summaryrefslogtreecommitdiffstats
path: root/net/mac80211
Commit message (Collapse)AuthorAgeFilesLines
* mac80211: fix key replacing, hw accelJohannes Berg2008-02-291-7/+20
| | | | | | | | | | | | | | | | | | | | Even though I thought about it a lot and had also tested it, some of my recent changes in the key code broke replacing keys, making the kernel oops because a key is removed from a list while not on it. This patch fixes that using the list as an indication whether or not the key is on it (an empty list means it's not on any list.) Also, this patch fixes hw accel enabling, the check for not doing hw accel when the interface is down was lost and is restored by this. Additionally, move adding the key to the list into the function __ieee80211_key_replace() for more consistency. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: split ieee80211_key_alloc/freeJohannes Berg2008-02-295-98/+203
| | | | | | | | | | | | | | | | | | | | In order to RCU-ify sta_info, we need to be able to allocate a key without linking it to an sdata/sta structure (because allocation cannot be done in an rcu critical section). This patch splits up ieee80211_key_alloc() and updates all users appropriately. While at it, this patch fixes a number of race conditions such as finally making key replacement atomic, unfortunately at the expense of more complex code. Note that this patch documents /existing/ bugs with sta info and key interaction, there is currently a race condition when a sta info is freed without holding the RTNL. This will finally be fixed by a followup patch. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: remove STA infos last_ack stuffJohannes Berg2008-02-294-39/+0
| | | | | | | | | | These things aren't used and the only possible use is within rate control algorithms, however those can, if they need it, keep track of it in their private data. last_ack_ms isn't even updated so completely useless. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: safely free beacon in ieee80211_if_reinitJohannes Berg2008-02-291-1/+5
| | | | | | | | | | | If ieee80211_if_reinit() is called from ieee80211_unregister_hw() then it is possible that the driver will still request a beacon (it is allowed to until ieee80211_unregister_hw() has returned.) This means we need to use an RCU-protected write to the beacon information even in this function. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: fix IBSS codeJohannes Berg2008-02-291-3/+3
| | | | | | | | | | | | | | | | | | This patch fixes two errors introduced by commit 19d35612f3cd7f60dd9174c0100584e21f5a1025 Author: Bruno Randolf <bruno@thinktube.com> Date: Mon Feb 18 11:21:36 2008 +0900 mac80211: enable IBSS merging The first error is an endianness problem that sparse found and the second is a build failure when CONFIG_MAC80211_IBSS_DEBUG is not set. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Cc: Bruno Randolf <bruno@thinktube.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: fix debugfs_sta print_mac() warningJohannes Berg2008-02-291-2/+3
| | | | | | | | | | | When print_mac() was marked as __pure to avoid emitting a function call in pr_debug() scenarios, a warning in this code surfaced since it relies on the fact that the buffer is modified and doesn't use the return value. This patch makes it use the return value instead. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Reported-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Disallow concurrent IBSS/STA mode interfacesJohannes Berg2008-02-291-4/+47
| | | | | | | | | | | Disallow having more than one IBSS interface up at any time because of beacon distribution issues, and for now also disallow having more than one IBSS/STA interface up at the same time because we use the master interface's BSS struct which would be completely corrupted when we have more than one up. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: atomically check whether STA exists alreadyJohannes Berg2008-02-295-27/+36
| | | | | | | | | | | | | | When a STA structure is added, it is often checked whether it already exists before adding it. This, however, isn't done atomically so there is a race condition that could lead to two STA structures being added with the same MAC address. This patch changes sta_info_add() to return an ERR_PTR in case of failure and adds the failure mode -EEXIST when the STA already exists. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Cc: Luis Carlos Cobo <luisca@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: rework TX filtered frame codeJohannes Berg2008-02-293-50/+89
| | | | | | | | | | | This reworks the code for TX filtered frames, splitting it out to a new function to handle those cases, making the clear instruction a flag and renaming a few things to be easier to understand and less Atheros hardware specific. Finally, it also makes the comments explain more. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: fix incorrect use of CONFIG_MAC80211_IBSS_DEBUGPavel Roskin2008-02-291-1/+3
| | | | | | | Configuration variables are only available to the preprocessor Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: consolidate TIM handling codeJohannes Berg2008-02-295-83/+84
| | | | | | | | | | This consolidates all TIM handling code to avoid re-introducing errors with the bitmap/set_tim order and to reduce code. While reading the code I noticed a possible problem so I also added a comment about that. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: remove sta TIM flag, fix expiry TIM handlingJohannes Berg2008-02-295-25/+28
| | | | | | | | | | | The TIM flag that is kept in each station's info is completely useless, there's no code (aside from the debugfs display code) checking it, hence it can be removed. While doing that, I noticed that the TIM handling is broken when buffered frames expire, so fix that. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: invoke set_tim() callback after setting own TIM infoJohannes Berg2008-02-293-8/+8
| | | | | | | | | | | Drivers should be allowed to simply get a complete new beacon when set_tim() is invoked (and set_tim() is required for drivers that just want a beacon template!), so we need to update our own TIM bitmap before calling set_tim() so that getting the beacon will now get an already updated beacon. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: convert sta_info.pspoll to a flagJohannes Berg2008-02-293-9/+12
| | | | | | | | This doesn't really need to be a full int variable since it's just a flag to indicate a PS-poll is in progress. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: enable IBSS mergingBruno Randolf2008-02-292-30/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enable IBSS cell merging. if an IBSS beacon with the same channel, same ESSID and a TSF higher than the local TSF (mactime) is received, we have to join its BSSID. while this might not be immediately apparent from reading the 802.11 standard it is compliant and necessary to make IBSS mode functional in many cases. most drivers have a similar behaviour. * move the relevant code section (previously only containing debug code) down to the end of the function, so we can reuse the bss structure. * we have to compare the mactime (TSF at the time of packet receive) rather than the current TSF. since mactime is defined as the time the first data symbol arrived we add the time until byte 24 where the timestamp resides, since this is how the beacon timestamp is defined. as some some drivers are not able to give a reliable mactime we fall back to use the current TSF, which will be enough to catch most (but not all) cases where an IBSS merge is necessary. * in IBSS mode we want to allow beacons to override probe response info so we can correctly do merges. * we don't only configure beacons based on scan results, so change that message. * to enable this we have to let all beacons thru in IBSS mode, even if they have a different BSSID. Signed-off-by: Bruno Randolf <bruno@thinktube.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: move function ieee80211_sta_join_ibss()Bruno Randolf2008-02-291-158/+159
| | | | | | | | this moves ieee80211_sta_join_ibss() up for the next patch (ibss merge). Signed-off-by: Bruno Randolf <bruno@thinktube.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* net/mac80211/: Use time_* macrosS.Çağlar Onur2008-02-292-2/+4
| | | | | | | | | | The functions time_before, time_before_eq, time_after, and time_after_eq are more robust for comparing jiffies against other values. So following patch implements usage of the time_after() macro, defined at linux/jiffies.h, which deals with wrapping correctly Cc: linux-wireless@vger.kernel.org Signed-off-by: S.Çağlar Onur <caglar@pardus.org.tr> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: fix ecw2cw brain-damageJohannes Berg2008-02-291-6/+1
| | | | | | | This brain-damaged code just bothers me, fix it. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: give burst time in txop rather than 0.1msec unitsJohannes Berg2008-02-291-5/+6
| | | | | | | | | | | | | This changes mac80211 to pass the burst time to conf_tx in txop units rather than 0.1msec units. 0.1msec units are only required by atheros hardware (according to current driver support), all other drivers do other calculations or require the txop value. Therefore, it results in fewer calculations and more precision if we just pass the txop value through to the driver. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: defer master netdev allocation to ieee80211_register_hwJohannes Berg2008-02-291-34/+38
| | | | | | | | | | | When we want to go multiqueue, we will need to know the number of queues the hardware has for registering the master netdev. This number is only available in ieee80211_register_hw() rather than ieee80211_alloc_hw(), so defer allocation of the master device to ieee80211_register_hw(). Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: adjustable number of bits for qdisc poolRon Rindjunsky2008-02-291-9/+9
| | | | | | | | | This fix allows to control the number of bits that qdiscs book keeping can be done for with respect to the qdisc pool Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Add cooked monitor mode supportMichael Wu2008-02-293-31/+126
| | | | | | | | | | This adds "cooked" monitor mode to mac80211. A monitor interface in "cooked" mode will see all frames that mac80211 has not used internally. Signed-off-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: move some code into ieee80211_invoke_rx_handlersJohannes Berg2008-02-291-24/+18
| | | | | | | | | There is some duplicated code that sits in front of each function call to ieee80211_invoke_rx_handlers() that can very well be part of that function if it gets slightly different arguments. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: remove "dynamic" RX/TX handlersJohannes Berg2008-02-294-61/+43
| | | | | | | | | It doesn't really make sense to have extra pointers to the RX/TX handler arrays instead of just using the arrays directly, that also allows us to make them static. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: clean up some things in the RX pathJohannes Berg2008-02-291-27/+10
| | | | | | | | | | Uninline ieee80211_invoke_rx_handlers to save .text space, make the code more readable in some places and remove the "optimisation" that is hit only very few times and unclear to start with. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Use monitor configuration flagsMichael Wu2008-02-294-16/+60
| | | | | | | | Take advantage of the monitor configuration flags now provided by cfg80211. Signed-off-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* nl80211: Add monitor interface configuration flagsMichael Wu2008-02-291-2/+2
| | | | | | | | This allows precise control over what a monitor interface shows. Signed-off-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: split RX_DROPJohannes Berg2008-02-295-43/+45
| | | | | | | | | | Some instances of RX_DROP mean that the frame was useless, others mean that the frame should be visible in userspace on "cooked" monitor interfaces. This patch splits up RX_DROP and changes each instance appropriately. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: split ieee80211_txrx_resultJohannes Berg2008-02-298-197/+204
| | | | | | | | | | The _DROP result will need to be split in the RX path but not in the TX path, so for preparation split up the type into two types, one for RX and one for TX. Also make sure (via sparse) that they cannot be confused. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rc80211-pid: fix rate adjustmentStefano Brivio2008-02-291-49/+44
| | | | | | | | | | | | Merge rate_control_pid_shift_adjust() to rate_control_pid_adjust_rate() in order to make the learning algorithm aware of constraints on rates. Also add some comments and rename variables. This fixes a bug which prevented 802.11b/g non-AP STAs from working with 802.11b only AP STAs. Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: remove port control enable switch, clean up sta flagsJohannes Berg2008-02-298-45/+44
| | | | | | | | | | | | | | | This patch removes the 802.1X port acess control enable flag since it is not required. Instead, set the authorized flag for each station that we normally communicate with (WDS peers, IBSS peers and APs we're associated to) and require hostapd to set the authorized flag for all stations when port control is not enabled. Also, since I was working in that area, this documents station flags and removes the unused "permanent" one. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: fix scan band off-by-one errorJohannes Berg2008-02-291-6/+18
| | | | | | | | | | | | | When checking for the next band to advance to, there was an off-by-one error that could lead to an access to an invalid array index. Additionally, the later check for scan_band >= IEEE80211_NUM_BANDS is not required since that will never be true. This also improves the comments related to that code. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* cfg80211 API for channels/bitrates, mac80211 and driver conversionJohannes Berg2008-02-2919-918/+606
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch creates new cfg80211 wiphy API for channel and bitrate registration and converts mac80211 and drivers to the new API. The old mac80211 API is completely ripped out. All drivers (except ath5k) are updated to the new API, in many cases I expect that optimisations can be done. Along with the regulatory code I've also ripped out the IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED flag, I believe it to be unnecessary if the hardware simply gives us whatever channels it wants to support and we then enable/disable them as required, which is pretty much required for travelling. Additionally, the patch adds proper "basic" rate handling for STA mode interface, AP mode interface will have to have new API added to allow userspace to set the basic rate set, currently it'll be empty... However, the basic rate handling will need to be moved to the BSS conf stuff. I do expect there to be bugs in this, especially wrt. transmit power handling where I'm basically clueless about how it should work. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: dissolve pre-rx handlersJohannes Berg2008-02-293-62/+37
| | | | | | | | | These handlers do not really return a status and the compiler can do a much better job when they're simply static functions that it can inline if appropriate. Also makes the code shorter. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: A-MPDU Tx add delBA from recipient supportRon Rindjunsky2008-02-291-2/+11
| | | | | | | | This patch adds the ability to handle delBA from recipient to initiator during an A-MPDU session Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: A-MPDU add debugfs supportRon Rindjunsky2008-02-292-0/+117
| | | | | | | | This patch adds A-MPDU status report per STA to the debugfs. The option to de/activate A-MPDU through debugfs is also present. Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: A-MPDU Tx MLME data initializationRon Rindjunsky2008-02-291-1/+12
| | | | | | | This patch initialize A-MPDU MLME data for Tx sessions. Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: A-MPDU Tx adding qdisc supportRon Rindjunsky2008-02-295-18/+155
| | | | | | | | This patch allows qdisc support in A-MPDU Tx. a method to handle QoS <-> TID switches is present in this patch. Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: A-MPDU Tx adding basic functionalityRon Rindjunsky2008-02-293-2/+530
| | | | | | | | | | | | This patch adds the following abilities to mac80211: - start A-MPDU Tx session - stop A-MPDU Tx session - call backs to start/stop A-MPDU Tx session - sending addBA request - processing addBA response Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: A-MPDU Tx add MLME structuresRon Rindjunsky2008-02-291-3/+33
| | | | | | | | | | | | | | This patch adds the needed structures to describe the Tx aggregation MLME per STA new: - struct tid_ampdu_tx: TID aggregation information (Tx) changed: - struct sta_ampdu_mlme: Tx aggregation information per TID and dialog token creator were added - struct sta_info: tid_to_tx_q added for tid<->tx queue mapping Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: A-MPDU Tx add session's and low level driver's APIRon Rindjunsky2008-02-291-2/+2
| | | | | | | | | | | | | | | | This patch adds the API for 3 stages in A-MPDU Tx session flow: - request mac80211 to start/stop A-MPDU Tx session for specific TID. such a request should be issued by a load aware element, either mac80211 itself or external element. - requests by mac80211 to low-level driver to start/stop Tx aggregation. notice that low level driver responds now with Starting Sequence Number. - async feedback by low-level to mac80211 to inform that HW is ready for next A-MPDU Tx state. Changes in API to Rx A-MPDU were also made, reflected in iwlwifi changes as well. Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: allow sending multicast frames through virtual portsJohannes Berg2008-02-291-6/+15
| | | | | | | | | | When reworking the port access control code, I forgot multicast frames and those are now always rejected because the destination station is not known. This changes the code to allow through multicast frames and also avoid the sta hash lookup (which is bound to fail) for them. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: set assoc flag to bss_confTomas Winkler2008-02-291-0/+1
| | | | | | | | | Only BSS_CHANGED_ASSOC was set in the 'changed' bitmask. Assignment to bss_conf.assoc was absent. This patch assign value to bss_conf.assoc according the association state. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: fix kmalloc vs. net_ratelimitJohannes Berg2008-02-281-3/+4
| | | | | | | The "goto end;" part definitely must not be rate limited. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Fix initial hardware configurationMichael Buesch2008-02-151-1/+4
| | | | | | | | | On the initial device-open we need to defer the hardware reconfiguration after we incremented the open_count, because the hw_config checks this flag and won't call the lowlevel driver in case it is zero. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Is not EXPERIMENTAL anymoreMichael Buesch2008-02-051-1/+0
| | | | | | | | Remove the EXPERIMENTAL dependency, as the existing mac80211 features are stable. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: fix initialisation error pathJohannes Berg2008-02-011-7/+7
| | | | | | | | | The error handling in ieee80211_init() is broken when any of the built-in rate control algorithms fail to initialise, fix it and rename the error labels. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211 rate control: fix section mismatchJohannes Berg2008-02-012-2/+2
| | | | | | | | | | When the rate control algorithms are built-in, their exit functions can be called from mac80211's init function so they cannot be marked __exit. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: make alignment warning optionalJohannes Berg2008-02-012-0/+19
| | | | | | | | | | | | | Driver authors should be aware of the alignment requirements, but not everybody cares about the warning. This patch makes it depend on a new Kconfig symbol MAC80211_DEBUG_PACKET_ALIGNMENT which can be enabled regardless of MAC80211_DEBUG and is recommended for driver authors (only). This also restricts the warning to data packets so other packets need not be realigned to not trigger the warning. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: fixing null qos data frames check for reordering bufferRon Rindjunsky2008-01-311-1/+1
| | | | | | | | | This patch fixes a wrong condition for null qos data frames, causing us to drop data frames needed for reordering as well. Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
OpenPOWER on IntegriCloud