Commit Graph

938 次程式碼提交

作者 SHA1 備註 提交日期
Jeff Johnson
4c5b6e76fe qcacmn: Properly abstract the Linux bottom half interfaces
When migrating to Linux Kernel v5.19 the following compilation error
was encountered:

i_qdf_defer.h:192:19: error: cast from 'qdf_defer_fn_t' (aka 'void (*)(void *)') to '__qdf_bh_fn_t' (aka 'void (*)(unsigned long)') converts to incompatible function type [-Werror,-Wcast-function-type]
        tasklet_init(bh, (__qdf_bh_fn_t) func, (unsigned long)arg);

This revealed the fact that the QDF bottom half abstraction was not
cleanly implemented. The current implementation freely typecasts the
abstracted signature:
	void (*func)(void *arg)
with the Linux-specific signature:
	void (*func)(unsigned long arg)

This has worked in the past since a void * and and unsigned long are
the same size and hence could be freely converted from one to another.
However the Linux Kernel now supports Call Flow Integrity which
requires that the function signatures must always exactly match.

To address this issue rewrite the bottom half abstraction to use an
intermediate dispatching function, exactly like is already done for
the deferred work abstraction.

Change-Id: I56b5a8ab9515033d8237302300fd6b55ea755633
CRs-Fixed: 3305515
2022-10-06 16:53:10 -07:00
Jeff Johnson
a5d454cfef qcacmn: Remove qdf_exit_thread()
While migrating from v5.15 to v5.19 of the Linux Kernel, a build error
was observed:

ERROR: modpost: "do_exit" [...] undefined!

The reason do_exit is undefined is because Linux Kernel commit
eb55e716ac1a ("exit: Stop exporting do_exit") removed the
EXPORT_SYMBOL() with the justification "there are no more modular uses
of do_exit".

Commit eb55e716ac1a was preceded by commit 111e70490d2a
("exit/kthread: Have kernel threads return instead of calling
do_exit") which details why, since commit 63706172f332 ("kthreads:
rework kthread_stop()"), it is unnecessary to call do_exit().

Note that commit 63706172f332 was introduced in 2009 in v2.6.31-rc1.
Since we do not need to support any kernels before that time, we can
follow the same advice and return instead of calling do_exit().

Currently do_exit() is only called from qdf_exit_thread(). As a result
of the preceding investigation, all former callers of qdf_exit_thread()
have been modified to no longer call it.  Since it is obsolete, remove
it.

Change-Id: I22f27692fa8766df080630b9b0640c259285557c
CRs-Fixed: 3300460
2022-10-06 11:15:50 -07:00
Rajesh Chauhan
fcd8ef9da8 qcacmn: use netif_rx() instead of netif_rx_ni()
In kernel 5.18, netif_rx_ni() is removed. So redefine netif_rx_ni
with netif_rx.

Change-Id: Ia0e43089f028f3bfa71d658d1e64ddeafd32d289
CRs-Fixed: 3298369
2022-10-06 11:15:38 -07:00
Rajesh Chauhan
38b4da1cc9 qcacmn: add a new macro __qdf_alloc_size
In kernel 5.16, __alloc_size is defined in linux/compiler_types.h
file. So instead of calling this macro, define and use new macro
__qdf_alloc_size.

Change-Id: Ie1930bf2aaf0cb6bc079bc66aba9eeba92ec8c12
CRs-Fixed: 3295139
2022-10-05 19:33:35 -07:00
Rajesh Chauhan
e895717ffb qcacmn: add a new function to update net_device->dev_addr
In kernel 5.17, net_device->dev_addr is changed to const unsigned char*
and can only be updated via dev_addr_mod(). Add a new function
qdf_net_update_net_device_dev_addr() to call kernel API dev_addr_mod().

Change-Id: Ifecfb453f5dc6b066892c04f4bdbec3759e32c53
CRs-Fixed: 3298120
2022-10-05 17:51:44 -07:00
Rajesh Chauhan
f4b6b093c6 qcacmn: include stdarg header file with correct path
For kernel version 5.15 or later, include linux/stdarg.h in
i_qdf_types.h and for older versions include stdarg.h.
Also remove inclusion of stdarg.h from dp_internal.h,
qdf_trace.h and qdf_types.h files.

Change-Id: I2eaa1af06fda0ac07a1be3d245f197de0b85719d
CRs-Fixed: 3295172
2022-10-05 17:51:31 -07:00
Azmath Mohammed
6f54fca3a9 qcacmn: Implement qdf support for skb shared info
Implement qdf support for skb shared info and frag list append.
qdf macros will be used to handle skb shared info and list append.

Change-Id: I3e91bfb7a09f2e4547b3210a10919d6c84ec6567
CRs-Fixed: 3243932
2022-09-28 22:31:52 -07:00
Jithender Miryala
eea229eb7d qcacmn: Create NOL and CAC HRtimer in softIRQ context by using hrt_mode
The NOL and CAC timeout callback function is divided into two parts:
HardIRQ and workqueue. If NOL/CAC expires, the callback function runs in a
HardIRQ context and the rest of the task runs in a workqueue to avoid
deadlock issues.

Issue: Workqueue tasks run in a low-level context. The task's execution
might have been delayed.

To fix this, run the "NOL" and "CAC" timer in softirq context.
Use QDF_CONTEXT_TASKLET instead of QDF_CONTEXT_HARDWARE as a argument in
qdf_hrtimer_init. If it is a "QDF_CONTEXT_TASKLET," the HR timer
initialises with softIRQ mode(HRTIMER_MODE_SOFT) and runs in softRQ
context when timer expires.

Change-Id: I9e23a9dff1a9c4669bb85342b3ffd91bc46ebe95
CRs-Fixed: 3239417
2022-09-27 08:43:36 -07:00
Jia Ding
1f49ac1d70 qcacmn: Fix qdf abstraction for IPA rx_bank_id
rx_bank_id defined in IPA driver is a write parameter for WLAN.
Therefore abstract the QDF macro in a set way, where bank id
obtained from wlan driver is passed as an input parameter to
the macro and rx_bank_id field is then being set within the macro
itself.

Without the fix, setting the bank id to IPA driver is like
MACRO_FOO(foo) = val. On build targets with kernel version < 5.15.41,
this can lead to unexpected build error.

Change-Id: I727b8af0ad7bd076e7756b51682842e947eb0a36
CRs-Fixed: 3291711
2022-09-21 21:38:43 -07:00
Jia Ding
a560466b61 qcacmn: Add qdf abstraction for IPA rx_bank_id field
rx_bank_id is newly added in IPA driver to represent bank id
field in TX descriptor for BE chipsets. Therefore add same qdf
definitions for DP layer to pass the bank id to IPA driver.

Change-Id: I7efe7ec6917eab131e2b441a502cdb25e682a88a
CRs-Fixed: 3291711
2022-09-18 03:14:52 -07:00
Tiger Yu
5bdbb2c2ab qcacmn: Add return value for qdf trace rate limited func
Add return value for qdf trace rate limited function to give
the caller a chance to know whether the current logging message
is bypassed or not. This allows the caller to skip additional
logging when logs are being rate limited.

Here is the value for this return:
false: log is not limited, output is normal.
true:  log is limted, will not be output in the log.

Change-Id: Ia5ae0e5676072142c3daf9b64a9bcf609692abf2
CRs-Fixed: 3284268
2022-09-13 03:24:56 -07:00
Devender Kumar
736edd06a2 qcacmn: Definitions to support SMMU debug framework
To support SMMU debug framework, add new definitions
and add logic to track the mapping and unmapping of
a buffer via nbuf tracker.

CRs-Fixed: 3255423
Change-Id: I0b9e2828e6cd5e3204b6bba57af8806c4d080b32
2022-09-13 03:24:41 -07:00
Ripan Deuri
c0e0b4f1e1 qcacmn: Add QDF API to get skb timestamp in microsecond
Add QDF API to get skb timestamp in microsecond.

Change-Id: I14019e5e60599c1499285b92b8727e8d6a9bf782
CRs-Fixed: 3286751
2022-09-12 08:15:11 -07:00
vijaraj
8b843ae157 qcacmn: Enable EAPOL logging for FILS Authentication
In api __qdf_nbuf_data_get_eapol_subtype(), the EAPOL key_info
is evaluated only for SAE authentication, which result in EAPOL
logging failure for FILS authentication.

Check ACK and Secure bit in EAPOL key_info to determine
EAPOL packet irrespective of authentication protocol.

Change-Id: Ieef143d36d85cbf473b682810d658de93dbbdad2
CRs-Fixed: 3268362
2022-09-12 08:15:04 -07:00
abhinav kumar
2888b71da7 qcacmn: Save jiffies value for QDF timer
Save the jiffies value in a per-timer context
in qdf_mc_timer_t while processing qdf_mc_timer_start
and scheduler_mc_timer_callback. It will help the
debugger to know the exact time gap between the
start and stop/expiry of the QDF timer.

Change-Id: Ia79011971184de9390632253417ee35dc7d26cf8
CRs-Fixed: 3283746
2022-09-10 10:42:23 -07:00
Amir Patel
49555350f2 qcacmn: Optimize ppdu_info memory
a. Optimize mon_rx_status and mon_rx_user_status objects memory
b. Add QDF API to remove last element in nbuf queue

Change-Id: I53328aae4d2861e0d2972556f61c8556be5e601c
CRs-Fixed: 3278895
2022-09-06 10:23:36 -07:00
Amir Patel
8983dd04f8 qcacmn: Add QDF Kmem cache support
Introduce QDF abstraction APIs for handling kmem cache
create/destroy/alloc/free

Change-Id: I46fa8e5e3891a3665fb230b737ef66ff65b5135e
CRs-Fixed: 3274919
2022-09-06 08:59:43 -07:00
Shivam Kumar
79b46e688f qcacmn: Add the missing module id and names to the array
Add the missing module id and names to g_qdf_category_name array,
and missing module trace default level to module_trace_default_level.
By using the command ‘Cfg80211tool ath0 g_qdf_cv_lvl ‘ It displays all
the Module id names

CRs-Fixed: 3273947
Change-Id: Ia4b2b49aae6fa5eaba667f26498708e500a231c7
2022-09-05 02:40:20 -07:00
Sreeramya Soratkal
17794aa9d6 qcacmn: Remove unused variables in qdf memory component
Remove unused local variables in the qdf memory component
to address the compiler warnings.

CRs-Fixed: 3272720
Change-Id: I9b784a43897003f374239ed2f27e0bb8e0ce4c93
2022-08-26 09:10:39 -07:00
Sreeramya Soratkal
351edebeae qcacmn: Resolve difference in pointer signedness
The control buffer element of socket buffer structure (sk_buff)
is of the data type char and the virtual address element of network
buffer control block structure is of the type unsigned char. The
current prototypes cause this pointer assignment with different
signedness.
Fix this by using appropriate type in the API definition.

Change-Id: Ic20ca29ce5d26a134ef295663632a5b7fd420954
CRs-Fixed: 3269690
2022-08-26 09:10:19 -07:00
Yu Wang
aec06bc9b7 qcacmn: register va based minidump entry with module name
Current code registers va-md entry with static name
'qdf_va_md' when loading wlan driver, with no unregister
upon failure or driver unloading, this has a problem when
multiple wlan drivers are present, in which case it will
try to load all one by one during system bootup, but only
one driver will be loaded successfully at last. The
notifier_block for the unexpected wlan drivers will be left
in the notifier chain, which will result in kernel panic
when collecting minidump.

We can improve this by registering va-md entry with module
name, and unregistering the entry during de-init with the
newly added API qcom_va_md_unregister(), then different
wlan driver will register va-md entry with different module
name, and the entry will be unregistered on loading failure
or unloading, then there will be no stale notifier_block.

Change-Id: Ic08136f3f2ce1c202cab1ee68d8d376f2bd2fa57
CRs-Fixed: 3265807
2022-08-25 17:40:58 -07:00
Yu Wang
c520d7fe83 qcacmn: fix GFP flag for memory allocation
As per implementation of might_sleep(), rcu_read_lock()
nesting depth should be taken into consideration too to
figure out whether sleeping is allowable or not.
To make align with it, allocate memory with GFP_ATOMIC
if rcu_read_lock() nesting depth is not zero.

Change-Id: I83c042827db4024cedf4f043a4243e399a33f6e5
CRs-Fixed: 3272683
2022-08-22 23:05:10 -07:00
Karthik Kantamneni
322be7253c qcacmn: Implement static inline API's for net dev stats handling
Currently net dev stats are handled using QDF MACROS which is not
ideal approach. So implement OS agnostic inline API's for
handling net dev stats.

Change-Id: Ib8ee368d6575ba6628df473fda057c254fc5bab4
CRs-Fixed: 3189332
2022-08-18 00:49:16 -07:00
Yu Wang
3f49761156 qcacmn: add module ID for CoAP
Add a new module ID QDF_MODULE_ID_COAP for
CoAP(Constrained Application Protocol).

Change-Id: I4420f741984dfa81677717a6bbb337a0f0b3051b
CRs-Fixed: 3254124
2022-08-17 19:58:05 -07:00
nakul kachhwaha
ef9ad9d2d2 qcacmn: Add qdf APIs to set/get IPv4/6 TOS and TC field
Add QDF APIs to set/get IPv4/6 TOS and TC field.

Change-Id: Ie048b74bacea33e9b1c57c5561064673247ee14c
CRs-Fixed: 3207377
2022-08-16 07:40:35 -07:00
Pavankumar Nandeshwar
d9709af89a qcacmn: Add API to clean up tx desc pool
Add an API to clean up tx dec pool in case of
umac reset.

Change-Id: I99fe11bcd07471f5aafefbeae10a9d4683cc5c5c
CRs-Fixed: 3266252
2022-08-13 02:59:35 -07:00
Yeshwanth Sriram Guntuka
b4ff9ea317 qcacmn: Add functionality for rtpm prevent suspend sync
Add provision to call sync prevent suspend which will wait for
system to resume and increment usage_count before returning.

Change-Id: I855e3fc2660dc7f3f78bb70f8eef6228cbef96d3
CRs-Fixed: 3253335
2022-08-08 05:47:18 -07:00
Author Amrit Sahai
dc5cc15bba qcacmn: Check ICMPV4 and ICMV6 are redirect or not
Add API to check ICMPV4 and ICMPV6 are redirect or not
This is to avoid a security breach.

Change-Id: I61e7c54c6d9279c1e7d2f316381fbc1c83ce5b4a
CRs-Fixed: 3233925
2022-08-08 00:16:44 -07:00
Shiva Krishna Pittala
8641a158f3 qcacmn: Hook the UMAC reset in the target attach path
Call UMAC reset initialization API from soc_attach_target().
FW exposes a service bit for this feature, use that to conditionally
enable this feature. Also, add default log levels for this feature.

CRs-Fixed: 3253464
Change-Id: Ia7c9cf07a7ab7b000ebe452ab074a82173b70129
2022-08-03 07:35:26 -07:00
nobelj
7d3197b9a5 qcacmn: tx monitor populate stats information
add tx monitor stats information.

Change-Id: Iffc55c2a4fa5351140daeffac3a50dd6867f6ea1
CRs-Fixed: 3230286
2022-08-02 03:23:01 -07:00
Jinwei Chen
64d7493b30 qcacmn: add RX statistics per lmac for MLO connection
Add RX statistics per lmac for MLO connection.

Change-Id: I72b942732cc362c1613fae637bc5e1154f9e2ec2
CRs-Fixed: 3251609
2022-07-29 22:57:35 -07:00
Bing Sun
d0385d035d qcacmn: Fix CFI failure caused by dfs_remove_from_nol
The parameter of callback of kernel struct hrtimer is itself, not
qdf_hrtimer_data_t. CFI failure happens if the function pointers
does not have the same type as the function that's called.
Add a new API __qdf_hrtimer_cb and assign it to hrtimer->function.

Change-Id: I9cf753272dd37635e82defac6cf7258c7a70425d
CRs-Fixed: 3245385
2022-07-27 07:22:54 -07:00
Yu Wang
56ebf2707b qcacmn: add support for VA based minidump
Before GKI enforcement and driver modulization, vendor drivers’
data section was part of vmlinux and they were registered with
minidump and collected when crash happens.
With GKI, vendor modules’ data section is part of va-malloc
region, which is virtually contiguous but physically not. It
is difficult to fit into the existing PA based minidump framework.
New VA-minidump driver allocates some CMA region which is registered
as one entry in minidump infrastructure. During panic, the driver
creates an ELF which is based on VA, copies it into that CMA region,
and finally it gets dumped as md_KVA_DUMP.bin.
This change makes use of this VA-minidump framework and implement
the APIs accordingly.

Change-Id: Ib1282990c91408bcd4e68365afe694830b90d0ac
CRs-Fixed: 3232060
2022-07-26 01:48:03 -07:00
Himanshu Batra
a2f709fa4f qcacmn: Change macro IPA_WDI3_RX_TWO_PIPES to IPA_WDI3_VLAN_SUPPORT
Change macro IPA_WDI3_RX_TWO_PIPES to IPA_WDI3_VLAN_SUPPORT to represent
the feature supported under this macro

Change-Id: Ie1e387d641052cd5690c63f0c1216f4852544605
CRs-Fixed: 3250264
2022-07-25 05:13:47 -07:00
Harsh Kumar Bijlani
81d963fc50 qcacmn: Remove SCS database from dp_peer structure
Set function pointer for SCS peer lookup and rule handler.

Add a new module id for SCS.

SCS database maintained in dp_peer structure is redundant as
same info is maintained in control peer. Therefore remove
SCS database from dp_peer structure and also remove APIs
which access/update this database.

Change-Id: I951f12de487a4be3ae169d1e309352e4e5031fc9
CRs-Fixed: 3226693
2022-07-16 09:10:04 -07:00
Amir Patel
09ae481644 qcacmn: Use page_frag_cache to avoid fragmentation
Use page_frag_cache to avoid memory fragmentation
in WKK RxMON

CRs-Fixed: 3234833
Change-Id: I2e42a41999694a91b0f3f9386a1ad0c691bf5caf
2022-07-15 05:01:37 -07:00
Devender Kumar
bf35825b9f qcacmn: AST entry definition for IPA
To support the EasyMesh feature WDS need to be enable and
same status need to be given to IPA driver for that add
new AST definition and declaration.

CRs-Fixed: 3226348
Change-Id: Id2c38b55310f6f0ef9e3d42d606feca16c7d9d78
2022-07-10 23:40:36 -07:00
VIJAY RAJ
b3113d5540 qcacmn: TX status conversion for Datapath frame during diag logging
Wrong value of tx status sent to supplicant for Datapath frame
via diag logging.

Convert the tx status value to enum diag_tx_status specific value.

Change-Id: I3bcf47ed5265d82fb64f1499f79e89be52d23a3e
CRs-Fixed: 3236391
2022-07-10 05:07:40 -07:00
Himanshu Batra
53eac0def3 qcacmn: QDF changes to support vlan traffic in IPA offload
QDF changes to support vlan traffic in IPA offload

Change-Id: I41e1511284f16ac2afa91115bd953b0055a31d47
CRs-Fixed: 3229809
2022-07-07 23:29:44 -07:00
Jia Ding
47aa8f94e0 qcacmn: Properly get iommu domain attributes
Beginning with kernel version 5.13, enum iommu_attr structure and
iommu_domain_get_attr() API are obsolete. Thus properly wrap
__qdf_iommu_domain_get_attr() API with new QCOM iommu util API.

Change-Id: I1f4d67f64985c599a72bad9853caf2cf18b9bcd1
CRs-Fixed: 3228740
2022-07-07 12:40:14 -07:00
VIJAY RAJ
bece5a698a qcacmn: Send DHCP and EAP event logs through netlink
DHCP and EAP logs are sent through the
vendor event to the supplicant.

Modify the DHCP and EAP log flow through
the diag event to the supplicant in order to maintain single
logging infrastructure.

Change-Id: I43025f393615451f83e3846c767c4572d108462e
CRs-Fixed: 3219460
2022-07-01 13:22:54 -07:00
Neha Bisht
87596da3e4 qcacmn: Avoid qdf framework for nbuf free in Tx. simple path
Avoid qdf framework for nbuf_free in Tx. simple path.

Change-Id: Ic0a82279586a16f07625fc78d3e07d1a134af3a4
CRs-Fixed: 3224285
2022-06-29 04:31:25 -07:00
Chaithanya Garrepalli
bd0375c2de qcacmn: Remove unnecessary checks in Tx path
1. Remove prints in per packet path
2. Add prefecth for skb shinfo
3. Avoid qdf_get_cpu() in DP tx

Change-Id: I86d196cc7865a2d5b3a5a6098f6f7d84397a60d0
CRs-Fixed: 3227568
2022-06-28 14:00:52 -07:00
Ananya Gupta
f3f153cba2 qcacmn: Update qdf wrappers for Runtime PM module
With restructured internal hif runtime pm. Modules using the
runtime pm module need to get registered with runtime pm modules
with their static IDs. QDF wrappers for allowing and preventing
runtime pm suspend are depreciated.
This change introduces ID for various modules and new qdf
wrappers, qdf_runtime_pm_get and qdf_runtime_pm_put are
introduced.

Change-Id: I111efe4aa980a26dbd7da30f031b8daba1c870f2
CRs-Fixed: 3169417
2022-06-18 23:11:31 -07:00
David Oladunjoye
35cf6aca16 qcacmn: Define fallthrough attribute
-Wimplicit-fallthrough is being enabled by default. Some compilers
such as clang require the attribute instead of just a fallthrough comment.

Change-Id: I7e8efaa680c26d9e4a12268e97c1a82a7c7a7a44
CRs-Fixed: 3216249
2022-06-13 17:50:00 -07:00
Devender Kumar
96d0dd12b0 qcacmn: Add new macro for net_dev iface_id
IPA driver requires netdev iface_id at client disconnect event
so that the IPA driver can unregister the local interface.
Fix is to pass the netdev iface id from wlan driver to IPA
at client disconnect event.

Change-Id: Idf79553ee2a9574bf8213e69c46229a3843fca84
CRs-Fixed: 3165336
2022-06-03 04:41:25 -07:00
Subrat Dash
46d50239e8 qcacmn: Microsecond time stamping for hw tx latency stats
Use microsecond timestamping for the tx descriptors
for capturing the latencies more accurately. It will help
to determine the appropriate bucket.

Change-Id: I216e083a7c89b01b6f2f384c1c0a85ca323d3a3e
CRs-Fixed: 3165153
2022-05-16 17:18:48 -07:00
Ripan Deuri
75f4f36ba3 qcacmn: qdf: Add QDF module ID for DP SAWF
Add QDF module ID for DP SAWF.

Change-Id: I461e8f7f12d36b649c807d78d26f50d63d8b6a4d
CRs-Fixed: 3195161
2022-05-16 05:49:24 -07:00
Amir Patel
ca9379b181 qcacmn: Add fraglist to skb if num_frags exceeds MAX_FRAG
Add fraglist to skb if num_frags exceeds MAX_FRAG

CRs-Fixed: 3186124
Change-Id: I3112d63276fe00aea4fce2e287650078b1573d8a
2022-05-06 16:42:41 -07:00
Alan Chen
28a567fe06 qcacmn: Use single variable for minidump table index position
To avoid calling qdf_get_name_idx() function multiple times, only
use the variable tracking the index position of the log type in the
minidump table.

Change-Id: I978ee0fdeed0d9483da7262293103f468496e1c0
CRs-Fixed: 3185934
2022-05-02 20:50:08 -07:00