Commit Graph

2262 Commits

Author SHA1 Message Date
Abhishek Ambure
f15c50bad1 qcacld-3.0: Restore default RSO values after STA disconnect
Restore default RSO values after STA disconnect.

Change-Id: I6b230b5a8e00449955d641b440f12925340ca0df
CRs-Fixed: 2605336
2020-01-22 19:22:45 -08:00
Srinivas Dasari
a73e5f5dee qcacld-3.0: Clear static, dynamic roam channels on NCHO disable
For NCHO disable, clear static and dynamic channels from roam scan
list in driver and firmware.

Change-Id: I24bca4dfb34895b4e86455dea40764af163544f1
CRs-Fixed: 2605299
2020-01-22 10:57:51 -08:00
Vevek Venkatesan
2d88a6bc30 qcacld-3.0: cdp: Converge cdp_peer_ops
Currently cdp ops are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev_id or vdev_id or peer mac address,
which will be used to get the respective handles,
and hence avoiding the unwanted access of the
handles if it has been deleted.

Also remove the ops which are used to store
and retrieve such handles, that no more needed.

- register_peer
- clear_peer
- change_peer_state
- peer_get_ref_by_addr
- peer_release_ref
- peer_state_update
- get_vdev_by_sta_id
- register_ocb_peer
- get_peer_state
- get_vdev_for_peer
- update_ibss_add_peer_num_of_vdev
- remove_peers_for_vdev
- remove_peers_for_vdev_no_lock
- copy_mac_addr_raw
- add_last_real_peer
- is_vdev_restore_last_peer
- update_last_real_peer
- peer_detach_force_delete

Change-Id: I5134ca882f5fcf0e5941317e48712717eddb58fe
CRs-Fixed: 2541708
2020-01-22 02:45:32 -08:00
bings
32e066d5bf qcacld-3.0: follow ref-ap edca if ref-ap and sta intersection is 11ax
If ref-ap and sta are both support 11ax mode, make sta edca follow ref-ap.

Change-Id: I707409d242ec6f91bbf6620862120747d697af92
CRs-Fixed: 2600718
2020-01-17 18:23:32 -08:00
Abhishek Singh
bda14831fa qcacld-3.0: Remove unused code for defer key
As setFTPTKState is never set to true the code for defer
key is not been used

Change-Id: I8afcebf00b00bcf39ba7da999c55e5eacdf26aaa
CRs-Fixed: 2604329
2020-01-16 15:46:48 -08:00
Alan Chen
9fcd4d39f9 qcacld-3.0: Fix remaining compilation issues regarding WLAN_FEATURE_11W
When CONFIG_WLAN_FEATURE_11W is disabled, compilation of lahaina still fails
in a few areas. Even though CONFIG_WLAN_FEATURE_11W should be always be
enabled now, add appropriate fixes for the compilation issues in the event
that CONFIG_WLAN_FEATURE_11W is disabled.

Change-Id: I1743678df6b66a63160795374de7969f313f55d9
CRs-Fixed: 2601362
2020-01-15 04:43:08 -08:00
Liangwei Dong
c1956bd4cb qcacld-3.0: Handle 6Ghz channel switch
Always use ECSA for STA/SAP channel switch between 6GHz band and
other 2Ghz or 5Ghz band since operating class is required to identify
an unique channel together with channel number in IE.
Change channel switch APIs to use frequency.

Change-Id: Ie655ae88b5223a3213146cb2684a70f91cdd5b04
CRs-Fixed: 2600136
2020-01-12 18:57:55 -08:00
Jianmin Zhu
7ff7fe7d37 qcacld-3.0: Some AP are missed in Beacon Report response
In radio measurement beacon report frame,  The BSSID field
indicates the BSSID of the BSS(s) for which a beacon report is
requested. When requesting beacon reports for all BSSs on the
channel, the BSSID field contains the wildcard BSSID; otherwise
the BSSID field contains a specific BSSID for a single BSS.

If BSSID is wildcard BSSID, bssid num should be 0 when use fill
scan result filter, or filtered scan result is always empty
since wildcard BSSID can't match any normal bssid.

Change-Id: Ia172ac8160d0c38ce4c875fc29458c6c8f26c804
CRs-Fixed: 2599634
2020-01-11 13:56:06 -08:00
Amruta Kulkarni
e673511908 qcacld-3.0: Change info/err prints to debug in roaming path
In roaming path, while processing roam synch indication info/err
prints at the driver adds up latency to the total roaming
transition time and the KPI for maximum transition time exceeds
the expected 100ms. The printk buffer is protected by a global
raw spinlock for readers and writers. This restricts the contexts that
are allowed to access the buffer. So large latencies exists when
printing to kmsg done with QDF trace levels WARN, INFO, ERROR.

Change the redundant/less significant info, error, warn level
prints in roaming path to debug level.

Change-Id: I8e2a03ddef8f3cd680263939f6e0275b8703e681
CRs-Fixed: 2597624
2020-01-08 20:10:31 -08:00
Yue Ma
b49b7fedc5 qcacld-3.0: Cleanup CRYPTO_SET_KEY_CONVERGED for SME layer
CRYPTO_SET_KEY_CONVERGED is a temporary flag which is used for
converged crypto component transition. The transition has already
been done, so cleanup legacy code related to the flag in SME layer.

Change-Id: Iff9ba19887caaa39f43cb58d519a14cf6e759d59
CRs-fixed: 2593523
2020-01-08 11:30:50 -08:00
Yue Ma
d03d10bcd1 qcacld-3.0: Cleanup WLAN_CONV_CRYPTO_IE_SUPPORT flag
WLAN_CONV_CRYPTO_IE_SUPPORT is a temporary flag which is used for
converged crypto component transition. The transition has already
been done, so cleanup legacy code related to the flag.

Change-Id: Ide9fa97a9eb0b5c197c762205f386651efc51e33
CRs-fixed: 2592096
2020-01-08 11:30:05 -08:00
Pragaspathi Thilagaraj
9cece7211d qcacld-3.0: Send PER config command before WMI_ROAM_SCAN_MODE command
The host driver sends WMI_ROAM_PER_CONFIG_CMDID command after
WMI_ROAM_SCAN_MODE as part of RSO start/update. But the
expectation from firmware is that host should send this after
WMI_VDEV_PARAM_ROAM_FW_OFFLOAD but before WMI_ROAM_SCAN_MODE.
Also the WMI_VDEV_PARAM_ROAM_FW_OFFLOAD is sent after set key
response from csr->lim->wma->wmi. But the
WMI_ROAM_PER_CONFIG_CMDID is directly posted wma (csr->wma->wmi)
which can cause this command to go before the
WMI_VDEV_PARAM_ROAM_FW_OFFLOAD is sent to firmware.
One more instance where the WMI_ROAM_PER_CONFIG_CMDID can go
before vdev roam fw offload init is if the userspace sends
blacklist update command before offload init happens.

So route the WMI_ROAM_PER_CONFIG_CMDID via lim before posting
it to wma and add changes in rso update config to block the
blacklist command being sent in ROAM_DEINIT state.
Also Call csr_roam_offload_per_scan before csr_roam_send_rso_cmd
in csr_roam_offload_scan to send WMI_ROAM_PER_CONFIG_CMDID before
WMI_ROAM_SCAN_MODE.

Change-Id: I2600cfeafcc3e3ebfac6694c1f2cdb5df0366411
CRs-Fixed: 2596257
2020-01-08 07:49:45 -08:00
Pankaj Singh
dc48e39e8d qcacld-3.0: Fix uapsd auto trigger command failing after addts
Modify sme_enable_sta_ps_check() to take power save mode
parameter as new argument.During certification WMMAC test
cases failed due to recent change of saving user power save
configuration. The uapsd auto trigger cmd could not be send
due to user power save configuration.

Apply the user power save configuration in conjunction with
power save mode.

Change-Id: I79bdfc3f4d168df23415bfb3418913de7a45886a
CRs-Fixed: 2592560
2020-01-08 04:52:24 -08:00
gaurank kathpalia
570f0aff4f qcacld-3.0: Fix issue for SMM before vdev start on 2.4ghz
Scenario:-
1. Turn on SAP and STA on 2.4ghz and 5ghz
2. Turn off SAP
3. Turn off STA
4. Turn on SAP on 2.4ghz

Issue:-
In the start ap function, the driver calls
the stop opportunistic timer and calls the handler
to goto SMM mode.
After this, the SAP checks whether it requires the
DBS or not and then requests for DBS also, but since
the driver is already in DBS mode this command gets
rejected, so there would be 2 commands in the serialization
queue which would be SMM and start AP, which would lead to
a crash as SMM is sent before a connection on 2.4ghz as
Hastings is not capable to start a vdev in 2.4ghz without
DBS mode.

Fix:-
1.Not allow SMM if the current connection requires DBS
2. Check the HW capabilty in the active command only and
not before that to protect the reliability of hw mode.

Change-Id: I1c0c05ea05ba14d1556af2612daa3de2ffcba367
CRs-Fixed: 2587508
2020-01-08 02:03:40 -08:00
Liangwei Dong
5f8906d29f qcacld-3.0: Fix unknown phymode in vdev start
If gDot11Mode=1 is set to INI, DUT STA will be failed to
connect to 5G AP due to "unknown phymode" included in
vdev start.
Correct the driver to use freq API to identify 5G band
BSS instead of channel API.
And the change forces 11ax mode for 6ghz bss.

Change-Id: I692fa744756490e7125ccd5fd82c15febc19ce68
CRs-Fixed: 2594048
2020-01-03 12:20:19 -08:00
sheenam monga
10b9a7ff27 qcacld-3.0: Send RSO update after roaming to a whitelist SSID
When roaming to  whitelist SSID, firmware offloads
EAPOL 4-way HS to supplicant. Suppose initially if DUT connects
to SSID1 and then firmware roams to SSID2 then 4-way HS should be
offloaded to supplicant as the firmware doesn't posses the
pre-shared key. When roaming happens between same SSID, then
firmware has PSK and 4-way handshake is taken care by firmware.

But due to issue in roaming code, 4-way HS is offloaded to supplicant
even if roam happens between same SSID. Issue is for ROAM_RSO_STARTED
state in csr_roam_switch_to_rso_start API, there is no handling to send
RSO update if Roaming is already started, due to which
csr_roam_offload_scan is not invoked.
Second issue in roaming code is that RSO is not enabled with the
new SSID2 in firmware. RSO is not enabled as after set key
complete the state of roaming state was not set to
eCSR_NEIGHBOR_ROAM_STATE_INIT. Due to this the SSID in
firmware is still SSID1 and when firmware tries to roam again
to SSID2 it offloads 4-way HS to supplicant instead of handling
within firmware only.

Fix is to update the roam state from eCSR_NEIGHBOR_ROAM_STATE_CONNECTED
to eCSR_NEIGHBOR_ROAM_STATE_INIT in csr_process_roam_sync_callback after
roam synch propagation and also handle ROAM_RSO_STARTED state with
roam_command ROAM_SCAN_OFFLOAD_UPDATE_CFG instead of returing success from
csr_roam_switch_to_rso_start API. Now when supplicant does set key after
4-way HS, roaming is enabled via csr_roam_chk_lnk_set_ctx_rsp->
csr_roam_link_up->csr_neighbor_roam_indicate_connect->
csr_neighbor_roam_info_ctx_init->csr_post_roam_state_change.

Change-Id: I5b81f2e03fe1c7dee2820370d06f4e4f8017f12c
CRs-Fixed: 2587120
2020-01-03 06:26:06 -08:00
Alan Chen
e37ba25faa qcacld-3.0: Change wlan vdev log level from error error to debug
After removing alarms, suspend failures are still seen saying that
linux is failing to freeze tasks. This is because there is an error
log message that indicates that at the time of suspend, there was no
active wlan vdev since the DUT is also in airplane mode. Thus, change
the log message level from error to debug.

Change-Id: I7ef0f0d9cf6eab26e53f62a176fc771e862b8ccd
CRs-Fixed: 2594922
2019-12-30 22:30:42 -08:00
Liangwei Dong
10054b9f9e qcacld-3.0: Channel to Freq conversion for channel overlap API
Use frequency as parameter for channel overlap handling
APIs - csr_check_concurrent_channel_overlap,
csr_calc_chb_for_sap_phymode, csr_get_ch_from_ht_profile,
csr_handle_conc_chnl_overlap_for_sap_go.

Change-Id: Ie3c9d466f21d7313998328432c063b1f6c7e5d0f
CRs-Fixed: 2577706
2019-12-23 09:35:06 -08:00
Sandeep Puligilla
a6b845d2c8 qcacld-3.0: Force STA connection in VHT
Force STA connection in VHT mode if AP HE adveritised rates
does not match with STA supported HE rates

Change-Id: Ia691a66ad4a2d2d2d59e07d07104e6771c6e4a84
CRs-Fixed: 2580041
2019-12-22 23:50:15 -08:00
Pragaspathi Thilagaraj
1e30b6ac29 qcacld-3.0: Clear Country code information after roaming
The connected profile in csr_roam_session is filled after join
success with an AP in csr_roam_process_join_res(). The connected
profile information also has the country code advertised by the
AP over its beacon in the Country Element (EID 7). When STA
roams from AP1 having country IE to AP1 which doesn't have
country IE, the driver checks if the country IE is present in
the AP2 beacon IEs. If the country code is present, new value is
copied, else the older country code value is not cleared.
This results in beacon report failure when roamed to AP2 due
to country code and op class mismatch.

Clear the country code in connected profile before checking if the
country code IE is present.

Change-Id: I503f9761ff33fb245a25b23893360389d7a0b258
CRs-Fixed: 2590117
2019-12-21 21:12:00 -08:00
Ashish Kumar Dhanotiya
d8d7dead7d qcacld-3.0: Add support for oem data event
Currently use of comamnd QCA_NL80211_VENDOR_SUBCMD_OEM_DATA
is to pass data blobs from Application to FW but there is
no mechanism to send the data blobs from FW to Application.

To meet the above requirement update the usage of existing
OEM DATA command to use it as a vendor event as well to
send data blob from host to Application.

Change-Id: I502312f25d2754984b86e1cc4e011800a5d4b58a
CRs-Fixed: 2573464
2019-12-17 14:09:53 -08:00
Pragaspathi Thilagaraj
376ead97d5 qcacld-3.0: Add MBO IE for Open auth connection
The host driver checks the peer PMF capability
before adding MBO IE. But for open authentication
AP, the peer will not advertise PMF capability.
So while connecting to open mode AP, the MBO IE
doesn't get added in the association request frames.

Check if the authentication algorithm is open.
If the authentication algorithm is open don't
check for peer pmf capability to add MBO IE.

Change-Id: Ieae85ce696a40234535388a548906dc9521b19a0
CRs-Fixed: 2584527
2019-12-14 14:13:14 -08:00
Pankaj Singh
f84a5dd718 qcacld-3.0: Fix connection latency situation in driver
In 11D scan procedure if WMI_11D_NEW_COUNTRY_EVENTID event is
received, host processes 11d new country code event.
Host driver as a response sends WMI_SCAN_CHAN_LIST_CMDID
new channel list cmd to firmware.

As a result the ongoing scan procedure is aborted by firmware,
and if the scan was a first scan for connection, then it would
lead to connection latency as the supplicant then have to
scan again.

Fix is to check if any scan is in progress, then delay
WMI_SCAN_CHAN_LIST_CMDID channel list command to FW till
the current scan is complete.

Change-Id: I4e747bb747c32430b5d8024823aa0df4928a8c71
CRs-Fixed: 2569741
2019-12-14 04:04:25 -08:00
wadesong
fbf576a8fa qcacld-3.0: Convert CSR legacy channel ID usage
Remove wlan_reg_freq_to_chan within function
csr_update_op_class_array and use channel frequencies
directly to retrieve opclass.

To utilize the new channel frequency function,
regional opclass table will be used unconditionally,
given no OTA packets' country IEs will be populated
here(and thus no need to carry global opclass).

Change-Id: Ida9831e7e74223455089770744222185ae3cb1d3
CRs-Fixed: 2576285
2019-12-13 14:11:30 -08:00
Abhinav Kumar
d83a689ba1 qcacld-3.0: Send pause indication to upper layer for proper vdev
While processing BEACON_REPORTING_ACTIVE_REPORTING vendor command
on a particular STA (say its vdevid == 0), If scan started on any
interfaces (for example, on same STA (with vdev id == 0) or P2P
(with vdev id == 1) or on second STA (with vdev id == 1) of
STA + STA), Host should send a pause indication to upper layer only
for the vdev id(s) (here vdev id == 0) on which host processing
BEACON_REPORTING vendor command comes from user space.

Add sanity check to make sure that HOST should send pause
indication to upper layer only for vdev of STA for which host
processing BEACON_REPORTING vendor command at the moment.

Change-Id: I5ed5dc42e4dded2a803349d75234b84d3aa7f314
CRs-Fixed: 2582389
2019-12-11 14:55:32 -08:00
Abhishek Singh
4f134e2ff7 qcacld-3.0: Cleanup unused legacy crypto api of csr
Cleanup unused legacy crypto api of csr.

Change-Id: I68cd35d8a72fbea675a34d9894563bf83e1fed8a
CRs-Fixed: 2583679
2019-12-11 03:21:03 -08:00
Liangwei Dong
2b0c18bde9 qcacld-3.0: Update 6GHz ch_width based on peer HE IE
In 6GHz BSS, the VHT and HT IE are not present and only
HE IE is present. Driver needs to update ch_width to peer
struct based on HE IE if vht and HT is not supported.

Change-Id: Ib48dc63f972cfc040b40c3dbf53a4c46f9e95eee
CRs-Fixed: 2583249
2019-12-11 03:20:50 -08:00
Jayachandran Sreekumaran
0eede6b342 qcacld-3.0: Remove the completed roam command from active queue
If hardware mode change is required during roaming, then
the roam command to disassoc from the current ap remains in the
active queue until SME receives hw_mode_res. Due to which the
SME requests for hardware mode switch and nss update are not
able to get queued into the active queue. Hence LFR2.0 roaming
fails to proceed after disassoc completion.

Removed the completed roam command from active queue.

Change-Id: I5f244ddba88cbb8af3a34e6f78b9b664ca009666
CRs-Fixed: 2576362
2019-12-10 00:50:32 -08:00
Abhishek Ambure
3d18b4c831 qcacld-3.0: Add max index check for dscp_to_up_map array
In SME layer, boundary check for dscp_to_up_map array is not present.

The dscpmapping is an array of 0x40 elements. Values in dscp_exceptions
are used to index dscpmapping. The indices are not validated to be less
than 0x40. The dscp_exceptions array is received from association
response frame. A malicious AP can send values up to 0xff, causing OOB
write of dscpmapping array.

Hence, max index check is added to avoid OOB write of dscpmapping array.

Change-Id: I73526849677e867673fc0bd0024ed2b003e4f89e
CRs-Fixed: 2569764
2019-12-10 00:50:20 -08:00
Abhinav Kumar
a3cc2199cf qcacld-3.0: Send roam ch list to fw for both roaming and initial conn
Suppose, STA first connected to AP0 then connected to AP1.
After connection HOST sends current op channel to fw as roam
scan channel map only if the current(AP1) and previous AP(AP0)
profile does not match.

Now a disconnect indication comes to STA from AP1. While processing
deauth with currently associated AP (AP1) host first deletes its
previous connection profile(AP0) and then save the current AP profile
(AP1) as prev profile and complete disconnection with AP1.

At this point of time, STA successfully disconnected with AP1 and
has info about AP1 as a previous profile.

Now STA initiates a fresh connection with AP2 and successfully
connected. In case if the profile of AP1 and AP2 match, host does not
send the current home channel to fw after connection with AP2. This
results in the unavailability of the current home channel in fw scan
channel list and FW fails to find any AP available on current
operating channels in the partial scan.

Irrespective of capabilities of current and previously associated
APs, Host should send current home channel to FW after initial
connection as well as while roaming. FW has logic to append its
channel list with a list coming from host. So send current AP
channel to firmware all the time.

Change-Id: I7942b98116c651e6b53f1134fd6cc85bc80b5354
CRs-Fixed: 2561340
2019-12-10 00:49:58 -08:00
Will Huang
95e5946964 qcacld-3.0: Enable Tspec handover when ESE capable roaming
Currently if roaming is offloaded to target, and it is a ESE capable
association, but 11r capable is not available, the Tspec configure
before roaming can't handover to new AP in host, but target has
reassociated with new AP include Tspec configure, and if want to
delete Tspec after roaming it fails to find it in lim in host.

Fix it by also enable ftHandoffInProgress flag if hit such case

Change-Id: Ie242d3c2e137c31bc5f213ea1756846f18b860ae
CRs-Fixed: 2566015
2019-12-09 17:28:22 -08:00
bings
51eb74f9e8 qcacld-3.0: Lock all the entry of ch power info
If the entry of ch power info is not locked, free after use may be
happened. For example, csr_save_to_channel_power2_g_5_g does
csr_purge_channel_power, while csr_save_tx_power_to_cfg is called
in another thread and it calls csr_ll_peek_head then does some
operation on the entry.

Change-Id: If6cc4d8e0072e97288b60d3c72499b79c0a2bf67
CRs-Fixed: 2580147
2019-12-09 13:55:48 -08:00
Jianmin Zhu
61d502d966 qcacld-3.0: SAP CSA from 5G to 2G for modem N79
For SAP/P2P GO on 5G, when receive cmd to disable 5G band when
modem n79 band used, will move to 2G band via CSA.
1. If no active connection on 2G, select ch by safe list, or
channel 6.
2. If there is STA on 2G, force scc with it.
3. If there is SAP/GO on 2G, force scc with it.
4. Handle one race condition that if candidate is already
selected & FW has gone ahead with roaming or about to go ahead
when set_band comes, it will be complicated for FW to stop the
current roaming. Instead, host will check roam sync to make sure
the new AP is on 2G, or disconnect the AP.
5. If 2 SAP on 5G, move both to 2G and keep scc.

When Set band to enable 5G band again, restored all 5G SAP/Go..

Change-Id: I9b2b1ead3b4502022aeefc08359037457bb051f9
CRs-Fixed: 2580204
2019-12-09 13:54:16 -08:00
gaurank kathpalia
8197e355fa qcacld-3.0: Peer ID cleanup in LIM, HDD and WMA
Cleanup peer id from the callers of cdp APIs from
where the peer ID was passed, and use mac address
instead to identify the STA.

Change-Id: Ie6dcae77e959439a71c11b1a2fa0daddcaa6e719
CRs-Fixed: 2529822
2019-12-06 01:51:09 -08:00
Will Huang
e38ae0f758 qcacld-3.0: Use channel frequency directly stead of channel number
Use channel frequency directly in function csr_get_dot11_mode() and
csr_neighbor_roam_preauth_rsp_handler().

Change-Id: I2dac911fac1d1c154a3d0f5465cfef3d85e81b85
CRs-Fixed: 2568346
2019-12-05 15:16:26 -08:00
Abhishek Ambure
6523bc72c9 qcacld-3.0: Clear Static channel list in fw for SETROAMSCANCONTROL 0
In the present implementation, it is observed that "SETROAMSCANCONTROL 0"
command is not clearing STATIC channels in the firmware for ROAM scan list.

So to clear STATIC channels configured for ROAM scan and set dynamically
added ROAM scan channels host sends two RSO commands to Firmware.

In the first RSO command STATIC channel list is cleared and second RSO
command will add dynamically added ROAM scan channels to ROAM scan list
in firmware.

Change-Id: Ic359326032c5776540c773a51d7531c0cfcd7bdc
CRs-Fixed: 2571119
2019-12-05 04:20:42 -08:00
gaurank kathpalia
318006772b qcacld-3.0: Verify the channel and BW info in monitor mode
Currently the monitor mode does not check the chan
validity and BW validity before starting the monitor
mode vdev which could result in invalid configuration
given to FW and thus further can lead to assert.
Eg. If the command comes for an invalid channel, or
suppose 160 MHZ and the device supports 80 MHZ only
then it can lead to assert.

Fix is to verify the channel and BW info and reject
the command if found invalid.

Change-Id: Iaf9f06f8d4b943bd1e8db5c22ea155a4fe3e61a8
CRs-Fixed: 2572152
2019-12-03 22:48:17 -08:00
Jianmin Zhu
a9c1b38b62 qcacld-3.0: Failed to add PMF required AP into LFR3 channel map
PMF info isn't filled in scan filter when find AP in scan
cache to build LFR3 channel map.

Change-Id: Ibacf0ee6534298415f97fc42e5223b7d85f203e0
CRs-Fixed: 2571777
2019-12-02 22:36:47 -08:00
Abhishek Singh
91562fa4be qcacld-3.0: Free connected profile, roam info etc during HB failure
In case of disconnect from peer or HB failure the connected profile,
roam info etc are not freed. So connected BSSID is still present in
sme session.

Now in STA+STA case if the vdev0 STA connect to a BSSID say AP1 and
then disconnect due to HB failure. Now if the 2nd vdev1 STA connect to
AP1 and again disconnect due to HB failure, in
csr_roam_chk_lnk_deauth_ind it will try to find the session using
BSSID, but as vdev0 BSSID is not yet deleted it will get the vdev0
vdev id and continue the process on the wrong BSSID.

This result in actual CSR session in connected state for the vdev1
but all other layer in disconnected state.

Now if a connect request is received on vdev1 again, as CSR is
connected state it lead to reassoc req to LIM and lead to out of
sync issues.

To fix this free connected profile, roam info etc during peer
initiated disconnects. Also ignore the BSSID if a vdev is already
connected to it.

Change-Id: I0f862259dc297217c7b9ecd5d1521a8ded2aadc3
CRs-Fixed: 2577795
2019-12-02 12:39:08 -08:00
hqu
bcd0a8f349 qcacld-3.0: Clear wlan_reg_freq_to_chan
Clear wlan_reg_freq_to_chan in is_dfs_unsafe_extra_band_chan,
refine unsafe_channel_list for hdd_context to store frequency.

Change-Id: I48a75e053228b202122633a32e750f446f839ea3
CRs-Fixed: 2574028
2019-12-02 12:38:55 -08:00
hqu
e947f6524f qcacld-3.0: Clear wlan_reg_freq_to_chan
Clear wlan_reg_freq_to_chan in csr_scan_filter_results.

Change-Id: I4c6815171f51790a795af3635c924225cdf5ac35
CRs-Fixed: 2570951
2019-12-02 07:19:10 -08:00
Abhishek Singh
f37d49f5b4 qcacld-3.0: Rename sessionId of struct tagSmeCmd to vdev id
Rename sessionId of struct tagSmeCmd to vdev id

Change-Id: I3b0d9c1f7e173e4f45bd3d0a29df6ab7dd0de64d
CRs-Fixed: 2575198
2019-12-01 17:40:42 -08:00
Srinivas Dasari
b24bdd3f73 qcacld-3.0: Consider NAN enabling also as connection in progress
There is a race condition while handling the below scenario,
1. NAN enable request is received from framework.
2. Policy mgr opportunistic timer expired and set hw mode
   initiated to Single MAC mode in scheduler thread at
   the same time

As the opportunistic timer handler doesn't have any info if
NAN enable initiated in DBS mode, it's configuring the hw
mode to Single Mac Mode just before NAN enable request is sent
to firmware. So the NAN enable request is sent to firmware in
Single Mac Mode which is not allowed by firmware.

NAN enable/disable is also similar to connection in progress
status in case of STA. So provide NAN enable/disable status
through hdd_is_connection_in_progress() to the opportunistic
timer handler. Opportunistic timer handler restarts the timer as
connection(NAN enable/disable) is in progress.

Also set hw_mode_change_in_progress before checking the
connection progress status. This is to avoid a possible race in
the below scenario,
1. NAN-enable sets the state but scheduler thread had read the
   state just before that
2. NAN-enable read the hw_mode_change_in_progress just
   before it gets set by scheduler thread.

Change-Id: I1a184c84520deb3f6ad1ec010a0fdefda96a5364
CRs-Fixed: 2566841
2019-12-01 17:39:45 -08:00
Gururaj Pandurangi
847342e013 qcacld-3.0: Remove logs in csr_nonscan_active_ll_peek_head
Remove logs in csr_nonscan_active_ll_peek_head to prevent
excessive logging while testing CVE-2017-0624

Change-Id: Ie5ab57d36fc05a3eac0d4fdba33a72b11eb7c561
CRs-Fixed: 2573914
2019-12-01 13:10:49 -08:00
hqu
a07736a6da qcacld-3.0: Clear wlan_reg_freq_to_chan
Clear wlan_reg_freq_to_chan in csr_fill_bss_from_scan_entry.

Change-Id: I06b2eef0f1c965466c1ec67edd3ea48db07dddc7
CRs-Fixed: 2570933
2019-11-29 06:16:20 -08:00
Liangwei Dong
17b35c18f9 qcacld-3.0: Remove op_chan and wlan_reg_freq_to_chan
Remove unused op_chan local variable. Remove call to
wlan_reg_freq_to_chan.

Change-Id: I351fe9df7f419fe9345dce73c948d34a73bfcc8a
CRs-Fixed: 2940016
2019-11-27 14:15:28 -08:00
wadesong
d8a7719df3 qcacld-3.0: Convert CSR legacy channel ID usage
1) Change the following functions to make them use channel
   frequencies intead of channel IDs:

   csr_process_roam_sync_callback
   csr_save_to_channel_power2_g_5_g
   csr_save_tx_power_to_cfg

2) Remove some local variable and code within function
   csr_save_tx_power_to_cfg as they're not used.

3) Retain the code for channel ID utilization within
   csr_get_channel_power_info as they're used to
   indicate diag info to upper layer apps.

Change-Id: Ib294fd04f770c008afaa0049fb1951aa912caf34
CRs-Fixed: 2573403
2019-11-27 07:04:33 -08:00
Rachit Kankane
e599de301c qcacld-3.0: Add check ongoing deauth message
There are two path in code to deauth a associated STA in SAP mode:
1. Deauth issued from user space
2. Deauth issued from peer

Rectified the check for ongoing deauth before queuing for another.

Change-Id: Ib3f45968c770b1df25c77aed9fd1e3bc8edd6e72
CRs-Fixed: 2567087
2019-11-26 08:42:08 -08:00
Sourav Mohapatra
2a67b0ed24 qcacld-3.0: Add driver command to request ANI level
The ANI level determines how well the device is coping with interference
in the wireless environment. Add support in the driver to query the ANI
level from the firmware and populate it for userspace entities to use.

Change-Id: I54934f670aa11737e11eca4d64e12f9dffb4f430
CRs-Fixed: 2554674
2019-11-26 05:30:13 -08:00
Abhishek Singh
f554e7a205 qcacld-3.0: Remove unused csr serialization APIs
Remove unused csr serialization APIs.

Change-Id: I80b126abbb3c52aa854343dcad6834835ae53038
CRs-Fixed: 2573395
2019-11-26 05:30:00 -08:00