Commit Graph

670 Commits

Author SHA1 Message Date
Samuel Ahn
388b9a5c1e qcacmn: Add support for multiple instances of the host driver
Propagation from qcacld-2.0 to qca-wifi-host-cmn.

If the module name is changed to something other than wlan in
Makefile or Kbuild, then MULTI_IF_NAME is defined to be the module name.
When MULTI_IF_NAME is defined, the names for the config files, log files,
and firmware files are prepended or appended with MULTI_IF_NAME. This
prevents file name collisions allowing multiple instances of this driver
to be loaded with different module names.

Change-Id: Id880c5fe423eb0b2a2c01677d8fa7c4a784c74df
CRs-Fixed: 946520
2016-12-01 01:41:23 -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
59fd245eae qcacmn: Add WCN3990_V2 to hw names
Print out hw name WCN3990_V2.2 when soc version is 0x40010001.

Change-Id: I78c8cf5cf8917174fe95b8a8eefe608363a49e49
CRs-Fixed: 1092353
2016-11-28 14:09:43 -08:00
Houston Hoffman
710af5a21e qcacmn: Use 9 copy engines for QCA6290
Reserve CE9-11 for the MHI driver.

Change-Id: If09c749293f98e9d0d97e73c3720eb5d8800070f
CRs-Fixed: 1093513
2016-11-26 13:35:38 -08:00
Nandha Kishore Easwaran
cbff9c9090 qcacmn: Enable napi to re-enable interrupts
When NAPI is busy processing Rx, interrupt is not re-enabled
and this causes CE2 and other pipes to become full and target asserts.
This patch enables napi to return after processing half of the descriptors.

Change-Id: I2ba443c388f1a9d36331c632bfb2fbbbe876228f
Crs-fixed: 1094034
2016-11-25 11:00:24 -08:00
Jeff Johnson
6950fdbedd qcacmn: Fix -Wmissing-prototypes in HIF
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code that is generating warnings. Fix all warnings
in hif.

Change-Id: I342360f48f73a1e5ef42ebc4ca38366669eea0e0
CRs-Fixed: 1091702
2016-11-23 14:44:52 -08:00
Sarada Prasanna Garnayak
8d9eba1470 qcacmn: Fix compilation error for msmcobalt_32
In hnc_link_clusters function, few local variables left
uninitialized. Initialize them with zero as they will get
overwritten during the processing of the cluster for first time.

CRs-Fixed: 1085510
Change-Id: I04af509bdc1a63eeb215c5ec854b55a8bc45aba9
2016-11-20 22:33:04 -08:00
Houston Hoffman
6fe6059965 qcacmn: Dummy hif_hal_attach when hal not supported
If hal_api.h is not available do not use its api's.
Avoid "implicit declaration of function" compilation error.

Change-Id: I8458bde4ce862adeeda5c8d3892ce439be068c06
CRs-Fixed: 1089874
2016-11-19 19:32:14 -08:00
Houston Hoffman
b522bdc3cc qcacmn: sync qca6290def.c with fw_common
Use UMAC_CE_COMMON_CE_HOST_IE_0 instead of
UMAC_CE_COMMON_WFSS_CE_COMMON_R0_CE_HOST_IE_0

Change-Id: I70e92ca4b86329b562e84261d8911f52f7d64cd0
CRs-Fixed: 1089874
2016-11-19 19:32:13 -08:00
Houston Hoffman
2d8ee28971 qcacmn: changes in pcie path to bypass for emulation builds
Changes include skipping of legacy interrupt routing,
target probe and target sleep state adjust

Change-Id: I36b7f627e7ca6970a73ffbc85b7f0e7a6ce40325
CRs-Fixed: 1089874
2016-11-19 19:32:12 -08:00
Houston Hoffman
74109127d0 qcacmn: write DEST_MAX_LENGTH for CE rings
Change that allows configuration of max buffer
size for SRNG rings in the receive direction

Change-Id: Ib857f1fdf43c849078f9470ec029fe627379fcb4
CRs-Fixed: 1089874
2016-11-19 19:32:11 -08:00
Houston Hoffman
f7bc308404 qcacmn: use my_io_remap to map 13MB for pcie space
This remap is needed temporarily for emulation builds

Change-Id: I6662eeba32dc5847aac730928ed72db77ff1d42c
CRs-Fixed: 1089874
2016-11-19 19:32:10 -08:00
Houston Hoffman
202425d1a5 qcacmn: Set intr_timer_thres_us to 0
intr_timer_thres_us minimum step size is 8us. So anything
less than 8 will not enable the hardware timer.  Set the
value to 0 to avoid confusion.  A strong warning message
should also be added.

Change-Id: I9286d2988930df8577e46e5a753cc6f68c71d180
CRs-Fixed: 1089874
2016-11-19 19:32:09 -08:00
Houston Hoffman
9a1b391970 qcacmn: Add direction to srng DPTRACE call
DPTRACE has been enhanced to record send and recive packets.
Update the missed call site

Change-Id: If1554b31add1df00f98b6d3eed8e5f752ca4722c
CRs-Fixed: 1089874
2016-11-19 06:48:38 -08:00
Houston Hoffman
6c0c3f95fa qcacmn: skip bmi for srng based chips
SRNG based chips will use MHI based firmware download

Change-Id: I4125578a33315011075677a0ea7e4b48c914037f
CRs-Fixed: 1089874
2016-11-19 06:48:13 -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
Houston Hoffman
a57184e5ef qcacmn: remove pci_set_drvdata
pci_set_drvdata stores a pointer in the pci driver device structure.
Since we do not use this pointer any more we do not need to set it.

Change-Id: I36452aaf2a4c218a3d3891626406e4693d968bba
CRs-Fixed: 1071958
2016-11-19 06:47:10 -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
Kai Liu
af427fe54c qcacmn: Adjust buffer size for fw dump
qcacld-2.0 to qcacmn propagation

In platform using usb interface, when fw assert, buffer alloc for fw
dump is smaller than the actual fw dump size, so adjust the buffer size.

Change-Id: I4706c57e8c1b684bfe164b23fc0902c376d4d80a
CRs-Fixed: 1043805
2016-11-17 14:00:28 -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
Houston Hoffman
a69581e791 qcacmn: Disable interrupt processing before stopping the bus
The interrupt free code is protected by a flag.  In the normal case
the interrupts are freed before the bus is stopped.  Make all cases
free the interrupt before hif_stop.

Change-Id: I1e1dfae9ba388733eb13f2cdf90aa85b3db35b0d
CRs-fixed: 1089935
2016-11-15 02:18:25 -08:00
Houston Hoffman
7fe51b1cf3 qcacmn: Free ce fastpath buffer even if handler not installed
Durring a driver load failure, the fastpath buffer is allocated
before the fastpath handler is installed.  Change the free logic
to match the allocation logic.

Change-Id: Ib9731b3d06d7ac728e0f23bb32e2b74c35b9a8de
CRs-Fixed: 1089933
2016-11-15 02:18:24 -08:00
Houston Hoffman
271951f0dc qcacmn: Return error in hif start for allocation failures
This allocation failure will likely lead to a copy engine
stall and subsequent need to restart the subsystem.
Abort the module start immediately to avoid a system crash
or delayed subsystem restart.

Change-Id: Ibe7b348dee39d35e3e7f767f17f0114d888a30f8
CRs-Fixed: 1088725
2016-11-15 02:18:21 -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
Komal Seelam
887b648e11 qcacmn: ADD API to sanatize during SSR shutdown
During SSR, HDD context prevails, no need to free the contexts.
Hence add an API to sanatize runtime pm list during SSR shutdown.

CRs-Fixed: 1082449
Change-Id: I189eca6fc31dfa2cdedade3d5308f01311d72c88
2016-11-07 03:33:23 -08:00
Pratik Gandhi
815c6d8a62 qcacmn: Implement run-time check for 8074 target for emulation
Target 8074 changes for emulation platform (VP/M2M/SOC) are under
compilation switch which does not allow single meta to run for
legacy platforms and Hawkeye emulation platform.
Change compile time switch to run time check for target.
Keep all emulation related changes under QCA8074_VP switch which
needs to be always enabled. It helps to identify emulation specific
changes. All emulation changes are enabled for target type 8074.

CRs-Fixed: 1082545
Change-Id: Id0bab52735154db086b56ecd751578dba75a311a
2016-11-04 11:12:44 -07: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
Poddar, Siddarth
fbb155f557 qcacmn: Add NULL check for HIF state and CE state before dereferencing
Add NULL check for HIF state and CE state in ce_send_cb_register and
ce_recv_cb_register functions before dereferencing it.

Change-Id: I96cde91775ff77f6ae863b4d56e48c42e34104c7
CRs-Fixed: 1081995
2016-10-27 01:48:59 -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
Orhan K AKYILDIZ
84deb9727e qcacmn: Fix memset bug on error path
Fix the incorrect order of arguments to memset in two
places in the error path.

CRs-Fixed:  1082204
Change-Id: I4cd6e23930d4f34bb732499eda2b20845b09a3b2
2016-10-25 16:37:38 -07:00
Sarada Prasanna Garnayak
df1c4b2f77 qcacmn: Add API in HIF to read Runtime State in readable format
Improve Runtime PM state logging for debugging purposes.
Log transport layer tag as well.

Change-Id: I90b74693c8c84a09a8cca64276ad62b7157160cb
CRs-Fixed: 1072520
2016-10-21 13:09:16 -07:00
Houston Hoffman
dd4da483c7 qcacmn: Add WCN3990_V2 to hw names
Print out hw name WCN3990_V2 when soc version is 0x40010000.

Change-Id: I0e1be64fe5c3b148bb96fbbbbeed4bc68d06ad4b
CRs-Fixed: 1078766
2016-10-20 15:12:26 -07:00
Srinivas Girigowda
8a0b665897 qcacmn: Replace DEBUG macro with WLAN_DEBUG
This is a qcacld-2.0 to qcacld-3.0 propagation.

pr_debug() should not appear by default in kernel log (kmsg).
DEBUG is a kernel macro, since host driver is using the same name macro,
pr_debug log statements are appearing in kmsg.

Fix this by moving the code under DEBUG to WLAN_DEBUG and
remove DEBUG macro from Kbuild.

Change-Id: I5bb385f91f9b6ba15629a5878625fefc21d4a7e1
CRs-Fixed: 1003261
2016-10-20 01:39:05 -07:00
Orhan K AKYILDIZ
458fefc8bd qcacmn: Add a NAPI mode for roaming
Add a new mode with a pair of new NAPI events, NAPI_EVT_USR_SERIAL
and NAPI_EVT_USR_NORMAL, which allows client force NAPI to move all
instances onto the same CPU and peg them there (blacklist); and
to move back to normal mode of operation.

This part implements the HIF portion. Goes with the corresponding
HDD code.

Change-Id: Id301267d654ef24de706f81b0bd712ed751d8265
CRs-Fixed: 1078976
2016-10-18 19:19:51 -07:00
Komal Seelam
81045d5cb8 qcacmn: Define Runtime PM init/exit API's in the driver
OPENSOURCE driver doesn't need PLD/CNSS platform layer
interface to call the kernel API's.

Define the Runtime PM init/exit API's in the bus interface layer.

CRs-Fixed: 1072520
Change-Id: I81bd782e52095826510b3adfd02ca76f593bdb49
2016-10-18 00:45:46 -07:00
Mohit Khanna
865d8ff535 qcacmn: Fix IRQ affinity Core-ID during NAPI CPU migration
Currently we are using core-id of the core for setting IRQ affinity.
This is incorrect since core-ids can be common across clusters. Use
CPU number instead for setting IRQ affinity.

Change-Id: I71afd23c6a78985df51a694ed21cc6c3a51eedf3
CRs-Fixed: 1077069
2016-10-17 17:27:50 -07:00
Orhan K AKYILDIZ
6d9b757ac5 qcacmn: Use PLD APIs instead of ICNSS ones
Replace calls to ICNSS APIs with calls to PLD APIs, as per the new
guidelines.

Change-Id: Iccb8633ad5f6b493b2424acab98ba573f95f15c2
CRs-Fixed: 1070948
2016-10-12 19:10:19 -07:00
Yuanyuan Liu
041397ff74 qcacmn: Remove platform stub files
Remove platform stub files as PLD takes care of platform APIs.

CRs-Fixed: 1056979
Change-Id: Iecb40e4c3b2b281c6bac179b173c46ceebbc5018
2016-10-10 00:12:16 -07:00
Houston Hoffman
471e9a05e9 qcacmn: introduce dummy hif_ahb_configure_irq
When AHB is not compiled in, hif_ahb_configure_irq needs a dummy
implementation for compilation.

Change-Id: I782ffed7d01b3de84bab61140dd4158768bb30a3
CRs-Fixed: 1072078
2016-10-07 18:12:15 -07:00
Houston Hoffman
834b927a37 qcacmn: Check precondition at start of hif_snoc_enable_bus
ol_sc null check needs to happen before it is dereferenced.

Change-Id: I11820668fcbcc59c87ee7c675aec2451da030075
CRs-Fixed: 1072077
2016-10-07 18:12:12 -07:00
Houston Hoffman
55fcf5a1c8 qcacmn: Check ce_state for null before dereference in ce_mark_datapath
Dereference was happening before the null check. Also simplified the
data structure traversal since we are inside hif.

Change-Id: I2370402f3d080bd413ab949a40dc5d97fba6be27
CRs-Fixed: 1072077
2016-10-07 18:12:07 -07:00
Dustin Brown
e589dd571c qcacmn: Cleanup code related to unit-test framework
A previous unit-test framework change contained some outstanding clean
code issues. Address the issues to ensure cleaner code is maintained.

Change-Id: I4e9f8e98f63e280b4333dec710fd1bd2e37e3fb6
CRs-Fixed: 1073756
2016-10-07 16:28:36 -07:00
Dustin Brown
6bdbda50fb qcacmn: Power offload unit test framework enhancements
Recently host power offload suspend/resume has switched to 3
stage process. Enhance power offload unit test framework accordingly, and
improve error handling. This is a companion change for
I8cc1e955fbaca631ee7fd76b0c907d1e68c836bf in qcacld-3.0.

Change-Id: I8c4e062d4a51a7a245500bc135571fc67cf1b4d0
CRs-Fixed: 1072424
2016-10-06 11:38:21 -07:00
Venkateswara Swamy Bandaru
772377c7df qcacmn: Enhance ce register dump and add hif_get_irq_num
Modify the CE register debug dump routine to print the read,
write indexes on the console.

Add new function  to return vector used for specific radio.
WIN uses this routine to retrieve the irq and assign the same
to radio netdev irq field. Assign the radio netdev with
the right irq number which helps qrfs to steer to traffic
towards a specific core.

Change-Id: I94bdcc323afbee53946ea9e50a773ffe35224ae6
Acked-by: Balamurugan Mahalingam <bmahalin@codeaurora.org>
CRs-Fixed: 1066208
2016-10-06 07:32:11 -07:00
Venkateswara Swamy Bandaru
26f6f1ebae qcacmn: Add support for pipe specific callbacks
Packetlog framework needs pipe specific callbacks. Change is done to
support pipe specific callbacks.

Change-Id: Iabd442acc8bef19ad9b8ad9ff2660e273a859f54
CRs-Fixed: 1072220
2016-10-06 07:32:09 -07:00