Commit Graph

111 Commits

Author SHA1 Message Date
Jianmin Zhu
9030831d48 qcacld-3.0: Fix SSR failure on Rome
Peer and vdev leaked during SSR, Helium/Rome SSR is different.
Helium:
FW assert will indicate to CNSS driver, then PLD_FW_DOWN
is sent, in wlan_hdd_pld_uevent, target ready is cleared and
RECOVERING is set, so wma_force_objmgr_vdev_peer_cleanup can be
called, no such issue.
Rome:
FW assert will indicate to wlan driver directly, in
ol_target_failure, only RECOVERING is set, target ready isn't
cleared, wma_force_objmgr_vdev_peer_cleanup can't be called,
so peer and vdev leaked.

Change-Id: I6ecf6cc439f931d8da67972c543376b2148982af
CRs-Fixed: 2403501
2019-03-03 22:24:50 -08:00
Dustin Brown
963101199d qcacld-3.0: Remove OS_* usage
There are a few consumers of the legacy OS_* APIs. Directly use
appropriate QDF APIs instead.

Change-Id: Ibe46172200119c6d293acb301baf796276c5949c
CRs-Fixed: 2403793
2019-02-27 08:11:53 -08:00
Dustin Brown
cda29b5091 qcacld-3.0: Remove EOK from BMI
EOK is a legacy definition and frequently misused. Remove references to
it from BMI.

Change-Id: I38455eca00a6c1f3ffe25635019677708e312f92
CRs-Fixed: 2404901
2019-02-26 04:26:07 -08:00
hangtian
127c953c7f qcacld-3.0: Use qdf_mem_zero for zero initialization
Use qdf_mem_zero for zero initialization.

Change-Id: Ic2b8d907623cf67a4569aaf01398c1b3a2bff707
CRs-Fixed: 2376644
2019-01-14 08:38:03 -08:00
Jeff Johnson
489b4643a9 qcacld-3.0: Remove unnecessary includes from ol_if_athvar.h
The header file ol_if_athvar.h is strange in that it is a qcacld-3.0
file that is included by files in the qca-wifi-host-cmn project.  That
model does not conform to the software architecture so there is a plan
to correctly refactor the file. As a preliminary step remove all
include directives that are not actually required by the files that
include this header file.

Change-Id: Ifbb38adba434aa19fade4838e30d39884b6e4615
CRs-Fixed: 2366965
2018-12-17 13:12:01 -08:00
Jeff Johnson
31e7ecfb86 qcacld-3.0: Remove all definitions from ol_if_athvar.h
Currently ol_if_athvar.h defines the following:
- struct ol_version
- enum ol_ath_tx_ecodes
- struct ol_ath_stats

None of these are used, so remove them. This leaves behind just a set
of #include directives.

Change-Id: Ie8c2ee1fa1b3c34f37430633c28987651e60434b
CRs-Fixed: 2366964
2018-12-17 13:12:01 -08:00
Jeff Johnson
237951ba51 qcacld-3.0: Include qdf headers in i_bmi.h
Header file i_bmi.h utilizes several QDF data structures, but it does
not explicitly include the header files which define them. This must
mean that the data structures are being included as a side-effect of
including an unrelated header file.

In an upcoming change the header file ol_if_athvar.h is being
refactored, and that change somehow interferes with the side-effect
that causes the QDF header files to be included by i_bmi.h. So rather
than rely upon the side-effect, explicitly include the necessary
header files.

Change-Id: Icf7d7e4babb14faa41b2ac18c6181a206da9b858
CRs-Fixed: 2366963
2018-12-17 13:12:01 -08:00
Jeff Johnson
5c89b2c49b qcacld-3.0: Fix SNOC condition in i_bmi.h
In i_bmi.h the hif_reg_based_get_target_info() conditional
compilation references SNOC but this is not a macro defined
by the driver. Replace this with the correct macro, HIF_SNOC.

Change-Id: I52969426c58c078b3dd558e825e2a9fb68394536
CRs-Fixed: 2366958
2018-12-17 13:12:01 -08:00
Jeff Johnson
cb3e565d3d qcacld-3.0: Remove ol_get_fw_files() prototype
Change I2c217891d0ca4b503e7388b3ebe2f787e8325af5 ("qcacld-3.0: Add
firmware download support for sdio bus (Part 5 - HIF SDIO)") added a
prototype for ol_get_fw_files() but did not add an implementation.
Since nothing uses this prototype, remove it.

Change-Id: Ie3b9aee767e14acc425ca7c365d10cbb73682fb5
CRs-Fixed: 2366957
2018-12-14 22:49:35 -08:00
Jeff Johnson
e2e0e337eb qcacld-3.0: Remove ol_ctrl_addba_api.h
The definitions in file ol_ctrl_addba_api.h are unused, so remove the
file and remove the #include directive in the one place it appears.

Change-Id: I9056791b1a21dc8c8e113db2d49468e3abafab34
CRs-Fixed: 2364105
2018-12-11 10:18:26 -08:00
Yu Ouyang
58648a57f3 qcacld-3.0: fix wlan driver reload issue without CNSS module
Currently, driver without CNSS module can't be unloaded when firmware
crashed. Without CNSS module, driver should set recovery in progress
flag to false when fw dump finished or failed. Driver should add ramdump
memory address and length too.

Change-Id: I672c50bd90ada7ff47ddff64ff3b313a75faff13
CRs-Fixed: 2343124
2018-11-23 02:00:06 -08:00
jiad
4afa84fe51 qcacld-3.0: Abstract BMI CE callbacks
As part of WIN BMI modularization, hif_bmi_register_callbacks
are removed from if_pci.c in qcacmn project. As a result,
MCL needs to invoke hif_bmi_register_callbacks in qcacld project.

Fix is to call bus agnostic hif_register_bmi_callbacks method
in bmi_download_firmware.

Change-Id: I72febb02150cf9c672bea4949c53f1b87fa69cdf
CRs-Fixed: 2332266
2018-11-05 10:57:38 -08:00
Yu Wang
68baaddd7f qcacld-3.0: check the data length when downloading firmware
When downloading a corrupted firmware file that has chunk length in
header which doesn't match the contents, buffer over-read may occur.

To fix it, before downloading the data, ensure the length is equal or
smaller than the left size of the firmware file.

Change-Id: I4e0c6c4423f94f26a8c4573b5d234296890f4ecf
CRs-Fixed: 2314182
2018-09-18 01:02:55 -07:00
Srinivas Girigowda
09625b0222 qcacld-3.0: Fix embedded function name checkpatch warnings
Logging macros already print function name by default,
there is no need to print the function name again as part of the log.

Hence, remove the function name or
wherever required use '"%s...", __func__'

Change-Id: Ib6dc6cc03ef148146b1c626271d5ac3b7345c4bb
CRs-Fixed: 2312593
2018-09-12 11:58:26 -07:00
Lihua Liu
8944216d43 qcacld-3.0: Fix an OOB issue in bmi_sign_stream_start()
Remaining may be greater than its original value when
(remaining & 0x3)!=0, then OOB occurs when memcpy.To address
this, align the remaining after doing memcpy.

Change-Id: I3e39a791a76a272e82beb6561375e26ca84ec0f4
CRs-Fixed: 2259721
2018-08-17 04:40:05 -07:00
Qiwei Cai
a01a96291f qcacld-3.0: Featurize wlan BMI
Featurize wlan BMI to compile out when not needed.

Change-Id: I4ea1e34ee4299840cf7a601396c4dba7af415623
CRs-Fixed: 2258614
2018-07-12 12:34:43 -07:00
Ajit Pal Singh
44273d6464 qcacld-3.0: Call cnss_wlan_enable() for QCN7605 USB
Call cnss_wlan_enable() for QCN7605 USB.

Change-Id: I566e934ee43db0b95dad799cac6731695f62992e
CRs-Fixed: 2269602
2018-07-11 14:28:45 -07:00
Sriram Madhvapathi
b1a791c99a qcacld-3.0: Abstract SDIO block size
Do not tie up names with mailbox.
This results from SDIO HIF refactoring.
See qcacmn: I12bdf8b07350411093ba35071411525a8333cf93

Change-Id: I99184fbfc95a601f09dba5891098c35d5aa794c5
CRs-Fixed: 2252448
2018-06-25 04:55:52 -07:00
Jeff Johnson
9e80bab8d0 qcacld-3.0: bmi: Fix misspellings
Address the following issues in the core/bmi folder:
CHECK: 'Defintions' may be misspelled - perhaps 'Definitions'?
CHECK: 'initilization' may be misspelled - perhaps 'initialization'?

Change-Id: I649b42e30e10e51c2c734d909a8c9ab2811b9421
CRs-Fixed: 2241939
2018-05-16 18:01:27 -07:00
Jeff Johnson
3032101c48 qcacld-3.0: bmi: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: Ifce2b7d373a6a1233f091feb3f0e67578715ebeb
CRs-Fixed: 2229655
2018-04-24 14:48:51 -07:00
Yu Wang
2741c7afbf qcacld-3.0: disable mailbox swap for FTM mode
It shouldn't swap mailbox in FTM mode,
or WMI commands will be stuck.

Change-Id: I5d3760100f3c8e1d2c3bfbe88fd5a84deb0bc1ff
CRs-Fixed: 2208876
2018-04-23 00:30:24 -07:00
Nirav Shah
eb017befbd qcacld-3.0: Add support for QCA9379 on x86 platform
Add support for QCA9379 chip on x86 platform for
USB and SDIO attach.

Change-Id: I2de81794cd16521097ffa6956a18b4b0fe981d36
CRs-Fixed: 2196757
2018-02-28 05:29:39 -08:00
Zhang Qian
e0cb936d1f qcacld-3.0: Fix memory leak at BMI initializing
Free buffered file name when failed at BMI initializing.

CRs-Fixed: 2173026
Change-Id: I5fb1e9c76ba88711a0b0a6395a1ec7ae93ec4415
2018-01-24 19:44:52 -08:00
Ryan Hsu
6fdc60fcae qcacld-3.0: clean up the FTM legacy code
clean up the ftm legacy code

Change-Id: If56f46386108b04f8c1ec73804976c61019a6ffe
CRs-fixed: 2169366
2018-01-22 11:20:52 -08:00
Yuanyuan Liu
67abd8054f Revert "qcacld-3.0: Do not access target register in driver unloading"
This reverts Change-Id: I2a4980b6cd4b689da07c34f2acdfaafbbb0715bb.
This change set driver unload state before unload work is scheduled,
which causes async between platform driver and wlan host driver.

Change-Id: Ieaf1cf0a257f69bf8958085c48d9020f1b5ec610
CRs-Fixed: 2124953
2017-10-25 17:48:22 -07:00
Yun Park
5d42e11033 qcacld-3.0: Fix KW issue for unlock rx_hash_lock and initializing cap
Unlock variable 'pdev->rx_ring.rx_hash_lock.lock.spinlock' in htt_rx.c.
Initialize 'cap.cap_flag' in ol_fw.c.

Change-Id: I243647deb01cd2f9c7b3e07feeb321adf849608d
CRs-Fixed: 2098769
2017-10-13 12:12:41 -07:00
Kai Liu
1be510abee qcacld-3.0: skip notifying SSR framework when wlan unloading is ongoing
Fw assert and unloading can occur at same moment, there is no need
to recover if wlan unloading is ongoing, so skip notifying SSR framework
in such case.

Change-Id: I2176d1505e8e358f4436277e4d0b706923596f27
CRs-Fixed: 2087634
2017-10-12 14:03:13 -07:00
Yu Wang
66a250bbb5 qcacld-3.0: add ini config for PTP options
Add ini param 'gtsf_ptp_options' to control
PTP options, it's a bitmap:
bit0 - PTP_OPT_RX(0x1)
  set this bit to enable RX time stamping
bit1 - PTP_OPT_TX(0x2)
  set this bit to enable TX time stamping
bit2 - PTP_OPT_RAW(0x4)
  set this bit to use raw time as timestamp
bit3 - TSF_DBG_FS(0x8)
  set this bit to add device attriubte 'tsf' for iface

The default value of gtsf_ptp_options is 0xf

Propagated from qcacld-2.0.

Change-Id: Ie53d503bdd2e85790502583a238ee138f4bcf6c6
CRs-Fixed: 2079466
2017-10-12 13:57:17 -07:00
Zhang Qian
b17ee62d9b qcacld-3.0: Add auto BDF Selection
qcacld-2.0 to qcacld-3.0 propagation

The board data file is selected based on the board id returned
by executing otp binary.

Based on the chip id and the board id, select the appropriate
board data file and download.

The board data file selection is as follows:
Mission mode: bdwlan<chip_id>.b<board_id>
Factory mode: utfbd<chip_id>.b<board_id>

If the auto board data files are not present in the filesystem,
then download the default board data file i.e bdwlan<chip_id>.bin

Change-Id: I26c3eb377513d2c4439eddc4e5dc75eba66c78f4
CRs-Fixed: 805800
2017-09-29 01:39:53 -07:00
Will Huang
ebfd91b33f qcacld-3.0: Enable IRAM Dump
qcacld-2.0 to qcacld-3.0 propagation

Cleanup target dump code and add support to dump IRAM region
for different platforms. Update the Target Memory Region for
different platforms.

Change-Id: Ie29fb62e0f1bc279311f77400e8be490ccf987a4
CRs-Fixed: 2088394
2017-09-25 23:42:41 -07:00
Will Huang
2788dcf8f2 qcacld-3.0: Init cap before use it
In function ol_configure_target cap is used uninitialized when call
pld_get_platform_cap fail, although pld_get_bus_type and
hif_get_bus_type return same bus type, so actually it has no issue here,
but it look not clear here, init it explicitly.

Change-Id: I001956521c62c14b3537b399bbca1791b274a4c7
CRs-Fixed: 2115553
2017-09-25 03:22:03 -07:00
Jeff Johnson
16caea59fb qcacld-3.0: bmi: Replace instances of unadorned %p
Replace instances of unadorned %p in core/bmi.

Change-Id: I5dfdaa536da2c46d6180f74857e7518198bb43f7
CRs-Fixed: 2100997
2017-09-20 06:22:00 -07:00
Jeff Johnson
adb3b1cadf qcacld-3.0: Remove cds_[alloc|free]_context() parameter
Currently cds_alloc_context() & cds_free_context() take a CDS context
parameter. However CDS already maintains its own context, hence this
parameter introduces an unnecessary coupling, so remove it.

Change-Id: I4501a0fea7acc7b4a764b0d425da386922b93bcb
CRs-Fixed: 2109265
2017-09-13 20:07:39 -07:00
Chris Guo
9597ded3df qcacld-3.0: Enable tx_free_at_download feature for SDIO WLAN
When FW support SDIO_REDUCE_TX_COMPL_FW_ACK feature, WLAN host can
enable tx_free_at_download feature to increase efficiency further.

CRs-Fixed: 2078825
Change-Id: I542e51254ca5c0a6c51f7479e0cc1cdb12a077fa
2017-08-08 01:21:54 -07:00
jiad
b20627788b qcacld-3.0: enable pktlog support for HL project
qcacld-2.0 to qcacld-3.0 propagation

Currently for SDIO implementation, tx comp indication is
suppressed and tx_desc is freed when htt download is done.
This leads to invalid tx_desc being referenced when pktlog
indication handler wants to collect TX-ed tx_desc information.

Fix consists of two parts:
1. When pktlog is enabled in ini, enable tx comp indication
handler just like PCIe and USB. tx_desc is still valid when
pktlog indication comes.

2. Check vdev pointer embedded in tx_desc structure. vdev
pointer is set when tx_desc is allocated and set to NULL when
tx_desc is freed. This guards against invalid tx_desc_id
from firmware.

Note that performance drops should be expected when
pktlog is enabled on HL platforms.

Change-Id: Iba9b8323b4a6e2ae17e36768bda3511f52236a2c
CRs-Fixed: 2034996
2017-08-07 20:24:18 -07:00
Liangwei Dong
95d6c373bb qcacld-3.0: skip FW dump for SDIO SSR
Skip FW memory dump in SSR case for HL SDIO solution.
HL SDIO uses the diag read API to read by 4 bytes,
which is too slow to meet SSR time requirement.

Change-Id: Iacde90ab0ec84f29f3744bf4497ec8fd8517600a
CRs-Fixed: 2071329
2017-07-27 16:59:09 -07:00
Yu Wang
ceb357b964 qcacld-3.0: time stamp msdu with precise rx/tx time
Get tx/rx tsf time for each msdu, and then
time stamp the msdu with the corresponding
host time.

Change-Id: I7af80318b60c28d53e95fbe545e82da4191544b6
CRs-Fixed: 2057693
2017-07-12 15:21:47 +08:00
wadesong
42968e93c3 qcacld-3.0: Fix build errors generated by gcc 6
Gcc 6 introduces some stricter checking for indentation,
causing warnings of misleading-indentation, which are
treated as build errors when drivers are compiled.

Fix all the identation warnings under qcacld-3.0.

Change-Id: Ie197761cfe4334ab14d593adebc56375372ba37c
CRs-Fixed: 2058158
2017-07-05 22:12:11 -07:00
Hanumanth Reddy Pothula
2a8a740a4d qcacld-3.0: Add support for SSR within SSR
Add below changes to support SSR within SSR,
1.Add new driver state, CDS_DRIVER_STATE_BAD, which will be set
  on re-init failure and reset on re-init success and if this
  state is set, don't allow any north-bound calls.
2.Don't de-register wiphy/netdev on re-init failure.
3.BUG_ON if re-init or probe fails successively for two times.
4.During driver unload, don't wait for SSR to be completed.

Change-Id: Id05a3e4b592664c9b56c7dd83b965b973f1d5ca5
CRs-Fixed: 2037628
2017-07-03 19:54:20 -07:00
bings
75be2d0a45 qcacld-3.0: Fix crash caused by sdio ramdump allocation
For TF sdio chip with platform driver, ramdump is
configured in platform driver. Driver can get the
virtual memory, but it can't call ioremap again.

If there is a platform driver, ramdump should be
allocated in platform driver, and if there is no
platform driver, ramdump should be allocated in
driver.

CRs-Fixed: 2066529
Change-Id: Ia2a32a4895f354e365522a30bbfac949ccb7a391
2017-06-27 01:40:21 -07:00
Sravan Kumar Kairam
76ab2662f5 qcacld-3.0: Free allocated memory before return
Currently in function ol_copy_ramdump dynamically allocated memory
is not freed before return in error condition. In this change free
memory before return.

Change-Id: Ie75d69a1716c3598e0123064a6ee522076748f7d
CRs-Fixed: 2044460
2017-06-23 02:12:34 -07:00
Yu Wang
c407bf733a qcacld-3.0: enable FW dump for SDIO
When FW assert happen, it won't do FW dump
if the bus type is SDIO.

Enable FW dump for SDIO target

Change-Id: I24655ca74003c915d9eda1106aad7cf87856947e
CRs-Fixed: 2010613
2017-06-09 15:36:37 -07:00
Manikandan Mohan
fe6a70adeb qcacld-3.0: Update for check patch refactoring
HIF files are updated for check patch warnings. Thus update
dependent files.

Change-Id: Ia8ee33e8ee3a43a15ff48cc7effb67c30336f099
CRs-fixed: 2030824
2017-05-02 13:29:40 -07:00
Yue Ma
45a05d5d95 qcacld-3.0: Fix kernel check patch errors and warnings for BMI
Fix msm-4.9 kernel check patch errors and warnings for BMI module.

Change-Id: I2eb1f179ca2a1ae9ceac7b314d252bd410d9eef9
CRs-fixed: 2034077
2017-04-19 17:44:16 -07:00
Zhang Qian
b3326c61fe qcacld-3.0: Fix resource leak in __ol_transfer_bin_file
qcacld-2.0 to qcacld-3.0 propagation

If data was NULL in fw_entry, fw_entry should be released before return.
Otherwise there will be resource leakage.

Change-Id: I0a72f6bd74f349baf1028aed1f9988b188cda1b6
CRs-fixed: 1111115
2017-04-16 21:16:55 -07:00
bings
6028ee8b41 qcacld-3.0: Do not access target register in driver unloading
qcacld-2.0 to qcacld-3.0 propagation

Crash happens when driver continues to access target register in
ol_target_failure when driver is unloading.

If rmmod happens firstly, do nothing in ol_target_failure in ssr.
If ssr happens firstly, wait for ssr finish in rmmod.

Change-Id: I2a4980b6cd4b689da07c34f2acdfaafbbb0715bb
CRs-Fixed: 2025585
2017-04-11 04:16:41 -07:00
Kai Liu
a27ce62df5 qcacld-3.0: override default uart tx pin to aviod conflict with sdio pin
In sdio interface chip, both sdio_data2 and uart_tx pin will use GPIO6.
It is set by fw rom code, which will cause sdio CRC error  when there is
sdio transaction. Override uart tx pin to avoid side effect to sdio pin.

Change-Id: Icd268e607c51238dcea7e8e3a55dceb96d5b1c1a
CRs-Fixed: 2019742
2017-04-09 20:16:40 -07:00
Tushnim Bhattacharyya
12b4874f33 qcacld-3.0: Replace policy manager header file included in data path
Replace policy manager header file include as part of policy manager
moving to host common.

Change-Id: Ie1f9d6675cc373c3325c9e76514f48299932cdda
CRs-Fixed: 2009818
2017-03-30 16:26:36 -07:00
Yu Wang
95ed98e08d qcacld-3.0: add support for QCA9377_REV1_1
Add processing for QCA9377_REV1_1_VERSION

Change-Id: I0d91e2b903b60370e9d8395917539cb491a272e3
CRs-Fixed: 2004328
2017-02-14 16:28:16 -08:00
Yuanyuan Liu
7a97b8f838 qcacld-3.0: Add support for setting fw log mode for msm8998
Add support for setting fw log mode for msm8998. Change the log mode
from bool type to tristate to support multiple log modes.

CRs-Fixed: 1115611
Change-Id: I6aef023d1e3cb1b68f1520f800af094f6f6decdb
2017-02-02 12:43:36 -08:00