Commit Graph

448 Commits

Author SHA1 Message Date
Jeff Johnson
1856266cba qcacld-3.0: Replace hal in sap_module
Recently all instances of tHalHandle were replaced with mac_handle_t
to align with current usage and the Linux coding standard. To align
with the new naming now replace all instances of hal with mac_handle
in sap_module.

Change-Id: I8631e7b3cc4bdca564846bb2dee50e6c993087ef
CRs-Fixed: 2351898
2018-11-21 13:46:46 -08:00
Jeff Johnson
15f7829bbb qcacld-3.0: Replace hal in sap_fsm
Recently all instances of tHalHandle were replaced with mac_handle_t
to align with current usage and the Linux coding standard. To align
with the new naming now replace all instances of hal with mac_handle
in sap_fsm.

Change-Id: I560f99110bd38815c6e515006245f538d3dc6482
CRs-Fixed: 2351897
2018-11-21 13:46:38 -08:00
Jeff Johnson
7730fbbd64 qcacld-3.0: Replace halHandle in sap_ch_select
Recently all instances of tHalHandle were replaced with mac_handle_t
to align with current usage and the Linux coding standard. To align
with the new naming now replace all instances of halHandle with
mac_handle in sap_ch_select.

Change-Id: I4306005fb2677b1892272e2176e8cc73cb927d29
CRs-Fixed: 2351894
2018-11-16 14:55:36 -08:00
gaurank kathpalia
5f6919b0f4 qcacld-3.0: Skip ACS based on hw mode and STA's channel
If the STA is already present, and a SAP has to come up,
return the STA channel as the best channel, and skip ACS,
if the Hw_mode is set according to the STA channel
Eg:- STA on channel 1, and hw_mode is 11B, or 11G.
Also the driver doesnt check the DFS master mode, and
includes the DFS channels in the ACS scan list, which
may result in SAP bringup on a DFS channel

Check the conc_channel, and acs_policy ini, and return the
best channel as the STA channel.
Also exclude the DFS channels from the ACS scan list if
DFS master mode is disabled.

Change-Id: I70951d7b51b620db8cda7ed771d5c36a7571a125
CRs-Fixed: 2340965
2018-11-15 17:19:26 -08:00
Jeff Johnson
419348b1bc qcacld-3.0: Replace hHal in sap_module
Recently all instances of tHalHandle were replaced with mac_handle_t
to align with current usage and the Linux coding standard. To align
with the new naming now replace all instances of hHal with mac_handle
in sap_module.

Change-Id: I5422b4a7e1a464a8f870cea33069c47401c73bac
CRs-Fixed: 2349566
2018-11-15 15:18:10 -08:00
Jeff Johnson
793e5a9163 qcacld-3.0: Replace hHal in sap_api_link_cntl
Recently all instances of tHalHandle were replaced with mac_handle_t
to align with current usage and the Linux coding standard. To align
with the new naming now replace all instances of hHal with mac_handle
in sap_api_link_cntl.

Change-Id: I1248b01c4da617c307bc7262e32c32e069491d1c
CRs-Fixed: 2349565
2018-11-15 15:18:05 -08:00
Jeff Johnson
19681ce028 qcacld-3.0: Replace hHal in sap_fsm
Recently all instances of tHalHandle were replaced with mac_handle_t
to align with current usage and the Linux coding standard. To align
with the new naming now replace all instances of hHal with mac_handle
in sap_fsm.

Change-Id: I478b21a0e060b86c05025f3f8b1d46e196d7e93f
CRs-Fixed: 2349564
2018-11-15 15:18:01 -08:00
Jeff Johnson
60bfb3efd0 qcacld-3.0: Replace tHalHandle in sap_fsm
I9d0d7d109621237f29d66f7b06c5b63c38f63fb2 (qcacld-3.0: Introduce
mac_handle_t) introduced a "better" name for tHalHandle, so replace
tHalHandle with mac_handle_t in sap_fsm.

Change-Id: Ia61860e788b51c7becc6fc708a41f78e4658565d
CRs-Fixed: 2348557
2018-11-13 14:24:54 -08:00
Jeff Johnson
adf1313618 qcacld-3.0: Replace tHalHandle in sap_ch_select
I9d0d7d109621237f29d66f7b06c5b63c38f63fb2 (qcacld-3.0: Introduce
mac_handle_t) introduced a "better" name for tHalHandle, so replace
tHalHandle with mac_handle_t in sap_ch_select.

Change-Id: I204e955c7cda75bbed27a8653fbca4cca4f4b055
CRs-Fixed: 2348556
2018-11-13 14:24:53 -08:00
Jeff Johnson
6340ee0e43 qcacld-3.0: Replace tHalHandle in sap_api_link_cntl
I9d0d7d109621237f29d66f7b06c5b63c38f63fb2 (qcacld-3.0: Introduce
mac_handle_t) introduced a "better" name for tHalHandle, so replace
tHalHandle with mac_handle_t in sap_api_link_cntl.

Change-Id: I2d54133a841112486ecfd7a7971a1fcefa471cfc
CRs-Fixed: 2348553
2018-11-13 14:24:53 -08:00
Jeff Johnson
facce873dd qcacld-3.0: Replace tHalHandle in sap_module
I9d0d7d109621237f29d66f7b06c5b63c38f63fb2 (qcacld-3.0: Introduce
mac_handle_t) introduced a "better" name for tHalHandle, so replace
tHalHandle with mac_handle_t in sap_module.

Change-Id: Ib3dbaf58c4dd4408a09a099b233f94331f46075f
CRs-Fixed: 2348555
2018-11-13 14:24:53 -08:00
Jeff Johnson
610151f500 qcacld-3.0: Use mac_handle_t in sap_validate_chan()
Change "qcacld-3.0: Introduce mac_handle_t" introduced a modern
name for what was previously called the tHalHandle. Transition
sap_validate_chan() to use the new naming.

Change-Id: I5495d00a0fa2d1bef8d491788559fc9493797dd6
CRs-Fixed: 2347657
2018-11-13 02:43:41 -08:00
Jeff Johnson
6ccbec1f48 qcacld-3.0: Remove wlan_sap_set_pre_cac_status() handle param
Function wlan_sap_set_pre_cac_status() currently takes as one
parameter a tHalHandle handle.  This handle is converted into a MAC
context pointer. That MAC context pointer is then tested for NULL but
is otherwise unused.  Since the MAC context, and hence the handle, are
unnecessary, remove them.

This is part of an ongoing campaign to remove or replace all instances
of tHalHandle.

Change-Id: I1c280be8c7c65a28267a9ab38d76fb8aa94e48af
CRs-Fixed: 2347653
2018-11-09 18:21:53 -08:00
Jeff Johnson
d75a616eea qcacld-3.0: Remove CDS_GET_HAL_CB
Change "qcacld-3.0: Introduce sap_get_mac_context()" introduced a new
API for retrieving the MAC context. Since all instances of using
CDS_GET_HAL_CB have been converted, remove the macro.

Change-Id: Ib0ed67cf6af779d2805c3f7bb0cf3667c5d844f9
CRs-Fixed: 2346185
2018-11-09 15:24:57 -08:00
Jeff Johnson
689d522974 qcacld-3.0: Replace CDS_GET_HAL_CB in sap_module
Change "qcacld-3.0: Introduce sap_get_mac_context()" introduced a new
API for retrieving the MAC context. Update sap_module to use this API.

Change-Id: I906a57557d38b139728c7f2332e9580abf947d47
CRs-Fixed: 2346184
2018-11-09 06:36:15 -08:00
Jeff Johnson
682a14e5e9 qcacld-3.0: Replace CDS_GET_HAL_CB in sap_fsm
Change "qcacld-3.0: Introduce sap_get_mac_context()" introduced a new
API for retrieving the MAC context. Update sap_fsm to use this API.

Change-Id: Id4f81e12d2544e1de5d35b0360b6a7dd0e3b3c0b
CRs-Fixed: 2346183
2018-11-08 21:03:12 -08:00
Jeff Johnson
53c3827251 qcacld-3.0: Replace CDS_GET_HAL_CB in sap_api_link_cntl
Change "qcacld-3.0: Introduce sap_get_mac_context()" introduced a new
API for retrieving the MAC context. Update sap_api_link_cntl to use
this API.

Change-Id: Icb5cfb0db4acaf7ee58e9527feded83c88bcb8d3
CRs-Fixed: 2346182
2018-11-08 21:03:08 -08:00
Jeff Johnson
03d1e2c428 qcacld-3.0: Introduce sap_get_mac_context()
Currently the macro CDS_GET_HAL_CB() is used throughout the SAP to
retrieve an opaque handle for the MAC context. This name is an
anachronism given that the HAL layer was moved to firmware many
generations ago. In addition, since the SAP module is internal to the
UMAC, it should normally not be dealing with the opaque handle but
should instead be dealing directly with the MAC context. Finally, per
the coding style, "inline functions are preferable to macros
resembling functions."

To address these issues introduce sap_get_mac_context(), a new inline
function, to replace the current usage of CDS_GET_HAL_CB().

Subsequent changes will actually perform the replacement.

Change-Id: I53160f7f5a315516f5348baea8cc7945483431bd
CRs-Fixed: 2346181
2018-11-08 21:03:03 -08:00
Liangwei Dong
ab3dcd4033 qcacld-3.0: Fix override chan issue
When override sap channel, call wlan_reg_set_channel_params
to update ch_params.

Change-Id: I4086ec8fea0d68547a1080b0ef455a0e9f64c0b7
CRs-Fixed: 2333666
2018-11-06 16:16:03 -08:00
Abhishek Singh
ec7e31a70a qcacld-3.0: Do not register SAP as requestor again after reinit
During SSR the sap context is reinitialized and it request for
scan request id again deleting the older request id from scan module
this can lead to situation where the scan requestor list is filled by
SAP request id's and thus next request for request id will return 0.

Now during de init when it try to delete the requestor id 0 it delete
the 0th entry which is for CFG. Now if again SAP register the request
id it will get the 0th index which was freed and thus when CFG
requests a scan the sap callback is called instead of CFG leading to
NULL pointer access.

Fix this by not registering for request id again after SSR for SAP.

Change-Id: Ibc8ad0700b602a9c3d2769d979303499df8d6605
CRs-Fixed: 2341133
2018-11-01 07:40:42 -07:00
Abhishek Singh
8d11564b56 qcacld-3.0: Fix memory leak of sap_ctx->channelList
In sap_deinit_ctx() the check to free sap_ctx->channelList is after
sap_ctx is memset to 0 and thus sap_ctx->channelList will always be
NULL and memory will never get freed.

Also there is no need to reset scan_vdev_del_in_progress after vdev
is deleted in firmware as there still can be the race when scan is
processed. scan_vdev_del_in_progress will be deleted with obj_mgr
vdev so no need to reset it.

Change-Id: Ie5f133d4db48485434436e67ce1643d8e1e04106
CRs-Fixed: 2342039
2018-11-01 04:20:16 -07:00
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