prima: Initial Kconfig and Makefile

Initial push of the prima Kconfig and Makefile to verify operation
with the remote server hosted by Code Aurora Forum
prima: WLAN Driver Release 3.1.7.9

This is the initial release of the Prima WLAN Driver
prima: Remove backup file pushed during initial commit
prima: WLAN Driver Release 3.1.7.11

Incorporate Driver Releases 3.1.7.10 and 3.1.7.11

Release 3.1.7.10

Integrate the following CLs from Perforce:

633566: Do not drop beacons or probe response ever when in scan mode
If beacons or probe response is dropped for an AP, it can take upto 10
seconds to connect to an AP as the AP will not be discovered until
next scan cycle.  There was logic to throttle/drop incomming frames
even during scan and not overhwhelm PE and VOSS Message wrappers which
was done in Gen6 days. With the new MSMs, faster processing power and
and removal of SDIO, host should be able to handle and process all
frames fast enough.  Therefore do not ever drop beacons or probe
response frames when we are in scan mode.  (CR 368500)

633567: Fix BMPS issues which prevent disconnect after missed beacon
1. In missed beacon scenario, BMPS request from PMC must not be
allowed by PE. This is because DUT has exited BMPS to probe the AP and
if probe has not completed, BMPS must not be allowed.
2. When ENTER BMPS is rejected or ENTER BMPS fails, make sure
heartbeat timer is always running. This is just a fail safe check to
ensure we do not ever land in a situation where DUT is out of BMPS and
also out of AP's range but heartbeat timer is deactivated for some
reason. If that happens, link will never be torn down and device will
always keep trying to enter BMPS unsuccessfully.
3. Introduce a new eSIR_SME_BMPS_REQ_REJECT which implies that request
is rejected by PE.  eSIR_SME_BMPS_REQ_FAILED now implies that request
was denied by Riva. This will help us in debugging.  (CR 367659)

633809: Change value of MAX_SCAN_SSID
While doing cfg80211 interface registeration with kernel, we are
filling wiphy->max_scan_ssids parameter with MAX_SCAN_SSID value
(MAX_SCAN_SSID =2). So During combo scan wpa_supplicant is not able to
send more then 2 profile to host driver. As host driver supporting 9
max ssid. MAX_SCAN_SSID has value set to 9 while registering the
cfg80211 interface.  (CR 365219)

634012, 634018, 634021, 634163: Legacy Fast Roaming Feature (CR 362782)

634148: Fix SSR race condition in cfg80211 APIs and BTAMP
cfg80211 APIs are blocked when SSR is going on; there could be various
race conditions in WLAN driver if these APIs are not blocked during
SSR. Some of them are already SSR protected, adding protection to the
missing ones. Also fixing a BTAMP race condition during SSR in softap
mode.  (CR 370064)

634185: Fuzzing Fix - Vos Packet is Freed Twice
Fix issue seen in fuzzing test case #48518 for malformed data packet -
There is a bug where if WLANTL_GetEtherType fails, the vos packet is
returned twice.  (CR 369987)

634238: Fix for Timer Leak
While unloading host driver it is showing timer leak. In rrmClose
function, it is not destroying neighborRspWaitTimer. Same way it is
not destroying txSleepTimer in hddDevTmUnregisterNotifyCallback
function. this change is going to fix both timer leak issue.  (CR
369951)

634272: Fix of kernel Panic in P2P mode after including DXE TX ring empty fi
DXE TX ring is taking more than 3 seconds in some secarios to get
cleared and becasue of this after getting DEL BSS response sessionId
is getting changed and as a side effect of this dev is comign as Null
and any access to it is leading to Kernel Panic.  (CR 370441)

634397: SME Close Session wait timeout should be more than WDI timeout
SME Close Session is timing out before getting the call back from
WDI. Increased the WLAN_WAIT_TIME_SESSIONOPENCLOSE to 15 seconds which
is more than WDI timeout (10 seconds).  (CR 368821)

634422: Port config80211 softap interfaces to Kernel 3.4
The softap config80211 interfaces are changed in Kernel 3.4, some of
the interfaces are renamed; and also a new data structures is
introduced for softap interface. So the existing WLAN driver APIs are
modified to accomadate these changes.  (CR 371516)

634858: Fix typo in sirWrapper.h Copyright
Fix typo that was uncovered during Open Source legal scan

Release 3.1.7.11

Integrate the following CLs from Perforce:

634522: Make changeCountryCode ioctl completly synchronous
Implemented completion routine and callback function to make
changeCountryCode Ioctl completely Synchronous (CR 365094)

634543: Fix typo in WCNSS version log message

634791: Do not allow the second interface for the same type.
Currently two concurrent sessions of same type are not supported. The
new additional session is causing problems to existing session. Seeing
errors like sme_OpenSession() failure, disconnecting and reconnect the
existing session, but data transfer failure etc., As two P2P sessions
are currently not supported, restrict this, at HDD level. This can be
removed once concurrent P2P CLI sessions have to be supported.

634824: Set ERP protection bit when SoftAP overlaps with 11b AP.
SoftAP is not setting ERP protection bit when 11b AP operates in same
channel as that of SoftAP. Added this 11b OBSS overlap support. After
turning off 11b AP, ERP protection bit is cleared but not "OBSS non-HT
STA" persent bit. HT protection also remained "01". We need to disable
this HT protection also while disabling ERP protection.  (CR 368189)

634825: Fix for Memory Leak
While sending scan response from LIM to SME, it allocate memory of
8000 byte length for pSirSmeScanRsp. In case where scan results are
empty (bssCount=0) LIM send eWNI_SME_SCAN_RSP message with
statusCode. After posting message it is not freeing memroy which is
allocated previously which result into memory leak for 8000 byte when
we unload driver. Now After posting message we will check if
pSirSmeScanRsp is not NULL then free allocate memory.  (CR 371901)

634850: Fix for setband and country commands which occasionally enable dualb
Added a fix to check the INI settings for band (CR 368987)

634876: Max tx power value from ini is not reflected during initial assoc
check is added to pick up the lowest of regmax, ap and ini value  (CR 367780

635070: Fix issue with iwconfig for p2p session when concurrency is enabled

635072: Fix for leting device go to IMPS when p2p_client is disconnected
In case where p2p_client is the last session to be
deleted/disconnected, what happens is that csrScanTriggerIdleScan()
fails at vos_concurrent_sessions_running(). We add further check to
see if any session is in connect state. In case there are no sessions
in connect state, it is okie to go into IMPS.

635216: Fix SoftP and P2P porting issues on Kernel 3.4
When registering with config80211 interface, Kernel 3.4 expects to
announce the capability for "remain on channel" interface. So add this
flag when WLAN driver register with cfg80211. For SoftAP when cfg80211
new station interface is invoked, Kernel 3.4 expects an additional
flag in station info, to indicate that it has filled association
request IES.
prima: WLAN Driver Release 3.2.0.1

Integrate the following CLs from Perforce:

635258: Integrate the latest Riva API

635360: Cleaning up WDI_SendMsg for WDA requests with req callbacks
1. For WDI requests which have registered a request callback, inform
the WDA caller of the same via setting the return value (wdiStatus) to
WDI_STATUS_PENDING. This makes sure that WDA doesnt end up repeating
the functonality in the req callback for the WDI_STATUS_E_FAILURE case
2. General cleanup/restructuring of WDI_SendMsg.
(CR 356091)

635425: Add support for multicast MAC address list
Provision to configure multicast MAC address list "gMCAddrListEnable"
flag and support for Multicast MAC address List.  Currently Multicast
MAC address List is not supported. Nowit is supported in Riva and Host
changes are verified. In addition to this, one ini flag
"gMCAddrListEnable" is introduced to enable this support.
  # to enable Multicast MAC address list
  # Flags to enable filter Mcast MAC address list separately
  # gMCAddrListEnable=1 to enable the support
  # gMCAddrListEnable=0 to disable the support
  gMCAddrListEnable=1
Default value 0 if not configured in ini file.  (CR 371401)

635520: Fix a possible NULL pointer dereference in SME 'get statistics'
Fix a possible NULL pointer dereference while SME processes a 'get
statistics' de-register request. (CR 368659)

636116: Support multicast MAC address list

636138 & 636161: Remove hard tabs

636159: Avoid duplicate entries in gLimMgmtFrameRegistratinQueue
__limProcessSmeRegisterMgmtFrameReq is adding entry even there is an
entry for requested mgmt frame already exists.  This is creating
problem when wlan_hdd_request_remain_on_channel function get called
back to back.  Fix- First checking whether the entry for requested
mgmt frame exists in the list; if exists then deleting the entry and
adding new entry to make sure that there wont be no duplicate entries
in the list.

636356: Avoid unwanted reset of country code after disassoc/assoc failure
After dis-association or association failure, reset the country code
only if 11d is disabled and current operating country code and default
country codes are different.  If we reset the country code, driver is
flushing the scan results and which is triggering full scan. Full scan
is taking 3-4 sec and this delay is causing connection issues in
roaming.

636724: Fix for Prefetch Abort in Vos MC Thread
Fix to not invoke WDI callback function if it is NULL (CR 370598)
prima: WLAN Driver Release 3.2.0.2

Integrate the following CLs from Perforce:

636735: Insure PMK candidate notify event only sent up to supplicant for RSN
Insure that PMK candidate notify even only sent up to supplicant for
RSN associations (CR 362782)

636761,
636770,
636789: Feature for supporting roaming to an AP with better RSSI
This feature takes care of the station to roam to a new AP only if the
roamable/new AP has a better RSSI than current AP.  A new ini item has
been added named RoamRssiDiff using which we can configure how better
in terms of Rssi, the new AP that we want to roam should be. On
providing a value of Zero, the feature is disabled and the check for
an AP with better RSSI does not happen while roaming. (CR 366355)

636834: Set rssi filter period to FT value
if CCX is disable and LFR is enabled, rssi filter period was set to 20
(default value) because of which RSSI monitoring was not effective,
changes added to set rssi filter period to FT rssi value (5) even for
LFR enabled case also. (CR 372303)

636843: isFastRoamingEnabled passed during reassoc (CR 372303)

636970: Implemented getwlandbg for SoftAP
SoftAP does not have an ioctl to print the log levels and log
info. Implemented getwlandbg for SoftAP.  (CR 374467)

636989 & 636992: Remove hard tabs and DOS line endings

637100: Fix of WDA Stop timeout kernel panic issue.
WDA stop timeout should never happen. Increasing WDA stop timeout
after considering 1 pending request and cleaning up WDI pending queues
once driver unload is trigerred.  (CR 367261)

637246: Fixed WLAN_BAPReset() to avoid sending Disassoc on STA interface.
Due to some reason(Seen just after driver load and whenever
hdd_netdev_notifier_call get called with netdevice state
NETDEV_GOING_DOWN where we call WLANBAP_DeregisterFromHCI())
WLAN_BAPReset was getting called through BSL_Write -> bslWriteFinish.
Even If the BT-AMP session is not opened(in this case
btampHandle->sessionId will be zero(default value) and if
WLAN_BAPReset is called, BAP was issueing sme_RoamDisconnect with
sessionId 0 which is station interface which results in Disassoc of
STA with AP.  Fixed the issue by checking BT-AMP session is opened or
not. (btampContext->isBapSessionOpen). If its opened then only call
sme_RoamDisconnect.

637340: SAP does not beacon on Country code to which STA is associated
(CR 368474)

637497: completed tx statistic reporting functionality
(CR 370923)

637687: Support for MC/BC & hostARPOffload with ini to work instead of ioctl
Fixes MC frames are still passed to host driver although
McastBcastFilter=1, hostArpOffload=0 (CR 363707)

637850: Fix for SAP Auto Channel Selection feature
For SAP auto channel selection, WLAN host driver do scan to find less
noise channel. While performaing scan do not check for Active session
in CSR module and change CSR roam state to eCSR_ROAMING_STATE_SCANNING
state for scan command irrespective of session is active or not.  (CR
375829)

638022: Fix for CCX-STA to connect to CCKM-RSN AP
because of the incorrect if-else-if authentication type overwritten to
255 (CR 376930)

638142-638147: Fix compilation warnings caused by GCC -Wenum-compare
Recent versions of the GCC compiler include an "enum-compare" warning
which will emit a warning when an enum of one type is compared with an
enum of a different type.  The compiler has found occurrences of this
issue in the WLAN code.  Fix those issues such that enum comparisons
are restricted to enums of the same enumerated type.

638253: Implemented getAutoChannel ioctl for SoftAP
SoftAP does not have an ioctl to get auto channel. Implemented
getAutoChannel for SoftAP and fixed getchannel ioctl for softap (CR
369147)

638267: Fix GCC 4.6 compile failure in WDI due to inlining failure
WDI_GET_PAL_CTX() was defined to be an inline function, but the
function body was not available to the compilation units that refer to
it.  Other versions of the compiler have silently ignored this, but
GCC-4.6 is emitting an error "sorry, unimplemented: inlining failed in
call to 'WDI_GET_PAL_CTX': function body not available".  So we remove
the unnecessary "inline" directive from the definition of
WDI_GET_PAL_CTX().

638291: Fix WLAN suspended flag
If WLAN driver suspend fails becuase of a TX, RX or MC thread suspend
timeout, the suspended flag is not reset. So set the suspended flag
only after all three threads are suspended successfully.  (CR 375230)

638703: Disabling AMP flag
Disabling AMP flag from config file, so that we don't register with
HCI any more as BT AMP is not PORed (CR 375826)
prima: WLAN Driver Release 3.2.0.9
prima: WLAN Driver Release 3.2.0.10
wlan: Fix 10th station is unable to connect when in SAP mode

Fixes: In SAP mode, while doing change interface from Station to SoftAP,
we are removing the p2p0 interface.

Change-Id: I0a82a79632208659a497c5af2e405fec1c9f251d
CRs-Fixed: 382752
wlan: Fix for passing proper reason code to supplicant

Passing reason code to supplicant based on reason code which
received during deauth frame.

Change-Id: I03fc84cd2b1c3ce92d4a3f5542c237cfbb8465a4
CRs-Fixed: 394441
wlan: Fix for crash in wlan_hdd_cfg80211_connect

In connect request params, chan may be NULL.
Added sanity check before accessing variable.

Change-Id: Ie64a16155b0aedb0891d10e3aba05a211fb02db6
CRs-Fixed: 397166
wlan: Fix for crash during wlan unloading.

Scan request can receive during unloading in progress.
So added check before proceesing scan request whether
unloading in progress or not.

Change-Id: I13f8efb26e0206007ee8c98943238e8ed8e4c5f5
CRs-Fixed: 393218
wlan: Change number of descriptors for Low and High to 256.

The number of descriptors for high priority channel is 40 where as low
priority channel is 512.
We noticed that the voice traffic starve when we run multiple streams.

Change-Id: I69e280949f16f5aee4bf8b2874b70ccd2ac2ae24
CRs-Fixed: 383623
wlan: Parsing the OpertingMode IE as a part of Assoc Req

Fixes: Parsing the OpertingMode IE as a part of Assoc Req and setting
corresponding chanwidth

Change-Id: Idaca52b97c80bf0b6647481ebd67394745fd01c8
CRs-Fixed: 395634
wlan: Extended Capability and VHT Opmode support

Change-Id: I12e1941adb86d6d6f3ad6863e2938dbfe6054264
CRs-Fixed: 395644, 395645
wlan: Fix clearFeatCaps to clear the correct bit

Change-Id: Ie5d8d3da42085597a9fc183f24fbe9699408c349
wlan: Changes related to BMPS workaround enable/disable dynamically

Changes related to BMPS workaround en/disable dynamically based on SLM
feature capability flag

Change-Id: Ib35219c99255651f5532a6cb444aab39be34956a
wlan: host driver logging improvements

Made changes to enable ERROR logging levels for all modules, changed the
levels of some logs so the kmsg ring buffer is not flooded (Part 1)

Change-Id: I9cb869ba88c31f4a57e5fa6e24b5ba0098c60ca4
CRs-Fixed: 379947
wlan: Fix to avoid sleep in invalid context.

GFP_KERNEL flag passed for kmalloc in hdd_wmm_acquire_access(), sleeps
in invalid context. Hence GFP_KERNEL flag is changed to GFP_ATOMIC.

Change-Id: I423a84b6c64fe4258c44a5ec37061eb3298d5168
CRs-Fixed: 396311
wlan: MCC GO+STA different B.I

Fixes: Add one qcom_cfg.ini item and override SME concurrency policy
check
MCC: Add gAllowMCCGODiffBI paramter in qcom_cfg.ini to accept different
beacon interval than STA's. This is mainly to pass Wi-Fi Cert. 5.1.12
only. Usually different B.I GO+STA is not handled very well by
RIVA firmware at this point, so do not turn on this excpet Wi-Fi
cert. purpose.

Change-Id: Ia7d425670d6495d713ca6a7e92fa4c09508c4ef1
CRs-Fixed: 392112