aboutsummaryrefslogtreecommitdiff
path: root/net/wireless
AgeCommit message (Collapse)AuthorFilesLines
2013-12-03cfg80211: add reg_get_dfs_region()Luis R. Rodriguez2-0/+28
This can be used outside of the regulatory context for any checks on the DFS region. The central cfg80211 dfs_region is always used and if it does not match with the wiphy a debug print is issued. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-12-03nl80211/cfg80211: Set Operating Mode NotificationMarek Kwaczynski1-0/+7
This attribute is needed for setting Operating Mode Notification in AP mode from User Space. This functionality is required when User Space received Assoc Request contains Operation Mode Notification element. Signed-off-by: Marek Kwaczynski <[email protected]> [fix typos, nl80211 documentation] Signed-off-by: Johannes Berg <[email protected]>
2013-12-02Merge branch 'for-john' of ↵John W. Linville13-453/+787
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
2013-12-02cfg80211: disable CSA for all driversSimon Wunderlich1-0/+6
The channel switch announcement code has some major locking problems which can cause a deadlock in worst case. A series of fixes has been proposed, but these are non-trivial and need to be tested first. Therefore disable CSA completely for 3.13. Signed-off-by: Simon Wunderlich <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-12-02cfg80211/mac80211/ath6kl: acquire wdev lock outside ch_switch_notifySimon Wunderlich1-6/+3
The channel switch notification should be sent under the wdev/sdata-lock, preferably in the same moment as the channel change happens, to avoid races by other callers (e.g. start/stop_ap). This also adds the previously missing sdata_lock protection in csa_finalize_work. Reported-by: Johannes Berg <[email protected]> Signed-off-by: Simon Wunderlich <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-12-02cfg80211: protect beacon changing functions with wdev-lockSimon Wunderlich1-3/+19
To avoid race conditions in functions which modify the beacon information, lock these using the wdev lock. This is especially required to avoid problems for csa handling functions which modify beacons but can not be called under rtnl lock. Reported-by: Johannes Berg <[email protected]> Signed-off-by: Simon Wunderlich <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-12-02cfg80211: aggregate mgmt_tx parameters into a structAndrei Otcheretianski5-43/+33
Change cfg80211 and mac80211 to use cfg80211_mgmt_tx_params struct to aggregate parameters for mgmt_tx functions. This makes the functions' signatures less clumsy and allows less painful parameters extension. Signed-off-by: Andrei Otcheretianski <[email protected]> [fix all other drivers] Signed-off-by: Johannes Berg <[email protected]>
2013-12-02cfg80211: fix reporting 5/10 MHz support to user spaceFelix Fietkau1-4/+5
nla_put_flag needs a real nl80211 attribute id, not a wiphy flag bit. While at it, split 5 and 10 MHz capability flags in case we ever need to support hardware that can only do one of the two. Also move the flag settings to the split-only information so we don't increase the space needed for old userspace. Signed-off-by: Felix Fietkau <[email protected]> [change location of flag setting] Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: replace print_dfs_region() with reg_dfs_region_str() helperLuis R. Rodriguez1-25/+16
This lets us later reuse the more generic reg_dfs_region_str(). Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: distinguish unset DFS region from unknownLuis R. Rodriguez1-0/+3
Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: intersection dfs regions when intersecting regdomainsLuis R. Rodriguez1-0/+16
Only allow DFS to be set if the DFS regions agree. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: use enum nl80211_dfs_regions for dfs_region everywhereLuis R. Rodriguez3-4/+4
u8 was used in some other places, just stick to the enum, this forces us to express the values that are expected. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: add an option to disable processing country IEsLuis R. Rodriguez1-0/+3
Certain vendors may want to disable the processing of country IEs so that they can continue using the regulatory domain the driver or user has set. Currently there is no way to stop the core from processing country IEs, so add support to the core to ignore country IE hints. Cc: Mihir Shete <[email protected]> Cc: Henri Bahini <[email protected]> Cc: Tushnim Bhattacharyya <[email protected]> Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: add flags to define country IE processing rulesLuis R. Rodriguez1-5/+3
802.11 cards may have different country IE parsing behavioural preferences and vendors may want to support these. These preferences were managed by the REGULATORY_CUSTOM_REG and the REGULATORY_STRICT_REG flags and their combination. Instead of using this existing notation, split out the country IE behavioural preferences as a new flag. This will allow us to add more customizations easily and make the code more maintainable. Cc: Mihir Shete <[email protected]> Cc: Henri Bahini <[email protected]> Cc: Tushnim Bhattacharyya <[email protected]> Signed-off-by: Luis R. Rodriguez <[email protected]> [fix up conflicts] Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: move regulatory flags to their own variableLuis R. Rodriguez2-17/+17
We'll expand this later, this will make it easier to classify and review what things are related to regulatory or not. Coccinelle only missed 4 hits, which I had to do manually, supplying the SmPL in case of merge conflicts. @@ struct wiphy *wiphy; @@ -wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY +wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG @@ expression e; @@ -e->flags |= WIPHY_FLAG_CUSTOM_REGULATORY +e->regulatory_flags |= REGULATORY_CUSTOM_REG @@ struct wiphy *wiphy; @@ -wiphy->flags &= ~WIPHY_FLAG_CUSTOM_REGULATORY +wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG @@ struct wiphy *wiphy; @@ -wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY +wiphy->regulatory_flags & REGULATORY_CUSTOM_REG @@ struct wiphy *wiphy; @@ -wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY +wiphy->regulatory_flags |= REGULATORY_STRICT_REG @@ expression e; @@ -e->flags |= WIPHY_FLAG_STRICT_REGULATORY +e->regulatory_flags |= REGULATORY_STRICT_REG @@ struct wiphy *wiphy; @@ -wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY +wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG @@ struct wiphy *wiphy; @@ -wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY +wiphy->regulatory_flags & REGULATORY_STRICT_REG @@ struct wiphy *wiphy; @@ -wiphy->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS +wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS @@ expression e; @@ -e->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS +e->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS @@ struct wiphy *wiphy; @@ -wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS +wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS @@ struct wiphy *wiphy; @@ -wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS +wiphy->regulatory_flags & REGULATORY_DISABLE_BEACON_HINTS Generated-by: Coccinelle SmPL Cc: Julia Lawall <[email protected]> Cc: Peter Senna Tschudin <[email protected]> Cc: Mihir Shete <[email protected]> Cc: Henri Bahini <[email protected]> Cc: Tushnim Bhattacharyya <[email protected]> Signed-off-by: Luis R. Rodriguez <[email protected]> [fix up whitespace damage, overly long lines] Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: rename __set_regdom() to reg_set_rd_country_ie()Luis R. Rodriguez1-6/+5
This reflects that case is now completely separated. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: set driver regulatory updates on its ownLuis R. Rodriguez1-67/+56
This splits up the driver regulatory update on its own, this helps simplify the reading the case. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: set user regulatory updates on its ownLuis R. Rodriguez1-0/+35
This splits out the user regulatory update on its own, this helps simplify reading the case. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: set core regulatory updates on its ownLuis R. Rodriguez1-13/+27
This splits up the core regulatory update to be set on its own helper. This should make it easier to read exactly what type of requests should be expected there. In this case its clear that NL80211_REGDOM_SET_BY_CORE is only used by the core for updating the world regulatory domain. This is consistant with the nl80211.h documentation. Signed-off-by: Luis R. Rodriguez <[email protected]> [add warning to default switch case to avoid compiler warning] Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: pass the last_request to __set_regdom()Luis R. Rodriguez1-3/+3
last_request is RCU protected, since we're getting it on set_regdom() we might as well pass it to ensure the same request is being processed, otherwise there is a small race it could have changed. This makes processing of the request atomic. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: move core reg_notfier() check to sourceLuis R. Rodriguez1-13/+18
Drivers that set the WIPHY_FLAG_CUSTOM_REGULATORY skip the core world regulatory domain updates, but do want their reg_notifier() called. Move the check for this closer to the source of the check that detected skipped was required and while at it add a helper for the notifier calling. This has no functional changes. This brings together the place where we call the reg_notifier() will be called. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: allow only the core to request to update the world regdomLuis R. Rodriguez1-0/+2
It seems some out of tree drivers were using a regulatory_hint("00") to trigger off the wiphy regulatory notifier, for those cases just setting the WIPHY_FLAG_CUSTOM_REGULATORY would suffice to call the reg_notifier() for a world regulatory domain update. If drivers find other needs for calling the reg_notifier() a proper implemenation is preferred. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: add helper for calling CRDALuis R. Rodriguez1-12/+12
All the regulatory request process routines use the same pattern. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: add helper for kfree'ing and assigning last_requestLuis R. Rodriguez1-10/+11
This enforces proper RCU APIs accross the code. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: add helper for kfree'ing last_requestLuis R. Rodriguez1-23/+19
This is common code, this reduces the chance of making a mistake of how we free it. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: process non country IE conflicting firstLuis R. Rodriguez1-19/+20
By dealing with non country IE conficts first we can shift the code that deals with the conflict to the left. This has no functional changes. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: process country IE regulatory requests on their ownLuis R. Rodriguez1-133/+68
This is the last split up of the old unified __regultory_hint() processing set of functionality, it moves the country IE processing all on its own. This makes it easier to follow and read what exactly is going on for the case of processing country IEs. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: process driver regulatory requests on its ownLuis R. Rodriguez1-17/+86
This makes the code easier to read and follow. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: process user regulatory requests on its ownLuis R. Rodriguez1-33/+81
This makes the code path easier to read and lets us split out some functionality that is only user specific, that makes it easier to read the other types of requests. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: processing core regulatory hints on its ownLuis R. Rodriguez1-2/+44
This makes the code path easier to read for the core case. Signed-off-by: Luis R. Rodriguez <[email protected]> [add warning to default case in switch to avoid compile warning] Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: check regulatory request alpha2 earlyLuis R. Rodriguez3-1/+5
Currently nl80211 allows userspace to send the kernel a bogus regulatory domain with at most 32 rules set and it won't reject it until after its allocated memory. Let's be smart about it and take advantage that the last_request is now available under RTNL and check if the alpha2 matches an expected request and reject any bogus userspace requests prior to hitting the memory allocator. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: enforce disabling channels by custom or strict settingsLuis R. Rodriguez1-3/+14
If a custom regulatory domain is passed and if a rule for a channel indicates it should be disabled that channel should always remain disabled as per its documentation and design. Likewise if WIPHY_FLAG_STRICT_REGULATORY flag is set and a regulatory_hint() is issued if a channel is disabled that channel should remain disabled. Without this change only drivers that set the _orig flags appropriately on their own would ensure disallowed channels remaind disabled. This helps drivers save code by relying on the APIS provided to entrust channels that should not be enabled be respected by only having to use wiphy_apply_custom_regulatory() or regulatory_hint() with the WIPHY_FLAG_STRICT_REGULATORY set. If wiphy_apply_custom_regulatory() is used together with WIPHY_FLAG_STRICT_REGULATORY and a regulatory_hint() issued later, the incoming regulatory domain can override previously set _orig parameters from the initial custom regulatory setting. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: fix parsing when db.txt ends on a ruleLuis R. Rodriguez1-0/+2
If genregdb.awk assumes the file will end with an extra empty line or a comment line. This is could not be true so just address this. Signed-off-by: Luis R. Rodriguez <[email protected]> Acked-by: John W. Linville <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: add function helpers to genregdb.awkLuis R. Rodriguez1-11/+25
This has no functional change, this just lets us reuse helpers at a later time. Signed-off-by: Luis R. Rodriguez <[email protected]> Acked-by: John W. Linville <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: allow beaconing after DFS CACJanusz Dziedzic1-11/+74
Allow beconing after we pass Channel Availability Check (CAC). Allow non-DFS and DFS channels mix. All DFS channels have to be in NL80211_DFS_AVAILABLE state (pass CAC). Signed-off-by: Janusz Dziedzic <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211/mac80211: DFS setup chandef for cac eventJanusz Dziedzic3-8/+6
To report channel width correctly we have to send correct channel parameters from mac80211 when calling cfg80211_cac_event(). This is required in case of using channel width higher than 20MHz and we have to set correct dfs channel state after CAC (NL80211_DFS_AVAILABLE). Signed-off-by: Janusz Dziedzic <[email protected]> Reviewed-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: don't allow drivers to unset NL80211_FEATURE_SCAN_FLUSHJohannes Berg2-10/+6
As the flag is entirely implemented in cfg80211, it should have been a global feature flag (which I believe didn't exist at the time). However, there's no reason to allow drivers to unset the flag, so don't allow it and remove the validation of NL80211_SCAN_FLAG_FLUSH. Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: add missing break in cfg80211_get_chan_state()Johannes Berg1-0/+1
Improve readability of the function by adding the break, there's no functional impact but it's confusing to fall through. Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: remove second argument from reg_process_hint()Luis R. Rodriguez1-6/+5
The iniator is already available to us, so use it. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: force WIPHY_FLAG_CUSTOM_REGULATORY on wiphy_apply_custom_regulatory()Luis R. Rodriguez1-0/+4
wiphy_apply_custom_regulatory() implies WIPHY_FLAG_CUSTOM_REGULATORY but we never enforced it, do that now and warn if the driver didn't set it. All drivers should be following this today already. Having WIPHY_FLAG_CUSTOM_REGULATORY does not however mean you will use wiphy_apply_custom_regulatory() though, you may have your own _orig value set up tools / helpers. The intel drivers are examples of this type of driver. Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: DFS check chandef usable before CACJanusz Dziedzic3-1/+88
Check chandef we get in CAC request is usable for CAC. All channels have to be DFS channels. Allow DFS_USABLE and DFS_AVAILABLE channels mix. At least one channel has to be DFS_USABLE (require CAC). Signed-off-by: Janusz Dziedzic <[email protected]> Reviewed-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: add helper functions for start/end freqJanusz Dziedzic1-14/+30
Add helper fuctions for start/end freq. Signed-off-by: Janusz Dziedzic <[email protected]> Reviewed-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: consolidate passive-scan and no-ibss flagsLuis R. Rodriguez6-37/+25
These two flags are used for the same purpose, just combine them into a no-ir flag to annotate no initiating radiation is allowed. Old userspace sending either flag will have it treated as the no-ir flag. To be considerate to older userspace we also send both the no-ir flag and the old no-ibss flags. Newer userspace will have to be aware of older kernels. Update all places in the tree using these flags with the following semantic patch: @@ @@ -NL80211_RRF_PASSIVE_SCAN +NL80211_RRF_NO_IR @@ @@ -NL80211_RRF_NO_IBSS +NL80211_RRF_NO_IR @@ @@ -IEEE80211_CHAN_PASSIVE_SCAN +IEEE80211_CHAN_NO_IR @@ @@ -IEEE80211_CHAN_NO_IBSS +IEEE80211_CHAN_NO_IR @@ @@ -NL80211_RRF_NO_IR | NL80211_RRF_NO_IR +NL80211_RRF_NO_IR @@ @@ -IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_IR +IEEE80211_CHAN_NO_IR @@ @@ -(NL80211_RRF_NO_IR) +NL80211_RRF_NO_IR @@ @@ -(IEEE80211_CHAN_NO_IR) +IEEE80211_CHAN_NO_IR Along with some hand-optimisations in documentation, to remove duplicates and to fix some indentation. Signed-off-by: Luis R. Rodriguez <[email protected]> [do all the driver updates in one go] Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: ignore supported rates for nonexistant bands on scanFelix Fietkau1-0/+4
Fixes wpa_supplicant p2p_find on 5GHz-only devices Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: disable 5/10 MHz support for all driversJohannes Berg1-0/+3
Due to nl80211 API breakage, 5/10 MHz support is broken for all drivers. Fixing it requires adding new API, but that can't be done as a bugfix commit since that would require either updating all APIs in the trees needing the bugfix or cause different kernels to have incompatible API. Therefore, just disable 5/10 MHz support for all drivers. Cc: [email protected] [3.12] Signed-off-by: Johannes Berg <[email protected]>
2013-11-25nl80211: check nla_nest_start() return valueJohannes Berg1-0/+2
Coverity pointed out that we might dereference NULL later if nla_nest_start() returns a failure. This isn't really true since we'd bomb out before, but we should check the return value directly, so do that. Signed-off-by: Johannes Berg <[email protected]>
2013-11-25nl80211: fix error path in nl80211_get_key()Johannes Berg1-1/+1
Coverity pointed out that in the (practically impossible) error case we leak the message - fix this. Signed-off-by: Johannes Berg <[email protected]>
2013-11-25nl80211: check nla_put_* return valuesJohannes Berg1-22/+30
Coverity pointed out that in a few functions we don't check the return value of the nla_put_*() calls. Most of these are fairly harmless because the input isn't very dynamic and controlled by the kernel, but the pattern is simply wrong, so fix this. Signed-off-by: Johannes Berg <[email protected]>
2013-11-25cfg80211: fix ibss wext chandef creationSimon Wunderlich1-9/+9
The wext internal chandefs for ibss should be created using the cfg80211_chandef_create() functions. Initializing fields manually is error-prone. Reported-by: Dirk Gouders <[email protected]> Signed-off-by: Simon Wunderlich <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2013-11-19genetlink: make multicast groups const, prevent abuseJohannes Berg1-75/+54
Register generic netlink multicast groups as an array with the family and give them contiguous group IDs. Then instead of passing the global group ID to the various functions that send messages, pass the ID relative to the family - for most families that's just 0 because the only have one group. This avoids the list_head and ID in each group, adding a new field for the mcast group ID offset to the family. At the same time, this allows us to prevent abusing groups again like the quota and dropmon code did, since we can now check that a family only uses a group it owns. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>