Commit Graph

472 Commits

Author SHA1 Message Date
Dustin Brown
b7871f64ad qcacmn: Add qdf_status_from_os_return()
It is sometimes useful to reverse map an errno into a QDF_STATUS. For
this purpose, introduce qdf_status_from_os_return(), the logical inverse
operation of qdf_status_to_os_return().

Change-Id: I053f43867ef603c2654eca64fe76c7bd313e14e4
CRs-Fixed: 2242664
2018-05-18 00:00:33 -07:00
Wen Gong
a5dfb6d847 qcacmn: Add hdd memory dump feature flag
Add config flag to enable / disable hdd memory dump feature

CRs-Fixed: 2231694
Change-Id: I6b565bd7007223a51b67a2ea9fbafd6a737d22d9
2018-05-17 21:39:10 -07:00
Wu Gao
210778359a qcacmn: Add QDF API for ID allocation
In P2P ROC and MGMT tx cases, it use kernel address as cookie and
provides to userspace. Which has security risk. Add QDF API for ID
allocation and map ID to pointer, provides ID to userspace instead
of kernel address.

Change-Id: I4e10109988391474722df5b251fab11a87c7992b
CRs-Fixed: 2237756
2018-05-17 16:55:21 -07:00
Jeff Johnson
2d821eb0fe qcacmn: Fix typo "recieve"
Replace typo "recieve" with correct spelling "receive".

Change-Id: I7d88e57b97fa6d217630d4a5d5c365b56e714428
CRs-Fixed: 2238309
2018-05-17 00:47:23 -07:00
Prathyusha Guduri
9bb99acfca qcacmn: Add skb record rx queue to qdf API
Add skb_record_rx_queue() wrapper in qdf

Change-Id: Ic14e0a39d7d62bb404b443cc240b1ed0e5176119
2018-05-14 03:00:04 -07:00
Dustin Brown
03a7ac6e19 qcacmn: Add reduction limit to qdf_flex_mem
Add the ability to prevent qdf_flex_mem_pool from freeing memory
segments unless there are more than some minimum number in the pool
already.

Change-Id: I20bde2ed629b97924ea71b4f7f46a2c1fc1bab28
CRs-Fixed: 2229511
2018-05-11 13:23:00 -07:00
Kiran Venkatappa
bc1c547b8e qcacmn: Add timekeeping.h inclusion under correct kernel version
timekeeping.h is available from kernel version 3.17. Add header
inclusion and ktime_get_boot_ns call under correct version check flag.

Change-Id: I2a1a127e1716b52af56d14c39e2e646e34b05fa3
CRs-Fixed: 2230949
2018-05-07 01:29:30 -07:00
psimha
0e8a2c6558 qcacmn: Get NSS info from SS bitmap
Get NSS info from a the MIMO SS bitmap within msdu_start info

Change-Id: I794b093783b5f1ffc7faf335da84cbc07375d520
CRs-Fixed: 2215660
2018-05-04 20:43:12 -07:00
Yun Park
538a3a6e3d qcacmn: Remove ipa_reset_hdr from QDF
Remove unused IPA API ipa_reset_hdr form QDF.

Change-Id: I749e891b74b0adb45a5c3b9dbe7ad638d62c4459
CRs-Fixed: 2233616
2018-05-03 12:55:02 -07:00
Yun Park
bcffecb07e qcacmn: Add QDF abstraction for IPA_CLIENT_WLAN1_CONS
Add QDF abstraction for IPA_CLIENT_WLAN1_CONS.

Change-Id: I7b93432c5ce88d13ba9e52eb04e933238fe7c836
CRs-Fixed: 2220705
2018-05-02 14:29:22 -07:00
Naveen Rawat
34e15c4636 qcacmn: Add umac implementation of getting peer rssi
Add changes to support get peer rssi from within cp_stats
component.

Change-Id: I68c9c7e23dd14b515a71080b1b5fe3af15651ef9
CRs-Fixed: 2222777
2018-05-02 04:35:07 -07:00
Chaithanya Garrepalli
5142030dd9 qcacmn: add qdf API for skb_orphan
Add the qdf abstraction API for skb_orphan

Change-Id: I0fabb3fdd02e289d7bad97efebb2853e6827f458
CRs-Fixed: 2232427
2018-05-02 01:19:47 -07:00
Mohit Khanna
0425280d73 qcacmn: add DPTRACE Enhancements - Phase 2
Change data packets printing to one line
Add msdu-id to TX packets
Increase data packets size to include the complete IP packets
Indication/print when the throttling occurs

Change-Id: I07fc664ea08bc8746e31260599c5892701ae52e7
CRs-Fixed: 2157769
2018-05-01 21:37:34 -07:00
Rakshith Suresh Patkar
dcd073313e qcacmn: ADD APIs to set/dump dp trace buffer
Add APIs to dump dp trace buffer and set
proto bitmap, number of records and
verbosity of dp trace.

Change-Id: I23cda36515e1f3299d6c1c28dee2489a89bb15d9
CRs-Fixed: 2180984
2018-04-23 07:51:00 -07:00
Mohit Khanna
1fe9fd414a qcacmn: add HE radiotap flags for MU cases
HE field in radiotap header are not being updated for MU frames.
Add support for MU-MIMO and MU-OFDMA frames.

Change-Id: If33e9f9039c8df6e1bb8f591879d4defed184ac8
CRs-Fixed: 2191215
2018-04-20 12:09:02 -07:00
Rhythm Patwa
f6862a6527 qcacmn: Add HE MU and HE MU Other support
Populate HE-MU and HE-MU-Other fields in the radiotap header.

Change-Id: Iab9b9c47e076007b43b7abeb296ea15f0ec2a2cb
CRs-Fixed: 2191215
2018-04-20 12:09:00 -07:00
Dustin Brown
19911f3a06 qcacmn: Add qdf_flex_mem pool allocator
It often happens that the WLAN driver needs to allocate some pool of
structures to handle bursty operations. The traditional approach is to
statically allocate the maximum number of structures that we want to be
able to handle concurrently. This has the significant down side of
requiring manual tuning for every hardware combination for optimal
behavior, and wasting large amounts of memory during non-burst periods.

Add a new flexible, segmented memory allocator in QDF to help address
such scenarios. A small static buffer segment is used to service the
vast majority of operations, while additional segments are dynamically
allocated as needed to meet demand. Critically, these additional
segments are freed when not in use to reduce memory consumption. The
result is a self-tuning buffer that combines most of the benefits of
pure dynamic allocation with most of the benefits of pure static
allocation.

Change-Id: I5c27ecce72a450826494b5d13d6c9fdebda650a6
CRs-Fixed: 2224534
2018-04-19 14:15:19 -07:00
Yun Park
c60a22b88d qcacmn: Fix use after free of SKB in DP trace path
qdf_dp_trace could access nbuf already freed after sending to CE ring.
Move trace log before sending skb and add error log when fail to send.

Change-Id: I8ce36b9d196b7d44e0e9f7dcfe05db404a77e32f
CRs-Fixed: 2090277
2018-04-18 21:02:21 -07:00
Manjunathappa Prakash
2c3dba28d9 qcacmn: Fix qdf_tso_seg_dbg_bug to use qdf_print format string
Fix build issue with extra compile flags [-Werror,-Wformat-security]

Change-Id: Ia2d516f3ff35d8d3b48a337b24d74ff8f3d83363
CRs-Fixed: 2174715
2018-04-18 19:49:55 -07:00
Naveen Rawat
d24bebbf24 qcacmn: Add umac implementation of get_wake_lock stats
Add changes to support get wake lock stats from within cp_stats component.

Change-Id: I93855e4a1635afa97b4d5235ddb9cd92654f943d
CRs-Fixed: 2210309
2018-04-17 13:17:54 -07:00
Shaakir Mohamed
19f4f63c35 qcacmn: Fix AMPDU status info in radiotap header
AMPDU flag check is not present when radiotap header is updated.
This fix will check for rs_flags to check and set AMPDU present

Change-Id: I9e0a703a46459b1013af092f8cb8b7cd35f1a3ce
CRs-Fixed: 2204278
2018-04-16 16:57:05 -07:00
Orhan K AKYILDIZ
c6b4a7be50 qcacmn: Fix a race btw tx and tx-compl
While handling a multi-segment TSO packet, there is a race condition
where, if tx complete arrives fast enough, the un-sent TSO segments
may be lost forever and a previously sent segment would be attempted
to be sent over.

Fix the race condition. Dont use the entry after send to go to
next entry.

Change-Id: I023587a48bea6f3b58aac62e398cc15939bbb773
CRs-Fixed: 2174715
2018-04-14 07:37:57 -07:00
Dustin Brown
cb94e45a0e qcacmn: Add qdf_list static initializer macros
In order to use qdf_list in situations where static initialization is
preferable, add a number of macros for statically initializing the
qdf_list structures.

Change-Id: I9a1291d495e7940b57d8519da0e3d62a0dfd2064
CRs-Fixed: 2222980
2018-04-14 07:37:55 -07:00
Dustin Brown
3cb98124c1 qcacmn: Fix NBUF_MEMORY_DEBUG PERF build error
qdf_net_buf_debug_init/exit() are defined when NBUF_MEMORY_DEBUG is
disabled, but they are not declared in the nbuf header file, leading
to build errors for PERF builds. Make qdf_net_buf_debug_init/exit()
static inline stubs when NBUF_MEMORY_DEBUG is disabled.

Change-Id: I4180086f27873a48cb965abed21f4bca2a4ca3a1
CRs-Fixed: 2222969
2018-04-13 09:30:45 -07:00
Shiva Krishna Pittala
b155431361 qcacmn: Fix the limitations in enabling memory debug on WIN
Copy the file name to a QDF local array, rather than using
the pointer to file name, to avoid access to the invalid pointer.
Also, separate out SKB debug from memory debug.
SKB debug will be enabled once the SKB related false positives are fixed.

CRs-Fixed: 2216661
Change-Id: I0ada1acb84c24c961cf614c9c47261f272959874
2018-04-11 09:15:20 -07:00
Soumya Bhat
35fc699c0f qcacmn: Populate RX PPDU length
Add change to compute and populate RX ppdu length
from RX ampdu length.

Change-Id: I0e60764be1d3b0a0e69a8dc52cfb094a5df0f596
2018-04-11 09:15:12 -07:00
Naga
6d06baaa60 qcacmn: Add new component id for cp stats
Add support for new component cp stats module id,
component id, obj mgr ref id and default log level

CRs-Fixed: 2192386
Change-Id: Ibb523f3756ad5cc80d5691ab421bcaaa0c7e2e4a
2018-04-06 17:49:56 -07:00
Manjunathappa Prakash
d345d27867 qcacmn: Remove obsolete dmac_inv_range API
Remove obsolete dmac_inv_range API, instead use
qdf_mem_dma_sync_single_for_cpu API where ever required.
https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt

Change-Id: I44f14e6c87c1086decc600f59f298b7b8a94bc82
CRs-Fixed: 2215678
2018-04-04 04:02:05 -07:00
Venkata krishna Sundararajan
471b552ca5 qcacmn: Add OS abstraction for NSEC_PER_MSEC
Currently code that is os-abstracted is referencing the
Linux-specific macro NSEC_PER_MSEC which violates the software
architecture. Introduce a new QDF macro to os-abstract this
Linux-specific macro.

CRs-Fixed: 2210748
Change-Id: I519773f2fd2a7227a285cf3832a758005a0f3900
2018-03-29 18:57:34 -07:00
Venkata krishna Sundararajan
e456cb8400 qcacmn: Add qdf wrapper for ktime, hrtimer related APIs
Add qdf wrapper for ktime, hrtimer related functions
and abstracts in qdf layer. The  wifi driver use the
qdf wrappers for the above APIs.

ktime APIs:
=========
ktime_to_ms
ktime_set
ktime_to_ns
ktime_add_ns
ktime_get
ktime_add
ns_to_ktime

hrtimer APIs:
=====
hrtimer_forward
hrtimer_active
hrtimer_callback_running
hrtimer_cancel
hrtimer_is_queued
hrtimer_get_remaining
tasklet_hrtimer_init
tasklet_hrtimer_cancel

CRs-Fixed: 2138717
Change-Id: Ic4655d6b342f2121a5acc9b1c6bda7aabd154f8f
2018-03-29 18:57:32 -07:00
Mahesh Kumar Kalikot Veetil
fe276b3bc7 qcacmn: Fix qdf_get_monotonic_boottime_ns()
Fix the API implementation to account for time spent in system
suspend. This matches with API qdf_get_monotonic_boottime()
implementation.

Change-Id: I4bf8980bfc4500c035e8de7df4d8a18dfc6775ae
CRs-Fixed: 2211953
2018-03-26 16:32:28 -07:00
Sravan Kumar Kairam
376e5f1e3f qcacmn: Add IPA component related definitions
As part of IPA componentization remove IPA from HDD module
and make it as an independent component. Add qdf module ID
and Objmgr ID for IPA module.

Change-Id: Id99089f8188e8b1dbf7e1f60d3a127bec770706d
CRs-Fixed: 2180176
2018-03-21 03:39:37 -07:00
Sravan Kumar Kairam
4e417e0ad0 qcacmn: Add APIs to get IPA SMMU status
Add APIs to get the IPA SMMU status

Change-Id: I5889f35739b220bd4ad38f4278c133cd97141b22
CRs-Fixed: 2176318
2018-03-19 09:34:41 -07:00
Himanshu Agarwal
59c25048cd qcacmn: Add QDF APIs for SMMU Stage 1 translation
Add QDF APIs for DMA buffer allocation and sharing with SMMU
Stage 1 translation support. When SMMU Stage 1 is enabled,
DMA APIs return IO virtual address(IOVA) instead of physical
address. This IOVA needs to be mapped to physical address by
external module before accessing these buffers.

Change-Id: I88e938d8ebe1f32fdea79e3c3aa8a3638ddfd2b8
CRS-Fixed: 2072953
2018-03-19 09:34:37 -07:00
Dustin Brown
385b73090f qcacmn: Add per-level logging wrapper APIs
Depending on platform limitations and the intended audience of a
particular WLAN driver build, it would be useful to be able to compile
out specific logging level logs completely. To that end, introduce
per-level logging wrappers, which can be compiled in or out by the build
configuration.

Change-Id: Ie062ada403f8a31aebcde691396987ad9e5352b5
CRs-Fixed: 2205888
2018-03-16 21:51:49 -07:00
Rajeev Kumar
88de1dba44 qcacmn: Add common QDF API qdf_is_fw_down() to check fw status
Add common QDF API qdf_is_fw_down() to check if FW is down.

Change-Id: I8215665bec6975c8dd47ae3bb8423eeaaeba159c
CRs-Fixed: 2202731
2018-03-16 10:35:54 -07:00
Rachit Kankane
9cc217ab6a qcacmn: Compile out MTRACE feature
Fix to disabled MTRACE feature

Change-Id: I3cc30b47a9ba9dc9f99bf1185f99f0ae621f5f31
CRs-Fixed: 2189886
2018-03-15 08:05:06 -07:00
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
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
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
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
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
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