p54pci: don't return zero on failure paths in p54p_probe()
If pci_set_dma_mask() or pci_set_consistent_dma_mask() fails in p54p_probe(),
it breaks off initialization, deallocates all resources, but returns zero.
Similar issue is if check for returned value of pci_resource_len() fails.
The patch implements proper error code propagation.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hante Meuleman [Wed, 2 Jan 2013 14:22:49 +0000 (15:22 +0100)]
brcmfmac: Return correct error on netdev xmit.
Netdev xmit routine brcfm_netdev_start_xmit was defined
incorrectly and used wrong return codes. Always eat the
packet and return ok. Remove drvr_up check since it is not
relevant.
Reviewed-by: Arend Van Spriel <arend@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The header of the ethernet packet is processed conditionally, but
the check is wrong as it checks skb length is at least ETH_ALEN. It
should check it is at least sizeof struct ethhdr instead.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The driver had some global definitions in dhd.h to map event
identifiers to event names. With redesign of firmware event
processing this has all moved to fweh module so these definitions
can be removed.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hante Meuleman [Wed, 2 Jan 2013 14:22:44 +0000 (15:22 +0100)]
brcmfmac: Use dedicated trace level for CDC.
CDC debug is partly done with TRACE and partly with CTL, however
CDC hardly ever needs debugging. Use dedicated level CDC and
replace TRACE and CTL in dhd_cdc with that.
Reviewed-by: Arend Van Spriel <arend@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcmfmac: remove rx helper function from bus interface
The bus interface provided a wrapper function to pass a single
packet to the common driver part filling a skb queue with one
packet. For clarity the caller now sets up the skb queue and
call the rx bus interface function.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Several source files (but not all) define the pr_fmt() macro in exactly
the same way. Instead this commit defines it in a header file so driver
logging is consistent.
Cc: Joe Perches <joe@perches.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcmfmac: assure USB dongle firmware is reset upon module unload
Upon unloading the brcmfmac module the USB firmware should be reset
as the device remains powered. The reset assures a known device
state when a new brcmfmac driver load is being done.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Piotr Haber [Wed, 2 Jan 2013 14:22:37 +0000 (15:22 +0100)]
brcmsmac: remove dead code
Dead code after AMPDU restructure.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Piotr Haber <phaber@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcmsmac: allow user-space setting of interface address
The interface address of the wireless device is determined by
the permanent address stored in the device. This patch allows
it to be overridden from user-space.
Reported-by: Maximilian Engelhardt <maxi@daemonizer.de> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Piotr Haber <phaber@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcmsmac: use perimeter lock in add_interface() callback
All callbacks that access driver functions should do that under
perimeter lock protection. The add_interface() callback was lacking
this lock.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Piotr Haber <phaber@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Piotr Haber [Wed, 2 Jan 2013 14:22:34 +0000 (15:22 +0100)]
brcmsmac: increase timer reference count for new timers only
On hardware reintialization reference count of
already existing timers would be increased again.
This leads to problems on module unloading.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Piotr Haber <phaber@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gabor Juhos [Sat, 29 Dec 2012 13:51:51 +0000 (14:51 +0100)]
rt2x00: rt2800: convert read_eeprom functions to return an int value
Both the rtt2x00usb_eeprom_read and the ioremap
functions are allowed to fail, however their
return values are not checked in the read_eeprom
functions in the rt2800{pci,usb} drivers.
The patch adds the missing checks, and converts
all read_eeprom functions to return an int value,
so the error values can be propagated up to the
'rt2800_validate_eeprom' function.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcmsmac: initialize morepending in brcms_b_recv()
drivers/net/wireless/brcm80211/brcmsmac/main.c: In function ‘brcms_b_recv’:
drivers/net/wireless/brcm80211/brcmsmac/main.c:7636: warning: ‘morepending’ may be used uninitialized in this function
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Power save support was removed from iwlegacy due to possible firmware
crashes problems it cause. I use to plan first inspect code to find
reason of problems, fix them and then allow to enable PS. But
realistically - code inspection will not happen, so let's do it, and
wait for eventual bug reports.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gabor Juhos [Mon, 17 Dec 2012 21:06:08 +0000 (22:06 +0100)]
ath9k: fix column header comments for some initval arrays
Some 3-column initval arrays have wrong comments. The
column of these arrays is indexed by the 'freqIndex'
variable in 'ar5008_hw_process_ini' which only depends
on the actual band.
The 'initvals' tool from 'qca-swiss-army-knife' prints
the correct comment lines for these arrays, since commit
'atheros-initvals: fix comments for non-fastclock 3-column tables'
however the comments were not refreshed in ath9k.
The patch contains no functional changes.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
While the driver supports HW offload in a single
P2P client configuration, it doesn't support HW
offload in the concurrent P2P GO+CLIENT
configuration.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
carl9170: Only specify interface combinations if more than one interface is possible
Otherwise carl9170 triggers a warning in cfg80211, from net/wireless/core.c
/* Combinations with just one interface aren't real */
if (WARN_ON(c->max_interfaces < 2))
Note: The number of supported interfaces is set by
the carl9170 firmware. The default number of
supported interfaces for all current firmwares is 2.
Therefore this warning can only be observed with
custom firmwares.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
carl9170: allow P2P_GO interface creation after P2P_CLIENT
Janusz Dziedzic reported that after a change in wpa_supplicant
["nl80211: Automatically use concurrent P2P if possible"],
carl9170 was no longer able to host a P2P network.
This patch tackles the problem by allowing GO interfaces to be
registered, long after the P2P_CLIENT interface is brought up.
Reported-by: Janusz Dziedzic <janusz.dziedzic@gmail.com> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Based on a quick test [ath9k and carl9170],
TDLS seemed to be working fine. And while
we are at it, let's move the wiphy feature
flag set from carl9170_alloc into a single
place in carl9170_fw.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Wed, 12 Dec 2012 12:14:23 +0000 (13:14 +0100)]
ath9k_hw: use the devres API for allocations
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Wed, 12 Dec 2012 12:14:22 +0000 (13:14 +0100)]
ath9k: use the devres API for allocations/mappings
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
rt2800_init_rfcsr() is too big, split RF initialization into per chip
functions. Code will change, but we should setup the same values onto
RF registers and in the same order as before.
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Thu, 27 Dec 2012 21:58:21 +0000 (22:58 +0100)]
iwlwifi: move some PCIe calls to better places
Synchronizing the IRQ is pointless when we will
then enable the RF-Kill interrupt again, but is
needed before we free it and the data needed to
handle IRQs; move it to the free function.
Simiarly, cancelling the replenish work struct
can move to the function that frees the RX data
structures.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
iwl_trans_grab_nic_access returns a boolean. So ret should
explicitely set to an error code and not rely on the value
returned by iwl_trans_grab_nic_access.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 27 Dec 2012 16:32:09 +0000 (17:32 +0100)]
cfg80211: disallow more station changes
The following changes are invalid and should be
disallowed when a station already exists:
* supported rates changes, except for TDLS peers
* listen interval changes
* HT capability changes
Disallow them and also update a mac80211 comment
explaining how they would be racy.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 28 Dec 2012 14:01:57 +0000 (15:01 +0100)]
mac80211: unset peer's HT 40 MHz support if not usable
When an interface is configured to a 20 MHz channel
and the device as well as the peer are 40 MHz capable
the HT capabilities of the peer are not restricted to
20 MHz, even though they're supposed to be restricted
to the currently possible capabilities.
Unset the 40 MHz HT capability bits in this case.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Wed, 18 Jul 2012 11:51:25 +0000 (13:51 +0200)]
mac80211: split TX aggregation stop action
When TX aggregation is stopped, there are a few
different cases:
- connection with the peer was dropped
- session stop was requested locally
- session stop was requested by the peer
- connection was dropped while a session is stopping
The behaviour in these cases should be different, if
the connection is dropped then the driver should drop
all frames, otherwise the frames may continue to be
transmitted, aggregated in the case of a locally
requested session stop or unaggregated in the case of
the peer requesting session stop.
Split these different cases so that the driver can
act accordingly; however, treat local and remote stop
the same way and ask the driver to not send frames as
aggregated packets any more.
In the case of connection drop, the stop callback the
driver is otherwise supposed to call is no longer
required.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Wed, 18 Jul 2012 11:31:31 +0000 (13:31 +0200)]
mac80211: split aggregation stop by reason
The initiator/tx doesn't really identify why an
aggregation session is stopped, give a reason
for stopping that more clearly identifies what's
going on. This will help tell the driver clearly
what is expected of it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 26 Oct 2012 15:53:44 +0000 (17:53 +0200)]
nl80211/mac80211: support full station state in AP mode
Today, stations are added already associated. That is
inefficient if, for example, the driver has no room
for stations any more because then the station will
go through the entire auth/assoc handshake, only to
be kicked out afterwards.
To address this a bit better, at least with drivers
using the new station state callback, allow hostapd
to add stations in unauthenticated mode, just after
receiving the AUTH frame, before even replying. Thus
if there's no more space at that point, it can send
a negative auth frame back. It still needs to handle
later state transition errors though, of course.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 7 Dec 2012 12:06:48 +0000 (13:06 +0100)]
mac80211: restrict assoc request VHT capabilities
In interoperability testing some APs showed bad behaviour
if some of the VHT capabilities of the station are better
than their own. Restrict the assoc request parameters
- beamformee capabable,
- RX STBC and
- RX MCS set
to the subset that the AP can support.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
cfg80211: move world roaming check for beacon hints
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 <greearb@candelatech.com> Reported-by: Ben Greear <greearb@candelatech.com> Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
[fix locking] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This will be used later by other code. This has no
functional change.
Tested-by: Ben Greear <greearb@candelatech.com> Reported-by: Ben Greear <greearb@candelatech.com> Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
cfg80211: do not process beacon hints if one is already queued
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 <greearb@candelatech.com> Reported-by: Ben Greear <greearb@candelatech.com> Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 14 Dec 2012 13:34:25 +0000 (14:34 +0100)]
mac80211: assign bss_conf.bssid only once
Instead of checking every time bss_info_changed is called,
assign the pointer once depending on the interface type
and then leave it untouched until the interface type is
changed. This makes the ieee80211_bss_info_change_notify()
now a simple wrapper to call the driver only.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 14 Dec 2012 13:22:10 +0000 (14:22 +0100)]
mac80211: further simplify ieee80211_bss_info_change_notify
The special case in the function isn't really needed,
instead make the suspend code a bit better and also
easier to understand and move the warning into the
driver op wrapper inline.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 14 Dec 2012 13:17:26 +0000 (14:17 +0100)]
mac80211: reconfig bss_info_changed only if beaconing
For AP/IBSS/mesh interfaces, call the driver to reconfigure
bss_info_changed only if the interface was beaconing before
suspend, otherwise we call the driver and it might interpret
the change as going from enabled to disabled.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 14 Dec 2012 13:06:28 +0000 (14:06 +0100)]
mac80211: track enable_beacon explicitly
Instead of calculating in ieee80211_bss_info_change_notify()
whether beaconing should be enabled or not, set it in the
correct places in the callers. This simplifies the logic in
this function at the expense of offchannel, but is also more
robust.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 13 Dec 2012 16:42:30 +0000 (17:42 +0100)]
mac80211: fix channel context iteration
During suspend/resume channel contexts might be
iterated even if they haven't been re-added to
the driver, keep track of this and skip them in
iteration. Also use the new status for sanity
checks.
Also clarify the fact that during HW restart all
contexts are iterated over (thanks Eliad.)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 13 Dec 2012 16:16:45 +0000 (17:16 +0100)]
mac80211: clean up association better in suspend
When suspending, bss_info_changed() is called to
disable beacons, but managed mode interfaces are
simply removed (bss_info_changed() is called with
"no change" only). This can lead to problems.
To fix this and copy the BSS configuration, clear
it during suspend and restore it on resume.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
mac82011: use frame control to differentiate probe resp/beacon
The probe response/beacon management frame RX code passes a
bool parameter to differentiate beacons and probe responses.
This is useless since we have the frame and can thus use its
frame control field. Moreover it is buggy since there is one
call to ieee80211_rx_bss_info with a beacon frame that is
indicated as a probe response, which is also fixed by using
the frame control field, so do that.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 14 Dec 2012 13:56:03 +0000 (14:56 +0100)]
mac80211: optimise AP stop RCU handling
If there are VLANs, stopping an AP is inefficient as it
calls rcu_barrier() once for each interface (the VLANs
and the AP itself). Optimise this by moving rcu_barrier()
out of the station cleanups and calling it only once for
all interfaces combined.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 6 Dec 2012 14:47:38 +0000 (15:47 +0100)]
regulatory: use RCU to protect global and wiphy regdomains
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 <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Tue, 4 Dec 2012 14:07:34 +0000 (15:07 +0100)]
regulatory: remove handling of channel bandwidth
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 <johannes.berg@intel.com>
Johannes Berg [Mon, 3 Dec 2012 23:48:59 +0000 (00:48 +0100)]
regulatory: fix reg_is_valid_request handling
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 <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Mon, 3 Dec 2012 23:19:24 +0000 (00:19 +0100)]
regulatory: remove locking from wiphy_apply_custom_regulatory
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 <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Mon, 3 Dec 2012 22:00:08 +0000 (23:00 +0100)]
regulatory: clarify locking rules and assertions
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 <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Mon, 3 Dec 2012 23:14:17 +0000 (00:14 +0100)]
regulatory: simplify freq_reg_info_regd
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 <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Mon, 3 Dec 2012 17:36:09 +0000 (18:36 +0100)]
regulatory: remove BUG_ON
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 <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 6 Dec 2012 16:26:17 +0000 (17:26 +0100)]
regulatory: clean up regdom_intersect
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 <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Tue, 4 Dec 2012 11:49:16 +0000 (12:49 +0100)]
regulatory: don't allocate too much memory
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 <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 6 Dec 2012 16:03:17 +0000 (17:03 +0100)]
regulatory: don't write past array when intersecting rules
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 <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 13 Dec 2012 22:49:02 +0000 (23:49 +0100)]
mac80211: optimise roaming time again
The last fixes re-added the RCU synchronize penalty
on roaming to fix the races. Split up sta_info_flush()
now to get rid of that again, and let managed mode
(and only it) delay the actual destruction.
Tested-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>