Commit Graph

765 Commits

Author SHA1 Message Date
Debasis Das
d5b64eab69 qcacmn: Add wrappers to abtsract OS API's
Add wrapper API's to abstract various OS API's
related to network-device.

Change-Id: I0c8bc9091d32965a90025b9e7738ab6cfdc39d14
2020-11-03 06:23:36 -08:00
Jinwei Chen
56f94da675 qcacmn: Add reo destination indication info to skb
Get reo destination indication from REO2SW ring descriptor,
store it to qdf_nbuf_cb of skb.

Change-Id: I5a4c504b2550229a77a435b1f5ddb78c4abe51aa
CRs-Fixed: 2809080
2020-11-01 23:14:06 -08:00
Rajeev Kumar
c3f4e5678d qcacmn: Change QDF per packet proto log level to debug
QDF per packet proto logging is leading to excessive console
logging and hence change QDF per packet proto logging to
debug log level and avoid spamming precious kernel dmesg
log  buffer.

Change-Id: Iae562a8541c81e7708caa822a0ce293e7d6e47f3
CRs-Fixed: 2808600
2020-10-31 07:17:14 -07:00
Jianmin Zhu
6ce6be5c32 qcacmn: Add MACRO qdf_ceil
Add MACRO qdf_ceil(x, y) as DIV_ROUND_UP(x, y)

Change-Id: I92ecffbaf29c43809712e2b950a8064890e98136
CRs-Fixed: 2807611
2020-10-29 23:35:39 -07:00
Karthik Kantamneni
6ef375e0fb qcacmn: During qdf assert don't print generic failure information
During qdf assert generic failure information printed at last is misleading
failure reason, to avoid this don't print generic failure information.

Change-Id: I55359b2e41a3ee50de4e45e73183f2480c28a1eb
CRs-Fixed: 2789137
2020-10-13 02:06:05 -07:00
Ankit Kumar
a438cb3a4a qcacmn: Add out of boundary assert check
Add an assert check to __qdf_nbuf_add_rx_frag() to ensure
the number of fragments doesn't exceed the maximum number
of frags an skb can accommodate.

Change-Id: Idcfe8fdacaad581d7b2b0ce52fc7e8d757286ec8
CRs-Fixed: 2791955
2020-10-09 06:47:29 -07:00
Harsh Kumar Bijlani
e3907fda5d qcacmn: Account for frags attached to chained nbufs in frag_list
Page fragments can be attached to the chained nbufs present in the
frag_list of the parent nbuf. Update the debug entries for such fragments
in different scenarios.

Change-Id: Ib114ec43dcb6cbcd707552bcca19f1ac0d3c2a22
CRs-Fixed: 2791903
2020-10-09 00:06:51 -07:00
Guisen Yang
1f8975e467 qcacmn: Change ROME IPA pipe names
Change ROME IPA pipes from IPA_CLIENT_WLAN1_CONS and
IPA_CLIENT_WLAN1_PROD to IPA_CLIENT_WLAN3_CONS and
IPA_CLIENT_WLAN3_PROD. The MCC pipe is changed to
IPA_CLIENT_WLAN2_CONS

Change-Id: I329eadc28e5730f6e9f73325ba41d69102dc89c0
2020-10-07 15:16:28 -07:00
Ankit Kumar
45c8760063 qcacmn: Fix fraglist creation api to handle nr_frags
Handle skb fraglist creation if parent skb has nr_frags.

Currently it is being handled if parent skb has nr_frags
associated with it and results into acessing invalid skb
region.

e.g:
To understand example, consider below points:
1. Parent frag has 40 bytes of data(qdf_nbuf_data())
2. Assume each frag is of size 10 bytes.

 ----------------------------------------------------------
|Parent_SKB -----> 1st Fraglist SKB - Cons SKB chained     |
 ----------------------------------------------------------
| nbuf->Data    : 40B         |   Nbuf->Data: 0B           |
 ----------------------------------------------------------
| Nr Frags: 16                |   Nr Frags: 10             |
 ----------------------------------------------------------
| Data Len: 160B (16 * 10)    |   Data Len: 100B (10 * 10) |
 ----------------------------------------------------------
| Nbuf->len: 200B ( 40 + 160) |   Nbuf->len: 100B          |
 ----------------------------------------------------------

While creating fraglist,
Parent nbuf -> data_len will become 100 Bytes (Because of assignment '=').
Logically it should be (160B + 100B). '+='

This change incorporate above handling.

Change-Id: I9f63035aa44e6f85a803511cb19632178d3dc2e5
2020-10-07 12:49:00 -07:00
Vevek Venkatesan
5e487cc20a qcacmn: add support for DDR mapped IPA doorbell
Add support for DDR mapped IPA doorbell addresses.

Change-Id: I3a0d03ff4435ea12a6e07d4ae75012f2c85e32c9
CRs-Fixed: 2782267
2020-10-06 14:24:41 -07:00
Vevek Venkatesan
111e9faf76 Revert "qcacmn: Fix align issue for nbuf alloc"
This reverts Change-Id: I8eca9a085c0270f47318e64cefba686eac39a69a
That causes nbuf alloc size 64 bytes short of 2K, which leads
nbuf data to corrupt SKB shared info.

Change-Id: Iece451b4611c3fe9aaac00cc8aa7abbf79093b22
CRs-Fixed: 2779177
2020-09-22 12:15:49 -07:00
Jinwei Chen
d4da14a5ce qcacmn: Add 802.1Q/802.1AD support for DHCP/EAPOL/ARP data check
If the data ether header contains 802.1Q and 802.1AD tag,
current API to identify DHCP/ARP/EAPOL frame will not work properly,
for 802.1Q/802.1AD frame, there is extra 4 or 8 bytes in ether header.
Add 802.1Q and 802.1AD support for DHCP/EAPOL/ARP check.

Change-Id: Ibf00bd9e1497ba9700abca10d840104a73238f56
CRs-Fixed: 2771942
2020-09-22 07:59:28 -07:00
Jinwei Chen
21d6fd0ac6 qcacmn: add function for multi-pages memory zero operation
Add function qdf_mem_multi_pages_zero() to support multi-pages
memory zero operation.

Change-Id: I08b5c2722c02881550d3a1da27d5137c0957fd51
CRs-Fixed: 2776365
2020-09-21 01:33:12 -07:00
Saket Jha
91f3420b3d qcacmn: Always assert if TSO frag paddr is invalid
Always assert immediately in case of dma mapping error for TSO frags or
whenever paddr is set to 0. This will assert closer to the point of
failure in the future and point to the immediate operation causing this
behavior.

Change-Id: I8e3d58c1b4f18a8b7721b96686ea0ea4ff9c270b
CRs-Fixed: 2777588
2020-09-19 22:36:24 -07:00
Nisha Menon
aa434cb679 qcacmn: Add qdf api to return nbuf size from data to end ptr
Add api to qdf abstraction framework to return size of nbuf
from nbuf data pointer to end pointer.

Change-Id: I8a450306ddcaa7c6a85607425bc1c1fd26c4e1e4
CRs-Fixed: 2767763
2020-09-18 18:23:46 -07:00
Harsh Kumar Bijlani
65420efa1b qcacmn: Update frag counter and frag debug nodes for qdf_nbuf_unshare
Update frag global counter and refcount for the frag debug nodes
in debug version of the API qdf_nbuf_unshare.

Change-Id: Ia7ede226701793fe1febb3411aa508ba7967092c
CRs-Fixed: 2776166
2020-09-18 18:23:38 -07:00
Harsh Kumar Bijlani
0ee6465661 qcacmn: Add check for mem debug disabled in qdf_frag_debug_update_addr
Check for is_initial_mem_debug_disabled is missing in API
qdf_frag_debug_update_addr API. Add check for is_initial_mem_debug_disabled
so as to return without proceeding further when
is_initial_mem_debug_disabled is set to true.

Change-Id: Ie6251e70d2c01302121ff1c63ecf438f626de706
CRs-Fixed: 2780110
2020-09-18 15:17:29 -07:00
Harsh Kumar Bijlani
1f7706356f qcacmn: Update global frag counter and frag debug nodes refcount
The current logic for decrementing the global frag counter and
refcount for the frag debug nodes does not take into consideration
the no. of users of nbuf.

Decrement global frag counter and frag debug nodes refcount only
when no. of users of nbuf is 1.

Change-Id: I5b88691f7e3e9b7e29e19479c3a3c12e70c0f311
CRs-Fixed: 2776170
2020-09-18 15:17:26 -07:00
Jhalak Naik
41e8d82db9 qcacmn: Hex dump generation for WMI events and commands
This records all the WMI events and commands, for all
PDEVs. Set WMI_EXT_DBG flag to enable this feature. Refer
Original Change-Id: I18e46f683e35912cad717ca3b9cc3d1885315362

Change-Id: I4c9bdfe6fdd195656ca0c01ca400eba595be24a3
CRs-Fixed: 2762266
2020-09-15 11:38:47 -07:00
Sandeep Puligilla
1e325d2b3a qcacmn: Add Interface module ID
Add interface module in the qdf trace.

Change-Id: I4053c46fec29bcae75a0505e93f53f01a05d3332
CRs-Fixed: 2767862
2020-09-15 09:28:57 -07:00
Jingxiang Ge
3d5a0c6aba qcacmn: Fix align issue for nbuf alloc
Current code it doesn't realize alignment.
Eg: if require 4096Bytes, it will alloc 4099Bytes,
which cause 2 pages here.

Fix is using qdf_align to align memory size.

Change-Id: I8eca9a085c0270f47318e64cefba686eac39a69a
CRs-Fixed: 2773627
2020-09-12 15:59:30 -07:00
Chaithanya Garrepalli
96d7fbafaf qcacmn: fix double nbuf allocation false positive
In qdf_nbuf_queue_free API __qdf_nbuf_free API is
called to free the nbuf which is not clearing the debug
node instead call qdf_nbuf_free API to delete the nbuf
debug node and free nbuf

Change-Id: I34f06a440ce7758d4ea02fbd1d696366460aa871
2020-09-11 19:08:19 -07:00
Nisha Menon
1c50a00210 qcacmn: Update the gold core latency on clearing cpu_mask
Add qdf framework apis to clear cpu_mask and loop
through cpus present and excluded in the cpu_mask.
Use the apis to clear the cpu_mask and loop through
cpus included in and excluded from the cpu_mask to
ensure that the latency of the cores is set correctly.

Change-Id: I131ef3df2ec5b1e5a1a78d39cbc5a5dedbaa2903
CRs-Fixed: 2772353
2020-09-11 16:17:49 -07:00
Chaoli Zhou
8b47a84559 qcacmn: Add GPIO MODULE ID
Add one new GPIO QDF MODULE ID for GPIO component use

Change-Id: Iefc9727b4dc8337be976d15f7d79298bc6ab884b
2020-09-11 07:36:58 -07:00
Alan Chen
907c485706 qcacmn: Add major print logic for SKB
Add major print logic for SKB as it is currently done for kmalloc and
dma allocations so that SKB allocations can be profiled.

Change-Id: Ic78cef61bc1519aa54da9823199add92c116aad7
CRs-Fixed: 2769631
2020-09-09 16:20:01 -07:00
Balaganapathy Palanisamy
55650d9c02 qcacmn: Add sequence number for WMI pipe
Add sequence number to each packet queued on wmi pipe and
match it against expected sequence number in wmi completion handler.
WMI packets are consumed internally, use the skb mark field to capture
the sequence number of the wmi packet.

Change-Id: I1421e3fcff0a2b326f6d899780c773950544ef26
CRs-Fixed: 2741465
2020-09-07 03:18:00 -07:00
Mainak Sen
14543e310a qcacmn: Add qdf and DP module id for MSCS
Add MSCS module id in QDF and DP
Change-Id: I1b5186828c2ef236bb1f05c8d54850ed37719926

Change-Id: I5049cd17e5e1ad73adc6a1d881e7882e3947796f
2020-09-02 08:48:28 -07:00
Uraj Sasan
0ba27943fb Revert "qcacmn: Hex dump generation for WMI events and cmds"
This reverts Change-Id: I18e46f683e35912cad717ca3b9cc3d1885315362

Change-Id: I2fffecdee294f08e694b12a744d35cf18d3fd66b
2020-09-01 01:49:45 -07:00
Jhalak Naik
8e4491a9ac qcacmn: Hex dump generation for WMI events and cmds
Support WHUNT FW simulation feature.
Records all the WMI events and commands, for all PDEVs.
Set WMI_EXT_DBG flag to enable this.

Change-Id: I18e46f683e35912cad717ca3b9cc3d1885315362
CRs-Fixed: 2762266
2020-08-28 13:03:54 -07:00
Jingxiang Ge
759cd74c04 qcacmn: Add wakeup source tracker
Enable debug for wakeup source tracker.

Change-Id: I28983b5b6cbc15e71753264504e28fccba8a79cc
CRs-Fixed: 2760401
2020-08-28 13:03:51 -07:00
Shashikala Prabhu
28cecde000 qcacmn: Use ktime_get_ts64 for logging time stamp
Use ktime_get_ts64 instead of ktime_get_real_ts64 to display logging time
stamp. ktime_get_real_ts64 displays the time of day in a timespec64.
Whereas, ktime_get_ts64 gets the monotonic clock in timespec64 format.

Change-Id: Id6646a2d60c5d049b0d777f58c9ac332ffb52437
CRs-Fixed: 2764048
2020-08-28 08:54:16 -07:00
Yu Tian
62339dcb9c qcacmn: Change feature flag name
Change feature flag name due to address alignment is
required from HW design perspective

Change-Id: I8418c7778f92031b11f0bb80bf9af307a61f45ff
CRs-Fixed: 2757537
2020-08-26 03:56:12 -07:00
Srinivas Girigowda
ffc5af7bbf qcacmn: qdf: Change %pM/QDF_MAC_ADDR_STR/ARRAY to QDF_MAC_ADDR_FMT/REF
Change %pM/QDF_MAC_ADDR_STR/ARRAY to QDF_MAC_ADDR_FMT/REF.

CRs-Fixed: 2760938
Change-Id: I89d17f8e7b58d10f56882310bd4e47a9519d0425
2020-08-23 23:09:27 -07:00
Nisha Menon
027d8742b8 qcacmn: Add new cpumask apis to framework
Add new qdf apis to copy cpumask and check if an
existing cpumask is empty.

Change-Id: Ie34a9f9c097a691ac16e7f8ceca0a855ab6b26e3
CRs-Fixed: 2738317
2020-08-21 02:28:48 -07:00
Harsh Kumar Bijlani
d47e448d58 qcacmn: Implementation of SKB Frag Debug Framework
SKB frag debug framework is required for debug purpose of frag based
approach in monitor mode

Change-Id: Ic7a5a2c3d7397c4d7dd2c5db32802b0f694e6101
CRs-Fixed: 2736136
2020-08-17 10:07:25 -07:00
Alok Kumar
9949f46e04 qcacmn: Use DEFERRABLE_WORK instead of DELAYED_WORK for BUS BW
For static display case, BUS BW work periodically wakes up the
APPS because bus bw work is created as DELAYED_WORK.
This has the power impact in case of static display.

Use DEFERRABLE_WORK instead of DELAYED_WORK for bus bw work.
DEFERRABLE_WORK won't wake up the APPS periodically in static
display case.

Change-Id: Id812907cc6962ab7a9bb2ce8a7417ca0546363ab
CRs-Fixed: 2748373
2020-08-14 08:13:01 -07:00
Pragaspathi Thilagaraj
0df12365ac qcacmn: Add FILS crypto API for rIK generation
Replace the lim_default_hmac_sha256_kdf() & lim_create_fils_rik()
API  with crypto API since both these API are primarily for
cryptographic derivation of re-authentication integrity key(rIK)

Use the new crypto APIs qdf_default_hmac_sha256_kdf(),
wlan_crypto_create_fils_rik() for this.

Change-Id: I1c8f38ee0124b8b3eb527d4b01d39add134e181b
CRs-Fixed: 2752635
2020-08-13 10:33:09 -07:00
Jhalak Naik
a878b340c8 qcacmn: Export qdf symbol for functions used for CBT
Add export function symbol for functions and compile
qdf_func_tracker.c file, required for code instrumentation.
These functions print the dump of function call map and are
called during CBT test case execution, to find errors and
trace function calls.

Change-Id: Idc79de7111398956b4995d3d7cbefa45a079b100
CRs-Fixed: 2748686
2020-08-11 09:48:00 -07:00
Jinwei Chen
d552bfa2cb qcacmn: add rx nbuf ipa smmu map/unmap trace
Currently in_use and unmapped flag from rx_desc can not know is
the rx nbuf has done IPA smmu map/unmap accurately.
add rx nbuf IPA smmu map/unmap flag in qdf_nbuf_cb, and use
this flag to check if IPA smmu map/unmap need to be done or not.

Change-Id: I19bbc6cc69ba752ef7c58d41fbe26299ca96d29e
CRs-Fixed: 2731313
2020-08-11 00:35:34 -07:00
Shivani Soni
15d8bb5c6b qcacmn: QDF API and SKB debug framework support for alloc_skb
Implementation of QDF API to allocate skb to avoid recycler pool
and extending skb debug framework support.
QDF API: qdf_nbuf_alloc_no_recycler

Change-Id: I32ccae7337000c899e8fba8127aa9fb3c8551783
CRs-Fixed: 2734717
2020-08-04 14:59:03 -07:00
Shwetha G K
66c83b2fbe qcacmn: Disable net_buf double-free panic when DISABLE_MEMDEBUG_PANIC set
Disable net_buf double-free panic when DISABLE_MEMDEBUG_PANIC set

CRs-Fixed: 2734030
Change-Id: I95b4e79e1e0607f39a950a3b96c70a066adee04d
2020-08-03 09:13:19 -07:00
Ankit Kumar
2b9e4ba1cb qcacmn: Add QDF wrapper for nbuf frag ops
Introduce qdf wrapper API for nbuf frag based ops.

Change-Id: I0f4c1cb1aa9fcdd9dc2fc2f5716860eb286a1932
CRs-Fixed: 2733972
2020-08-01 21:08:57 -07:00
bings
e344f80463 qcacmn: Set lock_cookie_freelist as NULL in qdf_lock_stats_deinit
lock_cookie_freelist is global static, which means it is set as NULL when
loading driver module. It works well when there is only one driver module.
For the CE platform with CONFIG_WLAN_RESIDENT_DRIVER defined, driver is
split into two modules, one module keeps variables and functions in
kernel, the other module is used to trigger rmmod/insmod function. In this
case, lock_cookie_freelist is not NULL when insmod is triggered the second
time through the second module.

Set lock_cookie_freelist as NULL in qdf_lock_stats_deinit.

Change-Id: Ia20fcc230c3a43eed9b646689348ad37b77811f2
CRs-Fixed: 2742118
2020-08-01 21:08:51 -07:00
Jayachandran Sreekumaran
3be1a0a167 qcacmn: Add qdf API for delayed workqueue
Add qdf API for delayed workqueue

Change-Id: Ic67f200ac6c9749b088bbd0769491d22583eed11
CRs-Fixed: 2738374
2020-07-31 07:43:44 -07:00
Shivani Soni
bf1bffa51d qcacmn: QDF macro for skb shared info size
Introducing QDF macro for getting size of skb shared info considering
alignment

Change-Id: Idb8e714c8de00b640dc7e400a757c71e80ae48e6
CRs-Fixed: 2737178
2020-07-23 07:00:44 -07:00
Prabhat Tamrakar
0ba944c541 qcacmn: Initialized QDF_NBUF_TRACK structure member
Uninitialize QDF_NBUF_TRACK structure members printing junk
data, it may lead to slab-out-of-bounds

Initialize QDF_NBUF_TRACK structure members with default value
in API qdf_net_buf_debug_add_node

CRs-Fixed: 2720988

Change-Id: I377a82a5e91b752516cd42089a66549d84d1c2dd
2020-07-17 01:51:16 -07:00
Aditya Kodukula
b25366fa6f qcacmn: Check for NULL pointer before de-referencing it
Pointer 'hif_ctx' returned from call to function 'cds_get_context'
may be NULL. Check for NULL pointer before de-referencing it.

Change-Id: I6c909b2c62e1bf6945a4cc40315e8fdad4a0aa83
CRs-Fixed: 2726335
2020-07-10 01:43:25 -07:00
Ashish Kumar Dhanotiya
a54735abdd qcacmn: Change data type of the code for qdf trace to uint16_t
Currently for qdf trace api data type of code is uint8_t, some of
the modules are inserting message id of type uint16_t because of
which some information is getting lost and post processing cmm
script is not able to parse these messages correctly.

To address above issue, change the data type of code for
qdf trace function.

CRs-Fixed: 2719767
Change-Id: I4461dc9c2f45e691317d318870dfdbce93929e12
2020-07-09 21:39:40 -07:00
Disha Das
6320586a21 qcacmn: Enable qdf_get_keyed_hash() API
Enable qdf_get_keyed_hash() API in qdf_crypto.c

CRs-Fixed: 2721647
Change-Id: I2c051f79dce2e70c9fa7c25d171a69b60588d6b8
2020-07-03 04:28:23 -07:00
Baowei Liu
f884be9f79 qcacmn: Improve 'Not set force_set if event completed'
Original changes have problems and have been reverted.
This is improved fix, the difference is set event done flag
before complete

Original submit is I31f947169153ccbeb8435c539faab1059c055c04
Revert submit is If8318b28883ae8ddd4fee36013f28c45f30fa426

Change-Id: I72814381a3ee932c9ff43fdae7d2dda5619baa48
2020-07-01 18:06:19 -07:00