Commit Graph

260 Commits

Author SHA1 Message Date
Jeff Johnson
550966209c qcacmn: Rename DFS offset macros
Rename the following macros to fix the spelling of "OFFSET":
DFS_OFFET_FIRST_LOWER
DFS_OFFET_SECOND_LOWER
DFS_OFFET_FIRST_UPPER
DFS_OFFET_SECOND_UPPER

Change-Id: If0568a8f87ad276d3bda26639b1b1dbfb91a0d6d
CRs-Fixed: 2241589
2018-05-19 19:40:45 -07:00
Jeff Johnson
c3e125cc8d qcacmn: Rename DFS_80_NUM_SUB_CHANNNEL
Rename DFS_80_NUM_SUB_CHANNNEL to fix the spelling of "CHANNEL".

Change-Id: I8a1f03a4bf853125b06d4422ea47d3735bb98c67
CRs-Fixed: 2241585
2018-05-19 19:40:43 -07:00
Jeff Johnson
da0a82610b qcacmn: umac: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: I34c7acfad802a3878ffa373489b7f6a4194abb62
CRs-Fixed: 2230684
2018-05-18 02:17:46 -07:00
Jeff Johnson
4cee5cf7cc qcacmn: Fix typo "seperate"
Replace typo "seperate" with correct spelling "separate".

Change-Id: I742473a16b79c5b91722c3642c983a7fa6dfd252
CRs-Fixed: 2238309
2018-05-17 00:46:54 -07:00
Abhijit Pradhan
b847c69bf1 qcacmn: Do not process bangradar command in NON-DFS channel
FW, on receiving the bangradar command from host, suspends the
scheduler/tx-traffic and resumes only after the channel is switched.

For a bangradar in non-DFS channel, host does not send the channel
switch command. Hence, the tx_traffic are not  resumed.

When the user issues a bangradar, forward it to FW only if the current
channel is a DFS channel.

Change-Id: Id1f969dd7654e540a1c637632122cf2c6b543123
CRs-Fixed: 2225953
2018-05-15 04:34:01 -07:00
Arif Hussain
8add0f7fbb qcacmn: Fix validation in dfs_process_phyerr_owl()
Fix validation in dfs_process_phyerr_owl function.

Change-Id: I0c97e7c18e1e93a248f325ff6f9b477c4135c486
CRs-Fixed: 2233111
2018-05-11 23:57:05 -07:00
Krunal Soni
3370ea52d1 qcacmn: Fix uninitialize variables in few policy manager APIs
Few variables are left uninitialized and they are being used
with some random value.

Fix by initializing to default value.

CRs-Fixed: 2232791
Change-Id: I3351cae52c58e963601d53376f42ca8ebf0d3b9a
2018-05-07 06:37:09 -07:00
Abhijit Pradhan
231d7df5d3 qcacmn: Add Radartable related changes for ETSI14_WORLD
Adjust radartable start offset for ETSI14_WORLD

Change-Id: I8d8f1019248c184b4e2a92a3b544be4358793812
CRs-Fixed: 2233349
2018-05-03 09:12:57 -07:00
Abhijit Pradhan
3c843340f8 qcacmn: Assign radar table for ETSI12 and ETSI13
Assign appropriate ETSI 302-502 Radar Pattern for ETSI12 and ETSI13.

Change-Id: I87e04f1bda919698c3dcca990a07252a0b881190
CRs-Fixed: 2223516
2018-04-14 21:55:49 -07:00
Abhijit Pradhan
2ed63d0e1a qcacmn: Reset delayline even for zero bin5 radars
It is valid for dfs->dfs_rinfo.rn_numbin5radars to be 0. If it is zero
then the malloc returns NULL and we skip dfs_reset_alldelaylines.

Skip dfs_reset_alldelaylines in case of non-zero malloc failures. Also
move the dfs->dfs_b5radars NULL check just before accessing
dfs->dfs_b5radars memory.

Change-Id: I0aba9d2357672e2c5bc6c5c3857cb06194381e2f
CRs-Fixed: 2215846
2018-04-14 07:37:50 -07:00
bings
beb9318263 qcacmn: Adjust the bin5 rssi threshold in radar filters
Radar bandwidth detection at certain frquencies is reported to
be lower than the acceptable threshold.  This is due to the low
rssi reported in the phyerrors.

Fix the issue by adjusting the rssi threshold accordingly.

Change-Id: Id00e6ae4722d1f4c820037a4014a86953abc6650
CRs-Fixed: 2224053
2018-04-14 07:37:42 -07:00
Shashikala Prabhu
e466b5a811 qcacmn: Use qdf spin lock bh in DFS component
Use QDF spin lock BH APIs in DFS component since
DFS can run in software interrupt context.

Change-Id: Id068b8e49023c52796b5d9ce76dac378b4ce4b1e
CRs-Fixed: 2218947
2018-04-10 02:33:25 -07:00
Yuanyuan Liu
80bfeb949d qcacmn: Fix LLVM compiling issues
Remove typedef redefinition, use correct enum type, remove extra
parentheses and correct header guard.

CRs-Fixed: 2214003
Change-Id: I0a75c70cd530590a16f6bfa884955ebc26906de0
2018-04-02 16:41:52 -07:00
Edayilliam Jayadev
2703fafbe2 qcacmn: Use new phymode for vht in 2G
Today for VHT in 2G, we are sending WMI_HOST_MODE_11NG_HT20/40
as phymode values to FW. Change this to WMI_HOST_MODE_11AC_VHT40/20_2G
which are dedicated phymodes defined for VHT operation in 2G.
This change is applicable only for tlv based chipsets.

CRs-Fixed: 2205265
Change-Id: I9482bfd1834285a21b5a45b6c039a13e9cd80479
2018-03-29 06:57:55 -07:00
Abhijit Pradhan
ed8c9d3bc8 qcacmn: Have separate macros for DA/PO/FO to reduce the code size
Since, an AP may have any combinations of DA,PO, and FO chips on it,
having support for all chips always is redundant. Therefore, enable the
chip specific code as and when required.
DA:- Direct attach
PO:- Partial offload
FO:- Full offload
WLAN_DFS_DIRECT_ATTACH    :- enable/disable DA specific DFS code.
WLAN_DFS_PARTIAL_OFFLOAD  :- enable/disable PO specific DFS code.
WLAN_DFS_FULL_OFFLOAD     :- enable/disable FO specific DFS code.

Change-Id: I498ac1f8cd1d6423032d7b3b8c233656c5f0bf22
CRs-Fixed: 2199819
2018-03-23 03:18:32 -07:00
Manikandan Mohan
b5387d4102 qcacmn: Fix export symbol for multi drivers compilation
Update dfs module files to use qdf_export_symbol to facilitate
multiple driver module compilation support.

Change-Id: Ib1b9605b7c017b1f366fe01b8f7e1ca0379fe217
CRs-fixed: 2197751
2018-03-19 19:58:18 -07:00
bings
7fd216a629 qcacmn: 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: 2204683
2018-03-15 11:51:18 -07:00
Abhijit Pradhan
f83b87ed16 qcacmn: Print radar found string when usenol is set to 0 or 1
Print radar found string when usenol is set to 0 or 1.

Change-Id: I051a223c78c40ce9023e9c32bcf3dfaf7ec6e5a0
CRs-Fixed: 2204257
2018-03-14 22:34:12 -07:00
Abhijit Pradhan
93caac752f qcacmn: Fix DFS NOL KW issues
Initialize the timer object to zero before using it.

Change-Id: I54ccb203bc096a382f670738e7e3f18d2aa69c8e
CRs-Fixed: 2202873
2018-03-09 16:31:13 -08:00
bings
a823ce622a qcacmn: Adjust the bin5 rssi threshold in radar filters
Radar bandwidth detection at certain frquencies is reported to
be lower than the acceptable threshold.  This is due to the low
rssi reported in the phyerrors.

Fix the issue by adjusting the rssi threshold accordingly.

Change-Id: Ia1598342e33b1217a1fb163878b2ac42661b33af
CRs-Fixed: 2184681
2018-02-27 21:17:17 -08:00
Shashikala Prabhu
249ddc70eb qcacmn: Fix radar detection failure for 11A mode
AP does not add the RADAR found channels to NOL when user configures
the AP in 11A mode. This is because, dfs_get_bonding_channels()
returns the number of bonding channels as 0 for 11A mode. Hence, the
radar detected channel are not added to NOL.

Add change to get bonding channels for 11A mode.

Change-Id: I88db7f1241c5915021071e9caa1cfb8b7fa94c7f
CRs-Fixed: 2195597
2018-02-26 21:44:50 -08:00
Abhijit Pradhan
5b96a30800 qcacmn: Fix for zero-CAC DFS Kernel panic
Remove elements from the correct lists.

Change-Id: Idda91238510fa89fdfb2451274f0da44f5e2f1f0
CRs-Fixed: 2185021
2018-02-23 23:46:29 -08:00
Arif Hussain
c8fe4680ae qcacmn: Fix sending dfs offload enable command sequence
Currently dfs offload command is sent during event registration
when psoc object is created. Dfs offload command is sent by accessing
pdev object, as pdev object during this time may not be created
or maybe in logically deleted state and sending command may fail.
This failure may cause wifi_dfs_psoc_enable and thereby effecting
other module objects.

To fix this, avoid using pdev objects during psoc enable, and send
pdev object specific command when pdev is created.

Change-Id: Ia10d493267259d0fbd918453e532b4f244029163
CRs-Fixed: 2179845
2018-02-23 06:05:56 -08:00
Arif Hussain
5aa8c07392 qcacmn: Add support to mark bonding channels to nol
If sub-channel marking is not supported then make sure to
add all the dfs channels in bonding channel list to NOL.

Change-Id: I27d738974bb2b2cfdb9dbcd944f5843cc3aeed93
CRs-Fixed: 2164692
2018-02-08 19:46:07 -08:00
bings
0c590ceba4 qcacmn: Move dfs leakage from qcacld to qcacmn
Move dfs leakage from qcacld to dfs module of qcacmn.

Change-Id: I17276fedf575f1a4029265be58d8fd088c1d956d
CRs-Fixed: 2177679
2018-02-04 21:43:31 -08:00
Srinivas Pitla
ee54aea6d8 qcacmn: Add target_if changes to DFS
Use target_if APIs to get dfs offload capability

Change-Id: Ic23770b0407e33e4b031bbbc4a8224663ac57e32
CRs-Fixed: 2177109
2018-02-03 15:11:02 -08:00
bings
276c0f1969 qcacmn: Use new APIs to get and set DFS Non-Occupancy-List(NOL)
Current driver is using pld_wlan_set_dfs_nol() and pld_wlan_get_dfs_nol()
directly through eSAP_DFS_NOL_SET and eSAP_DFS_NOL_GET case statements
respectively within HDD module. These methods are obsoleted as per
new driver design.

Use DFS component's utils_dfs_init_nol() and utils_dfs_save_nol() APIs
instead to get and set DFS NOL respectively.

Change-Id: I63e8adac3f99c2052c26e6b01d19071f098e0a4f
CRs-Fixed: 2178580
2018-02-02 05:45:45 -08:00
Shashikala Prabhu
8136b58f56 qcacmn: Fix radar detection failure for DA and PO
DFS capability was not set properly for Partial-offload(PO) and
Direct-Attach(DA) radio. Thus radar detection failed.

Change-Id: I5493d7195a57f160792a411653c05bbf220d3561
CRs-Fixed: 2160418
2018-02-01 04:16:49 -08:00
bings
aa1810a8fb qcacmn: Fix nol timer memory leak
DFS nol timer need cleanup when rmmod driver, otherwise there is
memory leak.

Change-Id: I4f4c91f7fb515133edd4cb852b3760819a390505
CRs-Fixed: 2173788
2018-02-01 02:20:57 -08:00
bings
5fc318cedb qcacmn: Do not switch channel in DFS testing mode
If gDisableDFSChSwitch is configured as 1, channel should not be
changed even radar is found.

Set usenol as 0 when gDisableDFSChSwitch is configured as 1.

Change-Id: I05c4afea3eb9af9c541b2324a2d50ea59c05f7d7
CRs-Fixed: 2168792
2018-01-31 21:49:35 -08:00
bings
e05bc00ff3 qcacmn: Disable radar for current channel before selecting new channel
In current implementation, after radar detection, a new channel is selected
and then radar is disabled on the new channel. The new channel may be a DFS
channel and radar will be disabled on the new channel.

Radar disable should be called for the current channel and not on the new
channel. Therefore, disable the radar first and then select the new
channel.

Change-Id: Ied57f8910b30ee2181406e26ace1e7a44ff691b4
CRs-Fixed: 2172007
2018-01-30 09:25:51 -08:00
bings
c83573954f qcacmn: Extend radar event structure for ETSI chirp radar detection
The pulse_delta_peak of chirp radar is not zero, which is one more radar
detection rule for ETSI chirp. Driver need delta peak related information
from FW for ETSI chirp radar detection.

Two more fields pulse_delta_peak and pulse_delta_diff are added in
wmi_dfs_radar_event_fixed_param.

Change-Id: Ief8dbea1c1336f45a24195853d5e1356bf3cad27
CRs-Fixed: 2179933
2018-01-30 09:25:49 -08:00
bings
88486ab463 qcacmn: Fix delta peak number counting for DFS
Every time when dfs_count_the_other_delay_elements is called,
delta_peak_match_count is set to 1, which is not correct.

delta_peak_match_count should be initialized once like numpulses
in dfs_bin_pri_check.

Change-Id: I9cf432cbe7b0ddb42a0c33adcbef07d0c48f42f8
CRs-Fixed: 2165538
2018-01-29 21:37:41 -08:00
bings
9c524f5fc4 qcacmn: Restore WMI_DFS_RADAR_EVENTID for Rome FW
Currently WMI handler for WMI_PHYERR_EVENTID is used to handle DFS and
spectral scan phy errors; but Rome FW still uses WMI_PHYERR_EVENTID
and WMI_DFS_RADAR_EVENTID and does not have spectral scan phy errors.

Restore WMI_PHYERR_EVENTID and WMI_DFS_RADAR_EVENTID as Rome FW
requirement.

Change-Id: I16761f6da947619a5969ac8dcd09498d508ad715
CRs-Fixed: 2160954
2018-01-27 00:10:32 -08:00
Abhijit Pradhan
f8e62c0115 qcacmn: Do not free timer object from within timer callback
When a timer callback function is being executed, the kernel still has the
timer object data structure. Therefore, do not free the object from within
the timer callback function. Since there are many DFS NOL timers and the
number of DFS NOL timers are not known at the device object creation time
we cannot allocate static memory for DFS NOL timers. They should be
created and freed dynamically. While waiting for the timer to complete
we should not hold the same lock that is held by the timer callback
function, holding the same lock might lead to deadlock.

Instead of freeing the timer object from within the timer we schedule a
workQueue and the timer object is freed from the workQueue callback
function. While destroying the device object or resetting DFS, we need to
stop the timers and free (cleanup) the DFS NOL timer objects that have
already been added. While waiting for a timer to complete
(qdf_timer_sync_cancel) we do not hold the lock that is used by the timer
function callback to protect the list of DFS NOL timers. This is to avoid
deadlock. The list access is protected by the lock so that either the
cleanup thread or the DFS NOL timer removes a timer object.

Also add fix for unwanted channel addition to precac NOL list when precac
is not enabled.

Change-Id: I1ee935fd15a79579197ccccba0e37c6850fde866
CRs-Fixed: 2171259
2018-01-25 19:40:38 -08:00
bings
0dca5c06e2 qcacmn: Free dfs_b5radars when it is not NULL
Before allocating dfs_b5radars, we need free the old one.
Free dfs_b5radars when it is not NULL.

Change-Id: I4df2698b2c630f0259df32eb5fface1b0750d86d
CRs-Fixed: 2166047
2018-01-11 10:53:44 -08:00
Abhijit Pradhan
6744161372 qcacmn: Add locks to protect DFS NOL list
Add locks to prevent concurrent access of DFS NOL list
from different  contexts.

Change-Id: Ib94bb08bcf3e0cac80b2f8e6be7ab4fd54c53a68
CRs-Fixed: 2156892
2018-01-08 01:18:36 -08:00
Shashikala Prabhu
6c3778275a qcacmn: Fix 2GHz association failure
Problem:
When a STA vap in repeater AP starts scan it checks for
is_cac_in_progress variable. If this variable is set true, then
STA does not scan. is_cac_in_progress is set true/false when dfs
is not NULL. Since DFS is NULL for 2G radio, is_cac_in_progress
has some random number and hence scan is cancelled by the HOST.

Solution:
Initialize is_cac_in_progress to false in
dfs_scan_serialization_comp_info_cb(). Set this variable to true
if dfs is not NULL and AP is performing CAC.

Change-Id: I3e04bfaf05001f7f76f67605fb2c6d35c3113683
CRs-Fixed: 2166300
2018-01-03 15:26:44 -08:00
Arif Hussain
5e7ad9b03f qcacmn: Add null pointer validation and fix initialization in dfs
Add validation check for memory allocation and initialize variable
before using.

Change-Id: If5215f4f034ea57884b252f8467c4e2ca227c952
CRs-Fixed: 2160749
2017-12-26 13:24:37 -08:00
Shashikala Prabhu
153b2881cf qcacmn: Do not allocate DFS object for 2GHz radio
DFS is applicable only for 5GHz radio. Therefore, do not
allocate DFS object for 2GHz  radio.

Change-Id: I5e8aec0c876e7862890fae689950bfbb4eae5255
CRs-Fixed: 2153493
2017-12-22 23:24:41 -08:00
nobelj
2c3db26446 qcacmn: passing correct argument to qdf_mem_set api
qdf_mem_set api parameter switched!
old
qdf_mem_set(void *ptr, uint32_t value, uint32_t num_bytes)

new
qdf_mem_set(void *ptr, uint32_t num_bytes, uint32_t value)

Change-Id: I4ebbc222d32e6fe18c28f2446102c95bfc734c8e
2017-12-14 17:45:20 -08:00
Shashikala Prabhu
a072dc55f7 qcacmn: Replace substring IEEE80211 by WLAN in DFS component
Replace substring IEEE80211 by WLAN in DFS component

Change-Id: I77bcbe0fc34514928a14c6208e33083ef17834af
CRs-Fixed: 2148682
2017-12-04 21:32:40 -08:00
Shashikala Prabhu
fbeb761ef0 qcacmn: Fix RADAR found on wrong channel
Problem 1:
When HOST receives RADAR found indication from target on wrong
channel ex: channel 68. Host does not add the channel to NOL,
but calls random channel function to choose new channel. It
leads to target assert and HOST crash.

Solution 1:
If channel is wrong, do not add it to NOL and do not call
random channel function.

Problem 2:
When Host receives RADAR indication from target, HOST prints
excess information. It floods the console log.

Solution 2:
Add debug bit mask for excess information.

Change-Id: Ib367ee80705d6b789e4e6823682e2f3c3096c9d9
CRs-Fixed: 2148940
2017-12-04 21:32:38 -08:00
Abhijit Pradhan
9ae09aeace qcacmn: Have same dfs action for Fulloffload and legacy
After RADAR detection the function should be used for
1)FullOffload
2)Legacy [ partial offload and Direct attach]
chipsets.

Change-Id: Id99f9f25dc5a9f751f9ad74c07a78fb980673300
CRs-Fixed: 2126916
2017-11-21 23:25:41 -08:00
Shashikala Prabhu
2a9f2a0525 qcacmn: Rename dfs_ioctl.h as wlan_dfs_ioctl.h
Rename dfs_ioctl.h file as wlan_dfs_ioctl.h and
move it from cmn_services directory to dfs dispatcher.

Change-Id: I75e0337bd84b71cf77975656423f78f9b016285f
CRs-Fixed: 2127833
2017-11-21 07:32:05 -08:00
Abhijit Pradhan
f9df7db9b5 qcacmn: Avoid functions with a very long list of arguments
To avoid passing multiple parameters to MLME functions from DFS
component, use a common structure between these components and
pass the structure instead of long list of parameters.
Define the common structure in cmn_services directory to access
it in both the components.

Change-Id: I02dde0780eebbce0886685d1f72a62c84e5b4eeb
CRs-Fixed: 2146000
2017-11-21 07:32:03 -08:00
Shashikala Prabhu
d9bf209f70 qcacmn: ETSI 302-502 Radar Pattern for ETSI11
According to the updates of Regdomain_23 submitted on 2017-5-18,
added two pulses (ETSI 302-502) in the static ETSI radar table for
ETSI11 regdomain.These two pulses are applicable only for 5.8GHz
(greater than 5.725 GHz)  channels.

Change-Id: I2f1e5535040ced9847eedff65dbe892e4d0fb056
CRs-Fixed: 2145124
2017-11-17 07:21:06 -08:00
Arif Hussain
f3b138c625 qcacmn: dfs: Replace instances of unadorned %p
Replace instances of unadorned %p in dfs.

Change-Id: I5a586d8e57fb0809bc1c7549ce78ac587bd0d142
CRs-Fixed: 2133316
2017-11-11 03:25:30 -08:00
Shashikala Prabhu
e858515daf qcacmn: Fix memleak issue in DFS component
Problem:
During wifi up/down, dfs_init_precac_list() is called to initialize
the precac list without de-allocating the previously allocated memory.
This leads to a memory leak.

Solution:
Deinit the allocated memory before initializing the precac list.

Change-Id: I7eee38fbc3c50f37ac0c6670b5bfe4b5a1b2d9f6
CRs-Fixed: 2140042
2017-11-11 03:25:28 -08:00
Shashikala Prabhu
4ef75c1c97 qcacmn: Fix false radar detect
Changes related to false radar detection, various WIFI devices leak/send
out calibration signal that is same as radar signal. Added a
second level of check to filter them. Chirping and frequency hopping
radar are excluded from secondary check.
* Added a check for jitter in frequency (sidx) to be within certain limit.
* Added a fractional PRI check.
* Added a check to look for chirp in ETSI type 4  radar.

Change-Id: Iec6e264b0db7fafe4d01f5ded481b22993b2b2ed
CRs-Fixed: 2106960
2017-11-10 13:39:34 -08:00