Commit Graph

129 Commits

Author SHA1 Message Date
Jeff Johnson
11c49ff34a qcacld-3.0: core: bmi: Fix misspellings
Fix misspellings in core/bmi/...

Change-Id: Ib4ea1c1067547ded1db163d60676fcca7ea30661
CRs-Fixed: 3303630
2022-10-11 22:21:24 -07:00
Yu Ouyang
cc2bf81627 qcacld-3.0: Use PM wakelock to protect firmware downloading
To protect firmware not downloaded in system suspend, acquire/release
the cnss semaphore cnss_pm_sem. It is complex, and cnss function
cnss_pm_notify may trigger dead lock issue once PM_POST_SUSPEND is
ahead of PM_SUSPEND_PREPARE.

Optimize code to use PM wakelock API to protect firmware downloading.

Change-Id: I533c373b85f554fbcceb562d9f56c6b88e5155bb
CRs-Fixed: 3280247
2022-09-19 23:36:45 -07:00
Jeff Johnson
e614f829b5 qcacld-3.0: Fix misspellings of "operation"
Fix misspellings:
Opeartion ==> Operation
opperation ==> operation
opration ==> operation

Change-Id: I57b4e2dea3fc989d4005237a6bcffeac0e693ffa
CRs-Fixed: 3275690
2022-09-06 20:33:43 -07:00
Jeff Johnson
9738fc6bbf qcacld-3.0: Fix misspelling "formated"
Fix misspelling: formated ==> formatted

Change-Id: Idf32e65f0761671b986b6686d243fea9304099d9
CRs-Fixed: 3275687
2022-09-06 18:57:02 -07:00
David Oladunjoye
678d1dcf9c qcacld-3.0: bmi: Replace fallthrough comment with attribute
-Wimplicit-fallthrough is being enabled by default. Some compilers
such as clang require the attribute instead of just a fallthrough comment.

Change-Id: I220132ef01f4bf300bbd1f54e5f9dc5208787603
CRs-Fixed: 3217416
2022-06-24 20:05:56 -07:00
Nakul Kachhwaha
aabf3d74ff qcacld-3.0: Fix Switch Case fallthrough compiler error
Adding fallthrough statement in switch case to
suppress compile time errors.

Change-Id: I948e87090dd68d2f5cf342e2115d672d2d772b6f
CRs-Fixed: 3079848
2021-11-24 01:14:18 -08:00
Zhaoyang Liu
6f4f7adc22 qcacld-3.0: Keep recovery in progress flag for ssr without pld support
For platform without pld support, SSR would do rmmod operation, which tries
to do suspend target, there is no ACK from crashed firmware during SSR.
Keep the recovery in progress flag to skip suspend target command.

Change-Id: Ic6b8f4ebacbf9dc5798730b253eae239fe30c159
CRs-Fixed: 3005884
2021-08-03 19:54:31 -07:00
Min Liu
e75553536a qcacld-3.0: Wait for ram dump completed when FW assert
From ROME, when FW assert, need to wait for ram dump via PCIe completed
before calling QDF_BUG.

Change-Id: I3d76f34c5eacccae07ed485b679a4177be12b15e
CRs-Fixed: 2818715
2020-11-19 18:23:08 -08:00
Srinivas Girigowda
c11a4d35e3 qcacld-3.0: bmi: Remove logs for cds_get_context() checks
cds_get_context() function already takes care of logging the
caller function name in case of any error.
Hence there is no need to add the error log again.
Getting rid of these unnecessary logs reduces driver memory footprint.

CRs-Fixed: 2816598
Change-Id: I16fc2a3cdf675d35fb297ec62f4d3f5fb2cd4dd3
2020-11-12 13:53:22 -08:00
Srinivas Girigowda
eab3348cb2 qcacld-3.0: dp: Remove logs for qdf_mem_malloc() checks
qdf_mem_malloc() function already takes care of logging the
caller function name and line number in case of any allocation error.
Hence there is no need to add the error log again.

Getting rid of these unnecessary logs reduces driver memory footprint.

Change-Id: If24f25fb61bda6f9cd18ec45c5ded2eb53748736
CRs-Fixed: 2781932
2020-09-25 12:59:55 -07:00
Mohammed Siddiq
335ba9e938 qcacld-3.0: Add code to support modularizing ICNSS ICNSS2 and CNSS2
Add code to support modularizing ICNSS, ICNSS2 and CNSS2.

Change-Id: I696715592f6000f2a64f8940f324b699acd5fcf1
CRs-fixed: 2685412
2020-06-29 07:38:04 -07:00
Baowei Liu
78aa7bdfc1 qcacld-3.0: Skip recovering check if host assert target
In cds_trigger_recovery_handler, Host driver first set flag recovering
before cds_force_assert_target. For Rome, ol_target_failure run when
FW crash, Self-Recovery stop when detect flag recoverying be set

Add CDS_DRIVER_STATE_ASSERTING_TARGET to record Host asserting in
cds_force_assert_target. Skip recovering check in ol_target_failure
if detect this flag.

Change-Id: I290e2f21bd0bca6dc6d76de43de4f8dd801d7ff5
2020-05-28 21:07:32 -07:00
Jianmin Zhu
da8f2bf948 qcacld-3.0: Fix watchdog when dump Roame FW after panic
When kernel panic, irq will be disabled, when dump Rome
firmware, dma buffer is malloced and freed every time
hif_diag_read_mem is called to dump 20K mem, dma_free_attrs is
called 100 times for 2M mem dump, WARN_ON(irqs_disabled())
will printk stack about 100 times in short time, watchdog bite.

Fix: Change dma mem malloc size from 20KB to 256KB, then only
malloc/free less than 10 times totally when dump Rome firmware.

Change-Id: I803b2cd30a1c6cdc1ce8f8f1073cdb6c17b650af
CRs-Fixed: 2693690
2020-05-26 19:35:22 -07:00
Tiger Yu
80fbbe1347 qcacld-3.0: Add synchronization between unloading & SSR recovering
There is no sync between driver unloading & SSR recovering.
If SSR is in progress, need to wait when driver unloading.

Change-Id: I81b935f9d8d6336b68abd6aecbdc7d28f4762be9
CRs-Fixed: 2534890
2019-10-19 19:25:31 -07:00
Lin Bai
8862bf7d81 Revert "qcacld-3.0: request firmware without userhelper"
This reverts change-id Ie40db69a24dc1e0b86f140ca1aad91bd3b10e95e.

The reverted changes was causing regression, that optional
firmware not loadable even it exists.

Change-Id: I02a45e9be635e4ce0787f0a24480e42129c59874
CRs-Fixed: 2516015
2019-08-29 07:45:45 -07:00
Yu Ouyang
486fac8fed qcacld-3.0: Send user space about FW CRASHED indication
In function ol_target_failure(), if enable_self_recovery is true,
fw_indication_work_handler() will be called. Ramdump collection
will not be executed. But for no CNSS module platform, recovery flag
is neither cleaned, no any FW indication is sent to user space.
Even enable_self_recovery is false, no FW crashed indication sent
to user space.

So, call function ol_check_clean_recovery_flag() to clean recovery
flag, and send FW CRASHED indication to user space by function
ol_target_failure().

Change-Id: I44396caf4972dc267d60757c479e4681f8885de5
CRs-Fixed: 2482596
2019-07-05 23:07:30 -07:00
Guisen Yang
77814d8f02 qcacld-3.0: request firmware without userhelper
The request_firmware() will take too long time(60s) when the
requested fw file do not exist. Replace this API with
request_firmware_direct.

Change-Id: Ie40db69a24dc1e0b86f140ca1aad91bd3b10e95e
CRs-Fixed: 2435125
2019-05-28 05:18:52 -07:00
Jeff Johnson
e85a8f7083 qcacld-3.0: bmi: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within bmi replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: I85578cf7e40e7d6c81246b423d5b626a9570c8b4
CRs-Fixed: 2418396
2019-03-19 22:54:28 -07:00
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