]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
11 years agoath9k: Fix ANI for AP mode
Sujith Manoharan [Mon, 17 Jun 2013 08:54:36 +0000 (14:24 +0530)]
ath9k: Fix ANI for AP mode

The commit "ath9k: Fix ANI monitoring" reverted an earlier
commit that adjusted ANI to improve performance. But, this causes
adverse effects in AP mode (as reported by Felix based on an OpenWrt
report). Use the older INI/period configuration for now until more
testing is done.

Cc: Felix Fietkau <nbd@openwrt.org>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix LNA gpio for AR9485
Sujith Manoharan [Mon, 17 Jun 2013 01:31:47 +0000 (07:01 +0530)]
ath9k: Fix LNA gpio for AR9485

The commit "ath9k: Add custom parameters for CUS198" didn't
pass the correct gpio value to ath9k_hw_cfg_output(). Fix it.

Reported-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: fix memory corruption when unsetting multicast list
Daniel Drake [Fri, 14 Jun 2013 19:24:24 +0000 (15:24 -0400)]
mwifiex: fix memory corruption when unsetting multicast list

When trying to unset a previously-set multicast list (i.e. the new list
has 0 entries), mwifiex_set_multicast_list() was calling down to
mwifiex_request_set_multicast_list() while leaving
mcast_list.num_multicast_addr as an uninitialized value.

We were arriving at mwifiex_cmd_mac_multicast_adr() which would then
proceed to do an often huge memcpy of
mcast_list.num_multicast_addr*ETH_ALEN bytes, causing memory corruption
and hard to debug crashes.

Fix this by setting mcast_list.num_multicast_addr to 0 when no multicast
list is provided. Similarly, fix up the logic in
mwifiex_request_set_multicast_list() to unset the multicast list that
was previously sent to the hardware in such cases.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Add module parameter for regdomain
Avinash Patil [Mon, 10 Jun 2013 22:40:07 +0000 (15:40 -0700)]
mwifiex: Add module parameter for regdomain

Allow a regulatory domain country code to be specified at boot
using a module argument.  This overrides the firmware regulatory
mode.

This patch also enables uAP to operate in 11a mode with hostapd.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoorinoco_usb: fix memory leak in ezusb_access_ltv() when device disconnected
Alexey Khoroshilov [Thu, 13 Jun 2013 20:26:11 +0000 (00:26 +0400)]
orinoco_usb: fix memory leak in ezusb_access_ltv() when device disconnected

If "device is disconnected" check occurs to be true in ezusb_access_ltv(),
it just return -ENODEV. But that means request_context is leaked since
there are no any references to it anymore.
The patch adds a call to ezusb_request_context_put() before return.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Add custom parameters for CUS198
Sujith Manoharan [Thu, 13 Jun 2013 17:21:26 +0000 (22:51 +0530)]
ath9k: Add custom parameters for CUS198

CUS198 is a card based on AR9485. There are differences
between the base reference design HB125 and CUS198.
Identify such cards based on the PCI subsystem IDs and
set HW parameters appropriately.

Addresses this bug - https://bugzilla.kernel.org/show_bug.cgi?id=49201

Cc: jkp@iki.fi
Cc: gfmichaud@gmail.com
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge tag 'nfc-next-3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Fri, 14 Jun 2013 17:34:39 +0000 (13:34 -0400)]
Merge tag 'nfc-next-3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next

Samuel Ortiz <sameo@linux.intel.com> says:

"These are the pending NFC patches for the 3.11 merge window.

It contains the pending fixes that were on nfc-fixes (nfc-fixes-3.10-2),
along with a few more for the pn544 and pn533 drivers, the LLCP
disconnection path and an LLCP memory leak.

Highlights for this one are:

- An initial secure element API. NFC chipsets can carry an embedded
  secure element or get access to the SIM one. In both cases they
  control the secure elements and this API provides a way to discover,
  enable and disable the available SEs. It also exports that to
  userspace in order for SE focused middleware to actually do something
  with them (e.g. payments).

- NCI over SPI support. SPI is the most complex NCI specified transport
  layer and we now have support for it in the kernel. The next step will
  be to implement drivers for NCI chipsets using this transport like
  e.g. bcm2079x.

- NFC p2p hardware simulation driver. We now have an nfcsim driver that
  is mostly a loopback device between 2 NFC interfaces. It also
  implements the rest of the NFC core API like polling and target
  detection. This driver, with neard running on top of it, allows us to
  completely test the LLCP, SNEP and Handover implementation without
  physical hardware.

- A Firmware update netlink API. Most (All ?) HCI chipsets have a
  special firmware update mode where applications can push a new
  firmware that will be flashed. We now have a netlink API for providing
  that mode to e.g. nfctool."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Fri, 14 Jun 2013 17:18:24 +0000 (13:18 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

11 years agoNFC: mei_phy: Clean up file
Valentin Ilie [Fri, 7 Jun 2013 19:01:55 +0000 (22:01 +0300)]
NFC: mei_phy: Clean up file

Fix checkpatch warnings.
Replace __attribute__((__packed__)) with __packed.
Replace spaces with tabs.

Signed-off-by: Valentin Ilie <valentin.ilie@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: llcp: Fix the well known services endianness
Samuel Ortiz [Mon, 3 Jun 2013 10:10:04 +0000 (12:10 +0200)]
NFC: llcp: Fix the well known services endianness

The WKS (Well Known Services) bitmask should be transmitted in big endian
order. Picky implementations will refuse to establish an LLCP link when the
WKS bit 0 is not set to 1. The vast majority of implementations out there
are not that picky though...

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: llcp: Set the LLC Link Management well known service bit
Samuel Ortiz [Tue, 28 May 2013 13:41:32 +0000 (15:41 +0200)]
NFC: llcp: Set the LLC Link Management well known service bit

In order to advertise our LLCP support properly and to follow the LLCP
specs requirements, we need to initialize the WKS (Well-Known Services)
bitfield to 1 as SAP 0 is the only mandatory supported service.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: llcp: Do not send pending Tx frames when the remote is not ready
Samuel Ortiz [Tue, 28 May 2013 13:03:17 +0000 (15:03 +0200)]
NFC: llcp: Do not send pending Tx frames when the remote is not ready

When we receive a RNR, the remote is busy processing the last received
frame. We set a local flag for that, and we should send a SYMM when it
is set instead of sending any pending frame.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: llcp: Fix non blocking sockets connections
Samuel Ortiz [Fri, 3 May 2013 16:29:30 +0000 (18:29 +0200)]
NFC: llcp: Fix non blocking sockets connections

Without the new LLCP_CONNECTING state, non blocking sockets will be
woken up with a POLLHUP right after calling connect() because their
state is stuck at LLCP_CLOSED.
That prevents userspace from implementing any proper non blocking
socket based NFC p2p client.

Cc: stable@vger.kernel.org
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add a nfc hardware simulation driver
Thierry Escande [Thu, 6 Jun 2013 14:23:23 +0000 (16:23 +0200)]
NFC: Add a nfc hardware simulation driver

This driver declares two virtual NFC devices supporting NFC-DEP protocol.
An LLCP connection can be established between them and all packets sent
from one device is sent back to the other, acting as loopback devices.

Once established, the LLCP link can be disconnected by disabling the target
device (with rfkill, nfctool, or neard disable-adapter test script).

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Fix a potential memory leak
Thierry Escande [Wed, 5 Jun 2013 15:15:59 +0000 (17:15 +0200)]
NFC: Fix a potential memory leak

In nfc_llcp_tx_work() the sk_buff is not freed when the llcp_sock
is null and the PDU is an I one.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Keep socket alive until the DISC PDU is actually sent
Thierry Escande [Tue, 4 Jun 2013 09:34:51 +0000 (11:34 +0200)]
NFC: Keep socket alive until the DISC PDU is actually sent

This patch keeps the socket alive and therefore does not remove
it from the sockets list in the local until the DISC PDU has been
actually sent. Otherwise we would reply with DM PDUs before sending
the DISC one.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Rename nfc_llcp_disconnect() to nfc_llcp_send_disconnect()
Thierry Escande [Tue, 4 Jun 2013 09:34:50 +0000 (11:34 +0200)]
NFC: Rename nfc_llcp_disconnect() to nfc_llcp_send_disconnect()

nfc_llcp_send_disconnect() already exists but is not used.
nfc_llcp_disconnect() naming is not consistent with other PDU
sending functions.
This patch removes nfc_llcp_send_disconnect() and renames
nfc_llcp_disconnect()

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn533: Fix ACR122 related debug output
Olivier Guiter [Mon, 3 Jun 2013 10:02:29 +0000 (12:02 +0200)]
NFC: pn533: Fix ACR122 related debug output

Instead of dumping ACR122 frames as errors, we use the print_hex_dump()
dynamic debug APIs.
We also print an accurate IC version, as the ACR122 is pn532 based.

Signed-off-by: Olivier Guiter <olivier.guiter@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add secure element enablement netlink API
Samuel Ortiz [Fri, 10 May 2013 15:07:32 +0000 (17:07 +0200)]
NFC: Add secure element enablement netlink API

Enabling or disabling an NFC accessible secure element through netlink
requires giving both an NFC controller and a secure element indexes.
Once enabled the secure element will handle card emulation once polling
starts.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add secure element enablement internal API
Samuel Ortiz [Fri, 10 May 2013 14:15:32 +0000 (16:15 +0200)]
NFC: Add secure element enablement internal API

Called via netlink, this API will enable or disable a specific secure
element. When a secure element is enabled, it will handle card emulation
and more generically ISO-DEP target mode, i.e. all target mode cases
except for p2p target mode.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove and free all SEs when releasing an NFC device
Samuel Ortiz [Fri, 10 May 2013 13:53:29 +0000 (15:53 +0200)]
NFC: Remove and free all SEs when releasing an NFC device

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Send netlink events for secure elements additions and removals
Samuel Ortiz [Fri, 10 May 2013 13:47:37 +0000 (15:47 +0200)]
NFC: Send netlink events for secure elements additions and removals

When an NFC driver or host controller stack discovers a secure element,
it will call nfc_add_se(). In order for userspace applications to use
these secure elements, a netlink event will then be sent with the SE
index and its type. With that information userspace applications can
decide wether or not to enable SEs, through their indexes.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add secure elements addition and removal API
Samuel Ortiz [Fri, 10 May 2013 13:28:38 +0000 (15:28 +0200)]
NFC: Add secure elements addition and removal API

This API will allow NFC drivers to add and remove the secure elements
they know about or detect. Typically this should be called (asynchronously
or not) from the driver or the host interface stack detect_se hook.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Extend and fix the internal secure element API
Samuel Ortiz [Fri, 10 May 2013 09:57:06 +0000 (11:57 +0200)]
NFC: Extend and fix the internal secure element API

Secure elements need to be discovered after enabling the NFC controller.
This is typically done by the NCI core and the HCI drivers (HCI does not
specify how to discover SEs, it is left to the specific drivers).
Also, the SE enable/disable API explicitely takes a SE index as its
argument.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove the static supported_se field
Samuel Ortiz [Tue, 7 May 2013 17:22:11 +0000 (19:22 +0200)]
NFC: Remove the static supported_se field

Supported secure elements are typically found during a discovery process
initiated when the NFC controller is up and running. For a given NFC
chipset there can be many configurations (embedded SE or not, with or
without a SIM card wired to the NFC controller SWP interface, etc...) and
thus driver code will never know before hand which SEs are available.
So we remove this field, it will be replaced by a real SE discovery
mechanism.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn533: Copy NFCID2 through ATR_REQ
Samuel Ortiz [Mon, 27 May 2013 13:29:11 +0000 (15:29 +0200)]
NFC: pn533: Copy NFCID2 through ATR_REQ

When using NFC-F we should copy the NFCID2 buffer that we got from
SENSF_RES through the ATR_REQ NFCID3 buffer. Not doing so violates
NFC Forum digital requirement #189.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn533: Use 0x3 for SENSF_REQ Time Slot Number (TSN)
Samuel Ortiz [Mon, 27 May 2013 12:59:40 +0000 (14:59 +0200)]
NFC: pn533: Use 0x3 for SENSF_REQ Time Slot Number (TSN)

LLCP validation requires TSN to be 0x03 for type F.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add NCI over SPI receive
Frederic Danis [Wed, 29 May 2013 13:35:04 +0000 (15:35 +0200)]
NFC: Add NCI over SPI receive

Before any operation, driver interruption is de-asserted to prevent
race condition between TX and RX.

Transaction starts by emitting "Direct read" and acknowledged mode
bytes. Then packet length is read allowing to allocate correct NCI
socket buffer. After that payload is retrieved.

A delay after the transaction can be added.
This delay is determined by the driver during nci_spi_allocate_device()
call and can be 0.

If acknowledged mode is set:
- CRC of header and payload is checked
- if frame reception fails (CRC error): NACK is sent
- if received frame has ACK or NACK flag: unblock nci_spi_send()

Payload is passed to NCI module.

At the end, driver interruption is re asserted.

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add NCI over SPI send
Frederic Danis [Wed, 29 May 2013 13:35:03 +0000 (15:35 +0200)]
NFC: Add NCI over SPI send

Before any operation, driver interruption is de-asserted to prevent
race condition between TX and RX.

The NCI over SPI header is added in front of NCI packet.
If acknowledged mode is set, CRC-16-CCITT is added to the packet.
Then the packet is forwarded to SPI module to be sent.

A delay after the transaction is added.
This delay is determined by the driver during nci_spi_allocate_device()
call and can be 0.

After data has been sent, driver interruption is re-asserted.

If acknowledged mode is set, nci_spi_send will block until
acknowledgment is received.

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add basic NCI over SPI
Frederic Danis [Wed, 29 May 2013 13:35:02 +0000 (15:35 +0200)]
NFC: Add basic NCI over SPI

The NFC Forum defines a transport interface based on
Serial Peripheral Interface (SPI) for the NFC Controller
Interface (NCI).

This module implements the SPI transport of NCI, calling SPI module
directly to read/write data to NFC controller (NFCC).

NFCC driver should provide functions performing device open and close.
It should also provide functions asserting/de-asserting interruption
to prevent TX/RX race conditions.
NFCC driver can also fix a delay between transactions if needed by
the hardware.

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: HCI: Follow a positive code path in the HCI ops implementations
Samuel Ortiz [Fri, 24 May 2013 23:21:21 +0000 (01:21 +0200)]
NFC: HCI: Follow a positive code path in the HCI ops implementations

Exiting on the error case is more typical to the kernel coding style.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: HCI: Implement fw_upload ops
Eric Lapuyade [Mon, 29 Apr 2013 15:47:42 +0000 (17:47 +0200)]
NFC: HCI: Implement fw_upload ops

This is a simple forward to the HCI driver. When driver is done with the
operation, it shall directly notify NFC Core by calling
nfc_fw_upload_done().

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Add firmware upload netlink command
Eric Lapuyade [Mon, 29 Apr 2013 15:13:27 +0000 (17:13 +0200)]
NFC: Add firmware upload netlink command

As several NFC chipsets can have their firmwares upgraded and
reflashed, this patchset adds a new netlink command to trigger
that the driver loads or flashes a new firmware. This will allows
userspace triggered firmware upgrade through netlink.
The firmware name or hint is passed as a parameter, and the driver
will eventually fetch the firmware binary through the request_firmware
API.
The cmd can only be executed when the nfc dev is not in use. Actual
firmware loading/flashing is an asynchronous operation. Result of the
operation shall send a new event up to user space through the nfc dev
multicast socket. During operation, the nfc dev is not openable and
thus not usable.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: NCI: Fix skb->dev usage
Frederic Danis [Wed, 22 May 2013 09:36:17 +0000 (11:36 +0200)]
NFC: NCI: Fix skb->dev usage

skb->dev is used for carrying a net_device pointer and not
an nci_dev pointer.

Remove usage of skb-dev to carry nci_dev and replace it by parameter
in nci_recv_frame(), nci_send_frame() and driver send() functions.

NfcWilink driver is also updated to use those functions.

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn533: Fix error return code in pn533_probe()
Wei Yongjun [Tue, 7 May 2013 12:07:52 +0000 (20:07 +0800)]
NFC: pn533: Fix error return code in pn533_probe()

Fix to return -ENOMEM in the nfc device alloc error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn544: Remove Felica and Jewel device presence check
Arron Wang [Mon, 22 Apr 2013 09:21:27 +0000 (17:21 +0800)]
NFC: pn544: Remove Felica and Jewel device presence check

There is no builtin command for driver to check the presence of
Felica and Jewel device, it is more reasonable for the userspace
daemon neard to build seperate commands to check the presence of
the card.

Signed-off-by: Arron Wang <arron.wang@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn544: Identify Type F NFC-DEP through NFCID2
Arron Wang [Mon, 22 Apr 2013 09:21:04 +0000 (17:21 +0800)]
NFC: pn544: Identify Type F NFC-DEP through NFCID2

NFCID2 is defined as the first 2 manufacturer ID (IDm) bytes.
NFC DEP (NFC peer to peer) devices Type-F NFCID2 must start with
0x01fe according to the NFC Digital Specification.
By checking those first 2 bytes we send the right command either to the
reader gate when NFCID2 != 0x1fe (The NFC tag case) or to the NFCIP1 gate
when seeing an NFC DEP device (The NFC peer to peer case).

Without this fix, Felica (Type F) tags are not properly detected with this
driver.

Signed-off-by: Arron Wang <arron.wang@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoMerge branch 'for-linville-ath10k' of git://github.com/kvalo/ath6kl
John W. Linville [Thu, 13 Jun 2013 17:34:29 +0000 (13:34 -0400)]
Merge branch 'for-linville-ath10k' of git://github.com/kvalo/ath6kl

11 years agoMerge branch 'for-linville' of git://github.com/kvalo/ath6kl
John W. Linville [Thu, 13 Jun 2013 17:33:39 +0000 (13:33 -0400)]
Merge branch 'for-linville' of git://github.com/kvalo/ath6kl

11 years agoath9k: Fix ANI trigger threshold
Sujith Manoharan [Thu, 13 Jun 2013 03:22:09 +0000 (08:52 +0530)]
ath9k: Fix ANI trigger threshold

Since raising/lowering the limits based on INI has
been changed, the error limit for OFDM has to be 1000,
not 3500.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agocarl9170: add support for the new rate control API
Christian Lamparter [Wed, 12 Jun 2013 19:35:39 +0000 (21:35 +0200)]
carl9170: add support for the new rate control API

With the new rate control API, the driver can now apply the
tx rate to outgoing frames just before they are uploaded to
the device. This is important because the rate control can
now react to fading or improving links a bit sooner.

Also, the driver no longer needs to sort the outgoing frames
for sample attempts (which affected the size of A-MPDUs and
the throughput of the link). For aggregated data frames, the
driver (and rate control) needs only to calculate and apply
a single set of tx rates to every subframe of the whole
aggregate.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoBluetooth: btmrvl: fix error return code in btmrvl_sdio_card_to_host()
Wei Yongjun [Wed, 5 Jun 2013 02:16:55 +0000 (10:16 +0800)]
Bluetooth: btmrvl: fix error return code in btmrvl_sdio_card_to_host()

Fix to return -ENOMEM in the skb alloc error handling case
instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoBluetooth: Add support for Mediatek Bluetooth device [0e8d:763f]
Cho, Yu-Chen [Tue, 4 Jun 2013 13:40:26 +0000 (21:40 +0800)]
Bluetooth: Add support for Mediatek Bluetooth device [0e8d:763f]

This patch adds support for Mediatek Bluetooth device

T:  Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.01 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0e8d ProdID=763f Rev= 1.00
S:  Manufacturer=MediaTek
S:  Product=BT
S:  SerialNumber=1.0
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=450mA
A:  FirstIf#= 0 IfCount= 2 Cls=ff(vend.) Sub=ff Prot=ff
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=125us
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=125us
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
I:  If#= 1 Alt= 6 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  63 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  63 Ivl=1ms

Signed-off-by: Cho, Yu-Chen <acho@suse.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlwifi: mvm: remove obsolete comment
Emmanuel Grumbach [Thu, 13 Jun 2013 07:25:43 +0000 (10:25 +0300)]
iwlwifi: mvm: remove obsolete comment

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: take the seqno from packet if transmit failed
Emmanuel Grumbach [Thu, 13 Jun 2013 07:07:47 +0000 (10:07 +0300)]
iwlwifi: mvm: take the seqno from packet if transmit failed

The fw is unreliable in all the cases in which the packet
wasn't sent.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: create opmode/device dependencies
Johannes Berg [Mon, 10 Jun 2013 14:12:52 +0000 (16:12 +0200)]
iwlwifi: create opmode/device dependencies

The older devices (pre-7000/3000 series) all only work with the
DVM opmode due to firmware availability, while newer ones will
only work with the MVM opmode for the same reason.

When building a driver that only has one of MVM or DVM, there's
no reason to build the device support and have the PCIe IDs for
all devices since they can't be used anyway, so avoid that.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: mark scratch area in TX command
Johannes Berg [Mon, 10 Jun 2013 13:58:13 +0000 (15:58 +0200)]
iwlwifi: mvm: mark scratch area in TX command

Give the scratch area a sub structure so it's marked
explicitly and it is obvious which part it is.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: reduce debug ifdefs using the optimiser
Johannes Berg [Wed, 12 Jun 2013 07:56:51 +0000 (09:56 +0200)]
iwlwifi: reduce debug ifdefs using the optimiser

Instead of using #ifdef CONFIG_IWLWIFI_DEBUG, remove the
iwlwifi_mod_params.debug_level variable completely and
make iwl_have_debug_level() always return false in the
non-debug case. This way, the optimiser will elide all
code for it automatically without having to add #ifdefs.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: remove calib channel section from PHY DB
David Spinadel [Wed, 12 Jun 2013 13:58:04 +0000 (16:58 +0300)]
iwlwifi: remove calib channel section from PHY DB

Remove calibration per-channel data as it's no longer used.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: mvm: removed an unused parameter from a function
Oren Givon [Wed, 12 Jun 2013 17:37:03 +0000 (20:37 +0300)]
iwlwifi: mvm: removed an unused parameter from a function

Remove the unused iwl_mvm *mvm parameter from the
iwl_mvm_send_remote_wake_cfg function in D3.c.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: pcie: don't read INTA register in ICT IRQ handler
Johannes Berg [Tue, 11 Jun 2013 19:12:29 +0000 (21:12 +0200)]
iwlwifi: pcie: don't read INTA register in ICT IRQ handler

There's no reason to read the INTA register in the ICT IRQ
handler, this interrupt mechanism is designed to not have
to read as many registers as the regular one. Not reading
the INTA register gives a significant performance/CPU use
improvement.

Since we still want to get this info, fetch it only if
the ISR debug level is enabled.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: make TX seqno validation more efficient
Johannes Berg [Tue, 11 Jun 2013 17:05:27 +0000 (19:05 +0200)]
iwlwifi: make TX seqno validation more efficient

Accessing the device in Tx path is not a good idea.
Mirror the data in DRAM.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Wed, 12 Jun 2013 19:39:05 +0000 (15:39 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

Conflicts:
drivers/net/wireless/iwlwifi/mvm/mac80211.c

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Wed, 12 Jun 2013 19:12:41 +0000 (15:12 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

11 years agobrcmfmac: add debugfs statistics for firmware-signalling
Arend van Spriel [Thu, 6 Jun 2013 11:18:07 +0000 (13:18 +0200)]
brcmfmac: add debugfs statistics for firmware-signalling

Added statistics for flow-control and packets dropped by the
driver.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Always use fifo_credits, also for requested credits.
Hante Meuleman [Thu, 6 Jun 2013 11:18:03 +0000 (13:18 +0200)]
brcmfmac: Always use fifo_credits, also for requested credits.

Currently firmware requested credits do not require fifo credits.
From a buffer management point of view this is incorrect. So
firwmware requested credits require also fifo credits before the
packet can be transferred to the host.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoRevert "iwl4965: workaround connection regression on passive channel"
Stanislaw Gruszka [Wed, 12 Jun 2013 14:48:25 +0000 (16:48 +0200)]
Revert "iwl4965: workaround connection regression on passive channel"

This reverts commit dd9c46408fdc07098333655ff27edf8cac8d9fcf.

With "iwl{4965,3495): workaround for firmware frame tx rejection"
patches we can enable IEEE80211_HW_REPORTS_TX_ACK_STATUS again.

Tested-by: Jake Edge <jake@lwn.net>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwl3945: workaround for firmware frame tx rejection
Stanislaw Gruszka [Wed, 12 Jun 2013 14:44:50 +0000 (16:44 +0200)]
iwl3945: workaround for firmware frame tx rejection

Firmware can reject to transmit frame on passive channel, when it
did not yet received any frame with valid CRC on that channel.
Workaround this problem in the driver.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwl4965: workaround for firmware frame tx rejection
Stanislaw Gruszka [Wed, 12 Jun 2013 14:44:49 +0000 (16:44 +0200)]
iwl4965: workaround for firmware frame tx rejection

Firmware can reject to transmit frame on passive channel, when it
did not yet received any frame with valid CRC on that channel.
Workaround this problem in the driver.

Tested-by: Jake Edge <jake@lwn.net>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlegacy: add il_{stop,wake}_queues_by_reason functions
Stanislaw Gruszka [Wed, 12 Jun 2013 14:44:48 +0000 (16:44 +0200)]
iwlegacy: add il_{stop,wake}_queues_by_reason functions

Add functions that will stop/wake all queues. Make them safe
regarding multiple calls and when some ac are stopped/woke
independently.

Tested-by: Jake Edge <jake@lwn.net>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlegacy: small refactoring of il_{stop,wake}_queue
Stanislaw Gruszka [Wed, 12 Jun 2013 14:44:47 +0000 (16:44 +0200)]
iwlegacy: small refactoring of il_{stop,wake}_queue

Tested-by: Jake Edge <jake@lwn.net>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath5k: make use of the new rate control API
Thomas Huehn [Tue, 11 Jun 2013 13:10:31 +0000 (15:10 +0200)]
ath5k: make use of the new rate control API

This patch enabels ath5k to use the new rate table to lookup each
mrr rate and retry information per packet.

Signed-off-by: Benjamin Vahl <bvahl@net.t-labs.tu-berlin.de>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Do not assign noise for NULL caldata
Sujith Manoharan [Mon, 10 Jun 2013 08:19:40 +0000 (13:49 +0530)]
ath9k: Do not assign noise for NULL caldata

ah->noise is maintained globally and not per-channel. This
is updated in the reset() routine after the NF history has been
filled for the *current channel*, just before switching to
the new channel. There is no need to do it inside getnf(), since
ah->noise must contain a value for the new channel.

Cc: stable@vger.kernel.org
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix noisefloor calibration
Sujith Manoharan [Mon, 10 Jun 2013 08:19:39 +0000 (13:49 +0530)]
ath9k: Fix noisefloor calibration

The commits,

"ath9k: Fix regression in channelwidth switch at the same channel"
"ath9k: Fix invalid noisefloor reading due to channel update"

attempted to fix noisefloor calibration when a channel switch
happens due to HT20/HT40 bandwidth change. This is causing invalid
readings resulting in messages like:

"ath: phy16: NF[0] (-45) > MAX (-95), correcting to MAX".

This results in an incorrect noise being used initially for reporting
the signal level of received packets, until NF calibration is done
and the history buffer is updated via the ANI timer, which happens
much later.

When a bandwidth change happens, it is appropriate to reset
the internal history data for the channel. Do this correctly in the
reset() routine by checking the "chanmode" variable.

Cc: stable@vger.kernel.org
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Assign default xlna config for AR9485
Sujith Manoharan [Mon, 10 Jun 2013 08:19:38 +0000 (13:49 +0530)]
ath9k_hw: Assign default xlna config for AR9485

For AR9485 boards with XLNA, the default gpio config
is not set correctly, fix this.

Cc: stable@vger.kernel.org
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: activate N-PHY and HT-PHY support by default
Hauke Mehrtens [Sun, 9 Jun 2013 16:59:43 +0000 (18:59 +0200)]
b43: activate N-PHY and HT-PHY support by default

N-PHY and HT-PHY support is more or less stable and should be activated
by default.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: activate PCI host option by default
Hauke Mehrtens [Sun, 9 Jun 2013 16:59:42 +0000 (18:59 +0200)]
bcma: activate PCI host option by default

Most users are using bcma with a PCIe card, activate support for
this by default.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: ensue that BCMA is "y" when B43 is "y"
Hauke Mehrtens [Sun, 9 Jun 2013 16:53:58 +0000 (18:53 +0200)]
b43: ensue that BCMA is "y" when B43 is "y"

When b43 gets build into the kernel and it should use bcma we have to
ensure that bcma was also build into the kernel and not as a module.
In this patch this is also done for SSB, although you can not
build b43 without ssb support for now.

This fixes a build problem reported by Randy Dunlap in
5187EB95.2060605@infradead.org

Reported-By: Randy Dunlap <rdunlap@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_htc: add STBC TX support
Oleksij Rempel [Sun, 9 Jun 2013 16:51:24 +0000 (18:51 +0200)]
ath9k_htc: add STBC TX support

All known ar7010+ar* device and current FW support STBC TX. This patch
make use of it and suggest to send STBC if peer support it.
I use wort "suggest" since currenly we have separate rate controller
in FW which will make decision based on rate and hardware.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Fix AP/PCP start flow
Kirshenbaum Erez [Sun, 9 Jun 2013 14:35:28 +0000 (17:35 +0300)]
wil6210: Fix AP/PCP start flow

WMI PCP Start flow should not be handled through:
net_device_ops->ndo_open()->wil_up()->__wil_up()
because it missing mandatory FW parameters (SSID,Channel,IEs, Security...).

Prior to AP starting __wil_up() may be called with iftype set
cfg80211_ops->change_virtual_intf(NL80211_IFTYPE_AP or STATION)
depend on the application hostapd/wpa_supplicant/iw.
there should not be an attempt to start an AP flow,
AP/PCP start flow will be started latter by cfg80211_ops->start_ap().

Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: fix name of tracing config option
Hauke Mehrtens [Sun, 9 Jun 2013 11:10:05 +0000 (13:10 +0200)]
wil6210: fix name of tracing config option

Tracing in wil6210 is activated with WIL6210_TRACING and not with
ATH6KL_TRACING, this is used for the ath6kl driver. Rename the config
option.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Init Rx vring right after reset
Vladimir Kondratiev [Sun, 9 Jun 2013 06:12:55 +0000 (09:12 +0300)]
wil6210: Init Rx vring right after reset

at the vring initialisation, memory pool get allocated in the FW.
Make it 1-st because FW need this memory pool to precess
next commands

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Send EAPOL frames using normal Tx queue
Vladimir Kondratiev [Sun, 9 Jun 2013 06:12:54 +0000 (09:12 +0300)]
wil6210: Send EAPOL frames using normal Tx queue

No more need for special processing of EAPOL, FW can now send EAPOL frames
using normal Tx queue for TID 0

This fixes "schedule while atomic" bug - start_xmit called in softirq context;
while WMI mechanism that was used may sleep.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Derive IE's for AP
Vladimir Kondratiev [Sun, 9 Jun 2013 06:12:53 +0000 (09:12 +0300)]
wil6210: Derive IE's for AP

When starting secure AP, in some cases wpa_s provides probe template but not
probe/assoc IE's. In this case, derive missing IE's from probe.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: improve frame type reporting
Vladimir Kondratiev [Sun, 9 Jun 2013 06:12:52 +0000 (09:12 +0300)]
wil6210: improve frame type reporting

Report FC from the frame itself, as auxiliary information includes
only frame subtype. This is preparation for future changes, when
DMG beacon (extension frame) may be reported through wmi_evt_rx_mgmt()

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: map more FW memory
Vladimir Kondratiev [Sun, 9 Jun 2013 06:12:51 +0000 (09:12 +0300)]
wil6210: map more FW memory

map card's back-door debug data

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: fix timeout for start_pcp
Vladimir Kondratiev [Sun, 9 Jun 2013 06:12:50 +0000 (09:12 +0300)]
wil6210: fix timeout for start_pcp

It may take up to 3500ms for the FW to start AP/PCP. Increase accordingly,
adding some safety margin.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: limit multicast buffer hardware queue depth
Felix Fietkau [Fri, 7 Jun 2013 16:12:02 +0000 (18:12 +0200)]
ath9k: limit multicast buffer hardware queue depth

The CAB (Content after Beacon) queue is used for beacon-triggered
transmission of buffered multicast frames. If lots of multicast frames
were buffered and this queue fills up, it drowns out all regular
traffic. To limit the damage that buffered traffic can do, try to limit
the queued data to becaon_interval / 8.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: implement support for .release_buffered_frames()
Felix Fietkau [Fri, 7 Jun 2013 16:12:01 +0000 (18:12 +0200)]
ath9k: implement support for .release_buffered_frames()

This adds support for PS-Poll and U-APSD driver-buffered frames (part of
an aggregation session).

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: add support for IEEE80211_TX_CTL_PS_RESPONSE
Felix Fietkau [Fri, 7 Jun 2013 16:12:00 +0000 (18:12 +0200)]
ath9k: add support for IEEE80211_TX_CTL_PS_RESPONSE

Use the UAPSD hardware queue to get PS-Poll responses out as fast as
possible and without backoff.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: free primary net_device when brcmf_bus_start() fails
Arend van Spriel [Fri, 7 Jun 2013 09:03:00 +0000 (11:03 +0200)]
brcmfmac: free primary net_device when brcmf_bus_start() fails

When initialization within brcmf_bus_start() fails on steps
before the brcmf_net_attach() the net_device for the primary
interface needs to be freed.

This patch resolves a panic during kernel boot as reported
by Stephen Warren.

ref.: http://mid.gmane.org/51AD1F22.2080004@wwwdotorg.org

Tested-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Sent TIM information in case of data available.
Arend van Spriel [Thu, 6 Jun 2013 11:49:32 +0000 (13:49 +0200)]
brcmfmac: Sent TIM information in case of data available.

When data is available and fw signalling is enabled then TIM
information should be sent to firmware. If it can piggy back
on existing packet then do that otherwise create dummy packet
to get information out.

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: increment hard_header_len instead of overriding
Arend van Spriel [Thu, 6 Jun 2013 11:18:06 +0000 (13:18 +0200)]
brcmfmac: increment hard_header_len instead of overriding

In brcmf_net_attach() the hard_header_len is set to sum of ETH_HLEN
and the headroom needed by the bus interface. Better use increment
instead as hard_header_len is already initialized upon alloc_netdev().

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add trace event for capturing BDC header
Arend van Spriel [Thu, 6 Jun 2013 11:18:05 +0000 (13:18 +0200)]
brcmfmac: add trace event for capturing BDC header

The BDC header contains PropTx TLV signals that are useful to capture
for debugging. This event captures the header and tlv's in binary
form. This can be post-processed using trace-cmd plugin.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix send_pkts statistic counter in firmware-signalling
Arend van Spriel [Thu, 6 Jun 2013 11:18:02 +0000 (13:18 +0200)]
brcmfmac: fix send_pkts statistic counter in firmware-signalling

The statistic counter send_pkts was wrongly counted conditionally.
Correcting the mistake.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Simplify counting transit count.
Hante Meuleman [Thu, 6 Jun 2013 11:18:01 +0000 (13:18 +0200)]
brcmfmac: Simplify counting transit count.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Fix endless loop when brcmf_fws_commit_skb fails.
Hante Meuleman [Thu, 6 Jun 2013 11:18:00 +0000 (13:18 +0200)]
brcmfmac: Fix endless loop when brcmf_fws_commit_skb fails.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Signalling header push and pull on logic places.
Hante Meuleman [Thu, 6 Jun 2013 11:17:59 +0000 (13:17 +0200)]
brcmfmac: Signalling header push and pull on logic places.

Currently suppressed packets get enque-ed with header which
then gets pulled before transmit. It is more logical and clean
to pull the header on return and push it unconditionally on xmit.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Accept only first creditmap event.
Hante Meuleman [Thu, 6 Jun 2013 11:17:58 +0000 (13:17 +0200)]
brcmfmac: Accept only first creditmap event.

During P2P testing it turned out that the firmware sents multiple
multiple creditmap event messages. Only the first message from the
firmware should be processed. Otherwise the firmware-signalled flow
control can run haywire when it has packets outstanding in firmware.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix invalid ifp lookup in firmware-signalling
Hante Meuleman [Thu, 6 Jun 2013 11:17:57 +0000 (13:17 +0200)]
brcmfmac: fix invalid ifp lookup in firmware-signalling

The destination entries for firmware-signalled flow control have
the interface id stored. This needs to be translated to bsscfg
index when looking up the ifp object for the interface.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Find correct MAC descriptor in case of TDLS.
Hante Meuleman [Thu, 6 Jun 2013 11:17:56 +0000 (13:17 +0200)]
brcmfmac: Find correct MAC descriptor in case of TDLS.

In case of TDLS find the correct MAC descriptor for fw signalling
data. In case of TDLS each destination gets its own entry. This
was not handled correctly for P2P client.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Correct creditmap when credit borrowing is active.
Hante Meuleman [Thu, 6 Jun 2013 11:17:54 +0000 (13:17 +0200)]
brcmfmac: Correct creditmap when credit borrowing is active.

When credit borrowing is active the BE credits have been depleted,
however the worker should still be scheduled. In case of credit
borrowing correct credit map to make sure worker remains active.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: For FW signalling it is necessary to track gen bit.
Hante Meuleman [Thu, 6 Jun 2013 11:17:53 +0000 (13:17 +0200)]
brcmfmac: For FW signalling it is necessary to track gen bit.

Store gen bit on suppressed packet per entry and use latest
stored version for each packet which gets transmitted to fw.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: On bus flow control use fw signalling or netif.
Hante Meuleman [Thu, 6 Jun 2013 11:17:52 +0000 (13:17 +0200)]
brcmfmac: On bus flow control use fw signalling or netif.

Currently on a bus flow control both fws is informed and netif queue
gets closed. In case of fw signalling enabled, let the flow control
be handled by fw signalling only.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: reducing debug logging in firmware-signalling code
Arend van Spriel [Thu, 6 Jun 2013 11:17:51 +0000 (13:17 +0200)]
brcmfmac: reducing debug logging in firmware-signalling code

The debug logging in firmware-signalling code was rather extensive and
for a large part in the data path. This patch removes large part or the
level is changed to DATA level.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: explicitly indicate sk_buff is sent upon request credit
Arend van Spriel [Thu, 6 Jun 2013 11:17:50 +0000 (13:17 +0200)]
brcmfmac: explicitly indicate sk_buff is sent upon request credit

Firmware can request the driver for transmit packets using two different
signals. Only for one signal a flag was set in the sk_buff control
buffer. This patch adds explicit flag for the other signal as well.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: rework credit pickup to assure consistent handling
Arend van Spriel [Thu, 6 Jun 2013 11:17:49 +0000 (13:17 +0200)]
brcmfmac: rework credit pickup to assure consistent handling

Reworked brcmf_skb_pick_up_credit() so it can be used for both
fcmode flavours in the same way.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Take bus flowcontrol at credit mgmt into account.
Hante Meuleman [Thu, 6 Jun 2013 11:17:48 +0000 (13:17 +0200)]
brcmfmac: Take bus flowcontrol at credit mgmt into account.

On bus flow control (no more host bus resources to send packets
to device) the netif flow control was toggled, however credit
management should also take this status into account. Since there
are multiple sources handling this flow control necessary spinlocks
were added to protect flow control related data/states.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove fifo bitfield from brcmf_skbuff_cb::if_flags
Arend van Spriel [Thu, 6 Jun 2013 11:17:47 +0000 (13:17 +0200)]
brcmfmac: remove fifo bitfield from brcmf_skbuff_cb::if_flags

The brcmf_skbuff_cb structure contain if_flags and htod fields. Both
have a bitfield defined to hold the fifo number. With a small code
change we get rid of the fifo bitfield in if_flags.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: allow firmware-signal tlv to be longer than specified
Arend van Spriel [Thu, 6 Jun 2013 11:17:46 +0000 (13:17 +0200)]
brcmfmac: allow firmware-signal tlv to be longer than specified

The firmware-signal API specification defines length for the different
tlv. During testing on different devices it turned out not all firmware
used the tlv length according specification. Therefore the length check
is made less strict with this patch.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>