Commit graph

481066 commits

Author SHA1 Message Date
Johan Hedberg
f03567040c Bluetooth: Fix l2cap_sock_teardown_cb lockdep warning
Any code calling bt_accept_dequeue() to get a new child socket from a
server socket should use lock_sock_nested to avoid lockdep warnings due
to the parent and child sockets being locked at the same time. The
l2cap_sock_accept() function is already doing this correctly but a
second place calling bt_accept_dequeue() is the code path from
l2cap_sock_teardown_cb() that calls l2cap_sock_cleanup_listen().

This patch fixes the proper nested locking annotation and thereby avoids
the following style of lockdep warning.

[  +0.000224] [ INFO: possible recursive locking detected ]
[  +0.000222] 3.17.0+ #1153 Not tainted
[  +0.000130] ---------------------------------------------
[  +0.000227] l2cap-tester/562 is trying to acquire lock:
[  +0.000210]  (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+...}, at: [<c1393f47>] bt_accept_dequeue+0x68/0x11b
[  +0.000467]
but task is already holding lock:
[  +0.000186]  (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+...}, at: [<c13b949a>] lock_sock+0xa/0xc
[  +0.000421]
other info that might help us debug this:
[  +0.000199]  Possible unsafe locking scenario:

[  +0.000117]        CPU0
[  +0.000000]        ----
[  +0.000000]   lock(sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP);
[  +0.000000]   lock(sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP);
[  +0.000000]
 *** DEADLOCK ***

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 10:05:25 +01:00
Alexander Aring
c8937a1d11 ieee820154: add lbt setting support
This patch adds support for setting listen before transmit mode via
nl802154 framework.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:43 +01:00
Alexander Aring
f426fd03da at86rf230: remove invalid max frame retries check
This patch removes the invalid max frame retries check from driver
layer. This is already handled by nl802154 framework. Also the IEEE
802.15.4 standard doesn't allow a frame retries setting above 7. This
seems to be valid for the at86rf230 transceiver but the chip running out
of spec then. We only allow settings according 802.15.4 right now.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:42 +01:00
Alexander Aring
17a3a46bfb ieee820154: add max frame retries setting support
This patch add support for setting mac frame retries setting via
nl802154 framework.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:42 +01:00
Alexander Aring
17561bfe6f at86rf230: remove invalid max csma backoffs check
This patch removes the invalid check on max csma backoffs in driver
layer. This is already handled by nl802154 framework.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:41 +01:00
Alexander Aring
a01ba7652c ieee820154: add max csma backoffs setting support
This patch add support for max csma backoffs setting via nl802154
framework.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:41 +01:00
Alexander Aring
a8d352d458 at86rf230: remove invalid backoff exponent check
This patch removes the invalid backoff exponent check from driver layer.
This is already handled by nl802154.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:41 +01:00
Alexander Aring
656a999e87 ieee820154: add backoff exponent setting support
This patch adds support for setting backoff exponents via nl802154
framework.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:40 +01:00
Alexander Aring
9830c62a0b ieee820154: add short_addr setting support
This patch adds support for setting short address via nl802154 framework.
Also added a comment because a 0xffff seems to be valid address that we
don't have a short address. This is a valid setting but we need
more checks in upper layers to don't allow this address as source address.
Also the current netlink interface doesn't allow to set the short_addr
to 0xffff. Same for the 0xfffe short address which describes a not
allocated short address.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:40 +01:00
Alexander Aring
702bf37128 ieee820154: add pan_id setting support
This patch adds support for setting pan_id via nl802154 framework.
Adding a comment because setting 0xffff as pan_id seems to be valid
setting. The pan_id 0xffff as source pan is invalid. I am not sure now
about this setting but for the current netlink interface this is an
invalid setting, so we do the same now. Maybe we need to change that
when we have coordinator support and association support.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:39 +01:00
Alexander Aring
820bd66fb2 ieee820154: remove valid page and channel checks
This patch removes validation of page and channel while setting from
driver layer. This is already handled by nl802154 and mac802154.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:38 +01:00
Alexander Aring
ab0bd56172 ieee820154: add channel set support
This patch adds page and channel setting support to nl802154 framework.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:38 +01:00
Alexander Aring
9d30a8cf98 ieee802154: cleanup cfg802154 intendation
This is patch is cleanup to have a similar indentation like cfg80211
implementation.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:37 +01:00
Alexander Aring
be4fd8e5d9 mac802154: add ifname change notifier
This patch adds a netdev notifier for interface renaming. We have a name
attribute inside of subif data struct. This is needed to have always the
actual netdev name in sdata name attribute.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:37 +01:00
Alexander Aring
912f67aec7 mac802154: change module description
This patch changes the module description like wireless which is IEEE
802.11 "subsystem" and not "implementation".

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:37 +01:00
Alexander Aring
6322d50d87 mac802154: add wpan_phy priv id
This patch adds an unique id for an wpan_phy. This behaviour is mostly
grabbed from wireless stack. This is needed for upcomming patches which
identify the wpan netdev while NETDEV_CHANGENAME in netdev notify function.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:36 +01:00
Alexander Aring
2789e6297f mac820154: move mutex locks out of loop
Instead of always re-lock the iflist_mtx at multiple interfaces we lock
the complete for each loop at start and at the end.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:36 +01:00
Alexander Aring
d14e1c71cf mac820154: rename sdata next to tmp
This patch is just a cleanup to name the temporary variable for
protected list for each loop as tmp.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:36 +01:00
Alexander Aring
592dfbfc72 mac820154: move interface unregistration into iface
This patch move the iface unregistration into iface.c file to have
a behaviour which is similar like mac80211. Also iface handling should
be inside iface.c file only.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-11-12 05:10:35 +01:00
John W. Linville
a15c706889 ath9k_htc: remove return of value in empty definintion of ath9k_htc_deinit_debug
Cc: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 17:12:17 -05:00
James Cameron
4eed83a252 mwifiex: simplify ad hoc join capability info
While preparing an ad-hoc start command, the capability info bitmap is
needlessly set from the command, and then the ESS bit cleared.

Change to set the bitmap directly without reference to the command.

Signed-off-by: James Cameron <quozl@laptop.org>
Acked-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:16 -05:00
Luciano Coelho
d351f5fea4 wlcore: make wlcore_cmd_send_failsafe() static
The wlcore_cmd_send_failsafe() function is only called in the cmd.c
file, where it is definde.  Make it static.

Additionally, move the EXPORT_SYMBOL macro for wl1271_cmd_send() to
the right place.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:16 -05:00
Luciano Coelho
f5b8f4790b wlcore: check minimum buffer size in some cmd_send functions
Check for the minimum required buffer length in wlcore_cmd_send() and
wlcore_cmd_configure_failsafe.  This ensures that we will never try to
use a buffer that is smaller than the required header.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:16 -05:00
Amitkumar Karwar
0d4b5c7c08 mwifiex: fix version display problem on big endian platforms
It's been observed that wrong firmware version (ex. 66.14.96.p9
instead of 14.66.9.p96) is displayed on big endian platforms.

The problem is fixed here.

Reported-by: Daniel Mosquera <daniel.mosquera@ctag.com>
Tested-by: Daniel Mosquera <daniel.mosquera@ctag.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:15 -05:00
Oleksij Rempel
3f2aa13f6d ath9k_htc: add spectral scan debug interface
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:15 -05:00
Oleksij Rempel
83fb287ecd ath9k_htc: process rx spectral packets
use code provided by Ashish Patro <patro@cs.wisc.edu>

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:15 -05:00
Oleksij Rempel
911544f6a8 ath9k_htc: trigger spectral scan on set_channel
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:15 -05:00
Oleksij Rempel
88a2e3fb7b ath9k_htc: set initial spec_config values
use values provided by Ashish Patro <patro@cs.wisc.edu>

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:15 -05:00
Oleksij Rempel
fe30e8bb5b ath9k_htc: add struct ath_spec_scan_priv to ath9k_htc_priv
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:15 -05:00
Oleksij Rempel
94cd95c217 ath9k_htc: add ath_ps_ops bindings
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:15 -05:00
Oleksij Rempel
525d09456b ath9k_htc: fix rs_datalen conversation
For some reason it didn't coused obvious problems.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:14 -05:00
Oleksij Rempel
46140ddf16 ath9k: For AR9271 chipsets, set count = 0 for endless samples.
not sure why.
Initially provided by Ashish Patro <patro@cs.wisc.edu>

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:14 -05:00
Oleksij Rempel
67dc74f15f ath9k: move spectral.* to common-spectral.*
and rename exports from ath9k_spectral_* to ath9k_cmn_spectral_*

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:14 -05:00
Oleksij Rempel
f00a422cc8 ath9k: move ath9k_spectral_scan_ from main.c to spectral.c
Now we should be ready to make this code common.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:14 -05:00
Oleksij Rempel
963916dfe2 ath9k: make ath9k_spectral_scan_ do not depend on ath_softc
last preparation before moving ath9k_spectral_scan_ to spectral.c

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:14 -05:00
Oleksij Rempel
ef948da55f ath9k: use ath_common instead of ieee80211_hw in ath9k_spectral_scan_
we don't have here any ieee80211_hw dependencies any way.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:14 -05:00
Oleksij Rempel
934bdc73dd ath9k: use ath_ps_ops in ath9k_spectral_scan_
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:14 -05:00
Oleksij Rempel
99d2217b73 ath9k: add ath_ps_ops bindings
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:13 -05:00
Oleksij Rempel
0198c2e298 ath: add struct ath_ps_ops
we will need it to make common code

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:13 -05:00
Oleksij Rempel
1111d426ef ath9k: remove all struct ath_softc dependencies from spectral code
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:13 -05:00
Oleksij Rempel
dd7657be75 ath9k: add ath_hw to ath_spec_scan_priv
spectral code mostly depends on ath_hw, not on ath_softc

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:13 -05:00
Oleksij Rempel
c10b75af43 ath9k: use struct dentry by ath9k_spectral_init_debug
this will alow us to make ath_softc independent code.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:13 -05:00
Oleksij Rempel
21af25d00b ath9k: move spec_config to ath_spec_scan_priv
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:13 -05:00
Oleksij Rempel
8391f60194 ath9k: move spectral_mode to ath_spec_scan_priv
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:13 -05:00
Oleksij Rempel
911ea79f43 ath9k: add struct ath_spec_scan_priv
and move rfs_chan_spec_scan to this struct. We will need it
for common spectral scan code.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:12 -05:00
Avinash Patil
d7d8b83473 mwifiex: fix warning while starting BSS
We see this warning while starting mwifiex AP:
Unsupported RX-STBC, default to 2x2

This was happening because of wrong offset while copying HT
capabilities from BSS configuration of start_ap handler.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:12 -05:00
Avinash Patil
bfd713bc1a mwifiex: do not setup AMPDU/AMSDU with broadcast receiver
It is observed that device sometimes sends BA setup requests for
broadcast mac address.
This patch adds a check to avoid checking availability of
AMPDU/AMSDU streams for broadcast mac address.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:12 -05:00
Amitkumar Karwar
cf6a64fd60 mwifiex: fix out of memory issue observed for USB chipsets
On some platforms, system goes out of memory during heavy
Rx traffic with our USB chipsets.

In case of SDIO/PCIe, after receiving 50 packets in Rx queue
we stop processing interrupts till packets pending fall below
low threshold i.e 20. We don't have similar logic for USB,
so if host platform is slow, we would hit a case where firmware
keeps on pushing packets at high speed than driver/kernel can
process.

We will stop submitting URBs for Rx data when pending packet
count reaches high threshold and restart them when enough
packets are consumed to solve the problem.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=85071
Reported-by: Marek Belisko <marek.belisko@gmail.com>
Tested-by: Marek Belisko <marek.belisko@gmail.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:12 -05:00
Avinash Patil
041bfab5bb mwifiex: remove data_complete handler
This patch removes redundant data complete handler.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:12 -05:00
Avinash Patil
ec4a16b4d2 mwifiex: rx workqueue support for USB interface
This patch adds RX workqueue support for USB interfaces.
Currently rx_pending is applicable for cmd/events and Rx
data in USB interface. Let's use it only for Rx data.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11 16:31:12 -05:00