Commit graph

455514 commits

Author SHA1 Message Date
Vladimir Kondratiev
6508281b0b wil6210: support for "sparrow" hardware
New hardware release appears; it require some changes to properly support  it.
Introduce struct wil_board and "board" attribute in wil6210_priv;
keep hardware variant information in this structure.
fill it on probe(). Used in the reset flow.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-18 13:45:23 -04:00
John W. Linville
5235cd2121 Merge tag 'for-linville-20140717' of git://github.com/kvalo/ath 2014-07-18 13:44:50 -04:00
John W. Linville
fd29d2cdd5 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next 2014-07-18 13:35:45 -04:00
Bing Zhao
f95f59fe5d mwifiex: remove redundant TDLS setup action frame check and avoid leaks
The unwanted frame types are already handled in 'default' case
of the switch/case below.
The str_ptr is allocated but it can be leaked if the length check
fails in the REQUEST/RESP cases. Fix it by allocating sta_ptr
after the length checks.

Reported-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-16 09:57:58 -04:00
Rafał Miłecki
6daf43216f ssb: extract antenna gains from SPROMs revs 4+ properly
They are encoded the same way as in older SPROMs.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:19 -04:00
Rafał Miłecki
67d392c0e9 ssb: make code for antenna gain extraction more generic
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:18 -04:00
Xose Vazquez Perez
b3bbf84267 wireless: zd1211rw: new url for fw, remove experimental
Cc: Daniel Drake <dsd@laptop.org>
Cc: Ulrich Kunitz <kune@deine-taler.de>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:17 -04:00
Rafał Miłecki
c9ff78b4ff b43: N-PHY: add missing TX gain table for radio 0x2057 rev 5
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:16 -04:00
Arend van Spriel
c3da74bbbb brcmfmac: add brcmf_p2p_detach() call in brcmf_cfg80211_detach()
The function brcmf_p2p_detach() was only called in error flow of the
brcmf_cfg80211_attach() routine, but it also needs to be called
upon brcmf_cfg80211_detach().

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>
2014-07-15 16:00:16 -04:00
Arend van Spriel
b48d891676 brcmfmac: rework wiphy structure setup
Instead of waiting for IFF_UP of the primary net device to determine
the band and channel information of the wiphy structure, this is now
done during driver initialization in brcmf_cfg80211_attach(). The
channel information is obtained from the device and the 2G band is
updated when 40MHz bandwidth is enabled for that band. Before this
change the band and channel objects were common between multiple
brcmfmac devices in the system, which make that information rather
unreliable. That is also fixed with this reworked implementation.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:15 -04:00
Arend van Spriel
aa70b4fa43 brcmfmac: moving some functions around
Just reordering the functions in preparation of subsequent changes.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:14 -04:00
Arend van Spriel
c08437b4b5 brcmfmac: introduce feature and quirk handling
Introducing a new source module that will be responsible for
identifying features and quirks related to the device being
handled.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
2014-07-15 16:00:13 -04:00
Arend van Spriel
ccfd1e810b brcmfmac: move attach and detach functions in wl_cfg80211.c
Preparing for another patch move the functions in separate commit.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
2014-07-15 16:00:12 -04:00
Daniel Kim
c1b20532ef brcmfmac: Make firmware path a module parameter
This patch makes firmware path a module parameter so that firmware and
nvram files can be loaded from the specified path.

Signed-off-by: Daniel Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:12 -04:00
Arend van Spriel
82d957e09d brcmfmac: rework debugfs functions in the driver
Reworked the debugfs functions in the driver making it easier for
other driver parts to add a debugfs entry and keeping the information
they want to expose in debugfs private, ie. not in a header.

This is accomplished by providing the function brcmf_debugfs_add_entry()
in which the caller provides a read function in which they provide the
content. The debugfs function will take care of creating the debugfs
entry and cleaning up upon removal.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
2014-07-15 16:00:11 -04:00
Arend van Spriel
1b1e4e9e3a brcmfmac: make use of seq_file API for debugfs entries
The use of seq_file simplifies the debugfs code. Simpler is
better.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
2014-07-15 16:00:10 -04:00
Hante Meuleman
5779ae6a55 brcmfmac: Cleanup used device IDs.
This patch cleans up used broadcom IDs, device IDs for all the
bus layers and uses consistent naming for all IDs.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
2014-07-15 16:00:09 -04:00
Bing Zhao
b053557086 mwifiex: correct a typo in mwifiex_ret_tdls_oper
This patch fixes this typo.

Reported-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:08 -04:00
Bing Zhao
ea4eb7fb0c mwifiex: declare sta_ptr in smaller scope
sta_ptr is used only in an 'if' branch in this function.
Move it to the smaller scope where it is used.

Reported-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:07 -04:00
Bing Zhao
30fa51c888 mwifiex: define TDLS idle timeout macro with units
The unit of this timeout is in seconds.

Reported-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:07 -04:00
Bing Zhao
2a317ad806 mwifiex: fix a cut-n-paste error in adhoc-start
The 'else if' branch never gets the chance as its condition
matches 'if' branch's.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:06 -04:00
Amitkumar Karwar
d5343f0690 mwifiex: fix corner case system hang issue
Sometimes pending internal scan commands are delayed to give
preference to Tx traffic. 'scan_processing' flag has been
checked at the beginning of delay timer routine to know if in the
meantime scan operation has been cancelled.

There is a corner case where pending scan commands are emptied
after scan_processing flag check is passed. In this case
wrong pointer returned by list_first_entry() is passed to
list_del() which causes system hang.

This patch fixes the issue by adding list_empty() check.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:05 -04:00
Amitkumar Karwar
2d702830e0 mwifiex: access rx_reorder_tbl_ptr only while holding lock
This patch fixes a bug in which rx_reorder_tbl_ptr is accessed
without holding spinlock at few places.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:04 -04:00
Xose Vazquez Perez
6a06e554da wireless: rt2x00: add new rt2800usb devices
0x0b05 0x17e8 RT5372 USB 2.0  bgn 2x2 ASUS USB-N14
0x0411 0x0253 RT5572 USB 2.0 abgn 2x2 BUFFALO WLP-U2-300D
0x0df6 0x0078 RT???? Sitecom N300

Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: users@rt2x00.serialmonkey.com
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:03 -04:00
Eliad Peller
5e74b3aa6f wlcore/wl18xx/wl12xx: convert bitmaps to unsigned longs
The *_bit operations expect unsigned longs.
Instead of casting the pointers, simply define various
bitmaps as unsigned long (instead of u32).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:02 -04:00
Eliad Peller
9bccb8ae05 wl18xx: make sure fw_status->priv exists before deref
In some corner cases with specific timings, we might
try dequeueing tx before we got information about
the link status (e.g. due to recovery during tx).

Instead of NULL dereference, assume all
the links in this case have low priorities.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:02 -04:00
Arik Nemtsov
1631020226 wl18xx: change the number of WLAN addrs per chip
Each 18xx chip contains only 2 real MAC addresses
usable for WLAN, forcing us to use the LAA bit
approach to obtain a third MAC address.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:01 -04:00
Arik Nemtsov
e65628691f wlcore: don't switch channels on disconnected STA vifs
Sending the FW a channel switch command on a disconnected
vif may result in a beacon loss event. Avoid this corner case.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 16:00:00 -04:00
Eliad Peller
d8c5a48d27 wlcore: register vendor commands
All the smart config code is in place now,
so register the relevant vendor commands.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:59:59 -04:00
Eliad Peller
fbddf587cb wlcore: increase max roc duration to 30 seconds
we don't have any actual limitation in the driver, so
increase it arbitrarily to 30 seconds.

The long ROC is needed for the smart config.flow.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:59:58 -04:00
Eliad Peller
e93e15fb47 wlcore/wl18xx: handle smart config events
add defintions and handling for smart config events
(SMART_CONFIG_SYNC_EVENT_ID and SMART_CONFIG_DECODE_EVENT_ID)

parse the relevant info and send it to userspace as
vendor event.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:59:57 -04:00
Eliad Peller
80ff8063e8 wlcore: handle smart config vendor commands
userspace can ask to perform various smart config
actions via custom vendor commands.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:59:56 -04:00
Eliad Peller
ccb1df9480 wlcore/wl18xx: add smart config commands
These commands configures the fw to set key,
enter smart config mode, and exit it.

Add relevant hw ops as well.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:59:56 -04:00
Eliad Peller
936c50dd06 wlcore: add smart config definitions
Add definitions for the smart config commands.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:59:55 -04:00
Eliad Peller
71a301bb46 wlcore: use correct LAA bit
The LAA bit is second bit of the MSB, not of the
third byte.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:59:54 -04:00
Eliad Peller
601d6c4e70 wl18xx: fix last tx rate calculation
The last tx rate calculation didn't take into account
the different indices of 11a and 11g rates tables.

Add the required alignment (count only from the first
11a rate in case of 11a)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:59:53 -04:00
Eliad Peller
30a0035888 wlcore: user smaller sqn padding for GEM
On recovery, we increase the current seq num by
WL1271_TX_SQN_POST_RECOVERY_PADDING in order to
compensate for packets we might have missed during
recovery.

It seems that some GEM APs have issues when the
gap is too big, so use a smaller padding in this case.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:59:52 -04:00
Eliad Peller
50d26aa338 wlcore: save seq num only between recoveries
We want seq num (freed_pkts) to be initialized
on each new connection, but keep persistent
between recoveries/suspends.

Save the freed_pkts in the private block of the
sta struct (we already do a similar thing for
AP's stations).

However, keep the old wlvif->total_freed_pkts
in order to avoid too intrusive change.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:59:51 -04:00
Rafał Miłecki
72fcd3d16c b43: don't warn about no 5 GHz support on 2.4 GHz devices
This could be a bit confusing to see warning about lacking support for
5 GHz band if your device supports 2.4 GHz only.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:51:42 -04:00
Rafał Miłecki
3695b9324e b43: enable radio 0x2057 rev 9 (AKA BCM43228) support
Support for N-PHY rev 8 with 0x2057 rev 5 is almost ready, but we still
need to figure out how to handle rev 9 first.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:51:41 -04:00
Rafał Miłecki
785e7dbb75 b43: N-PHY: implement channel switching of radio 0x2057 rev 5
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:51:40 -04:00
Rafał Miłecki
162bee1a3e b43: N-PHY: init and channel switching of radio 0x2057 rev 9
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:51:39 -04:00
Rafał Miłecki
40c68f20e6 b43; N-PHY: write most of the missing code for revs 7+
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:51:39 -04:00
Rafał Miłecki
303415e2f1 b43: N-PHY: add placeholders for new devices support
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:51:38 -04:00
Rafał Miłecki
12db5481ba b43: N-PHY: add TX gain tables for devices with specific EPA
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:51:37 -04:00
Rafał Miłecki
0933ecf9ab b43: N-PHY: drop reg 0x1 access restriction on new PHY revs
Initialization of N-PHY radio revs 5 and 7 requires writing to 0x1.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:51:36 -04:00
Rafał Miłecki
88d825bffd b43: always print info about radio (manuf, id, revision)
Type of radio has a major meaning for the driver. There is quite some
code that does initialization/calibration depending on the radio rev.
Knowing radio params is quite important to provide help to users, so
print it even with debugging disabled.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15 15:51:35 -04:00
Michal Kazior
9936194437 ath10k: sanitize tx ring index access properly
The tx ring index was immediately trimmed with a
bitmask. This discarded the 0xFFFFFFFF error case
(which theoretically can happen when a device is
abruptly disconnected) and led to using an invalid
tx ring index. This could lead to memory
corruption.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-07-15 11:19:45 +03:00
Michal Kazior
2374b18684 ath10k: fix bmi exchange tx/rx race
It was possible for tx completion not to be
processed. In that case an old stack pointer was
left on copy engine tx ring. Next bmi exchange
would immediately pop it and use complete() on the
completion struct there causing corruption.

Make sure to wait for both tx and rx completions
properly.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-07-15 11:18:58 +03:00
Himangi Saraogi
4d042654af Bluetooth: cmtp: Remove unnecessary null test
This patch removes the null test on ctrl. ctrl is initialized at the
beginning of the function to &session->ctrl. Since session is
dereferenced prior to the null test, session must be a valid pointer,
and &session->ctrl cannot be null.

The following Coccinelle script is used for detecting the change:

@r@
expression e,f;
identifier g,y;
statement S1,S2;
@@

*e = &f->g
<+...
 f->y
 ...+>
*if (e != NULL || ...)
 S1 else S2

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-07-14 23:00:13 +02:00