Commit Graph

670 Commits

Author SHA1 Message Date
Venkateswara Swamy Bandaru
17cf2be2d4 qcacmn: Fix for CE Ring full error in ce_send_single path
sw_index is updated based DATA_CE_SW_INDEX_UPDATE_SKIP compile time flag.
If DATA_CE_SW_INDEX_UPDATE_SKIP is enabled software has to take care of
sw_index updation. Otherwise it will be read through register

Change-Id: I994e04cf08170441eba034a747e6224ec4c8370e
CRs-Fixed: 1072217
2016-10-04 14:42:17 -07:00
Yuanyuan Liu
3aa7fed319 qcacmn: Call PLD APIs of athdiag read/write when bus type is SNOC
Call PLD APIs of athdiag read/write if current bus type is SNOC.

CRs-Fixed: 1061835
Change-Id: I992a29027e36c98bac429f2402e93462195bd76c
2016-09-27 12:32:42 -07:00
Komal Seelam
2510b58c34 qcacmn: Prevent NOC/Link Access in resume when Link is down
propagation from qcacld-2.0 to qcacmn.

PCIe link training failure will not be indicated to cnss client driver
as a link down indication.
In System/Runtime PM resume callbacks, client driver will access the target
registers results in L2 errors.
Fix it by ensuring the PCIe link resume training is completed by reading
config space device-id.

Change-Id: I8be902330215cf3c8cb0700e6f0da5b69e274c96
CRs-Fixed: 1052965
2016-09-26 04:49:49 -07:00
Kiran Venkatappa
f41ef2e093 qcacmn: Add CE services changes for SRNG based target
SRNG based target uses SRNG(Standard Ring) interface to implement all
the ring related access functions. This change provides CE services to
use interact with SRNG for CE access. It uses hal_srng module for HW
related access. It implements src ring using SRNG src ring and
destination ring using dest and status ring.
fastpath and batch send is not implemented as these are not applicable
to this target

Change-Id: I3e2b613004a08d669319f956d7b0656447eb8521
CRs-Fixed: 1042915
2016-09-20 07:59:11 -07:00
Kiran Venkatappa
182a88a349 qcacmn: Add changes to skip fw boot, reset and HIA config
This change is applicable to Hawkeye VP bringup. It is added under
QCA_WIFI_QCA8074_VP flag

Change-Id: Ief32afebf2a306425e33e4ebc56351f10c609198
CRs-Fixed: 1063252
2016-09-20 07:58:56 -07:00
Venkateswara Swamy Bandaru
31108f318c qcacmn: Add framework for external group interrupt handling
Change-Id: I68a3c597e452e1975a97f9262870e16538f6dc4c
CRs-Fixed: 1042915
2016-09-20 07:58:33 -07:00
Venkateswara Swamy Bandaru
9fd9af065c qcacmn: Interrupt handling support for chipset QCA8074
Changes to handle Interrupts for qca8074

Change-Id: I81d4b0722d56388cc7aca08484bd8957258621d1
Acked-by: Venkateswara Swamy Bandaru <vbandaru@codeaurora.org>
CRs-Fixed: 1042915
2016-09-20 20:27:31 +05:30
Venkateswara Swamy Bandaru
2aa2c6913e qcacmn: regtable population of QCA8074
Added qca8074def.c that holds the register
table entries for qca8074.

Change-Id: I40b170722c2177cf5f53b5728cfae3730eeb8500
Acked-by: Venkateswara Swamy Bandaru <vbandaru@codeaurora.org>
CRs-Fixed: 1042915
2016-09-20 20:25:39 +05:30
Venkateswara Swamy Bandaru
e20c6dceda qcacmn: Fix AHB & disable soc-sleep durring driver load
Instead of checking target type, check bus type for skipping soc-sleep
durring driver load code.  Also enhance comments to explain why
hif_pci_target_sleep_state_adjust is called instead of
hif_target_sleep_state_adjust for the disable soc-sleep
durring driver load feature

Change-Id: I891e1b1782b46b32c1718e2c539215282e090bad
2016-09-20 20:25:20 +05:30
Venkateswara Swamy Bandaru
13164aac76 qcacmn: Make host_ce_config and target_ce_config per radio
Moving global variables host_ce_config and target_ce_config to
per radio structure.

Change-Id: Iaaee722af16812e06aae068f0fa0092cf5c8f78a
CRs-Fixed: 1042915
2016-09-20 20:24:54 +05:30
Venkateswara Swamy Bandaru
c5de4d9fd7 qcacmn: Cleanup target reg table
Remove unused fields in target reg table.

Change-Id: Ic183f7a27ffd5d4542dfe1c3eccb11825539c70f
Acked-by: Venkateswara Swamy Bandaru <vbandaru@codeaurora.org>
CRs-Fixed: 1042915
2016-09-20 20:23:50 +05:30
Pratik Gandhi
424c62e877 qcacmn: Address compilation issues for WIN new fw headers
Address compilation issues for WIN with new Lithium Firmware headers.
Also removed dependency on htt.h from header files, which may need to
add explicit dependency on htt.h in .c files.

Change-Id: Ia5027963837e645bc3f81a3db98c2ea06789aea8
CRs-Fixed: 1061096
2016-09-19 01:19:28 -07:00
Manjunathappa Prakash
21196d2578 qcacmn: Fix multi queue NAPI build errors
Fix build errors on the platform where multi queue NAPI is
not supported.

Change-Id: Id9916cff11f9337f279f9aed6dfe35e7a6beb1ed
CRs-Fixed: 1066020
2016-09-12 19:26:37 -07:00
Orhan K AKYILDIZ
7ce54e770f qcacmn: add multi-queue NAPI
Add CPU cluster management functionality. On low throughput,
the system works as normal. On high throughput, the driver gets
control of WLAN datapath interrupts and disperses them on different
CPUs and pegs them to maximize performance. Add init code, topology
table construction and hotplugin notifiers.

Change-Id: I247edb57003797ed6a04f70d15067072e22c2396
CRs-Fixed: 1065477
2016-09-12 18:02:29 -07:00
Himanshu Agarwal
df9ac5731e qcacmn: Add NULL check for HIF device before dereferencing
Propagation from qcacld-2.0 to qcacmn.

Add NULL check for HIF device structure in hif_enable_func before
dereferencing it.

Change-Id: I535d5138c2247b4b9acdf63211f30a57a1d3116f
CRs-Fixed: 1055684
2016-09-12 18:02:27 -07:00
Himanshu Agarwal
8d0cdea5b4 qcacmn: Add sanity check to avoid NULL pointer dereference
Propagation from qcacld-2.0 to qcacmn.

Add sanity check to avoid NULL pointer dereferencing of tx
completion handler callback in hif_send_buffer_cleanup_on_pipe.

Change-Id: If38b4b7cdd1154d8272e5150c6653f90df8f4b5e
CRs-Fixed: 1057490
2016-09-12 18:02:27 -07:00
Houston Hoffman
c1064a8fd8 qcacmn: Move ADRASTEA_BU inside pci code
Prepare to make ADRASTEA_BU true only for emulation
builds.

Change-Id: Iaeea8d8b1431f5eb670adc43e6fd54d5446bbc0f
CRs-Fixed: 1049433
2016-09-08 18:22:28 -07:00
Houston Hoffman
4989bafb07 qcacmn: Check nbytes before posting in SLUB
Check for valid nbytes values before posting descriptors
to copy engines when sending messages to FW in slub builds.

Change-Id: I6996aa5dc607be60c2434f04cd6b3249bc7df415
CRs-Fixed: 1060096
2016-09-08 18:22:26 -07:00
Houston Hoffman
7a5f890d58 qcacmn: Fix index recording for FAST_TX_SOFTWARE_INDEX_UPDATE
The sw_index was being recorded in the FAST_TX_SOFTWARE_INDEX_UPDATE
event leading to confusing descriptor history.

Change-Id: I1f2084296f25faf00c30370f47c4d29fb258c90b
CRs-Fixed: 1060098
2016-09-05 01:23:24 -07:00
Houston Hoffman
f7d5d8e397 qcacmn: Double CE2 resources on host and firmware
Firmware crashed when it ran out of buffers.  Increasing
the descriptor ring size for firmware and host on CE2
at firmwares request.

Change-Id: I602bc896dcd76b3184f922a3ac961a4433585374
CRs-Fixed: 1061291
2016-09-05 01:23:23 -07:00
Venkateswara Swamy Bandaru
1633436e74 qcacmn: Added a member in qca_napi_info structure
To derive hif_ctx from napi pointer. This changes helps enable napi support
for WIN driver.

Change-Id: Idcb0775195665d60d4b1a9a010afcfab256d839f
Acked-by: Balamurugan Mahalingam <bmahalin@codeaurora.org>
2016-09-02 04:33:47 -07:00
Dustin Brown
973abe89e4 qcacmn: fake apps ensures correct ce_id before resume
Currently, the interrupt handler does not check for the correct ce_id
before triggering a fake apps resume. This check is added to
hif_fake_apps_resume().

Change-Id: I810c59bb8536356bd87a394c815a294755aa5161
CRs-Fixed: 1061287
2016-09-02 02:08:08 -07:00
Venkateswara Swamy Bandaru
3ca38e2fe3 qcacmn: Support for wifidown and wifiup without modules removal
Release the iomem requested during the cleanup path.
Successive request to iomem resource fails,
if the ioremapped region is not released
during the last cleanup

Change-Id: Icc88647df8d21f9f230b784faa8e7fdaf5968814
Acked-by: Balamurugan Mahalingam <bmahalin@codeaurora.org>
CRs-Fixed: 1056971
2016-09-02 01:08:39 -07:00
Houston Hoffman
7fdff0c52f qcacmn: Use suspend_noirq callback instead of disabling irqs
Disabling the interrupts and setting them as wakeup sources does
not work as expected.  The pending interrupt gets trapped in sw
and kernel does not check for it before finishing the suspend.

Instead, use the suspend_noirq callback to guarantee that
wakeup messages don't get processed without rejecting the suspend.

Change-Id: I5ec5ce2a7e1b14c3d8477fe7aa0372c9ffd4dc0d
CRs-Fixed: 1060880
2016-09-01 22:08:57 -07:00
Venkateswara Swamy Bandaru
fa291a7851 qcacmn: Fix for kernel panic in wifi down path for peregrine
Warm reset is done in wifi down path for peregrine

Change-Id: Id187b8e60859f9936e4761bdce9ae7f744bd79d7
2016-09-01 13:27:53 -07:00
Govind Singh
4fcafd4990 qcacmn: unmap buffer for CE destination ring en-queue error
Unmap a previously mapped buffer if host fails to en-queue
buffer to CE destination ring.

Propagation from qcacld-2.0 to qcacmn.

Change-Id: If23398b01124638cfb266f5755fc9e45d3969ac9
CRs-Fixed: 1033307
2016-08-31 05:14:43 -07:00
Houston Hoffman
cd0884a954 qcacmn: Add WCN3990 to hw names
Print out hw name WCN3990_V1 when soc version is 0x40000000.

Change-Id: Ic76cd3ddc46cf9a2b142cc2d455b512e442f189e
CRs-Fixed: 1059083
2016-08-30 23:28:35 -07:00
Rajeev Kumar
8f312f2704 qcacmn: Reduce wake up IRQ enable/disable log level
IRQ wake up is happening as expected so reduce WLAN CE 2
IRQ wake up request log to info level to avoid logging it
every time on console.

Change-Id: I9838c80d5133b3f872b1129e41d4f722ba57b011
CRs-Fixed: 1059081
2016-08-25 18:53:13 -07:00
Mohit Khanna
440c5295c2 qcacmn: Add USB bus support (HIF Common)
Add module specific changes for USB bus support.

Change-Id: I98ca380567c279d3206aa4afc7a28c2feeb65993
CRs-Fixed: 1023663
2016-08-17 12:05:38 -07:00
Mohit Khanna
1957ba9385 qcacmn: Add USB bus support (HIF Dispatcher)
Add module specific changes for USB bus support.

Change-Id: If1f7d16a733d5d98cba982e3a5e7936356c57d8a
CRs-Fixed: 1023663
2016-08-17 12:05:29 -07:00
Houston Hoffman
8a3a9a4b06 qcacmn: Integrate tasklet flushing logic into snoc
Need to ensure that that the wakeup message gets processed
deterministically (before the return of hif_bus_suspend,
or after the message has woken up the apps.)

In another change, the driver will check for the wakeup message
after hif_bus_suspend completes and reject the suspend if it
has allready recieve the wakeup message. In conjunction with
this change the host will not be able to accidentally process
and discard the wakeup message.

Change-Id: I6d487a00dcfd40a665d3be03697f3a7cfc815203
CRs-Fixed: 1051968
2016-08-13 14:49:04 -07:00
Houston Hoffman
6f60b107c5 qcacmn: Move tasklet flush up to ce
Wish to reuse this logic for snoc

Change-Id: Ibd678feec9fe0ee583d32d055d4cb4a4885991ab
CRs-Fixed: 1051968
2016-08-13 14:49:04 -07:00
Houston Hoffman
cb9bc6333d qcacmn: Configure the wakeup sources for the snoc bus
Need to register the device as a wakeup source and configure
the corect interrupt as a wakeup source for the snoc bus.

Change-Id: I2afcd69a8308183e141d7560a225a3b48d0e9f55
CRs-Fixed: 1051968
2016-08-13 14:49:04 -07:00
Yuanyuan Liu
fd594c2455 qcacmn: HIF: Use PLD APIs
PLD is a interface between CLD and CNSS/ICNSS. It hides
CNSS/ICNSS APIs from CLD and provides a set of common APIs.
CLD modules should use these PLD APIs instead of calling
CNSS/ICNSS platform APIs.
Replace all CNSS/ICNSS APIs with PLD APIs in HIF.

CRs-Fixed: 1010692
Change-Id: I4018a4b7e08179f9c65a19fde61727228e876762
2016-08-08 15:05:33 -07:00
Houston Hoffman
9538fefe71 qcacmn: Initialize ce ring base address high registers for adrastea
Because the register values were not defined in the target defs table,
The values were defaulting to 0 or missing. The code to write to these
registers checks if they exist before trying to write to them.  Without
these registers defined, the base addresses of the dma rings would be
truncated to 32 bits.

Change-Id: Iabb49df50c2452522b6da30154e4d7d7221e22ac
CRs-Fixed: 1049424
2016-08-03 18:12:58 -07:00
Houston Hoffman
faf8ab5983 qcacmn: Fix Q_TARGET_ACCESS in hif_fastpath_resume
Q_TARGET_ACCESS return value check was incorrect.
Fixed to match usage in the rest of the driver.

Change-Id: I73631536c9670edcb5014f3e850985dfc6fc4d16
CRs-Fixed: 1046067
2016-08-03 18:12:57 -07:00
Houston Hoffman
6296c3e8f0 qcacmn: Compilation fixes for AP135 platform
1. AP135 platform uses 3.4.104 kernel. Fixed API names for the kernel.
2. Implicit declaration function errors fixed.
3. Stack frame size exceed error fixed for hif_dump_ce_registers function.
4. BIG Endian #define fixed.

Change-Id: I761762f6e51c0890e672f76817a911ade7126dd5
Acked-by:  Venkateswara Swamy Bandaru <vbandaru@codeaurora.org>
CRs-Fixed: 1040617
2016-08-03 14:25:48 -07:00
Rajeev Kumar
5bac30f5e6 qcacmn: Add unit test framework to validate WLAN suspend/resume features
WLAN suspend/resume feature has tight dependency on APPS platform
suspend/resume support. On new targets APPS suspend/resume is not
supported until target is feature complete. In absence of APPS
suspend/resume support testing WLAN offload features become
difficult. Add unit test framework to test WLAN suspend/resume
features using private IOCTL command by simulating APPS
suspend/resume behaviour.

Trigger WLAN suspend:
iwpriv wlan0 wlan_suspend 0 0

To resume WLAN run a ping test from access point side and very 1st
ping request unicast packet should trigger wake up.

If FW is not waking up APPS then use below command to do a manual
wake up:

Trigger WLAN resume:
iwpriv wlan0 wlan_resume 0 0

This framework is only for SNOC platform.

Change-Id: I177a0047f460aa2a305a9e4e46fbfaa94a81dced
CRs-Fixed: 1042205
2016-08-03 01:07:49 -07:00
Hardik Kantilal Patel
343739296c qcacmn: Address 32 bit specific compilation issues
Fixing 32 bit compliation issues due to improper type
casting and shift operation.

CRs-Fixed: 1043823
Change-Id: I2c05a0c0940c5d65c40aefdc80dc2888fbe87be1
2016-07-25 00:41:12 -07:00
Govind Singh
051a8c4457 qcacmn: Remove duplicate definition from hif layer
FW common files needs to be in sync with host and fw.
There are duplicate definition of target attach API when
latest copy of fw common files are used.
Remove duplicate definition of target attach from hif layer.

Change-Id: Ie4a80ba07bc3ec2d9d1466c32062c373c9759a94
CRs-Fixed: 1012542
2016-07-08 06:12:14 -07:00
Himanshu Agarwal
2a92459208 qcacmn: Add NULL checks before dereferencing
Add NULL checks before dereferencing in:
1) HIF layer
2) WMI layer.

Change-Id: I47c5d18ae7841826d958d742283edb0bd6d246b7
CRs-Fixed: 1036390
2016-07-01 10:36:19 -07:00
Houston Hoffman
c2611a2c80 qcacmn: Remove references to cnss_pm_runtime_request
cnss_pm_runtime_request is deprecated.

Change-Id: I620065d8d0eae6a6830eeb003a29575c5352cb93
CRs-Fixed: 1035562
2016-07-01 05:41:23 -07:00
Houston Hoffman
4ede3494a7 qcacmn: Fix RUNTIME_PM wrt. runtime_pm_delay
Refer to runtime_pm_delay inside the config_info structure.
The member was moved inside a config_info structure to cleanup
hif_softc.

Change-Id: I45b54ef2323eb635bb110ece381d5c806a0a4627
CRs-Fixed: 1035562
2016-07-01 05:41:14 -07:00
Nirav Shah
b70bd731ec qcacmn: Add per CPU interrupt statistics
Add per CPU per copy engine interrupt statistics.

Change-Id: I1619f0db3314ae3d915284459f2b191f31fc2190
CRs-Fixed: 1017437
2016-06-30 03:11:34 -07:00
Aravind Narasimhan
e79befadca qcacmn: Fix for AR9887/AR9888 chips bringup
With the converged code swfit has issues in bringup.
Below changes are done to make it work.
1 Target type checks for AR9887/AR9888 corrected.
2 Added new reg write to wake the chip after enabling
  interrupts

Change-Id: Ib17d03cb4f0699d8d2270340b2c8a4002f0b31d0
CRs-Fixed: 1035003
2016-06-29 13:51:47 -07:00
Aravind Narasimhan
c7620c1fa8 qcacmn: Fix for performence issue on beeliner
For AP based chisets made host to taget HTT
ce descriptos to be allocated as 4098

Change-Id: I3f74aef9fc99e383481c1a8c3e7710761d9cf106
CRs-Fixed: 1035019
2016-06-29 13:51:46 -07:00
Houston Hoffman
004ec91c3d qcacmn: Populate target_type in target_info for snoc
The target type is queried through the target_info structure.

Change-Id: I0c4323f83098f607584f7a8d9b1929257172b5be
CRs-Fixed: 1025074
2016-06-24 16:48:20 -07:00
Aravind Narasimhan
a1c7d6dd1d qcacmn: Fix implicit declaration warnings
Implicit declarion warnings are errors in MCL builds.
WIN uses the AHB bus and warnings are not errors in WIN.
This change fixes the warnings associated with AHB bus

Change-Id: I6bd7dba4267c9dad77535b8cb28d15e230773fa5
CRs-Fixed: 1033493
2016-06-24 16:48:20 -07:00
Houston Hoffman
c50572b27a qcacmn: Reduce Shadow Register Logging
Change the log level to info. Remove repeated log messages.
Remove extra \n from many hif log prints

Change-Id: Ie3d254888f0a0d37e0bc0c81c6186cb172e882c8
CRs-Fixed: 1026520
2016-06-23 12:33:10 -07:00
Houston Hoffman
e8a9500c7d qcacmn: Use qtimer for descriptor history timestamp
Syncronizes the timestamps between firmware and host.

Change-Id: Ibcd1805a513d7f7bd249113dca4f8d7773f59f7f
CRs-Fixed: 1028192
2016-06-23 12:33:08 -07:00