Commit Graph

805 Commits

Author SHA1 Message Date
Sravan Kumar Kairam
4af5290d97 qcacmn: Add QDF abstraction for IPA enums
Add QDF abstraction for Linux kernel IPA driver enums.

Change-Id: I9b61917768a109d12aefdc19a7822287337c9c18
CRs-Fixed: 2194166
2018-03-14 22:34:15 -07:00
jinweic chen
c3546321b6 qcacmn: add nbuf map result check when replenish
add the nbuf map result checking when replenish rx
nbuf to monitor status ring, this could avoid the
case nbuf map failed and invalid dma address
posted to HW or do unmap for unmapped nbuf.

Change-Id: I45cfc015f71a2d7295f7fcb4803bd6e68e2752d4
CRs-Fixed: 2182546
2018-03-13 06:00:59 -07:00
Rajeev Kumar
e7abced1a1 qcacmn: Register fw down legacy callback with QDF
Register fw down legacy callback with QDF such that new UMAC
components can call QDF API to check if fw is down or not.

Change-Id: I8d68cb7625fd75aa90ba09adfe13955c5418b54f
CRs-Fixed: 2202605
2018-03-12 15:06:24 -07:00
Srinivas Pitla
ceae543cff qcacmn: Change object manager trace level to ERROR
Change object manager trace level to ERROR, move few
debug prints to obj_mgr_warn

Change-Id: Idc8943badb524c52694df18b035c9fc91c097e3a
CRs-Fixed: 2195292
2018-03-09 16:31:11 -08:00
Subrat Mishra
2a06b23e82 qcacmn: Change ATF default trace level
Change ATF module default trace level from NONE to ERROR

Change-Id: I7dc47968db72329ffc99f466f0db51110ac02d64
CRs-Fixed: 2201834
2018-03-09 09:35:50 -08:00
Dustin Brown
1723d45ad2 qcacmn: Don't inline QDF_DEBUG_PANIC for debug builds
Calling panic can cause a compiler to assume any subsequent code is
unreachable. Because these panics may or may not be enabled by the
build configuration, this can cause developers some pain. Consider:

	bool bit;

	if (ptr)
		bit = ptr->returns_bool();
	else
		panic();

	// do stuff with @bit

	return bit;

In this case, @bit is potentially uninitialized when we return!
However, the compiler can correctly assume this case is impossible when
PANIC_ON_BUG is enabled. Because developers typically enable this
feature, the "maybe uninitialized" warning will not be emitted, and the
issue remains uncaught until someone tries to make a build without
PANIC_ON_BUG.

A simple workaround, is to put the definition of QDF_DEBUG_PANIC in
another compilation unit, which prevents the compiler from assuming
subsequent code is unreachable. For CONFIG_SLUB_DEBUG, do this to
catch issues earlier. Otherwise, use the typical inlined approach.

Change-Id: I8901fd33781ccb8229fad16343a5b08d97cdcf68
CRs-Fixed: 2202527
2018-03-09 00:10:40 -08:00
Sravan Kumar Kairam
03e69b3098 qcacmn: Translate QDF pending status to Linux error
Translate QDF pending status to Linux error in progress
code.

Change-Id: I3a8d9d17cb4b72cdfbb6d1f1c5adecd1679fe816
CRs-Fixed: 2200900
2018-03-07 16:28:02 -08:00
Poddar, Siddarth
a9172bf24d qcacmn: Add APIs to get data packets info
Add APIs to get TCP syn/syn-ack/ack packets,
TCP src/dst port, DNS domain name/query/response,
ICMPv4 req/res, and ICMPv4 src/tgt ip information.

Change-Id: I1e4e92997a33e64fe2e4ae28a05b54b6ba5e8cff
CRs-Fixed: 2168412
2018-03-07 03:55:46 -08:00
Rajeev Kumar
83953b769c qcacmn: Change return type of fw down callback from void to bool
Change the signature of QDF FW down callback API to return bool
instead of void. Return type true indicates fw is down and return
type false indicates fw is not down.

Change-Id: I2be6f14e5fbdb7b24ccd604244e1314a8f127291
CRs-Fixed: 2196217
2018-03-06 20:10:14 -08:00
sumedh baikady
b882f93dbc qcacmn: Fix channel info in radiotap
Fix frequency and channel flags fields in radiotap API

Change-Id: Ic991ea796d0b19f8adc16a5bc33cfde0042c167e
CRs-fixed: 2189914
2018-03-03 23:44:46 -08:00
Dustin Brown
f16867f4c2 qcacmn: Remove qdf_str include from qdf_mem
In order to migrate existing qdf_str_* APIs to qdf_str.h from
qdf_mem.h, qdf_mem.h included qdf_str.h. Now that consumers are
including qdf_str.h directly, remove this include.

Change-Id: I6b0ee3a4a2ad17db922b8e19087c1d730ad9b419
CRs-Fixed: 2196132
2018-03-02 16:34:32 -08:00
Dustin Brown
2cd4bfb104 qcacmn: Include qdf_str.h
The qdf_str APIs have recently been moved from qdf_mem. Reference the
new qdf_str.h header file where appropriate.

Change-Id: If97c9c37a7d720a7b93e50ec228da67a8e980c2e
CRs-Fixed: 2196129
2018-03-01 11:39:20 -08:00
gaurank kathpalia
1435fba5e0 qcacmn: Add qdf time api to get time of the day in millisec
qcacld-2.0 to qcacmn propagation

Adds qdf time api to get time of the day in millisec

Also send host timestamp to firmware, so that firmware can print the
logs timestamp in sync with host via the wmi interface,with
api wmi_send_time_stamp_sync_cmd_tlv()

Change-Id: Id6acfc5227fdca2fbf8d266998fdfc4046adc5f4
CRs-Fixed: 2193978
2018-02-28 23:35:53 -08:00
Dustin Brown
013ae979a6 qcacmn: Use size_t for qdf_str_len() return type
A recent commit changed the return type for qdf_str_len() to size_t from
int32_t. Update call sites for qdf_str_len() to store the return value
as size_t to match.

Change-Id: Ib8bfad2c1fc7de1f6fc601d1be69e734d3a49dcf
CRs-Fixed: 2196858
2018-02-28 13:22:36 -08:00
Dustin Brown
d5ff73ebc7 qcacmn: Move existing qdf_str APIs to qdf_str
A set of files for string abstractions has recently been added to QDF.
Move any existing qdf_str_* APIs from qdf_mem to qdf_str.

Change-Id: I6e1e5d1edcdfae2af83a6497ebd872fba981cdec
CRs-Fixed: 2196098
2018-02-28 11:55:20 -08:00
Mohit Khanna
68c9a549cb qcacmn: Fix RSSI info in radiotap header
Currently, RSSI in radiotap header is being sourced from
RX_MSDU_START TLV. RSSI information is missing in the TLV.

Source RSSI from PHYRX_RSSI_LEGACY TLV (rssi_comb).

Change-Id: I8030d970ff300a957e5215157e5f6a3599e4b430
CRs-Fixed: 2190210
2018-02-28 04:17:16 -08:00
nobelj
9ab76e283f qcacmn: Add support for ppdu length in ppdu_stats
Rx PPDU length is calculated from number of MSDU length in each MPDU
Rx PPDU stats are populated after updating PPDU length.

Change-Id: I2af6a82eaddc4e791d4e7445c933a5886304e8f3
2018-02-27 21:17:19 -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
Dustin Brown
d1f73fa8ef qcacmn: Add const to qdf_*_parse function parameters
Add const to the 'char *' parameters of the qdf_*_parse family
of functions.

Change-Id: Ia106da9b9832bfe08a594a43926d68b4aa840f1f
CRs-Fixed: 2194529
2018-02-27 01:57:44 -08:00
Dustin Brown
26e61b5928 qcacmn: Fix inappropriate use of qdf_str_lcopy()
A call into qdf_str_lcopy() is passing qdf_str_len(src) as the
destination buffer size parameter. Instead, pass the actual size
of the destination buffer.

Change-Id: I62ff473d9d45cfa53c5fc3df27743690586381c0
CRs-Fixed: 2196114
2018-02-26 21:44:52 -08:00
Dustin Brown
b067d27d61 qcacmn: Add context parameter to qdf_ini_parse()
In order to avoid global state, add a context parameter to
qdf_ini_parse. This parameter will get passed back to consumers via
the existing callbacks.

Change-Id: Icd74a58815701b4603924838bb84c7956058da6b
CRs-Fixed: 2194517
2018-02-26 15:57:53 -08:00
Rajeev Kumar
8b221806ac qcacmn: Create new QDF file qdf_util.c
Create new QDF source file qdf_util.c to keep FW down
APIs inside it.

Change-Id: Ic2a91cf8924d08307b3307d5f214663247125582
CRs-Fixed: 2195157
2018-02-26 12:08:39 -08:00
Sravan Kumar Kairam
68a824774c qcacmn: Add qdf utility functions for ARP debug stats
Implement QDF utility functions to operate on ARP data packet to
support ARP debug stats feature.

Change-Id: Idce70799bd3698dc8a8ecd8cfc8ef7d9bf1f5764
CRs-Fixed: 2019789
2018-02-26 04:07:21 -08:00
Kabilan Kannan
14e527f66a qcacmn: Fix X86 driver load problem
X86 driver is failed to load due to DMA malloc size
limitations.
Increase the maximum DMA malloc size for X86
driver.

Change-Id: I5d3a0138a61751e924183b7175a0b565cffd4eb4
CRs-Fixed: 2188749
2018-02-23 20:01:19 -08:00
Dustin Brown
96ad17d131 qcacmn: Fix parse failure in qdf_bool_parse()
qdf_bool_parse() fails to advance the parsing cursor after consuming
valid characters. Advance the cursor after valid input in
qdf_bool_parse() to avoid failing to parse valid boolean expressions.

Change-Id: I904d5eed638e215e9821e140feb5286fffe37b7b
CRs-Fixed: 2194546
2018-02-23 17:45:56 -08:00
Dustin Brown
e50d168ba5 qcacmn: Add qdf_str_dup() API
Add a QDF abstraction for strdup().

Change-Id: I141e625a91e3433c2a66bc75b4e860ed6ef266ac
CRs-Fixed: 2194537
2018-02-23 17:45:52 -08:00
Dustin Brown
64740289bc qcacmn: Add qdf_str_eq() API
strcmp() is regularly used to compare two strings for equality. However,
reading source code using strcmp in this manner can be prone to errors
because the return values are not obvious from the function's name. In
the best case, this leads to referring to the strcmp documentation more
often than one would like. In the worst case, this leads to difficult to
spot bugs. Add a thin wrapper for this use case to make intentions
abundantly clear to future readers. This wrapper is effectively sugar
for 'strcmp(left, right) == 0'.

For example:
	if (!strcmp(left, right))
	/* reads: if not string compare: left, right */

Becomes:
	if (qdf_str_eq(left, right))
	/* reads: if string equal: left, right */

Change-Id: Iabcb7c7e9f37dcb6cf1bdf5d7cc6c69ea926ba5c
CRs-Fixed: 2194508
2018-02-23 15:33:20 -08:00
Dustin Brown
61cabef5b6 qcacmn: Update qdf_trace for CONFIG module
QDF_MODULE_ID_CONFIG was previously defined for use by the configuration
component, but qdf_trace was not updated. Set the default logging level
for the configuration module in qdf_trace.

Change-Id: I8946b5473f03f3b85f8c2d6783039e03c9a49494
CRs-Fixed: 2194542
2018-02-23 15:33:18 -08:00
Dustin Brown
47452e942b qcacmn: Add QDF_DEBUG_PANIC API
A very common pattern in the Wlan driver is to test for a fatal
condition, and then call QDF_BUG with some falsy value. Add a sugar
API for these cases, which effectively does 'QDF_BUG(false)'.
Additionally, include 'debug' in the name to remind consumers that
the panic will not occur on end user devices.

Current syntax:

	if (fatal_condition)
		QDF_BUG(false);

New syntax:

	if (fatal_condition)
		QDF_DEBUG_PANIC();

Change-Id: Ifa03e9109be5efdbd061ca32363d5719fb91da0f
CRs-Fixed: 2191582
2018-02-23 15:33:16 -08:00
Rajeev Kumar
28dba98f8b qcacmn: Define QDF API to register fw down callback
Define QDF API such that legacy module can register fw down
callback and new components can use QDF API to check if fw
is down or not.

Change-Id: I2f5423943f351ee3a0fd84616c904a27702c10e3
CRs-Fixed: 2194451
2018-02-23 00:37:05 -08:00
Sravan Kumar Kairam
8fb188fc9a qcacmn: Add qdf abstraction for byte order identifiers
Add qdf abstraction for Linux byte order type identifiers.

Change-Id: I4ff55ffcb92a86e7d067bcb78b404b8deb3ee0f0
CRs-Fixed: 2193638
2018-02-21 23:49:16 -08:00
Varun Reddy Yeturu
52c506d034 qcacmn: Add caller info to memory debug infrastructure
Currently, the detected memory leaks would not dump
the caller of the function which is leaking the memory.
Add an extra parameter to the table to store the caller
address and print the function during an assert.

Change-Id: I6dc31b55fd4e78dc69df9eb6166ebb63086891c1
CRs-Fixed: 2177486
2018-02-15 14:10:51 -08:00
Yun Park
1ba3ada3aa qcacmn: Add IPA WDI Unified API support
Support for WDI2 in the Unified IPA WDI APIs.

Change-Id: Ife42a6a96ce80070de51f994e29ded252b3dd980
CRs-Fixed: 2183501
2018-02-15 09:20:35 -08:00
Dustin Brown
89a217419e qcacmn: Perform minor cleanup of qdf_*_parse APIs
Perform the following cleanup items for qdf_*_parse() APIs:
 1) Many qdf_*_parse APIs use a custom left-trim function called
    qdf_skip_whitespace(). Recently, qdf_str_left_trim was added,
    so use this function instead.
 2) Remove 'const' from 'const char *' parameters. 'const' protects
    modification of the pointer, which is already duplicated for the
    function call. Since the qdf_*_parse() APIs modify the pointer
    parameter anyway, using const is incorrect (and should have failed
    compilation).
 3) Ensure the public qdf_*_parse APIs are properly exported.

Change-Id: I89725c68cc0d61a66fe95ef02fa2deda110411ac
CRs-Fixed: 2185978
2018-02-13 17:24:13 -08:00
Dustin Brown
6461e566f4 qcacmn: Add int/bool parse functions to QDF
Add the following function implementations to QDF:
 * qdf_bool_parse()
 * qdf_int32_parse()
 * qdf_uint32_parse()
 * qdf_int64_parse()
 * qdf_uint64_parse()

Change-Id: Ic31e3eb70f684799bd6e1e524cfc1cb816ddc01a
CRs-Fixed: 2185282
2018-02-13 13:14:47 -08:00
Varsha Mishra
7ea1800145 qcacmn: Export __qdf_nbuf_is_bcast_pkt
Use of qdf_nbuf_is_bcast_pkt function in qca-wifi is causing
unknown symbol __qdf_nbuf_is_bcast_pkt runtime error. This
does not let wifi driver to load.

CRs-Fixed: 2125569
Change-Id: If91685ae7d72c6fe52427648e9f01cba92fee86e
2018-02-13 07:34:18 -08:00
Dustin Brown
2d237dde74 qcacmn: Avoid stack trace when PANIC_ON_BUG is off
PANIC_ON_BUG controls whether QDF_BUG panics the system on a failed
assertion. This config flag should be disabled for all end user
production builds. However, when PANIC_ON_BUG is disabled, QDF_BUG will
still print the call stack that resulted in the failed assertion. This
call stack can leak sensitive kernel address information, and should not
be printed for end user production builds.

When PANIC_ON_BUG is disabled, avoid printing the current stack trace to
dmesg.

Change-Id: I8c83d3690c606f8ffa91cf931e45543ed6e6437a
CRs-Fixed: 2186096
2018-02-12 11:22:41 -08:00
Dustin Brown
677a261213 qcacmn: Add qdf_file and qdf_parse files to QDF
Add an QDF abstraction for reading a file. Also, add the first consumer,
qdf_ini_parse(), as well. This is pure parsing logic, which offloads the
actual content handling to the caller via callback functions.

Change-Id: Idfca74c5543a5b0da7ddd1bdc6e2ad2be59ed36b
CRs-Fixed: 2184463
2018-02-10 07:15:00 -08:00
Dustin Brown
a4fd883481 qcacmn: Add qdf_str files to QDF
Add files for QDF string APIs. Existing qdf_str_* APIs will be moved as
part of a future change.

Change-Id: If98d41380b2f7f62bbe5de141b6827e9427944ab
CRs-Fixed: 2184462
2018-02-10 07:14:57 -08:00
Kabilan Kannan
56800ad9a5 qcacmn: Add debug support for DMA memory allocations
Add debug support to detect memory leaks and corruption
in DMA memory operations.

Change-Id: I1478973828ddc147367c4a579c97c3840c106f44
CRs-Fixed: 2155603
2018-02-09 12:18:40 -08:00
Tallapragada Kalyan
32e74e669d qcacmn: Linearize nbuf in intra-bss forwaring case
with fragmented pkts re-injected back to REO destination
ring as frag_list, we need to linearize these nbufs while
handling intra-bss forwarding cases.

Change-Id: Id692974ac5d80f369fafae39aec32e2066dffb0b
2018-02-09 01:51:24 -08:00
Paul Zhang
ca6152167b qcacmn: Support 11d for non-offload platform
Support 11d for non-offload platform by maintaining
count of beacons encountered for each country code
and choosing country code with max votes as device's
country code.

Change-Id: I83b66e980854eded17e254386561fa32b1f8c4ac
CRs-Fixed: 2154048
2018-02-08 21:37:37 -08:00
Keyur Parekh
4d36b32991 qcacmn: Add Indication for MSDU or MPDU level aggregation
populate flags for MPDU or MSDU level aggregation in
mon_rx_status structure.

Change-Id: I5d8d026a42ffef9e95f579178b4f8cdc581699ec
2018-02-08 19:46:08 -08:00
Varsha Mishra
d385dbe43d qcacmn: Add QDF API to find packet type
Add qdf API to know whether packet is broadcast or not

CRs-Fixed: 2125569
Change-Id: If91685ae7b72c6ce52426648e9e01cba92fee86e
2018-02-08 14:13:14 -08:00
Chaithanya Garrepalli
221c795fea qcacmn: Add nbuf count support
Add a global nbuf count variable and add support to update
this count.

Change-Id: I08a50b54cae25ab9f356cd05d7635f1ba3b6bf55
CRs-Fixed: 2008240
2018-02-07 05:43:53 -08:00
Venkateswara Swamy Bandaru
58c8085e21 Revert "Revert "qcacmn: Mesh throughput enhancements""
This reverts commit I7421f3572c46ed27a2d96724b2bbbe40c0704e5f.

Change-Id: I8c44b0e893f81aadf7aa4404538776f27a579d76
CRs-Fixed: 2180219
2018-02-06 07:44:57 -08:00
Srinivas Pitla
c4bdc7a1df qcacmn: Add target_if changes to QDF
1) Remove redundant members
2) Change the target_if debug level to info

Change-Id: I49d5e3f2af61a87097145e9214d84882ffd439ee
CRs-Fixed: 2177109
2018-02-03 15:10:53 -08:00
Srinivas Pitla
1ddc439f46 qcacmn: Add wait_timeout API in qdf
Introduces QDF API for wait_queue_timeout() to allow
driver to use. This API helps to wait for the event for
configured time

Change-Id: I9640368120fd09b19f64f028f1eb3aab46b7c97a
CRs-Fixed: 2177109
2018-02-03 15:10:48 -08:00
Dustin Brown
57a7ff2f9b qcacmn: Remove QDF_MAC_ADDRESS_STR
QDF_MAC_ADDRESS_STR has been replaced by QDF_MAC_ADDR_STR. Remove
QDF_MAC_ADDRESS_STR.

Change-Id: I810d56ef62009375422a69b66d75b4d03ddaee0f
CRs-Fixed: 2176528
2018-02-02 09:31:03 -08:00
Manjunathappa Prakash
f9efb3d998 qcacmn: Check for TSO packet in release_skb
For TSO packets we get Tx completion for each segment,
whereas nbuf tracking code has only one entry. So remove
nbuf tracking record entry when nbuf->users is 1.

Change-Id: I7f66eb91d802c909ee0c9a0243be6415c82c211e
CRs-Fixed: 2179883
2018-02-02 05:45:49 -08:00