Commit Graph

13931 Commits

Author SHA1 Message Date
Ashok Nagarajan ffb1c56a97 ath9k: Fix mactime from being clobbered in rx_status
mactime was being overwritten by the function ath9k_rx_skb_preprocess. Fixed by
memsetting rx_status in ath_rx_tasklet.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-12 14:21:52 -04:00
Rajkumar Manoharan 9f61903ca2 ath9k: configure bss info at assoc notification
The proper place to configure bss info is at assoc notification. So that
ath9k continues to work if the supirous bssid notification will be
removed in future.

Cc: Johannes Berg <johannes@sipsolutions.net>
Reported-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-12 14:21:51 -04:00
Helmut Schaa 290d60891e rt2x00: Fix beacon skew in rt2800pci
rt2800pci is suffering from beacon skew in AP mode. Some powersaving
clients (like VOIP phones) are getting into trouble after some time
when the beacon skew is getting too big.

The ralink legacy drivers contain a function that indicates that the
beacon timer is off by 1us per tbtt. And this function works around
that by reducing the beacon interval for every 64th beacon transmission
by 64us (the smallest possible value). Do the same in rt2800pci.

This allows proper powersaving when rt2800pci is used in AP mode.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-12 14:21:49 -04:00
Mohammed Shafi Shajakhan 3789d59c24 ath9k_hw: Fix enabling of MCI and RTT
tested in AR9462 Rev:2, both hardware capability flag are set

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-12 14:19:37 -04:00
Stanislav Yakovlev 138f07edb6 net/wireless: ipw2x00: remove unused definitions for regulatory domain
ipw2200 driver does not use these defines, it uses geo struct instead.
Therefore remove them from its header.

Note: we keep them in the ipw2100 driver's header, because the driver
still uses them.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-12 14:19:37 -04:00
Ben Greear 98b36a0295 ath9k: Add wiphy name to log messages.
On systems with multiple NICs, it's nice to know which
one is producing warnings.  Here is an example of the
new ouput:

ath: wiphy0: Failed to stop TX DMA, queues=0x005!

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-12 14:19:36 -04:00
Ashok Nagarajan 4e13f092f7 mac80211_hwsim: Fix set mactime on receiver hwsim radio
The patch "mac80211_hwsim:  Add tsf to beacons, probe responses and radiotap
header" was setting the mactime on wrong hwsim radio. This patch fixes it.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-12 14:19:35 -04:00
Sujith Manoharan bff2ec2b91 ath9k: Fix BTCOEX shutdown
Flush MCI profiles only if MCI is being actually used.
This fixes a panic on driver unload when non-MCI devices
are being used and btcoex_enable is set.

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: [<ffffffffa06296d2>] ath_mci_flush_profile+0x12/0x100 [ath9k]
Call Trace:
[<ffffffffa061befe>] ath9k_stop_btcoex+0x5e/0x80 [ath9k]
[<ffffffffa061ed57>] ath9k_stop+0xb7/0x230 [ath9k]
[<ffffffffa0533f30>] ieee80211_stop_device+0x50/0x180 [mac80211]
[<ffffffffa051f0cf>] ieee80211_do_stop+0x2af/0x6a0 [mac80211]
[<ffffffffa051f4da>] ieee80211_stop+0x1a/0x20 [mac80211]
[<ffffffff81365d96>] __dev_close_many+0x86/0xe0
[<ffffffff81365ee0>] dev_close_many+0xa0/0x110
[<ffffffff81366038>] rollback_registered_many+0xe8/0x260
[<ffffffff813661cb>] unregister_netdevice_many+0x1b/0x80
[<ffffffffa051e950>] ieee80211_remove_interfaces+0xd0/0x110 [mac80211]
[<ffffffffa050c133>] ieee80211_unregister_hw+0x53/0x120 [mac80211]
[<ffffffffa061d5a4>] ath9k_deinit_device+0x44/0x70 [ath9k]
[<ffffffffa062c1d4>] ath_pci_remove+0x54/0xa0 [ath9k]
[<ffffffff81267c46>] pci_device_remove+0x46/0x110
[<ffffffff8131021c>] __device_release_driver+0x7c/0xe0
[<ffffffff81310960>] driver_detach+0xd0/0xe0
[<ffffffff81310078>] bus_remove_driver+0x88/0xe0
[<ffffffff81311122>] driver_unregister+0x62/0xa0
[<ffffffff81268004>] pci_unregister_driver+0x44/0xc0
[<ffffffffa062c8b5>] ath_pci_exit+0x15/0x20 [ath9k]
[<ffffffffa063205d>] ath9k_exit+0x15/0x31 [ath9k]
[<ffffffff810b92cc>] sys_delete_module+0x18c/0x270
[<ffffffff814373dd>] ? retint_swapgs+0x13/0x1b
[<ffffffff8124828e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff81437de9>] system_call_fastpath+0x16/0x1b

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-12 14:19:33 -04:00
Stanislaw Gruszka 3780d038fd rt2x00: fix random stalls
Is possible that we stop queue and then do not wake up it again,
especially when packets are transmitted fast. That can be easily
reproduced with modified tx queue entry_num to some small value e.g. 16.

If mac80211 already hold local->queue_stop_reason_lock, then we can wait
on that lock in both rt2x00queue_pause_queue() and
rt2x00queue_unpause_queue(). After drooping ->queue_stop_reason_lock
is possible that __ieee80211_wake_queue() will be performed before
__ieee80211_stop_queue(), hence we stop queue and newer wake up it
again.

Another race condition is possible when between rt2x00queue_threshold()
check and rt2x00queue_pause_queue() we will process all pending tx
buffers on different cpu. This might happen if for example interrupt
will be triggered on cpu performing rt2x00mac_tx().

To prevent race conditions serialize pause/unpause by queue->tx_lock.

Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-12 14:00:17 -04:00
Stanislaw Gruszka 210787e82a iwl3945: fix possible il->txq NULL pointer dereference in delayed works
On il3945_down procedure we free tx queue data and nullify il->txq
pointer. After that we drop mutex and then cancel delayed works. There
is possibility, that after drooping mutex and before the cancel, some
delayed work will start and crash while trying to send commands to
the device. For example, here is reported crash in
il3945_bg_reg_txpower_periodic():
https://bugzilla.kernel.org/show_bug.cgi?id=42766#c10

Patch fix problem by adding il->txq check on works that send commands,
hence utilize tx queue.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-12 14:00:16 -04:00
Aarthi Thiruvengadam 17a7b16df4 ath6kl: Fix merge error in ath6kl_set_ies()
Portion of the commit id 080eec4fb4 ("ath6kl: Clear the IE in firmware
if not set") was overwritten by mistake due to a merge
conflict. This patch fixes the code back to how it should be.

kvalo: more details to the commit log

Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-12 09:46:56 +02:00
David S. Miller b2d3298e09 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-03-09 14:34:20 -08:00
John W. Linville 74dd1521d0 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2012-03-09 14:57:30 -05:00
Wey-Yi Guy 1745e4405b iwlwifi: fix the delta for remove max_txq_num patch
BIg portion of "iwlwifi: remove max_txq_num from hw_params" was
missing during merge, here is the fix for it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-09 14:25:14 -05:00
Wey-Yi Guy 9ba1947a89 iwlwifi: fix cmd_queue number merge
iwlwifi: move command queue number out of the iwl_shared struct
move the cmd_queue out of iwl_shared struct, but for some reason the
patch is half done and fail compile

Here is the fix

John, could you apply this patch to wireless-next to address the issue
Thanks

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-09 13:20:50 -05:00
Emmanuel Grumbach 3dc420be8c iwlwifi: restore PAN support
in iwlwifi: move setting up fw parameters

Meenakshi moved code up to configure the transport layer, but this
code read the sku before it was set (from the EEPROM). This killed
P2P.
Only the ucode_flags are needed to configure the transport layer, not
the sku which _must_ be set after the EEPROM is read.

We need to reconfigure the transport in case the EEPROM disabled PAN
support. This is not the nicest thing to do, but we have no choice.
Document that we are allowed to configure the transport several times
before start_fw, but not after.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-09 11:32:59 -05:00
Meenakshi Venkataraman c6f600fcfe iwlwifi: move command queue number out of the iwl_shared struct
The command queue number is required by the transport
layer, but it can be determined only by the op mode.
Move this parameter to the dvm op mode, and configure
the transport layer using an API.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-09 11:32:58 -05:00
Amitkumar Karwar 8763848e03 mwifiex: correction in number of bitrates
In recent commit "mwifiex: correct bitrates advertised..", we have
removed 22Mbps and 72Mbps bitrates from supported bitrate array.
It means number of bitrates has reduced from 14 to 12.

Initialize ".n_bitrates" to array size instead of hardcoding it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 14:05:08 -05:00
Stanislav Yakovlev d11f0ca012 net/wireless: ipw2x00: remove WEXT_USECHANNELS define
Driver does not use it any more.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 14:05:07 -05:00
Don Fry 1353a7ba7e iwlwifi: correct status bit refactoring errors
I missed a couple of status bits in my refactoring changes.  This
fixes the ones I missed.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 14:02:29 -05:00
Johannes Berg 974205153b iwlwifi: don't delete AP station directly
With the mac80211 deauth sequence changes, the
station is deleted before the device is set
unassociated. This can cause the device to get
confused as it expects the station to be there
while the associated bit is set.

To fix this, do not delete the AP station from
the device when mac80211 asks for deletion,
instead just mark it as unused and rely on the
unassociated RXON to drop it from the station
database in the device.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 14:02:29 -05:00
Johannes Berg e6dd5838ac iwlwifi: make iwl_init_context static
It's not needed anywhere but during init.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 14:00:01 -05:00
Johannes Berg bada991b45 iwlwifi: remove messages from queue wake/stop
The only reason we ever stop/wake queues at
the transport level is now that they become
full (or non-full), so the messages aren't
useful any more -- remove them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 14:00:01 -05:00
Don Fry 83626404a7 iwlwifi: more status bit factoring
Continue splitting the status bits between transport and op_mode.
All but a few are separated.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:55 -05:00
Meenakshi Venkataraman 9bdfbfadc4 iwlwifi: move setting up fw parameters
Gather parameters required to configure the
transport layer before invoking the transport
configuration API.

Change-Id: I5b39da284af6d9b5432a08911b4e1173a4d7207d
Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:55 -05:00
Meenakshi Venkataraman 92d743ae10 iwlwifi: configure transport layer from dvm op mode
Introduce the iwl_trans_config struct which contains
state variables that only the op mode can determine,
but which the transport layer needs to know.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:55 -05:00
Emmanuel Grumbach 3251715dc5 iwlwifi: log stop / wake queues
There were a few missing occurences when we get PASSIVE_NO_RX
notification.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:54 -05:00
Stanislaw Gruszka 354928dd00 iwlwifi: make tx_cmd_pool kmem cache global
Otherwise we are not able to run more than one device per driver:

[   24.743045] kmem_cache_create: duplicate cache iwl_dev_cmd
[   24.743051] Pid: 3165, comm: NetworkManager Not tainted 3.3.0-rc2-wl+ #5
[   24.743054] Call Trace:
[   24.743066]  [<ffffffff811717d5>] kmem_cache_create+0x655/0x700
[   24.743101]  [<ffffffffa03b9f8b>] iwl_alive_notify+0x1cb/0x1f0 [iwlwifi]
[   24.743111]  [<ffffffffa03ba442>] iwl_load_ucode_wait_alive+0x1b2/0x220 [iwlwifi]
[   24.743142]  [<ffffffffa03ba893>] iwl_run_init_ucode+0x73/0x100 [iwlwifi]
[   24.743152]  [<ffffffffa03b8fa1>] __iwl_up+0x81/0x220 [iwlwifi]
[   24.743161]  [<ffffffffa03b91c0>] iwlagn_mac_start+0x80/0x190 [iwlwifi]
[   24.743188]  [<ffffffffa03307b3>] ieee80211_do_open+0x293/0x770 [mac80211]

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:54 -05:00
Don Fry 9a716863ae iwlwifi: separate status to priv and trans
The shared status bits are a mixture of transport and op mode bits.
Some are used just by one or the other, some are shared.  Begin the
de-tangling of these bits.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:53 -05:00
David Spinadel 18c57d3c1e iwlwifi: add option to test MFP
Add a Kconfig symbol to enable MFP for testing even
if the firmware file doesn't advertise it.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:53 -05:00
Amit Beka 8e81f65fdc iwlwifi: fixed testmode notifications length
The length of iwl_rx_packet doesn't include the
dword for the length itself, so add it manually.

Signed-off-by: Amit Beka <amit.beka@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:52 -05:00
Amit Beka 0aef8ddc8b iwlwifi: add testmode command for rx forwarding
Added a testmode command which tells iwl_rx_dispatch
to send the RX both as a notification to nl80211 and
with the registered RX handlers.

This is used for monitoring RX from userspace while preserving
the regular flows in the driver.

Signed-off-by: Amit Beka <amit.beka@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:52 -05:00
Stanislaw Gruszka 8722c899a0 iwlwifi: reintroduce iwl_enable_rfkill_int
If device is disabled by rfkill switch, do not enable all interrupts,
but only CSR_INT_BIT_RF_KILL to receive rfkill state change. Unblocking
other interrupts might cause problems, since driver can not be prepared
for receive them.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:52 -05:00
Stanislaw Gruszka c2945f390d iwlwifi: print DMA stop timeout error only if it happened
iwl_poll_direct_bit() return negative error value on timeout,
positive values do not indicate an error.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:51 -05:00
Stanislaw Gruszka 05f5b97ee0 iwlwifi: use writeb,writel,readl directly
That change will save us some CPU cycles at run time. Having port-based
I/O seems to be not possible for PCIe devices.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:51 -05:00
Stanislaw Gruszka 3a73a30049 iwlwifi: cleanup/fix memory barriers
wmb(), rmb() are not needed when writel(), readl() are used as
accessors for MMIO. We use them indirectly via iowrite32(),
ioread32().

What is needed mmiowb(), for synchronizing writes coming from
different CPUs on PCIe bridge (see in patch comments). This
fortunately is not needed on x86, where mmiowb() is just
defined as compiler barrier. As iwlwifi devices are most likely
not used on anything other than x86, this is not so important
fix.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:50 -05:00
Stanislaw Gruszka bfe4b80e9f iwlwifi: always check if got h/w access before write
Before we write to the device registers always check if
iwl_grap_nic_access() was successful.

On the way change return type of grab_nic_access() to bool, and add
likely()/unlikely() statement.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:50 -05:00
Stanislaw Gruszka aa5affbacb iwlwifi: dump stack when fail to gain access to the device
Print dump stack when the device is not responding. This should give
some more clue about the reason of failure. Also change the message we
print, since "MAC in deep sleep" is kinda confusing.

On the way add unlikely(), as fail to gain NIC access is hmm ...
unlikely.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:50 -05:00
Johannes Berg 9441b85d59 iwlwifi: return error if loading uCode failed
In "iwlwifi: consolidate the start_device flow"
the code flow changed and the firmware is now
loaded by the transport layer, but the change
unfortunately lost error checking -- restore.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:49 -05:00
Johannes Berg 9563fe1696 iwlwifi: remove unused max_nrg_cck from sensitivity and constify
The sensitivity parameters are never modified, so they
should be const. Also remove the unused max_nrg_cck
value to save some space.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:49 -05:00
Johannes Berg 51dc51d12b iwlwifi: make EEPROM enhanced TX power a bool
There's no need to carry around the function
pointer when a boolean indicating that the
EEPROM stores enhanced TX power information
is sufficient.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:49 -05:00
Johannes Berg a75a79a84f iwlwifi: move BT/HT params to shared
Hardware parameters will be shared, so
move the definitions into the shared
header file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:48 -05:00
Johannes Berg 562f08eb80 iwlwifi: remove BT handlers from lib_ops
There's no need to have operations for
these as they simply depend on whether
the device has built-in bluetooth, so
just duplicate the information already
there (whether bt_params is present or
not).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:48 -05:00
Johannes Berg b0b4619273 iwlwifi: transport's tx_agg_disable must be atomic
At least as long as it is called from the reclaim
flow (iwlagn_check_ratid_empty) it must be atomic.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:48 -05:00
Johannes Berg e755f882b7 iwlwifi: redesign PASSIVE_NO_RX workaround
The PASSIVE_NO_RX workaround currently crosses
through the op_mode and transport layers, which
is a bit odd. This also isn't necessary, if the
transport simply reports when queues are full
(or no longer full) the op_mode can keep track
of this state, and report to mac80211 only what
*it* thinks is appropriate. What is appropriate
can then be based on whether queues should be
stopped to wait for RX or not.

This significantly simplifies the transport API,
it no longer needs to expose anything to stop a
queue, nor to wake "any" queue, this can all be
handled in the upper layer completely.

Also simplify the handling to not be dependent
on the context, that makes little sense as the
queues are shared and both contexts have to be
on the same channel anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:47 -05:00
Johannes Berg ea886a6014 iwlwifi: remove unused argument from iwlagn_suspend
There's not much point in passing priv and
hw pointers since they can be derived from
each other, and the function doesn't use
the hw pointer anyway. Remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:47 -05:00
Johannes Berg c1803c9459 iwlwifi: remove two unused arguments in testmode
The dump functions never access the incoming
attributes, so don't pass them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:46 -05:00
Johannes Berg 03dadf96aa iwlwifi: remove unused argument from iwl_init_hw_rates
The function never uses the priv argument as it
only fills in the passed data, so remove the
argument.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:46 -05:00
Johannes Berg 955570fc66 iwlwifi: move iwl_sta_id_or_broadcast to user
There's only one user, so the function
can be moved into the correct file. It
also loses an argument along the way.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:45 -05:00
Johannes Berg 9b6ca44823 iwlwifi: remove unused argument from rs_initialize_lq
The function never uses its conf argument,
so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:45 -05:00
Johannes Berg fdeff46586 iwlwifi: remove unused arguments from iwlagn_gain_computation
The function has two arguments it never uses,
remove them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08 13:59:45 -05:00
Luciano Coelho cc4bf501a2 Merge branch 'wl12xx-next' into for-linville 2012-03-08 14:40:40 +02:00
Arik Nemtsov 55df5afb13 wl12xx: implement SW Tx watchdog
Track freed FW blocks during Tx. If no blocks were freed during a
predefined timeout, initiate a HW recovery. This helps in situations
when the FW watchdog fails.

Don't trigger recovery during activities that can temporarily stop
Tx. This includes:
- scanning
- buffering packets for sleeping stations (AP role)
- ROC on any role

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-08 14:25:18 +02:00
Attila Fazekas 41b58f189a rtl8187: Add AD-HOC support
Add AD-HOC support to the rtl8187 based on the rtl8180 source

Signed-off-by: Attila Fazekas <turul64@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:37 -05:00
Johannes Berg b443d8d8a2 iwlwifi: make iwl_fill_probe_req static
This function is only used in iwl-scan.c, so
if we move it up a little in the file it can
be made static.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:36 -05:00
Johannes Berg e7a0d0c449 iwlwifi: clean up iwl-commands.h
Do some cleanups here:
 * remove an unused prototype
 * remove some unused constants
 * clean up includes

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:36 -05:00
Johannes Berg eae63b858f iwlwifi: don't include iwl-prph.h everywhere
It's only needed in a few places.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:35 -05:00
Johannes Berg 55bba9eafb iwlwifi: remove PA type configuration
No need to have a special config variable
for the PA type, we can just use the
additional NIC config function to config
the hardware correctly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:35 -05:00
Johannes Berg ef0ef9c8de iwlwifi: remove priv from shared
Finally nothing needs to access priv
from shared any more, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:35 -05:00
Johannes Berg ecdb975c92 iwlwifi: virtualize nic_config
The nic_config sets uCode dependent register
bits, so it must be virtual in the op_mode.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:34 -05:00
Johannes Berg f8d7c1a18d iwlwifi: move packet to transport
The base packet structure will (hopefully) be
the same for all transports, but what is in it
differs. Remove the union of all the possible
contents and move the packet itself into the
transport header file. This requires changing
all users of the union to just use pkt->data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:34 -05:00
Johannes Berg 7559553660 iwlwifi: move irq to PCIe
Even if the variable might also be used by other
transports, there's no need for anything outside
of the transport itself to access it, so move it
into the private area.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:34 -05:00
Johannes Berg 13df1aab4a iwlwifi: move all uCode load variables
All variables related to uCode loading (the
waitqueue and done indication) should be in
the PCI-E transport's private data as this
is transport specific. Move them there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:33 -05:00
Johannes Berg 947a9407e3 iwlwifi: move ucode_owner to priv
The transport doesn't really need to know as
we can enforce it in the command wrapper.
Move the ucode_owner variable into priv and
do all enforcing there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:33 -05:00
Johannes Berg 4bd14dd5f7 iwlwifi: abstract out notification wait support
This will be sharable, but needs to live in the
op_mode as it is dependent on command processing.
Make a library out of the notification wait code.

Since I wrote all of the code originally and only
Intel employees changed it, we can also relicense
it to dual BSD/GPL.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:32 -05:00
Johannes Berg f47208934b iwlwifi: fix notification wait bug
In "iwlwifi: consolidate the start_device flow"
Emmanuel added the return if the fw isn't there
but forgot to take into account that the struct
for notification wait needs to be added only
after the check -- fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:32 -05:00
Johannes Berg 6794f3ee1d iwlwifi: constify remaining config data
The HW configuration settings base_params, ht_params
and bt_params all should be const, make it so.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:32 -05:00
Johannes Berg b9ad70da6a iwlwifi: put use_rts_for_aggregation into hw_params
The hardware config ht_params shouldn't be modified,
so copy the use_rts_for_aggregation parameter into
hw_params and use/modify it there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:56:31 -05:00
Johannes Berg e7a09438b3 iwlwifi: use watchdog timeout from hw_params
This is the version that can be modified, the
config params should be read-only.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:55:44 -05:00
Johannes Berg ab5c0f1f2d iwlwifi: keep plcp_delta_threshold in priv
The base_params shouldn't be writable, so keep
a copy of this in priv that can be modified.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:55:44 -05:00
Johannes Berg 3cc241ad71 iwlwifi: remove max_txq_num from hw_params
This can be used directly from the config now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:54:30 -05:00
Johannes Berg ae9625a1a9 iwlwifi: remove num_of_queues module parameter
This is a hardware parameter, so it shouldn't
be configurable by the user. Users can disable
aggregation (which is the only thing affected)
with 11n_disable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:53 -05:00
Johannes Berg 1b29dc94ac iwlwifi: clean up iwl-core.h inclusions
The transport doesn't need to include iwl-core.h any more.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:52 -05:00
Johannes Berg 0e781842cb iwlwifi: virtualize command queue full behaviour
When the command queue is full, the transport
will return -ENOSPC, but the reaction to that
depends on the op_mode. Virtualize that, the
DVM op_mode checks for CT-kill and restarts
the hardware otherwise.

We may be able to get rid of this callback by
putting the behaviour check into the wrapper
but that needs more careful evaluation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:52 -05:00
Johannes Berg 6c1011e191 iwlwifi: make tracing use device as identifier
Tracing used the priv pointer as an identifier,
which has the problem that we don't have it in
all code, and also some people say no pointers
should be "leaked" to userspace.

Use the device name instead, it is more useful
anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:52 -05:00
Johannes Berg 84abd2cc06 iwlwifi: move status check functions out of shared
They are only used in the DVM op_mode.
Also move the rfkill debug macros that
depend on them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:51 -05:00
Johannes Berg 0dde86b2f2 iwlwifi: remove shadow_reg_enable from hw_params
There's no need to copy shadow_reg_enable into
hw_params since it is a pure hardware parameter
that will never change, we can access it from
the config directly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:51 -05:00
Johannes Berg 496bab39b5 iwlwifi: remove AMT check from transport
As iwl_prepare_card_hw() is idempotent (and
many cards support AMT anyway) there's no
point in calling iwl_prepare_card_hw() only
for AMT capable devices -- call it always
and simplify the code that way.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:51 -05:00
Johannes Berg 3995deafda iwlwifi: rename ucode.h to fw-file.h
That name better reflects the contents
of the file and the fact that it isn't
related to iwl-ucode.c.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:50 -05:00
Johannes Berg c9eec95cb4 iwlwifi: move rfkill status handling out of transport
The transport layer should only check the
hardware RF kill status, not impose any
policy or reaction based on it, so move
that out of it into the op_mode.

For now keep the restriction on loading
firmware, that will have to be removed
later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:50 -05:00
Johannes Berg b1eea297d6 iwlwifi: move mutex out of shared
Now the mutex no longer needs to be
shared, so move it into iwl_priv.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:49 -05:00
Johannes Berg 2cc39c94c1 iwlwifi: move lockdep assertion into DVM
The fact that the mutex must be held is an
implementation detail of DVM, but something
has to ensure that no two synchronous cmds
are submitted concurrently. Move the lockdep
assertion into the DVM-specific code, but
also make the transport abort if there are
two concurrently commands.

The assertion is much more useful though as
the transport check can only catch it when
it actually happens, while the assertion
makes sure it can't possibly happen.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:49 -05:00
Johannes Berg 721c32f72d iwlwifi: move RF/CT kill check to command wrapper
Currently, we cannot send any commands when the
uCode is in RF or CT kill, but that will not be
true for all new uCode versions, so we need to
move the check into the uCode specific code.

Also remove the duplicate rfkill check.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:49 -05:00
Johannes Berg e10a0533a9 iwlwifi: add wrappers for command sending
Add wrappers to send commands from the DVM
op-mode (which essentially consists of the
current driver). This will allow us to move
specific sanity checks there.

Also, this removes iwl_trans_send_cmd_pdu()
since that can now be taken care of in the
DVM-specific wrapper.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:48 -05:00
Johannes Berg 965974a631 iwlwifi: remove iwl-wifi.h
This file was recently introduced, but then
directly abused -- it contained private data
that shouldn't have been used by anything
but the implementation of firmware requests
and some very core code. Now that it is no
longer accessed by any code but the code in
iwl-drv.c, we can dissolve it.

Also rename the iwl_nic struct to iwl_drv to
better reflect where and how it is used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:48 -05:00
Johannes Berg 0692fe41b3 iwlwifi: split out firmware store
Through the driver, struct iwl_fw will
store the firmware. Split this out into
a separate file, iwl-fw.h, and make all
other code use it. To do this, also move
the log pointers into it, and remove the
knowledge of "nic" from everything.

Now the op_mode has a fw pointer, and
(unfortunately) for now the shared data
also needs to keep one for the transport
to access dump the error log -- I think
that will move later.

Since I wanted to constify the firmware
pointers, some more changes were needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:47 -05:00
Johannes Berg e19918855d iwlwifi: move ucode loading to op_mode
uCode loading belongs to the op_mode, as it
is dependent on various things there and the
commands sent during it are specific to it.
Move the prototypes to iwl-agn.h to indicate
this. To make this possible, also move all
the calibration handling (which is op_mode
dependent after all).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:47 -05:00
Felix Fietkau 2ef167557c ath9k: fix signal strength reporting issues
On A-MPDU frames, the hardware only reports valid signal strength data for
the last subframe. The driver also mangled rx_stats->rs_rssi using the
ATH_EP_RND macro in a way that may make sense for ANI, but definitely
not for reporting to mac80211.
This patch changes the code to calculate the signal strength from the rssi
directly instead of taking the average value, and flag everything but
the last subframe in an A-MPDU to tell mac80211 to ignore the signal strength
entirely, fixing signal strength fluctuation issues reported by various
users.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:39 -05:00
Felix Fietkau 3a2923e83c ath9k: get rid of double queueing of rx frames on EDMA
Process rx status directly instead of separating the completion test from
the actual rx status processing.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:38 -05:00
Felix Fietkau fc16fd8808 ath9k: remove rssi/antenna information from recv debug stats
The way this is implemented (simply storing the last value) is absolutely
worthless for debugging anything, and the same information is also available
through the MAC sample feature, so there's no point in keeping this around.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:38 -05:00
Felix Fietkau 5baec7422c ath9k: make MAC sample statistics optional
They're more expensive than some of the other debug options and only used
in very rare situations, so it sometimes makes sense to disable them while
leaving in debugfs support.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:38 -05:00
Felix Fietkau 9c083af868 ath9k_hw: use cold instead of warm reset on AR9280
Cold reset is more reliable for getting the hardware out of some specific
stuck states.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07 13:51:37 -05:00
Kalle Valo b51f92e09a ath6kl: make ath6kl_bmi_[read|write]_hi32() endian safe
ath6kl_bmi_[read|write]_hi32() did not have endian support, fix that.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:04:00 +02:00
Kalle Valo 05aab177a9 ath6kl: fix too long lines
Found by checkpatch:

drivers/net/wireless/ath/ath6kl/init.c:78: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/init.c:397: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/init.c:407: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/htc.c:189: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/htc.c:704: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/htc.c:2452: WARNING: line over 80 characters

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:04:00 +02:00
Kalle Valo 12eb9444a8 ath6kl: document all spinlocks
Also fixes quite a few checkpatch warnings like this:

ath6kl/hif.h:226: CHECK: spinlock_t definition without comment

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:04:00 +02:00
Kalle Valo 8c9bb054f8 ath6kl: fix open paranthesis alignment in ath6kl_cfg80211_connect()
ath6kl/cfg80211.c:462: CHECK: Alignment should match open parenthesis

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:04:00 +02:00
Kalle Valo 1ca4d0b6b9 ath6kl: fix error handling ath6kl_target_config_wlan_params()
The error handling in ath6kl_target_config_wlan_params() was just weird,
fix that. This also fixes some of the open parenthesis alignment issues
reported by checkpatch.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:03:59 +02:00
Kalle Valo 80fb268639 ath6kl: add ath6kl_bmi_read_hi32()
There are few 32 bit reads from the host interest area. Add
ath6kl_bmi_read_hi32() to make it easier to do that. As code is cleaner
this also fixes few checkpatch warnings.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:03:59 +02:00
Kalle Valo 24fc32b356 ath6kl: add ath6kl_bmi_write_hi32()
We have a lot of 32 bit writes to the host interest area and the code
doing that is ugly. Clean that up by adding ath6kl_bmi_write_hi32().

This also fixes few checkpatch warnings.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:03:58 +02:00
Kalle Valo d0d670abcf ath6kl: remove multiple assignments
Found by checkpatch:

drivers/net/wireless/ath/ath6kl/cfg80211.c:1295: CHECK: multiple assignments should be avoided
drivers/net/wireless/ath/ath6kl/cfg80211.c:3000: CHECK: multiple assignments should be avoided

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:03:58 +02:00
Kalle Valo ddc3d77c80 ath6kl: logical continuations should be on the previous line
All found by checkpatch:

ath6kl/wmi.c:1036: CHECK: Logical continuations should be on the previous line

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:03:58 +02:00
Kalle Valo 96f1fadc94 ath6kl: alignment should match open parenthesis
Fix the issues which checkpatch found and were easy to fix. Especially
callers of ath6kl_bmi_write() are tricky and that needs to be fixed
separately.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:03:57 +02:00
Kalle Valo c650538f5d ath6kl: fix checkpatch error with EPSTAT() macro
ath6kl/debug.c:739: ERROR: Macros with complex values should be
enclosed in parenthesis

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:03:57 +02:00
Kalle Valo 51b56e263f ath6kl: fix pointer style
reported by checkpatch:

ath6kl/core.h:748: ERROR: "foo * bar" should be "foo *bar"
ath6kl/core.h:751: ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 20:03:57 +02:00
Raja Mani ce0dc0cfea ath6kl: Set optimal listen intvl,bmiss,scan params while going to wow suspend
* In order to save the target power in WOW suspend state,
  configure the best optimal values for the below parameters,
     - listen interval.
     - beacon miss interval.
     - scan parameters.

  Default values for above attributes are reverted in
  wow resume operation.

* The default listen interval is set before the host issue
  connect request.

* New function is added to configure beacon miss count.

kvalo: minor changes to fix open parenthesis alignment

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 09:49:47 +02:00
Raja Mani 8f46fccd6c ath6kl: Maintain the listen interval per VIF specific
Firmware has the option to support the listen interval
per vif specific. Fix this.

Listen interval can be set by the TUs or by the number
of beacons. Current code enables the user to configure
the listen interval in the unit of 'number of beacons'
using debugfs entry "listen_interval". Going forward,
we need to alter the listen interval in the unit of TUs
to get good power numbers while going to WOW suspend/resume.

Allowing the user to change the listen interval in
the unit of "number of beacons"  in debugfs and changing
listen interval in wow suspend/resume in the unit of
time (TUs) would lead us to confuse.

This patch make sures the listen interval is changed only
in the unit of time (TUs).

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 09:38:25 +02:00
Raja Mani 390a8c8fae ath6kl: Check wow state before sending control and data pkt
Below two scenarios are taken care in this patch which helped
to fix the firmware crash during wow suspend/resume.

* TX operation (ctrl tx and data tx) has to be controlled based
  on suspend state. i.e, with respect to WOW mode, control packets
  are allowed to send from the host until the suspend state goes
  ATH6KL_STATE_WOW and the data packets are allowed until WOW
  suspend operation starts.

* Similarly, wow resume is NOT allowed if WOW suspend is in progress.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 09:34:14 +02:00
Raja Mani 1e9a905d9a ath6kl: Add provision to define suspend policy in disconnected state.
It gives flexibility to the user to define suspend policy
when the suspend mode is set to WOW and the device is in
disconnected state at the time of suspend.

New module parameter wow_mode is added to get the choice
from the user. This parameter is valid only if the module
parameter suspend_mode is set to WOW.

To force WOW in connected state and cut power
in disconnected state:
  suspend_mode=0x3 wow_mode=0x1

To force WOW in connected state and deep sleep
in disconnected state (this is also the default wow_mode):
   suspend_mode=0x3 wow_mode=0x2

If there is no value specified to wow_mode during insmod,
deep sleep mode will be tried in the disconnected state.

kvalo: clarified commit log

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-03-07 09:17:10 +02:00
Felix Fietkau 5c17ddc4a0 ath5k: do not re-run AGC calibration periodically
All other Atheros drivers run the AGC gain calibration and DC offset
calibration only after reset. Running them periodically has caused stability
issues on some (primarily AR2315/2413/5413/5414 based) devices, leading to
messages such as:

ath5k phy0: gain calibration timeout (2462MHz)
ath5k phy0: calibration of channel 11 failed

Related bug reports:
https://dev.openwrt.org/ticket/10574
https://bugzilla.redhat.com/show_bug.cgi?id=795141

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:18 -05:00
Felix Fietkau 62e2c102cc ath5k: do not stop queues for full calibration
Some calibration types interfere with tx activity, but the queue stop does
not prevent that. In fact, some calibration types need tx activity to properly
function, so stopping the queues for them is counterproductive.
In some tests this patch has been shown to improve stability, especially in
AP or ad-hoc mode.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:17 -05:00
Javier Cardona 12ce8ba3eb mac80211: Modify tsf via debugfs in mesh interfaces
Signed-off-by: Javier Cardona <javier@cozybit.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:17 -05:00
Javier Cardona 2f40b94049 mac80211_hwsim: Add tsf to beacons, probe responses and radiotap header.
Generate a tsf from internal kernel clock.  Prepare the path for having
different tsf offsets on each phy.  This will be useful for testing
mesh synchronization algorithms.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:17 -05:00
Johannes Berg 2e7eb11758 iwlwifi: move firmware completion wait
This doesn't belong into the op_mode, it has
to be in the drv stop flow instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:16 -05:00
Johannes Berg 15854ef94f iwlwifi: move firmware request into drv
Firmware request is a base driver flow,
it isn't related to any specific mode.
Move the code related to it into the
base driver file iwl-drv.c.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:16 -05:00
Johannes Berg 702e0630ee iwlwifi: move iwl_base_params to shared header
This is used from there, so should be in it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:16 -05:00
Johannes Berg 7db5b989a0 iwlwifi: move uCode deallocation to drv
This shouldn't be in the op_mode, as it
will later be switchable at runtime.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:15 -05:00
Johannes Berg ab0bd5b32a iwlwifi: fix station HT parameters
My patch "iwlwifi: simplify auth/assoc flow"
caused a serious throughput degradation due
to me forgetting that there are HT settings
in the station table. To restore throughput,
set these parameters correctly when the sta
moves to assoc state.

This patch should probably be merged with
the auth/assoc redesign patch for upstream.
In that case, this paragraph should be added
to the commit log as the third paragraph
(before talking about RXON):

However, as we only get the station HT data
when the station moves into assoc state, we
also need to program this into the device
(and copy it into our database) then.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:15 -05:00
Johannes Berg 61f0439277 iwlwifi: move traffic log definitions
These are DVM specific, and shouldn't be
in iwl-shared.h.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:15 -05:00
Johannes Berg 0439bb6200 iwlwifi: move IWL_MASK into file using it
Only used in two places in the same file,
no need to be in iwl-shared.h.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:14 -05:00
Johannes Berg 70a18c5d57 iwlwifi: move tid_to_ac to PCI-E
Currently, queue mapping is handled in the
transport. This may change, but until then
the code for it can be close to where it's
used rather than in iwl-shared.h.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:14 -05:00
Johannes Berg 930dfd5f20 iwlwifi: iwl_rx_cmd_buffer belongs to transport API
This is how the transport passes things
up into higher layers, so it belongs to
the transport API.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:14 -05:00
Johannes Berg bffc66ce22 iwlwifi: move queue functions to PCI-E
iwl_queue_inc_wrap/iwl_queue_dec_wrap aren't
shared functions, they are PCI-E specific,
so move them into the appropriate header.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:14 -05:00
Johannes Berg c977a33d84 iwlwifi: transport's tx_agg_alloc must not sleep
The annotation/documentation is wrong, we call
it in a context that can't sleep.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:13 -05:00
Johannes Berg df2f3216cc iwlwifi: refactor PCI-E RX path
Just make the code easier to read with less indentation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:13 -05:00
Johannes Berg 48a2d66f58 iwlwifi: don't pass iwl_rx_mem_buffer to upper layers
struct iwl_rx_mem_buffer implementation details
(DMA address, list pointers) that the upper
layers don't need. Introduce iwl_rx_cmd_buffer
that is passed upstream and only contains the
needed data (the page). Additionally, access
this data only via accessor functions, allowing
us to change the implementation in the future.
These accessors are rxb_addr() (as before) and
rxb_steal_page() to take ownership of the data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:12 -05:00
Johannes Berg 65b94a4abf iwlwifi: pass response packet directly
When CMD_WANT_SKB is set for a (synchronous)
command, the response is passed back to the
caller which is then responsible for freeing
it. Make this more abstract with real API,
passing directly the response packet in the
new cmd.resp_pkt member and also introduce
iwl_free_resp() to free the pages -- this
way the upper layers don't have to directly
touch the page implementation.

NOTE: This breaks IDI -- the new code isn't reflected there yet!

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:12 -05:00
Johannes Berg 2c6ab7ff8f iwlwifi: use ieee80211_tx_status
We currently use the _irqsafe version, but that
isn't recommended together with ieee80211_rx()
as it can cause races. If the device reports
a TX-status and RX in that order then with the
current combination mac80211 might process them
in the other order, which can cause issues with
powersaving clients.

Use ieee80211_tx_status() to avoid this race.
Since we don't want to call it with locks held,
process the frame queues later -- this is fine
as they are on the stack.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:12 -05:00
Johannes Berg 15b86bff99 iwlwifi: move wowlan bool into priv
With the new WoWLAN flow into the transport
there no longer is a need for this to be
shared, so move it into priv.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:12 -05:00
Johannes Berg 2dd4f9f731 iwlwifi: clean up (wowlan) suspend flow
In the WoWLAN suspend flow, instead of accessing
registers directly, ask the transport to do the
required setup at the end of suspend. If the
transport doesn't implement this, don't tell the
stack we support WoWLAN.

When the device suspends w/o WoWLAN, mac80211
will have stopped it already, which has already
called iwl_apm_stop() via stop_hw(). Thus, it
isn't necessary to call it again in pcie_suspend
and we can simply do nothing there.

This unifies the regular and WoWLAN suspend.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:12 -05:00
Johannes Berg ce9e80af4f iwlwifi: reduce IDI code ifdef
The code in the two branches of the #ifdef
is almost the same so move the common code
outside the #ifdef.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:11 -05:00
Johannes Berg 706c4ff67c iwlwifi: make config const
Writing to the global config structures
is always wrong. To protect against such
mistakes in the future, mark them const.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:11 -05:00
Johannes Berg 7e79a3937a iwlwifi: use valid TX/RX antenna from hw_params
It's not really a good idea to write to the
global static configuration. Use the valid
TX/RX antenna information only from the HW
params struct except in the case where the
values from the config are used to override
the values from the EEPROM.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:11 -05:00
Johannes Berg 54708d8df3 iwlwifi: remove SKU from config
There's no SKU override, we always just use
it from EEPROM. As such, we can remove it
from the config and use it in hw_param only.
Since iwl_eeprom_check_sku() really needs
to fill it in also rename that to
iwl_eeprom_init_hw_params().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:11 -05:00
Johannes Berg a8bceb392a iwlwifi: remove per-device debug level
There's no need for the per-device debug
level that we expose in debugfs since the
module parameter is writable in sysfs.

At the same time, simplify code by changing
    iwl_get_debug_level(shrd) & IWL_DL_ISR)
to
    iwl_have_debug_level(IWL_DL_ISR)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:10 -05:00
Johannes Berg fb5fe5b9da iwlwifi: simplify auth/assoc flow
With mac80211 now giving us station information
(via the sta_state callback) before auth/assoc
we can get rid of tx_sync by adding the station
early for the case of managed interfaces. Keep
AP mode actions the same for now.

As we now get the BSSID early, we can also get
rid of iwl_reprogram_ap_sta().

We can still optimise the number of RXONs we
send to the device, but that can be done later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:10 -05:00
Johannes Berg 5c40d8603d iwlwifi: make EXIT_PENDING depend on mac80211
There's no reason to set EXIT_PENDING when we
start removing the module, as mac80211 will
cleanly shut down the device in this case.
Additionally, there's no point in rejecting
commands to the device when we're cleaning up
as that only leads to unwanted errors from
mac80211 being printed, such as
  failed to remove key (...) from hardware (-16)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:10 -05:00
Johannes Berg 08ae86ac3f iwlwifi: remove shared lock
Some data doesn't need protection, some of the
lock places are simply useless, and some data
can be protected with the mutex instead. Thus
the shared lock can be removed by making those
changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:09 -05:00
Johannes Berg 4ff70fcdf3 iwlwifi: introduce statistics lock
The statistics are currently only half-heartedly
locked against concurrent reading & modification
so introduce a lock to really protect them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:09 -05:00
Johannes Berg fa23cb04b3 iwlwifi: make sta lock private & BH lock
Now that the transport has its own locking,
there's no need to have the sta_lock in the
shared data. Also, it can be a BH lock as
it's not used from IRQ handlers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:09 -05:00
Johannes Berg 015c15e106 iwlwifi: introduce per-queue locks
Instead of (ab)using the sta_lock, make the
transport layer lock its own TX queue data
structures with a lock per queue. This also
unifies with the cmd queue lock.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:08 -05:00
Johannes Berg 9451ca1a31 iwlwifi: build some station commands directly
In the powersave related functions we only need
to set a few parameters for the station command
and can otherwise leave it blank -- there's no
need to copy it from the database.

This allows us to not use the sta lock here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:08 -05:00
Johannes Berg 40e4e6868c iwlwifi: simplify code in iwlagn_key_sta_id
Simplify the code by returning directly in the
error case and replacing the switch/if with a
single if statement.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:08 -05:00
Johannes Berg 71cb99241d iwlwifi: reduce sta_lock hold time in TX
When we TX, we hold the sta_lock for a long
time, a lot of which isn't needed. Reduce
the time we hold the lock. Note that this
doesn't really change anything as the code
is already under the other spinlock, but it
makes the code easier to read.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:08 -05:00
Johannes Berg f2b69ef022 iwlwifi: remove an unused argument
The station ID argument to the function
iwlagn_tx_cmd_build_hwcrypto isn't used
so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:07 -05:00
Johannes Berg d316383dfd iwlwifi: move iwl_clear_driver_stations to user
There's only one place using this function, so
move it where it's needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:07 -05:00
Dan Carpenter e9a8e8ec1e airo: fix test for FLAG_RADIO_DOWN
We should be doing a shift (1 << FLAG_RADIO_DOWN) here before testing
the flag.  As luck would have it, this test works almost correctly.
The current code tests for FLAG_RADIO_OFF instead of FLAG_RADIO_DOWN.

#define FLAG_RADIO_OFF  0       /* User disabling of MAC */
#define FLAG_RADIO_DOWN 1       /* ifup/ifdown disabling of MAC */

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:07 -05:00
Johannes Berg 342bbf3fee iwlwifi: always monitor for stuck queues
If we only monitor while associated, the following
can happen:
 - we're associated, and the queue stuck check
   runs, setting the queue "touch" time to X
 - we disassociate, stopping the monitoring,
   which leaves the time set to X
 - almost 2s later, we associate, and enqueue
   a frame
 - before the frame is transmitted, we monitor
   for stuck queues, and find the time set to
   X, although it is now later than X + 2000ms,
   so we decide that the queue is stuck and
   erroneously restart the device

It happens more with P2P because there we can
go between associated/unassociated frequently.

Cc: stable@vger.kernel.org
Reported-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:07 -05:00
Christian Lamparter 26627687e8 p54pci: use new driver.pm interface for suspend/resume
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:06 -05:00
Christian Lamparter 972a31367f p54: pass interface setup errors back to mac80211
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:06 -05:00
Jingjun Wu a9b89e2567 rtlwifi: rtl8192ce: Fix loss of receive performance
Driver rtl8192ce when used with the RTL8188CE device would start at about
20 Mbps on a 54 Mbps connection, but quickly drop to 1 Mbps. One of the
symptoms is that the AP would need to retransmit each packet 4 of 5 times
before the driver would acknowledge it. Recovery is possible only by
unloading and reloading the driver. This problem was reported at
https://bugzilla.redhat.com/show_bug.cgi?id=770207.

The problem is due to a missing update of the gain setting.

Signed-off-by: Jingjun Wu <jingjun_wu@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06 15:16:06 -05:00