Commit Graph

397 Commits

Author SHA1 Message Date
Pragaspathi Thilagaraj
b11dbe4531 qcacld-3.0: Remove redundant null check for p_mac
In sme and lim, NULL check is available for h_hal. pmac is
casted resultant from h_hal and is retrieved using
PMAC_STRUCT macro, which is defined as ((tpAniSirGlobal)_hHal).
Null check is added for this p_mac also which is redundant.

Remove logically dead code to NULL check the p_mac.

Change-Id: I7a22de3691b83e8ae04391e43cde82541eaabc23
CRs-Fixed: 2276003
2018-07-24 13:20:29 -07:00
Vignesh Viswanathan
694bec3af7 qcacld-3.0: Update dot11_mode based on target channel during chan switch
Currently if the dot11_mode is set to eCSR_DOT11_MODE_11g or
eCSR_DOT11_MODE_11g_ONLY and a channel switch is triggered with
target channel in 5Ghz band, then an invalid combination of dot11_mode
and channel occurs which fails the vdev_restart for channel switch.

Update the dot11_mode based on the target channel and the current
dot11_mode before sending the channel change request to SME.

Change-Id: I2b0fa4a36f137150ee0506d62be29ede4f4e604c
CRs-Fixed: 2276876
2018-07-13 15:46:02 -07:00
Abhinav Kumar
dd01d8df25 qcacld-3.0: Remove logically dead code in wlansap_start_bss
Remove redundant NULL check for hHal in wlansap_start_bss.

Change-Id: Iaac53d1203ec3bc4a6f12dd1db3634b5636ae3b2
CRs-Fixed: 2267073
2018-07-11 18:45:34 -07:00
Will Huang
b52446a70e qcacld-3.0: Fix SAP stop fail while detect radar in cac wait state
If radar detected while in SAP CAC wait state, and stop AP command
invoke at same time, SAP machine will go to eSAP_DISCONNECTING but
ignore eSAP_HDD_STOP_INFRA_BSS message in sap_fsm_state_disconnecting()
because is_chan_change_inprogress is not set for this case.

Set is_chan_change_inprogress as case radar detected after cac
wait time.

Change-Id: I156cf8375520eeb258d5cde53bd13e80881a36a3
CRs-Fixed: 2273169
2018-07-11 14:28:38 -07:00
Jeff Johnson
6a18c96ba2 qcacld-3.0: Rename csr_roam_completeCallback
Rename csr_roam_completeCallback to avoid having camelCase.

Change-Id: Ic84cf07c352da5c445df599657a050feef997f1f
CRs-Fixed: 2273780
2018-07-07 10:26:07 -07:00
Kiran Kumar Lokere
1a43bcf236 qcacld-3.0: Add support for SRD channels in ETSI domain
Add support for SRD channels in ETSI regulatory domain

1) Add SRD channels only if DSRC feature is disabled.
2) Add user configuration to enable/disable these channels
in master mode PCL/ACS. Default is disabled.
3) Allow these channels in ACS/PCL only if the INI is set.

Change-Id: Ibd79dc95e9911ce3a0fd101f4716d9bbb8b75466
CRs-Fixed: 2264786
2018-07-05 20:49:25 -07:00
Bala Venkatesh
2f25c81c88 qcacld-3.0: Skip DFS channels if sta_sap_scc_on_dfs_chan enabled
If sta_sta_sap_scc_on_dfs_chan enabled then SAP is not allowed
on DFS channel in standalone mode. If ACS and sta_sap_scc_on_dfs_chan
are enabled ini then skip the DFS channels from the ACS channel list

CRs-Fixed: 2159816
Change-Id: I396d0c8996f8870de1570ed9932451567f5c77f3
2018-07-05 14:13:51 -07:00
gaurank kathpalia
6f53cf10d5 qcacld-3.0: Fix pointer dereference condition
In the APi wlansap_roam_callback, under switch
case of roam result eCSR_ROAM_RESULT_INFRA_ASSOCIATION_IND,
the driver passes csr_roam_info in
wlansap_roam_process_infra_assoc_ind without a NULL check for
the same, which may cause pointer dereference.

Fix is to call wlansap_roam_process_infra_assoc_ind only if
csr_roam_info is valid

Change-Id: I6388b7c8f7af827a5c2a862779f04b22c5c5f23e
CRs-Fixed: 2260094
2018-07-03 16:36:39 -07:00
Himanshu Agarwal
cf5b89316f qcacld-3.0: Check for beacon channel in ACS channel list correctly
Beacon's channel is checked against ACS channel list before even
getting the beacon's channel resulting in no beacon parsing at all.

Check for beacon channel in ACS channel list after getting the
beacon's channel.

Change-Id: I16edcf9eaa0eafce289cc050652702eb90d79c9d
CRs-Fixed: 2271461
2018-07-03 06:38:18 -07:00
Ashish Kumar Dhanotiya
10b0c91904 qcacld-3.0: Do not select any invalid channel from acs list
Driver is selecting first channel from the preferred channel list
if no channel is selected from the sap channel select algorithm.
This leads to the selection of an invalid channel if the entire
preferred channel list is invalid.

To resolve this issue, do not select any channel from the preferred
channel list if the entire list is invalid or if the entire list
is unsafe.

Change-Id: Ic90416fe62f854e2c1f124884c200876f543caba
CRs-Fixed: 2234142
2018-06-28 10:42:36 -07:00
Bala Venkatesh
5479cf853f qcacld-3.0: Skip CAC and ignore radar indication for SAP
If STA is already connected on DFS channel and SAP is going to start
on the same channel then skip the CAC for SAP.
If STA and SAP sessions are already operating on same DFS channel,
then ignore radar indication received on SAP interface.

CRs-Fixed: 2130000
Change-Id: Ife0ab6979a07c8773001a43f5a30c9a555dab37a
2018-06-28 03:10:54 -07:00
Himanshu Agarwal
170b497c19 qcacld-3.0: Avoid beacon parsing on channels not in scan list for ACS
When STA is already up on some 2.4Ghz channel and SAP needs to be started
on some 5Ghz channel through ACS, scan channel list contains only 5Ghz
channels. But scan results contains beacons on STA 2.4Ghz channel as well
which is getting parsed contributing to bsscount and rssi on that 2.4Ghz
channel which should not be the scenario as bsscount should be 0 and rssi
should be -100 on this 2.4Ghz channel as it is not present in the scan
channel list sent by HOST to fw.

Avoid beacon parsing on all the channels other than the channels present
in ACS scan channel list.

Change-Id: I85ab967386b19748c32e98a7e468d471e31f9b9a
CRs-Fixed: 2266170
2018-06-27 17:41:06 -07:00
Jeff Johnson
83e30fa110 qcacld-3.0: sap: Replace tSirRetStatus with QDF_STATUS
The tSirRetStatus definitions are obsolete, so replace them with
QDF_STATUS definitions in the sap folder.

Change-Id: I17482713977012d13e0fdb99b67e3f5f4a33efe9
CRs-Fixed: 2266146
2018-06-22 14:07:58 -07:00
Jiachao Wu
b8f8921958 qcacld-3.0: Using util API to check scan result
SCAN_EVENT_TYPE_DEQUEUED means this scan request have been dequeued
in fw. Driver should close this session and free related resouce if
recevie DEQUEUED.

In sap_scan_event_callback and csr_scan_callback,
those functions will return if receive DEQUEUED.Which cause memory leak.

So using util_is_scan_success to check scan result in scan callback.
And check sap resouce whether be freed when rmmod.If not clear it.

Change-Id: Iaf1f077dd7221236944d94d2b543f4df63de29fd
CRs-Fixed: 2242823
2018-06-20 14:01:08 -07:00
Zhu Jianmin
72d32dedba qcacld-3.0: ini parameter to allow STA+SAP SCC on LTE coex channel
When Force SCC and STA+SAP SCC on LTE coex channel are enabled:
   1. When STA on LTE coex channel, start SAP, select STA
      channel.
   2. When SAP on, connect STA on LTE coex channel, then switch
      SAP channel to STA channel.

Change-Id: I3f3972df43318473342d42012be3a57b8baad965
CRs-Fixed: 2235704
2018-06-20 00:42:26 -07:00
Himanshu Agarwal
052ce25534 qcacld-3.0: Initialize channel info for ACS even if channel is unsafe
Channel info for ACS is not getting initialized if channel is unsafe.
So, channel number, rssi, ACS weight, etc. is not getting initialized
and is 0 for all the unsafe channels. As a result, wrong weights are
getting calculated in ACS algo and wrong channel number is getting
printed in logs for all these channels.

Initialize channel info for ACS even if channel is unsafe.

Change-Id: Iec315ea818b5b51aef6879831b8be29ba4515983
CRs-Fixed: 2260798
2018-06-19 00:27:43 -07:00
Himanshu Agarwal
3697f94539 qcacld-3.0: Pass correct channel in ch_in_pcl()
Presently, wrong channel is passed in ch_in_pcl() as a result of which
PCL discount is applied on wrong channel resulting in wrong ACS weight
calculation.

Pass correct channel in ch_in_pcl().

Change-Id: Id87c0afe501d7217ae6b170656bf6d2fab89b5b7
CRs-Fixed: 2257182
2018-06-14 18:35:19 -07:00
gaurank kathpalia
e4a628f2d6 qcacld-3.0: Free channel-list memory from Sap_context
The driver allocates memory to channelist in the API
sap_get_channel_list, and stores the pointer to channel
list in sap_context, and frees the memory allocated for
the same in scan request callback.
But it may happen that before the callback, stop adapter
calls wlansap_context_put and frees the memory allocated
to sap context, without the mem free of channellist, which
results in a mem leak

Fix is to add a NULL check to sap context and free the memory
allocated to the sap context channel list in
sap_cleanup_channel_list.

Change-Id: I7030ca8325ae4c968db654bf14062e332f409b87
CRs-Fixed: 2254767
2018-06-13 22:26:54 -07:00
Pragaspathi Thilagaraj
fbfa88ea39 qcacld-3.0: Increase SAP ACS scan priority to high from low
The function sap_goto_channel_sel triggers the pre start bss
scan for SAP. After this scan is queued, the hostapd process
gets scheduled after 3 secs and proceeds to select the channel
to start the SAP. If scan completion for the ACS scan was not
received, it selects the default channels. ACS scan is sent to
firmware with low priority like other normal scan.
Increasing the priority of the scan will ensure that the scan
completion is done prior to the other existing scans pending on
the queue.

Escalate the priority of the ACS scan from low to high.

Change-Id: Ibe558a4a323f276cce6eaabb3b62db217dbd5a94
CRs-Fixed: 2245200
2018-06-13 18:19:54 -07:00
Himanshu Agarwal
f5c5b10736 qcacld-3.0: Choose appropriate bandwidth while channel switch
If SAP comes up in 2.4Ghz channel in HT/VHT 20/40Mhz and channel
switch comes for a 5Ghz channel, SAP gets started in HT/VHT 20/40
Mhz only while it should connect in VHT80Mhz or HT40Mhz depending
on whether the initial connection is in HT or VHT.

Change the bw to 80Mhz if initial connection is in VHT and to 40Mhz
if initial connection is in HT if channel switch comes for a 5Ghz
channel.

Change-Id: I709dd35575866b7ec9fddcfb94078f114a78d1a2
CRs-Fixed: 2226979
2018-06-08 10:11:46 -07:00
Himanshu Agarwal
331639871a qcacld-3.0: Start SAP on 80Mhz in STA+SAP when acs_policy enabled
When acs_policy is enabled and STA is already up on some 5Ghz channel,
SAP is coming up on the same 5Ghz channel as expected but in 20Mhz even
when bandwidth given by hostapd is 80Mhz.

Start SAP on same channel as STA but in 80Mhz instead of 20Mhz.

Change-Id: Ie5dc06844f867d32796706cdcc190d1cb1b1d2fe
CRs-Fixed: 2196229
2018-06-06 05:49:14 -07:00
wadesong
cb0ded2438 qcacld-3.0: Add diag event support for ACS
Send ACS diag event when SAP is doing ACS.

Change-Id: I409b57dce98a12796cfee1619c8efe47a403bd1d
CRs-Fixed: 2238666
2018-05-31 19:23:07 -07:00
Tushnim Bhattacharyya
4e4be911ba qcacld-3.0: Initialize variable sap_ap_event in sap_signal_hdd_event
Initialize variable sap_ap_event to avoid use of uninitialized value
of sap_ap_event.sapHddEventCode when calling sap_ctx->pfnSapEventCallback.

Change-Id: Idcf18b6c95ffcef59f0db764d0071fcb4909ea2e
CRs-Fixed: 2232749
2018-05-29 12:27:33 -07:00
Zhu Jianmin
c147a544b7 qcacld-3.0: Get rid of camelCase pSapContext
Replace all pSapContext with sap_context

Change-Id: I79e29f4921be0b81b101297d1b976ba711fef0e6
CRs-Fixed: 2230873
2018-05-24 11:13:33 -07:00
Zhu Jianmin
436827dd13 qcacld-3.0: Use same sap_context for different SAP wrongly
When receive dfs event, if no available channel,  stop all AP,
but send eSAP_STOP_BSS_DUE_TO_NO_CHNL to same AP for 2 times
wrongly during SAP+SAP concurrency, init and schedule same work
queue sap_stop_bss_work 2 times at nearly same time, deadlock
happens

Change-Id: I86cf0ed578e81b3bc1941e057e91c9d952893e07
CRs-Fixed: 2230873
2018-05-24 11:13:27 -07:00
Tushnim Bhattacharyya
6610ff711f qcacld-3.0: Restrict the force SCC logic for STA+SAP only
Restrict the force SCC logic for STA+SAP only, driver shouldn't
use the force scc logic for STA+P2P GO.

Change-Id: I3e62256bc1d8fd35667e6413219077ddc30f0732
CRs-Fixed: 2243537
2018-05-21 10:26:27 -07:00
Jeff Johnson
c7e4d16ff9 qcacld-3.0: sap: Fix misspellings
Address the following issues in the core/sap folder:
CHECK: 'availabe' may be misspelled - perhaps 'available'?
CHECK: 'defult' may be misspelled - perhaps 'default'?
CHECK: 'fucntion' may be misspelled - perhaps 'function'?
CHECK: 'Funtion' may be misspelled - perhaps 'Function'?
CHECK: 'intial' may be misspelled - perhaps 'initial'?

Change-Id: Id1e696f70d4d3c5ff650a353eb8402216909bc2c
CRs-Fixed: 2241944
2018-05-18 00:00:18 -07:00
Wen Gong
bf560c80fb qcacld-3.0: Add sap_indicate_radar stub for DFS master disable
Add sap_indicate_radar for enable / disable DFS master feature

Change-Id: I2b65213033fd6065ae8f1a38e927956410678daf
CRs-Fixed: 2243754
2018-05-17 21:39:03 -07:00
bings
071a4c6d71 qcacld-3.0: Do not call dfs_get_radars if concurrent sap exists
If concurrent sap exists, which means dfs_init_radar_filters has
been called before, there is no need to call it again.

Change-Id: Ibf1805b0dbd27fbdf36c37450bdb95626195fb81
CRs-Fixed: 2241282
2018-05-17 11:35:01 -07:00
Will Huang
9913277e97 qcacld-3.0: Clear mac_ctx->sap.sapCtxList for SAP if SSR happen
While SSR happen, hdd_reset_all_adapters will not clear
mac_ctx->sap.sapCtxList[sapctx->sessionId].pSapContext, and later the
sapctx will assign new sessionId after SSR restart SAP and update to
mac_ctx->sap.sapCtxList. So sapctx/old sessionId still can be
referenced by like wlan_sap_is_pre_cac_active and call pre cac cleanup
on unexpected port.

When SAP restart and set global sapCtxList in sap_set_session_param(),
find matched sapctx and clear it before assigning updated value.

Change-Id: Id02733cb22267ac0c1899d8caf9ac47c65e24a88
CRs-Fixed: 2232398
2018-05-14 10:26:18 -07:00
Jeff Johnson
33142e6fb6 qcacld-3.0: Fix typo "doesnt"
Replace typo "doesnt" with correct spelling "doesn't".

Change-Id: Ic3063f9fe74e10f656e00e86c8f38ccf1132f22d
CRs-Fixed: 2238297
2018-05-12 04:30:58 -07:00
Jeff Johnson
4ceed38fbf qcacld-3.0: Fix typo "recieve"
Replace typo "recieve" with correct spelling "receive".

Change-Id: I16de4aedcd0f401da8b11fa0ea4989ad1e73bf57
CRs-Fixed: 2238297
2018-05-12 04:30:02 -07:00
Jeff Johnson
2cc31fdbad qcacld-3.0: Fix typo "choosen"
Replace typo "choosen" with correct spelling "chosen"

Change-Id: I58fc894783093f3d68f3b576906695a9ce201adf
CRs-Fixed: 2237731
2018-05-09 15:19:55 -07:00
Jeff Johnson
e4c11db22a qcacld-3.0: Fix camelCase in tsap_Config_t
Rename typedef tsap_Config_t and the underlying struct sap_Config to
align with the Linux coding standard.

Change-Id: I6e8f8b5ab9555c7781f1acf12a0475902866300c
CRs-Fixed: 2237721
2018-05-09 15:19:47 -07:00
Vignesh Viswanathan
ad47f0a2a8 qcacld-3.0: Modify callers of ObjMgr APIs to include pdev_id
wlan_objmgr_get_vdev_by_macaddr_from_psoc and wlan_objmgr_get_peer
API's definitions have been changed to include pdev_id as an
argument.

Modify the callers of these APIs to include pdev_id as argument.

Change-Id: I3d0de6a0bc1dfefbe1b3cad51ec23f703baaf3ad
CRs-Fixed: 2210728
2018-05-09 01:44:33 -07:00
Naveen Rawat
c3411bbdf8 qcacld-3.0: Fix null pointer dereference in SAP state fsm
Add a check against for NULL pointer before accessing roam_info
object pointer.

Change-Id: Id03a47761fa9624ddf76305f110f1f83bcb0a7cd
CRs-Fixed: 2232419
2018-05-03 18:33:03 -07:00
hqu
8f11faa1c0 qcacld-3.0: Use secondary_ch to calculate ACS result params
In shielding room, bring up one 2.4G SAP with HT40+ on channel 6,
but hostapd_cli command will report HT40-. Root cause is it uses
sec_ch_offset when calculate ACS result params, it's wrong.

Fix is to use secondary_ch when calculate ACS result params.

Change-Id: I41a5d0e4be0d2e3046d0004c25f11f2905a3b911
CRs-Fixed: 2221588
2018-05-02 05:40:13 -07:00
Jeff Johnson
f8b4d424cf qcacld-3.0: sap: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: I05b2f8ed3e48de4347475d279d4de409d4eece42
CRs-Fixed: 2229655
2018-04-24 14:48:48 -07:00
Wen Gong
01a2c63468 qcacld-3.0: Add DFS master feature flag
Add config flag to enable / disable DFS master feature

Change-Id: Ibb0bc715c70b471b5e73626cf75ce9785a8eb567
CRs-Fixed: 2222562
2018-04-23 00:30:46 -07:00
Bala Venkatesh
82914ad371 qcacld-3.0: Remove DFS channels from scan list in case of MCC disallow
ACS in 5G channels for STA connected in 5G non DFS channel can result
SAP starting on DFS channel. Making MCC on DFS channel. This is
leading to FW panic if STA tries to roam during SAP is
detecting radar.

Avoid SAP starting on DFS channel if STA connected on 5G non DFS

Remove DFS channels from scan list before acs, if MCC is disllowed.
So, that DFS channel is not selectecd after acs.

Change-Id: I717309b81934852bfd93146b233db6f7fb03f252
CRs-Fixed: 2215332
2018-04-16 16:56:40 -07:00
Jeff Johnson
78772177b6 qcacld-3.0: Remove obsolete WLANTL_DEBUG code
Macro WLANTL_DEBUG is currently used to define some SAP debug
counters, but these counters are unused, so remove this obsolete code.

Change-Id: Ie7d976efcb5fb335b3f60a5af48a70dd214b3bd0
CRs-Fixed: 2220915
2018-04-11 03:37:24 -07:00
Ravi Joshi
9788fcd47d qcacld-3.0: Enhance logging levels for some SAP ACS messages
Enhance logging levels for some auto channel selection messages useful for
debugging.

CRs-Fixed: 2189466
Change-Id: I05c0f8a7c96c8e33f997b00c3d9a9d1714f283e0
2018-04-06 14:47:00 -07:00
Naveen Rawat
b4ea70f96e qcacld-3.0: Fail channel sap channel change request for channel 0
In function wlansap_channel_change_request validate channel requested
before processing the request.

Change-Id: I1cc8c978b15fe6ee043ce6bf712a109994dce50b
CRs-Fixed: 2212078
2018-04-02 19:39:34 -07:00
Ashish Kumar Dhanotiya
d39c8b55db qcacld-3.0: Update correct reason code on receiving del sta
On receiving del station command, SAP is not updating the del
station reason code properly in station info.
Update the correct reason code in station info whenever a
del station or deauth station event comes.

Change-Id: I2004dc21f18682dbc7dee488e7b55bfccd0d242a
CRs-Fixed: 2178538
2018-03-29 17:32:02 -07:00
Himanshu Agarwal
4f503b8676 qcacld-3.0: Compute RSSI and BSS adjustment correctly
When hw_mode=any (both 2.4Ghz nad 5Ghz bands included),
RSSI and BSS adjustment for 2.4Ghz channels happens 2
times, once in sap_interference_rssi_count() and once
in sap_interference_rssi_count_5G() which leads to wrong
computation of weight.

Check whether a channel is 2.4Ghz or 5Ghz channel before
calling the corresponding RSSI, BSS adjustment function.

Change-Id: I6c318e489cfa177c6de088e7cdfb4779ceb99b2f
CRs-Fixed: 2208069
2018-03-28 06:26:08 -07:00
Tushnim Bhattacharyya
3b99f4b181 qcacld-3.0: Deprecate enum sir_conn_update_reason
Deprecate enum sir_conn_update_reason & use enum
policy_mgr_conn_update_reason from policy manager component.

Change-Id: Id592d5405235f29a962a2a7d8b679fa4363f556d
CRs-Fixed: 2213000
2018-03-27 07:29:09 -07:00
bings
fe10dd1441 qcacld-3.0: Do not switch channel when target channel is 0
When all the configured channel are in NOL list, the target channel
will be set as 0 and sap will be stopped.
Currently a workqueue is created to stop sap, so channel switch may
still happens if it is called before this workqueue is executed.

Switch channel should be not happened when target channel is 0.

Change-Id: I368830bddcd9363826f6f2c8898b86ece8dd7d89
CRs-Fixed: 2203899
2018-03-26 23:07:55 -07:00
Jeff Johnson
66ee8a92fe qcacld-3.0: Replace typedef tCsrRoamProfile
The Linux Coding Style enumerates a few special cases where typedefs
are useful, but stresses "NEVER EVER use a typedef unless you can
clearly match one of those rules." The tCsrRoamProfile typedef does
not meet any of those criteria, so replace references to it with a
reference to the underlying struct.

Change-Id: Ie78bc34c5c39a56058d0daa0240047ec67392ab3
CRs-Fixed: 2207843
2018-03-19 19:57:58 -07:00
bings
3fe5bc31bf qcacld-3.0: Configure phyerr filter offload before sap starts
Do not send phyerr filter offload to FW when dfs module is doing
initialization, because in target_if_dfs_set_phyerr_filter_offload
routine GET_WMI_HDL_FROM_PDEV returns NULL at this time.

Configure phyerr filter offload before sap starts.

Change-Id: I60436fc1e142937383a3714c727166bc5fa8d0db
CRs-Fixed: 2205229
2018-03-15 06:08:32 -07:00
Vignesh Viswanathan
200f5c19b0 qcacld-3.0: Skip starting SAP after channel change if stop BSS in progress
When stop_bss from HDD is received when a SAP channel change request
is currently in progress and channel change response is not yet
received from the FW, the stop_bss would clear the SAP session and
when channel change response is received, we try to start BSS again.
The CSR roam state is also set to JOINING in this case.

As part of start BSS, we queue set key command to SME active command
list. Since the session has been cleared, eWNI_SME_SETCONTEXT_RSP
sent to lim would not be processed in CSR state JOINING leading to set
key command stuck in the active command list.

Do not restart BSS after channel change response if stop BSS is in
progress. Also handle eWNI_SME_SETCONTEXT_RSP and clear the command
queue in CSR Joining state.

Change-Id: I8dbab054746d26cc92fc2274d35ce76a694035fe
CRs-Fixed: 2193505
2018-02-27 14:07:02 -08:00