mwifiex: bring in scan channel gap feature

With scan channel gap when any station/AP is active, FW comes back
to connected channel for any pending data transfter after scanning each
channel.
We set scan channel gap TLV to FW in scan command when any of the
interface is active. This enables scan channel gap in FW.
Also when scan channel gap is enabled, we would scan maximum channels
allowed by FW.

Scan channel gap is supported only on FW with V15 FW API.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
mwifiex: remove restriction of single channel scan when connected

With scan channel gap in place, FW comes back to connected channel
after each scan; so we dont need to restrict FW to scan
single channel while connected.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
mwifiex: process TX even when scan is ongoing

With channel scan gap, FW comes back to connected channel after each
single channel scan. So we can safely transfer data to FW during scan.
FW would send this data once on connected channel.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
mwifiex: remove redundant variable report_scan_result

This variable is never used, get rid of it.

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>
mwifiex: remove low priority scan handling

We have a logic in driver to delay or abort low priority scan
to serve Tx traffic effectively. With scan channel
gap support added, firmware now allows driver to send Tx data while
scan operation is in progress. Hence low priority scan handling
in driver is not required now. This patch removes related code.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
mwifiex: add rx workqueue support

This patch adds RX work queue support to mwifiex.
Packets received are queued to internal queue which are then
processed by scheduling a work item for RX process.

RX work is enabled only on SMP systems.

Reviewed-by: James Cameron <quozl@laptop.org>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
mwifiex: modify TX/RX window sizes for AP interface

This patch sets uAP BA window sizes to 64.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b43: Implement PHY PLL reset

We should reset PLL after changing MAC frequency.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
rtlwifi: btcoexist: Change local debugging macros CL_*** into the standard varieties

Macros CL_SNPRINTF and CL_PRINTF are always used in that order. The first
formats info into a buffer, and the second dumps it with printk. As the
debug system in rtlwifi has a macro that does this with a single call,
it seems reasonable to use it instead. An additional benefit is that the
debug level can be set when loading the driver used by the wifi device.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: use container_of to resolve brcms_phy from brcms_phy_pub

Use container_of instead of casting first structure member.

Compiled but untested.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: use container_of to resolve dma_info from dma_pub

Use container_of instead of casting first structure member.

Compiled but untested.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fixup! wil6210: fix usage of print_hex_dump_debug

Use empty inline functions instead of empty #define. Fix for "unused variable"
as reported below:

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   167bf96dd87d2a8360cb9e9783006876dac4f579
commit: 871d8c4bbb0f23c29a21b63b1801071766f69b51 [45/62] wil6210: fix usage of print_hex_dump_debug
config: i386-allyesconfig
reproduce:
  git checkout 871d8c4bbb0f23c29a21b63b1801071766f69b51
  make ARCH=i386  allyesconfig
  make ARCH=i386

All warnings:

   drivers/net/wireless/ath/wil6210/wmi.c: In function 'wmi_evt_rx_mgmt':

>> drivers/net/wireless/ath/wil6210/wmi.c:341:10: warning: unused variable 'ie_len' [-Wunused-variable]
      size_t ie_len = d_len - offsetof(struct ieee80211_mgmt,
             ^

>> drivers/net/wireless/ath/wil6210/wmi.c:340:13: warning: unused variable 'ie_buf' [-Wunused-variable]
      const u8 *ie_buf = rx_mgmt_frame->u.beacon.variable;
                ^

vim +/ie_len +341 drivers/net/wireless/ath/wil6210/wmi.c

2be7d22f Vladimir Kondratiev 2012-12-20  334
2be7d22f Vladimir Kondratiev 2012-12-20  335    if (ieee80211_is_beacon(fc) || ieee80211_is_probe_resp(fc)) {
2be7d22f Vladimir Kondratiev 2012-12-20  336            struct cfg80211_bss *bss;
8eea944a Vladimir Kondratiev 2014-06-16  337            u64 tsf = le64_to_cpu(rx_mgmt_frame->u.beacon.timestamp);
8eea944a Vladimir Kondratiev 2014-06-16  338            u16 cap = le16_to_cpu(rx_mgmt_frame->u.beacon.capab_info);
8eea944a Vladimir Kondratiev 2014-06-16  339            u16 bi = le16_to_cpu(rx_mgmt_frame->u.beacon.beacon_int);
8eea944a Vladimir Kondratiev 2014-06-16  340            const u8 *ie_buf = rx_mgmt_frame->u.beacon.variable;
8eea944a Vladimir Kondratiev 2014-06-16  341            size_t ie_len = d_len - offsetof(struct ieee80211_mgmt,
8eea944a Vladimir Kondratiev 2014-06-16  342                                             u.beacon.variable);
8eea944a Vladimir Kondratiev 2014-06-16  343            wil_dbg_wmi(wil, "Capability info : 0x%04x\n", cap);
8eea944a Vladimir Kondratiev 2014-06-16  344            wil_dbg_wmi(wil, "TSF : 0x%016llx\n", tsf);

:::::: The code at line 341 was first introduced by commit
:::::: 8eea944af0efcdba09dac1ad220c9bfa68293279 wil6210: print more info about BSS found

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b43: tell the ucode the mac capabilities

This is based on code form brcmsmac.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b43: tell ucode the phy type and version

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b43: add missing rate

The OFDM reate 9MB was not set here

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b43: update some transmit header constants

Some constants were missing and are added now.
The rate mode was renamed, at least the ucode in brcsmac uses 2 for HT
rates (iee80211n) and the more recent ucodes are using 3 for VHT
(ieee80211ac).

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b43: add support for setting the beacon listen interval

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: Remove unnecessary tbtt assignment

The next_tbtt variable in the scheduler is needed only
for GO/AP mode operation and is always read from the
NEXT_TBTT_TIMER in the HW. There is no need to store
the timestamp for received beacons.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: Check beaconing mode properly

In MCC mode, the TSF of a context needs to be
adjusted only if it is GO/AP.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: Set offchannel state properly

When switching offchannel, BSS related information
in the HW has to be reset to default values. Add a routine
to do this.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>