Commit Graph

1897 Commits

Author SHA1 Message Date
Paul Zhang
09849da4ce qcacmn: ignore WMI_REG_CHAN_LIST_CC_EVENTID
If reg offload is disabled, then ignore the processing of
WMI_REG_CHAN_LIST_CC_EVENTID in regulatory module.

Change-Id: I5da0cdf2c80357d03199fa367137cc236f4c3307
CRs-Fixed: 2625784
2020-03-07 14:33:48 -08:00
Abhishek Singh
d9e7ba7cc6 qcacmn: Optimize logging in crypto module
Optimize logging in crypto module.

Change-Id: I4da7dfcaae81f9a6511bce5b422b5e81faa189ef
CRs-Fixed: 2635263
2020-03-05 14:02:14 -08:00
Hariharan Basuthkar
ee4dcfe6d7 qcacmn: Add the API wlan_reg_get_band_cap_from_op_class
Add the API wlan_reg_get_band_cap_from_op_class to get the supported
band capability from an list of operating class as input.

Change-Id: I58dc0bbe7c5436b889c12ac2d68bd769a3c702cf
CRs-fixed: 2617526
2020-03-04 01:27:27 -08:00
Liangwei Dong
54be27be16 qcacmn: Add an API to get frequency from country,chan,opclass
Add wlan regulatory API reg_country_chan_opclass_to_freq
to calculate channel frequency given country, opclass and channel
number. The API gets channel frequency from country's operating
class table by opclass and channel number pair. If the driver
can not find the pair, then try to find the frequency (MHz) by
channel number only.

Change-Id: I6a23a53e2e53e0b7c81b36f9f5c7794e9749c734
CRs-Fixed: 2605920
2020-03-03 22:20:37 -08:00
Abhishek Singh
5b92984b0b qcacmn: Optimize cp stats prints
Optimize cp stats prints

Change-Id: Idbaa19cc22e2ebcefdbae08169071203cd6ccc49
CRs-Fixed: 2633501
2020-03-03 18:55:32 -08:00
Amar Singhal
12105f94d1 qcacmn: Fix auto BW calculation
Auto BW computes new bandwidth for adjacent regulatory rules. But this
combined bandwidth can be more than the bandwidth allowed for a
particular reg-domain. So relax the check for combined BW for
adjacent regulatory rules.

Change-Id: I1486988c114f0348f7228b91aeadc5c027c6a510
CRs-Fixed: 2626165
2020-03-03 14:18:03 -08:00
aloksing
8bfa58f189 qcacmn: spin-lock init before get ref while peer attach
spin lock is called without init while peer attach
move spin-lock init before get ref

Change-Id: Ibf21ac6a7b06c62f2e64a2d89154b21183b9c472
CRs-Fixed: 2628750
2020-03-03 14:17:46 -08:00
aloksing
2877d23b09 qcacmn: Add dbg id to string_from_dbgid
Array strings of size 73 may use index value(s) 73..74
Adding dbg ids to strings same as wlan_objmgr_ref_dbgid

CRs-Fixed: 2632424
Change-Id: I8eac1c4f015d54c626c2e74891d8c86ccfb962e4
2020-03-02 16:02:02 -08:00
Vignesh U
0c37ce5603 qcacmn: Add chirp radar detection support for MKKN
So far, only MKK4 and FCC DFS domains supported Chirp RADAR. But with new
Japan regulation, JP country which is mapped to MKKN DFS domain should
also detect the MKK4 DFS domain's Chirp RADAR.

Add Chirp RADAR detection support for MKKN DFS domain.

Change-Id: Iafd952d70726c9a9b85e73607d4a23c5022b8a46
CRs-Fixed: 2630894
2020-02-28 13:39:25 -08:00
hqu
fe04486a96 qcacmn: Define WLAN_DCS_MAX_PDEVS for dcs use
For MCL side, WLAN_UMAC_MAX_PDEVS is always 1 from current design,
so it's wrong to use WLAN_UMAC_MAX_PDEVS define array dcs_pdev_priv,
since dcs_pdev_priv includes firmware indicated pdev dcs information,
define WLAN_DCS_MAX_PDEVS to 3 for dcs use, this will be compatible
for both MCL and WIN side.

Change-Id: I3bac35f561c49e9959645e85774662ff48d7903d
CRs-Fixed: 2627683
2020-02-27 14:52:33 -08:00
Adwait Nayak
99a4329e07 qcacmn: CFR: code clean up
Remove unnecessary inclusion of cfr_api.h
and fix the return types

Change-Id: I85fb45777e527b46ad086a3d3211cdf6019312ec
CRs-Fixed: 2609610
2020-02-27 14:52:15 -08:00
Nirav Shah
5ad9b66679 qcacmn: Disallow TKIP/WEP with HT supported client
As softap, send assoc failure if HT supported client try to associate
as WEP/TKIP pairwise key.

Change-Id: Ie33e5d83ec18e10aae51a4cc3515f754bd24774e
CRs-Fixed: 2623660
2020-02-26 20:47:06 -08:00
Amar Singhal
c0de18fdc6 qcacmn: Fix maximum bandwidth in regulatory rules
Regulatory rules cannot have maximum bandwidth more than the
width of the rule. Fix this logic for six ghz regulatory rules.

Change-Id: Icbd4eb95d4de54acaef0aa635c293451ba4e1987
CRs-Fixed: 2620699
2020-02-26 14:57:06 -08:00
hqu
e6d0730c6b qcacmn: Rename is_target_pdev_id to is_host_pdev_id
It's more suitable that rename is_target_pdev_id to is_host_pdev_id.

Change-Id: I5ec8971ac564e1a26f1b544f9bc2cc08e29f949d
CRs-Fixed: 2627802
2020-02-26 11:40:32 -08:00
Sumedh Baikady
d188789876 qcacmn: Enhancement in Minidump feature
Handle minidump logging using dynamic
configurablity options. Data structures
to be logged in minidump can be configured
using internal INI file.

Change-Id: I99f12b3f98c4a9c0e15c3e5d611019e6b8d0909a
2020-02-26 08:35:46 -08:00
Liangwei Dong
5d64a83690 qcacmn: Add pmksa based on SSID and cache id
For FILS pmksa cache, the pmksa add/del/query is based on SSID
and cache id. The current crypto pmksa cache API dosn't support
SSID and cache ID.

1. Add SSID/Cache ID support to pmksa API
2. Add RSN IE pmkid field based on SSID/cache ID

Change-Id: I1577c6293b75d6f8e6210f314dd83462e06d8190
CRs-Fixed: 2621860
2020-02-26 06:42:56 -08:00
Liangwei Dong
4f2b0feab6 qcacmn: Fix memory leak in get_station_stats_cb
There is memory leak in get_station_stats_cb:
priv->vdev_summary_stats, priv->vdev_chain_rssi,
priv->peer_adv_stats. But the “request” is not leaked,
that means the “.dealloc” should be called.
The suspect is the get_station_stats_cb was called two
times with same cookie (request) before the "request"
was freed, that caused the priv->vdev_summary_stats
and the others two member of "priv" were overwritten,
and then memory leaks.

From the cp stats components there are multiple places
to call ucfg_mc_cp_stats_reset_pending_req to reset the
unused pending.req(has a cookie) to zero.  The zero
cookie may be used in again.

Change the ucfg_mc_cp_stats_reset_pending_req API to do
atomic operation of "reset" and "get" last pending
request.

Change-Id: I5efb7efec4da1edc0aab33b940dc126012a3f12e
CRs-Fixed: 2622444
2020-02-25 21:58:50 -08:00
Amar Singhal
c749787a01 qcacmn: Fix definition of function reg_freq_width_to_chan_op_class_auto
Fix definition of function reg_freq_width_to_chan_op_class_auto

Change-Id: I92504d992153f6ee2dd6d31b2d2976822505856a
CRs-Fixed: 2626433
2020-02-25 15:32:54 -08:00
Ashish Kumar Dhanotiya
48934773cd qcacmn: Reduce regulatory logging
As part of logging optimization, reduce the
logging from regulatory component.

Change-Id: If81f87b06e111cffb9189cae20a1acc66849678d
CRs-Fixed: 2624108
2020-02-25 10:59:06 -08:00
Santosh Anbu
fdd3a5b314 qcacmn: Increase vdev id bitmap size
Add change to increase vdev id bitmap size to the number of vdev ids
bitmap as sent by the FW to avoid memory overflow on host.

Change-Id: I92a2ae31cf0079c989b1788afc61e7f3153dc426
CRs-Fixed: 2626887
2020-02-25 04:48:49 -08:00
Karthik Kantamneni
dfdfce1e58 qcacmn: Fix compilation error in vipertooth build
Fix compilation error in reg_country_opclass_freq_check
return false when HOST_OPCLASS is disabled.

Change-Id: Ib03e544311ae0a6c3496711f303ad17d490900ba
CRs-Fixed: 2624546
2020-02-24 23:37:15 -08:00
Hariharan Basuthkar
a6d77e7dbd qcacmn: Start Host wait timer and then send radar_params to FW
When radar is detected on a channel and the radar parameters are sent to
FW, the Host Wait Timer expires even though the action status is
received from FW. At this point, the VAP state machine sends a
multivdev restart on the target channel, and is in restart progress
substate.

Since the Host Timer expires due to some reason, radar detect event is
posted to vdev state machine, that is currently in restart progress
state and, this causes a target assert and leads to kernel panic.

This issue is solved by the following 2 ways:
1) Start the host wait timer first, and then send the radar found
   params to the target.
2) Check if dfs_is_host_wait_running is true, in the Host Wait Timer's
   timeout, and only then call the radar_found_action_generic API.

Change-Id: I9b93c7c1822966f7d6bc00c00229849fdb5627d9
CRs-Fixed: 2604173
2020-02-21 21:27:51 -08:00
Abhinav Kumar
90d227ce32 qcacmn: Support sae single pmk roaming BSS in scan
"WPA3-SAE Single PMK" is a feature by which STA can
complete SAE roaming to specific group of AP(s) using
single PMK. This is done with the help of advertising
vendor specific SAE single PMK IE in the beacon/probe.

When vendor specific sae single pmk IE (oui 0x00 40 96,
type 0x03) is present in the beacon/probe of AP then the
BSS supports WPA3-SAE roaming using Single PMK.

Add changes in scan module to parse the Vendor specific
SAE single PMK IE and copy it to the scan_entry ie_list.

Change-Id: I5b7096d1360c624ce1c47e56e8cad37adbdda1e3
CRs-Fixed: 2616099
2020-02-20 18:11:53 -08:00
Ananya Barat
9a4c328738 qcacmn: Populate the correct opclass for 6G channels
For the 6G band, the only valid opclass_table is the global_op_class
as per the current specification. Therefore, if the band is 6G set the
opclass to global_op_class instead of the default us_op_class.

As per specification for chan width 40 MHz, there is no behav limit
for both Low Primary and High Primary channels. Hence, set behav limit
as BIT(BEHAV_NONE) if channel width is 40 MHz.

Change-Id: I534f5b898e10cf21042a117aa71e824a85d73fb3
CRs-Fixed: 2608059
2020-02-20 08:33:03 -08:00
Aditya Sathish
6287db0784 qcacmn: Add 6GHz support for chan/freq/band usage in scan
Currently the conversion APIs used doesn't take into account
the overloading of channel numbers between 6GHz, 5GHz and 2.4GHz
bands.

Add support to obtain the correct channel number (and auxiliary
information like band and frequency) through the new APIs that
support all three bands.

Change-Id: Ic2c8dfa4cc845d701dfd07df61c9ae1ee3d8bdef
CRs-Fixed: 2610378
2020-02-20 08:32:32 -08:00
Aditya Sathish
14e285e95c qcacmn: Add 6GHz support for chan/freq/band usage in dfs/reg
Currently the conversion APIs used doesn't take into account
the overloading of channel numbers between 6GHz, 5GHz and 2.4GHz
bands.

Add support to obtain the correct channel number (and auxiliary
information like band and frequency) through the new APIs that
support all three bands.

Change-Id: Ief417f14620bc2fc02d76fea3642b6fbb9615916
CRs-Fixed: 2610378
2020-02-20 08:32:16 -08:00
Ashish Kumar Dhanotiya
07810f61ce qcacmn: Reduce logging while printing channel list
As part of logging optimization, reduce logging while
printing channel lists.

Change-Id: I0241dc4dbaa3879bbe354a0e4750a0d559d1ba40
CRs-Fixed: 2624517
2020-02-19 19:26:27 -08:00
Sourav Mohapatra
9fae7f7537 qcacmn: Clean up logs in STATS path
Clean up logs in STATS request and response path.

Change-Id: I45135233eb4c10793dc9c62f28d91c49183a0a09
CRs-Fixed: 2618310
2020-02-19 04:58:56 -08:00
Himanshu Batra
f4149ccaa2 qcacmn: Add multivdev restart wait timeout
In the current implementaion, if multivdev restart req is not sent
due to error cases, then the multivdev restart timer gets restarted
after every timeout and the vdev sm is stuck in same state.
Add multivdev restart timeout wait counter and assert after the wait
timeout expires.

Change-Id: I12b10fb7d880e7fcf3dd02d1e38397aa2e3aebe7
CRs-Fixed: 2621231
2020-02-19 01:57:59 -08:00
Vignesh U
637fcad8e5 qcacmn: Add external dfs filters whenever available
Query the external radar source and if external radars are
available use the external radars in addition to the internal
radars.

Change-Id: I9fe42ecaaf949f8e504c35ecb8cffb3e9e809fd0
CRs-Fixed: 2615278
2020-02-18 20:56:54 -08:00
Linux Build Service Account
1d96209158 Merge "qcacmn: Enable external processing of radar" 2020-02-18 15:37:23 -08:00
Santosh Anbu
b59fbe7504 qcacmn: Reduce log level of serialization deinit
Add change to reduce log level for the serialization deinit
debug string as part of bootlog cleanup.

Change-Id: Ibf1cf8352df053df0dba6239f503b868a870a04d
CRs-Fixed: 2623638
2020-02-18 12:48:45 -08:00
Santosh Anbu
cba0c2f7c5 qcacmn: Return status of multivdev restart request
Add change to return the status of multivdev restart request sending
to FW.

Change-Id: I48501323761256beac3b86e1b3cd3b476ee3ce82
CRs-Fixed: 2622200
2020-02-18 08:10:58 -08:00
Vignesh U
265b3cb98d qcacmn: Enable external processing of radar
Enable external processing of confirm radar.

Change-Id: I241b73c93301728489342dd47fb130f366290aa0
CRs-Fixed: 2615270
2020-02-17 04:49:42 -08:00
Jianmin Zhu
c310645579 qcacmn: Fix get peer stats cmd timeout
Request is cleared before response for race condition between request
thread wificond and response work thread.
1. wificond thread sent get peer request and waited for
response.
2. worker thread got response from F/W, completed the request.
3. Wificond got the response, finished the request.
4. wificond triggered another get peer request, created
new request, set pending request bit TYPE_PEER_STATS.
5. Kworker thread clear the pending request bit
TYPE_PEER_STATS.
6. Cleared request TYPE_PEER_STATS couldn't be completed any
more, wificond thread waited for 1.6s, timeout happened.

Fix: Clear pending request bit TYPE_PEER_STATS before
complete the request, make sure old pending request bit is
cleared before new request of same type is set.

Change-Id: I058cada5fa870d95172122364903bff2b31eb277
CRs-Fixed: 2621914
2020-02-16 13:08:27 -08:00
Amar Singhal
70259d6252 qcacmn: Define a new regulatory API for frequency check
Given country from country IE and operating class, check
whether a channel frequency belongs to that pair.

Change-Id: I9bf711b2c52ad230a3066113a5aa7b8959219754
CRs-Fixed: 2620767
2020-02-16 02:05:29 -08:00
Vinay Gannevaram
2250592dcd qcacmn: Add support to get fwr phymode for frequency
Currently, wifi-pos uses channel number to get the fwr phymode.
For adding 6g support wifi-pos need to get the phymode from
frequency instead of channel number
As a part of fix, Add handler for getting phymode based on
frequency

CRs-Fixed: 2617903
Change-Id: I007edebe41bf5ca750a1262c85043f628dc9f89f
2020-02-15 04:43:36 -08:00
Ashish Kumar Dhanotiya
35152d5562 qcacmn: Add support to dynamically set dwell time for 2g
Currently there is no support to dynamically set dwell time
for 2g channels.
Add support in existing command SETDWELLTIME to dynamically
configure dwell time for 2g channels.
Along with set, add support to get dwell time for 2g channels
with the existing driver command GETDWELLTIME.

Change-Id: I8a71e39338e7a81690140f50bc3c5ac7b0bd63eb
CRs-Fixed: 2620370
2020-02-14 04:18:27 -08:00
Jianmin Zhu
587fdeec25 qcacmn: Fix get station stats cmd timeout
Request is cleared before response for race condition between request
thread wificond and response work thread.
1. wificond thread sent cp_stats_get request and waited for
response.
2. worker thread got response from F/W, completed the request.
3. Wificond got the response, finished the request.
4. wificond triggered another cp_stats_get request, created
new request, set pending request bit TYPE_STATION_STATS.
5. Kworker thread clear the pending request bit
TYPE_STATION_STATS.
6. Cleared request TYPE_STATION_STATS couldn't be completed any
more, wificond thread waited for 1.6s, timeout happened.

Fix: Clear pending request bit TYPE_STATION_STATS before
complete the request, make sure old pending request bit is
cleared before new request of same type is set.

Change-Id: I7b89571b1e95a6e17aec9d649bd3adfccf3eb02e
CRs-Fixed: 2619370
2020-02-13 22:09:31 -08:00
hqu
fed4bfb049 qcacmn: Add dcs component
Add dcs component to implement interference detection algorithm
and dynamic channel selection frequency control.

Change-Id: Ia201d77e77feb9de3aff03d6e389d4891dde118e
CRs-Fixed: 2594837
2020-02-13 04:12:30 -08:00
Hariharan Basuthkar
a6a139298a qcacmn: Add an API reg_get_center_channel in the Regulatory
In a SON WFA testcase, the QCA AP advertises the channel set in
operating class 128 as individual IEEE channel number (for eg. 36, 40,
44, 48 etc.) instead of center channel (for eg. 42, 58, 106 etc.) to
the third party AP.

As a result, the third party AP creates Front Haul VAPs in High Band
radio when the QCA AP is configured to Low Band, due to incorrect
channel set advertised to it.

To fix this issue, add an API reg_get_chan_or_chan_center to
calculate the center channel number for a 80MHz, 80_80 MHz and 160
MHz bandwidth channel, and use it to calculate the center channel
number within the channel set for a particular operating class in the
operating class table.

Change-Id: Idf7df70c8d01ed79b43d0ba21db7b07189f3f710
CRs-Fixed: 2612258
2020-02-12 23:17:28 -08:00
gaurank kathpalia
85d4f03587 qcacmn: Set DBS scan if ndp peers are active
Currently on the STA interface if the scan
comes the driver puts it to NON-DBS scan if the
high accuracy request comes, but if the NDP
peers are active this causes a throughput loss
as scan takes much time to complete.

Fix is to do a DBS scan if the NDP peers are
attached to a NDI interface.

Change-Id: I798fd388f2bf010304ba1f6777680cf4d1f3ccfb
CRs-Fixed: 2615541
2020-02-12 21:48:30 -08:00
Liangwei Dong
bb0b78c688 qcacmn: Set dfs_set_cfreq2 with correct DFS flag
In MCL code, QCA_DFS_NOL_OFFLOAD is no defined,
which causes the utils_is_dfs_cfreq2_ch always return
"false".
In function vdev_mgr_start_param_update
the "dfs_set_cfreq2" needs to be set correct dfs flag from
utils_is_dfs_cfreq2_ch so that vdev start wmi command will include
correct DFS flag - WMI_CHAN_FLAG_DFS_CFREQ2 for AP home channel.

Move utils_is_dfs_cfreq2_ch function out of WLAN_DFS_FULL_OFFLOAD
and QCA_DFS_NOL_OFFLOAD build flag.

Change-Id: I341db02c4db3ad3b21d8b2c115b2baffc3df3164
CRs-Fixed: 2619273
2020-02-12 09:55:06 -08:00
Amruta Kulkarni
65f217ba99 qcacmn: Cleanup for function wlan_reg_is_dfs_ch()
Replace wlan_reg_is_dfs_ch() with wlan_reg_is_dfs_for_freq()

Change-Id: Idb40beeea3ba07e133f3346b46998ae9ac549ba7
CRs-Fixed: 2615754
2020-02-10 20:36:44 -08:00
Shashikala Prabhu
29aca291c5 qcacmn: Add WMI support for native 160MHZ
A service bit is added to indicate Firmware supports sending NSS ratio
information to Host and Host receives the NSS ratio information from
Firmware as part of service ready ext event. Save this service bit in
soc's extcap feature bit. Extract the NSS ratio info from service ready
ext event and save the results in wlan_psoc_host_mac_phy_caps structure
to calculate NSS value.

Change-Id: I8fbee48d872b0724bbb629ad38b3c959736a3c39
CRs-Fixed: 2612959
2020-02-07 20:06:29 -08:00
Abhishek Singh
d0708ac038 qcacmn: Print type while creating the obj manager peer
Print type while creating the obj manager peer.

Change-Id: I04df87c3c7a992406a19c99560f85d6777198761
CRs-Fixed: 2617007
2020-02-07 03:06:55 -08:00
Abhishek Singh
d52ee762bc qcacmn: Use qdf_scnprintf in scan instead of snprintf
Use qdf_scnprintf instead of snprintf to log channels to store
the freq list and print.

Change-Id: I4e2f4a93f3de9b9937af3699bde00bb2d1066ca5
CRs-Fixed: 2615319
2020-02-05 22:40:34 -08:00
Arun Kumar Khandavalli
fc4ac73e9b qcacmn: Selectively reduce the mgmt logs
Reduce loglevel of the management logs from info to debug.

Change-Id: I587357c14b1e7a79615af9c1eeeed8e4455234f0
CRs-Fixed: 2606506
2020-02-04 23:26:22 -08:00
gaurank kathpalia
59b431a029 qcacmn: Optimize logs in serialization
Optimize the logs in serialization.

Change-Id: I0148a4d0799102817167b19e27cca609570e3b02
CRs-Fixed: 2612823
2020-02-04 06:06:50 -08:00
Srinivas Pitla
9632da7583 qcacmn: debugfs support for sm history
SM history is redirected to debugfs for user to redirect
it to a file

Change-Id: I7670be9dbccaaef868e472062c1ee97635bd29d5
CRs-Fixed: 2613250
2020-02-04 00:34:00 -08:00