cfg80211: protect first access of last_request on 11d hint under mutex
We were not protecting last_request there is a small possible race
between an 11d hint and another routine which calls reset_regdomains()
which can prevent a valid country IE from being processed. This is
not critical as it will still be procesed soon after but locking prior
to it is correct.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
cfg80211: make regulatory_request use wiphy_idx instead of wiphy
We do this so later on we can move the pending requests onto a
workqueue. By using the wiphy_idx instead of the wiphy we can
later easily check if the wiphy has disappeared or not.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
cfg80211: propagate -ENOMEM during regulatory_init()
Calling kobject_uevent_env() can fail mainly due to out of
memory conditions. We do not want to continue during such
conditions so propagate that as well instead of letting
cfg80211 load as if everything is peachy.
Additionally lets clarify that when CRDA is not called during
cfg80211's initialization _and_ if the error is not an -ENOMEM
its because kobject_uevent_env() failed to call CRDA, not because
CRDA failed. For those who want to find out why we also let you
do so by enabling the kernel config CONFIG_CFG80211_REG_DEBUG --
you'll get an actual stack trace.
So for now we'll treat non -ENOMEM kobject_uevent_env() failures as
non fatal during cfg80211's initialization.
CC: Greg KH <greg@kroah.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
nl80211: disallow user requests prior to regulatory_init()
If cfg80211 is built into the kernel there is perhaps a small
time window betwen nl80211_init() and regulatory_init() where
cfg80211_regdomain hasn't yet been initialized to let the
wireless core do its work. During that rare case and time
frame (if its even possible) we don't allow user regulatory
changes as cfg80211 is working on enabling its first regulatory
domain.
To check for cfg80211_regdomain we now contend the entire operation
using the cfg80211_mutex.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
mac80211: Introduce a generic commit() to apply changes
This patch introduces a generic commit() function which initiate a
new network joining process. It should be called after some interface
config changes, so that the changes get applied more cleanly. Currently
set_ssid() and set_bssid() call it. Others can be added in future
patches.
In version 1 the header files was forgotten, sorry.
Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Dan Williams [Fri, 20 Feb 2009 17:27:38 +0000 (12:27 -0500)]
libertas: use private SDIO workqueue to avoid scheduling latency
The libertas SDIO interface scheduled the packet worker, resulting in
unwanted latency for every data packet or command sent to the firmware.
Fix a bug on the SDIO probe error path too.
Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Michael Buesch [Fri, 20 Feb 2009 11:24:52 +0000 (12:24 +0100)]
b43: Add slot count compiletime assertion
This adds a compiletime assertion for a recently introduced
assumption on the slot counts.
The tx header cache handling code assumes that the TX slot count
can be divided evenly by the number of TX slots per frame.
Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: Don't reset TSF after scanning automatically
Reset automatically the TSF on re-enabling beaconing after scanning
in IBSS mode causes several problems. For example a new created IBSS
network can't age before an other node has joined, because scans are
done automatically in that case. And several other strange bugs more...
The TSF reset is done manually in the higher level mac80211 code in
the cases were it's needed, so we don't need to do it here.
Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Michael Buesch [Thu, 19 Feb 2009 22:45:43 +0000 (23:45 +0100)]
b43: Optimize DMA buffers
In the old days we used one slot per frame. But when we changed that to 2,
we didn't raise the overall slot count. Which resulted in an effective
division of two to the number of slots.
Double the number of TX slots, so we have an effective hardware queue
of 128 frames per QoS queue.
Also optimize the TX header cache handling. We don't need a cached TX header
for slots that will never carry an actual header.
So we reduce the memory consumption of the cache by 50%.
So as a net result we end up with more or less the same memory usage before
and after this patch (except a few tiny meta structures), but have twice
the number of TX slots available.
Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Michael Buesch [Thu, 19 Feb 2009 22:39:26 +0000 (23:39 +0100)]
b43: Fix DMA buffer size handling
This fixes hidden bugs in the size handling of the DMA buffers.
This sets the RX buffer size to the theoretical max packet size and
fixes passing of the size values to the device (must not subtract the header offset).
These bugs are hidden and don't actually trigger due to the magic +100
offset for the buffer size.
Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Fenghua Yu [Wed, 18 Feb 2009 23:54:33 +0000 (15:54 -0800)]
iwlwifi: dma mapping read and write changes
When iwlwifi runs on IOMMU, IOMMU generates a lot of PTE write faults
because PTE write bit is not set on some of PTE's. This is because iwlwifi
driver calls DMA mapping with PCI_DMA_TODEVICE which is read only in mapping
PTE. But iwlwifi device actually writes to the mapped page to update its contents.
This issue is not exposed in swiotlb. But VT-d hardware can capture this fault and
stop the fault transaction.
The iwl TX command contains a scratch field that is updated by uCode to
indicate retry counts. For 5000 series the patch is required also for
regular frames, but this patch does not differenciate.
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jason Andryuk [Wed, 18 Feb 2009 20:41:04 +0000 (22:41 +0200)]
at76c50x-usb: convert at76_debug to an unsigned int
at76_debug should be an unsigned int as it used as a bit field. In
fact, modprobe fails when trying to set at76_debug's high bit.
Signed-off-by: Jason Andryuk <jandryuk@gmail.com> Signed-off-by: Kalle Valo <kalle.valo@iki.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jason Andryuk [Wed, 18 Feb 2009 20:40:57 +0000 (22:40 +0200)]
at76c50x-usb: update to latest mac80211 hw scan api
With the latest mac80211 stack, the driver needs to be updated for
cfg80211 scanning. I based the changes off of modifications for
at76_usb found here:
The trick was that max_signal also needs to be set to avoid a divide
by zero Oops. I just guessed and used the value 100 for now.
kvalo: handpicked the change from two different patches
Signed-off-by: Jason Andryuk <jandryuk@gmail.com> Signed-off-by: Kalle Valo <kalle.valo@iki.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Sat, 21 Feb 2009 00:03:31 +0000 (19:03 -0500)]
iwlagn: default to MAX_UCODE_BEACON_INTERVAL in iwl_adjust_beacon_interval
Default to MAX_UCODE_BEACON_INTERVAL if the output of
iwl_adjust_beacon_interval would otherwise be zero. This prevents a
division by zero on my iwl5300-equipped Lenovo T400 with kernels that
include "mac80211: use cfg80211s BSS infrastructure".
This patch is a bit of a hack -- I'm not sure why iwl_setup_rxon_timing
is giving iwl_adjust_beacon_interval a zero input (which is the only way
it would output zero). I would be happy to have a better fix. But for
now, this makes my box boot...
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Dan Williams [Wed, 11 Feb 2009 18:26:06 +0000 (13:26 -0500)]
ipw2x00: age scan results on resume
Scanned BSS entries are timestamped with jiffies, which doesn't
increment across suspend and hibernate. On resume, every BSS in the
scan list looks like it was scanned within the last 10 seconds,
irregardless of how long the machine was actually asleep. Age scan
results on resume with the time spent during sleep so userspace has a
clue how old they really are.
Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 18 Feb 2009 18:32:08 +0000 (19:32 +0100)]
mac80211/cfg80211: move iwrange handler to cfg80211
The previous patch made cfg80211 generally aware of the signal
type a given hardware will give, so now it can implement
SIOCGIWRANGE itself, removing more wext stuff from mac80211.
Might need to be a little more parametrized once we have
more hardware using cfg80211 and new hardware capabilities.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 18 Feb 2009 17:45:06 +0000 (18:45 +0100)]
cfg80211: clean up signal type
It wasn't a good idea to make the signal type a per-BSS option,
although then it is closer to the actual value. Move it to be
a per-wiphy setting, update mac80211 to match.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 18 Feb 2009 09:48:07 +0000 (10:48 +0100)]
nl80211: remove admin requirement from station get
There's no particular reason to not let untrusted users see
this information -- it's just the stations we're talking to,
packet counters for them and possibly some mesh things.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Some APs don't start BA negotiation with the client before it is done
with the key handshake in WPA/RSN. With those APs, key handshake times
out if EAPOL frames are sent after addba request. So defer the BA negotiation
until we are done with tx/rx of all EAPOL frames.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 18 Feb 2009 17:27:22 +0000 (18:27 +0100)]
cfg80211/mac80211: fill qual.qual value/adjust max_qual.qual
Due to various bugs in the software stack we end up having
to fill qual.qual; level should be used, but wpa_supplicant
doesn't properly ignore qual.qual, NM should use qual.level
regardless of that because qual.qual is 0 but doesn't handle
IW_QUAL_DBM right now.
So fill qual.qual with the qual.level value clamped to
-110..-40 dBm or just the regular 'unspecified' signal level.
This requires a mac80211 change to properly announce the
max_qual.qual and avg_qual.qual values.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Dan Williams [Wed, 11 Feb 2009 22:14:43 +0000 (17:14 -0500)]
cfg80211: age scan results on resume
Scanned BSS entries are timestamped with jiffies, which doesn't
increment across suspend and hibernate. On resume, every BSS in the
scan list looks like it was scanned within the last 10 seconds,
irregardless of how long the machine was actually asleep. Age scan
results on resume with the time spent during sleep so userspace has a
clue how old they really are.
Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Tue, 17 Feb 2009 13:04:29 +0000 (14:04 +0100)]
rt2x00: Fix RF offset
The word_base is in bytes instead of word index number,
this means that when using it, it should be transformed into
a word index first.
Otherwise RF register reading will fail through debugfs since
we would start reading 4 words starting with word 4 (which is the last
valid word for RF).
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Tue, 17 Feb 2009 11:24:57 +0000 (13:24 +0200)]
nl80211: Provide access to STA TX/RX packet counters
The TX/RX packet counters are needed to fill in RADIUS Accounting
attributes Acct-Output-Packets and Acct-Input-Packets. We already
collect the needed information, but only the TX/RX bytes were
previously exposed through nl80211. Allow applications to fetch the
packet counters, too, to provide more complete support for accounting.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Mon, 16 Feb 2009 17:39:13 +0000 (19:39 +0200)]
nl80211: Optional IEs into scan request
This extends the NL80211_CMD_TRIGGER_SCAN command to allow applications
to specify a set of information element(s) to be added into Probe
Request frames with NL80211_ATTR_IE. This provides support for the
MLME-SCAN.request primitive parameter VendorSpecificInfo and can be
used, e.g., to implement WPS scanning.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Sun, 15 Feb 2009 17:06:11 +0000 (12:06 -0500)]
ath5k: move beacon processing to a tasklet
We currently send beacons directly from the interrupt routine. This
can hold up interrupt processing in beaconing modes and makes the
ISR somewhat more complex. Move it to a tasklet like rx and tx.
Changes-licensed-under: 3-Clause-BSD
Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Sun, 15 Feb 2009 17:06:10 +0000 (12:06 -0500)]
ath5k: use spin_lock_irqsave for beacon lock
ath5k_reset can be called from process context, which in turn can
call ath5k_beacon_config which takes the sc->block spinlock. Since
it can also be taken in hard irq context, use spin_lock_irqsave
everywhere. This fixes a potential deadlock in adhoc mode.
Changes-licensed-under: 3-Clause-BSD
Cc: stable@kernel.org Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Sun, 15 Feb 2009 17:06:09 +0000 (12:06 -0500)]
ath5k: don't mask off interrupt bits
Since interrupts are already masked by the hardware, there's no need to
discard interrupt bits in the ISR itself. Also, in ath5k_beacon_config
we mask off a couple of bits without locking, so doing this mask in
software can lead to unhandled beacon timer and beacon miss interrupts.
Changes-licensed-under: 3-Clause-BSD
Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Sun, 15 Feb 2009 16:42:48 +0000 (17:42 +0100)]
rt2x00: Remove check for rf word 0
The only way rf_write() can be called with word 0 is
when the user sends the wrong word index through debugfs.
However the values which are send through debugfs are
validated using the RF_BASE and RF_SIZE macro values,
the most logical solution is to increase RF_BASE with 4
and decrease RF_SIZE with 4 (RF_SIZE has always been
1 word too big)
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Randy Dunlap [Sat, 14 Feb 2009 00:39:35 +0000 (16:39 -0800)]
wireless: fix for CONFIG_NL80211=n
Add empty function for case of CONFIG_NL80211=n:
net/wireless/scan.c:35: error: implicit declaration of function 'nl80211_send_scan_aborted'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Fri, 13 Feb 2009 19:51:19 +0000 (11:51 -0800)]
iwlwifi: Fix and rework Kconfig file
Fixes:
- iwlwifi is an optional driver and should thus not default to 'y'.
- 3945 now depends on IWLCORE.
Rework:
- There is not a case when IWLCORE should not be selected. At the same time
the driver does not use IWLWIFI or IWLCORE. We can just merge the usage of
these two. With IWLWIFI being the driver name we proceed to use just it and
replace instances of IWLCORE with it. The module name does not change
and is still iwlcore.
- Both IWLAGN and IWL3945 are selecting FW_LOADER, we can thus just move
this up to one select when IWLWIFI is selected.
- IWL5000 now supports Intel Wireless Wifi 100, 6000, and 6050 series.
- Now that 3945 depends on IWLWIFI we can also indicate its dependency on
MAC80211_LEDS and LEDS_CLASS at this level.
- IWLAGN_LEDS is not used by driver - remove it.
- IWLAGN_SPECTRUM_MEASUREMENT actually depends on IWLWIFI as it forms part
of iwlcore module. Move this config up in Kconfig to reflect that and also
change name to IWLWIFI_SPECTRUM_MEASUREMENT.
- CONFIG_IWLWIFI_RFKILL is used by iwlagn as well as iwl3945, add text to
description that indicates this.
- CONFIG_IWL3945_RFKILL does not exist - remove usage from driver.
- Add "iwlagn" to end of description of IWLAGN to help people understand
what iwlagn means in rest of Kconfig text.
- Add "iwl3945" to end of description of IWL3945 to help people understand
what iwlagn means in rest of Kconfig text.
- Change IWLWIFI_DEBUGFS description to indicate that only iwlagn supports
it (for now).
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Fri, 13 Feb 2009 19:51:18 +0000 (11:51 -0800)]
iwlwifi: use singlethread workqueue
Use one workqueue instead of one per CPU.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
cc: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jiri Slaby [Thu, 12 Feb 2009 21:29:40 +0000 (22:29 +0100)]
ipw2200, fix ipw io functions
- some of them are defined as follows:
#define ipw_write32 expr1; expr2
and are called from loops or ifs without a compound statement, so
they are broken. Fix it by putting them into do {} while (0) for
writes and ({ }) for reads.
- also unify and cleanup them while at it -- convert them from
macros to inline functions, so that we get some basic typechecking
Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Acked-by: Zhu Yi <yi.zhu@intel.com> Cc: James Ketrenos <jketreno@linux.intel.com> Cc: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Thu, 12 Feb 2009 18:38:58 +0000 (13:38 -0500)]
ath9k: move common regulatory code out of if() branches
Both branches of the regulatory check in ath_attach() set up a
custom regulatory domain and apply radar and world flags, so extract
those into a single path.
While at it, fix a couple of spelling errors and an unnecessary extra
pointer traversal.
Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Thu, 12 Feb 2009 18:38:57 +0000 (13:38 -0500)]
ath9k: remove prototype for ath9k_regd_get_current_country
ath9k_regd_get_current_country() doesn't exist.
Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Thu, 12 Feb 2009 18:38:56 +0000 (13:38 -0500)]
ath9k: remove ath9k_regd_get_rd()
The function ath9k_regd_get_rd() is unused.
Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Thu, 12 Feb 2009 18:38:55 +0000 (13:38 -0500)]
ath9k: convert isWwrSKU macro into C code
Write isWwrSKU as an inline function and nix the camel-case to make
the routine slightly clearer. Change its argument to take the regd
value directly so it can eventually be used by ath5k as well.
Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Thu, 12 Feb 2009 18:38:54 +0000 (13:38 -0500)]
ath9k: save a few calls to ath9k_regd_get_eepromRD
Since we already have a stack variable to track the eeprom regd,
we can grab it up front it and save three calls to fetch it again.
Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Thu, 12 Feb 2009 18:38:53 +0000 (13:38 -0500)]
ath9k: remove write-only current_rd_inuse
The current_rd_inuse regulatory value is assigned but not used anywhere.
Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Thu, 12 Feb 2009 17:51:03 +0000 (18:51 +0100)]
iwlagn: clean up error path in iwl_pci_probe
This avoids triggering a BUG_ON in pci_disable_msi in the error path.
Furthermore remove the first call to pci_disable_device as it is already
called at out_pci_disable_device.
Both issues were introduced in the patch "iwlagn: fix hw-rfkill while
the interface is down".
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Thu, 12 Feb 2009 06:08:37 +0000 (11:38 +0530)]
mac80211: Extend the rate control API with an update callback
The AP can switch dynamically between 20/40 Mhz channel width,
in which case we switch the local operating channel, but the
rate control algorithm is not notified. This patch adds a new callback
to indicate such changes to the RC algorithm.
Currently, HT channel width change is notified, but this callback
can be used to indicate any new requirements that might come up later on.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Thu, 12 Feb 2009 04:36:45 +0000 (10:06 +0530)]
ath9k: Enable Fractional N mode
This patch enables Fractional N mode for all channel
if the EEPROM says so, and also fixes the INI only
when the device is not a 2 GHz only capable device.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>