UPSTREAM: ieee80211: add definition for 802.11ac information elements

Add element IDs for Extended BSS Load, VHT TX Power Envelope, AID,
and Quiet Channel.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I8038175389fc521505299743b96963ea6214c8e5
Signed-off-by: Fred Zhou <fred.zy@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202237
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209473
drm: Re-add locking to drm_fb_helper_restore_fbdev_mode_unlocked

Change b7aaef9 from upstream removed the locking in anticipation of
future atomic changes, but, those are not quite ready yet so this
change re-introduces the locking to avoid asserts that are
firing because locks are not held during modesets

Remove a WARN_ON for set_property being initialized as it's initialized
in a later patch in the atomic series

BUG=chromium:410053
TEST=test on daisy to confirm asserts are no longer firing

Change-Id: Ia03deacd201735fb2a5372ad958994e3ad5cf18c
Signed-off-by: David Sodman <dsodman@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/216225
Reviewed-by: Sean Paul <seanpaul@chromium.org>
UPSTREAM: ieee80211: add definition for TDLS wide band extended capability

Seventh bit of 8th byte of extended capabilities specifies wide
bandwidth support for TDLS links. Add this definition to ieee80211.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I8d3ac7e524aa4cd8c0a30d24413ef8447610a2bd
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202238
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209474
UPSTREAM: ieee80211: add definition for SMS4 key len

Add SMS4 key length definition to ieee80211_key_len enum.
It's used by WAPI.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I472ce98afb6c26fdb6cfbb58300af378734374a4
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202239
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209475
UPSTREAM: cfg80211: Pass station (extended) capability info to kernel

The information of the peer's capabilities and extended capabilities are
required for the driver to perform TDLS Peer UAPSD operations and off
channel operations. This information of the peer is passed from user space
using NL80211_CMD_SET_STATION command. This commit enhances
the function nl80211_set_station to pass the capability information of
the peer to the driver.

Similarly, there may be need for capability information for other modes,
so allow this to be provided with both add_station and change_station.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I0a968b61e55075507b871e420c8eaf958f07ff94
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/203619
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209476
UPSTREAM: mwifiex: fix ext_capab IE structure definition

EXT_CAPAB_IE format involves IEEE header followed by bytestream of
capabilities. Current structure has incorrect member u8 for data;
fix it by defining it as u8[0].

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I8d20fe4f8fde39b4e90da30d70d5288d1259e2c9
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202841
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209477
UPSTREAM: mwifiex: rename pkt_count to ba_pkt_count in mwifiex_ra_list_tbl struct

pkt_count is used to determine if BA can be formed on this RA list
by comparing it with randomly generated BA threshold. The pkt_count
variable name here is ambiguous and does not reflect its usage
correctly. Rename it to ba_pkt_count.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: Ib8a155dcaf133230e2e61417d730ee779e00b0d3
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202842
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209478
UPSTREAM: mwifiex: maintain outstanding packet count for RA list instead of packet size

Maintain total outstanding packet count for RA list instead of total
outstanding size as packet count metric seems more reasonable for
checking threshold etc.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I0f8103c42de06b3ad385080c6725a34fe7976b38
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202843
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209479
UPSTREAM: mwifiex: handle AMPDU supported check for AP interface

This patch fixes a bug where we were checking for AP's AMPDU param
setting even when transmitting traffic to associated station.
Patch adds provision to pass additional parameter ra_list pointer
to function which checks if AMPDU is allowed. If current BSS type is
AP, we check station's AMPDU params else we check AP's AMPDU params.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I3ae55840e9ce0088cef0898da4d74764f262ba56
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202844
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209520
UPSTREAM: mwifiex: make tos_to_tid_inv part of mwifiex_private structure

tos_to_tid_inv values are needed even during TDLS operations.
Currently tos_to_tid_inv is part of wmm.c and declared static.
Make it part of private structure so that it can be used in
other files as well.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I90b39757c4459f233918ebfca62d13650b4ef49c
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202845
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209521
UPSTREAM: mwifiex: move station list functions to common code

These functions are now needed by TDLS while managing station list.
Move them from AP related file to utility file.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I4d273df0853763bc48487768ccd823f7bbb7e146
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202846
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209522
UPSTREAM: mwifiex: cleanup in mwifiex_fill_cap_info()

Pass 'struct ieee80211_ht_cap' pointer to mwifiex_fill_cap_info()
instead of 'struct mwifiex_ie_types_htcap' pointer, because the
routine internally uses the later one.
This patch also adds WARN_ON_ONCE check for NULL band.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: Ifb04064ca423dcbb03a1fc65ad96041fc79153ba
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202847
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209523
UPSTREAM: mwifiex: add tdls_mgmt handler support

This patch adds support for TDLS management frames transmit
handler. mwifiex driver supports TDLS with external support,
i.e. expects user space application to form TDLS frames.
Same is advertised to cfg80211 during registration.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I505018e620cd5ef2c2c7893d7f41a29e150bca5f
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/205916
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209524
UPSTREAM: mwifiex: parse TDLS action frames during RX

This patch adds support for parsing TDLS action frames during station receive
handler. Peer station capabilities are stored into station node.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I6c36d14f1b5993ef2bba631c4e7a80e5b96b7a97
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202849
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209525
UPSTREAM: mwifiex: add cfg80211 tdls_oper handler support

This patch adds cfg80211 handler tdls_oper handler support to
mwifiex. Upon enable link, driver sets status as TDLS status as
setup complete and also sets AMSDU size, AMPDU params for direct
link. Upon disable link, driver issues command to FW to delete
this link in FW.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I3c23a1cd0edc0c61605a98884408e0bea4ca31a5
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202850
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209526
UPSTREAM: mwifiex: add cfg80211 add_station handler support

This patch adds cfg80211 add_station handler support for mwifiex
which is needed for TDLS setup. Driver issues create TDLS link
command to FW upon receiving add_station from cfg80211.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I5fd7d67726d714e3acc87217602e2dc2fdacfd55
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202851
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209527
UPSTREAM: mwifiex: add cfg80211 change_station handler support

This patch adds cfg80211 change_station handler support for mwifiex
which is needed for TDLS link setup. Driver creates a command to
modify peer link capabilities and issues command to FW.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: If39a4433cd513a89b23790ea7bbed79794d33aa5
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202852
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209528
UPSTREAM: mwifiex: provision for holding and restoring packets during TDLS setup

While TDLS link is being setup, few packets from this station to
peer station may be buffered at AP. It may happen that once TDLS
link is setup, packets sent from station to peer on direct link
get delivered before traffic from AP arrives at peer station.
This results into packet reordering issue at peer station.

To avoid this, we hold data packets destined to TDLS peer during
TDLS setup. These packets are moved to temperory TDLS TX queue.
Upon successful TDLS setup, they are moved to RA list created for
this peer. Upon failure, packets are moved back to AP's RA list
for that particular TID.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: Idf41bf868e25423432abc475e43a00c2a7ba3ad9
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202853
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209529
UPSTREAM: mwifiex: tdls related handling for data packets addressed to TDLS peer

1. If data packet is addressed to TDLS peer for which link is
established, mark these packets with TDLS flag so that FW can
send them on direct link instead of sending via AP.
2. If data packet is addressed to TDLS peer and TDLS setup is
underway, move these packets to TDLS queue.
3. If this packet is TDLS setup packet, do not block it.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: I74a97b8bdda377f618da20b4e7b936287617accc
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202854
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209530
UPSTREAM: mwifiex: AMPDU support for TDLS link

This patch adds AMPDU support for TDLS link. We have set 11n
capabilities including AMPDU parameters during ENABLE_LINK.
We set a variable in RA list to indicate this as TDLS link.
This patch uses these capabilities to know if AMPDU is allowed
on TDLS link and enables AMPDU aggregation for TX and RX reording
support for RA list for this peer.

BUG=chrome-os-partner:24153
TEST=With all patches in this series applied on Clapper, test TDLS functionality.
1. run wpa_cli on peer device
2. Discover TDLS peer by command
tdls_discover <Clapper WLAN mac address>
3. Setup TDLS link with clapper
tdls_setup <Clapper WLAN mac address>
4. Teardown existing TDLS link
tdls_teardown <Clapper WLAN mac address>
From Clapper, DBus command can be used to setup TDLS link as follows:
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply \
/fi/w1/wpa_supplicant1/Interfaces/0 \
fi.w1.wpa_supplicant1.Interface.TDLSSetup string:<peer-mac-address>

Change-Id: Id7ab4caae579b30b34b79a83027e51261b861232
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Tested-by: Xinmin hu <huxm@marvell.com>
Tested-by: Avinash Patil <patila@marvell.com>
Reviewed-on: https://chromium-review.googlesource.com/202855
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209531