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
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
In kernel 5.18, netif_rx_ni() is removed. So redefine netif_rx_ni
with netif_rx.
Change-Id: Ia0e43089f028f3bfa71d658d1e64ddeafd32d289
CRs-Fixed: 3298369
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
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
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
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
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
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
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
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
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
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
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
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
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
Remove unused local variables in the qdf memory component
to address the compiler warnings.
CRs-Fixed: 3272720
Change-Id: I9b784a43897003f374239ed2f27e0bb8e0ce4c93
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
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
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
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
Add a new module ID QDF_MODULE_ID_COAP for
CoAP(Constrained Application Protocol).
Change-Id: I4420f741984dfa81677717a6bbb337a0f0b3051b
CRs-Fixed: 3254124
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
Add API to check ICMPV4 and ICMPV6 are redirect or not
This is to avoid a security breach.
Change-Id: I61e7c54c6d9279c1e7d2f316381fbc1c83ce5b4a
CRs-Fixed: 3233925
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
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
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
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
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
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
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
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
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
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
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
-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
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
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
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