summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* cfg80211: remove regulatory_update()Luis R. Rodriguez2012-07-171-10/+2
| | | | | | | | | | regulatory_update() just calls wiphy_update_regulatory(). wiphy_update_regulatory() assumes you already have the reg_mutex held so just move the call within locking context and kill the superfluous regulatory_update(). Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: make regulatory_update() staticLuis R. Rodriguez2012-07-173-4/+4
| | | | | | | | | Now that we have wiphy_regulatory_register() we can tuck away the core's regulatory_update() call there and make it static. Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: rename reg_device_remove() to wiphy_regulatory_deregister()Luis R. Rodriguez2012-07-173-5/+7
| | | | | | | | | | This makes it clearer what we're doing. This now makes a bit more sense given that regardless of the wiphy if the cell base station hint feature is supported we will be modifying the way the regulatory core behaves. Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: add cellular base station regulatory hint supportLuis R. Rodriguez2012-07-176-8/+171
| | | | | | | | | | | | | | | | | | Cellular base stations can provide hints to cfg80211 about where they think we are. This can be done for example on a cell phone. To enable these hints we simply allow them through as user regulatory hints but we allow userspace to clasify the hint as either coming directly from the user or coming from a cellular base station. This option is only available when you enable CONFIG_CFG80211_CERTIFICATION_ONUS. The base station hints themselves will not be processed by the core unless at least one device on the system supports this feature. Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: add CONFIG_CFG80211_CERTIFICATION_ONUSLuis R. Rodriguez2012-07-171-0/+21
| | | | | | | | | | | | | | | | | | | | This adds CONFIG_CFG80211_CERTIFICATION_ONUS which is to be used for features / code which require a bit of work on the system integrator's part to ensure that the system will still pass 802.11 regulatory certification. This option is also usable for researchers and experimenters looking to add code in the kernel without impacting compliant code. We'd use CONFIG_EXPERT alone but it seems that most standard Linux distributions are enabling CONFIG_EXPERT already. This allows us to define 802.11 specific kernel features under a flag that is intended by design to be disabled by standard Linux distributions, and only enabled by system integrators or distributions that have done work to ensure regulatory certification on the system with the enabled features. Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: fix set_regdom() to cancel requests with same alpha2Kalle Valo2012-07-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | While adding regulatory support to ath6kl I noticed that I easily got the regulatory code confused. The way to reproduce the bug was: 1. iw reg set FI (in userspace) 2. cfg80211 calls ath6kl_reg_notify(FI) 3. ath6kl sets regdomain in firmware 4. firmware sends regdomain event to notify about the new regdomain (FI) 5. ath6kl calls regulatory_hint(FI) And this (from FI to FI transition) confuses cfg80211 and after that I only get "Pending regulatory request, waiting for it to be processed...." messages and regdomain changes won't work anymore. The reason why ath6kl calls regulatory_hint() is that firmware can change the regulatory domain by it's own, for example due to 11d IEs. I could of course workaround this in ath6kl but I think it's better to handle the case in cfg80211. The fix is pretty simple, use a different error code if the regdomain is same and then just set the request processed so that it doesn't block new requests. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: support TX error rate CQMThomas Pedersen2012-07-175-0/+140
| | | | | | | | | | | | Let the user configure serveral TX error conection quality monitoring parameters: % error rate, survey interval, and # of attempted packets. On exceeding the TX failure rate over the given interval, the driver will send a CQM notify event with the actual TX failure rate and packets attempted. Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: add wdev ID as u64 as it shouldJohannes Berg2012-07-171-1/+1
| | | | | | | | In one of my previous patches I erroneously used nla_put_u32 for the wdev_id, fix that to use nla_put_u64. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: fix race condition with sta/vif pointersThomas Huehn2012-07-171-5/+0
| | | | | | | | | | info->control.sta and control.vif may only be dereferenced during the drv_tx call otherwise could lead to use-after-free bugs. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> [reword commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: fix tx-mgmt cookie value being left uninitializedNicolas Cavallari2012-07-171-0/+1
| | | | | | | | | | | | | | commit "mac80211: unify SW/offload remain-on-channel" moved the cookie assignment from ieee80211_mgmt_tx() to ieee80211_start_roc_work(). But the latter is only called where offchannel is needed. If offchannel isn't needed/used, a uninitialized cookie value would be returned to userspace. This patch sets the cookie value when offchannel isn't used. Signed-off-by: Nicolas Cavallari <cavallar@lri.fr> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: reduce monitor interface trackingJohannes Berg2012-07-134-62/+2
| | | | | | | | | | | | | | | | | | | | Revert commit b78e8ceac23655e1e06b30aa95ab11742d1ac7c0 ("cfg80211: track monitor channel") and remove the set_monitor_enabled() callback. Due to the tracking happening in NETDEV_PRE_UP, it had introduced bugs because the monitor interface callback would be called before the device was started. It looks like there's no way to fix this, and using NETDEV_PRE_UP is broken anyway (since there's no NETDEV_UP_FAIL), so remove all that code, track interfaces in NETDEV_UP and also stop tracking the monitor channel in cfg80211. This mostly reverts to before the tracking, except that we keep the interface count tracking so that setting the monitor channel can be rejected properly. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211/mac80211: re-add get_channel operationJohannes Berg2012-07-134-7/+38
| | | | | | | | | | | | This essentially reverts commit 2e165b818456 but introduces the get_channel operation with a new wireless_dev argument so that you can retrieve the channel per interface. This is necessary as even though we can track all interface channels (except monitor) we can't track the channel type used. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Revert "mac80211: refactor virtual monitor code"Johannes Berg2012-07-133-17/+14
| | | | | | | | | | This reverts commit 870d37fc22f3e40f9f23e06c581c8538fc16a2f0. This code doesn't work as cfg80211 will call set_monitor_enabled at the wrong time and it doesn't seem to be possible to fix this. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: fix use after freeAlan Cox2012-07-131-2/+4
| | | | | | | roc is destroyed then roc->started is referenced. Keep a local cache. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: allow enabling WoWLAN without triggersJohannes Berg2012-07-121-17/+13
| | | | | | | | | It may be desirable to use WoWLAN without triggers to keep the connection alive to the AP while suspended. Allow this use by enabling WoWLAN without triggers if no triggers were requested. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: ignore channel state for stopped AP/mesh interfacesFelix Fietkau2012-07-121-2/+9
| | | | | | | | | | | Without this change, running AP + station on the same wiphy does not work since the commit "cfg80211: add channel checking for iface combinations". The stopped AP prevents the client from connecting to an AP on a different channel. Signed-off-by: Felix Fietkau <nbd@openwrt.org> [line-break commit message to < 72 chars] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: iterate the virtual monitor interfaceJohannes Berg2012-07-122-10/+28
| | | | | | | | | | | | If the virtual monitor interface is requested by the driver, it should also be iterated over when the driver wants to iterate all active interfaces. To allow that protect it with the iflist_mtx. Change-Id: I58ac5de2f4ce93d12c5a98ecd2859f60158d5d69 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: fix locking and lockdep complaintsJohannes Berg2012-07-123-6/+12
| | | | | | | | | | | | | | To call cfg80211_get_chan_state() we need to lock the wdev, so we need to lock the wdev_iter mutex in cfg80211_can_use_iftype_chan(). This needs to use nested locking for lockdep. Also, cfg80211_get_chan_state() doesn't actually use the rdev, so remove that completely including the lock assertion that isn't needed. Reported-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* minstrel_ht: enable frame aggregation for fixed rateSylvain Roger Rieunier2012-07-121-2/+6
| | | | | | | | | | | | When sample_idx is set to a value other than -1 it activates the IEEE80211_TX_CTL_RATE_CTRL_PROBE flag which disables frame aggregation. To allow frame aggregation during fixed rate it is necessary to set max_tp_rate, max_tp_rate2 and max_prob_rate instead of sample_idx. Signed-off-by: Sylvain Roger Rieunier <sylvain.roger.rieunier@gmail.com> [reword commit message a bit] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: tx: do not drop non-robust mgmt to non-MFP stas.Nicolas Cavallari2012-07-121-0/+3
| | | | | | | | | | | | | | | When drop_unencrypted is enabled and MFP is disabled, non-robust management frames for not-yet associated STA are dropped. This isn't visible as many management frames sent from the kernel have TX_INTFL_DONT_ENCRYPT set and management frames injected from a monitor vif have TX_CTL_INJECTED so aren't dropped. But management frames sent from userspace via NL80211_CMD_FRAME do not have this flag set, so are dropped. This patch make it always accept non-robust management frames. Signed-off-by: Nicolas Cavallari <cavallar@lri.fr> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: restructure key selectionJohannes Berg2012-07-121-9/+13
| | | | | | | | | | The "no key" case in key selection that decides whether to drop the frame or not is impossible to understand, restructure the code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> [cavallar@lri.fr: removed blank line and restructured action frame clause] Signed-off-by: Nicolas Cavallari <cavallar@lri.fr>
* mac80211: add time synchronisation with BSS for assocJohannes Berg2012-07-128-15/+27
| | | | | | | | | | | | | | | | | | | | | | | Some drivers (iwlegacy, iwlwifi and rt2x00) today use the bss_conf.last_tsf value. By itself though that value is completely worthless since it may be ancient. What really is needed is synchronisation between some device time and the TSF. To clarify this, rename bss_conf.last_tsf to sync_tsf and add sync_device_ts which is obtained from rx_status which gets a new field device_timestamp for this purpose. This is intentionally not using the mactime field since that is used for other things and in IBSS is expected to sync with the IBSS's TSF which isn't necessarily true for the device timestamp. Also, since we have the information and it's useful even before the connection has been established, give all the timing details to the driver before authenticating. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: optimize ieee80211_rx_status struct layoutJohannes Berg2012-07-121-7/+7
| | | | | | | | | We waste a lot of space in this struct because it uses int values where smaller ones would be sufficient. The upcoming A-MPDU information needs some space, optimize the struct now. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: redesign scan RXJohannes Berg2012-07-124-80/+32
| | | | | | | | | | | | | | | Scan receive is rather inefficient when there are multiple virtual interfaces. We iterate all of the virtual interfaces and then notify cfg80211 about each beacon many times. Redesign scan RX to happen before everything else. Then we can also get rid of IEEE80211_RX_IN_SCAN since we don't have to accept frames into the RX handlers for scanning or scheduled scanning any more. Overall, this simplifies the code. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: track scheduled scan virtual interfaceJohannes Berg2012-07-124-14/+15
| | | | | | | | | Instead of tracking whether or not we're in a scheduled scan, track the virtual interface (sdata) in an RCU-protected pointer to make it usable from RX to check the MAC address. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: make scan_sdata pointer usable with RCUJohannes Berg2012-07-123-14/+30
| | | | | | | | | | Making the scan_sdata pointer usable with RCU makes it possible to dereference it in the RX path to see if a received frame actually matches the interface that is scanning. This is just preparations, making the pointer __rcu. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: fix invalid band deref building preq IEsArik Nemtsov2012-07-122-0/+5
| | | | | | | | | | | | The function building probe-request IEs does not validate the band is supported before dereferencing it. This can result in a panic when all bands are traversed, as done during sched-scan start. Warn when this happens and return an empty probe request. Also fix sched-scan to not waste memory on unsupported bands. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: move scan API to wdevJohannes Berg2012-07-1214-47/+57
| | | | | | | | The new P2P Device will have to be able to scan for P2P search, so move scanning to use struct wireless_dev instead of struct net_device. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: send interface after creationJohannes Berg2012-07-121-2/+15
| | | | | | | | After a new virtual interface is created, reply to userspace with a message detailing it so it knows the new wdev identifier. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: use wireless_dev for interface managementJohannes Berg2012-07-1211-72/+83
| | | | | | | | In order to be able to create P2P Device wdevs, move the virtual interface management over to wireless_dev structures. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: use wdev in mgmt-tx/ROC APIsJohannes Berg2012-07-0913-121/+152
| | | | | | | | | | | The management frame and remain-on-channel APIs will be needed in the P2P device abstraction, so move them over to the new wdev-based APIs. Userspace can still use both the interface index and wdev identifier for them so it's backward compatible, but for the P2P Device wdev it will be able to use the wdev identifier only. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: don't assume wdev->netdev existsJohannes Berg2012-07-091-1/+6
| | | | | | | | | There are a few places that iterate the wdev list and assume wdev->netdev exists, check there. The rfkill one has to be extended for each non-netdev type later. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: retrieve interface data by wdevJohannes Berg2012-07-091-11/+15
| | | | | | | | Since soon there will be virtual interfaces that don't have a netdev, use the wdev identifier for the API to retrieve interface data. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: add NL80211_FLAG_NEED_WDEVJohannes Berg2012-07-091-18/+39
| | | | | | | | | Some nl80211 callbacks will soon need the wdev instead of the netdev, so add NL80211_FLAG_NEED_WDEV to allow them to request that. Add NL80211_FLAG_NEED_WDEV_UP as well which checks the netdev is UP if one exists. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: prepare for non-netdev wireless devsJohannes Berg2012-07-097-47/+144
| | | | | | | | | | | | | | | | | In order to support a P2P device abstraction and Bluetooth high-speed AMPs, we need to have a way to identify virtual interfaces that don't have a netdev associated. Do this by adding a NL80211_ATTR_WDEV attribute to identify a wdev which may or may not also be a netdev. To simplify things, use a 64-bit value with the high 32 bits being the wiphy index for this new wdev identifier in the nl80211 API. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: remove ieee80211_key_removedJohannes Berg2012-07-093-37/+0
| | | | | | | | | | This API call was intended to be used by drivers if they want to optimize key handling by removing one key when another is added. Remove it since no driver is using it. If needed, it can always be added back. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: remove unused assignmentJohannes Berg2012-07-091-1/+1
| | | | | | | | ieee80211_mlme_notify_scan_completed() iterates all interfaces and doesn't need to assign anything to the sdata variable before the loop. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: update BSS info on AC parameters changeJohannes Berg2012-07-092-14/+16
| | | | | | | | | | | | | When the AC parameters change, drivers might rely on getting a bss_info_changed notification with BSS_CHANGED_QOS in addition to the conf_tx call. Always call the function when userspace updates are made (in AP/GO modes) and also set the change flag when updates were made by the AP (in managed mode.) Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: fix oops due to unassigned set_monitor_enabled callbackVladimir Kondratiev2012-07-081-2/+3
| | | | | | | Quick fix for method being invoked without checking its existence. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: request TX status for BlockAck RequestsChristian Lamparter2012-07-071-1/+2
| | | | | | | | | | | | | | | Because ieee80211_tx_status in status.c checks if outgoing BlockAck requests have been acked, it is necessary to tell the driver that tx feedback for this sort of frame is important. Otherwise, the stack will continue to send the same BlockAck request over and over, which can cause the receiver to flush or clean its reorder buffer over and over. Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: add testmode code to stop/wake queuesJohannes Berg2012-07-061-0/+8
| | | | | | | This was useful for debugging the queue stop/wake issues and is pretty small so let's just put it in. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: fix crash with single-queue driversJohannes Berg2012-07-061-2/+10
| | | | | | | | | | | | | | Larry (and some others I think) reported that with single-queue drivers mac80211 crashes when waking the queues. This happens because we allocate just a single queue for each virtual interface in case the driver doesn't have at least 4 queues, but the code stopping/waking the virtual interface queues wasn't taking this into account. Reported-by: Larry Finger <Larry.Finger@lwfinger.net> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: always set in_reconfig=false on wakeupEliad Peller2012-07-061-1/+1
| | | | | | | | | | | | | | | | If the interfaces were removed just before a restart work was started, open_count will be 0, and most of the reconfig work will be skipped, including the resetting of local->in_reconfig to false. Leaving local->inconfig = true will result in dropping any incoming packet. Fix it by always setting local->in_reconfig = false (even if there are no active interfaces). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: fix debugfs default key linksJohannes Berg2012-07-061-6/+10
| | | | | | | | | | | | | | | | | | | | Due to the way the default key links are created, it happens that a link is left dangling: * both unicast/multicast links are created * unicast link is destroyed, and the links are updated * during this update, adding the multicast link again fails because it is present, destroying the debugfs pointer * removing the multicast link won't work as the pointer has been destroyed Fix this by always removing the links and then re-creating them if needed. Reported-by: Marek Lindner <lindner_marek@yahoo.de> Reported-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: bitrate calculation for 60gVladimir Kondratiev2012-07-052-0/+51
| | | | | | | | 60g band uses different from .11n MCS scheme, so bitrate should be calculated differently Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* {nl,cfg}80211: support high bitratesVladimir Kondratiev2012-07-054-4/+18
| | | | | | | | | | | | | | | | | Until now, a u16 value was used to represent bitrate value. With VHT bitrates this becomes too small. Introduce a new 32-bit bitrate attribute. nl80211 will report both the new and the old attribute, unless the bitrate doesn't fit into the old u16 attribute in which case only the new one will be reported. User space tools encouraged to prefer the 32-bit attribute, if available (since it won't be available on older kernels.) Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> [reword commit message and comments a bit] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: fix locking regression in monitor channel trackingJohannes Berg2012-07-042-7/+5
| | | | | | | | | | | | Michal's monitor channel tracking introduce a locking problem as it locked the rdev lock inside the netdev notifier which isn't allowed as we might already hold it if we get there by removing an interface that is up. Fix this by relying only on the RTNL to protect the interface counters, the RTNL is always held in these code paths anyway. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: add TX prepare APIJohannes Berg2012-07-034-0/+44
| | | | | | | | | | | | | | | | | | Some drivers require setup before being able to send management frames in managed mode, in particular in multi-channel cases. Introduce API to allow the drivers to do such setup while being able to sleep waiting for the setup to finish in the device. This isn't possible inside the TX call since that can't sleep. A future patch may also restructure the TX retry to wait for the driver to report the frame status, as suggested by Arik in http://mid.gmane.org/CA+XVXffKSEL6ZQPQ98x-zO-NL2=TNF1uN==mprRyUmAaRn254g@mail.gmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: fix NUM_BANDS usageJohannes Berg2012-07-031-2/+2
| | | | | | | | | Due to the recent change of NUM_BANDS from 2 to 3 hwsim broke. Fix the code by using the right constant but don't support bands other than 2.4 and 5 GHz. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: reduce IEEE80211_TX_MAX_RATESThomas Huehn2012-07-034-12/+11
| | | | | | | | | | | | | | | IEEE80211_TX_MAX_RATES can be reduced from 5 to 4 as there is no current hardware supporting a rate chain with 5 multi rate stages (mrr), so 4 mrr stages are sufficient. The memory that is freed within the ieee80211_tx_info struct will be used in the upcoming Transmission Power Control (TPC) implementation. Suggested-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> [reword commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
OpenPOWER on IntegriCloud