Commit Graph

167 Commits

Author SHA1 Message Date
c_cgodav
fda96ad28f qcacmn: Add additional CE Tx descriptor debug
Store the Tx data buffer of MAX_DATA_SIZE bytes as part of CE descriptor
debug information. Add sysfs API to dump the CE descriptor+data debug
information on console.
The CE descriptor and MAX_DATA_SIZE bytes are stored for Tx packets which
would be used to debug any CE related issues.

Change-Id: I68a765c6219a2ff2a6a7adc7e8ed031f8957d243
2018-02-07 02:15:30 -08:00
bings
602a3588a9 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: I1bb4d6dcafc831f8ea45f0fa1646db47f291fabe
CRs-Fixed: 2160372
2018-01-27 00:10:30 -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
wadesong
41f857eb31 qcacmn: Debug print rate limiting
Implement driver debug print rate limiting in HIF SDIO RX
path and QDF nbuf allocation path to avoid driver
inactivity watch dog time out when the platform is facing
great memory pressure.

Change-Id: Ifa4fe3e7027150fd1469df58049776fca8aa6f2f
CRs-Fixed: 2148314
2017-12-04 23:38:59 -08:00
chenguo
f254886c3d qcacmn: Mapping between NAPI budget and internal budget
There is a scale factor mapping between NAPI budget and internal
budget. Add logic for this dynamic translation.

CRs-Fixed: 2140049
Change-Id: Iac03bd431ab7a416a87e488b14bc8b5c1bb7869f
2017-11-27 22:40:17 -08:00
Dustin Brown
5d0d104798 qcacmn: Use qdf_cpuhp APIs for NAPI
Abstract NAPI's use of CPU hotplug events by using the new QDF CPU
hotplug APIs.

Change-Id: Iad590768476b4dc6bad63b3ee3b1b1bbf7698251
CRs-Fixed: 2141180
2017-11-15 15:53:37 -08:00
Dustin Brown
bbba9176f8 qcacmn: Set the initial wake flag on MSI resume
When the wlan driver is suspending, the last thing it does is check to
see if the firmware has indicated a wakeup during the suspend process.
This is done by checking the initial wakeup flag, which is set when a
specific copy engine payload is received from firmware. For the new
dedicated wake MSI, only the wake signal is received, no payload. When
the wake MSI is toggled, set the initial wakeup flag to prevent race
conditions during the suspend process.

Change-Id: Id53cc7884431a437136d8dca068449bc5a25b87c
CRs-Fixed: 2133469
2017-11-01 13:57:00 -07:00
Manjunathappa Prakash
96713609aa qcacmn: Get rid of spinlock lro_unloading_lock
Spinlock "lro_unloading_lock" was required to synchronize the LRO
instance being deleted when there is LRO packet inflight.
With LRO moved to qdf and LRO is tied to hif_napi, LRO instance is
active with life time of the driver. So no need to protect via lock.

Change-Id: I06f7b43e80ddf0ce5e096351b38ce954eb634a95
CRs-Fixed: 2028318
2017-10-26 23:48:06 -07:00
Govind Singh
bc679dc919 qcacmn: Do not allow CE register access when recovery is in progress
Currently, Shadow registers is not implemented for all registers.
This can lead to unclocked access and followed by NOC errors.
In Rx path Interrupt Status and src/dst read index are directly
accessed without shadow block. Target may execute
reset sequence due to PDR/SSR while rx path is active.

Avoid direct access to below registers if target is crashed due
to PDR/SSR.

HOST_IE_ADDRESS
HOST_IS_ADDRESS
CURRENT_DRRI_ADDRESS
CURRENT_SRRI_ADDRESS

Return from ISR without scheduling the bottom half if target is
crashed due to PDR/SSR.

Change-Id: Ifa993e978579b4d061d21281338494292e19700a
CRs-Fixed: 2123967
2017-10-12 14:22:34 -07:00
Sravan Kumar Kairam
bd20096931 qcacmn: At set DMA mask skip IPA version check
Currently while setting DMA mask based on IPA HW version DMA
address bit mask is set. So when IPA is disabled at HW wrong
DMA bit mask is set which leads to allocation failures.

In this change skip IPA version check if IPA HW support is
absent.

Change-Id: I8e438ea012ca889f9d38f22b64207b2a9532a99b
CRs-Fixed: 2067774
2017-10-01 23:41:13 -07:00
Venkateswara Swamy Bandaru
b3d6b4e446 qcacmn: remove module parameter from dp code
Remove napi_budget module parameter from dp code.

Change-Id: Ib48d08044977da9091f1a1264d219420d7f53962
CRs-Fixed: 2096650
2017-09-21 16:41:57 -07:00
psimha
a079b8c678 qcacmn: Deregister HIF ext groups on rmmod
- Deregister & free the hif ext ctx when detaching DP interrupts.
- Unregister the hotcpu_notifier during rmmod.

Change-Id: Icbd3c6cee70b6b224059a4b301b9840485a96d11
CRs-Fixed: 2086729
2017-09-08 19:40:02 -07:00
Venkateswara Swamy Bandaru
ed15e74a87 qcacmn: Add support to pass napi budget as module parameter
Add module parameter to pass napi budget for dp interrupts. Default value is
set to 128.

Change-Id: I6b3761c6908ed9cec4e40118a657b39da6ac2532
CRs-Fixed: 2095242
2017-09-01 23:17:18 -07:00
Prashanth Bhatta
65b0eaa24b qcacmn: Change semantics of Runtime Lock APIs
Runtime PM lock init API right now returns pointer to a context
but this would cause confusion to the caller if feature is not
defined and dummy function return NULL as caller can't find real
failure versus dummy function returning because feature not being
enabled.

Fix declaring a data structure in QDF layer that caller can use
but it hides the internal details of HIF implementation for
Runtime PM locks.

CRs-fixed: 1116509
Change-Id: I4dcba604e803faa0e14fac6403610391895e382e
2017-08-15 13:27:07 -07:00
Houston Hoffman
817ff7fc72 qcacmn: Add target type for adrastea chip
Add adrastea target type definitions to hif.h.

Change-Id: Id3183287ecd749577cfc1b71a0cfd96210073612
CRs-Fixed: 2066361
2017-08-11 19:38:21 -07:00
psimha
61b1a36f72 qcacmn: Add NAPI stats
Add basic stats to track NAPI polls & schedules.

Change-Id: Iea8f21fc08d4a5de62e00f32ffdc020f8364ced1
CRs-Fixed: 2083867
2017-08-04 15:35:43 -07:00
Houston Hoffman
a0ecf33aa9 qcacmn: Duplicate hif_napi files
Duplicate hif_napi files to replicate the irq afinity handling
for hif_exec objects.

Change-Id: I31429ed188e6f40bb34aa8d22225752e311d364e
CRs-Fixed: 2051902
2017-07-13 03:38:00 -07:00
Houston Hoffman
def86a361b qcacmn: Introduce hif_exec_context
hif_exec_context extends hif_ext_groups to support napi and tasklet models.
Some of the rename and enahancements have been done to support merging of
the execution context management code between the CE and DP contexts, as
well as supporting irq affinity for both napi & tasklet contexts.

Change-Id: I82c8abf2e906f027ec80faf7353a7685536bb79b
CRs-Fixed: 2051902
2017-07-13 03:37:59 -07:00
Pamidipati, Vijay
3d8e1e8655 qcacmn: Enable interrupts for DP Rx Error release and REO status rings
Initialize correct mask values to enables Rx error and status ring interrupts

Change-Id: I717fbea492f12d983fb57d964996f4b79c73cb38
CRs-Fixed: 2004658
2017-06-16 17:12:19 -07:00
Dustin Brown
ccf859d9f5 qcacmn: Refactor Unit-Test Suspend
Unit-Test suspend needs to be decoupled from the copy engine
implementation in HIF. Split the HIF portion of Unit-Test suspend into
their own files, and clean up naming, etc.

Change-Id: Ic36c5b98c505f6b62ddf94336838a9e53fe8aa78
CRs-Fixed: 2055328
2017-06-16 09:49:14 -07:00
Karunakar Dasineni
7b61c6ca74 qcacmn: WAR for CE status ring timer intr issue
Enable timer threshold interrupts for CE destination ring.

Change-Id: I851283a5ae6dc6d0f237aa90fdf401fd52794377
2017-06-12 17:19:24 -07:00
Yu Wang
9d9fa19d83 qcacmn: add 'const' for 'section' in struct TGT_REG_TABLE
To fix the following compilation error:
warning: assignment discards ‘const’
qualifier from pointer target type, at:
reg_table->section = ar6320v2_reg_table
in ol_fw.c.

It's because the register table is a
const array, while reg_table->section does
not point to a const.
So add 'const' for 'section'.

Change-Id: Idfef358817241e73d660d2730b74c2ca88e23af1
CRs-Fixed: 2017786
2017-06-09 17:23:40 -07:00
Houston Hoffman
eab19b3b61 qcacmn: Allocate hif_napi_info structures dynamically
The hif_napi_info structure has a dummy netdev included.
The dummy netdev is large.  Avoiding unneeded allocation
save 30kb of memory.  Dynamically allocating the
hif_napi_info structures also reduces the size of
the contiguous memory needed for the parent structure.

Change-Id: I58044e5b1d0a834b3b6d17f66d6f4b2462873f2a
CRs-Fixed: 2016355
2017-06-08 15:23:21 -07:00
Dhanashri Atre
991ee4defc qcacmn: Modify legacy LRO implementation to use QDF
Modify the legacy LRO implementation to use the implementation
in QDF instead. This is to avoid code duplication and to unify
the LRO implementations for Napier and Helium.

CRs-Fixed: 2042812
Change-Id: I38e9da3b54392a1c5781133916361aac3875d43d
2017-05-26 16:11:22 -07:00
Manikandan Mohan
bd0ef8a249 qcacmn: Fix kernel module check patch warnings in HIF files
Fix kernel module check patch warnings in HIF files

Change-Id: I3ddc76399004f15f325b56709e4f2e96bf4cda96
CRs-fixed: 2033001
2017-05-02 13:29:28 -07:00
Manikandan Mohan
af3fb2cbb0 qcacmn: Fix kernel module check patch warnings in HIF USB files
Fix kernel module check patch warnings in HIF USB files

Change-Id: Ia9a76aedcef83bb582e44fc76a486137bd22362b
CRs-fixed: 2033001
2017-05-02 13:29:27 -07:00
Manikandan Mohan
a6d64a1dd6 qcacmn: Fix kernel module check patch warnings in hif sdio files
Fix kernel module check patch warnings in hif sdio files

Change-Id: Ieb1bac5061969538095fad8f0311029b3d3161f0
CRs-fixed: 2033001
2017-05-02 13:29:20 -07:00
Venkateswara Swamy Bandaru
61824944ab qcacmn: Add API to support configuring external group interrupts
Added API to support configuring external group interrupts for AHB bus.

Change-Id: If65984183db808e68dea680c585692e1533e4c7a
CRs-Fixed: 2018655
2017-04-12 04:02:03 -07:00
Mohit Khanna
012bfe3098 qcacmn: modify HIF NAPI blacklist mechanism
The existing HIF NAPI blacklist feature uses irq_blacklist_on(off) APIs
which make a call to the userspace irq_balancer.

Replace these APIs with kernel API irq_modify_status to mark (or unmark) the
individual interrupts with IRQ_NO_BALANCING flag. Once marked, the
msm-irq-balancer will not be able to move the CE interrupts around.

Change-Id: I4d780fa8780b42a668006e13a49eb1299304e633
CRs-Fixed: 1114161
2017-04-11 11:04:31 -07:00
Orhan K AKYILDIZ
5bfbc5b35b qcacmn: Make interrupt blacklisting robust
Interrupt blacklisting in kernel 4.4 happens through a user-space
entity. The kernel APIs irq_blacklist_on(off) essentially send
a message to the user space service(irq balancer) and
therefore are not synchronous and do not guarantee that blacklisting
has actually taken effect. It will be granted with some latency
(userspace entity's processing delay).

Make blacklisting more robust by:
a) move irq (if it has been moved around after blacklist_on call
has been made and not yet honored) to the designated CPU
on IRQ reception
b) stop cpu_isolation in blacklisting mode boost API
c) modify NAPI stats to indicate blacklisting mode

Change-Id: I13e478adbed1a6a66d320f69acdb012bee3dc1e8
CRs-Fixed: 1093770
2017-04-11 11:04:30 -07:00
Mohit Khanna
518eb5092e qcacmn: Add NAPI statistics to dumpstats
Currently NAPI stats are retrieved as a part of iwpriv getStats command.
The buffer available for this command is limited and NAPI stats get
trucncated.

Add a new dumpStats parameter (9) to dump NAPI stats.

Change-Id: Iaf52a3dcecac2f7b24fde2f8220fbfddc767965b
CRs-Fixed: 1076563
2017-04-11 11:04:27 -07:00
Yue Ma
9c6f84da99 qcacmn: Resume fastpath DP in correct place for runtime PM
Fastpath DP should be resumed after WOW is disabled from FW. Move
it to correct place.

Change-Id: I9108ee4393cc4ee5f8a232c3de14d68b47aa760e
CRs-fixed: 2023358
2017-04-03 18:02:13 -07:00
Houston Hoffman
cbcd8397ea qcacmn: Block non-wmi traffic in ce layer durring suspend
Upper layers are failing to block disallowed traffic durring suspend.
Hif can enqueue the messages on the ce rings without letting hardware
know they are there.  When fw is ready to recieve non wmi packets,
hif can inform hw of the queued packets.

Change-Id: I32810d9548416021c1da4f48a4ac539f75f1d907
CRs-Fixed: 2003582
2017-03-30 05:45:50 -07:00
Dustin Brown
6834d321d8 qcacmn: Fix IRQ disable for unit-test suspend on PCIe
pld_disable_irq is a no-op for PCI devices, causing unit-test resume
to fail in some cases. Define new IRQ disable/enable API's in HIF for
unit-test suspend/resume to use.

Change-Id: Ib3e6007025e791c867463c7d9f64512628c4ca0b
CRs-Fixed: 2023978
2017-03-24 15:16:59 -07:00
Himanshu Agarwal
846cf37306 qcacmn: Do IPA version based DMA coherent mask setting
In case of IPA hw version less than 3.0, only 32 bit DMA
address can be handled as it is only 32 bit compliant.
Because of this, setting DMA coherent mask of 37 when
IPA hw version is less than 3.0, crash is happening.

Do IPA version based DMA coherent mask setting such that
when IPA hw version is less than 3.0, set DMA coherent mask
as 32 only.

Change-Id: I8dec7da47766985ab0590f885b29f345f153cd08
CRs-Fixed: 1114605
2017-02-23 07:29:54 -08:00
Houston Hoffman
3c84105dc1 qcacmn: balance spin_lock_create (napi)
Adding lock stats print upon spinlock & mutex destroy.
Without the destroy api invoked the lock stats are not printed.

Change-Id: Id3c432e1f6982ea47bdf1de5c15f1a3568df4eb9
CRs-Fixed: 1100505
2017-01-31 18:53:02 -08:00
Dhanashri Atre
a98e024f86 qcacmn: Change due to R102 hardware headers for QCA6290
Changes needed to support the new definitions introduced
in the R102 hardware header files for QCA6290.

Change-Id: I4e3c27dfdc48b4d6a44f0f50f3e4a907be20e53d
CRs-Fixed: 1105853
2017-01-18 20:05:31 -08:00
Nandha Kishore Easwaran
858a769d6b qcacmn: Fix and Clean up code under NAPI_YIELD_BUDGET_BASED
Enable interrupts after processing the available
rx buffers on CE5 or complete napi after reaching the budget.

NAPI_YIELD_BUDGET_BASED:
This flag enables napi to return once the budget is exceeded,
or after processing the available packets and re-enables
interrupt and this feature doesn't honor the napi
yeild time configured.Napi budget will be configured as
256 for this feature

Change-Id: I75ac75ede46124bc773e3625173f33ca29da8142
CRs-fixed: 1094034
2016-12-15 03:44:06 -08:00
Houston Hoffman
fec8ed1234 qcacmn: Remove cds from napi hot_plug_notifier functionality
Instead of using cds to get the hif context in the notifier callback
rely on the context_of semantics to traverse back to the hif context.

Change-Id: I7d57f9dcf8c09836c34ce16a4acaa8c3bc1624b9
CRs-Fixed: 1092842
2016-11-28 14:09:48 -08:00
Houston Hoffman
60af6759fb qcacmn: Stringify HW_VERSION value when HW UNKNOWN
When new hardware is not found in the lookup table
for human readable hardware names, print the hex
value of the hardware version info.

Change-Id: If821ba04c83f2d9b54587379d92bdc1918d7a094
CRs-Fixed: 1092353
2016-11-28 14:09:45 -08:00
Houston Hoffman
31b25ecbea qcacmn: Support QCA6290 target type
Add device id for QCA6290 emulation platform.
Add target def support for QCA6290
Needs HIF_TYPE_QCA6290 defined

Change-Id: I4edd5a5b600007ebe7416195648815d80025e768
CRs-Fixed: 1089874
2016-11-19 06:47:36 -08:00
Leo Chang
5ea93a4527 qcacmn: wifi3 compile against cdp
Wifi 3.0 compile against cdp apis.
Make compilable against mobile code base.
selective hw common header include.

Change-Id: I051f917001c0d13c762d9cb5a3ec141cd278d0e7
CRs-fixed: 1075736
2016-11-17 19:13:03 -08:00
Venkateswara Swamy Bandaru
814094e9c2 qcacmn: Change CONFIG_SLUB_DEBUG_ON define to HIF_CONFIG_SLUB_DEBUG_ON
Change CONFIG_SLUB_DEBUG_ON to HIF_CONFIG_SLUB_DEBUG_ON to differentiate
kernel CONFIG_SLUB_DEBUG_ON macro with hif specific debug option.

Change-Id: I8922d5c37363da382f3f0b23489f8fd3544eed7d
CRs-Fixed: 1088928
2016-11-16 06:38:41 -08:00
Venkateswara Swamy Bandaru
aefb2f4dc4 qcacmn: Fix NAPI compilation issue for ext group interrupts
In current code ext group interrupts are not support. Defined these
functions to NULL to avoid compilation issue.

Change-Id: I7e1e027a3faabce1a8844606c5c5c3a412256ded
CRs-Fixed: 1088926
2016-11-16 06:38:40 -08:00
Orhan K AKYILDIZ
f006e93682 qcacmn: Disable NAPI before disabling the irq
Before disabling the interrupts, disable NAPI so that
the softirq cannot be [re-]scheduled.
Remove the affinity notification on the irq.

Change-Id: I64061d2b4f2e1e6eff67416133b928faa9c0dd4c
CRs-Fixed: 1089166
2016-11-15 19:48:37 -08:00
Manjunathappa Prakash
2146da30dd qcacmn: Add changes for per NAPI or per Rx CE LRO manager
Make changes for per per Rx context LRO manager, this addresses
all parallel Rx concurrency issues. There by removes all the contention.

Change-Id: I90604ffdf7b7fd930eee636426a4c7fc9b92c7d7
CRs-Fixed: 1079320
2016-11-15 00:35:31 -08:00
Kiran Venkatappa
7439befaf8 qcacmn: Add function prototype for hif_get_dev_ba in header file
Function prototype for hif_get_dev_ba is c file to avoid
warning. This should be ideally added in header file. Adding this
prototype in hif.h.

Change-Id: Ic61c5b8278e6e888931721e716de74c4703ace82
CRs-Fixed: 1079655
2016-11-13 23:59:33 -08:00
Kiran Venkatappa
8c8390a7c2 qcacmn: Move regdef for qca8074 out of AHB compiler flag
X86 uses PCI to connect to qca8074. ATH_AHB is not enabled on x86
but regdef is required to set correct offset for registers. Move the
initialization code out of ATH_AHB compiler flag.

Change-Id: I369f9c87e006fa3ae929e18a6922332d84f01382
CRs-Fixed: 1079647
2016-11-02 05:48:40 -07:00
Govind Singh
861d5da41d qcacmn: Remove arch_get_cpu_efficiency references from hif napi layer
Compilation error is seen for 32 bit builds as arch_get_cpu_efficiency
is not exported in 64 bit architecture cpu.

Remove arch_get_cpu_efficiency references from hif napi layer as this
information is not used as of now.

Change-Id: I68c31b1008696fc84bc5a563d45eaa507ae92981
CRs-Fixed: 1071783
2016-10-27 02:26:37 -07:00
Venkateswara Swamy Bandaru
5432c1babc qcacmn: Add support for low memory platforms
For supporting low memory platforms, if fastpath is enabled, the number
of destinaton ring receive buffers are reduced from 512 to 64 for CE1.
Also when pktlog has been disabled, avoid allocating receive buffers
for CE8.

Change-Id: Ia4cd991ec14a5d69f13efee8e6f72db6da99f83a
Acked-by: Sahoo, Amarendra Kumar <c_aksah@qti.qualcomm.com>
CRs-Fixed: 1066302
2016-10-25 23:43:29 -07:00