16 Apr, 2013
1 commit
-
When a full scan 2.4 and 5 GHz scan is scheduled, but then the 2.4 GHz
part of the scan disables a 5.2 GHz channel due to, e.g. receiving
country or frequency information, that 5.2 GHz channel might already
be in the list of channels to scan next. Then, when the driver checks
if it should do a passive scan, that will return false and attempt an
active scan. This is not only wrong but can also lead to the iwlwifi
device firmware crashing since it checks regulatory as well.Fix this by not setting the channel flags to just disabled but rather
OR'ing in the disabled flag. That way, even if the race happens, the
channel will be scanned passively which is still (mostly) correct.Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg
06 Mar, 2013
1 commit
-
For VHT, the wider bandwidths (up to 160 MHz) need
to be allowed. Since world roaming only covers the
case of connecting to an AP, it can be opened up
there, we will rely on the AP to know the local
regulations.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg
19 Feb, 2013
1 commit
-
…wireless-next into for-davem
Conflicts:
drivers/net/wireless/iwlwifi/dvm/tx.c
drivers/net/wireless/ti/wlcore/sdio.c
drivers/net/wireless/ti/wlcore/spi.c
15 Feb, 2013
2 commits
-
Some drivers might support 80 or 160 MHz only on some
channels for whatever reason, so allow them to disable
these channel widths. Also maintain the new flags when
regulatory bandwidth limitations would disable these
wide channels.Reviewed-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
Add new NL80211_CMD_RADAR_DETECT, which starts the Channel
Availability Check (CAC). This command will also notify the
usermode about events (CAC finished, CAC aborted, radar
detected, NOP finished).
Once radar detection has started it should continuously
monitor for radars as long as the channel is active.This patch enables DFS for AP mode in nl80211/cfg80211.
Based on original patch by Victor Goldenshtein
Signed-off-by: Simon Wunderlich
[remove WIPHY_FLAG_HAS_RADAR_DETECT again -- my mistake]
Signed-off-by: Johannes Berg
12 Feb, 2013
1 commit
-
When a driver requests a specific regulatory domain after cfg80211 already
has one, a struct ieee80211_regdomain is leaked.Reported-by: Larry Finger
Tested-by: Larry Finger
Signed-off-by: Larry Finger
Signed-off-by: Johannes Berg
29 Jan, 2013
1 commit
-
…wireless-next into for-davem
11 Jan, 2013
1 commit
-
commit 1a9193185f462a51815fe48491f8a6fb6b942551 "regulatory: code cleanup"
changed is_ht40_allowed without considering that IEEE80211_CHAN_NO_HT40 is
not just one flag, but two.
This is causing HT40- to be blocked completely.Signed-off-by: Felix Fietkau
Signed-off-by: Johannes Berg
09 Jan, 2013
2 commits
-
My commit 379b82f4c9dc6e67bf61aa61b096c06a2f320f60
("regulatory: pass new regdomain to reset function")
broke the restore_regulatory_settings() function due
to a logic change. Consider this change:- reset_regdomains(true);
- cfg80211_regdomain = cfg80211_world_regdom;
+ reset_regdomains(true, cfg80211_world_regdom);This looks innocent enough, until you realise that the
called function (reset_regdomains) also resets the
cfg80211_world_regdom pointer, so that the old version
of the code would use the new object it pointed to and
the new version of the code uses the old object. This
lead to a double-free of this object.Since reset_regdomains() sets it to &world_regdom, use
that directly.Reported-by: Sujith Manoharan
Tested-by: Sujith Manoharan
Reported-by: Bob Copeland
Reported-by: Emmanuel Grumbach
Signed-off-by: Johannes Berg -
The uevent callback doesn't protect its access to
last_request, which now causes a warning since
the conversion to get_last_request(). Fix this by
allowing to use RCU protection for last_request.Reported-by: Emmanuel Grumbach
Signed-off-by: Johannes Berg
03 Jan, 2013
26 commits
-
We should not add new beacon hints even if the wiphy
is not world roaming. Without this we were always adding
a beacon hint if not world roaming for every non world
roaming wiphy interface.Tested-by: Ben Greear
Reported-by: Ben Greear
Reported-by: Johannes Berg
Signed-off-by: Luis R. Rodriguez
[fix locking]
Signed-off-by: Johannes Berg -
This will be used later by other code. This has no
functional change.Tested-by: Ben Greear
Reported-by: Ben Greear
Reported-by: Johannes Berg
Signed-off-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
Regulatory beacon hints are used to help with world roaming
and as it is right now we learn from a beacon hint processed
on one wiphy to all other wiphys. The processing of beacon
hints however is scheduled and if we have a lot of interfaces
we may hit the case that we'll queue a the same beacon hint
many times until its processed.To avoid this do a lookup on the queued up beacon hints prior
to adding a new beacon hint. If the beacon hint is removed
from the pending reg beacon hint list then it would be processed
and we'd ensure all wiphys would have learned from it, if its
on the pending reg beacon list we'd now find it prior to it
being processed.Tested-by: Ben Greear
Reported-by: Ben Greear
Reported-by: Johannes Berg
Signed-off-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
Instead of returning an error and filling a pointer
return the pointer and an ERR_PTR value in error cases.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
This will allow making freq_reg_info() lock-free.
Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
To simplify the locking and not require cfg80211_mutex
(which nl80211 uses to access the global regdomain) and
also to make it possible for drivers to access their
wiphy->regd safely, use RCU to protect these pointers.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
Instead of assigning after calling the function do
it inside the function. This will later avoid a
period of time where the pointer is NULL.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
The channel bandwidth handling isn't really quite right,
it assumes that a 40 MHz channel is really two 20 MHz
channels, which isn't strictly true. This is the way the
regulatory database handling is defined right now though
so remove the logic to handle other channel widths.Signed-off-by: Johannes Berg
-
There's a bug with the world regulatory domain, it
can be updated any time which is different from all
other regdomains that can only be updated once after
a request for them. Fix this by adding a check for
"processed" to the reg_is_valid_request() function
and clear that when doing a request.While looking at this I also found another locking
bug, last_request is protected by the reg_mutex not
the cfg80211_mutex so the code in nl80211 is racy.
Remove that code as it only tries to prevent an
allocation in an error case, which isn't necessary.
Then the function can also become static and locking
in nl80211 can have a smaller scope.Also change __set_regdom() to do the checks earlier
and not different for world/other regdomains.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
wiphy_apply_custom_regulatory() doesn't have to hold
the regulatory mutex as it only modifies the given
wiphy with the given regulatory domain, it doesn't
access any global regulatory data.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
Many places that currently check that cfg80211_mutex
is held don't actually use any data protected by it.
The functions that need to hold the cfg80211_mutex
are the ones using the cfg80211_regdomain variable,
so add the lock assertion to those and clarify this
in the comments.The reason for this is that nl80211 uses the regdom
without being able to hold reg_mutex.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
The function itself has dual-purpose: it can
retrieve from a given regdomain or from the
globally installed one. Change it to have a
single purpose only: to look up from a given
regdomain. Pass the correct regdomain in the
freq_reg_info() function instead.This also changes the locking rules for it,
no locking is required any more.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
Even if it never happens and is hidden behind the
debug config option, it's completely useless: the
calltrace will only show module loading.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
toupper() only modifies lower-case letters, so
the isalpha() check is redundant; remove it.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
Use list_splice_tail_init() and also simplify the locking.
Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
This code is a bit too BUG_ON happy, remove all
instances and while doing so make some code a bit
smarter by passing the right pointer instead of
indices into arrays.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
This is pretty much useless since get_wiphy_idx()
always returns true since it's always called with
a valid wiphy pointer.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
Instead of treating special error codes specially,
like -EALREADY, introduce a real enum for all the
needed possibilities and use it.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
It would be a major problem if anything were to run
concurrently while the module is being unloaded so
remove the locking that doesn't help anything.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
Clean up various things like indentation, extra
parentheses, too many/few line breaks, etc.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
There's no need to unlock before calling
queue_regulatory_request(), so simplify
the function.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
There's no need to test whether a list is
empty or not before iterating.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
Use ERR_PTR/IS_ERR to return the result or errors,
also do some code cleanups.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
As the dummy_rule (also renamed from irule) is only
used for output by the reg_rules_intersect() function
there's no need to clear it at all, remove that.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
There's no need to allocate one reg rule more
than will be used, reduce the allocations. The
allocation in nl80211 already doesn't allocate
too much space.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg -
When intersecting rules, we count first to know how many
rules need to be allocated, and then do the intersection
into the allocated array. However, the code doing this
writes past the end of the array because it attempts to
do all intersections. Make it stop when the right number
of rules has been reached.Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg
22 Dec, 2012
1 commit
-
CONFIG_HOTPLUG is always enabled now, so remove the unused code that was
trying to be compiled out when this option was disabled, in the
networking core.Cc: Bill Pemberton
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: David S. Miller
07 Dec, 2012
1 commit
-
Conflicts:
drivers/net/wireless/mwifiex/sta_ioctl.c
net/mac80211/scan.c
30 Nov, 2012
1 commit
-
When a BSS struct is updated, the IEs are currently
overwritten or freed. This can lead to races if some
other CPU is accessing the BSS struct and using the
IEs concurrently.Fix this by always allocating the IEs in a new struct
that holds the data and length and protecting access
to this new struct with RCU.Signed-off-by: Johannes Berg
12 Nov, 2012
1 commit
-
When in world roaming mode, allow 40 MHz to be used
on channels 12 and 13 so that an AP that is, e.g.,
using HT40+ on channel 9 (in the UK) can be used.Cc: stable@vger.kernel.org
Reported-by: Eddie Chapman
Tested-by: Eddie Chapman
Acked-by: Luis R. Rodriguez
Signed-off-by: Johannes Berg