Commit Graph

61 Commits

Author SHA1 Message Date
Linux Build Service Account
340a69cc06 Merge "qcacmn: Initialize __log_window_end_ticks variable explicitly" 2019-10-08 00:38:54 -07:00
Himanshu Batra
7ee0677954 qcacmn: Replace linux print APIs with qdf print APIs
Replace linux print APIs with equivalent level qdf print APIs.

Change-Id: If0a4a5326de87c9f023e8f4de996a4734ed6cda2
CRs-Fixed: 2530137
2019-09-29 23:15:37 -07:00
Li Feng
510e4e2de7 qcacmn: Initialize __log_window_end_ticks variable explicitly
The __log_window_end_ticks variable is implicitly initialized as
zero, which may lead to the disfunction of qdf_system_time_after
when assert_on_excessive_logging is first called with big number
jiffies. Then __log_window_count number increase until hit the
threshold, and trigger the panic.

Now initialize __log_window_end_ticks variable explicitly when
__log_window_count is initial zero in the first call of
assert_on_excessive_logging.

Change-Id: Ic5256af9235bf195b4ae5ee79bfce9ea213ea29b
CRs-Fixed: 2525529
2019-09-23 14:41:18 +08:00
Jingxiang Ge
3d3ec24553 qcacmn: Remove CONFIG_MCL for header file in wlan_logging_sock_svc.c
Remove CONFIG_MCL for header file.

Change-Id: Id3d6f86fde15d7afd88504886fc87db02a949a67
CRs-Fixed: 2488036
2019-07-29 11:23:18 -07:00
Venkata Sharath Chandra Manchala
d82dc29fe6 qcacmn: Fix skb overflow in wlan_pkt_stats_to_logger_thread
When wlan logging is turned on in developer options
wlan logging verbosity level is set to active and
pktlog buffer will also be passed to
wlan_pkt_stats_to_logger_thread. In this API we call
skb_put multiple times to copy ath_pktlog_hdr(16 bytes)
and pktlog buffer (2048 bytes) = 2064bytes  which is leading to
skb_over_panic as the skb length is set to 2048 bytes.
Increase the skb size to 2112 bytes which can accommodate
2048 bytes (pktlog buffer size)  + 16 bytes(ath_pktlog_hdr) +
8 bytes (pkt_dump) + 40 bytes (future use)  to avoid overflow.

Change-Id: Ia8bda14f45d2eb77357bf7e46a12c1062d56d8e1
CRs-Fixed: 2489338
2019-07-25 22:09:55 -07:00
Paul Zhang
8cf0c34663 qcacmn: Remove CONFIG_MCL wlan_logging_sock_deinit_svc
This is to remove CONFIG_MCL wlan_logging_sock_deinit_svc.

Change-Id: I4e31bddb0fb2ac25c031dc05eec60e54032322de
CRs-Fixed: 2494078
2019-07-25 02:41:00 -07:00
Alok Kumar
9551ea2d0e qcacmn: Define tx_status enum in wlan_logging_sock_svc.h
Add the tx_status enum in wlan_logging_sock_svc.h so that
enum can be used for MGMT TX status mapping in wma_mgmt.c

Change-Id: I5681e6fcc39704b6be18bc68b1042e0e6b53f590
CRs-Fixed: 2491787
2019-07-20 02:32:43 -07:00
Jingxiang Ge
4cbb2ada5b qcacmn: Remove CONFIG_MCL in wlan_flush_host_logs_for_fatal
This is to remove CONFIG_MCL in wlan_flush_host_logs_for_fatal.
And move condition cds_is_log_report_in_progress to qcacld code.

Change-Id: Ie231e966229789bcd8fa69aef1bc20e9b07a88ae
CRs-Fixed: 2484897
2019-07-10 00:23:19 -07:00
Jingxiang Ge
e575abcaa6 qcacmn: remove CONFIG_MCL in wlan_logging_set_fw_flush_complete
This is to remove CONFIG_MCL in qcacmn code.
This change cleans CONFIG_MCL in wlan_logging_set_fw_flush_complete.

Change-Id: Ia417c90060b20b004b1e5408be654ff392a8113d
CRs-Fixed: 2484838
2019-07-10 00:23:16 -07:00
wadesong
9b220a6ec6 qcacmn: Cleanup CONFIG_MCL for pktlog related code
Replace macro CONFIG_MCL with FEATURE_PKTLOG for
pktlog related code.

Add some macro changes to ensure the following 3
functions' declarations are enclosed by the right
macros:

wlan_deregister_txrx_packetdump
wlan_register_txrx_packetdump
wlan_pkt_stats_to_logger_thread

Change-Id: I900de3be28faee8403923a5e4bd326e69895d998
CRs-Fixed: 2406250
2019-07-08 12:10:09 -07:00
Rajeev Kumar
f13e25e8fb qcacmn: Remove adrastea compile flag from log to user api
Adrastea compile flag is not needed for wlan log to user
time stamp add API because current day of time is expected
to be logged in driver log for all cases.

Change-Id: If04dc54ef35db6d66da9a69a1c7d502873009553
CRs-Fixed: 2444852
2019-05-01 16:21:13 -07:00
Jeff Johnson
4c5ac90746 qcacmn: utils: 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 utils replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: Iae6c2f2f0b3041a9397dd13092ea500a8b995fd2
CRs-Fixed: 2418251
2019-03-26 10:30:31 -07:00
Jingxiang Ge
434105d7a5 qcacmn: Get wlan op mode from vdev for pktlog
To avoid using qcacld code in cmn, when getting
wlan op mode, using op mode info from vdev rather
adapter.

Change-Id: Ida5a7aa6c793e955122a4bbf3bf0fa1fa5cbf7a3
CRs-Fixed: 2412317
2019-03-19 21:17:07 -07:00
Harprit Chhabada
b276eea5e7 qcacmn: Fix null pointer dereference in send_packetdump
netbuf in send_packetdump is never checked for null before
dereferencing it for len netbuf->len.

Change-Id: I51aa0fb9c52e04c33291791ef47def703754222d
CRs-Fixed: 2404844
2019-03-06 14:08:36 -08:00
Paul Zhang
9c8c20f6c0 qcacmn: Clean CONFIG_MCL for send_flush_completion_to_user
The aim is to remove CONFIG_MCL or CONFIG_WIN from
cmn component.

This change takes care send_flush_completion_to_user.
Cleaning up cmn code by replacing the CONFIG_MCL
with macro FEATURE_WLAN_DIAG_SUPPORT.

CRs-Fixed: 2397824
Change-Id: I57a82fec17210b49f778a950034ca442d11eb511
2019-02-22 06:56:44 -08:00
Jingxiang Ge
eb26aa78ae qcacmn: Clean CONFIG_MCL for log_to_console/assert_on_excessive_logging
The aim is to remove CONFIG_MCL or CONFIG_WIN from
cmn component.

This change takes care log_to_console and
assert_on_excessive_logging.

Change-Id: I365f5156a2825a11c279b931b9191cf5c470e943
CRs-Fixed: 2359042
2019-02-01 05:54:38 -08:00
Paul Zhang
884782c9c8 qcacmn: Clean CONFIG_MCL for host_diag_log_set_*
The aim is to remove CONFIG_MCL or CONFIG_WIN from
cmn component.

This change takes care host_diag_log_set_code and
host_diag_log_set_length.

CRs-Fixed: 2371125
Change-Id: Ic04037202d79f87003a47ac2d698bc4e7752ee12
2019-01-16 00:12:08 -08:00
Lin Bai
00e8c948c8 qcacmn: Implement converged packetdump API
Packetdump invokes legacy data path API directly without
considering underlying HW:
1. ol_register_packetdump_callback
2. ol_deregister_packetdump_callback
Global pointer pdev_txrx_ctx will be casted to struct ol_txrx_pdev_t
always even Lithium (use struct dp_pdev) underlying, and overwrite
struct dp_pdev unexpected.

Wrap with cdp API to avoid.

Change-Id: I5c8847ddc51548e8854ba600bec99ce5200dd817
CRs-Fixed: 2366344
2019-01-03 02:30:21 -08:00
jitiphil
7c265d301e qcacmn: Packet stat collection failure
Change made I7fd67b02c3b7cb4f1bfe7c6f4641f6d881e25abd
to fix possible NULL dereference of pkt_stats_dump
caused pkt stats collection to fail as pkt_stats_dump
is NULL from cds_pkt_stats_to_logger_thread.

Move NULL check for pkt_stats_dump to just before
it is dereferenced

Change-Id: I0f4c9d58f0d4d17d6c26bfbbd79f6447dd52230b
CRs-Fixed: 2358139
2018-12-02 11:55:21 -08:00
Dustin Brown
aaa97751a6 qcacmn: Add excessive logging detection
One of the most common stability issues encountered by the stability
team is watchdog bite due to excessive logging. Add a feature to track
logging to dmesg using a tumbling window and counter, and panic if the
configured maximum number of logs for that window is exceeded.

Change-Id: If83c6dfccb9d191b02a3a7166b065c0a0704f969
CRs-Fixed: 2338385
2018-10-25 12:33:04 -07:00
Dustin Brown
02818ec2e5 qcacmn: Log to console per log level
Currently, every message which is logged to console is logged at the
same level. Instead, log each message using an appropriate pr_* API
based on the log level of the message being logged.

Change-Id: I0638f3ab155576ed87d663a4b060d16969cf816c
CRs-Fixed: 2327148
2018-10-05 00:27:49 -07:00
Rajeev Kumar
b7dcab9948 qcacmn: Use pr_info for wlan driver console logging
Use pr_info for wlan driver console logging such that its
backward compatible with qcacld-3.1 and by default info log
levels are not logged on console unless kernel's printk current
console log level is changed to print info logs as well on console.

Change-Id: I33ca583743a9b77253390abcece6c8067f38c35d
CRs-Fixed: 2326304
2018-10-02 22:28:45 -07:00
Dustin Brown
e60cba22e1 qcacmn: Remove radio index from logs
As part of the effort to reduce the volume of logs produced by wlan,
remove the radio index from the base information which gets logged with
every message. The module name, which is also logged with every message,
is the preferred way to keep track of which wlan module is logging.

Change-Id: Ib13f12c55fb9a90ac61661d2a13e44913997804e
CRs-Fixed: 2318008
2018-09-21 22:40:33 -07:00
Adil Saeed Musthafa
12205b544b qcacmn: Add timer to flush out log buffers periodically
Add timer to flush out log buffers periodically. Add command to set the
time period value.

Change-Id: I8e796a9bc7caac2661d00852420dd5fa66f5bca5
CRs-Fixed: 2296362
2018-09-21 20:50:55 -07:00
Paul Zhang
f7fb463692 qcacmn: Stability feature enhancement
Stability feature enhancement to log below highlighted QTIMER
tick into Hexadecimal(currently its logged in decimal) such
that it can easily compare WLAN log QTIMER with WMI and HTC
credit log in crash-scope.

Change-Id: I0e0db3cbe90519248be98678e692cc89a87fcd2f
CRs-Fixed: 2315210
2018-09-21 03:53:38 -07:00
Manjunathappa Prakash
d0fc0ea364 qcacmn: Add more debug_ids and reduce the dump log level
Add more debug IDs to narrow down further funciton who is holding peer
reference. Reduce the peer debug dump log level to avoid side effects of
console logging.

Change-Id: I9820c72bcde8a0c2b0e779cf322e1133ef8a43e6
CRs-Fixed: 2303069
2018-09-01 01:42:42 -07:00
Qiwei Cai
59ec405e49 qcacmn: Allocate roam debug buffer dynamically
Allocate memory for global_wlan_roam_debug_table dynamically.

Change-Id: I73a7654cbe75c288aae58e50c6d2072dc6a1e2fe
CRs-Fixed: 2275994
2018-07-13 02:58:39 -07:00
Rachit Kankane
dfd97f38f6 qcacmn: Call blocking functions in right context
Call blocking functions free_g_qdf_dp_trace_tbl_buffer and
allocate_log_msg_buffer under non-atomic context.

Change-Id: I534c95b19cb08472db4a4a0f8285769841b00326
CRs-Fixed: 2273581
2018-07-09 05:32:55 -07:00
Rachit Kankane
97c4e1efcc qcacmn: Allocate gplog_msg dynamically
Allocate memory for gplog_msg buffer dynamically.

Change-Id: I70b79215b5f318217de180a53c4bad5f237be37d
CRs-Fixed: 2266814
2018-06-27 07:24:40 -07:00
Qiwei Cai
1c8f4f7be2 qcacmn: Featurize wlan roam debug
Featurize wlan roam debug log to compile out in mission mode.

Change-Id: Ic3dcdc6ab541093f16fcc8b9118120aa1f9b972f
CRs-Fixed: 2241297
2018-06-20 00:43:28 -07:00
Nirav Shah
79ec3e999b qcacmn: Add support to configure buffer size from kbuild
Add support to configure logging buffer size from
per-OEM kbuild based on memory requirement.

Change-Id: Ia91d79e5e738b1c9787015de101c3f67ccde46aa
CRs-Fixed: 2253438
2018-06-15 21:31:16 -07:00
Rajeev Kumar
c396c9015a qcacmn: Log reason code while flushing logging events
Log reason code while flushing logging events to precisely know
the reason of failure.

Change-Id: Ibe26563780f165e85490c54c2b4f83d959a3587f
CRs-Fixed: 2235276
2018-06-14 20:55:47 -07:00
Nirav Shah
c9b0931950 qcacmn: Featurize packet log
Featurize packet log.

Change-Id: Ica7d658ef65486ae77e24a11cef50291a5e82563
CRs-Fixed: 2245424
2018-06-09 02:28:11 -07:00
Jeff Johnson
5f255001d9 qcacmn: utils: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: I0bb870b4c83129d2466aeb4741d27783de888008
CRs-Fixed: 2230684
2018-05-18 02:17:50 -07:00
Kai Liu
d7bfcdf520 qcacmn: Refine API wlan_log_to_user
Remove redundant message length check.
Truncate message immediately if its length is over MAX_LOGMSG_LENGTH,
so that can remove min check between true length and max available length.

Change-Id: I7e6c61021316a727e04dbb9671947b6413c27af3
CRs-fixed: 2229210
2018-05-04 00:48:04 -07:00
Rajeev Kumar
708e7f57c5 qcacmn: Remove multicast logging check from wlan_log_to_user API
Multicast logging is MCL specific feature which controls sending
of host and fw netlink DIAG events to user space. This feature
should not control console logging from wlan_log_to_user because
it can lead to all debug logs getting logged on console until
CFG INI for multicast logging is parsed during initialization and
this can lead to watchdog bark beacuse of excessive logging during
WiFi driver initialization. Hence remove multicast logging check
from wlan_log_to_user API to avoid logging all debug logs on console
during WiFi driver initialization sequence.

Change-Id: I2a29928757f683a72345436a57de1ee8d02f53b3
CRs-Fixed: 2217749
2018-04-05 16:41:16 -07:00
Manikandan Mohan
5bdb2fe470 qcacmn: Fix export symbol for multi drivers compilation
Update driver files to use qdf_export_symbol to facilitate
multiple driver module compilation support.

Change-Id: Ic7d7f65b79e92957b02c0386ba98af2adf17506b
CRs-fixed: 2197751
2018-03-19 19:58:03 -07:00
Dustin Brown
fb6527630f qcacmn: Deprecate WLAN_MACADDR_LEN
At some point WLAN_MACADDR_LEN was added to the driver, despite
QDF_MAC_ADDR_SIZE already serving the same purpose. There are cases
where these two macros are implicitly assumed to be the same value.
This is a classic single-source-of-truth violation, and only serves to
confuse developers. Deprecate WLAN_MACADDR_LEN and use
QDF_MAC_ADDR_SIZE instead.

Change-Id: I4e941d5e17d161a5810e693c89b95ae08f83c6b0
CRs-Fixed: 2179728
2018-02-28 14:57:53 -08:00
Nirav Shah
b432e7c080 qcacmn: [QDF] Add support for QCA9379 on x86 platform
Add support for QCA9379 chip on x86 platform for
USB and SDIO attach.

Change-Id: I50353d069e3b2edfb73c5421b73e18273bc243af
CRs-Fixed: 2181012
2018-02-27 21:17:15 -08:00
Arif Hussain
a4a02defe3 qcacmn: wlan_roam_debug: Replace instances of unadorned %p
Replace instances of unadorned %p in wlan_roam_debug_dump_table.

Change-Id: I3fdfcbe30162804f6a32c84ae2f79dc11d649771
CRs-Fixed: 2144062
2017-11-22 15:21:47 -08:00
Deepak Dhamdhere
7e0b8ba31a qcacmn: Create roam debug log infrastructure
Add a circular buffer to hold roaming related debug log information
for peer and vdev operations in the driver. Purpose is to dump
this information after host or target crash. 256 entries will go
back much deeper into history than dmesg or wlan driver logs found
in crashScope. Information is dumped out as error messages from
crash detection points as necessary.

The support routines help to store the debug logs and dump them,
typically after peer related timeout or assert.

wlan_roam_next_debug_log_index () - Utility routine to compute next index
wlan_roam_debug_log() - Adds a log entry
wlan_roam_debug_string() - Returns debug log type string
wlan_roam_debug_dump() - Dump all wlan roam debug log records

Add new QDF module ID QDF_MODULE_ID_ROAM_DEBUG.

CRs-Fixed: 1116078
Change-Id: If2077f560405ec0414d08ef4ece0fb0d2db2ccc7
2017-10-31 17:39:09 -07:00
Anurag Chouhan
6e56986cae qcacmn: Introduce QCA_NL80211_VENDOR_SUBCMD_HANG
Event indicating to the user space that the driver has detected an
internal failure. The driver is expected to recover from such a failure
automatically, e.g., by resetting the device.
This event carries the information indicating the reason that triggered
this detection.

Change-Id: Ia13e6f102e5e18ec4864ed258728369d51a77ff4
CRs-fixed: 2120886
2017-10-06 07:58:02 -07:00
Jeff Johnson
8104b5db07 qcacmn: utils: Replace instances of unadorned %p
Replace instances of unadorned %p in utils.

Change-Id: Idd12720d45238adad17ffafa6dfb50041022cbe2
CRs-Fixed: 2111274
2017-10-03 23:41:28 -07:00
Dustin Brown
49a8f6e37e qcacmn: Prepend kernel includes with "kernel/"
To avoid include conflicts, prepend all kernel includes with "kernel/"

Change-Id: I1c3ae9078d5537b03486afff9c2491881c9f694c
CRs-Fixed: 2098814
2017-09-15 12:22:51 -07:00
Jeff Johnson
23f532b887 qcacmn: Remove reference to obsolete vos_ctx
wlan_logging_sock_svc has a reference to the vos_ctx. Since this is
obsolete, remove the reference.

Change-Id: I1256aa8a1220859911eceec8048a57856e64299a
CRs-Fixed: 2102456
2017-09-07 18:08:25 -07:00
Jeff Johnson
fa099795fa qcacmn: Replace hdd_adapter_t in wlan_logging_sock_svc
The Linux Coding Style enumerates a few special cases where typedefs
are useful, but stresses "NEVER EVER use a typedef unless you can
clearly match one of those rules." The hdd_adapter_t typedef does not
meet any of those criteria, so replace references to it with a
reference to the underlying struct.

Change-Id: Ia5177a671f3657a23e88ec1a47c6ed0ac569934a
CRs-Fixed: 2100985
2017-09-07 18:08:21 -07:00
Jeff Johnson
0960ae344a qcacmn: Replace hdd_context_t in wlan_logging_sock_svc
The Linux Coding Style enumerates a few special cases where typedefs
are useful, but stresses "NEVER EVER use a typedef unless you can
clearly match one of those rules." The hdd_context_t typedef does not
meet any of those criteria, so replace references to it with a
reference to the underlying struct.

Change-Id: I3dfe59ac92a374639faa6774a6538c5d970d3f1d
CRs-Fixed: 2100797
2017-09-07 18:08:18 -07:00
Dustin Brown
9a489c42be qcacmn: Statically allocate wlan logging buffer
To aid in debugging memory leaks, and improve the robustness of log
recovery from crash dumps, statically allocate pglog_msg in the global
scope. This allows logs to be inspected even in cases where a crash
came late in the unload process. It also improves log recovery
robustness by removing the possibility of using a NULL pointer offset
under certain memory corruptions scenarios.

Change-Id: I077198e358570661c2f3adf2704f2c48f4b2f6f8
CRs-Fixed: 2078548
2017-09-02 00:17:40 -07:00
Dustin Brown
c50a659932 qcacmn: Update calls to cds_trigger_recovery
cds_trigger_recovery no longer takes any arguments. Update calls to
cds_trigger_recovery accordingly.

Change-Id: I2d2f36c73baa2133496559bd8213aec8091e51b5
CRs-Fixed: 2073933
2017-08-28 14:47:01 -07:00
Agrawal Ashish
42a1dc0596 qcacmn: Trigger copy of pktlogs to SD Card on basis of ring ID
For fatal events , driver sends EVENT_WLAN_LOG_COMPLETE
to userspace. But there can be multiple events for each
ring id like connectivity, driver , frimware, wakelock etc.
Cnss diag has to trigger copy of pkt log to /sdcard only for
one bug report, so send ring id in log complete event so
that it can trigger copy for driver ring id.

Change-Id: I3b06bed52509e58ac4d79698c95ba5eb1baa3bb3
CRs-Fixed: 2053770
2017-08-10 06:12:51 -07:00