Commit Graph

160 Commits

Author SHA1 Message Date
Karunakar Dasineni
a46da42b53 qcacmn: Remove freed DP structures from minidump
Remove entries previously added to minidump during
data-path detach.

Change-Id: Ib69803e8ea58e5b4e0f045d3037730a5b6700c8d
2019-07-24 17:10:06 -07:00
Akshay Kosigi
283e2358f4 qcacmn: CONFIG_WIN Macros to be moved out of DP/HAL
Remove CONFIG_WIN usage from Lithium DP and HAL module.

Change-Id: If388e45cb3e7e31493edd422a2f4c40f0dd4a799
CRs-Fixed: 2474613
2019-07-15 06:39:40 -07:00
Balamurugan Mahalingam
6a2601a26c qcacmn: Use qca8074v2 hal source files for qca6018
qca6018 and qca8072v2 uses the same WCSS block and the source
files of qca8074v2 shall be used for qca6018 as well

This will also ensure all fixes for qca8074v2 gets auto
propagated to qca6018 as well.

Change-Id: I2ead316c7ed16b6ee315bda05ce82d268ba04bbb
2019-06-08 12:30:40 -07:00
Karunakar Dasineni
8075637d77 qcacmn: Add DP structures to minidump
Add calls to log some data-path structures to minidump.

Change-Id: Ib94e22e9e44ad314eaaff3d6ab57f2c60082e8ec
CRs-Fixed: 2444081
2019-05-14 16:23:09 -07:00
jiad
09526ac0d1 qcacmn: Fix REO2IPA reo destination routing
Observed that when IPA offload is enabled, RX packets
are not routed correctly to IPA ring. Currently only
IX0 of REO_DESTINATION_CTRL_IX registers are remapped,
which only covers 3-bit reo_destination_indication of
range 0 to 7.

Fix is to remap REO_DESTINATION_CTRL_IX2|3 registers
so that reo_destination_indication of range 16 to
31 can also be routed REO2IPA ring when IPA offload
is enabled. Upon IPA offload is disabled, save values
of IX2 and IX3 are reset back to HW.

Change-Id: I3428b450ab10076d27c7628a3729e8cec088bd94
CRs-Fixed: 2434331
2019-04-30 02:13:28 -07:00
Krunal Soni
9911b44343 qcacmn: Use hal_verbose_debug() to print msgs which come excessively
Some of the print messages in HAL module come very excessively.
Use hal_verbose_debug() API to print them.

CRs-fixed: 2405028
Change-Id: I4b4754af65c00edb571de898527026b6183ef15f
2019-03-06 12:52:10 -08:00
Sravan Kumar Kairam
4c6a8a9123 qcacmn: Zero out the memory of hal shadow pointers
Currently hal shadow pointers after memory allocation
are not memset to zero. In case of SMMU S1 enable when
host starts to access hal srng the random value of shadow
memory is copied to host cached values which leads to accessing
the rings even when HW has not updated to it. So zero out
the memory of hal shadow ring pointers after memory allocation.

Change-Id: I10ac6bfff957e953ee9caa15056ce3fa9d57b70e
CRs-Fixed: 2368491
2019-01-29 14:32:03 -08:00
Basamma Yakkanahalli
5f7cfd49c2 qcacmn: Device and Target type support for qca6018
Added target and device type support for qca6018.

Change-Id: I85382bf053d0a5f34cfaf0cca78a4b66b4265989
CRs-Fixed: 2323023
2018-11-27 00:32:00 -08:00
Mohit Khanna
efdae7f1bf qcacmn: Reduce log level in hal_srng.c
Functions hal_update_srng_hp_tp_address and hal_set_one_shadow_config
are dumping a lot of information, which is not needed.

Reduce INFO log levels to DEBUG.

Change-Id: I210cd5493d758685312b7851eb37e05ce93b6071
CRs-Fixed: 2342960
2018-11-09 19:43:33 -08:00
Mohit Khanna
81179cb75e qcacmn: Fixes for IPA enablement for lithium/Hastings
- Support to pass IPA enabled(disabled) flag from ini to DP layer
- Use ioremap call to translate tx_comp_doorbell_paddr obtained from
  calling ipa_setup api to tx_comp_doorbell_vaddr. This is needed to
  write the initial value of HP at the doorbell address.
- Change REO_DST_RING_SIZE and WLAN_CFG_TX_RING_SIZE to 1023
  for napier/hastings if IPA is enabled. This is needed because,
  ipa_setup API can handle only 16-bit values for the size param(bytes)
  of the ring.
- Disable hash based flow steering for SAP peers in case IPA is enabled
  and set default reo_dest_ring_4 as default RX ring. Since IPA will be
  reaping RX packets from reo_dest_ring_4 only, flow steering is not
  needed for SAP peers.
- Unmap pre-allocated TX buffers for IPA in the TX completion ring.
- Donot execute IPA functionality if IPA is disabled from ini.

Change-Id: I6855bfe293a457ccc0abd1ad5567f5c95232a9d2
CRs-Fixed: 2183519
2018-10-17 17:42:35 -07:00
Pramod Simha
627278cdfe qcacmn: Change Shadow Register configuration for QCA6390
- Change the SR mapping address for QCA6390
- Use ring direction field from HAL ring config instead of HAL ring
  directly as ring is not yet initialized here.

Change-Id: I900b2329367cc02ae2f9d7f164e5f867d8253d90
CRs-Fixed: 2299919
2018-09-28 10:41:39 -07:00
Sathish Kumar
86876490f2 qcacmn: CE services separation for legacy and lithium architecture
CE service file includes APIs for both legacy and lithium
architecture.

These are getting compiled for both targets today. Separate the CE
services into legacy and srng and selectively compile based on
targets present in the SoC.

Note: Generic APIs implemented for both legacy and SRNG services
      are separated out through this change. Fast path implementation
      will be de-coupled from common service and moved to legacy source
      in a follow-up change.

CRs-Fixed: 2258640
Change-Id: If86c21c0bf560a360474c9efcdbcd4841a09828d
2018-09-17 21:29:26 -07:00
Balamurugan Mahalingam
5d80641550 qcacmn: [1/2] Support both qca8074v1 and qca8074v2 from hal
Some of the macro names defined in qca8074v1, are defined with
a slightly different name in qca8074v2, and few macros have the
same name in both headers but are defined with different values.
Fixed the same.

Change-Id: I5e948baf5326d1d8fdfa2bd7ee8aa072c710d17c
2018-09-04 11:53:36 -07:00
Aditya Sathish
ded018e406 qcacmn: Clean up dp component prints
Clean up datapath component prints by correcting trace levels for
regularly occurring prints and removing newlines from converged
print APIs since qdf_trace_msh appends them by default.

Change-Id: Ie8fe319fcb737720f7400a165e134b6a18bd15b5
CRs-Fixed: 2243843
2018-08-10 18:11:21 -07:00
Venkata Sharath Chandra Manchala
79860aa182 qcacmn: Enable QCA6390
1. Allocate and Initialize host and target copy engine configuration
   for QCA6390 based products.
2. Setup Copy engine service map for QCA6390.
3. Add conditional compilation flag QCA_WIFI_QCA6390 to support
   QCA6390 based products.

Change-Id: Ia4dd4d436b8ecae0e9f91faa0c1fe7dbd14f001f
CRs-Fixed: 2259312
2018-08-08 12:53:51 -07:00
Balamurugan Mahalingam
96d2d41c87 qcacmn: Fix compilation issues and a minor issue
Removed qdf exports on functions defined in target specific
header files and defined those functions as static. Revert
changes on hal_rx_msdu_end_sa_idx_get and make
hal_rx_msdu_end_da_idx_get target specific

Change-Id: I2858b1d77118f0a26b54bf983bd342c7a4fe757d
2018-07-21 00:03:36 -07:00
Balamurugan Mahalingam
6cf4c27417 qcacmn: add HAL support for qca6390
hal_hw_srng table and register offsets array, some target specific
functions  are defined separately for each new target.
define the same for qca6290.

Change-Id: I08c1243bc50460fac776e28186acfa192fb1ff66
2018-07-21 00:03:30 -07:00
Balamurugan Mahalingam
d0159640ea qcacmn: Separate hal for qca6290 and qca8074
Create separate individual hal_srng_table and hal register
offset in target specific source files. Create separate
functions for qca6290 and qca8074 for few hal rx tx
functions as the macro value differs between the chipsets.

Assign target specific hal tx, rx ops as part of hal_attach
and call respective hal tx, rx ops through callbacks.

Change-Id: Ibbf490c678c39fdd9d54191aad7aaec786db30ec
2018-07-21 00:03:20 -07:00
Venkata Sharath Chandra Manchala
9a59bd6483 qcacmn: Add a new parameter to the srng table
Add max_size parameter in the hw_srng_table
to hold the maximum size for a given ring.

Change-Id: Ibfce021505ab9a55d3208b1c5aba26021d1fe230
CRs-Fixed: 2262818
2018-07-11 14:29:27 -07:00
Jeff Johnson
f7aed493b1 qcacmn: hal: Fix misspellings
Address the following issues in the hal folder:
CHECK: 'completly' may be misspelled - perhaps 'completely'?
CHECK: 'Initalize' may be misspelled - perhaps 'Initialize'?
CHECK: 'refered' may be misspelled - perhaps 'referred'?
CHECK: 'Retreive' may be misspelled - perhaps 'Retrieve'?
CHECK: 'settting' may be misspelled - perhaps 'setting'?

Change-Id: I98368830eeef7942c20380dbe6c638319a9860d9
CRs-Fixed: 2241575
2018-05-19 19:40:27 -07:00
Jeff Johnson
9f2d54f039 qcacmn: Fix typo "accross"
Replace typo "accross" with correct spelling "across"

Change-Id: Ifec1b81cbc6c808784d86afe055468ff42674a57
CRs-Fixed: 2238309
2018-05-17 00:46:41 -07:00
sumedh baikady
668d8679ff qcacmn: Fix minor pn_size init and index check
1. In hal reo setup initialize pn_size to avoid uninitialization
in default case.
2. In hal validate shadow register function, fix the check
for index as shadow_config array can take 0 to 35 as index values.

Change-Id: I8b729dc70053e333ef659ba38fb0c2f66cd8b35a
CRs-fixed: 2208799
2018-03-23 21:38:54 -07:00
Pratik Gandhi
dc82a77896 qcacmn: Support to WIN for split of kernel modules
Add EXPORT_SYMBOLS to support modularization in WIN.

Change-Id: I587fe6f2c5cce4b54756358de5c488b146f61850
CRs-Fixed: 2179854
2018-02-08 06:58:35 -08:00
Kai Liu
b8e1241366 qcacmn: dump reo ring when flush cache failed
When delete peer, host will try to flush all frames in REO queue
by sending a cmd through reo ring, but sometimes encounted failure to
send this cmd, dump ring status if ecountered above failure.

Change-Id: I3ea4e96e5999f85398b531ddf4f350e91e798d70
CRs-Fixed: 2167419
2018-01-22 07:37:34 -08:00
Pratik Gandhi
034cb7cb60 qcacmn: Define Host based TARGET_TYPE
fwhdr_abstrct: Use Host based TARGET_TYPE instead of firmware
defined TARGET_TYPE. It will abstract dependency on bmi_msg.h.

Change-Id: I76d744db27df730a3a91a243adfc07fc17d77487
CRs-Fixed: 2140921
2018-01-03 20:09:46 -08:00
Manoj Ekbote
376116e052 qcacmn: Handle error case with HAL SRNG setup
If hal_srng_setup() fails, memory allocated for srng
is not freed resulting in a leak. Free the memory in
that case. In future, return error to caller and
assert when invalid ring ID is used during setup.

Change-Id: I6f3a7494a5c5e861652f3a38d18c220cd9a6eef2
2018-01-03 14:17:00 -08:00
Sathish Kumar
03d77e6590 qcacmn: Add source ring for direct buffer rx module
Direct Buffer Receive provides the driver with a mechanism by which target
can transfer information directly into host memory via DMA.

DMA rings must be initialized and configured before they can be shared
to the target for transfer ot data. Host driver will use the HAL SRNG
APIs to create, initialize and configure the DMA rings.

Change-Id: I43cd39ccbb5f5069c9a14092459d5c88ea514dca
CRs-Fixed: 2157986
2017-12-13 19:18:09 -08:00
Alok Kumar
ebdb2daf68 qcacmn: Replace instances of unadorned %p
Replace instances of unadorned %p which violates security guidelines.

Change-Id: I0b00fb9f997d3ed6a2824c2bb133c343fc92caef
CRs-Fixed: 2133330
2017-12-11 11:25:12 -08:00
Yun Park
601d0d868a qcacmn: Fix IPA WDI3 Tx issues
Fix bug to enable IPA WDI3 Tx H/W path.

Change-Id: Ice691dccc649b38971985cd8da042719d943cec7
CRs-Fixed: 2085751
2017-10-23 22:08:28 -07:00
Jeff Johnson
05503ee8f1 qcacmn: hal: Replace instances of unadorned %p
Replace instances of unadorned %p in hal.

Change-Id: I76cfeb154511d1852cc70c7969982e25d603089a
CRs-Fixed: 2111274
2017-10-03 16:02:41 -07:00
Houston Hoffman
ae850c6d62 qcacmn: Cleanup some excessive logging
Cleanup some excessive logging used durring bringup.

Change-Id: I09df15b7aad8176ad35f70d4d51b4a0a254699e0
CRs-Fixed: 2101103
2017-09-13 15:25:42 -07:00
Houston Hoffman
9b55b5fbb9 qcacmn: Fix ce ring timeout interrupt hw work arround
Interrupt was constantly firing because the low_threshold was
improperly configured.  The low threshold needs to be 1 less than
the number of buffers posted when the CE is fully posted.  The
srng backed CE's are setup with nentries - 2 buffers as the fully
posted amount, therefore the threshold needs to be nentries - 3.

Also fixes a bug where a reused variable is not cleared.  This
bug could result in the threshold being set to a garbages value.

Change-Id: Iac840bfd6677683bf2feb42d8bdbd050f42e895d
CRs-Fixed: 2090603
2017-08-31 06:27:43 -07:00
Yun Park
fde6b9e551 qcacmn: Enable WLAN host data path support for IPA WDI3.0
Change to support WLAN Napier host autonomy data path architecture.

Change-Id: I07f7592d547bb796a3c12bbc4745cee22e2c0022
CRs-Fixed: 2064810
2017-08-07 17:47:38 -07:00
Houston Hoffman
648a918927 qcacmn: Enable msi support for ext_group ring groupings
assign msi vectors to srng rings based on the ext_group they will be
serviced in.

provide support for ext_groups in hif_pci.

Change-Id: If313fdb43b939871c0d73dea9a05f757427b5b16
CRs-Fixed: 2051911
2017-08-06 10:47:16 -07:00
Pamidipati, Vijay
45b1df25fc qcacmn: Configure DP interrupt mitigation values based on ring type
Currently interrupt mitigation values are configured for per-packet interrupts.
Change this for core DP rings (REO Destination and WBM Tx Completions) to reduce
CPU overhead of interrupt processing

Change-Id: I7bf0f6e78c52b5678ad3c8cc4d829444e410fad3
CRs-Fixed: 2064113
2017-06-26 17:42:33 -07:00
Karunakar Dasineni
335bbd1374 qcacmn: Fix SRNG low threshold setting in HAL
SRNG low_threshold setting should be in no. of dwords.

Change-Id: I9940f02936cff5947d2bae800ecf6d05b168e729
2017-06-17 15:47:22 -07:00
Naveen Rawat
ba24c486a3 qcacmn: Initialize DMA rings using hal_srng APIs
Initialize DMA rings for CIR/CFR capture and program them
to firmware.

Change-Id: I41c32cddc3fc0f7f0a972bf69ecbacfc9f0626f7
CRs-Fixed: 2053958
2017-06-02 14:47:29 -07:00
Pramod Simha
1dfdf64381 qcacmn: Fix for R2 REO register size calculation
Calculate register size by subtracting the higher
register address by the lower one.

Change-Id: Id2255ad48d0ceb2fde00774dbf56868efb3646ca
CRs-Fixed: 2052617
2017-05-30 17:31:23 -07:00
Bharat Kumar M
9e22d3d99e qcacmn: API to read memory info from HAL
HAL modification to provide additional information to
support lithium nss offload configuration.
A new API added to extract addtional information from HAL
Few additional parameter added in get_param function.

Change-Id: I2fb0ed89c2d3cb3ee253b158f7982e1a00ab4353
2017-05-17 19:29:48 -07:00
Houston Hoffman
8bbc99066e qcacmn: Use hal io apis in SRNG_REG_WRITE
The register write apis for the srng rings pass the
srng structure as their context.  Add a pointer to
the hal to enable windowing.

Change-Id: Ib3bda2d49d5c2d327cc1b986dcf825a216a004ef
CRs-Fixed: 2032131
2017-05-02 20:06:43 -07:00
Houston Hoffman
61dad49aa3 qcacmn: Provide hal io apis to support register windowing
Use windowing for register read/write.  This allows
for pci based devices to reduce the mapped bar size.
Required for QCA6290.

Change-Id: Ifb173095c135e9eca454f2ba6132b5c54ea8fc4b
CRs-Fixed: 2032131
2017-05-02 20:06:41 -07:00
Houston Hoffman
1a601690a1 qcacmn: Set SRNG_ENBLE bit in SRNG MISC register
Setting the SRNG_ENABLE bit is required for devices with newer
hardware definitions.  Setting this bit is a no-op for older
hardware.

Change-Id: I2e0369b62a89f6a9a32f9e211ab815e3c16b2393
CRs-Fixed: 2032351
2017-04-12 18:23:10 -07:00
Kai Chen
6eca1a62da qcacmn: Monitor mode configuration and processing
This change is for supporting monitor mode VAP.  All the monitor mode ring
is configured. The related monitor mode ring includes:
-monitor mode buffer ring
-monitor mode destination ring
-monitor mode status ring
-monitor mode link descriptor ring
The packet is not sent to monitor mode ring unless the monitor mode VAP is
configured. This release support Multiple VAP - AP/STA VAP plus Monitor
VAP configuration. The status ring is not used in this release. However,
the ring is tested and the ring is moving and there are TLV's in the ring.

Change-Id: I782ee0c3b998d8b3bbac79b5e7fdecdbff15fa93
CRs-Fixed: 2013049
2017-03-29 05:58:52 -07:00
Karunakar Dasineni
d0ea21f109 qcacmn: WBM ring changes to fix stability issues
1. Increased the sizes of following SRNGs used by WBM and also added max size
check in SRNG setup:
-idle link descriptor ring
-Tx completion ring
-Rx release ing

2. As per HW team, TP_ADDR and HP_ADDR for Idle link ring should remain 0 to avoid
some WBM stability issues. Remote head/tail pointers are not required since
this ring is completly managed by WBM HW

Change-Id: I93d70a287329dfeb08fcfb6b04306d65776b4834
2017-02-23 00:27:27 -08:00
Houston Hoffman
f60a3488d0 qcacmn: Add config flag to use shadow registers
For platforms that don't use QMI and have firmware
enable shadow registers, host needs to ignore the
shadow register configuration it calculated.

Change-Id: I91a3d9a0c65172afde6a2ddab61651f9f8683aee
CRs-Fixed: 2003581
2017-02-10 18:10:34 -08:00
Dhanashri Atre
0215a3ee92 qcacmn: Pass the mac id while getting the ring id
There is a bug where the mac id passed to get the
HAL srng id is always hardcoded to 1. This should be
the mac id.

Change-Id: I0e07c420f77c7158b0a778c8a5fc81af7de2e5ee
CRs-Fixed: 2003050
2017-02-06 22:50:10 -08:00
Dhanashri Atre
d4032abf27 qcacmn: Support for configuring 2nd MAC
Add support to configure the second LMAC ring
which is needed for DBS.

Change-Id: Idb055621d174c994e267dc6dcca2bc798ae79bfc
CRs-Fixed: 1116939
2017-02-01 16:23:38 -08:00
Houston Hoffman
3ba070e41e qcacmn: Include pld_common.h later
The pld_common.h stub doesn't include all the header files it needs
for compilation.  Let it get included from hal_internal.h through
hal_api.h.  In this manner, all the required .h files will allready
be included.

Change-Id: I40d107d2305baabe57719afe854bad4428d74a23
CRs-Fixed: 1113131
2017-01-30 22:18:24 -08:00
Houston Hoffman
e3c1a37468 qcacmn: add sanity check of shadow configuration
When shadow registers replace other register addresses,
ensure that they are configured to point at the registers
that would be written to with shadow registers disabled.

Change-Id: I789021fe394cad2ce50cbbeb2943827b6d5e464f
CRs-Fixed: 1113131
2017-01-30 22:18:21 -08:00
Houston Hoffman
5141f9d1e8 qcacmn: construct shadow v2 config
In this change, hif requests hal construct the shadow register
configuration for all the necessary datapath rings.  Then hif
requests hal append the configuration for the srng rings used
by the host copy engine module.  When constructing the shadow
register configuration, the hal makes note to use the shadow
register addresses instead of the actual addresses.

Change-Id: Ide8f523dece0d1dc6eb05f4c86739ece7909c25a
CRs-Fixed: 1113131
2017-01-30 22:18:20 -08:00