Commit Graph

206 Commits

Author SHA1 Message Date
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
Mukul Sharma
5427179120 qcacmn: Add IFACE_CHANGE_TIMER wake lock event
Add IFACE_CHANGE_TIMER wake lock event to track
apps power collapse is prevent due to change
interafce timer is running.

Change-Id: I6df238ec2092d3190d0ae52748427955f7c35a9e
CRs-fixed: 2105189
2017-10-03 09:34:07 -07:00
Jeff Johnson
6a7f21d9e6 qcacmn: Rename pAdapter in epping
The Linux Coding Style frowns upon mixed-case names and
so-called Hungarian notation, so rename pAdapter to align
with the Coding Style.

Change-Id: Iddd543a9e0fb61a92e0769abb234b93e44f603c2
CRs-Fixed: 2119798
2017-10-03 08:24:03 -07:00
Dustin Brown
a46d9c69f2 qcacmn: Fix compilation issue when CNSS_GENL is enabled
A recent change added a wrapper to nla_parse. When CNSS_GENL is enabled,
this new wrapper API is not defined in cnss_diag_cmd_handler, causing a
compilation failure. Include the appropriate header file when CNSS_GENL
is enabled.

Change-Id: I2e929b48e306fb1426eb6e59011cd821922bb8dd
CRs-Fixed: 2112767
2017-09-22 13:20:45 -07:00
Linux Build Service Account
e0ea1373cc Merge "qcacmn: add useful debug prints" 2017-09-21 11:28:38 -07:00
Linux Build Service Account
5b6fb9d48f Merge "qcacmn: Add ini param to control the crash inject" 2017-09-21 11:28:36 -07:00
Dustin Brown
4ff1c130d3 qcacmn: Remove vma from vm_operations_struct->fault handler
Linux kernel 4.10 removes the vm_area_struct parameter from the
vm_operations_struct->fault handler. Add conditional compilation to
provided the appropriate fault handler signature based on the version of
the Linux kernel being compiled against.

Change-Id: I467f4d8426ecfa55e4f2aac26a5326901239a752
CRs-Fixed: 2094824
2017-09-19 13:27:50 -07:00
Jeff Johnson
fcf0cc6593 qcacmn: Avoid NULL pointer dereference in nl_srv
Currently nl_srv_bcast() and nl_srv_ucast() allocate a temporary
buffer to hold the netlink message which is subsequently sent to
userspace. The value returned by qdf_mem_malloc() is not checked for
NULL, and hence if NULL is returned it will be dereferenced.
However in reality a temporary buffer is not required. Update the
functions to directly send the message from the skb.

Change-Id: Ia12e1695498323c4e29b8280b9265c20393a2fe7
CRs-Fixed: 2111674
2017-09-19 09:59:21 -07:00
Dustin Brown
1b57dba257 qcacmn: Add wrapper for nla_parse()
The Linux kernel version 4.12 introduced an API change to nla_parse().
Add conditional compilation to call nla_parse with the correct
parameters based on the version of the linux kernel being compiled
against.

Change-Id: Ie904d217a42a2396f8245251a9c90a15dac2c0c9
CRs-Fixed: 2093354
2017-09-15 15:26:31 -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
Dustin Brown
8f6788d071 qcacmn: Use vm_fault->address instead of virtual_address
Linux kernel 4.10 removed vm_fault->virtual_address in favor of simply
using vm_fault->address. Add conditional compilation to use the
appropriate vm_fault address field based on the version of the Linux
kernel being compiled against.

Change-Id: I3f29721888bf349a7ac4f5f62d576b668ee0abc2
CRs-Fixed: 2094806
2017-09-08 01:57:46 -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
Ashish Kumar Dhanotiya
edd0890445 qcacmn: Add ini param to control the crash inject
qcacld-2.0 to qcacld-3.0 propagation

Currently the crash can be injected by iwpriv command and FW
gets crashed.
Changes are done to add the gEnableCrashInject ini parameter

1) This ini param is disabled by default.
2) If this param is disabled the crash inject is ignored.

Change-Id: I082ca4101806033958b10869f151d6085ca7a2d6
CRs-Fixed: 2084606
2017-09-06 00:09:37 -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
Sandeep Puligilla
5c1cc50c22 qcacmn: Fix compilation errors
Fix compilation errors after updating
latest dbglog.h file from fw.

Change-Id: I3defd4242d922364849041b35bddb3cca4f9a39a
CRs-Fixed: 2066361
2017-08-11 19:38:18 -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
Zhu Jianmin
25ff719058 qcacmn: qcacld-3.0: Discard pktlog message for invalid msdu id
During HOST AP offload case fw is sending pktlog tx info
with invalid MSDU id. This will result in invalid de-reference
tx descriptor.
Discard pktlog msg for invalid msdu id to handle
the above scenario.

Change-Id: I772ab47d46b373ab0c4a8f7f7266697d4bccd703
CRs-Fixed: 2077611
2017-08-07 05:08:32 -07:00
Srinivas Girigowda
43fa6527d4 qcacmn: Enable FATAL/ERROR/WARN/INFO log levels to console
Enable FATAL/ERROR/WARN/INFO log levels to console.

Change-Id: I54ea83ded49fcb2f1e8e1c13973ee8035dc9ce5d
CRs-Fixed: 2017427
2017-08-03 19:48:38 -07:00
Srinivas Girigowda
ee8f5dbf4b qcacmn: Utils: Reduce the log spam in kmsg
Move the logs to appropriate log levels to reduce
the log spam in kmsg.

Change-Id: I27ca212113513b15f159aa26da67e03bd3a73a9a
CRs-Fixed: 2017427
2017-08-03 19:48:36 -07:00
wadesong
6211cb6b56 qcacmn: Fix build errors generated by gcc 6
Gcc 6 introduces some stricter checking for bool value
comparison, causing build errors when a certain code
block in CLD3.x driver is compiled.

Change-Id: I270e20dab8410f45e734c15d5365e30e314b55c8
CRs-Fixed: 2051383
2017-07-23 09:58:38 -07:00
Rajeev Kumar
e501f2c62f qcacmn: Create WMI debugfs only if WLAN_DEBUGFS is defined
WMI FW log debug FS is created irrespective of WLAN_DEBUGFS is defined
or not. Make sure to only create WMI log debugfs only if WLAN_DEBUGFS
is defined.

Change-Id: I8d7d5ef160ce2674b3f01dc7afa3ac4761538cab
CRs-Fixed: 2066664
2017-07-18 23:46:22 -07:00
Rajeev Kumar
607d7cef03 qcacmn: Log QDF trace error/fatal messages using pr_err
Currently QDF trace error/fatal log messages are logged using
pr_info and bydefault these logs do not show up on console.
Hence log QDF trace error/fatal log messages using pr_err
such that bydefault these logs show up in console.

Change-Id: I220e5eb93ea21d01b948c40432179f294530ba0d
CRs-Fixed: 2070065
2017-07-18 23:35:13 -07:00
Rakesh Pillai
13146458f9 qcacmn: Fix CLANG warnings in Data path
implicit conversion from enumeration type 'A_STATUS' to different enumeration type 'QDF_STATUS'
implicit conversion from enumeration type 'QDF_STATUS' to different enumeration type 'A_STATUS'

CRs-Fixed: 2063344
Change-Id: Id3613d0b7fca58c3d94c5af59838b0bff3ef26de
2017-06-30 22:50:37 -07:00
Sandeep Puligilla
5c41638e14 qcacmn: set logging thread priority to default
Currently logging thread priority is equal to cds
thread which can cause scheduling issues to other
priority tasks when there are too many wlan debug
messages.
Set logging thread priority to default value.

Change-Id: I578ac062a69a34f7f4b7a2450e59e3f934704934
CRs-Fixed: 2047462
2017-06-30 15:50:14 -07:00
Tushnim Bhattacharyya
3db6b3cc4e qcacmn: Avoid buffer overread when retrieving cnss diag cmd
In cnss_diag_cmd_handler(), add length check for the command attribute.
This prevents possibility of a buffer overread or underrun.
Also add audit comment to express the intent why policy table
is not used in this API.

Change-Id: I023bbf3789498f315fd1bff8db8ef8257abb2b04
CRs-Fixed: 2058580
2017-06-27 18:12:59 -07:00
hqu
8c27253b0b qcacmn: Fix cnss diag log capture issue
Presently if the module name is changed to something other than wlan,
then MULTI_IF_NAME is defined and cnss diag log can't be captured
because the driver doesn't register itself to cnss_logger module.
Add fix to resolve this issue.

Also add free skb buffer operation for one case to sync with qcacld-2.0.

Change-Id: I815c5260fbc248e37e1ec0417ed5a8cc476ca8b7
CRs-Fixed: 2029803
2017-06-27 18:12:56 -07:00
Nachiket Kukade
741073c18d qcacmn: Sanity check on the incoming PTT cmd
In ptt_cmd_handler(), validate that the command attribute is of
minimum allowed size. This prevents parsing of rogue command
format. Also add audit comment to express the intent why policy
table is not used while using nla_parse API.

Change-Id: Ia2da6c88245190aad9a00110059fd6dcfda8a9fa
CRs-Fixed: 2058353
2017-06-19 12:43:24 -07:00
Dustin Brown
a4e0fd63cc qcacmn: Add connect wakelock reason
Add a wakelock reason for wifi connect to wake_lock_reason.

Change-Id: I907b6e0aebeceee1172604b8142ba40f5fbcdcd9
CRs-Fixed: 2059884
2017-06-14 15:53:37 -07:00
Ashish Kumar Dhanotiya
a55792d148 qcacmn: Race condition while using pkt log buffer
There can be a race condition if the pktlog_buf inside pktlog APIs,
is accessed simultanously from two threads.
To prevent this use mutex in the caller functions of pktlog APIs.

Change-Id: Iea6e3cd28a7a347c1753fe71d0646fb43ee184fa
CRs-Fixed: 2047150
2017-06-05 05:29:56 -07:00
Yu Wang
7250c75146 qcacmn: fix compile error in APPs when include wlan_nlink_common.h
wlan_nlink_common.h include linux/if.h, and linux/if.h
refers to 'struct sockaddr' which is defined in
linux/socket.h, and so it include linux/socket.h;
however, in userspace, linux/socket.h doesn't define
'sockaddr', so it will cause errors when compiling
userspace APP if it includs wlan_nlink_common.h.

Add macro __KERNEL__ to determine which header file
should be included:
For userspace, include net/if.h, it will include
sys/socket.h, which is for userspace;
for kernel space, include linux/if.h.

Change-Id: I3a2d8e6edb42871aa3599ef30fbb5d0d275764df
CRs-Fixed: 2054409
2017-05-31 23:37:58 -07:00
Yuanyuan Liu
da525ac7a3 qcacmn: send channel info to cnss daemon
Update wlan nlink message header file with channel info.
These info will be sent to cnss daemon and daemon will
pass it to LOWI client.

CRs-Fixed: 2006217
Change-Id: I125a519e188774bb099058ad5c385787800e5411
2017-05-26 07:50:50 -07:00
Adil Saeed Musthafa
5a0a7073fd qcacmn: Limiting a function declaration within CONFIG_MCL
Function dbglog_set_log_lvl needs to be commented out for WIN compilation
since enum DBG_LOG_LVL is not converged. Functions nl_srv_bcast and
nl_srv_is_initialized needs to be exported out for pushing FW Diag Log
events to user-space (cnss-diag)

CRs-Fixed: 2048651
Change-Id: I57a4bd3d78680b97bd75191ca58349abeb77240a
2017-05-22 09:39:52 -07:00
Manikandan Mohan
50ec704606 qcacmn: Update for check patch fixes
Fix for compilation errors after check patch fixes

Change-Id: Ib530d8d860440754f526ac93f5b12dbeab45b8aa
CRs-fixed: 2033001
2017-05-02 13:29:33 -07:00
Govind Singh
e3331b5b3c qcacmn: Remove ol_defines dependency from WMI layer
ol_defines header inclusion is invalid in WMI layer.
Remove the header inclusion by abstracting the dependency
with in WMI layer.

Change-Id: I5eb8624605cde20b516a1d8d0c823996c363e119
CRs-Fixed: 2023821
2017-04-28 07:42:08 -07:00
Ashish Kumar Dhanotiya
485d594ea1 qcacmn: Race condition while using pkt log buffer
There can be a race condition if two different threads use the
pkt log buffer at the same time. This issue can lead to Use-After-Free
of the packet log buffer.

To address this issue, protect the pktlog buffer access using spinlock.

Change-Id: I75d9375c9d85ac26dab1c06658d3f0fdbeb62935
CRs-Fixed: 2034486
2017-04-21 00:25:09 -07:00
Poddar, Siddarth
6bb2c1755f qcacmn: Return the error value if pktlog is not enabled
When pktlog enable gives an error as part of pktlog_release,
then return the error value.

Change-Id: I88289226d3dc933a46d6dba0cd6ee0b6d2abb2d5
CRs-Fixed: 2031287
2017-04-17 04:47:57 -07:00
Poddar, Siddarth
3a52bd7e6a qcacmn: Add support to collect pktlogs as part of bugreport
Add infrastructure in pktlog utils to collect pktlogs as part
of bug report generation. As part of this when pktlog read command
is received on host:
1. disable pktlog,
2. read pktlog,
3. clear pktlog buffer,and
4. Retain pktlog initial state

Change-Id: I67e2231c2897007b58fa42a4f931b3c35ad1f418
CRs-Fixed: 2031287
2017-04-17 04:47:56 -07:00
Selvaraj, Sridhar
e440caa3b3 qcacmn: Remove Logger socket app msg init/deinit changes
Now all host and firmware logs are sent to multicast group id's
and are not sent to particular process on userspace.

Change-Id: I6fc9540de1313d6a2ad3564090e5fed281f54a62
CRs-Fixed: 2024754
2017-04-13 10:32:09 +05:30
Poddar, Siddarth
5503c76aca qcacmn: Add iwpriv pktlog command to clear pktlog buffer
Implement iwpriv pktlog command to clear pktlog buffer.
This command is effective only if pktlog disable is issued previously.
This command needs one argument.
Command to use this feature : iwpriv wlan0 pktlog 4

Change-Id: I431169a10828b6cfcd21c7d8065f325c5eb8cbba
CRs-Fixed: 2031212
2017-04-12 01:14:08 -07:00
Srinivas Girigowda
17720241d4 qcacmn: Replace wlanLoggingFEToConsole to wlanLoggingToConsole
Currently the config ini "wlanLoggingFEToConsole" specifically talks
about enabling the logs to kmsg for FATAL and ERROR logs.

This cfg.ini item should not be specific to any log level, instead
it should just depict whether logging to console should be enabled
or not.  Hence change wlanLoggingFEToConsole to wlanLoggingToConsole.

Change-Id: I54e340ed58891175b53ac2d0137d15a2baea1c9f
CRs-Fixed: 2017427
2017-04-11 11:04:27 -07:00
Adil Saeed Musthafa
e3599a90e3 qcacmn: Remove all non-QDF directories from include paths
CRs-Fixed: 2026943
Change-Id: I6fa1ba02552b0c1d10c891471e072f9b235e6de8
2017-04-11 11:04:20 -07:00
Poddar, Siddarth
e0a0247ead qcacmn: Reduce the log spam in kmsg
Move the logs to appropriate log levels to avoid excessive
logging in kmsg. Also log the error reason and line number.

Change-Id: I08ed38861ff0b3d50861b957de34b1c62bc45afb
CRs-Fixed: 2024378
2017-04-03 13:47:20 -07:00
Tushnim Bhattacharyya
bb105f90d1 qcacmn: Include correct header file in epping module for policy manager
Include the correct header file in epping module for policy manager as
part of policy manager restructuring.

Change-Id: I115e1473fade0da0c6fc2c2ce9eda061c83dfe66
CRs-Fixed: 2009818
2017-03-30 16:26:15 -07:00
Rajeev Kumar
a85d8b4ad7 qcacmn: Fix SKB double free issue in nl_srv_ucast
If netlink_unicast() fails it already frees SKB buffer hence
do not double free the SKB when netlink_unicast() returns failure.

Change-Id: I2aa99c47f99c573abbd281c06ff58fcb38aad76b
CRs-Fixed: 2022800
2017-03-29 19:18:40 -07:00
Adil Saeed Musthafa
3318807269 qcacmn: Add shared print_ctrl_obj for qdf_trace_msg
At this point lot of Win code already uses QDF_TRACE macro. It will be
difficult to translate QDF_TRACE to qdf_trace_msg unless all the modules
(already using QDF_TRACE) make changes to use the qdf_print_ctrl
framework. Until that happens, we can have a shared object temporarily
so that wlan_log_to_user and hence user space logging of messages can be
in place

Change-Id: Ia149b86de8c2c36ed1c8508570b31db25f6bc41e
CRs-Fixed: 2018767
2017-03-28 13:50:42 -07:00
Naveen Rawat
e3e6f491d1 qcacmn: Add wrapper to call legacy userspace or GENL socket API
Add single wrapper API to send message over legacy userspace socket
or GENL socket.

Change-Id: I7cf46651d64467e77d85c147080d74a7470e42d6
CRs-Fixed: 2003488
2017-03-20 11:38:07 -07:00