wlan: Crash due to wrong roaming scan state.

In limSuspendLink, lim is calling init scan and even if
init scan fails it continue ahead. Now in limResumeLink
there is no check to verify that init scan failed and
thus avoid sending finish scan.

Added check in limResumeLink if scan init was
successful or not. Send finish scan only when init
scan was successful.

Change-Id: I66823acab5ceed9d7633ffd429f42074855d25eb
CRs-Fixed: 588494
wlan: wlan_hdd_cfg80211_del_pmksa error code causing infinite loop

wlan_hdd_cfg80211_del_pmksa() return an error code which causing
wpa_supplicant send_and_recv() go into infinite loop

Change-Id: I0f5305b72048d235b802d75c5b6799fef846b80a
CRs-fixed: 587500
Reset client pointer to NULL after returning from vos_mem_free()

In the PE Module resetting the pointer to NULL is done by this
commit.

Change-Id: I19699556a798c353bcecde33021d8832cc10f8cb
CRs-fixed: 586361
wlan: Runtime memory debug configuration support

Provide runtime configuration support for memory leak
debug feature using ini flag.

Change-Id: Ibca73e4d2c027ec68ab1ddd6de7c169deed0965a
CRs-Fixed: 583700
wlan: fix of kernel panic issue in SAP mode

In SAP mode batch scan un-initialized mutex is acquired which
is leading to kernel panic.

Change-Id: I054d309b8788161a1ab7749d8c0b5cac848c30fe
CRs-fixed: 590915
wlan: lim: Fix additional logging format/argument mismatches

Previously change "wlan: lim: fix logging format/argument mismatch"
fixed some instances of mismatches between format and argument in
invocations of logging APIs in the lim code.  Recent analysis has
uncovered additional mismatches, so fix them.

CRs-fixed: 570511
Change-Id: If71cdf164b36c60a9033e29ab4d8a5453c952e1d
Fix for Immediate block-ack bit not set in the capability info

Though driver supports immediate block ack, the corresponding bit
in the capability info of beacons is not set in the current driver
this commit sets the immediate block ack support bit in capability
information of beacons

Change-Id: Ib9b64c8fbdd5abae33266be4bb3a1166e4c8fcee
CRs-fixed: 579391
wlan:Sessionize WME configuration

If device in STA mode connects to an AP having WME disabled then
CSR disabling WME CFG item which is getting reflected in
SAP mode i.e WME is disabled for both modes while operating in
concurrency mode.

WME CFG item is not sessionized and it is getting used commonly
in SAP and STA mode.

As part of this change WME configuration is sessionized.

Change-Id: I3e4ec1c10ef06bb8e7597fe6e9b46725abd57657
CRs-Fixed: 573384
wlan: Measurement Duration Validation

A value of Zero for measurement duration is acceptable when scan
mode is table type(2).

Change-Id: Iec77be6d5c4fa47b2caa40324ac8ef2d2dd18ccc
CRs-Fixed: 584869
TDLS: Ensure acquisition of tdls and sme lock are independent.

Acquisition of tdls lock after sme lock would result in a
deadlock if the corresponding threads contend for each other.
Hence make the tdls lock acquisition independent of sme lock.

Change-Id: Idbf82e0a4f1ec87389b3da8207b26bd308873d97
CRs-fixed: 584668
Fix NULL pointer issues observed in static code analysis.

Updates the freed memory pointer with NULL

Change-Id: If198d5c6d412cb7e277f07bd4bb7061dd7112411
CRs-Fixed: 586361
wlan: Add adapter MAGIC checking in *_tx_fetch_packet_cbk()

A kernel panic in _list_del_entry() was observed when SoftAP was
disabled.  Root cause is that when the SoftAP function was disabled
and the pAdapter was freed, the TX Thread was blocked. When the TX
Thread subsequently unblocked, a stale pAdapter was dereferenced.  Add
adapter MAGIC checking to the *_tx_fetch_packet_cbk() functions to
prevent dereference of a stale pAdapter.

Change-Id: Ief12257ab0f89dba6acf8d86c20f526d90426d7c
CRs-fixed: 580814
wlan: Avoid connection to an already existing session.

This commit ensures to return a failure on a connection attempt to a
network with which a concurrent interface is already associated.

Change-Id: I94e2fb6091a0e2e8a915fa7041794c0b98c6d785
CRs-Fixed: 550579
wlan:HDD: Reset client ptr to NULL after returning from vos_mem_free()

Reset client pointer to NULL after returning from vos_mem_free()

Change-Id: I1ffc2cd0f3ee628129b38ed1a845f1ac8a7592ce
CRs-Fixed: 586361
TDLS : Initiate the TDLS setup only when externally configured.

There are use cases where the driver has to initiate the TDLS
setup to the peer only when configured by the external applications
This commit addresses the same and the functionality is configured
by gTDLSExternalControl parameter .

CRs-fixed: 537537
Change-Id: Ie22cf6969d498e4c1994ebdbde3eb3e5bcb00b25
TDLS: Enhance TDLS external control operations (gTDLSExternalControl=1)

This commit enhances the external control operations to

1.Allows gTDLSTxStatsPeriod to accept a minimal value of 10 msec.
2.Allows gTDLSIdlePacketThreshold to accept a minimal value of 0 packets.
3.Caters the requirement of establishing the TDLS link irrespective of
  the data traffic, the moment tdls_setup is issued by the framework.
4.Only teardown based on non-zero idle packet threshold, to address a use
    case where this threshold does not get consider for TEAR DOWN.

Change-Id: Idf5a6c5ecb72565586b21217a9c066c3ca2c83fc
CRs-fixed: 537537
TDLS: Optimize TDLS External Control operation handling.

Commit "Initiate the TDLS setup only when externally configured"
defined an additional data structure to represent a force peer.
Optimize this implementation by defining a new field isForcedPeer,
signifying a forced peer, in TDLS peer data structure (hddTdlsPeer_t).

CRs-fixed: 537537

Change-Id: Ibf55499fc648868e04a2ec9f18f5dce94fe61108
TDLS: Do not transit peer to LINK_IDLE state on a failure in tdls mgmt

Supplicant ensures to issue a DISABLE_LINK on any failure in the
transaction / transfer of tdls management frames.
Also, transitioning to the LINK_IDLE state for the peer shall also
results in failure to decrement the connected peer counts
as this is done only when the peer is in CONNECTED state.
Hence , there is no need to transit the peer to LINK_IDLE state,
rather return just a failure to the supplicant on a failed
transaction.

CRs-fixed: 579582
Change-Id: Id65ad44766b9a31eaa5deab15ff72c5726bd4edc
TDLS: Check if a peer is forced peer only when initiating setup

TDLS tear down should happen irrespective of the peer being a
forced one or not. Hence only check for the forced peer while
initiating a setup to the peer.
CRs-fixed: 576627

Change-Id: I539bd0b43dbde94223ac5f8f6d77d74bc4515c46
Revert "wlan: Non-sec wd bark due to  excessive logging"

This reverts commit 05ea1d0a68702c2a73fb72f47e5bc0ba2abb009c

due to code base discrepancy

Change-Id: Ic46bd722bff07dbb9ba8a4b344d215fff0e0b8c1