]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoBluetooth: Remove stop discovery handling from hci_event.c
Andre Guedes [Tue, 30 Apr 2013 18:29:34 +0000 (15:29 -0300)]
Bluetooth: Remove stop discovery handling from hci_event.c

Since all mgmt stop discovery command complete events are now handled
in stop_discovery_complete callback in mgmt.c, we can remove this
handling from hci_event.c.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Update stop_discovery to use HCI request
Andre Guedes [Tue, 30 Apr 2013 18:29:33 +0000 (15:29 -0300)]
Bluetooth: Update stop_discovery to use HCI request

This patch modifies the stop_discovery function so it uses the HCI
request framework.

The HCI request is built according to the current discovery state
(inquiry, LE scanning or name resolving) and a complete callback is
register to handle the command complete event for the stop discovery
command. This way, we move all stop_discovery mgmt handling code
spread in hci_event.c to a single place in mgmt.c.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Use HCI request in interleaved discovery
Andre Guedes [Tue, 30 Apr 2013 18:29:32 +0000 (15:29 -0300)]
Bluetooth: Use HCI request in interleaved discovery

In order to have a better HCI error handling in interleaved discovery
functionality, we should use the HCI request framework.

This patch updates le_scan_disable_work function so it uses the
HCI request framework instead of the hci_send_cmd helper. A complete
callback is registered (le_scan_disable_work_complete function) so we
are able to trigger the inquiry procedure (if we are running the
interleaved discovery) or to stop the discovery procedure (if we are
running LE-only discovery).

This patch also removes the extra logic in hci_cc_le_set_scan_enable
to trigger the inquiry procedure and the mgmt_interleaved_discovery
function since they become useless.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Move discovery macros to hci_core.h
Andre Guedes [Tue, 30 Apr 2013 18:29:31 +0000 (15:29 -0300)]
Bluetooth: Move discovery macros to hci_core.h

Some of discovery macros will be used in hci_core so we need to
define them in common place such as hci_core.h. Thus, this patch
moves discovery macros to hci_core.h and also adds the DISCOV_
prefix to them.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Make mgmt_start_discovery_failed static
Andre Guedes [Tue, 30 Apr 2013 18:29:30 +0000 (15:29 -0300)]
Bluetooth: Make mgmt_start_discovery_failed static

mgmt_start_discovery_failed is now only used in mgmt.c so we can
make it a local function. This patch also moves the mgmt_start_
discovery_failed definition up in mgmt.c to avoid forward
declaration.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Remove start discovery handling from hci_event.c
Andre Guedes [Tue, 30 Apr 2013 18:29:29 +0000 (15:29 -0300)]
Bluetooth: Remove start discovery handling from hci_event.c

Since all mgmt start discovery command complete events are now handled
in start_discovery_complete callback in mgmt.c, we can remove this
handling from hci_event.c.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Update start_discovery to use HCI request
Andre Guedes [Tue, 30 Apr 2013 18:29:28 +0000 (15:29 -0300)]
Bluetooth: Update start_discovery to use HCI request

This patch modifies the start_discovery function so it uses the HCI
request framework.

We build the HCI request according to the discovery type (add inquiry
or LE scan HCI commands) and run the HCI request. We also register
the start_discovery_complete callback which handles mgmt command
complete events for this command. This way, we move all start_
discovery mgmt handling code spread in hci_event.c to a single place
in mgmt.c.

This patch also merges the LE-only and interleaved discovery type
cases since these cases are pretty much the same now.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Gustavo Padovan [Fri, 3 May 2013 21:41:04 +0000 (18:41 -0300)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth

11 years agoBluetooth: Make inquiry_cache_flush non-static
Andre Guedes [Tue, 30 Apr 2013 18:29:27 +0000 (15:29 -0300)]
Bluetooth: Make inquiry_cache_flush non-static

In order to use HCI request framework in start_discovery, we'll need
to call inquiry_cache_flush in mgmt.c. Therefore, this patch adds the
hci_ prefix to inquiry_cache_flush and makes it non-static.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix multiple LE socket handling
Johan Hedberg [Mon, 29 Apr 2013 16:35:45 +0000 (19:35 +0300)]
Bluetooth: Fix multiple LE socket handling

The LE ATT server socket needs to be superseded by any ATT client
sockets. Previously this was done by looking at the hcon->out variable
(indicating whether the connection is outgoing or incoming) which is a
too crude way of determining whether the server socket needs to be
picked or not (an outgoing connection doesn't necessarily mean that an
ATT client socket has triggered it).

This patch extends the ATT server socket lookup function
(l2cap_le_conn_ready) to be used for all LE connections (regardless of
the hcon->out value) and adds an internal check into the function for
the existence of any ATT client sockets (in which case the server socket
should be skipped). For this to work reliably all lookups must be done
while the l2cap_conn->chan_lock is held, meaning also that the call to
l2cap_chan_add needs to be changed to its lockless __l2cap_chan_add
counterpart.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Remove useless hci_conn disc_timeout setting
Johan Hedberg [Mon, 29 Apr 2013 16:35:44 +0000 (19:35 +0300)]
Bluetooth: Remove useless hci_conn disc_timeout setting

There's no need to reset disc_timeout in l2cap_le_conn_ready since
HCI_DISCONN_TIMEOUT is the default when the hci_conn is created and
there should be no way for it to get changed between creation and
l2cap_le_conn_ready being called.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Simplify hci_conn_hold/drop logic for L2CAP
Johan Hedberg [Mon, 29 Apr 2013 16:35:43 +0000 (19:35 +0300)]
Bluetooth: Simplify hci_conn_hold/drop logic for L2CAP

The L2CAP code has been incrementing the hci_conn reference for each
l2cap_chan instance in the l2cap_conn list. Likewise, the reference is
dropped each time an l2cap_chan is removed from the list. The reference
counting policy with respect to removal has been clear and explicit in
the l2cap_chan_del function, however for addition the function
calling 2cap_chan_add has always had to do a separate hci_conn_hold
call.

What made the counting even more hard to follow is that the
hci_connect() procedure increments the reference and the L2CAP layer
making this call took advantage of it to use it as its own reference.

This patch aims to clarify things by having the call to hci_conn_hold
inside __l2cap_chan_add, thereby removing the need to do it in the
functions calling __l2cap_chan_add. The reference count for hci_connect
is still kept as it's necessary for users such as mgmt_pair_device,
however for the L2CAP layer it means that an extra call to hci_conn_drop
must be performed once l2cap_chan_add has been done.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Remove unnecessary L2CAP channel state check
Johan Hedberg [Mon, 29 Apr 2013 16:35:42 +0000 (19:35 +0300)]
Bluetooth: Remove unnecessary L2CAP channel state check

In l2cap_att_channel() we're only interested in the BT_CONNECTED state
so this state can directly be passed to l2cap_global_chan_by_scid().
This way there's no need to do any additional state check later.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Remove useless sk variable in l2cap_le_conn_ready
Johan Hedberg [Mon, 29 Apr 2013 16:35:41 +0000 (19:35 +0300)]
Bluetooth: Remove useless sk variable in l2cap_le_conn_ready

The sk variable is of quite little use since it's only used to simplify
access in the two bt_sk() calls.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix duplicate call to l2cap_chan_ready()
Johan Hedberg [Mon, 29 Apr 2013 16:35:40 +0000 (19:35 +0300)]
Bluetooth: Fix duplicate call to l2cap_chan_ready()

In l2cap_le_conn_ready() after doing l2cap_chann_add() the LE channel is
part of the list which is subsequently iterated in l2cap_conn_ready() in
this loop each channel will get l2cap_chan_ready() called which would
result in trying to set the channel two times into BT_CONNECTED state.
Instead it makes sense to just add the channel but not call chan_ready
in l2cap_le_conn_ready, which is what this patch does.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add clarifying comment to l2cap_conn_ready()
Johan Hedberg [Mon, 29 Apr 2013 16:35:39 +0000 (19:35 +0300)]
Bluetooth: Add clarifying comment to l2cap_conn_ready()

There is an extra call to smp_conn_security() for outgoing LE
connections from l2cap_conn_ready() but the reason for this call is far
from clear. After a bit of commit history research and using git blame I
found out that this extra call is for socket-less pairing processes
added by commit 160dc6ac1. This patch adds a clarifying comment to the
code for this.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix hardcoding ATT CID in __l2cap_chan_add()
Johan Hedberg [Mon, 29 Apr 2013 16:35:38 +0000 (19:35 +0300)]
Bluetooth: Fix hardcoding ATT CID in __l2cap_chan_add()

Since in the future more than the ATT CID may be permissible we should
not be hardcoding it for all LE connections in __l2cap_chan_add().
Instead, the source ATT CID should only be set if the destination is
also ATT, and in other cases we should just use the existing dynamic CID
allocation function.

Assigning scid based on dcid means that whenever __l2cap_chan_add() is
called that chan->dcid is properly initialized. l2cap_le_conn_ready()
wasn't initializing is properly so this is also taken care of in this
patch.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix EBUSY condition test in l2cap_chan_connect
Johan Hedberg [Mon, 29 Apr 2013 16:35:37 +0000 (19:35 +0300)]
Bluetooth: Fix EBUSY condition test in l2cap_chan_connect

The current test in l2cap_chan_connect is intended to protect against
multiple conflicting connect attempts. However, it assumes that there
will ever only be a single CID that is connected to, which is not true.
We do need to check for conflicts with connect attempts to the same
destination CID but this check is not in anyway specific to LE but can
be applied to BR/EDR as well.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix LE vs BR/EDR selection when connecting
Johan Hedberg [Mon, 29 Apr 2013 16:35:36 +0000 (19:35 +0300)]
Bluetooth: Fix LE vs BR/EDR selection when connecting

The choice between LE and BR/EDR should be made on the destination
address type instead of the destination CID. This is particularly
important when in the future more than one CID will be allowed for LE.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Rename L2CAP_CID_LE_DATA to L2CAP_CID_ATT
Johan Hedberg [Mon, 29 Apr 2013 16:35:35 +0000 (19:35 +0300)]
Bluetooth: Rename L2CAP_CID_LE_DATA to L2CAP_CID_ATT

In future Core Specification versions the ATT CID will be just one of
many possible CIDs that can be used for data transfer. Therefore, it
makes sense to rename the define for the ATT CID to something less
ambigous.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Handle LE L2CAP signalling in its own function
Johan Hedberg [Mon, 29 Apr 2013 16:35:33 +0000 (19:35 +0300)]
Bluetooth: Handle LE L2CAP signalling in its own function

The LE L2CAP signalling channel follows its own rules and will continue
to evolve independently from the BR/EDR signalling channel. Therefore,
it makes sense to have a clear split from BR/EDR by having a dedicated
function for handling LE signalling commands.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix checks for LE support on LE-only controllers
Johan Hedberg [Wed, 24 Apr 2013 10:05:32 +0000 (13:05 +0300)]
Bluetooth: Fix checks for LE support on LE-only controllers

LE-only controllers do not support extended features so any kind of host
feature bit checks do not make sense for them. This patch fixes code
used for both single-mode (LE-only) and dual-mode (BR/EDR/LE) to use the
HCI_LE_ENABLED flag instead of the "Host LE supported" feature bit for
LE support tests.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoMerge tag 'nfc-next-3.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Mon, 29 Apr 2013 19:08:47 +0000 (15:08 -0400)]
Merge tag 'nfc-next-3.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next

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

"With this one we have:

- One patch for moving the LLCP code into net/nfc.
  It fixes a build annoyance reported by Dave Miller caused by the fact
  that the LLCP code object targets are not in the same directory as the
  Makefile trying to build them is. It prevents us from doing e.g.

        make net/nfc/llcp/sock.o

  Moving the LLCP code into net/nfc and not making it optional anymore
  makes sense as LLCP is a fundamental piece of the NFC specifications
  and thus should be in the core NFC directory.

- One patch that fixes the missing dependency against RFKILL. Without it NFC
  fails to properly build when it's builtin and CONFIG_RFKILL=m."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoNFC: Add missing RFKILL dependency for Kconfig
Marcel Holtmann [Fri, 26 Apr 2013 23:02:46 +0000 (01:02 +0200)]
NFC: Add missing RFKILL dependency for Kconfig

Since the NFC subsystem gained RFKILL support, it needs to be able
to build properly with whatever option for RFKILL has been selected.

on i386:

net/built-in.o: In function `nfc_unregister_device':
(.text+0x6a36d): undefined reference to `rfkill_unregister'
net/built-in.o: In function `nfc_unregister_device':
(.text+0x6a378): undefined reference to `rfkill_destroy'
net/built-in.o: In function `nfc_register_device':
(.text+0x6a493): undefined reference to `rfkill_alloc'
net/built-in.o: In function `nfc_register_device':
(.text+0x6a4a4): undefined reference to `rfkill_register'
net/built-in.o: In function `nfc_register_device':
(.text+0x6a4b3): undefined reference to `rfkill_destroy'
net/built-in.o: In function `nfc_dev_up':
(.text+0x6a8e8): undefined reference to `rfkill_blocked'

when CONFIG_RFKILL=m but NFC is builtin.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agortlwifi: rtl8192cu: Fix false loss of AP indication
Larry Finger [Thu, 25 Apr 2013 14:50:28 +0000 (09:50 -0500)]
rtlwifi: rtl8192cu: Fix false loss of AP indication

A major change in the rtlwifi family recently added code to detect when
there is loss of AP signals. One critical statement needed for the USB
driver was missed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Fix merge issue
Piotr Haber [Thu, 25 Apr 2013 10:27:09 +0000 (12:27 +0200)]
brcmsmac: Fix merge issue

Commit 7088f4835aa353f7226e57e73fd9e6564a4dfb75
"Merge branch 'master' of
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless"
ramoved call to brcms_led_unregister in mac80211_if.c

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: implement ssb spuravoid for chipid BCM43222
Hauke Mehrtens [Wed, 24 Apr 2013 19:30:54 +0000 (21:30 +0200)]
ssb: implement ssb spuravoid for chipid BCM43222

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Correct pci_unmap_single's size
Yogesh Ashok Powar [Tue, 23 Apr 2013 23:49:50 +0000 (16:49 -0700)]
mwifiex: Correct pci_unmap_single's size

There exist mismatch between the size used for pci_map and
pci_unmap on command skb. Correcting it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Do not kfree cmd buf while unregistering PCIe
Yogesh Ashok Powar [Tue, 23 Apr 2013 23:49:49 +0000 (16:49 -0700)]
mwifiex: Do not kfree cmd buf while unregistering PCIe

All the command buffers are freed in mwifiex_free_cmd_buffer()
and hence there is no need to kfree the current command buffer
again. This might ends up freeing memory allocated by some other
kernel code.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Call pci_release_region after calling pci_disable_device
Yogesh Ashok Powar [Tue, 23 Apr 2013 23:49:48 +0000 (16:49 -0700)]
mwifiex: Call pci_release_region after calling pci_disable_device

"drivers should call pci_release_region() AFTER
calling pci_disable_device()"

Please refer section 3.2 Request MMIO/IOP resources
in Documentation/PCI/pci.txt

Cc: <stable@vger.kernel.org> # 3.2+
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Use pci_release_region() instead of a pci_release_regions()
Yogesh Ashok Powar [Tue, 23 Apr 2013 23:49:47 +0000 (16:49 -0700)]
mwifiex: Use pci_release_region() instead of a pci_release_regions()

PCI regions are associated with the device using
pci_request_region() call. Hence use pci_release_region()
instead of pci_release_regions().

Cc: <stable@vger.kernel.org> # 3.2+
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
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>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Fri, 26 Apr 2013 12:37:39 +0000 (08:37 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

11 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
John W. Linville [Fri, 26 Apr 2013 12:36:00 +0000 (08:36 -0400)]
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next

11 years agoNFC: Move LLCP code to the NFC top level diirectory
Samuel Ortiz [Fri, 26 Apr 2013 09:49:40 +0000 (11:49 +0200)]
NFC: Move LLCP code to the NFC top level diirectory

And stop making it optional. LLCP is a fundamental part of the NFC
specifications and making it optional does not make much sense.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoBluetooth: btmrvl: report error if verify_fw_download times out
Andreas Fenkart [Mon, 22 Apr 2013 09:10:23 +0000 (11:10 +0200)]
Bluetooth: btmrvl: report error if verify_fw_download times out

FW does the synchronization of the different modules during init.
It will report different modules, that it is ready at different times.
The fw download 'winner' will be reported fw ready first. Without this
patch, btmrvl was already continuing before the FW told it too. Probably
on behalf of the 'winner' which then never sees FW ready and times out.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: btmrvl: release lock while waiting for fw download complete
Andreas Fenkart [Mon, 22 Apr 2013 09:10:22 +0000 (11:10 +0200)]
Bluetooth: btmrvl: release lock while waiting for fw download complete

If not winner, driver must release the sdio host lock, so the fw
download can progress. While holding the lock fw download is stalled
and the following error is produced:

[  235.746015] Bluetooth: FW failed to be active in time!
[  235.752799] Bluetooth: Downloading firmware failed!

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: btmrvl: use native helpers for debugfs
Andy Shevchenko [Tue, 23 Apr 2013 09:53:46 +0000 (12:53 +0300)]
Bluetooth: btmrvl: use native helpers for debugfs

Clean up the code by using native debugfs helpers, instead of implementing
them ourselves:

debugfs_create_u8()
debugfs_create_x16()
debugfs_create_file()
debugfs_remove_recursive()

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Remove unneeded parameter from L2CAP ATT channel handling
Marcel Holtmann [Tue, 23 Apr 2013 07:59:00 +0000 (00:59 -0700)]
Bluetooth: Remove unneeded parameter from L2CAP ATT channel handling

The CID is fixed to L2CAP ATT channel and so there is no need to hand it
down to the handling function. Just use a constant instead.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: hci_get_cmd_complete() can be static
Fengguang Wu [Sat, 20 Apr 2013 13:24:31 +0000 (16:24 +0300)]
Bluetooth: hci_get_cmd_complete() can be static

There are new sparse warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next master
head:   a0b644b0385fa58ca578f6dce4473e8a8e6f6c38
commit: 75e84b7c522c6e07964cd1f5bf28535768a1e9fa Bluetooth: Add __hci_cmd_sync() helper function
date:   13 days ago

>> net/bluetooth/hci_core.c:82:16: sparse: symbol 'hci_get_cmd_complete' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add support for Intel Bluetooth device [8087:07dc]
Tedd Ho-Jeong An [Fri, 19 Apr 2013 16:57:43 +0000 (09:57 -0700)]
Bluetooth: Add support for Intel Bluetooth device [8087:07dc]

This patch adds support for Intel Bluetooth device by adding
btusb_setup_intel() routine that update the device with ROM patch.

T:  Bus=02 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  4 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=8087 ProdID=07dc Rev= 0.01
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
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=e0(wlcon) Sub=01 Prot=01 Driver=btusb
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=e0(wlcon) Sub=01 Prot=01 Driver=btusb
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=e0(wlcon) Sub=01 Prot=01 Driver=btusb
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=e0(wlcon) Sub=01 Prot=01 Driver=btusb
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=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix sending write_le_host_supporte for LE-only controllers
Johan Hedberg [Fri, 19 Apr 2013 15:35:21 +0000 (18:35 +0300)]
Bluetooth: Fix sending write_le_host_supporte for LE-only controllers

The Bluetooth Core Specification (4.0) defines the Write LE Host
Supported HCI command as only available for controllers supporting
BR/EDR. This is further reflected in the Read Local Extended Features
HCI command also not being available for LE-only controllers. In other
words, host-side LE support is implicit for single-mode LE controllers
and doesn't have explicit HCI-level enablement.

This patch ensures that the LE setting is always exposed as enabled
through mgmt and returns a "rejected" response if user space tries to
toggle the setting. The patch also ensures that Write LE Host Supported
is never sent for LE-only controllers.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agomwifiex: rework round robin scheduling of bss nodes.
Andreas Fenkart [Thu, 18 Apr 2013 23:34:12 +0000 (16:34 -0700)]
mwifiex: rework round robin scheduling of bss nodes.

Rotate bss prio list, so the bss next to the one served, will come first
in the list of bss' with equal priority. This way we pick bss nodes in a
round robin fashion. Using list rotation instead of a cur ptr simplifies
iteration to calling list_for_each_entry. List rotation is done via
list_move, where the head itself is temporarily removed and then
re-inserted after the bss just served.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: replace ra_list_curr by list rotation.
Andreas Fenkart [Thu, 18 Apr 2013 23:33:45 +0000 (16:33 -0700)]
mwifiex: replace ra_list_curr by list rotation.

After a packet is successfully transmitted, ra list is rotated, so the ra
next to the one transmitted, will be the first in the list. This way we
pick the ra' in a round robin fashion. This significantly simplifies
iteration in  mwifiex_wmm_get_highest_priolist_ptr to a call to
list_for_each_entry.
List rotation is done via list_move, where the head itself is temporarily
removed and then re-inserted after the item just transferred.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add credit borrowing mechanism
Arend van Spriel [Tue, 23 Apr 2013 10:53:15 +0000 (12:53 +0200)]
brcmfmac: add credit borrowing mechanism

The firmware provides credits to the driver per WMM-AC. When
only AC_BE are to be transmitted to the firmware the driver
may use credits from other priorities to send AC_BE packets
towards the firmware.

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: correct error handling in brcmf_fws_init()
Arend van Spriel [Tue, 23 Apr 2013 10:53:14 +0000 (12:53 +0200)]
brcmfmac: correct error handling in brcmf_fws_init()

In brcmf_fws_init() the error flows were not properly handled
and the caller ignored the return value. The only action that
is allowed to fail in brcmf_fws_init() is setting the tlv in
firmware as the feature is not supported on all devices.

Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
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: flush queue upon MACDESC_DEL firmware signal
Arend van Spriel [Tue, 23 Apr 2013 10:53:13 +0000 (12:53 +0200)]
brcmfmac: flush queue upon MACDESC_DEL firmware signal

When firmware signals the driver to remove a destination entry
it may have sk_buff packets queued for it. These should be freed.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: support critical protocol API for DHCP
Piotr Haber [Tue, 23 Apr 2013 10:53:12 +0000 (12:53 +0200)]
brcmfmac: support critical protocol API for DHCP

Adds support for the critical protocol API provided by nl80211
which gives Wifi traffic priority over a Bluetooth (e)SCO connection
and disables scanning during DCHP negotiation.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: allow scanning to be suppressed in the driver
Arend van Spriel [Tue, 23 Apr 2013 10:53:11 +0000 (12:53 +0200)]
brcmfmac: allow scanning to be suppressed in the driver

During the DHCP protocol exchange it is benificial to suppress
scan requests which may decrease time to complete DHCP protocol.

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 agoath9k: Fix RX DMA mapping
Sujith Manoharan [Tue, 23 Apr 2013 06:52:19 +0000 (12:22 +0530)]
ath9k: Fix RX DMA mapping

After the commit "ath9k: improve dma map failure handling", the
wrong buffer was DMA-unmapped, introducing warnings like the one below.
This patch fixes the issue.

WARNING: at /home/sujith/dev/wireless-testing/lib/dma-debug.c:986 check_sync+0x4bc/0x580()
Hardware name: LIFEBOOK AH531
ath9k 0000:02:00.0: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x00000000d9012800] [size=48 bytes]
Pid: 86, comm: kworker/u:5 Tainted: G        W  O 3.9.0-rc8-wl-debug #106
Call Trace:
 [<ffffffff810410c0>] warn_slowpath_common+0x70/0xa0
 [<ffffffff8104113c>] warn_slowpath_fmt+0x4c/0x50
 [<ffffffff8125432c>] check_sync+0x4bc/0x580
 [<ffffffff8109e5f7>] ? trace_hardirqs_on_caller+0xa7/0x190
 [<ffffffff8109e6ed>] ? trace_hardirqs_on+0xd/0x10
 [<ffffffff81254488>] debug_dma_sync_single_for_device+0x48/0x50
 [<ffffffffa0a53825>] ? ath9k_iowrite32+0x35/0x90 [ath9k]
 [<ffffffff812512f0>] ? swiotlb_tbl_sync_single+0x50/0x90
 [<ffffffff81251350>] ? swiotlb_sync_single+0x20/0x30
 [<ffffffff8125137f>] ? swiotlb_sync_single_for_device+0xf/0x20
 [<ffffffffa0a58baf>] ath_rx_edma_buf_link+0xef/0x140 [ath9k]
 [<ffffffffa0a58c4e>] ath_rx_addbuffer_edma+0x4e/0x90 [ath9k]
 [<ffffffffa0a59c51>] ath_startrecv+0xf1/0x120 [ath9k]
 [<ffffffffa0a550e0>] ath_complete_reset+0x20/0x130 [ath9k]
 [<ffffffffa0a5790d>] ath_reset_internal+0x10d/0x210 [ath9k]
 [<ffffffffa0a5878c>] ath9k_config+0x47c/0x7b0 [ath9k]
 [<ffffffffa06d4978>] ieee80211_hw_config+0x88/0x3f0 [mac80211]
 [<ffffffffa06d4a3f>] ? ieee80211_hw_config+0x14f/0x3f0 [mac80211]
 [<ffffffffa06dbed1>] __ieee80211_scan_completed+0xc1/0x440 [mac80211]
 [<ffffffffa06dd002>] ieee80211_scan_work+0x82/0x440 [mac80211]
 [<ffffffff810606a3>] process_one_work+0x1e3/0x530
 [<ffffffff81060641>] ? process_one_work+0x181/0x530
 [<ffffffff8106163f>] worker_thread+0x10f/0x3c0
 [<ffffffff81061530>] ? manage_workers+0x330/0x330
 [<ffffffff810665da>] kthread+0xea/0xf0
 [<ffffffff810664f0>] ? kthread_create_on_node+0x140/0x140
 [<ffffffff8146085c>] ret_from_fork+0x7c/0xb0
 [<ffffffff810664f0>] ? kthread_create_on_node+0x140/0x140

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Use lockless variants for the RX fifo queue
Sujith Manoharan [Tue, 23 Apr 2013 06:52:18 +0000 (12:22 +0530)]
ath9k: Use lockless variants for the RX fifo queue

The RX fifo can be accessed from the common tasklet or it can
be reaped/cleaned when RX is stopped, which is done when doing
a reset or channel change - this happens in process context.

Since it is ensured that there are no pending tasklets when
stopping RX and cleaning the FIFO, there is no need to use
SKB queue functions which take internal locks.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Reduce deep indentation
Sujith Manoharan [Tue, 23 Apr 2013 06:52:17 +0000 (12:22 +0530)]
ath9k: Reduce deep indentation

The EDMA case is handled first, so the else condition
can be removed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Remove unused argument "size"
Sujith Manoharan [Tue, 23 Apr 2013 06:52:16 +0000 (12:22 +0530)]
ath9k: Remove unused argument "size"

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: add support for the new rate control API
Felix Fietkau [Mon, 22 Apr 2013 21:11:44 +0000 (23:11 +0200)]
ath9k: add support for the new rate control API

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: merge ath_tx_start_dma into ath_tx_start
Felix Fietkau [Mon, 22 Apr 2013 21:11:43 +0000 (23:11 +0200)]
ath9k: merge ath_tx_start_dma into ath_tx_start

The split makes no sense and merging the functions makes further changes
easier to implement

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortl8192c:dm: Properly initialize local array and set value.
Han Shen [Mon, 22 Apr 2013 20:35:07 +0000 (13:35 -0700)]
rtl8192c:dm: Properly initialize local array and set value.

GCC 4.8 is spitting out uninitialized-variable warnings against
"drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c".  This patch adds
initialization to the variable and properly sets its value.

Signed-off-by: Han Shen (shenhan@google.com)
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: apply coverage class on slottime too
Mathias Kretschmer [Mon, 22 Apr 2013 20:34:41 +0000 (22:34 +0200)]
ath9k: apply coverage class on slottime too

According to 802.11-2007 17.3.8.6 (slot time), the slot time should
be increased by 3 us * coverage class. The code only increased the
ack timeout, which is fixed by this patch.

We have noticed in our long shot scenario that we see less collisions
with this patch.

Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
[add standard reference and commit message]
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'master' of git://git.infradead.org/users/rafal/b43-next
John W. Linville [Tue, 23 Apr 2013 18:10:10 +0000 (14:10 -0400)]
Merge branch 'master' of git://git.infradead.org/users/rafal/b43-next

11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Tue, 23 Apr 2013 18:09:39 +0000 (14:09 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

Conflicts:
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c

11 years agob43: N-PHY: don't use deprecated b43_radio_foo16
Rafał Miłecki [Fri, 12 Apr 2013 15:58:13 +0000 (17:58 +0200)]
b43: N-PHY: don't use deprecated b43_radio_foo16

All radio ops are 16b (there is only 1 exception for reg 0x1), so we
deprecated b43_radio_read16 and b43_radio_write16 long time ago.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: clean init tables
Rafał Miłecki [Sun, 31 Mar 2013 18:00:45 +0000 (20:00 +0200)]
b43: N-PHY: clean init tables

Sort defines, use one macro for all revs, support for 5GHz when
uploading antenna table.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: move tables init function to tables file
Rafał Miłecki [Sat, 30 Mar 2013 23:40:21 +0000 (00:40 +0100)]
b43: N-PHY: move tables init function to tables file

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use defines for (re)storing VCM config
Rafał Miłecki [Sat, 30 Mar 2013 21:34:40 +0000 (22:34 +0100)]
b43: N-PHY: use defines for (re)storing VCM config

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use shortcut "ctl" in functions names
Rafał Miłecki [Sat, 30 Mar 2013 20:50:46 +0000 (21:50 +0100)]
b43: N-PHY: use shortcut "ctl" in functions names

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use enum for INTC override function argument
Rafał Miłecki [Fri, 29 Mar 2013 10:37:02 +0000 (11:37 +0100)]
b43: N-PHY: use enum for INTC override function argument

Also make a function name shorter so we can easily fit 80 chars.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: define missing registers
Rafał Miłecki [Fri, 29 Mar 2013 10:13:40 +0000 (11:13 +0100)]
b43: N-PHY: define missing registers

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: use defines for board_type
Rafał Miłecki [Thu, 28 Mar 2013 21:25:38 +0000 (22:25 +0100)]
b43: use defines for board_type

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: fix "NB" RSSI calibration on PHYs rev2-
Rafał Miłecki [Wed, 20 Mar 2013 18:13:47 +0000 (19:13 +0100)]
b43: N-PHY: fix "NB" RSSI calibration on PHYs rev2-

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use enum for RSSI type everywhere we use it
Rafał Miłecki [Wed, 20 Mar 2013 17:24:47 +0000 (18:24 +0100)]
b43: N-PHY: use enum for RSSI type everywhere we use it

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: rename RSSI types to be shorter and more accurate
Rafał Miłecki [Wed, 20 Mar 2013 16:30:38 +0000 (17:30 +0100)]
b43: N-PHY: rename RSSI types to be shorter and more accurate

Thanks to Broadcom releasing some code we can use better names.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use more friendly variables names in RSSI code
Rafał Miłecki [Wed, 20 Mar 2013 16:26:03 +0000 (17:26 +0100)]
b43: N-PHY: use more friendly variables names in RSSI code

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: simplify conditions in RSSI offset scale function
Rafał Miłecki [Wed, 20 Mar 2013 15:57:04 +0000 (16:57 +0100)]
b43: N-PHY: simplify conditions in RSSI offset scale function

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use enum for RAIL type
Rafał Miłecki [Wed, 20 Mar 2013 15:51:39 +0000 (16:51 +0100)]
b43: N-PHY: use enum for RAIL type

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: use enum for RSSI types
Rafał Miłecki [Tue, 19 Mar 2013 17:12:00 +0000 (18:12 +0100)]
b43: HT-PHY: use enum for RSSI types

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: store TX power state before disabling it
Rafał Miłecki [Sun, 17 Mar 2013 18:49:08 +0000 (19:49 +0100)]
b43: HT-PHY: store TX power state before disabling it

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: define regs for power estimation
Rafał Miłecki [Sun, 17 Mar 2013 18:08:15 +0000 (19:08 +0100)]
b43: HT-PHY: define regs for power estimation

In MMIO dumps of ndiswrapper there are following PHY ops:
phy_read(0x0118) -> 0x013d
phy_read(0x01ed) -> 0x993d
phy_read(0x0119) -> 0x012f
phy_read(0x01ee) -> 0x992f
phy_read(0x011a) -> 0x0139
phy_read(0x0969) -> 0x9939
It matches the code of wlc_phy_txpower_est_power_nphy (from brcm80211),
so we know the registers meaning.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: do some extra TSSI setup after configuring TX
Rafał Miłecki [Sat, 16 Mar 2013 22:57:10 +0000 (23:57 +0100)]
b43: HT-PHY: do some extra TSSI setup after configuring TX

After b43_phy_ht_tx_power_ctl_setup there are some extra radio ops:
 radio_read(0x08bf) -> 0x0001
radio_write(0x08bf) <- 0x0001
radio_write(0x0159) <- 0x0011
On N-PHY we write 0x11 to TSSI regs, so it's probably sth similar.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: finish calculating values for idle TSSI
Rafał Miłecki [Sat, 16 Mar 2013 22:47:29 +0000 (23:47 +0100)]
b43: HT-PHY: finish calculating values for idle TSSI

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: tables: don't duplicate core-generic regs
Rafał Miłecki [Sat, 16 Mar 2013 22:40:01 +0000 (23:40 +0100)]
b43: HT-PHY: tables: don't duplicate core-generic regs

Now when we know many radio regs at 0x000 are core-generic, I've noticed
we duplicate some values in the tables.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: rename defines addressing cores on the 2059 radio
Rafał Miłecki [Sat, 16 Mar 2013 22:24:21 +0000 (23:24 +0100)]
b43: HT-PHY: rename defines addressing cores on the 2059 radio

After comparing writes to registers at 0x000, 0x400 and 0x800 it seems
there are many very similar writes. So 0x000 offset is not for accessing
something totally different, but probably just the first out of three
cores.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agomwifiex: remove redundant initialization for bss_descriptor
Bing Zhao [Fri, 12 Apr 2013 17:34:18 +0000 (10:34 -0700)]
mwifiex: remove redundant initialization for bss_descriptor

Initialization of bss_descriptor is unnecessary as the entire
structure will be overwritten by a memcpy followed by.

Initialize disable_11ac flag properly by setting it to true in
mwifiex_fill_new_bss_desc().

Reported-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: fix use-after-free in beacon_ie processing
Bing Zhao [Fri, 12 Apr 2013 17:34:17 +0000 (10:34 -0700)]
mwifiex: fix use-after-free in beacon_ie processing

beacon_ie buffer is allocated in mwifiex_fill_new_bss_desc()
and the buffer pointer is saved in bss_desc->beacon_buf.
beacon_ie is freed before the function returns. However,
bss_desc->beacon_buf is still being accessed afterwards.

Fix it by freeing beacon_ie (bss_desc->beacon_buf) in
caller's scope.

Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-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 agomwifiex: don't try to associate when bss_mode is not STA
Bing Zhao [Sat, 20 Apr 2013 04:00:44 +0000 (21:00 -0700)]
mwifiex: don't try to associate when bss_mode is not STA

We have blocked association attempts on interfaces configured in
AP and AD-HOC modes. P2P mode should be blocked too.

Furthermore, an error code must be returned if we are unable to
associate.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: make use of msecs_to_jiffies()
Bing Zhao [Sat, 20 Apr 2013 00:44:44 +0000 (17:44 -0700)]
mwifiex: make use of msecs_to_jiffies()

Use msecs_to_jiffies() wherever possible.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: correct bss_mode check while appending vht operation IE
Bing Zhao [Sat, 20 Apr 2013 00:44:43 +0000 (17:44 -0700)]
mwifiex: correct bss_mode check while appending vht operation IE

priv->bss_mode uses NL80211_IFTYPE_* definitions.
HostCmd_BSS_MODE_IBSS is used in ad-hoc start/join command between
driver and firmware.

Coincidentally both HostCmd_BSS_MODE_IBSS and NL80211_IFTYPE_STATION
are defined as 2. That explains why nobody complained.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: use PCI_DMA_FROMDEVICE for RX queue de-init
Avinash Patil [Sat, 20 Apr 2013 00:44:42 +0000 (17:44 -0700)]
mwifiex: use PCI_DMA_FROMDEVICE for RX queue de-init

There is a typo in mwifiex_cleanup_rxq_ring() which uses
PCI_DMA_TODEVICE while unmapping PCI memory.
We should actually use PCI_DMA_FROMDEVICE.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: configure p2p interface during initialization
Bing Zhao [Sat, 20 Apr 2013 00:44:41 +0000 (17:44 -0700)]
mwifiex: configure p2p interface during initialization

Send P2P_MODE_CFG cmd to firmware when p2p interface is created.
Without proper p2p configuration firmware may behave incorrectly
while handling commands sent through this interface.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Stone Piao <piaoyun@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Start P2P devices in P2P mode
Paul Stewart [Fri, 19 Apr 2013 15:37:46 +0000 (08:37 -0700)]
mwifiex: Start P2P devices in P2P mode

p2p devices should identify themselves as such to userspace at
startup, so the connection manager can decide which interface
to start wpa_supplicant instances on.

Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: Use more current logging styles, shrink object size
Joe Perches [Fri, 19 Apr 2013 15:33:40 +0000 (08:33 -0700)]
rt2x00: Use more current logging styles, shrink object size

Reduce object space ~2% using more current logging styles.

Neaten and simplify logging macros.
Use wiphy_<level> where appropriate.
Coalesce formats.

Convert ERROR/WARNING/INFO macros to rt2x00_<level>
Convert EEPROM to rt2x00_eeprom_dbg
Convert PROBE_ERROR to rt2x00_probe_err
Convert DEBUG to rt2x00_dbg
Convert EEPROM to rt2x00_eeprom_dbg

$ size drivers/net/wireless/rt2x00/built-in.o*
   text    data     bss     dec     hex filename
 245639   71696   69584  386919   5e767 drivers/net/wireless/rt2x00/built-in.o.new
 240609   70096   68944  379649   5cb01 drivers/net/wireless/rt2x00/built-in.o.new.nodyndbg
 240609   70096   68944  379649   5cb01 drivers/net/wireless/rt2x00/built-in.o.new.no_rt2x00_debug
 249198   70096   70352  389646   5f20e drivers/net/wireless/rt2x00/built-in.o.old
 249198   70096   70352  389646   5f20e drivers/net/wireless/rt2x00/built-in.o.old.nodyndbg
 244222   70096   69712  384030   5dc1e drivers/net/wireless/rt2x00/built-in.o.old.no_rt2x00_debug

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: rt2800lib: rename rt2800_init_bbb_early to rt2800_init_bbp_early
Gabor Juhos [Fri, 19 Apr 2013 08:13:52 +0000 (10:13 +0200)]
rt2x00: rt2800lib: rename rt2800_init_bbb_early to rt2800_init_bbp_early

The function is used for BBP register initialization,
fix the typo in the function name to reflect that.

The patch contains no functional changes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix potential NULL pointer dereference in brcmf_fws_flow_control_check()
Wei Yongjun [Fri, 19 Apr 2013 02:14:31 +0000 (10:14 +0800)]
brcmfmac: fix potential NULL pointer dereference in brcmf_fws_flow_control_check()

The dereference to 'ifp' in debug code should be moved below the NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: more Rx descriptor accessor functions
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:53 +0000 (14:33 +0300)]
wil6210: more Rx descriptor accessor functions

Helpers to fetch various fields from the Rx descriptor

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Use cached copy of Tx descriptor
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:52 +0000 (14:33 +0300)]
wil6210: Use cached copy of Tx descriptor

Original Tx descriptor stored is in non-cached area for DMA;
copy it to the cached memory to speed-up access

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Tx init optimization
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:51 +0000 (14:33 +0300)]
wil6210: Tx init optimization

vring size is known from the beginning, fill it immediately
in the struct initializer
This is minor optimization that reduces code size.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Use cached copy of Rx descriptor
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:50 +0000 (14:33 +0300)]
wil6210: Use cached copy of Rx descriptor

Rx descriptors stored in non-cacheable memory area for DMA.
Non-cacheable memory causes long access time from CPU.

Copy rx descriptor to the skb->cb, and use this copy.
It provides faster memory access, and will be usefull to keep
Rx information for later processing (BACK reorder)

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: stop dequeue upon sk_buff commit failure
Arend van Spriel [Wed, 17 Apr 2013 19:25:58 +0000 (21:25 +0200)]
brcmfmac: stop dequeue upon sk_buff commit failure

In the dequeue worker the function brcmf_commit_skb() is called.
However, instead of increment the credit count upon success it
should break the for loop upon failure. Otherwise, it will result
in an endless loop.

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: change return type for brcmf_rollback_toq() to void
Arend van Spriel [Wed, 17 Apr 2013 19:25:57 +0000 (21:25 +0200)]
brcmfmac: change return type for brcmf_rollback_toq() to void

The function brcmf_rollback_toq() is already called in error path
and its result should not override the initial error value. As the
function releases the sk_buff there is no need to return anything
so change return type to void.

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: finalize transmit upon any rollback failure
Arend van Spriel [Wed, 17 Apr 2013 19:25:56 +0000 (21:25 +0200)]
brcmfmac: finalize transmit upon any rollback failure

All rollback failures should result in freeing of the sk_buff
by calling brcmf_txfinalize().

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: use lock in brcmf_fws_del_interface()
Arend van Spriel [Wed, 17 Apr 2013 19:25:55 +0000 (21:25 +0200)]
brcmfmac: use lock in brcmf_fws_del_interface()

When deleting an interface in firmware-signalling module it will
clear any destination descriptors. To avoid concurrency issues it
should take the lock using brcmf_fws_lock().

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: schedule dequeue upon firmware-signal reception
Arend van Spriel [Wed, 17 Apr 2013 19:25:54 +0000 (21:25 +0200)]
brcmfmac: schedule dequeue upon firmware-signal reception

Several firmware signals should be considered as opportunity to
send packets to the firmware. This patch adds conditional scheduling
of the dequeue worker thread while handling those signals.

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: destination mac closed when interface is closed
Arend van Spriel [Wed, 17 Apr 2013 19:25:53 +0000 (21:25 +0200)]
brcmfmac: destination mac closed when interface is closed

Firmware signals a destination is closed as well as an interface. A
destination is associated with an interface. When an interface is
closed consequently the destination should be considered closed 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>