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
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
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
Do sap_ctx release for all DFS "Ignore" case.
Otherwise, the ref count may mismatch.
Change-Id: Ib3d7c416ec3942f4d0317825fa504bc2b5abd968
CRs-Fixed: 2297787
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
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
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
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
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
Support of ini to control driver acs is removed, therefore remove
related code which is no longer used.
Change-Id: I3d279de67ee5f36b785e4516edd9f14484311f5c
CRs-Fixed: 2284253
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
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
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
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
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
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
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
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
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
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
The tSirRetStatus definitions are obsolete, so replace them with
QDF_STATUS definitions in the sap folder.
Change-Id: I17482713977012d13e0fdb99b67e3f5f4a33efe9
CRs-Fixed: 2266146
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Rename typedef tsap_Config_t and the underlying struct sap_Config to
align with the Linux coding standard.
Change-Id: I6e8f8b5ab9555c7781f1acf12a0475902866300c
CRs-Fixed: 2237721
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
Add a check against for NULL pointer before accessing roam_info
object pointer.
Change-Id: Id03a47761fa9624ddf76305f110f1f83bcb0a7cd
CRs-Fixed: 2232419
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