Commit Graph

42 Commits

Author SHA1 Message Date
Jhalak Naik
055dfbe881 qcacmn: Add Host support for Spectral FFT recapture
Add support to receive the fft_recapture arg value
from spectraltool, handle the FFT recapture config and
pass this to FW. The recapture feature must be
enabled only for spectral scan period > 52 us and
Normal Spectral scans.

Change-Id: Ied637704d25bb15bff2139a215da7481d4f80e4f
CRs-Fixed: 3140890
2022-03-09 06:51:27 -08:00
Edayilliam Jayadev
aaf4382daf qcacmn: Increase the Spectral payload size
Increase the Spectral payload size to account for
FFT size 11.

CRs-Fixed: 3073239
Change-Id: I5c6db642267a96cbc535bf6842c8f9ac90b1a335
2021-12-01 04:23:19 -08:00
Bapiraju Alla
430a5f423e qcacmn: Fix 11BE compilations when kernel doesn't support 11be
Along with 11BE feature macro, check for Kernel 11be macro to avoid
compilation issues when kernel doesn't support 11be.

Change-Id: I11c8287725a25b6b4e3234a38ae61d50f293cc96
CRs-Fixed: 3066178
2021-11-16 20:57:54 -08:00
Shiva Krishna Pittala
de13832745 qcacmn: Populate and expose 320MHz spectral capabilities
Populate and expose the following 320MHz spectral capabilities.
  - Agile spectral scan support for 320MHz mode.
  - Number of detectors used for spectral scan in 320MHz mode.

Change-Id: Ibea77d4ec8b1d9322ef82d1d48236836ffad24ec
CRs-Fixed: 3053059
2021-10-13 02:57:24 -07:00
Shiva Krishna Pittala
5e1696733a qcacmn: Convert spectral scan bandwidth to proper format
Spectral scan bandwidth value that is received over NL80211 socket will be
in NL80211_CHAN_WIDTH format. Convert it into phy_ch_width format before
using it in the driver. Similarly, convert the spectral scan bandwidth to
NL80211_CHAN_WIDTH format before sending over NL80211 socket.

Change-Id: Ic3b464bff6ac62a9d0c1f915118a4ca6db416252
CRs-Fixed: 3048195
2021-10-01 13:05:59 -07:00
Jhalak Naik
b65b4ae703 qcacmn: APIs to convert phy_ch_width to nl80211_chan_width and vice-versa
Add Spectral APIs to convert channel width values
from enum phy_ch_width to nl80211_chan_width and
vice-versa.

CRs-Fixed: 3029184
Change-Id: I60fb7fb04b943b0d70c569ff6587e5e8efd7722b
2021-09-29 15:05:37 -07:00
Shiva Krishna Pittala
aead8c4d39 qcacmn: Add support to configure spectral scan bandwidth
Add support to configure spectral scan bandwidth as provided by the user.
Validate the user configured value before applying it. As the spectral scan
bandwidth is an optional parameter, when the user doesn't configure it, use
configure the spectral scan bandwidth to the maximum value supported by the
target for the current operating bandwidth.
Also, populate the spectral scan bandwidths supported for different
operating bandwidths on different targets.

CRs-Fixed: 3042424
Change-Id: I266aa5489b0ce5c149968067a06e1cc65bb4e3b7
2021-09-28 03:43:21 -07:00
Yue Ma
674474c55a qcacmn: Add CONFIG_CNSS_OUT_OF_TREE flag
Use CONFIG_CNSS_OUT_OF_TREE to control if CNSS family drivers are
built from in-kernel-tree source or out-of-kernel-tree source since
the exposed header files will be in different paths. This is also
for backward compatibility.

Change-Id: I698492f175ea140e6854c372f366a63f36de24c9
CRs-fixed: 3022556
2021-08-30 13:38:44 -07:00
Pooventhiran G
60533b64ea qcacmn: Add policy for QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_STATUS
Vendor commands using nested attributes should use properly defined
policies instead of RAW_DATA and the same has been enforced since 5.4
kernel. Hence, defined a policy for the vendor command
QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_STATUS.

Change-Id: Ibdf7a19ddd533653c0706b4f0cf3ac97d31b9e40
2021-08-20 01:18:39 -07:00
Jeff Johnson
79b61afd8f qcacmn: Do not export static functions
Linux kernel commit 15bfc2348d54 ("modpost: check for static
EXPORT_SYMBOL* functions") adds a check to make sure that static
functions are not exported.

With this in place the following fatal errors are reported:
FATAL: modpost: "__qdf_nbuf_get_ether_type" is a static EXPORT_SYMBOL
FATAL: modpost: "os_if_spectral_free_skb" is a static EXPORT_SYMBOL
FATAL: modpost: "qdf_nbuf_tx_desc_count_update" is a static EXPORT_SYMBOL
FATAL: modpost: "__qdf_nbuf_get_ip_offset" is a static EXPORT_SYMBOL

To fix these errors do not export the static functions.

Change-Id: Ib5caab904401900bafb23dee23b119daa76d4055
CRs-Fixed: 2910980
2021-03-31 10:07:30 -07:00
Edayilliam Jayadev
9b98e19b51 qcacmn: Add Spectral disabled checks in some APIs
Add Spectral feature disable checks in some APIs
used by other modules.

CRs-Fixed: 2845252
Change-Id: I74d66da2aa85ab0f116ad1a6d2e859f3ee8eeeb9
2020-12-30 07:06:41 -08:00
Edayilliam Jayadev
6c76bce586 qcacmn: Modify vendor command handler to accept vdev
The Spectral module uses the first vdev of a pdev for scanning.
For MCL platforms all the vdevs are associated with a single pdev
and this may cause a mismatch between the vdev intended by user and
the vdev used by driver. To avoid this MCL platforms pass a reference
to vdev on which Spectral scan is triggered. WIN platforms
can continue to use the old approach of using the first vdev of a
pdev by passing NULL for vdev to vendor command handlers.

CRS-Fixed: 2725777
Change-Id: I1a7278bdcbcc2b706aa292b33c17546190dac082
2020-07-24 02:01:11 -07:00
Wu Gao
b43c68dedf qcacmn: Gets vdev by id in spectral component
It starts spectral scan without vdev object, and uses the first vdev
as current vdev. which cause vdev mismatch in some platforms. So pass
vdev object or id when finding current vdev.

Change-Id: Iab55afbe2c98906021a008918f186d3d2dce5871
CRS-Fixed: 2716460
2020-07-24 02:01:08 -07:00
Neha Bisht
466c04dee9 qcacmn: remove dependency of public files from wlan_objmgr_psoc_obj.h
Remove dependency of wlan_lmac_if_def headerfile from
wlan_objmgr_psoc_obj.h

Change-Id: Ida8472e6f05a90b3930b5a13a2bf89ea8b3e938f
2020-05-15 10:41:46 -07:00
Edayilliam Jayadev
1de47959b6 qcacmn: Enable Agile Spectral in single synth targets
Some targets have a single synthesizer and it allows
a single Spectral detector to scan in 160 MHz /165 MHz.
Enable Agile Spectral scanning in 160 MHz / 165 MHz for
such targets. Agile creq2 will be populated in the WMI
command after WMI interface changes are merged.

CRs-Fixed: 2648480
Change-Id: I8522cbeeab29ac41479e3041eea376b081c0758a
2020-04-30 01:51:14 -07:00
Edayilliam Jayadev
f76792f311 qcacmn: Add Spectral detector count in capability info
Populate number of Spectral detectors per BW in the
Spectral capability vendor command response.

CRs-Fixed: 2659587
Change-Id: I2eba5df02a5f70556d65e689aece1f0fbd8bba93
2020-04-09 11:31:53 -07:00
Alan Chen
31f4e86ecb qcacmn: Remove static from nla_policy spectral_scan_policy
Remove static from nla_policy spectral_scan_policy in correspondence to
the change to add policy attribute to SPECTRAL_SCAN vendor subcommand.

Change-Id: I764a51f5c1355cb0c3dd2096e6dc7ee332b2f3d6
CRs-Fixed: 2634075
2020-03-14 03:25:12 -07:00
Edayilliam Jayadev
17ecd7493a qcacmn: Enable Spectral feature for Pine
1) Enable DDMA support, FFT bin length adjustment SWARs
2) Skip 16 bytes of padding added after Spectral summary report.
3) FFT report header length is 24 instead of 16 in Pine.
4) Max FFT size is changed to 10.

CRs-Fixed: 2608215
Change-Id: If32a8995f814140f5b61041031fb842d01d24c94
2020-02-01 06:25:04 -08:00
Shwetha G K
6d85a9e8da qcacmn: Track netlink allocations
Track netlink allocations when mem debug is enabled.

Change-Id: Icba58f93cf0364678d730f32bd56645efab934e1
CRs-Fixed: 2588037
2020-01-09 04:51:33 -08:00
Shwetha G K
8db4b4ac32 qcacmn: Control path support for Spectral DMA debug
All gen III chipsets use Direct-DMA mechanism to copy Spectral reports to
the Host for further processing. This mechanism involves ring and buffer
management in the Host, FW, and uCode, where improper/incomplete DMA and
improper tail update issues are seen. DBR framework provides support to
debug such issues. Add Spectral control path support to facilitate the
configuration of these debug options.

CRs-Fixed: 2478596 2478595
Change-Id: I094616c4137145389b6984ccab933e5ebd0aa1ab
2019-12-03 03:26:22 -08:00
Edayilliam Jayadev
2afe8e48fd qcacmn: Populate aSpectral capability based on BW
Some chipsets don't have the capability to run agile Spectral with
160/80p80 modes. For this populate separate agile Spectral capability
for 160 MHz, 80p80 and non 160 MHz modes.

CRs-Fixed: 2549664
Change-Id: I7ae961d3f2bba33d1d3f73679f162823d54b6717
2019-10-26 11:55:36 -07:00
Edayilliam Jayadev
9217a212bb qcacmn: Add error handling in the Spectral control path
Add an attribute which describes the error code
in the response to set config, start scan and stop
scan.

CRs-Fixed: 2500481
Change-Id: I491cd6e061d2d08ceb4d9af2a7de5223e229c280
2019-08-29 12:51:37 -07:00
Edayilliam Jayadev
8e74a62e72 qcacmn: Change Spectral control path to support Agile mode
Modify Spectral control path APIs to support Agile mode.

CRs-Fixed: 2450620
Change-Id: Id6cf48c1288b157932ab5ce0535293e466a87783
2019-07-27 00:31:31 -07:00
Edayilliam Jayadev
cd6f190963 qcacmn: Make RX path changes for Agile Spectral
Change Spectral report processing logic to handle
Agile Spectral reports. 160 MHz state machine is not
affected by Agile Spectral reports.

CRs-Fixed: 2458359
Change-Id: Iead6427f57edddd61f7d64a961cc6d936d54ab9e
2019-06-21 03:09:19 -07:00
Edayilliam Jayadev
7c72252ec8 qcacmn: Free outstanding skbs on Spectral detach
While detach if there are any outstanding skbs free them.

CRs-Fixed: 2470780
Change-Id: Ic9ee568a1af96b2535cc2a30747ac8e5190e1be6
2019-06-14 12:58:27 -07:00
Edayilliam Jayadev
14f9bd4194 qcacmn: Spectral control path changes
Add a new request structure for Specteral control path.
This structure packages all the commands and their
required inputs. Response to the commands are filled
in this structure by the command handlers in lower
layers.

CRs-Fixed: 2446466
Change-Id: I3113e8721382d284b4e03e0f8fdab1e68d5cfaa1
2019-06-08 06:29:44 -07:00
Edayilliam Jayadev
d4b7e3b572 qcacmn: Populate spectral capability and send via cfg80211
Populate Spectral capability structure with scaling parameters
from extended service ready event parameters. Send the spectral caps
via cf80211 interface.

CRs-Fixed: 2379652
Change-Id: Id0372bdd40843c2101df32d2e71920027a24909f
2019-02-05 04:02:20 -08:00
Edayilliam Jayadev
2256850e61 qcacmn: 160 MHz/80p80 support for gen III Spectral
For generation 3 spectral reports for the 80 MHz segments
come as part of different events. To deal with this a
state machine is added to report handler. Noise floor
value of the lowest chain in the chain mask is populated
in the SAMP message.

CRs-Fixed: 2236331
Change-Id: Ie24426449cf8503c9d7f7c30ca617a6697ca2b5e
2018-10-05 02:14:07 -07:00
Debasis Das
c2af7e7648 qcacmn: Wrappers for OS API's used for device cfg
Use appropriate wrappers for OS API's used for
device configuration.

Change-Id: I6a8042175d1a5939742be077fa45e8b776eee180
CRs-Fixed: 2222560
2018-08-17 10:29:26 -07:00
Shiva Krishna Pittala
6db0dac5b6 qcacmn: Fix SKB leak in Spectral Netlink
Spectral allocates its nbuf using qdf_nbuf_alloc() and calls
Netlink functions to send the SKB to the application layer.
After sending SKB, the Netlink send functions free the SKB using
dev_kfree_skb(). As a result, QDF nbuf tracker treats this
an SKB leak and panics the system.
To avoid this leak, remove the SKB entry from QDF nbuf debug hash table
by calling qdf_net_buf_debug_release_skb() before handling
the SKB to Netlink send functions.

Change-Id: I62c7046d1481c2a38ef5321410ebca9f5f5f34ed
CRs-Fixed: 2285654
2018-08-08 09:12:00 -07:00
Edayilliam Jayadev
b3911b4c48 qcacmn: Initialize spectral samp message with zero
Initialize the spectral samp message structure to zero.

CRs-Fixed: 2278403
Change-Id: I5d36662db32820c40f7fb2eafb56942d8654e7f6
2018-07-25 01:24:29 -07:00
Chaoli Zhou
d519e6b287 qcacmn: Remove boring log of spectral scan
Such log will show once has the spectral scan result message
need to send to application, which is boring and delete it

Change-Id: I4e7fd8877b354d94022b65a8e43cc4ca3e285943
CRs-Fixed: 2274032
2018-07-13 06:42:57 -07:00
Sandeep Puligilla
6f083bace3 qcacmn: Fix spectral scan compilation issue
Forward declare 'struct wmi_spectral_cmd_ops' in
file wlan_spectral_utils_api.h to avoid
compilation issue when spectral feature flag
is disabled.

Change-Id: Iba8dfbb2007f20d409fbb2d67ee29f702264e50d
CRs-Fixed: 2269005
2018-07-11 23:36:30 -07:00
Sandeep Puligilla
0a341a5e92 qcacmn: Add spectral scan feature flag
Add spectral scan feature flag which can be
used to control the feature through build options.

Change-Id: Ic56416fc99b521174cccb3af27cc841bfb2ad27d
CRs-Fixed: 2244334
2018-06-06 23:49:17 -07:00
Edayilliam Jayadev
df3100c157 qcacmn: Share Spectral HW gen as part of capability exchange
Spectral scan period is not in terms of tclk periods for
generation 3 Spectral HW. It is directly in micro seconds.
Default value is 224 us. Driver needs to use 224 us as
default value. Application needs to display the unit as
tclk period till generation II and micro second for
generation III. For this driver will be sharing the
Spectral HW generation info to application as part of
the capability exchange.

CRs-Fixed: 2225740
Change-Id: Iaeda8ebb77c2a39824b5f919e8578ff4d56c1aa5
2018-05-14 11:39:29 -07:00
Manikandan Mohan
5bdb2fe470 qcacmn: Fix export symbol for multi drivers compilation
Update driver files to use qdf_export_symbol to facilitate
multiple driver module compilation support.

Change-Id: Ic7d7f65b79e92957b02c0386ba98af2adf17506b
CRs-fixed: 2197751
2018-03-19 19:58:03 -07:00
Shiva Krishna Pittala
a143f83a27 qcacmn: Add Netlink deinit functionality in Spectral
Define os_if_spectral_netlink_deinit to close the Spectral socket and
de-register the os_if callbacks

Change-Id: I3d054c2a2d630d4d959861d3620592010d04c09a
CRs-Fixed: 2186113
2018-03-06 03:53:47 -08:00
Sandeep Puligilla
cd793f38a3 qcacmn: Configure spectral module for Gen2
-Initialize the default Configuration as
gen2 for spectral module on MCL.
-Add support to general netlink socket.

Change-Id: Iab06f66d18c4791f0ff5483781634df2a7268ddb
CRs-Fixed: 2183870
2018-02-09 09:21:02 -08:00
Shiva Krishna Pittala
101778698b qcacmn: Move Spectral Netlink APIs to os_if layer
Spectral Netlink related APIs are currently present in
target_if layer, move them to os_if layer.

Change-Id: I86a5495f6ec8aa85a2e9639902503a522b023f8e
CRs-Fixed: 2151548
2018-02-09 09:21:00 -08:00
Sandeep Puligilla
4fe1d4b0ee qcacmn: Fix spectral scan compilation errors
Fix spectral scan component compilation errors
on MCL build system.

Change-Id: I903431fba923859e796e0786354608cac2841b0c
CRs-Fixed: 2160819
2017-12-21 01:39:17 -08:00
Edayilliam Jayadev
e0c7fbdb93 qcacmn: Callback functions for legacy spectral apis
Use table of function pointers for legacy api calls
instead of calling legacy apis directely

CRs-Fixed: 2146231
Change-Id: Ia5840208d0de5bd4e78c1d27b8ffdc0cf6cbf298
2017-11-30 05:27:58 -08:00
Edayilliam Jayadev
d8c6a467dd qcacmn: Add QCA vendor commands for spectral scan
Add following vendor commands and their handlers.

 1) QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_START
        Set the spectral parameters and start scan.
 2) QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_STATUS
        Stop spectral scan.
 3) QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CONFIG
        Get current values of spectral parameters.
 4) QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_DIAG_STATS
        Get stats for spectral scan debug.
 5) QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CAP_INFO
        Get the spectral hardware capability.
 6) QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_STATUS
        Get the current status of spectral scan.

CRs-Fixed: 2146272
Change-Id: I8e048d6c21e9fb1ed286c19df0edcad46f6e6414
2017-11-30 05:27:57 -08:00