Commit Graph

670 Commits

Author SHA1 Message Date
Nirav Shah
0d0cce8057 qcacmn: Featurize EPPING Feature
Featurize EPPING Feature to compile
out in mission mode.

Change-Id: Iecbab88961034a5e5d2ab73b5b577e52cdb17873
CRs-Fixed: 2198847
2018-03-07 03:55:50 -08:00
Vinay Adella
2a6bd8a5f9 qcacmn: Don't send message to FW when in reset state
Fix a memory leak in the cnss layer, where the packet
used to send the disable command never gets freed.

CRs-Fixed: 2185830
Change-Id: I8118baf2397bf6440177d3fe92d34a537c29df8b
2018-03-05 04:28:22 -08:00
Nandha Kishore Easwaran
51f80b8f0b qcacmn: Add CE config for 2nd mac in qca6290
Added CE config for 2nd mac support in Napier. This is needed when
2 mac support is enabled in FW to bringup both 2g and 5g radio

Change-Id: Idd0b8fa7617e4797413266a62053125802f6b3ad
CRs-Fixed: 2192227
2018-02-27 15:08:03 -08:00
Balamurugan Mahalingam
f6d3035ec6 qcacmn: Fix race while stopping the ce poll timer
Set the timer_inited flag to false bit earlier to
stop ce_poll_timeout function from processing

CRs-Fixed: 2182979

Change-Id: I91dd257c6beb21e379a4c51e651d835a35ca76ed
2018-02-23 06:06:03 -08:00
Balamurugan Mahalingam
3ab3633184 qcacmn: Add support for QCA6290 platform
Add support for QCA6290 platform and introduced an hif api to enable,
disable polled mode.

Change-Id: I16e210fef93251b33928788cf873117249c2d70f
2018-02-23 06:06:00 -08: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
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
jiad
8245c03b69 qcacmn: Fix may be used uninitialized compile error
Build option -Werror=maybe-uninitialized throws may be used
uninitialized error.

Fix is to initialize varibles to 0 before being used.

Change-Id: I05a17fcb3dd666a77e14ef6469305fde541fb740
CRs-Fixed: 2165500
2018-01-24 02:27:05 -08:00
Venkateswara Swamy Bandaru
ed9697f4aa qcacmn: Fix race condition in enabling group interrupts
Fix race condition in initialising irq_enabled variable. Initialize it to
true before enabling interrupts.

Change-Id: I53a53ee729ca2dc54e47ac65a5bce00b0260f84e
CRs-Fixed: 2173907
2018-01-23 13:40:17 -08:00
Zhang Qian
145aef1dfa qcacmn: Fix potential buffer overflow
Fragment count will be larger than the upper limit which
would lead to an overread of fragment length. Upper limit
check for fragment count is added in this change.

Change-Id: Icc078b2efee554ac84377b5edd90d0a5c7a61f98
CRs-Fixed: 2158922
2018-01-19 14:10:52 -08:00
Kiran Venkatappa
c686275355 qcacmn: Add support for ce_cancel_srng API
ce cacnel is used To release/flush buffers from source SRNGs which have
not been reaped yet. Update this API to use appropriate hal API to reap
all pending buffers.

Change-Id: I6f8179b765f0768f2c2b25cd384b0380b7782414
CRs-Fixed: 2165595
2018-01-11 10:53:48 -08:00
Yue Ma
b4e12686e6 qcacmn: Enhance Runtime PM wakelock logging
It helps to track runtime PM wakelock allocation for each user.

Change-Id: I4d49c687fdd1dd3618f96f18acdaa9dad4197d74
CRs-fixed: 2152497
2018-01-05 15:30:08 -08:00
Venkateswara Swamy Bandaru
489ac74236 qcacmn: Fix kernel panic in wifi down path
Fix allocation size of hif context in case of ahb.

Change-Id: I306135f91706840988665d342ec897676ab3e161
CRs-Fixed: 2155377
2018-01-04 15:34:34 -08:00
Kiran Venkatappa
ae1a370d48 qcacmn: Use correct size in consistent free of CE rings
Size in consistent_memory_free should be same as size used in
consistent_memory_alloc. Fix the value sent in consistent free for CE
rings.

Change-Id: Iba6295cead21d357e266e753ca406732021ddfb4
CRs-Fixed: 2165385
2018-01-04 07:25:12 -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
Keyur Parekh
45393697a8 qcacmn: Fix potential buffer overflow
Fragment count will be larger than the upper limit of
cvg_nbuf_cb->extra_flag.num which would lead to an overread
of fragment length. Upper limit check for fragment count
is added in this change

Change-Id: Ib4ba4047f5eea89c09a92f89cf72e1976e0c9f3c
2017-12-27 11:01:16 -08:00
Lin Bai
ebf8d63835 qcacmn: Fix athdiag regression caused by boundary check
for QCA6290/QCA8074, input offset value will include memtype as well,
which not covered by current boundary-check, and will fail it.

Limited current boundary-check for legacy chip currently.

CRs-Fixed: 2157285
Change-Id: Id1e1fd10b4539288c461c6403fd8110fd5056dd5
2017-12-15 03:42:14 -08:00
Kiran Venkatappa
ca1b9f8769 qcacmn: Increase WMI event ring size for HK
WMI event pipe is shared between multiple pdev and it needs be big
enough to support events from 16+16 vaps. Increase it to 256 considering
128 used in older chipsets to support 16 VAPs for single pdev.

Change-Id: I7a1d8915c7c9a1916fb10408678f49e42147b189
CRs-Fixed: 2153720
2017-12-11 11:25:08 -08:00
Venkata Sharath Chandra Manchala
09adf5336c qcacmn: Enable Packetlog
Enable Packetlog for Lithium Based chipsets by:
Replacing ol_txrx calls with equivalent cdp calls

Change-Id: Ibf4431daca23c23c9e1c1a5e1ebb2579079e4969
CRs-Fixed: 2117063
2017-12-09 23:27:27 -08:00
Karunakar Dasineni
ce24321384 qcacmn: Fix bug in recent NAPI scaling change
Fix issue in reverse mapping of scaled NAPI budget.

Change-Id: I61e54122b406eed2189c9c857ca8423a61d38090
CRs-Fixed: 2156349
2017-12-09 15:08:29 -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
Yun Park
3fb3644e61 qcacmn: Clarify usage on Q_TARGET_ACCESS_BEGIN/END
Document where register writes are for legacy vs srng devices.
With the target access begin/end calls being associated with
the register writes and the register writes being associated to
specific HW, we avoid performing unneeded force wakes on common
code paths shared by legacy & srng based hardware.

Change-Id: Id91399d03298bfc5df56f0c5d5d14b648b665279
CRs-Fixed: 2117144
2017-11-14 12:07:30 -08:00
Tiger Yu
d448fad508 qcacmn: Fix memory leak for SDIO RX path in the HIF layer
qcacld-2.0 to qcacmn propagation

There is a memory leak if fail to process the rx packet header in the HIF
layer. Add sanity checking to free all resources if failure hit.

Change-Id: Ifa443dcec0a31ae39356ac1ddf7cfe652d8968ce
CRs-Fixed: 2137736
2017-11-11 09:25:12 -08:00
Yun park
c80eea7fcc qcacmn: ensure dynamic ce_count < CE_COUNT_MAX
This ensures scn->ce_count is less than CE_COUNT_MAX without having to
check all the constants it could be initialized to based on device
type.

Change-Id: I8482b5d7c455366d69dcda2b13785b305f192b3f
CRs-Fixed: 2128347
2017-11-10 00:27:49 -08:00
bings
be998d8c2d qcacmn: Free sdio hif device when hif_device_inserted fails
hif_device_inserted may be failed when installing sdio wlan module,
which causes memory leak.

To fix this memory leak, free the hif_sdio_dev and its related DMA
buffers when sdio driver fails in hif_device_inserted.

Change-Id: I6ee53cd2a55fbb1492c66caa260ba8b3681526e6
CRs-Fixed: 2131539
2017-11-07 00:01:53 -08:00
Surabhi Vishnoi
6f752b487b qcacmn: Check target address boundary before access
Athdiag procfs entry does not have address sanity check, this is
resulting in invalid ioread32/iowrite32 if out of PCIE BAR address
is used.

Fix this by allowing address with in PCIE BAR range.

Change-Id: I8365eacca7ccc4f489b7d0bda6c998384d0fec7b
CRs-Fixed: 2112270
2017-11-05 20:37:06 -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
chenguo
23b6502d88 qcacmn: Fix memory leak for RX path of SDIO WLAN
There is a memory leak for RX path of SDIO WLAN if skb allocation
fails. Add condition check and free all resources for scenario.

Change-Id: Ic4a58d3d4e93f1d6d57bfb045dfdeb131b24f72a
CRs-Fixed: 2128051
2017-10-31 17:39:02 -07:00
Sarada Prasanna Garnayak
e9f0e9c77f qcacmn: add device pointer in pld snoc API
Add device pointer in all pld snoc API to support
for numerous WLAN module.

Change-Id: I2e3a296d9b40f14633e0f6e1ed6392536d854552
2017-10-30 05:38:26 -07:00
Yingying Tang
474bba0579 qcacmn: Add "static" to fix compilation error for HL bus
Add "static" before some functions which only be used in 1 file to
resolve the compilation error.

Change-Id: I5bf80fe2e124bf4258c9bfdc997a5423773ca474
CRs-Fixed: 2010227
2017-10-27 13:33:01 -07:00
Sravan Kumar Kairam
26cf747681 qcacmn: Release the spin lock before return
Currently in interrupt handler of per CE, spin lock is taken for
send or receive and returns with out releasing the lock held if
target register access is not allowed. This condition will lead
to kernel panic if some other context is trying for the same lock.

Change-Id: I115f6fbb006d28097168342aa4add3526ad3939d
CRs-Fixed: 2077464
2017-10-27 01:57:52 -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
bings
21f4cdaee2 qcacmn: Free sdio global variables scn, ol_sc in hif_sdio_close
When BMI failed in sdio, hif_sdio_dev->claimed_ctx is not set as valid
value. Then scn, ol_sc can't be freed through hif_disable_bus as usual.

To fix this memory leak, free scn, ol_sc in hif_sdio_close.

Change-Id: I96b9b7c86ea6e84a32eec1c57c27ef042673e2e1
CRs-Fixed: 2131452
2017-10-26 21:49:14 -07:00
Yun Park
b5e74bb6ae qcacmn: Fix irq mismatch from wake irq
Fix irq mismatch from wake irq, as well as extra irq free.

Change-Id: Id4415312868e54909521f0016923f859b228db64
CRs-Fixed: 2118005
2017-10-25 17:48:05 -07:00
Balamurugan Mahalingam
1666dd32aa qcacmn: Enable support for Coldboot calibration in IPQ8074 platform
This changes checks the con_mode value and passes corresponding PLD mode value

Change-Id: I08a8f87c3dc92b7af02c36851b27eec800b7f4a7
2017-10-24 04:51:47 -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
Orhan K AKYILDIZ
9e5b93c55c qcacmn: Limit yield log to rx data CEs
A recent change added NAPI yield stats update call for all CEs.
With another receent change that shortened the yield time, we see
a lot of logs complaining about CEs where this particular stats
are not applicable to. Limit the stats update to NAPI CEs.

Change-Id: Ia17a4ddf53ce52116f30d48190f47914721a548e
CRs-Fixed: 2092084
2017-10-12 14:22:24 -07:00
Houston Hoffman
d42ab38aa3 qcacmn: Remove WMI_CONTROL_SVC_WMAC1/2 from the default service map
WMI_CONTROL_SVC_WMAC1/2 services are not supported by adrastea/rome firmware.

Change-Id: Ibf5ab94c44e91f9e61110b5c395c69a408d12b77
CRs-Fixed: 2122123
2017-10-12 14:21:47 -07:00
Dustin Brown
0d7163dbd4 qcacmn: Log failures to prevent PCIe power collapse
Currently there is no indication when calls into pld_wlan_pm_control
fail. Add an error log in such situations to improve debugging.

Change-Id: Ic061a1735878930a5ab55711da58f8bad1a6a8a6
CRs-Fixed: 2119173
2017-10-05 16:11:29 -07:00
Nachiket Kukade
e5738b5a87 qcacmn: Return proper error status from modules under hif_start
Some of the HIF API's that do buffer allocations and operations
return either 0 or 1 as return status. Information is lost since
the same value is returned in case of buffer allocation failures,
queue operation failure or anything else. Caller can't decide if
to perform recovery, graceful failure or BUG_ON.
Return the appropriate error status to the callers.

Change-Id: Idccd3968231d030311fa5581aed78849b729227d
CRs-Fixed: 2105913
2017-10-05 09:20:03 -07:00
Govind Singh
ae820d08e5 qcacmn: Remove diag config from HOST CE config
IHelium uses qmi path for read/write access to
target registers, legacy diag path is not used.
Remove diag config to reduce unnecessary allocations.

Change-Id: Ic251364b5a724c1efd7d34bba55b020189e8e599
CRs-Fixed: 2041887
2017-10-05 09:19:57 -07:00
Jeff Johnson
b945021c30 qcacmn: hif: Replace instances of unadorned %p
Replace instances of unadorned %p in hif.

Change-Id: I282573452a2c12b4bccdbdaab611dcd6f84a6240
CRs-Fixed: 2111274
2017-10-03 16:02:39 -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
Arunk Khandavalli
e14e8e9fcf qcacmn: Fix Dma memory allocation leak from Hif layer
HIF close is not freeing RRI memory allocated during HIF initialization
resulting in memory leak of RRI memory after driver unload

To mitigate the issue, freeing RRI memory in HIF close.

Change-Id: Ib3daba8de0cabc1d8e303d7148448d21c47905e7
CRs-Fixed: 2019147
2017-09-27 20:08:51 -07:00
chenguo
ebc085458b qcacmn: Fix RX dead loop for SDIO WLAN
There is a dead loop when nbuf allocation failed for SDIO WLAN.
Do not change the status back to OK when E_RESOURCE is triggered.

CRs-Fixed: 2112323
Change-Id: I50b8fff99707cdccb1e5e837558131d6777ec9c0
2017-09-24 23:20:23 -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
Dustin Brown
49a8f6e37e qcacmn: Prepend kernel includes with "kernel/"
To avoid include conflicts, prepend all kernel includes with "kernel/"

Change-Id: I1c3ae9078d5537b03486afff9c2491881c9f694c
CRs-Fixed: 2098814
2017-09-15 12:22:51 -07:00