Commit Graph

427 Commits

Author SHA1 Message Date
Abhishek Singh
4dc3ac2556 qcacld-3.0: Fix SAP VDEV state machine for dfs cac offload
If DFS CAC is offloaded the SAP VDEV state machine does not move to
CAC wait state and thus stop AP and radar indications are dropped.
This leads to del_self_sta without del_bss.

To fix this move the SAP VDEV state machine to cac wait state when
dfs cac offload is set.

Change-Id: I0b526974a4586b41f5a4b1ea5968721f444c610b
CRs-Fixed: 2332087
2018-10-15 01:29:30 -07:00
Harprit Chhabada
85eb22c15b qcacld-3.0: remove the comparison check for noise_floor_weight
noise_floor_weight is defined as unsigned in
sap_weight_channel_noise_floor(), but is checked
for value less than 0, which will never be true.

Change-Id: Idd8215c479eeae2ffd712434aae740f8465a8b45
CRs-Fixed: 2310624
2018-10-11 22:01:37 -07:00
Arif Hussain
256cc28720 qcacld-3.0: sap: Remove excessive logs
Below API's logs failure with caller information,
So no need logs at caller.
qdf_mem_malloc_atomic()
qdf_mem_malloc()
wmi_buf_alloc()
qdf_nbuf_alloc()
wmi_unified_cmd_send()

Change-Id: I392fd31f2ae1e46a0d7ceaa657b77fad4efd31eb
CRs-Fixed: 2327098
2018-10-10 18:20:44 -07:00
Vignesh Viswanathan
a1f3a1a31b qcacld-3.0: Update multiple generic INI items using MLME CFG [Part 2]
Replace usage of the below INI Items using MLME CFG instead of HDD config.

gEnableSelfRecovery
gSapDot11mc
gEnableFatalEvent
gSub20ChannelWidth
goptimize_chan_avoid_event
fw_timeout_crash
DroppedPktDisconnectTh
gItoRepeatCount

Change-Id: Ib46b9fc6c4bbc5ede0be7a5cb88064808962839d
CRs-Fixed: 2327611
2018-10-09 04:05:07 -07:00
Arif Hussain
88d1fddd0b qcacld-3.0: Refactor CFG_ENABLE_DFS_MASTER_CAPABILITY cfg
Refactor CFG_ENABLE_DFS_MASTER_CAPABILITY cfg item.

Change-Id: I19b52c6848bd04feca4213aad64138d5c55b9a1f
CRs-Fixed: 2327917
2018-10-04 22:52:51 -07:00
Liangwei Dong
3fb0016526 qcacld-3.0: Check and skip Radar event for SAP
Use the new API wlan_reg_chan_has_dfs_attribute
to check dfs channel or not. The old API may return
CHANNEL_STATE_DISABLE if the dfs chan is added to
NOL.
If SAP is not on dfs channel, skip the Radar event
process.

Change-Id: Ie5c87e6fa416658df64da54c276fb87f23ed7efb
CRs-Fixed: 2324649
2018-10-02 17:19:02 -07:00
Abhishek Singh
8e913fa1ec qcacld-3.0: Handle channel switch failure in START_RESTART_PROGRESS
During CAC wait if radar indication is found, SAP try to switch to
new channel. If this channel switch fails, SAP is stopped
internally.

This stopped indication is not handled if VDEV state is
START_RESTART_PROGRESS and thus vdev down is not sent to vdev FSM.

Handle SAP stop in START_RESTART_PROGRESS vdev state.

Change-Id: I92e48cc9a85249c88315fbb09fe1a61bd07983fd
CRs-Fixed: 2322996
2018-09-28 01:21:11 -07:00
Abhishek Singh
20a8e44ab2 qcacld-3.0: Add vdev state machine for CSA and radar
Add vdev state machine for Channel change and to handle
radar indication.

Change-Id: Ib5a5476510ffe55611325c98dd9779261c7bd9a3
CRs-Fixed: 2316574
2018-09-21 07:09:01 -07:00
Abhishek Singh
caa6185945 qcacld-3.0: Add vdev state machine for stop BSS
Adds vdev state machine for stop BSS request

Change-Id: I3324f6e7c5747d8a75817fc02620b6bca013326e
CRs-Fixed: 2316547
2018-09-21 05:28:39 -07:00
Abhishek Singh
3d30a3bb0c qcacld-3.0: Add vdev state machine for start BSS
Adds vdev state machine changes for start BSS req.

Change-Id: I9c8a5129db4ddc81f179256b077ab0cd038b5b27
CRs-Fixed: 2316552
2018-09-21 05:28:35 -07:00
Bala Venkatesh
2fde2c61db qcacld-3.0: SAP CFG Items part 2
Add support for the sap cfg items in new mlme component

Change-Id: I80f3f00a85720fe7bec11575fe67dd2f6b9d44b2
CRs-Fixed: 2316643
2018-09-20 10:30:08 -07:00
Srinivas Girigowda
eff16d956b qcacld-3.0: Fix tab stop checkpatch warnings
Fix tab stop checkpatch warnings.

Change-Id: I4ccbc39b571737413de038fabcd4b8641a39cd62
CRs-Fixed: 2312593
2018-09-13 13:20:38 -07:00
Abhishek Singh
5cd19f35d2 qcacld-3.0: Remove SAP FSM dependency from CSA
CSA req changes the SAP FSM state to STOPPING.

Remove this state manipulation by CSA.

Change-Id: I76e78824cdc7acad87e60310d53225596630ea94
CRs-Fixed: 2309229
2018-09-12 22:27:13 -07:00
Srinivas Girigowda
09625b0222 qcacld-3.0: Fix embedded function name checkpatch warnings
Logging macros already print function name by default,
there is no need to print the function name again as part of the log.

Hence, remove the function name or
wherever required use '"%s...", __func__'

Change-Id: Ib6dc6cc03ef148146b1c626271d5ac3b7345c4bb
CRs-Fixed: 2312593
2018-09-12 11:58:26 -07:00
Rajeev Kumar Sirasanagandla
327f9b6998 qcacld-3.0: Add support to store vdev object in sap context
Add support to store vdev object in sap context and acquire and
release its reference count during sap_set_session_param() and
sap_clear_session_param() respectively.

Change-Id: I61ab4a443ed2de5c58b62012a08c106aee7909d7
CRs-Fixed: 2312356
2018-09-12 07:08:05 -07:00
Liangwei Dong
8030a53419 qcacld-3.0: allow STA SAP SCC on DFS
If sta_sap_scc_on_dfs_chan = 1, we
allow the SAP on STA's DFS chan.

Change-Id: I6d74f0db2247d3746047de7c65197d6634c4c6bb
CRs-Fixed: 2309846
2018-09-11 08:44:08 -07:00
Abhishek Singh
dfa69c397a qcacld-3.0: Refactor mlme code to integrate SAP start vdev SM
Divide and refactor mlme functions to integrate vdev state
machine for SAP start.

Change-Id: Id4419261cb1ba88754eded9fd780cca60f1f5db7
CRs-Fixed: 2309240
2018-09-10 20:41:19 -07:00
Ashish Kumar Dhanotiya
8d039c8829 qcacld-3.0: Add mtrace logging for scan request
We are transitioning to new logging infrastructure
by using existing mtrace functionality.
Add new logging for complete scan request and response path.

Change-Id: Iab48b0f2a6ab9d0ec14e3110eb628b6d1731df53
CRs-Fixed: 2308237
2018-09-04 21:15:01 -07:00
Sandeep Puligilla
1f1e400e99 qcacld-3.0: Change the log level in SME/PE/WMA
Change the info/err/warn log level to debug in
SME/PE/WMA layer.

Change-Id: Ica0a53d5d6e08b62bbc240ba763ccce59b26af0e
CRs-Fixed: 2299223
2018-08-29 12:30:20 -07:00
Jingxiang Ge
ec11359f6d qcacld-3.0: Fix session can't be closed issue
There is race condition for a small window. The scenario
as below.

1 SAP is starting, and dfs cac begins but without finished.
2 SSR happens, wlan begins to call hdd_reset_all_adapters.
  In hdd_reset_all_adapters, sap_ctx->sessionId is reset to invalid.
3 In hdd_hostapd_sap_event_cb, adapter sessionId is set to
  sap_ctx->sessionId, after this step, adapter sessionId is changed
  from valid sessionId to 0xff.
  In hdd_reset_all_adapters->hdd_vdev_destroy, vdev is released
  but session can't be clean up as invalid sessionId. adapter->event_flags
  can't be clear which cause hdd_vdev_destroy can be called multi times.

Change as below.
1 cancel cac timer at the beginning of hdd_reset_all_adapters and
  before wlansap_set_invalid_session.
2 before send eSAP_START_BSS_EVENT, check if sap_ctx->sessionId
  is valid.

Change-Id: Ifaad62cd008f7769b059f36530455d4e734522e4
CRs-Fixed: 2293072
2018-08-27 08:53:22 -07:00
Rajeev Kumar Sirasanagandla
4133d86be3 qcacld-3.0: Use CSA to change SAP DFS channel
If STA interface is added after softap is started on DFS channel,
then SAP is stopped and re-started on non-dfs channel which is selected
using driver internal acs. But, internal acs is now obsolete. Therefore,
select non-dfs channel from preffered channel list and use SAP CSA
instead of restart.

Change-Id: I95e50c3ffbce35cf30cc9a06f0f14c9e60eb3e3f
CRs-Fixed: 2301895
2018-08-25 02:11:31 -07:00
Kiran Kumar Lokere
e37c8559a1 qcacld-3.0: Update dfs region enum names
Update dfs region enum names to fix the compilation
due to name change.

Change-Id: If3ed7c5d2eb9ce855f62df98301196395e7febf9
CRs-Fixed: 2300595
2018-08-22 06:08:45 -07:00
Liangwei Dong
32b1bfcbe0 qcacld-3.0: Release sap_ctx for DFS event handling
Do sap_ctx release for all DFS "Ignore" case.
Otherwise, the ref count may mismatch.

Change-Id: Ib3d7c416ec3942f4d0317825fa504bc2b5abd968
CRs-Fixed: 2297787
2018-08-17 06:21:17 -07:00
Liangwei Dong
98e8cf68ed qcacld-3.0: Ignore Radar event for non-dfs SAP
For SAP (2.4G) + SAP (5g dfs chan), the radar event
will be posted to all vdevs. 2.4 SAP will run into
failure in random chan selection.
Fix by ignoring radar event for Non dfs channel SAP.

Change-Id: I739f2a84f17941e501dfe52c9cd12afc6a42425f
CRs-Fixed: 2294077
2018-08-15 19:40:49 -07:00
hqu
b6441f2c72 qcacld-3.0: Initialize weight_copy when weight is SAP_ACS_WEIGHT_MAX
When channel 4 is unsafe channel in 2.4g LTE coex ACS case,
the weight for channel 4 will be calculated as 0 by function
sap_sort_chl_weight_ht40_24_g, it's wrong because weight_copy
doesn't be initialized in this case, so acs channel select
may choose wrong channel to start sap.

Fix is to add initialization for weight_copy when weight is
SAP_ACS_WEIGHT_MAX.

Change-Id: I4aa0fb133774d9980146a9ceae9b91154bd15bbc
CRs-Fixed: 2282371
2018-08-14 21:44:07 -07:00
Qiwei Cai
e689a26cd8 qcacld-3.0: Featurize some vendor commands
Featurize some vendor commands to compile out when not needed.

Change-Id: I6757b5764930efbd9cd1c7ab74e5990e96267421
CRs-Fixed: 2270461
2018-08-13 23:15:17 -07:00
Rajeev Kumar Sirasanagandla
301aacb4e3 qcacld-3.0: Avoid camel case notation for SAP FSM states
Kernel checkpatch is throwing style issues due to use of camel case
notation for SAP FSM states.

To fix this, rename states according to kernel coding guidelines.

Change-Id: Ia09cccb7c51a61436d067710a763bed7f2437820
CRs-Fixed: 2295580
2018-08-13 16:28:43 -07:00
gaurank kathpalia
859c936a02 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.

Give max weight to those channles in the sap_compute_weight
but take the effect of those channels on the channels
present in the ACS scan list.

Change-Id: I51d14aa1bb9b280c6c4d9d0085de86cc7339a4f5
CRs-Fixed: 2290744
2018-08-09 04:24:10 -07:00
Rajeev Kumar Sirasanagandla
4015d747a2 qcacld-3.0: Remove eSAP_CH_SELECT from SAP FSM
Since, internal channel select is no longer in use and is obsolete.
Therefore, remove eSAP_CH_SELECT state from SAP state machine.

Change-Id: I7960999b983ddc1b5f6048aacbe92c500350a49b
CRs-Fixed: 2288258
2018-08-07 18:10:22 -07:00
Abhishek Singh
53791fa58b qcacld-3.0: Remove dead code related to driver acs
Support of ini to control driver acs is removed, therefore remove
related code which is no longer used.

Change-Id: I3d279de67ee5f36b785e4516edd9f14484311f5c
CRs-Fixed: 2284253
2018-07-31 15:25:37 -07:00
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