Commit Graph

281 Commits

Author SHA1 Message Date
Asutosh Mohapatra
de1e7e7e12 qcacmn: Enhance hang reason code mappings
Currently many host hang reason codes are not mapped to corresponding
userspace codes as a result these hang reason code will be invalid
for userspace and also QDF_REASON_UNSPECIFIED is used in some places
in host.

To add mappings for host hang codes to corresponding to userspace
hang codes and also add new hang codes.

Change-Id: Idb21ccb4a34c9c94872798404912bdb743e9270b
CRs-Fixed: 3381229
2023-02-10 12:21:38 -08:00
Mohammed Ahmed
cef49bdf89 qcacmn: add SSR host log collection API usage
Current code does not use the SSR host log collection API.
Fix this by adding SSR host log collection API usage.

Change-Id: I9dfb0bd7054986760a711d0752f37f4327c706b2
CRs-Fixed: 3339933
2023-01-19 20:44:09 -08:00
Vijay Raj
06d0b53489 qcacmn: Add event id for Neighbor and beacon report logging
Add event id to support Neighbor report and beacon report for
diag logging.

Add EVENT_WLAN_NBR_RPT event to send Neighbor report diag logs
and EVENT_WLAN_BCN_RPT event to send Beacon report diag logs.

Change-Id: I5c7207667e2bad803389e160912357bc87196131
CRs-Fixed: 3370803
2023-01-17 01:41:49 -08:00
Jingxiang Ge
7d007034fb qcacmn: Add debug timestamp for wlan_logging_thread
Add more log for wlan_logging_thread to monitor
thread start/exit.
and also add memory barrier wmb to make sure exit
flag/shutdown_comp have been set done.

Change-Id: I6549f344f50bdd9df3a29c4ab724ea67213670de
CRs-Fixed: 3320274
2022-11-22 07:49:45 -08:00
David Oladunjoye
3ccef6c0a6 qcacmn: Fix list iterators to match upstream discussion
List iterators should conform to upstream discussion. List iterators that
reach end of list do not point to NULL but rather they point to list_head.
Dereferencing the iterator in this case would break the list. The scope of
the list iterator should be confined to the loop. Solution is to use assign
ptr to iterator when condition is met, this ptr can be used outside of the
loop.

Change-Id: I896b85bbd24b63e6b1562d35ffec8abc920f1b6d
CRs-Fixed: 3331681
2022-11-19 01:03:24 -08:00
Liangwei Dong
436c73ee60 qcacmn: Add WAKELOCK_DYN_MAC_ADDR_UPDATE wake lock reason
Add new enum WIFI_POWER_EVENT_WAKELOCK_DYN_MAC_ADDR_UPDATE
for dynamic MAC address update wake lock reason code.

Change-Id: I61b9b54b2aca30eec9aa1d153a40877bfda88af9
CRs-Fixed: 3327592
2022-11-10 11:35:24 -08:00
Jeff Johnson
cfe8cda786 qcacmn: Use renamed QDF suppressed logging APIs
Several QDF suppressed logging APIs were originally named with a
misspelling of "suppressed." New correctly-spelled functions are
available, so call those instead.

Change-Id: I4fcd506b39cedd6f094f93ee900cf9ce8be759c1
CRs-Fixed: 3313686
2022-10-25 20:10:38 -07:00
Jeff Johnson
b26f2f678c qcacmn: utils: Fix misspellings
Fix misspellings in utils/...

Change-Id: I092dfff26e16e7c660e6652a652268256d1d1517
CRs-Fixed: 3304703
2022-10-12 13:19:26 -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
1cb111d3bc qcacmn: replace PDE_DATA() with pde_data()
In kernel 5.17, PDE_DATA() is replaced with pde_data(). Make
matching change in ath_procfs.c and linux_ac.c files.

Change-Id: Ia198545322146d4adde9330c19b43f5c2ed0dfa2
CRs-Fixed: 3298062
2022-10-05 17:51:38 -07:00
Rajesh Chauhan
c85603d008 qcacmn: replace complete_and_exit with kthread_complete_and_exit
In kernel 5.17, complete_and_exit is replaced with
kthread_complete_and_exit. So if kernel version is >= 5.17,
then use kthread_complete_and_exit.

Change-Id: I4e9a98373197eba4931a8dafe77040448ffb40eb
CRs-Fixed: 3297481
2022-10-05 17:51:25 -07:00
Jeff Johnson
88c15dadbb qcacmn: Fix misspelling "recevied"
Multiple instances of the misspelling "recevied" are present, so
replace them with the correct spelling "received."

Change-Id: Ibd7f4a136541be8aa98f5bee4db7f75af0271f53
CRs-Fixed: 3273526
2022-08-28 19:08:26 -07:00
VIJAY RAJ
0e1e696425 qcacmn: Add Roam reason and Roam sub-reason for Diag logging
The roam reason and roam sub-reason code sent and expected
reason codes at supplicant are diffent which results in
wrong interpretation of reason code.

Add roam reason and roam sub-reason code enum in order
to aid the converion from fw roam reason code to supplicant
understandable reason code.

Change-Id: I3432793965e325ddbf90ab90a1532a0726650d8c
CRs-Fixed: 3238496
2022-07-19 03:34:08 -07:00
VIJAY RAJ
a103471347 qcacmn: Add new diag events in enum event_id_enum_type
The existing design is to send connectivity event logs
via vendor command.

New diag events are  introduced to maintain single
logging infrastructure.

Change-Id: I162680b40127826cd74e7b437b7cdaeb81b96bc1
CRs-Fixed: 3220081
2022-07-07 21:43:18 -07:00
Vinod Kumar Myadam
b721690039 qcacmn: Add flag CONNECTIVITY_PKTLOG
Add new flag CONNECTIVITY_PKTLOG to make independent of
FEATURE_PKTLOG and REMOVE_PKT_LOG for packet logging.

This is because 32 tx/rx pkt logging is connection related
and this feature is independent of pkt log feature. Here
driver will send first 32 tx/rx pkts consisting of mgmt
and data pkts to userspace which can be used for debugging

Change-Id: I006a040546c9709f46e76dcd8630da8569c691c6
CRs-Fixed: 3222971
2022-06-27 12:17:21 -07:00
Amit Mehta
6e1dde7e43 qcacmn: Add QDF packet type enum
Add new QDF enum for packet type and make
changes to pass status and type to packetlog callback APIs as QDF type

Change-Id: I423839e42b316ce43feaae34e297d3d8f0dee7ba
CRs-Fixed: 3224881
2022-06-23 07:04:02 -07:00
Kai Liu
f744f6a4e7 qcacmn: Use default seek for memdump lseek
Kernel change d4455fa 'proc: mandate ->proc_lseek in "struct proc_ops"'
by default use proc_lseek for file operations without any check, so add
default_llseek for all proc ops.

Change-Id: Ia72839cf09ec721fb98f50793b19ec082478d8d7
CRs-Fixed: 3201003
2022-05-24 16:01:15 -07:00
Jianmin Zhu
5a0dd70fc9 qcacmn: Limit netlink log on console
WLAN registers with multicast group 1 which is used by some legacy
infrastructure, may receive some wlan irrelative events, don't need
print on console.

Change-Id: I48fca745a603fd9875e2161d48144b4283fd6493
CRs-Fixed: 3137354
2022-03-01 21:46:02 -08:00
Adwait Nayak
b66eb8977a qcacmn: Rectify LF copyright year
Rectify LF copyright year

Change-Id: Ia021db26a4e528d42f148b0f24258f55e957be54
CRs-Fixed: 3122253
2022-02-10 14:03:08 -08:00
Adwait Nayak
df88a8bdc9 qcacmn: Place pktlog specific code under BE_PKTLOG_SUPPORT
Introduce a new flag "BE_PKTLOG_SUPPORT" for beryllium specific
pktlog support.

Change-Id: If91156541b322905ad5d97cf2d9d7ae687290ecb
CRs-Fixed: 3115832
2022-01-26 10:59:42 -08:00
Liangwei Dong
a5503f36a3 qcacmn: Add DEBUG_CONN_RSO log history
Add new DEBUG_CONN_RSO enum to record RSO state changing.

Change-Id: Ie46ab5d4b32d8b5632aa3c3eaed96d00afda22b3
CRs-Fixed: 3097076
2021-12-27 01:03:55 -08:00
Adwait Nayak
3664b4c5c2 qcacmn: FR65980: Add HYBRID TX support for pktlog
- A new pktlog mode called "hybrid", is added for QCN9224 only.
- Create WDI event for hybrid mode
- Add dummy APIs for monitor filter setting
- Send WMI_PKTLOG_EVENT_HYBRID_TX to FW for umac TLV subscription

Change-Id: I47f4e14bfc766f29a0ab4a8c07ab19e0d919e66b
CRs-Fixed: 3074184
2021-11-26 10:13:12 -08:00
Mohit Khanna
81e29163db qcacmn: Add throughput based RTPM API support
Add support to invoke HIF runtime PM APIs in TX packet path based on
throughput level. Essentially at high throughputs, where runtime PM is
not expected to provide power gains, invoking the APIs is deterimental to
performance.
Hence invoke runtime_pm APIs based on throughput level.

CRs-Fixed: 3059712
Change-Id: I49d111bffa8a37c68abbdd54911f9ecc22430562
2021-11-08 05:19:41 -08:00
Yue Ma
6c387e6f24 qcacmn: Include panic_notifier.h to access panic_notifier_list
From 5.14 kernel, panic_notifier_list is moved from kernel.h to
panic_notifier.h, hence explicitly include the header file in
order to access panic_notifier_list.

Change-Id: Icf546ebea5a19b79602031b4fd92b498db0048c0
CRs-fixed: 3060060
2021-10-25 18:31:21 -07:00
Rajeev Kumar
2d0856d0b2 qcacmn: Add disconnect wake lock reason code
Add disconnect wake lock reason code to add a wake lock
for WiFi disconnection.

Change-Id: I2ac33239c9df76d7c92429b9ada0380ad79fc72c
CRs-Fixed: 3045132
2021-09-28 23:23:37 -07:00
Pragaspathi Thilagaraj
a8d8b663b2 qcacmn: Define QDF API for vzalloc and vfree
Define QDF API for virtual memory allocation and free.
Also add new api to get time of the day in microseconds.

Change-Id: I2921055bbb6b5d2a1105d19448b2a10fa2d6ccc5
CRs-Fixed: 3038180
2021-09-28 21:12:18 -07:00
Pragaspathi Thilagaraj
b001e0e130 qcacmn: Add support to send connectivity logs from logging thread
Add support to send connectivity logs from g_wlan_logging thread.
Add new HOST_LOG_DRIVER_CONNECTIVITY_MSG event flag which wakes up
the gwlan_logging thread when set.
Also register connection manager callbacks to send the logging event.

Check if logging queue is empty whenever the gwlan_logging thread
is woken up and send the logs to userspace if the count doesn't
exceed the allowed threshold.

Change-Id: I3fdb8358f9048a277e2f03894c0e6a17376b0da0
CRs-Fixed: 3029279
2021-09-16 08:28:29 -07:00
Yue Ma
674474c55a qcacmn: Add CONFIG_CNSS_OUT_OF_TREE flag
Use CONFIG_CNSS_OUT_OF_TREE to control if CNSS family drivers are
built from in-kernel-tree source or out-of-kernel-tree source since
the exposed header files will be in different paths. This is also
for backward compatibility.

Change-Id: I698492f175ea140e6854c372f366a63f36de24c9
CRs-fixed: 3022556
2021-08-30 13:38:44 -07:00
abhinav kumar
0df0ae40b0 qcacmn: Possible OOB read in process_fw_diag_event_data
API "fw_diag_data_event_handler" is the handler of an event
WMI_DIAG_DATA_CONTAINER_EVENTID comes from FW. Arguments of
this handler function come from FW.

If num_data may be less than size of(struct wlan_diag_data),
possible OOB while extracting event data.

Fix is to add a sanity check for num_data to avoid the OOB
read.

Change-Id: Ia2eb62dbaa154936bdb4ea34065657d441f12810
CRs-Fixed: 3001178
2021-08-19 22:17:46 -07:00
Jeevan Kukkalli
0343109e97 qcacmn: Print buffered logs one line at a time
Print buffered wlan logs one line at a time to avoid
log split.

Change-Id: Ie35bdee741e7dab430281bb18aea48325118bf23
CRs-Fixed: 2977844
2021-08-17 01:38:44 -07:00
Vevek Venkatesan
6a3c9eaa85 qcacmn: add CDP interface support for pkt_log_exit
Add CDP interface API support for pkt_log_exit,
to cleanup pkt_log_init on failure.

Change-Id: Ib50efaed5997d341d3e76c2e1dbe42856df40191
CRs-Fixed: 3012201
2021-08-14 23:07:04 -07:00
Jia Ding
b1ba62d8e2 qcacmn: Add 320MHz in enum mgmt_ch_width
Add BW_320MHz in mgmt_ch_width in host diag module.

Also remove WLAN_FEATURE_11BE feature flag within enum
mgmt_dot11_mode for 11BE related modes.

Change-Id: I2914735edd5aa21ad1d94b0e5fcf718b189fc432
CRs-Fixed: 3009301
2021-08-11 15:50:55 -07:00
Rajeev Kumar
37ee80923a qcacmn: Add wakelock reasons for sap and go d3 wow
Add wakelock reasons for sap and go d3 wow feature.

Change-Id: I067cb8fd30cc90d4ec0c8b1a26c0b5bc17db966f
CRs-Fixed: 2986291
2021-07-14 17:53:54 -07:00
Ashish Kumar Dhanotiya
fdac28ef95 qcacmn: Add synchronization for flush log completion
Currently there is no synchronization for flush log completion
between fw and userspace. When host driver receives command to
flush logs, it sends the command to fw and releases the control
of the userspace thread, it does not wait for the flush log
completion event from the fw and because of which user space
does not know when the host and fw completes the log flush.

To address above issue add a logic to wait for fw event of
flush log completion before host returns control to userspace.

Change-Id: I04fa0aead146d2b7b8627e4101c6dcd99d3947e9
CRs-Fixed: 2983387
2021-07-12 05:33:17 -07:00
Wu Gao
0971daad9f qcacmn: Add wakelock for enhanced CFR
There is potential risk when starting CFR and resume happens at same
time, so this change adds wake lock for enhanced CFR.

Change-Id: Ifbde12cb73092b7fc4ef517e57051af4ffe7a79f
CRs-Fixed: 2974733
2021-06-28 19:25:58 -07:00
Aditya Kodukula
f94320aa61 qcacmn: Add wlan driver log msgs into the minidump
As part of minidump enhancement feature, incorporate wlan driver
log_msg data structure into the minidump.

Change-Id: Ic68e199c645bf8c8be50e105391b5c6efa90decc
CRs-Fixed: 2946292
2021-06-08 13:18:25 -07:00
Lin Bai
c672a940aa qcacmn: Add diag API to report EVENT_WLAN_BRINGUP_STATUS
Implement API to report DIAG event EVENT_WLAN_BRINGUP_STATUS
to user-space.

Change-Id: Id344fc62b511de71da990aa37a2bca710ff8afda
CRs-Fixed: 2922103
2021-05-06 10:44:28 -07:00
Bapiraju Alla
17f12e5b39 qcacmn: Fill peer assoc mlo params in peer assoc request
Fill peer assoc mlo params in peer assoc request command.
Also add definitions to the WMI_SERVICE_11BE.

Change-Id: Ied7959e022ee27f3bd698b84dc801491175f85b3
CRs-Fixed: 2934417
2021-05-05 04:47:01 -07:00
Guisen Yang
7f654edca5 qcacmn: Do not return error if ol_ctx is NULL
For chips that do not use BMI, the epping enable process
will break if the epping_enable() flow is returned when
ol_ctx is NULL. This should not happen because ol_ctx
is only used when BMI is enabled. Whenever ol_ctx is referred
to, it will be checked for NULL before use, so we should
not return error here.

Change-Id: Ia873536a294b79f774193493646519163baf28c4
CRs-Fixed: 2901231
2021-03-24 09:48:08 -07:00
Ananya Gupta
6d07f2a272 qcacmn: Clear g_pktlog_pde after de-init pktlog
When switching from mission mode to FTM or Epping mode,
g_pktlog_pde is not cleared after de-init. When switching
back to mission mode, a warning is produced as the proc
directory is not found.
To fix this, g_pktlog_pde is cleared when pktlog is
de-initialized.

Change-Id: I1b9c9259c220a1981151dcb1e44a5621d7fd8204
CRs-Fixed: 2872045
2021-02-08 10:51:48 -08:00
Debasis Das
77a23e8f71 qcacmn: Use abstraction APIs for kernel APIs
Use non-inline OS-abstraction APIs to avoid direct
usage of kernel API's.

Use non-inline OS-abstraction APIs instead of OS APIs.

Change-Id: Ie4acfedc63a0e0e8ecbe358db711148db92bd8b6
2021-01-22 12:07:41 -08:00
Vivek
69a1c93dc2 qcacmn: Rate limit prints to console from logging utility
The prints from the driver are rate limited based on the
configurations provided.

Also the prints which are redirected to user space daemon
and of certain log levels are also printed on the console.

Add a rate limiting version of the API for the prints coming
to console via the logging daemon.

CRs-Fixed: 2853590
Change-Id: I9683172ac0665b46581bad13a1050c6d70d72b5c
2021-01-19 03:52:13 -08:00
Balaganapathy Palanisamy
d939d58b24 qcacmn: Delete logger timer then reset pcur_node
Delete the flush timer then set the pcur_node to NULL
while cleanup to avoid NULL pointer dereference in timer handler.

CRs-Fixed: 2820441
Change-Id: If6edca1343890e0fe962d7b3e3b5b07f379143ef
2021-01-15 01:58:47 -08:00
Liangwei Dong
a7717deced qcacmn: Record station connect/disconnect event
Add connect/disconnect log ring buffer to existing ROAM
debug functionality to record OS IF layer event.

Change-Id: Ifcbcd9a38ead27d60757983a0f56a37ae5d8af81
CRs-Fixed: 2852405
2021-01-13 02:34:45 -08:00
Vinay Gannevaram
860977d0dc qcacmn: Use local skb pointer for reentrant cld80211_msg_allocator
cld80211_oem_rsp_alloc_skb api is used to alloc skb for reply msg.
A static buffer pointer is returned from this reentrant func
which can be called by kworker and scheduler thread at same
time resulting single buffer access by both threads. After
kworker thread freeing this skb, scheduler is further updating
data in this skb resulting in page fault error. Use local
skb pointer to avoid such race conditions

CRs-Fixed: 2822390
Change-Id: I5f807d06c4890b027c86de9187f17fb83b19db5e
2020-12-15 03:36:00 -08:00
Alan Chen
8a27ffb4ad qcacmn: Rate limit error logs from send_diag_netlink_data
Introduce proper logging APIs for diag module and also rate limit error
logs when skb allocation fails in low memory conditions to avoid excessive
logging side effects

Change-Id: Ia41ff7cfd526180825df61a43f1f59163947f257
CRs-Fixed: 2836681
2020-12-11 22:45:11 -08:00
Srinivas Girigowda
f7248d774e qcacmn: Fix possible OOB read in cnss_diag_cmd_handler
The nla_data coming from user space is a variable length data,
but the driver is checking nla_len() against a fixed length struct only.
It is possible that the nla_len() check against fixed length struct
may pass and if the nla_data does not have the payload and it may
result in possible out-of-bound read (slot->payload).

Hence the fix is to, check if nla_len() is atleast more than
the fixed length struct and also account for payload length.

Change-Id: I2e68d55c0411cff55908c1704031e3c070f3316e
CRs-Fixed: 2825763
2020-12-04 02:50:42 -08:00
Vivek
3327a6a92b qcacmn: Add support for rate limiting QDF trace prints
The existing QDF implementation does the following
1. The QDF trace either prints to the console
2. The QDF trace message  is directed to the utils,
   which based on log level
	a. redirects to a user space daemon or
	b. redirects to console

There is excessive logging detection in the utils code
before redirecting the prints to  the console.
If the number of prints to console is more than
the configured threshold, we assert in development builds.

Moving the API for excessive logging detection from utils to
QDF trace.

The configuration for detection of excessive logging currently
is only for the number of prints per second.
Adding time configuration also to detection of excess logging
to the console.

CRs-Fixed: 2809752
Change-Id: Iecc408fc9b576fa900a6d7ee793639f1dde3110d
2020-12-02 10:45:34 -08:00
Bapiraju Alla
b130521bd3 qcacmn: Process FW diag events in a separate worker thread
Currently, FW diag logs, management frames and stats responses are
processed in worker context. Because of this, there is a possible
out of memory scenario when there are huge number of diag events
waiting in work queue.

To address this, process diag events in a separate worker thread and
set the limit for the number of diag events that can be queued in
work queue.

Change-Id: Ie6e5b905a3b591cf724cd6b024bec0612f9e2e0c
CRs-Fixed: 2818013
2020-11-21 00:20:27 -08:00
Lihua Liu
04e2005263 qcacmn: Avoid massive logging when diagLog socket absent
netlink_broadcast() will return -ESRCH when diagLog socket in
userspace is not present, then massive and repetitive error log
shown as below will be print. To address this, don't print
error log if netlink socket is absent.

"Ptt Socket error sending message to the app!!"
"ptt_sock_send_msg_to_app:Failed sending Msg Type [0x5050] to pid"

CRs-Fixed: 2801137
Change-Id: I14858625732c06442561e9a2e76fe2cfb6dabc12
2020-11-10 21:27:10 -08:00