platform/kernel/linux-3.10.git
12 years agowlcore: change the wait for event mechanism
Yoni Divinsky [Wed, 27 Jun 2012 18:35:47 +0000 (21:35 +0300)]
wlcore: change the wait for event mechanism

wlcore needs to wait for certain events for example
for roc complete event. Usually the events are received
from the FW very fast, therefore wlcore can poll with
a short delay and if after a second the event was
not received yet poll with a long (1-5 msec) delay.

This implementation is similar to the sending of
commands to the FW.

Empirically the change reduced the wait for roc event
from ~10-40msec to 100s of usecs.

[replace udelay/msleep with usleep_range - Arik]

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agowlcore: Prevent processing of work items during op_stop
Ido Yariv [Tue, 26 Jun 2012 18:08:58 +0000 (21:08 +0300)]
wlcore: Prevent processing of work items during op_stop

The interrupt line is disabled in op_stop using disable_irq. Since
pending interrupts are synchronized, the mutex has to be released before
disabling the interrupt to avoid a deadlock with the interrupt handler.

In addition, the internal state of the driver is only set to 'off'
after the interrupt is disabled. Otherwise, if an interrupt fires after
the state is set but before the interrupt line is disabled, the
interrupt handler will not be able to acknowledge the interrupt
resulting in an interrupt storm.

The driver's operations might be called during recovery. If these
acquire the mutex after it was released by op_stop, but before the
driver's state is changed, they may queue new work items instead of just
failing. This is especially problematic in the case of scans, in which a
new scan may be scheduled after all scan requests were cancelled.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agowlcore: implement .flush callback
Eliad Peller [Mon, 25 Jun 2012 10:52:33 +0000 (13:52 +0300)]
wlcore: implement .flush callback

implement the .flush() callback by simply calling wl1271_tx_flush().

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx/wlcore: increase FW filename version
Luciano Coelho [Wed, 27 Jun 2012 12:21:10 +0000 (15:21 +0300)]
wl12xx/wlcore: increase FW filename version

We have some API changes and new features in the new firmwares that
are not compatible with older drivers.  Increase the version of the FW
filenames for wl12xx to 5.

Additionally, remove the duplicate definitions from wlcore_i.h and
remove the MODULE_FIRMWARE macro calls from the SDIO and SPI modules,
since they're irrelevant there.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: add probe request templates for sched and one-shot scans
Yoni Divinsky [Wed, 27 Jun 2012 10:01:44 +0000 (13:01 +0300)]
wlcore: add probe request templates for sched and one-shot scans

The driver configures the firmware template for probe requests during
the scan process.  If the same template is used for one-shot and sched
scans they will override each other when running scans simultaneously.

This fix works only on firmwares later than X.3.9.2.112 for single
role and X.3.9.2.23 for multi-role.

[Some cleaning-up and renaming of the quirk to something smaller --
Luca.]

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: always clear recovery flag during recovery_work
Arik Nemtsov [Mon, 25 Jun 2012 19:26:20 +0000 (22:26 +0300)]
wlcore: always clear recovery flag during recovery_work

If recovery is called when the FW is off, we should clear the recovery
flag. Otherwise we risk booting the driver in permanent pending-recovery
state.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: avoid debug prints during intended FW recovery
Arik Nemtsov [Mon, 25 Jun 2012 19:26:19 +0000 (22:26 +0300)]
wlcore: avoid debug prints during intended FW recovery

Don't read the FW panic log or print other debug data when recovery is
intended (i.e. FW type switch). This takes valuable time and can be
confusing to the user.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: remove recover cmd from testmode
Arik Nemtsov [Mon, 25 Jun 2012 19:26:18 +0000 (22:26 +0300)]
wlcore: remove recover cmd from testmode

This command is buggy (doesn't take the mutex) and unused. Instead, the
"start_recovery" file is used for the same purpose. Remove the code but
keep the command constant to avoid breaking the testmode ABI.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: don't stop tx queue via watermark if already stopped
Arik Nemtsov [Mon, 25 Jun 2012 19:26:17 +0000 (22:26 +0300)]
wlcore: don't stop tx queue via watermark if already stopped

If a Tx queue is currently stopped because of our Tx watermark flow
control, don't stop it again. This causes a warning to appear.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx/wl18xx: check min FW version
Arik Nemtsov [Mon, 25 Jun 2012 14:46:40 +0000 (17:46 +0300)]
wlcore/wl12xx/wl18xx: check min FW version

Refuse to boot if the FW version is too old. The minimum version is set
per chip, with the option of setting it per PG in the future.

When boot fails because of an old FW, display a helpful message.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: enable sched scan while connected
Victor Goldenshtein [Thu, 14 Jun 2012 06:47:40 +0000 (09:47 +0300)]
wlcore: enable sched scan while connected

New wl12xx firmware supports scheduled scans also while connected.
Stop blocking sched scan requests when connected and add a quirk to
block in hardware that don't support it (currently wl18xx doesn't).

This requires FW version 6/7.3.10.2.112 for single-role and
6/7.5.6.0.25 for multi-role.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agoNFC: Check for llcp_sock and its device from llcp_sock_getname
Samuel Ortiz [Thu, 5 Jul 2012 15:43:08 +0000 (17:43 +0200)]
NFC: Check for llcp_sock and its device from llcp_sock_getname

They both can potentially be NULL.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Add ISO 14443 type B protocol
Samuel Ortiz [Tue, 3 Jul 2012 22:14:04 +0000 (00:14 +0200)]
NFC: Add ISO 14443 type B protocol

Some devices (e.g. Sony's PaSoRi) can not do type B polling, so we have
to make a distinction between ISO14443 type A and B poll modes.

Cc: Eric Lapuyade <eric.lapuyade@intel.com>
Cc: Ilan Elias <ilane@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Use communicate thru only for PaSoRi when trying to read Felica tags
Samuel Ortiz [Tue, 3 Jul 2012 21:45:26 +0000 (23:45 +0200)]
NFC: Use communicate thru only for PaSoRi when trying to read Felica tags

Otherwise DATA_EXCHANGE seems to be just fine.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Add initial Sony RC-S360 support to pn533
Samuel Ortiz [Mon, 2 Jul 2012 18:04:01 +0000 (20:04 +0200)]
NFC: Add initial Sony RC-S360 support to pn533

Sony RC-S360 is also known as the Sony PaSoRi contactless reader.
Only type 2, 3 and 4 tag reading is supported at the moment.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Dereference LLCP bind socket address after checking for it to be NULL
Samuel Ortiz [Fri, 29 Jun 2012 10:03:55 +0000 (12:03 +0200)]
NFC: Dereference LLCP bind socket address after checking for it to be NULL

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Do not return EBUSY when stopping a poll that's already stopped
Samuel Ortiz [Thu, 28 Jun 2012 14:41:57 +0000 (16:41 +0200)]
NFC: Do not return EBUSY when stopping a poll that's already stopped

We check for the polling flag before checking if the netlink PID caller
match.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Remove warning from nfc_llcp_local_put
Samuel Ortiz [Wed, 27 Jun 2012 10:23:48 +0000 (12:23 +0200)]
NFC: Remove warning from nfc_llcp_local_put

The socket local pointer can be NULL when a socket is created but never
bound or connected.

Reported-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Handle LLCP Disconnected Mode frames
Samuel Ortiz [Tue, 26 Jun 2012 14:13:29 +0000 (16:13 +0200)]
NFC: Handle LLCP Disconnected Mode frames

When receiving such frame, the sockets waiting for a connection to finish
should be woken up. Connecting to an unbound LLCP service will trigger a
DM as a response.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: LLCP late binding
Samuel Ortiz [Mon, 25 Jun 2012 13:46:28 +0000 (15:46 +0200)]
NFC: LLCP late binding

With the LLCP 16 local SAPs we can potentially quickly run out of source
SAPs for non well known services.
With the so called late binding we will reserve an SAP only when we actually
get a client connection for a local service. The SAP will be released once
the last client is gone, leaving it available to other services.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Forbid SSAP binding to a not well known LLCP service
Samuel Ortiz [Fri, 22 Jun 2012 15:15:20 +0000 (17:15 +0200)]
NFC: Forbid SSAP binding to a not well known LLCP service

With not Well Known Services there is no guarantees as to which
SSAP the server will be listening on, so there is no reason to
support binding to a specific source SAP.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Forbid LLCP service name reusing
Samuel Ortiz [Fri, 22 Jun 2012 13:32:20 +0000 (15:32 +0200)]
NFC: Forbid LLCP service name reusing

This patch fixes a typo and return the correct error when trying to
bind 2 sockets to the same service name.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Release LLCP SAP when the owner is released
Samuel Ortiz [Fri, 22 Jun 2012 12:48:11 +0000 (14:48 +0200)]
NFC: Release LLCP SAP when the owner is released

The LLCP SAP should only be freed when the socket owning it is released.
As long as the socket is alive, the SAP should be reserved in order to
e.g. send the right wks array when bringing the MAC up.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Close listening LLCP sockets when the device is gone
Samuel Ortiz [Fri, 22 Jun 2012 12:40:34 +0000 (14:40 +0200)]
NFC: Close listening LLCP sockets when the device is gone

When the MAC link goes down, we should only keep the bound sockets
alive. They will be closed by sock_release or when the underlying
NFC device is moving away.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Build LLCP general bytes upon request
Samuel Ortiz [Fri, 22 Jun 2012 00:04:53 +0000 (02:04 +0200)]
NFC: Build LLCP general bytes upon request

Drivers will need them before starting a poll or when being activated
as targets. Mostly WKS can have changed between device registration and
then so we need to re-build the whole array.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Fix LLCP getname socket op
Samuel Ortiz [Thu, 21 Jun 2012 15:41:42 +0000 (17:41 +0200)]
NFC: Fix LLCP getname socket op

Set the right target index and use a better socket declaration routine.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Update LLCP socket target index when getting a connection
Samuel Ortiz [Mon, 18 Jun 2012 19:38:09 +0000 (21:38 +0200)]
NFC: Update LLCP socket target index when getting a connection

Getting a valid CONNECT means we have a valid target index.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Add netlink module alias for NFC
Samuel Ortiz [Tue, 12 Jun 2012 14:54:16 +0000 (16:54 +0200)]
NFC: Add netlink module alias for NFC

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Add modules alias for NFC sockets
Samuel Ortiz [Mon, 11 Jun 2012 22:35:50 +0000 (00:35 +0200)]
NFC: Add modules alias for NFC sockets

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Allow HCI driver to pre-open pipes to some gates
Eric Lapuyade [Tue, 5 Jun 2012 12:42:11 +0000 (14:42 +0200)]
NFC: Allow HCI driver to pre-open pipes to some gates

Some NFC chips will statically create and open pipes for both standard
and proprietary gates. The driver can now pass this information to HCI
such that HCI will not attempt to create and open them, but will instead
directly use the passed pipe ids.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: update PN544 HCI driver state when opened/closed
Eric Lapuyade [Wed, 30 May 2012 16:13:06 +0000 (18:13 +0200)]
NFC: update PN544 HCI driver state when opened/closed

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Error management documentation
Eric Lapuyade [Thu, 3 May 2012 09:49:30 +0000 (11:49 +0200)]
NFC: Error management documentation

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: nfc_driver_failure() implementation
Eric Lapuyade [Mon, 11 Jun 2012 13:52:38 +0000 (15:52 +0200)]
NFC: nfc_driver_failure() implementation

If the device is polling we sent a 0 target found event.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: nfc_targets_found() should accept zero target found
Eric Lapuyade [Thu, 3 May 2012 14:33:32 +0000 (16:33 +0200)]
NFC: nfc_targets_found() should accept zero target found

The semantics for a zero target found event is that the polling operation
could not complete.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Core must test the device polling state inside the device lock
Eric Lapuyade [Thu, 3 May 2012 14:21:58 +0000 (16:21 +0200)]
NFC: Core must test the device polling state inside the device lock

There can ever be only one call to nfc_targets_found() after polling
has been engaged. This could be from a target discovered event from
the driver, or from an error handler to notify poll will never complete.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Implement HCI driver or internal error management
Eric Lapuyade [Mon, 11 Jun 2012 13:06:56 +0000 (15:06 +0200)]
NFC: Implement HCI driver or internal error management

If there is an ongoing HCI command executing, it will be completed,
thereby pushing the error up to the core. Otherwise, HCI will directly
notify the core with the error.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Factorize HCI cmd completion
Eric Lapuyade [Thu, 3 May 2012 13:59:37 +0000 (15:59 +0200)]
NFC: Factorize HCI cmd completion

HCI cmd can be completed either from an HCI response or from an
internal driver or HCI error. This requires to factorize the
completion code outside of the device lock.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Driver failure API
Eric Lapuyade [Mon, 11 Jun 2012 11:49:51 +0000 (13:49 +0200)]
NFC: Driver failure API

This API should be used by drivers, HCI, SHDLC or NCI stacks to report an
unrecoverable error.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Changed HCI cmd execution completion result to std linux errno
Eric Lapuyade [Thu, 3 May 2012 13:35:25 +0000 (15:35 +0200)]
NFC: Changed HCI cmd execution completion result to std linux errno

An HCI command can complete either from an HCI response
(with an HCI result) or as a consequence of any other system
error during processing. The completion therefore needs to take
a standard errno code. The HCI response will convert its result
to a standard errno before calling the completion.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Implement HCP reaggregation allocation error case
Eric Lapuyade [Mon, 11 Jun 2012 11:36:52 +0000 (13:36 +0200)]
NFC: Implement HCP reaggregation allocation error case

We can now report an ENOMEM error up to the HCI layer.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Remove an impossible HCI error case
Eric Lapuyade [Wed, 2 May 2012 09:37:19 +0000 (11:37 +0200)]
NFC: Remove an impossible HCI error case

nfc_hci_recv_frame can not be called with a NULL skb.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Handle SHDLC RSET frames from an SHDLC connected chip
Eric Lapuyade [Wed, 2 May 2012 09:23:11 +0000 (11:23 +0200)]
NFC: Handle SHDLC RSET frames from an SHDLC connected chip

shdlc reset may leave HCI in an inconsistent state by loosing parts of
HCI frames. Handle this case by reporting an unrecoverable error to HCI.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Removed addressed shdlc TODOs
Eric Lapuyade [Thu, 3 May 2012 12:53:20 +0000 (14:53 +0200)]
NFC: Removed addressed shdlc TODOs

The questions asked in the comments have been answered and addressed.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Prepare asynchronous error management for driver and shdlc
Eric Lapuyade [Mon, 30 Apr 2012 16:21:51 +0000 (18:21 +0200)]
NFC: Prepare asynchronous error management for driver and shdlc

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoath9k: Stop the BTCOEX timers before disabling BTCOEX
Mohammed Shafi Shajakhan [Fri, 6 Jul 2012 14:39:32 +0000 (20:09 +0530)]
ath9k: Stop the BTCOEX timers before disabling BTCOEX

Its safe to stop the BTCOEX timers 'period_timer' and
'no_stomp_timer' before disabling BTCOEX. These timers
can call ath9k_hw_btcoex_enable (or) change the BT
stomp type if they seem to be running after we had
called ath9k_hw_btcoex_disable, which is obviously
not correct.

Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Fix MCI cleanup
Mohammed Shafi Shajakhan [Fri, 6 Jul 2012 14:39:16 +0000 (20:09 +0530)]
ath9k: Fix MCI cleanup

We are doing MCI cleanup eventhough BTCOEX is not enabled
via module parameter. This means we do ath_mci_cleanup
though we skipped calling ath_mci_setup. Yet it does not
causes any issues now  as we free the DMA buffer allocated
only when it is allocated during ath_mci_setup.

Reviewed-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: use custom printing functions
Rafał Miłecki [Thu, 5 Jul 2012 20:07:32 +0000 (22:07 +0200)]
bcma: use custom printing functions

Having bus number printed makes it much easier to anaylze logs on
systems with more buses. For example Netgear WNDR4500 has 3 AMBA buses
in total, which makes standard log really messy.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43: N-PHY: fix RSSI calibration
Rafał Miłecki [Thu, 5 Jul 2012 19:55:46 +0000 (21:55 +0200)]
b43: N-PHY: fix RSSI calibration

Specs were updated, change code to match it.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: fix brcms_c_regd_init() which crashed after 11ad patch
Arend van Spriel [Tue, 3 Jul 2012 18:46:02 +0000 (20:46 +0200)]
brcmsmac: fix brcms_c_regd_init() which crashed after 11ad patch

This patch fixes an OOPS in brcmsmac driver, which was introduced
by the 11ad patch 'cfg80211: add 802.11ad (60gHz band) support'.
The value IEEE80211_NUM_BANDS increased, which was used in the
brcms_c_regd_init() function.

Cc: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Cc: Johannes Berg <johannes.berg@intel.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: enable support for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:34 +0000 (19:13 +0200)]
ath9k: enable support for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: set 4ADDRESS bit in RX filter for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:33 +0000 (19:13 +0200)]
ath9k: set 4ADDRESS bit in RX filter for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: enable PLL workaround for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:32 +0000 (19:13 +0200)]
ath9k: enable PLL workaround for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: fix PLL initialization for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:31 +0000 (19:13 +0200)]
ath9k: fix PLL initialization for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: skip internal regulator configuration for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:30 +0000 (19:13 +0200)]
ath9k: skip internal regulator configuration for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: disable SYNC_HOST1_FATAL interrupts for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:29 +0000 (19:13 +0200)]
ath9k: disable SYNC_HOST1_FATAL interrupts for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: fix RF channel frequency configuration for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:28 +0000 (19:13 +0200)]
ath9k: fix RF channel frequency configuration for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: fix PAPRD settings for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:27 +0000 (19:13 +0200)]
ath9k: fix PAPRD settings for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: fix antenna control configuration for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:26 +0000 (19:13 +0200)]
ath9k: fix antenna control configuration for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: fix XPABIASLEVEL settings for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:25 +0000 (19:13 +0200)]
ath9k: fix XPABIASLEVEL settings for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: read spur frequency information from eeprom for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:24 +0000 (19:13 +0200)]
ath9k: read spur frequency information from eeprom for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: add mode register initialization code for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:23 +0000 (19:13 +0200)]
ath9k: add mode register initialization code for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: add initvals for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:22 +0000 (19:13 +0200)]
ath9k: add initvals for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: enable TX/RX data byte swap for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:21 +0000 (19:13 +0200)]
ath9k: enable TX/RX data byte swap for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: clear pciexpress flag for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:20 +0000 (19:13 +0200)]
ath9k: clear pciexpress flag for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: add BB name string for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:19 +0000 (19:13 +0200)]
ath9k: add BB name string for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: add platform_device_id for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:18 +0000 (19:13 +0200)]
ath9k: add platform_device_id for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: set MAC version for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:17 +0000 (19:13 +0200)]
ath9k: set MAC version for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: define MAC version for AR9550
Gabor Juhos [Tue, 3 Jul 2012 17:13:16 +0000 (19:13 +0200)]
ath9k: define MAC version for AR9550

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: define DEVID for QCA955x
Gabor Juhos [Tue, 3 Jul 2012 17:13:15 +0000 (19:13 +0200)]
ath9k: define DEVID for QCA955x

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonet/wireless: remove macro defined twice with same value
Oskar Schirmer [Tue, 3 Jul 2012 09:31:48 +0000 (09:31 +0000)]
net/wireless: remove macro defined twice with same value

In the list of commands CMD_802_11_EEPROM_ACCESS had been
defined twice, unnecessarily, luckily with same value.

Remove one occurence.

Signed-off-by: Oskar Schirmer <oskar@scara.com>
Cc: Marcelo Tosatti <marcelo@kvack.org>
Cc: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: add set_antenna handler support
Amitkumar Karwar [Tue, 3 Jul 2012 02:32:33 +0000 (19:32 -0700)]
mwifiex: add set_antenna handler support

This enables user to set mode of Tx/Rx path using "iw set antenna"
command. For non MIMO chips, the command will be used for selecting
specific antenna or configuring antenna diversity mode.

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>
12 years agoath9k_hw: fix AR9462 2g5g switch on full reset
Rajkumar Manoharan [Sun, 1 Jul 2012 14:23:55 +0000 (19:53 +0530)]
ath9k_hw: fix AR9462 2g5g switch on full reset

On full reset, mci reset will put LNA update on 2G mode. And
Whenever 2g5g_switch is forced at the end of full reset, lna
update should not be skipped. Not doing so, is affecting WLAN
rx and causing beacon loss when BTCOEX is enabled on AR9462.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: fix power consumption on network sleep when BTCOEX is enabled
Rajkumar Manoharan [Sun, 1 Jul 2012 14:23:54 +0000 (19:53 +0530)]
ath9k: fix power consumption on network sleep when BTCOEX is enabled

The chip is waken up for every 45ms in btcoex timer cycle to
for sharing the radio between BT and WLAN. Whenever the wlan
interface is in network sleep mode, do not schedule hw timers.
This could reduce power consumption on idle associated state.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: fix fullsleep power consumption when BTCOEX is enabled
Rajkumar Manoharan [Sun, 1 Jul 2012 14:23:53 +0000 (19:53 +0530)]
ath9k: fix fullsleep power consumption when BTCOEX is enabled

As soon as the interface brought up, btcoex timer starts running
eventhough the interface is in idle state and WLAN chip is moved
to full sleep mode. There is no point in running btcoex timer when
the wlan interface is in sleep mode and also it might consumes
more power on WLAN idle unassociated state. So lets stop the
btcoex when wlan is idle state.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: do not load noise floor readings when it is running
Rajkumar Manoharan [Sun, 1 Jul 2012 14:23:52 +0000 (19:53 +0530)]
ath9k_hw: do not load noise floor readings when it is running

Noise floor calibration is performed on longcal interval and
the reading will be updated in history buffer. On rare occasions,
the previous noisefloor calibration might not be completed within
the period and trying to load nf reading will be failed. In such
situation, postpone the nf cabliration to next cycle to give
enough time to complete the calibration. This was already taken
care for ar9002 chips.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: start noisefloor calibration after MCI reset
Rajkumar Manoharan [Sun, 1 Jul 2012 14:23:51 +0000 (19:53 +0530)]
ath9k_hw: start noisefloor calibration after MCI reset

noisefloor calibration has to be loaded and started after
chip reset completion and restoring chainmask. Right now it is
being started before MCI reset completion on full reset. Fix that.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: add mdelay bcma_pmu_resources_init()
Hauke Mehrtens [Fri, 29 Jun 2012 23:44:45 +0000 (01:44 +0200)]
bcma: add mdelay bcma_pmu_resources_init()

This is based on code from brcmsmac.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: add bcma_pmu_spuravoid_pllupdate()
Hauke Mehrtens [Fri, 29 Jun 2012 23:44:44 +0000 (01:44 +0200)]
bcma: add bcma_pmu_spuravoid_pllupdate()

This function is needed by brcmsmac. This code is based on code from
the Broadcom SDK.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: remove chip ids doing nothing from PMU initialization.
Hauke Mehrtens [Fri, 29 Jun 2012 23:44:43 +0000 (01:44 +0200)]
bcma: remove chip ids doing nothing from PMU initialization.

The list of devices where nothing has to be done in
bcma_pmu_resources_init() and bcma_pmu_workarounds() is longer as all
the SoCs are missing there and some new devices will be added in some
time later. This patch changes the default case to just log on debug
level and also let the other devices which do not need any special
handling into the default case, instead of adding the missing 8 SoC
chip ids.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: remove bcma_pmu_{pll,swreg}_init()
Hauke Mehrtens [Fri, 29 Jun 2012 23:44:42 +0000 (01:44 +0200)]
bcma: remove bcma_pmu_{pll,swreg}_init()

These functions are doing nothing in the current code.

I do not think we will need these function in the future as the
corresponding functions in the Broadcom SDK are just doing something
useful on chips supported by ssb or fullmac chips.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: complete workaround for BCMA43224 and BCM4313
Hauke Mehrtens [Fri, 29 Jun 2012 23:44:41 +0000 (01:44 +0200)]
bcma: complete workaround for BCMA43224 and BCM4313

This code is based on the Broadcom SDK and brcmsmac.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: add PCI ID for BCM43224
Hauke Mehrtens [Fri, 29 Jun 2012 23:44:40 +0000 (01:44 +0200)]
bcma: add PCI ID for BCM43224

This ID was found on the PCIe wireless card on the board of a Netgear
WNDR3400 using a bcm4716. The device with this ID is identified by b43
as "Broadcom 43224 WLAN".

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: remove fix for 4329b0 bad LPOM is detection
Hauke Mehrtens [Fri, 29 Jun 2012 23:44:39 +0000 (01:44 +0200)]
bcma: remove fix for 4329b0 bad LPOM is detection

There is not core id with 0x4329, but at the same place in the open
source part of the Broadcom SDK is a check for some device with the
chip id of 0x4329. The device with a chip id of 0x4329 is a full mac
device, so it will never be supported by bcma, this part is running in
the firmware of the device and not on the host CPU.
This code is wrong and will never be used, so just remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: add constants for chip ids
Hauke Mehrtens [Fri, 29 Jun 2012 23:44:38 +0000 (01:44 +0200)]
bcma: add constants for chip ids

The chip IDs are used all over bcma and no constants where defined.
This patch adds the constants and makes bcma use them.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: extend workaround for bcm4331
Hauke Mehrtens [Fri, 29 Jun 2012 23:44:37 +0000 (01:44 +0200)]
bcma: extend workaround for bcm4331

This patch is based on a recent version of the Broadcom SDK.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: fixing register bit shift values of control packets to support TPC
Thomas Huehn [Fri, 29 Jun 2012 14:43:10 +0000 (10:43 -0400)]
ath9k: fixing register bit shift values of control packets to support TPC

Some register values of bit shifts are corrected in order to support the upcoming
transmission power control (tpc) for control packets as well.

Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Fix clearing of BTCOEX flags
Mohammed Shafi Shajakhan [Fri, 29 Jun 2012 05:04:39 +0000 (10:34 +0530)]
ath9k: Fix clearing of BTCOEX flags

BTCOEX flags are set/cleared by atomic operations.
We got to do the same in ath9k_btcoex_timer_resume,
while clearing those BTCOEX flags.

Acked-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: parse WPS IEs from beacon_data
Avinash Patil [Fri, 29 Jun 2012 03:30:30 +0000 (20:30 -0700)]
mwifiex: parse WPS IEs from beacon_data

Parse WPS IEs from start_ap as well as change_beacon handlers
and set them to FW. Beacon IEs, Probe Response IEs and Assoc
Response IEs are parsed from beacon_data and set to FW with
related masks.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: advertise WPS probe response offload support to cfg80211
Avinash Patil [Fri, 29 Jun 2012 03:30:29 +0000 (20:30 -0700)]
mwifiex: advertise WPS probe response offload support to cfg80211

Being a fullmac driver, mwifiex takes care of populating
beacon, probe response, association response WPS IEs to firmware.
And firmware is responsible for constructing these frames.
Advertise this to cfg80211.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: add change_beacon cfg80211 handler
Avinash Patil [Fri, 29 Jun 2012 03:30:28 +0000 (20:30 -0700)]
mwifiex: add change_beacon cfg80211 handler

This patch adds support for change_beacon handler which is needed
for setting modified management IEs to driver and FW.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: overwrite earlier IE buffers for new set IE request
Avinash Patil [Fri, 29 Jun 2012 03:30:27 +0000 (20:30 -0700)]
mwifiex: overwrite earlier IE buffers for new set IE request

All IE buffers are freshly supplied. In such case, there is no need
to preserve earlier buffers with same management mask and index.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: separate IE parsing for Head/Tail IEs and beacon_ies etc
Avinash Patil [Fri, 29 Jun 2012 03:30:26 +0000 (20:30 -0700)]
mwifiex: separate IE parsing for Head/Tail IEs and beacon_ies etc

While Head/Tail IEs may contain RSN/WPA IEs which needs to be set
for all mgmt subtypes, beacon_ies, probe_resp_ies, assoc_resp_ies
are for specific mgmt subtypes. Move them to separate function.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: pass cfg80211_beacon_data to mwifiex_set_mgmt_ie()
Avinash Patil [Fri, 29 Jun 2012 03:30:25 +0000 (20:30 -0700)]
mwifiex: pass cfg80211_beacon_data to mwifiex_set_mgmt_ie()

Pass cfg80211_beacon_data pointer instead of cfg80211_ap_settings.
While setting management IEs we only need cfg80211_beacon_data of
cfg80211_ap_settings which has Tail IE, Head IE and other IE elements.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Mon, 9 Jul 2012 20:35:18 +0000 (16:35 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

12 years agoMerge branch 'for-john' of git://git.sipsolutions.net/mac80211-next
John W. Linville [Mon, 9 Jul 2012 20:34:39 +0000 (16:34 -0400)]
Merge branch 'for-john' of git://git.sipsolutions.net/mac80211-next

12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Mon, 9 Jul 2012 20:34:34 +0000 (16:34 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless

Conflicts:
net/mac80211/mlme.c

12 years agoiwlegacy: don't mess up the SCD when removing a key
Emmanuel Grumbach [Wed, 4 Jul 2012 11:59:08 +0000 (13:59 +0200)]
iwlegacy: don't mess up the SCD when removing a key

When we remove a key, we put a key index which was supposed
to tell the fw that we are actually removing the key. But
instead the fw took that index as a valid index and messed
up the SRAM of the device.

This memory corruption on the device mangled the data of
the SCD. The impact on the user is that SCD queue 2 got
stuck after having removed keys.

Reported-by: Paul Bolle <pebolle@tiscali.nl>
Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlegacy: always monitor for stuck queues
Stanislaw Gruszka [Wed, 4 Jul 2012 11:20:20 +0000 (13:20 +0200)]
iwlegacy: always monitor for stuck queues

This is iwlegacy version of:

commit 342bbf3fee2fa9a18147e74b2e3c4229a4564912
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sun Mar 4 08:50:46 2012 -0800

    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

Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2x00usb: fix indexes ordering on RX queue kick
Stanislaw Gruszka [Wed, 4 Jul 2012 11:10:02 +0000 (13:10 +0200)]
rt2x00usb: fix indexes ordering on RX queue kick

On rt2x00_dmastart() we increase index specified by Q_INDEX and on
rt2x00_dmadone() we increase index specified by Q_INDEX_DONE. So entries
between Q_INDEX_DONE and Q_INDEX are those we currently process in the
hardware. Entries between Q_INDEX and Q_INDEX_DONE are those we can
submit to the hardware.

According to that fix rt2x00usb_kick_queue(), as we need to submit RX
entries that are not processed by the hardware. It worked before only
for empty queue, otherwise was broken.

Note that for TX queues indexes ordering are ok. We need to kick entries
that have filled skb, but was not submitted to the hardware, i.e.
started from Q_INDEX_DONE and have ENTRY_DATA_PENDING bit set.

From practical standpoint this fixes RX queue stall, usually reproducible
in AP mode, like for example reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=828824

Reported-and-tested-by: Franco Miceli <fmiceli@plan.ceibal.edu.uy>
Reported-and-tested-by: Tom Horsley <horsley1953@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix Coverity SCAN CID 709078: Resource leak (RESOURCE_LEAK)
Bing Zhao [Tue, 3 Jul 2012 22:53:13 +0000 (15:53 -0700)]
mwifiex: fix Coverity SCAN CID 709078: Resource leak (RESOURCE_LEAK)

> *. CID 709078: Resource leak (RESOURCE_LEAK)
>  - drivers/net/wireless/mwifiex/cfg80211.c, line: 935
> Assigning: "bss_cfg" = storage returned from "kzalloc(132UL, 208U)"
>  - but was not free
> drivers/net/wireless/mwifiex/cfg80211.c:935

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>