Commit Graph

90 Commits

Author SHA1 Message Date
Alok Kumar
337c5c6ada qcacmn: Fix buffer overflow in fill_ieee80211_hdr_data
Currently variable pl_msdu_info->num_msdu is from message, and
is used directly as array size. This may cause buffer overflow.

To address this issue add qdf_assert check.

Change-Id: Ice78633314b321243136ce4987c633e1201d3cb8
CRs-Fixed: 2187441
2018-02-15 07:42:04 -08:00
Orhan K AKYILDIZ
dfdbf5f846 qcacmn: Fix security concern with %p
%p is considered a security hole. Fix an instance of such a hole
introduced recently.

Change-Id: Iaaa8d94de3077f987605058d417b472966ad9931
CRs-Fixed: 2180521
2018-02-12 15:44:58 -08:00
Sandeep Puligilla
cd793f38a3 qcacmn: Configure spectral module for Gen2
-Initialize the default Configuration as
gen2 for spectral module on MCL.
-Add support to general netlink socket.

Change-Id: Iab06f66d18c4791f0ff5483781634df2a7268ddb
CRs-Fixed: 2183870
2018-02-09 09:21:02 -08:00
Ashish Kumar Dhanotiya
d36a315227 qcacmn: Add mutex lock for proc handlers
It will have race condition issue when multiple
threads access some fields of global shared
variable ctl concurrently.

Fix is to add mutex lock for proc handlers.

Change-Id: Ifba428ae6544ccbdae0547a63972ab241ae68d7c
CRs-Fixed: 2185522
2018-02-09 01:51:27 -08:00
Srinivas Pitla
f6b4bc8f02 qcacmn: Use new APIs to get dp handles
SON and DP modules use new APIs to get dp handles,

Change-Id: I1639b946f1660fcaa21b76688909451dcc0f94cc
CRs-Fixed: 2177109
2018-02-03 15:11:10 -08:00
yeshwanth sriram guntuka
ffd0a2fa8a qcacmn: Add config support for BTM offload
Add ini to configure BTM offload configuration
which is sent to firmware as part of RSO start
via wmi btm config cmd.

Change-Id: I69c792705b208014af8f1878f7645d957dde6c06
CRs-Fixed: 2105112
2018-01-15 17:46:19 -08:00
Amar Singhal
479698e1d7 qcacmn: Add NULL ptr and data initialization checks in pktlog
Add checks for NULL ptr. Also initialize data properly.

Change-Id: Ib6db409f038421c5a0c9033bea7948f9cd6376dd
CRs-Fixed: 2160752
2018-01-11 13:45:15 -08:00
psimha
9aec0b53dc qcacmn: Add NULL checks before accessing pldev
Add NULL checks before accessing pldev object in the pktlog module.

Change-Id: I7139480c028a54fab9d73d5b68494cc42ef6d427
CRs-Fixed: 2158642
2017-12-18 21:48:42 -08:00
Venkata Sharath Chandra Manchala
09adf5336c qcacmn: Enable Packetlog
Enable Packetlog for Lithium Based chipsets by:
Replacing ol_txrx calls with equivalent cdp calls

Change-Id: Ibf4431daca23c23c9e1c1a5e1ebb2579079e4969
CRs-Fixed: 2117063
2017-12-09 23:27:27 -08:00
Poddar, Siddarth
7055c33bdb qcacmn: Fix potential buffer overflow in process_tx_info
Check for buffer overflow for pktlog messages in process_tx_info
function before doing mem copy.

Change-Id: I5d34bfdecb4fd9dad1741da2256873ef3e9e708c
CRs-Fixed: 2154974
2017-12-09 15:44:41 -08:00
Ashish Kumar Dhanotiya
33608d1e94 qcacmn: Add a wakelock reason for monitor mode
Add a wakelock reason for device entering monitor
mode.

Change-Id: I27ba2d43fd7b84bc1ae7e6046ab635065872b2d2
CRs-Fixed: 2150162
2017-12-07 22:34:07 -08:00
Mukul Sharma
396cef7bcf qcacmn: Converge on wmi event registration / unregistration
Converge on wmi event registration / unregistration method.

Change-Id: If03a38d74a47cc1d900bc5734a7c8f950513efaa
CRs-Fixed: 2148479
2017-11-30 03:40:33 -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
Yun Park
a5685dec52 qcacmn: Use epping_tx_complete instead of epping_tx_complete_multiple
modify epping_tx_complete_multiple to accept single packets.
Currenly htc invokes the callback on individual packets.

Change-Id: I9df269ba4c714ccd05c2dea89b0acc94ce895492
CRs-Fixed: 2131348
2017-11-09 23:43:00 -08:00
Jeff Johnson
a4262320ce qcacmn: Use enum QDF_OPMODE
Change "qcacmn: Rename enum tQDF_ADAPTER_MODE" (qca-wifi-host-cmn
Change-Id I20f1b6d1a0ab4b8fe6a85cefdff96a49e2f4652c) renamed enum
tQDF_ADAPTER_MODE to QDF_OPMODE. Update all references to use the
new name.

Change-Id: Ic6f663dac11a100f168b2626c7c0fbcaccbfca4f
CRs-Fixed: 2141061
2017-11-09 23:42:58 -08:00
Manjunathappa Prakash
449a2a0425 qcacmn: Separate TcpDelAck and TcpAdvWinScale
Separate tcp-delayed-ack and tcp-advanced-window-scaling triggers
so that these system parameters can be set separately.

Change-Id: If2f869243152e698409e8a38459f5fabe44f35cb
CRs-Fixed: 2133069
2017-10-31 17:39:11 -07: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
Amar Singhal
287c86433e qcacmn: Check for buffer overflow for diag messages
Check for buffer overflow from diag messages.

Change-Id: I5ff85b24b0e26393343dc4cc4c41a9f84e6ba8e9
CRs-Fixed: 2129586
2017-10-31 17:39:04 -07:00
Poddar, Siddarth
9f7b297a38 qcacmn: Remove code related to mmap functionality for pktlog
Remove the code related to mmap functionality for pktlog
as it is no longer used/required.

Change-Id: Ib031148985055201810a7c32347c2e6efea57f35
CRs-Fixed: 2133878
2017-10-30 07:38:07 -07:00
Poddar, Siddarth
658455b413 qcacmn: Restrict max/min pktlog buffer size using pktlogconf tool
Restrict the pktlog buffer size to a minimum of 1MB and maximum
of 16MB using pktlogconf tool or through sysctl command.

Change-Id: I1c67ed724c512f57c5d6e555be14b0b0e23d203f
CRs-Fixed: 2133723
2017-10-30 03:25:50 -07:00
Amar Singhal
009d7f1ab2 qcacmn: Add size checks in diag_fw_handler
Correct the invalid type conversions in diag_fw_handler.

Change-Id: I930c8602c0f98d19b7276987cbb4d42e4757e267
CRs-Fixed: 2129581
2017-10-28 19:36:37 -07:00
Manjunathappa Prakash
c1e703a4cb qcacmn: Set CPU floor freq on high throughput
On high throughput mode, send a message to perfd, through
cnss-daemon, to set the min freq for perf cluster to 700 KHz,
and release it on transition to low throughput.

Goes with corresponding changes on cnss-daemon (1834087).

Change-Id: I9c5c701fa33992e44fc3bad5e58599da0b45cbd7
CRs-Fixed: 2133069
2017-10-27 01:57:54 -07:00
Orhan K AKYILDIZ
6bd48f118a qcacmn: Add sanity check for pktlog msgs
Add sanity check for pktlog messages, as we have seen a single case
of inconsisten nbuf. Assert if fails.

Change-Id: I6a076c4dfaa2ff8e1972dd795cadeca1302b2c0e
CRs-Fixed: 2131952
2017-10-26 17:47:30 -07:00
Manjunathappa Prakash
2620760503 qcacmn: Add protection for pkt_log ops with module stop
Packet log ops are protected against load-unload and SSR, but not
against module stop. Take care to add check for module stop.
Also takecare to NULLing of wdi_event_list and NULL check before accessing.

Change-Id: I20d49ff587719fc14f60a53e86092383de6ef5b8
CRs-Fixed: 2131044
2017-10-25 13:41:05 -07:00
Manjunathappa Prakash
fe0b0d43c2 qcacmn: SSR protect the pktlog_fops functions
Protect pktlog_fops callback function from sub system restart.

Change-Id: Iaaa50f609a96058e5f1a669f88c97e4a97193562
CRs-Fixed: 2131028
2017-10-23 20:23:50 -07:00
Manjunathappa Prakash
136dd82676 qcacmn: Compilation fix, replace VOS by QDF macro
Change VOS_TRACE_LEVEL_ERROR to QDF_TRACE_LEVEL_ERROR.

Change-Id: I75575860e3ceea615740c34fc21db75082f10dfd
CRs-Fixed: 2121017
2017-10-20 18:59:58 -07:00
Hanumanth Reddy Pothula
73112fd8aa qcacmn: utils: Validate packet length, before processing PTT commands
There is a possibility of buffer overread while processing PTT
commands, because of packet length check is missing.

While processing PTT commands, validate packet length to make sure
there is no buffer overread.

Change-Id: I65b2839b0812fc8b2421e4d73e14a05620411c53
CRs-Fixed: 2121017
2017-10-20 10:06:18 -07:00
Mahesh Kumar Kalikot Veetil
7df92bada9 qcacmn: Fix compilation issue in wlan_ptt_sock_svc.c
Fix a compilation issue introduced by the change
"Change-Id: I3bb7170c971f66178efe5cda837337a2e362f822".

Change-Id: Icfb204a5c6b0f5e471583df1c7b84441a6ee546a
CRs-Fixed: 2126606
2017-10-14 19:40:02 -07:00
Yeshwanth Sriram Guntuka
ca2862d351 qcacmn: Add host diag events for wow stats
Propagation from qcacld-2.0 to qcacld-3.0

Add diag event for wow packet counters stats.
The event EVENT_WLAN_POWERSAVE_WOW_STATS will be used to
inform the wow stats packet counters.

Change-Id: I9d1760aa6b790544b9879e7ef18d4f5359e0e245
CRs-Fixed: 1087714
2017-10-12 14:22:14 -07:00
Ajit Vaishya
2636384f2c qcacmn: Fix kernel check patch warnings in fwlog
Fix msm-4.4 kernel check patch warnings for fwlog module.

Change-Id: I84656de36b4b32d4e139021174ad8220cd6d845e
CRs-Fixed: 2041367
2017-10-12 14:22:09 -07:00
Ajit Vaishya
8dc86d6e54 qcacmn: Fix kernel check patch warnings in PTT
Fix msm-4.4 kernel check patch warnings for PTT module.

Change-Id: I3bb7170c971f66178efe5cda837337a2e362f822
CRs-Fixed: 2041367
2017-10-12 14:22:07 -07:00
Mahesh Kumar Kalikot Veetil
3b236ec96b qcacmn: Fix compilation issue in ptt_cmd_handler()
The feature CNSS_GENL is enabling compilation of some part of the
code. This feature depends on CONFIG_CNSS_GENL. Fix some of the basic
compilation issues.

Change-Id: I5cd3645cd8a10367abcfe89abda8de16548385b7
CRs-Fixed: 2123538
2017-10-12 14:21:58 -07:00
Poddar, Siddarth
5c57a8905e qcacmn: Add register/deregister data stall detect cb api
Add register and deregister data stall detect callback apis.

Change-Id: I59d5871b7ec03da4b4f69d87b14f7eb5e8606c4a
CRs-Fixed: 2090654
2017-10-06 12:27:19 -07:00
Srinivas Dasari
6d2ffaa980 qcacmn: Increase cld80211 family nlmsg size to 8K bytes
Current cld80211 nl message size depends on PAGE_SIZE. PAGE_SIZE
can be 4K and thus it's limiting the maximum nl message size to
4K bytes. Make the max supported nl message size to 8K bytes
irrespective of PAGE_SIZE.

Change-Id: I58fe8f85a5c9a0476fc5df75d0caa342cc261967
CRs-Fixed: 2053305
2017-10-06 10:25:13 -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
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