Commit Graph

81 Commits

Author SHA1 Message Date
Rajesh Chauhan
1cb111d3bc qcacmn: replace PDE_DATA() with pde_data()
In kernel 5.17, PDE_DATA() is replaced with pde_data(). Make
matching change in ath_procfs.c and linux_ac.c files.

Change-Id: Ia198545322146d4adde9330c19b43f5c2ed0dfa2
CRs-Fixed: 3298062
2022-10-05 17:51:38 -07:00
Vinod Kumar Myadam
b721690039 qcacmn: Add flag CONNECTIVITY_PKTLOG
Add new flag CONNECTIVITY_PKTLOG to make independent of
FEATURE_PKTLOG and REMOVE_PKT_LOG for packet logging.

This is because 32 tx/rx pkt logging is connection related
and this feature is independent of pkt log feature. Here
driver will send first 32 tx/rx pkts consisting of mgmt
and data pkts to userspace which can be used for debugging

Change-Id: I006a040546c9709f46e76dcd8630da8569c691c6
CRs-Fixed: 3222971
2022-06-27 12:17:21 -07:00
Kai Liu
f744f6a4e7 qcacmn: Use default seek for memdump lseek
Kernel change d4455fa 'proc: mandate ->proc_lseek in "struct proc_ops"'
by default use proc_lseek for file operations without any check, so add
default_llseek for all proc ops.

Change-Id: Ia72839cf09ec721fb98f50793b19ec082478d8d7
CRs-Fixed: 3201003
2022-05-24 16:01:15 -07:00
Adwait Nayak
b66eb8977a qcacmn: Rectify LF copyright year
Rectify LF copyright year

Change-Id: Ia021db26a4e528d42f148b0f24258f55e957be54
CRs-Fixed: 3122253
2022-02-10 14:03:08 -08:00
Adwait Nayak
df88a8bdc9 qcacmn: Place pktlog specific code under BE_PKTLOG_SUPPORT
Introduce a new flag "BE_PKTLOG_SUPPORT" for beryllium specific
pktlog support.

Change-Id: If91156541b322905ad5d97cf2d9d7ae687290ecb
CRs-Fixed: 3115832
2022-01-26 10:59:42 -08:00
Adwait Nayak
3664b4c5c2 qcacmn: FR65980: Add HYBRID TX support for pktlog
- A new pktlog mode called "hybrid", is added for QCN9224 only.
- Create WDI event for hybrid mode
- Add dummy APIs for monitor filter setting
- Send WMI_PKTLOG_EVENT_HYBRID_TX to FW for umac TLV subscription

Change-Id: I47f4e14bfc766f29a0ab4a8c07ab19e0d919e66b
CRs-Fixed: 3074184
2021-11-26 10:13:12 -08:00
Pragaspathi Thilagaraj
a8d8b663b2 qcacmn: Define QDF API for vzalloc and vfree
Define QDF API for virtual memory allocation and free.
Also add new api to get time of the day in microseconds.

Change-Id: I2921055bbb6b5d2a1105d19448b2a10fa2d6ccc5
CRs-Fixed: 3038180
2021-09-28 21:12:18 -07:00
Vevek Venkatesan
6a3c9eaa85 qcacmn: add CDP interface support for pkt_log_exit
Add CDP interface API support for pkt_log_exit,
to cleanup pkt_log_init on failure.

Change-Id: Ib50efaed5997d341d3e76c2e1dbe42856df40191
CRs-Fixed: 3012201
2021-08-14 23:07:04 -07:00
Ananya Gupta
6d07f2a272 qcacmn: Clear g_pktlog_pde after de-init pktlog
When switching from mission mode to FTM or Epping mode,
g_pktlog_pde is not cleared after de-init. When switching
back to mission mode, a warning is produced as the proc
directory is not found.
To fix this, g_pktlog_pde is cleared when pktlog is
de-initialized.

Change-Id: I1b9c9259c220a1981151dcb1e44a5621d7fd8204
CRs-Fixed: 2872045
2021-02-08 10:51:48 -08:00
Srinivas Girigowda
51ba6fe67c qcacmn: utils: Remove redundant __func__ from the logs
1. The logging macros implicitly takes care of embedding function name
in the log, hence there is no need to include __func__ again.
Getting rid of redundant __func__ reduces driver memory footprint.

2. Instead of adding __func__ to the qdf_nofl_* macros, its better to use
   qdf_* which already takes care of adding __func__.

Change-Id: If5717c811016845b5cffcf3fdc97805f3a1b731b
CRs-Fixed: 2774457
2020-09-15 02:45:54 -07:00
bings
e3fe6fc3c0 qcacmn: proc_create_data support for 5.6+ kernel
One parameter of proc_create_data is changed from struct
file_operations to struct proc_ops.
Add support for it under the kernel version compilation flag.

Change-Id: Ic87222f9c267debef56dcc66fc629854058ffabd
CRs-Fixed: 2666492
2020-06-01 00:04:11 -07:00
Lihua Liu
acb2945a97 qcacmn: Fix compile error when enabling pkt log
Variable "type_specific_data" is defined under macro
PKTLOG_HAS_SPECIFIC_DATA in struct ath_pktlog_hdr, but
used without control of the macro.

Change-Id: I9d46ddc141a0641aa6eaecf712c52e640c48053c
CRs-Fixed: 2665564
2020-04-29 22:27:43 -07:00
Alok Kumar
0265d7917a qcacmn: Add INI support for packet log buffer size
Add INI parameter "PacketLogBufSize" to populate
packet log buffer size.

Change-Id: Ic9b963a88a6f6d884d5fa3a63b4fed6768ba2fc4
CRs-Fixed: 2611409
2020-01-30 23:23:53 -08:00
Vevek Venkatesan
4a07e3949d qcacmn: cdp: Converge cdp_ctrl_ops
Currently cdp ops are given pdev/vdev handle
as its arguments, which is directly accessed
in those APIs. This can cause a race-condition
in access of the respective handles if it has
been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev_id/vdev_id which will be used to get the
respective handles, and hence avoiding unwanted
access of the handles if it has been deleted.
Also deleting few ops which stores and retrieves
such handles and adding ops to set/get pdev params.

- txrx_get_psoc_param
- wdi_event_sub
- wdi_event_unsub

Change-Id: Id089d9b6b4737d700d2436e2081291a3741affb5
CRs-Fixed: 2541658
2020-01-20 17:52:48 -08:00
Venkata Sharath Chandra Manchala
1affbbad46 qcacmn: Move pktlog API to platform specific file
Move process_sw_event API to pktlog_wifi2.c file as
it is only applicable to legacy product line.

Change-Id: I8eee102ea2eb70c0ffcec4ac20dfdf6ef48bca5b
CRs-Fixed: 2585613
2020-01-17 13:42:45 -08:00
Venkata Sharath Chandra Manchala
95d127a876 qcacmn: Move pktlog rate event handlers to specific files
Move pktlog_rate_find API to pktlog_wifi2.c as they are
only needed for legacy product lines.

Change-Id: I2a232e283cf5bf151ce84ba77f4359f25b60a5ac
CRs-Fixed: 2585613
2020-01-17 13:42:32 -08:00
Venkata Sharath Chandra Manchala
1896d2e534 qcacmn: Move process_rx_info API to platform specific file
Move process_rx_info to pktlog_wifi2.c file as it
is only applicable to legacy products.

Change-Id: I2a758c26ac560459f22fbb691863bf1fea17cf65
CRs-Fixed: 2585613
2020-01-17 13:42:19 -08:00
Venkata Sharath Chandra Manchala
41538b57b3 qcacmn: Move pktlog API's to specific files
Move process_tx_info from pktlog_internal.c to pktlog_wifi2.c
as they are only needed for legacy product line.

Change-Id: I53b90deaf86aa2bb6533b9957879e7860d91b352
CRs-Fixed: 2585613
2020-01-17 13:42:05 -08:00
Venkata Sharath Chandra Manchala
1140065e4c qcacmn: Move pktlog API's to specific files
Move pktlog hardware dependent API's from pktlog_internal.c
to pktlog_wifi3.c as they are hardware dependent.

Change-Id: I421b3116a35e735a51c82839005bbc2d4cb138d7
CRs-Fixed: 2585613
2020-01-17 13:41:54 -08:00
Alok Kumar
a316b315d8 qcacmn: Protect pktlog under mutex to avoid possible race conditions
Protect pktlog funcitonality under given mutex to avoid possible
race condition between pktlog_release/pktlog_open and pktlogmod_exit.
Also call pktlogmod_exit before calling wdi_event_detach to avoid
accessing freed memory in pktlog release.

Change-Id: I5ca4b304d0f4dc1af289daa167958d5b773d9a6e
CRs-Fixed: 2578623
2019-12-09 23:04:45 -08:00
Vivek
0c4e20ff82 qcacmn: Replace printk with qdf_nofl_info
Replace printk with qdf_nofl_info in qdf folder.
So if we wish to change from printing on console
to other location, based on a logging daemon, we
can do that by only changing at the implementation
of QDF print API's

Change-Id: I6db67cee416ebbe0f2c51b2d4dbf2b3a335e972a
CRs-Fixed: 2442689
2019-10-29 04:07:12 -07:00
Venkata Sharath Chandra Manchala
113ba25d75 qcacmn: Add QCA_WIFI_QCA6490 support for pktlog
Enable pktlog processing for QCA6490 based
chipsets.

Change-Id: I23939a284921211fcb869ce8473212014216cf74
CRs-Fixed: 2522133
2019-10-17 15:12:38 -07:00
Venkata Sharath Chandra Manchala
6f852506bf qcacmn: Use PKTLOG_TYPE_RX_STATBUF macro
Use macro PKTLOG_TYPE_RX_STATBUF for indicating
received Rx Full pktlog messages.

Change-Id: Ia7e69bc385fd7b1367c191f657ace8327388cf03
CRs-Fixed: 2529520
2019-10-09 19:10:57 -07:00
Himanshu Batra
7ee0677954 qcacmn: Replace linux print APIs with qdf print APIs
Replace linux print APIs with equivalent level qdf print APIs.

Change-Id: If0a4a5326de87c9f023e8f4de996a4734ed6cda2
CRs-Fixed: 2530137
2019-09-29 23:15:37 -07:00
Tiger Yu
720673fd7a qcacmn: Fix the regression issue for pktlog failure with ROME module
The pktlog will fail with ROME module due to the change IDs:
I24776caa3b78ec38d94421f243ec72d81ee3102d
Ifb70ac0993f2402201f88758845f730cf677b1a0

Define new macro PKTLOG_LEGACY for HELIUM/ROME to avoid the ROME PKTLOG
failure.

Change-Id: Ibaa20b7af208a261e0fd8682de45ad8eb4a69212
CRs-Fixed: 2523511
2019-09-15 22:48:36 -07:00
Tiger Yu
f28f88bcdd qcacmn: Add protection for type_specific_data in ath_pktlog_hdr
The member of type_specific_data is not valid for ROME module. Add macro
protection for type_specific_data in the ath_pktlog_hdr to avoid offset
error when getting the msdu id info during  processing pktlog TX info.

Change-Id: Icb8b95cef9a32732116522e4fc3b39067ff36037
CRs-Fixed: 2518400
2019-09-11 01:33:02 -07:00
Venkata Sharath Chandra Manchala
c0980fd21e qcacmn: Add a check to avoid processing invalid pktlog buffers
Avoid further processing of pktlog buffers received from
firmware or Hardware if the size is greater than
MAX_PKTLOG_RECV_BUF_SIZE.

Change-Id: If1dd855137a9b83721f01005fa3367f7924f4ebb
CRs-Fixed: 2493721
2019-09-06 18:18:36 -07:00
Venkata Sharath Chandra Manchala
a28e0144fe qcacmn: Initialize variable before use in process_tx_info
Initialize type specific data in process_tx_info
while processing full tx pktlog messages.

Change-Id: Icbdd20e7e4604f117912e5a4402f7aa5048e671e
CRs-Fixed: 2468471
2019-07-17 16:28:33 -07:00
Venkata Sharath Chandra Manchala
ff4d3f79f1 qcacmn: Validate pktlog handle
Add a NULL check to validate pktlog handle
before dereferencing it.

Change-Id: I3ea56b60460c5c2cfae0fff97f0721068156cf4a
CRs-Fixed: 2468506
2019-06-25 13:06:51 -07:00
Vulupala Shashank Reddy
3027c86227 qcacmn: Remove excessive logging in console for packet logs
The packet logs show in console logs which are redundant.
Change the log level from qdf_print to qdf_debug to avoid
excessive logging.

Change-Id: I2a43a0072bb7f940df007a590013e500ddda5e8a
CRs-Fixed: 2437278
2019-04-29 04:17:46 -07:00
Srinivas Girigowda
2751b6d2b3 qcacmn: Consolidate multiple MAC_ADDR_LEN to QDF_MAC_ADDR_SIZE
Consolidate multiple (redundant) MAC_ADDR_LEN to QDF_MAC_ADDR_SIZE
CDP_MAC_ADDR_LEN
OL_TXRX_MAC_ADDR_LEN
DP_MAC_ADDR_LEN
HTT_MAC_ADDR_LEN
IEEE80211_ADDR_LEN
DEFRAG_IEEE80211_ADDR_LEN
ETHER_ADDR_LEN
HAL_MAC_ADDR_LEN
WLAN_MACADDR_LEN

CRs-Fixed: 2406591
Change-Id: I4a87f8ff556920c7b341bdbba99ec43c97b873f4
2019-03-28 16:50:32 -07:00
Jeff Johnson
4c5ac90746 qcacmn: utils: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within utils replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: Iae6c2f2f0b3041a9397dd13092ea500a8b995fd2
CRs-Fixed: 2418251
2019-03-26 10:30:31 -07:00
Dustin Brown
50eab9871f qcacmn: Migrate qdf_ssr_protect/unprotect
qdf_op_protect/unprotect supersede qdf_ssr_protect/unprotect. Replace
calls to qdf_ssr_protect/unprotect with qdf_op_protect/qdf_op_unprotect.

Change-Id: Iab80e4cbf6b87b37a0d761e7ecea695b840c5e5e
CRs-Fixed: 2418450
2019-03-26 01:24:45 -07:00
Venkata Sharath Chandra Manchala
cad74add80 qcacmn: Add support for full pktlog
1. Enable CE5 and allow it to service
   pktlog messages from the firmware.
2. Register full pktlog callback handlers
   for handling sw_events and full tx pktlog.

Change-Id: Ifb70ac0993f2402201f88758845f730cf677b1a0
CRs-Fixed: 2388906
2019-02-21 23:25:30 -08:00
hangtian
b75e3446b7 qcacmn: Use qdf_mem_zero for zero initialization, utils part
Use qdf_mem_zero for zero initialization, utils part.

Change-Id: I88ba8a279c31fe779ca1bf563cd8882fe644c2c0
CRs-Fixed: 2378005
2019-02-21 01:47:09 -08:00
Rakshith Suresh Patkar
5cfc631920 qcacmn: Log pkt_stats to logger thread for sw_event
pktlog log types were received as individual log types
like PKTLOG_TYPE_TX_CTRL, PKTLOG_TYPE_RC_FIND, etc.
As per the current implementation, FW sends an
aggregated log type as PKTLOG_TYPE_SW_EVENT.
This aggregated log type event is not logged to
userspace.

Log sw_event pkt_stats to logger thread in
process_sw_event.

Change-Id: I5b12ecce25af6395a10eb7c7452a7eeb042d7c0a
CRs-Fixed: 2396980
2019-02-18 10:40:05 -08:00
Jianmin Zhu
860380d062 qcacmn: Remove CONFIG_MCL in pktlog
Since WIN are not using this code at the moment, just remove
CONFIG_MCL directly.

Change-Id: Iff35f533f4f32a6d8b22aea5f890ec4d935fc88c
CRs-Fixed: 2388751
2019-02-06 14:39:22 -08:00
Venkata Sharath Chandra Manchala
96e3633874 qcacmn: Pktlog Enhancements
1. Reduce the log level for every buffer received
   from firmware
2. Set the default pktlog buffer size to 10MB.

Change-Id: Iad8827084579592fcfa69056dcfc9d57095151e7
CRs-Fixed: 2364380
2018-12-15 08:43:26 -08:00
Manjunathappa Prakash
c6e684b128 qcacmn: pkt_log: Use qdf_spin_lock APIs debug infrastructure
Use QDF spin_lock APIs so that we can make use the debug infra.
This will help to identify catch issue related to unbalanced lock
operations or unexpectedely long locks.

Change-Id: I318bcb90340d98813f19862fda14e6ada30bbed6
CRs-Fixed: 2349308
2018-11-16 13:34:38 -08:00
Venkata Sharath Chandra Manchala
0ce469e330 qcacmn: Add pktlog handler to process rate events
Add dp_msg_pktlog_handler to handle
rate events from the firmware.

Change-Id: I24776caa3b78ec38d94421f243ec72d81ee3102d
CRs-Fixed: 2340639
2018-11-11 09:27:32 -08:00
Venkata Sharath Chandra Manchala
8747958dff qcacmn: Enable Monitor Mode for QCA6390
Support Monitor Mode for QCA6390 as RXDMA1 block is
now removed.
1. Monitor buffers are now received on rxdma_err_dst_ring
2. RXDMA1 monitor status ring is moved to RXDMA0 monitor
   status ring
3. Msdu link descriptors are now returned to WBM descriptor
   release ring.
4. Reap the Monitor buffers and return it to SW Refill ring.
5. Use the same rx descriptor pool for regular and monitor data.

Change-Id: If41e5d13f942da2b97e5aab72b88ae344925ba67
CRs-Fixed: 2297300
2018-10-26 10:39:37 -07:00
gaurank kathpalia
85e55d12d6 qcacmn: Add src, and dst id support in PKTLOG(WMA)
In the scheduler_post_message, src_id is now added to
know the source module of the msg. the present scheduler
doesn't know about the same which is scheduler_post_msg

Replace the scheduler_post_msg with scheduler_post_message

Change-Id: I166f4c943b9a21749c53ed19101b0ed0defd8491
CRs-Fixed: 2306013
2018-09-17 06:09:52 -07:00
Aditya Sathish
f78a3d8ca5 qcacmn: Clean up spectral, tif and umac component prints
Clean up spectral, tif and umac component prints by correcting trace
levels for regularly occurring prints and removing newlines from
converged print APIs since qdf_trace_msg appends them by default.

Change-Id: Ib10f1b1c54ecbcb9f4076be7c2c4708359d488e0
CRs-Fixed: 2243843
2018-08-10 18:11:18 -07:00
Ashish Kumar Dhanotiya
d9b88605c5 qcacmn: Update current pktlog state if pktlog enable fails
If user tries to enable pktlog multiple times, pktlog enable
fails as the pktlog is already enabled.
while returning failure, current pktlog state is not updated
to PKTLOG_OPR_NOT_IN_PROGRESS in pktlog_enable api.
Now if user tries to get pktlog using cat command driver
returns resource busy from pktlog_enable as the current
pktlog state is not set to PKTLOG_OPR_NOT_IN_PROGRESS.

To address this issue, set the current pktlog state to
PKTLOG_OPR_NOT_IN_PROGRESS in case of failure.

Change-Id: I08e67c13e7a781340a97ad4c37308f3e61972c99
CRs-Fixed: 2278363
2018-08-06 22:43:12 -07:00
Jiachao Wu
72eeed89e5 qcacmn: Add NULL check for 'pl_dev'
Currently 'pl_dev' is dereferenced without check for NULL in
get_pktlog_handle function in pktlog_internal.c.
To address this issue add NULL check before dereferencing.

Change-Id: I7017560d5eb36df3ca0a547cf62451f339f5940b
CRs-Fixed: 2280047
2018-07-24 01:06:19 -07:00
Ryan Hsu
c84218fed7 qcacmn: Add SSR callbacks
As CDS is not usable by WIN, add callbacks that are
registered in QDF and correct the module dependencies.

Also moves the platform related function to qdf_platform.[c|h]

Change-Id: I3080e9df86770235ff46237b8a2ffb9c2a3c9c2c
CRs-fixed: 2130260
2018-06-20 04:05:54 -07:00
bings
315d67f3f4 qcacmn: Fix pl_info->log_stat update
If log state 1, 2, 0, 1 are set serially, log state 2 can't be set
successfully, while log state 1 is set to wdi twice, which results
in two same pointers in doubly linked list txrx_pdev->wdi_event_list
and causes dead loop.

Update pl_info->log_stat only when it is subscribed to wdi and sent
to firmware successfully.

Change-Id: I8d67b9f02a2fb2c958d2553a743cbabcedfb2f42
CRs-Fixed: 2250715
2018-06-14 02:56:49 -07:00
Nirav Shah
c9b0931950 qcacmn: Featurize packet log
Featurize packet log.

Change-Id: Ica7d658ef65486ae77e24a11cef50291a5e82563
CRs-Fixed: 2245424
2018-06-09 02:28:11 -07:00
Jeff Johnson
c7bfa72ec1 qcacmn: utils: Fix misspellings
Address the following issues in the utils folder:
CHECK: 'interupt' may be misspelled - perhaps 'interrupt'?
CHECK: 'ommitted' may be misspelled - perhaps 'omitted'?
CHECK: 'TRESHOLD' may be misspelled - perhaps 'THRESHOLD'?

Change-Id: Ic9c2fdf2566f3bdd8c37906e52ed65d4dc1d1563
CRs-Fixed: 2241587
2018-05-19 22:14:43 -07:00
Jeff Johnson
5f255001d9 qcacmn: utils: Remove legacy markings
Per current guidance remove legacy markings.

Change-Id: I0bb870b4c83129d2466aeb4741d27783de888008
CRs-Fixed: 2230684
2018-05-18 02:17:50 -07:00