Revert "Merged PM Driver Updates from Aurora 3.5 thanks @neobuddy89 for TIP."

This reverts commit 3edc3af35313b845322620acff44613ee65e7f7a.
Revert "msm: lpm_levels: remove rpm handshake in l2_gdhs mode"

This reverts commit 990b4924641d9993e6016dd661a94aeb8428ed09.
Disable WIFI Driver Debug. works good no need to debug.

Thanks neobuddy89
WIFI: much better solution for POWERSUSPEND by neobuddy89 Thanks.

https://github.com/neobuddy89/hammerhead_kernel_caf/commit/a1db37deb691db016ce06349b13802a2c16bd515
net: wireless: bcmdhd: Fix Batch scan get bug

Legacy Batch scan code would issue mutex unlock w/o a lock

bug: 17021370

Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

https://github.com/neobuddy89/hammerhead_kernel_caf/commit/e26e9d653532621f009d3ef1a0e5b7f07da59713

Dorimanx:
finnaly this shit is fixed! :)
WIFI: bcmdhd: fix p2p interface and wlan0 assoc race

Do not allow virtual p2p interface creation while the AP
driver status is CONNECTING

Bug 200009241
Bug 200009346
Bug 200009344
Bug 200009328

Signed-off-by: bibhayr <bibhayr@nvidia.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
net: wireless: bcmdhd: Add support for hidden ssid PNO scan

Changes to support hidden ssid config to be sent to FW. Earlier
all ssids were hard coded as hidden, now only those indicated
as such by supplicant will be.

Change-Id: I927030fe12f162c52c93277b2ebfb4bf55daef4a
Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>

https://www.codeaurora.org/cgit/quic/la/kernel/msm/commit/?h=aosp-common/android-3.4&id=c4651bd65550ab73d9027935acec7a25515263ff
net: wireless: bcmdhd: Disable OOB interrupt when WLAN is off

b/17446901 Change-Id: I99069c584fa7279b8bd5a61d64ce27764edbd1d8

Signed-off-by: Ritter Yeh <ryeh@broadcom.com>
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

https://www.codeaurora.org/cgit/quic/la/kernel/msm/commit/?h=aosp-common/android-3.4&id=acddfe97de2ccf22d05ccc944469a16e7308ac7a
WIFI DRIVER: multy commit update from Nexus 5 WIFI driver. TNX @neobuddy89

 net: wireless: bcmdhd: add GSCAN Support

add GSCAN code in DHD 1.88 v2 (r)
Signed-off-by: Ecco park <eccopark@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/ac4fac16133553f7ead9be5d21f417e0a9974724#diff-77bc7e0951553856d3a11f2dfb4e73feR69

 net: wireless: bcmdhd: Fixed Coverity issue.

Signed-off-by: Ecco Park <eccopark@broadcom.com>
https://github.com/neobuddy89/hammerhead/commit/5a742d1c2b36da9c5a5e9a3432979b092b7c5991

 net: wireless: bcmdhd: Add support for hidden SSID in PNO

1. Hidden SSID support for PNO
2. Gscan Hotlist LOST event now enabled
3. Support for Get feature list/matrix command

Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/ebce1c4a8db4c2d4a3c4dfd848fee6296b5c0052

 net: wireless: bcmdhd: Added support for get ch list

Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/848835cbb2b24a9facc4f8227038d2259a0c1fb9

 net: wireless: bcmdhd: Changed sync mechanism for batch get

1. Changed sync mechanism for batch scan results get
   because of a race condition with wait_for_completion
2. Misc fixes for running legacy PNO ssid scan with gscan

Bug: 17071068 Deadlock on rtnl_lock

Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/919df534d1e0043f601d2cdcea8433ce7439718c

 net: wireless: bcmdhd: fix hang in wifi_get_cached_gscan_results

Bug: 15144213

Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/5ff0082f8ef53a4861bedd1d0867c18f97712d8c

 net: wireless: bcmdhd: Gscan v3 and bug fixes

Bug: 15085610

Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/5d644ab2ff4fd270fe4b5819a347798641d43729

 net: wireless: bcmdhd: Use systime for scan result ts

Earlier relative time (ms) was being used.

Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/923f3effecc1518630086e6a9e6252244d50567c

 net: wireless: bcmdhd: Fix batch scan timing out

Removed wait and sleep code from batch scan get result function (when
scan was ongoing in the FW) which resulted in HAL timing out.

Bug: 17048507

Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/74bba7ffcad23a2431f5712ba996efe83895b95d

 net: wireless: bcmdhd: 15395235 16510235 & 16803503 fixes

1. Enable FW roaming during suspend
2. Added support for asynchronous batch scan results get
3. Fixed chanspec to channel conversion in full scan result

Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/ea6f2df49be07da21f87466d11e4b228b30f8af4

 net: wireless: bcmdhd: Set KSO enable sleep to 5ms

Signed-off-by: Ecco park <eccopark@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/f5e61f065233d5a29d639d145e85d5289c98b56e

 net: wireless: bcmdhd: Add Link Layer Statistics support

Signed-off-by: Chilam Ng <chilam@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
https://github.com/neobuddy89/hammerhead/commit/5c2c57b1e75c343d2ad45d6015046aa7ed60501f

 net: wireless: bcmdhd: Update to Version 1.88.10

Change-Id: I0e41b9af42120286b99d23acdf52fd19997a267e
Signed-off-by: Kyunghoe Kim <kyunghoe.kim@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
https://github.com/neobuddy89/hammerhead/commit/2c62a17adfafdf7430c9ac5c04b18c436e17b142
Dorimanx Note: took only the OSL updates for BCMDBG_CTRACE

 net: wireless: bcmdhd: Fix WL_SCHED_SCAN compilation

Change-Id: I44f57cc63377c4009aafb4028970a9af43944241
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
https://github.com/neobuddy89/hammerhead/commit/62b584ca24c67586ad5f0af2b6fc69f678ee98d3
cfg80211: pass station supported channel and oper class info

The information of the peer's supported channels and supported operating
classes are required for the driver to perform TDLS off channel
operations. This commit enhances the function nl80211_(new)set_station
to pass this information of the peer to the driver.

CRs-fixed: 595620
Change-Id: I1d630deb4cf435e7f72e3a59276d3771c2b03114
Signed-off-by: Naresh Jayaram <njayar@codeaurora.org>
nl80211: vendor command support

Add support for vendor-specific commands to nl80211. This is
intended to be used for really vendor-specific functionality
that can't be implemented in a generic fashion for any reason.
It's *NOT* intended to be used for any normal/generic feature
or any optimisations that could be implemented across drivers.
Currently, only vendor commands (with replies) are supported,
no dump operations or vendor-specific notifications.
Also add a function wdev_to_ieee80211_vif() to mac80211 which
is needed for mac80211-based drivers wanting to implement any
vendor commands.

Change-Id: If73cf90d152ca0888a563cf4ae685aad9cec6443
CRs-fixed: 576020
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: ad7e718c9b4f717823fd920a0103f7b0fb06183f
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/linville/wireless-next.git
Signed-off-by: Leo Chang <leochang@codeaurora.org>
nl80211: support vendor-specific events

In addition to vendor-specific commands, also support vendor-specific
events. These must be registered with cfg80211 before they can be used.
They're also advertised in nl80211 in the wiphy information so that
userspace knows can be expected. The events themselves are sent on a
new multicast group called "vendor".

Change-Id: I184aaa9f9e8461aee572f7d0a35916cd668c2218
CRs-fixed: 576020
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 567ffc3509b2d3f965a49a18631d3da7f9a96d4f
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/linville/wireless-next.git
Signed-off-by: Leo Chang <leochang@codeaurora.org>
net: wireless: apply cfg80211 vendor command

Apply cfg80211 vendor patch for L-release development

[neo: This patch is modified to merge only required parts.]

Signed-off-by: broadcom <eccopark@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
nl80211: Correct the usage of command NL80211_CMD_VENDOR

Assign/pass the cur_cmd_info parameter correctly. This fixes a
merge error when open source commit
ad7e718c9b4f717823fd920a0103f7b0fb06183f was pulled into the tree.

Signed-off-by: Sunil Dutt <usdutt@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cfg80211: unblock user hint when cfg80211_regdom is intersected

If the driver is loaded when cfg80211_regdom is intersected then
user hint will fail for the first time since cfg80211 does not
have a check to see if cfg80211_regdom is intersected. Add
a check to see if cf80211_regdom is intersected and allow the
user hint to be processed.

Change-Id: Iba9cdd32470e29d35d3bb35012eb404b7c78d601
CRs-Fixed: 639538
Signed-off-by: Mihir Shete <smihir@codeaurora.org>
cfg80211: Add support for QoS mapping

This allows QoS mapping from external networks to be implemented as
defined in IEEE Std 802.11-2012, 10.24.9. APs can use this to advertise
DSCP ranges and exceptions for mapping frames to a specific UP over
Wi-Fi.

The payload of the QoS Map Set element (IEEE Std 802.11-2012, 8.4.2.97)
is sent to the driver through the new NL80211_ATTR_QOS_MAP attribute to
configure the local behavior either on the AP (based on local
configuration) or on a station (based on information received from the
AP).

CRs-fixed: 650927
Change-Id: I72ab05c7aa98528b05f6278df192cc25358c2666
Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: fa9ffc745610f31c6bc136d5a6a1782e00870e72
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
[ppotte@codeaurora.org: manually solved merge conflicts]
Signed-off-by: Pradeep Reddy POTTETI <ppotte@codeaurora.org>
cfg80211: Allow BSS hint to be provided for connect

This clarifies the expected driver behavior on the older
NL80211_ATTR_MAC and NL80211_ATTR_WIPHY_FREQ attributes and adds a new
set of similar attributes with _HINT postfix to enable use of a
recommendation of the initial BSS to choose. This can be helpful for
some drivers that can avoid an additional full scan on connection
request if the information is provided to them (user space tools like
wpa_supplicant already has that information available based on earlier
scans).

In addition, this can be used to get more expected behavior for cases
where a specific BSS should be picked first based on operations like
Interworking network selection or WPS. These cases were already easily
addressed with drivers that leave BSS selection to user space, but there
was no convenient way to do this with drivers that take care of BSS
selection internally without using the NL80211_ATTR_MAC which is not
really desired since it is needed for other purposes to force the
association to remain with the same BSS.

CRs-Fixed: 650927
Change-Id: I882d4b94b90f270907df0e53c360d69f3c984fb8
Signed-off-by: Jouni Malinen <j@w1.fi>
[add const, fix policy]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 1df4a51082df6e5b0b8eb70df81885b9b4c9e6ec
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
Signed-off-by: Pradeep Reddy POTTETI <ppotte@codeaurora.org>
cfg80211: Advertise maximum associated STAs in AP mode

This allows drivers to advertise the maximum number of associated
stations they support in AP mode (including P2P GO). User space
applications can use this for cleaner way of handling the limit (e.g.,
hostapd rejecting IEEE 802.11 authentication without manual
configuration of the limit) or to figure out what type of use cases can
be executed with multiple devices before trying and failing.

CRs-Fixed: 650927
Change-Id: I73a078800d8da28c9699cc02e7d4142691107811
Signed-off-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: b43504cf75b8b8773ee70c90bcd691282e151b9a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
[ppotte@codeaurora.org: manually solved merge conflicts]
Signed-off-by: Pradeep Reddy POTTETI <ppotte@codeaurora.org>

Conflicts:
	include/net/cfg80211.h
cfg80211: Pass TDLS peer capability information in tdls_mgmt

While framing the TDLS Setup Confirmation frame, the driver needs to
know if the TDLS peer is VHT/HT/WMM capable and thus shall construct
the VHT/HT operation / WMM parameter elements accordingly. Supplicant
determines if the TDLS peer is VHT/HT/WMM capable based on the
presence of the respective IEs in the received TDLS Setup Response frame.

The host driver should not need to parse the received TDLS Response
frame and thus, should be able to rely on the supplicant to indicate
the capability of the peer through additional flags while transmitting
the TDLS Setup Confirmation frame through tdls_mgmt operations.

CRs-Fixed: 650927
Change-Id: I6e37ff671aa39b27cd22fa8af0b6a1a3b33a64db
[ppotte@codeaurora.org: manually solved merge conflicts]
Signed-off-by: Pradeep Reddy POTTETI <ppotte@codeaurora.org>
mac80211: implement HS2.0 gratuitous ARP/unsolicited NA dropping

Taking the gratuitous ARP/unsolicited NA detection code from
mwifiex (but fixing it up to not have read-after-skb-end bugs),
implement the ability for userspace to request the behaviour
required by HS2.0 to drop gratuitous ARP and unsolicited NA
frames when proxy ARP service is enabled on the AP. Since this
behaviour is only mandatory for HS2.0 and may not always be
desired, make it optional - modify cfg80211/nl80211 for that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: be9efdecf8ecdcc6d2221845482e7359b33a603b
Git-repo : git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
Change-Id: I1e4083a2327c121073226aa6b75bb6b5b97cec00
CRs-fixed: 621827
[akholaif@codeaurora.org: only picked up the declaration
 and definition of cfg80211_is_gratuitous_arp_unsolicited_na()]
Signed-off-by: Ahmad Kholaif <akholaif@codeaurora.org>