Commit Graph

78 Commits

Author SHA1 Message Date
Himanshu Batra
21a548ada6 qcacmn: Rename WLAN_TELEMETRY_STATS_SUPPORT to WLAN_CONFIG_TELEMETRY_AGENT
Rename telemetry agent macro WLAN_TELEMETRY_STATS_SUPPORT to
WLAN_CONFIG_TELEMETRY_AGENT

Change-Id: I9b2feb33b32daf56e584ae04f260749c358c8ea4
CRs-Fixed: 3425567
2023-03-16 13:50:32 -07:00
Mukul Dhiman
7b27742e7c qcacmn: add doc for stat_periodicity, telemetry stats etc
add doc for stat_periodicity, telemetry_stats. add modify
doc for ucfg_send_telemetry_cp_stats_request.

CRs-Fixed: 3387941
Change-Id: I40a7f7223717fa681978421d5d2b4a67018f77dd
2023-02-16 03:07:50 -08:00
Jeff Johnson
eb0f6c63bd qcacmn: Fix umac/cp_stats documentation
The kernel-doc script identified some documentation errors in the
umac/cp_stats folder, so fix them.

Change-Id: Ib99f6c4f7e0f83531949509d1040cee5590bd345
CRs-Fixed: 3380566
2023-01-26 19:35:30 -08:00
Mukul Dhiman
c56d208844 qcacmn: Add wmi support to extract telemetry stats from FW
Add wmi support to extract telemetry stats from FW.

Change-Id: I050b22b594145739adcf7ddf8e6fc85866a27625
CRs-Fixed: 3376698
2023-01-22 22:26:01 -08:00
Mukul Dhiman
b590809644 qcacmn: Add wmi support to get telemetry stats from FW
Add wmi support to get telemetry stats from FW.

Change-Id: I7aec4ff19dc0a23755f572d3bca32f8491c60a5b
CRs-Fixed: 3376707
2023-01-22 22:25:44 -08:00
Pooventhiran G
e69557093d qcacmn: Fix Rx PN error stats for broadcast mgmt frames
Rx PN error stats for broadcast management frames is being tracked
as a ucast stats. Fix it to be tracked as part of mcast stats.

Change-Id: If76c512107728b792ed6d92d56036325592f0fd1
CRs-Fixed: 3361840
2023-01-05 14:30:52 -08:00
Jeff Johnson
88c15dadbb qcacmn: Fix misspelling "recevied"
Multiple instances of the misspelling "recevied" are present, so
replace them with the correct spelling "received."

Change-Id: Ibd7f4a136541be8aa98f5bee4db7f75af0271f53
CRs-Fixed: 3273526
2022-08-28 19:08:26 -07:00
Manoj Ekbote
e78a527ac1 qcacmn: TWT componentization changes
Include relevant header for MAX_SESSIONS and use
the correct build flag to retrieve session params.

CRs-Fixed: 3136148
Change-Id: I28ef98a67cbe479c5d8be93c49f9ae6ce63ba982
2022-02-28 09:10:11 -08:00
Srinivas Girigowda
f048242a78 qcacmn: Add support for twt get_status cp_stats changes
Add support for twt get_status cp_stats changes

Change-Id: Iac1039876d6bb50504af6fec2f976253e3a1ead3
CRs-Fixed: 3085698
2022-02-11 00:25:56 -08:00
Srinivas Girigowda
75335f0708 qcacmn: Add support for WMI_TWT_SESSION_STATS_EVENT
Add support for WMI_TWT_SESSION_STATS_EVENT.

Change-Id: I7bee07360824ca599c82d9dc3f1709acb00466d8
CRs-Fixed: 3085541
2022-02-11 00:25:41 -08:00
Pooventhiran G
886ce189d0 qcacmn: Track PN failures with relevant stats
When validating MMIE, if PN error is found, track it using relevant
statistics. Defined WMI_HOST_RXERR_PN to flag such PN errors.

Change-Id: Icb1fe9a653f67611539b5cb463adfceadedae38e
2022-02-02 03:16:24 -08:00
Ashish
0d31a3986e qcacmn: Add support to query BMISS stats from fw
Currently there is no support to read bmiss stats from fw.
With this change, add support to read bmiss stats from fw.

Change-Id: I75dee16fffac88303f22742eda1985dc15c6ec15
CRs-Fixed: 3097302
2022-01-03 02:19:51 -08:00
Rajasekaran Kalidoss
b60109631e qcacmn: Add Support for request control path stats
Add support in cp stats component for the control path
stats infrastructure provided by firmware via
WMI_REQUEST_CTRL_PATH_STATS_CMDID and
WMI_CTRL_PATH_STATS_EVENTID. Also add support for TWT
type operations over this infrastructure.

Change-Id: I154babff396ac39c11c7548ad91cc4dc0d0c52af
CRs-Fixed: 2847603
2021-01-21 23:24:03 -08:00
Gururaj Pandurangi
abb7ffcac0 qcacmn: Add rate limit macro for cp stats module ID
Add a new macro cp_stats_err_rl to rate limit certain
cp statistics logs.

Change-Id: I375ce2545c1eba2e568905ce76750cdf2f24bafd
CRs-Fixed: 2788221
2020-10-01 14:40:52 -07:00
gaurank kathpalia
dcc847a925 qcacmn: MCL specific movement from cmn to cld of stats
Move the MCL specific files related to cp stats from
the cmn to cld folder.

Change-Id: I62076512b1b407342338d4612087edd3ba2296df
CRs-Fixed: 2552452
2020-04-17 07:37:08 -07:00
Abhishek Singh
5b92984b0b qcacmn: Optimize cp stats prints
Optimize cp stats prints

Change-Id: Idbaa19cc22e2ebcefdbae08169071203cd6ccc49
CRs-Fixed: 2633501
2020-03-03 18:55:32 -08:00
Liangwei Dong
4f2b0feab6 qcacmn: Fix memory leak in get_station_stats_cb
There is memory leak in get_station_stats_cb:
priv->vdev_summary_stats, priv->vdev_chain_rssi,
priv->peer_adv_stats. But the “request” is not leaked,
that means the “.dealloc” should be called.
The suspect is the get_station_stats_cb was called two
times with same cookie (request) before the "request"
was freed, that caused the priv->vdev_summary_stats
and the others two member of "priv" were overwritten,
and then memory leaks.

From the cp stats components there are multiple places
to call ucfg_mc_cp_stats_reset_pending_req to reset the
unused pending.req(has a cookie) to zero.  The zero
cookie may be used in again.

Change the ucfg_mc_cp_stats_reset_pending_req API to do
atomic operation of "reset" and "get" last pending
request.

Change-Id: I5efb7efec4da1edc0aab33b940dc126012a3f12e
CRs-Fixed: 2622444
2020-02-25 21:58:50 -08:00
Sourav Mohapatra
9fae7f7537 qcacmn: Clean up logs in STATS path
Clean up logs in STATS request and response path.

Change-Id: I45135233eb4c10793dc9c62f28d91c49183a0a09
CRs-Fixed: 2618310
2020-02-19 04:58:56 -08:00
Jianmin Zhu
c310645579 qcacmn: Fix get peer stats cmd timeout
Request is cleared before response for race condition between request
thread wificond and response work thread.
1. wificond thread sent get peer request and waited for
response.
2. worker thread got response from F/W, completed the request.
3. Wificond got the response, finished the request.
4. wificond triggered another get peer request, created
new request, set pending request bit TYPE_PEER_STATS.
5. Kworker thread clear the pending request bit
TYPE_PEER_STATS.
6. Cleared request TYPE_PEER_STATS couldn't be completed any
more, wificond thread waited for 1.6s, timeout happened.

Fix: Clear pending request bit TYPE_PEER_STATS before
complete the request, make sure old pending request bit is
cleared before new request of same type is set.

Change-Id: I058cada5fa870d95172122364903bff2b31eb277
CRs-Fixed: 2621914
2020-02-16 13:08:27 -08:00
Jianmin Zhu
587fdeec25 qcacmn: Fix get station stats cmd timeout
Request is cleared before response for race condition between request
thread wificond and response work thread.
1. wificond thread sent cp_stats_get request and waited for
response.
2. worker thread got response from F/W, completed the request.
3. Wificond got the response, finished the request.
4. wificond triggered another cp_stats_get request, created
new request, set pending request bit TYPE_STATION_STATS.
5. Kworker thread clear the pending request bit
TYPE_STATION_STATS.
6. Cleared request TYPE_STATION_STATS couldn't be completed any
more, wificond thread waited for 1.6s, timeout happened.

Fix: Clear pending request bit TYPE_STATION_STATS before
complete the request, make sure old pending request bit is
cleared before new request of same type is set.

Change-Id: I7b89571b1e95a6e17aec9d649bd3adfccf3eb02e
CRs-Fixed: 2619370
2020-02-13 22:09:31 -08:00
Hangtian Zhu
7788a89ccd qcacmn: Fix compile issues when some features are disabled
Fix compile issues when some features are disabled, the features are:
BUILD_DEBUG_VERSION
CONFIG_CP_STATS
CONFIG_HOST_OPCLASS
CONFIG_FEATURE_ROAM_DEBUG
There are some other features depends on each other, so enabled features to
qcs40x.snoc.perf_defconfig, the features are:
CONFIG_WLAN_FEATURE_FILS
CONFIG_WMI_ROAM_SUPPORT
CONFIG_WMI_STA_SUPPORT
CONFIG_REG_CLIENT
CONFIG_WLAN_FEATURE_DP_BUS_BANDWIDTH
CONFIG_WMI_CONCURRENCY_SUPPORT
CONFIG_LL_DP_SUPPORT

Change-Id: I6fa1eacb79576a955e593dbb9ac52083742275e3
CRs-Fixed: 2584839
2019-12-18 23:55:00 -08:00
Liangwei Dong
7628a42ab1 qcacmn: Add VHT/HE 160Mhz rate flag
Add TX_RATE_HE160 and TX_RATE_VHT160 for 160Mhz
rate report.

Change-Id: Ica39b5dd65f1ca5bedece344456bb4e628b406af
CRs-Fixed: 2583923
2019-12-17 16:38:42 -08:00
tinlin
21f7286344 qcacmn: Add MIB statistics
Add new stats_id WMI_REQUEST_MIB_STATS &
WMI_REQUEST_MIB_EXTD_STATS in WMI_REQUEST_STATS_CMDID
to retrieve MIB statistics from fw.

Change-Id: I17bccc2673d1a2ce035db04d8426bab49db80790
CRs-Fixed: 2548165
2019-12-01 17:42:21 -08:00
Ashish Kumar Dhanotiya
758e340721 qcacmn: Move wow wakeup stats from vdev to psoc level stats
Currently wow wake up stats are maintained on vdev level,
since wow wake up stats are system level stats, stats on
the vdev gets reset on vdev destroy.
To resolve above issue store wow wake up stats to psoc level
stats so that stats are present even after vdev start.

Change-Id: I74aea1baa1d9168de3cb9142a24e73654910a48d
CRs-fixed: 2541661
2019-10-26 13:23:25 -07:00
Jingxiang Ge
0303830a0f qcacmn: Add 11ax tx_rate_info info
Add 20/40/80 11ax tx_rate_info info which will be
used for 11ax linkspeed display.

Change-Id: Idfc4c7bd4c4775fd258fb088285b9cee240f8e3a
CRs-Fixed: 2548462
2019-10-26 08:12:04 -07:00
Arun Kumar Khandavalli
9447e47cbb qcacmn: For pdev stats return last event as true for older firmware
In case of latest firmware, there can be multiple pdev stats events
received and last_bit is set in the pdev stats to indicate this
is a last pdev stats event to be sent from the firmware to host.
In case of older firmware the last bit will not be set and host waits
for the peer stats event to be the last event, generally for pdev
specific stats request the peer stats will not be sent resulting in
the timeout for the pdev specific stats.

So, if the last_bit in the stats is not present return true when
queried for last event.

Change-Id: I264428edba01285fdab4c109a9051b350063d74f
CRs-Fixed: 2509093
2019-08-19 03:57:19 -07:00
Ashish Kumar Dhanotiya
0cf77a56ea qcacmn: Process All the pdev stats events
There are 2 issues in the driver:
1. Currently host incorrectly fills the pdev id value as 0
   in stats request, If host sends the pdev id as 0 for
   stats request then FW sends the stats for all the pdevs.
2. If host requests pdev stats with pdev id as 0,
   FW can send multiple events for each pdev stats
   if one event buffer is not sufficient to fill the stats
   for all the pdevs. Curent host logic doesn't process
   multiple pdev stats events.

Address above 2 issues with below fixes:
1. Send correct pdev id to FW in the stats command.
2. Add a logic in host to process all the pdev stats events
   received as part of the pdev stats request.

Change-Id: I5b5bfcda2f30fb32749c653c6524ecbd2edc44a4
CRs-Fixed: 2503273
2019-08-13 07:33:27 -07:00
Sourav Mohapatra
791789e341 qcacmn: Add case to increment ICMP req frames in stats
Currently while processing wakeup stats, the driver doesnot increment
the icmpv4 packet count in case of a ICMP req frame. This causes only
the unicast packet counts to be incremented.

Add a case in function ucfg_mc_cp_stats_inc_wake_lock_stats_by_protocol
to increment the count in the above mentioned case also.

Change-Id: I0ee3e6e91f3bc7a8d9043af1af46739037cb7678
CRs-Fixed: 2439237
2019-08-05 06:12:54 -07:00
Ashish Kumar Dhanotiya
3af27eb408 qcacmn: Process FW stats event on VDEV_DOWN
FW sends vdev stats on vdev down, current host
implementation does not process this event as host is
only processing the stats events for which stats are
requested.
On vdev down FW sends the last available vdev stats and
based on that host updates it's RSSI on disconnect.
With CP stats infrastructure host is not processing
this event and is not updating rssi on disconnect.

To address above issue add a logic to process all the
vdev stats event received by host.

Change-Id: I9a5c32d061562cd3e3741cd9fe4a69f3278e7a98
CRs-Fixed: 2497104
2019-08-01 01:40:17 -07:00
Sourav Mohapatra
f31c071fd5 qcacmn: Move peer_adv_stats to MC specific peer_mc_cp_stats struct
Currently peer_adv_stats is present in peer_cp_stats structure
which is shared between WIN and MCL and only common features
should be part of this structure as peer_cp_stats is an
abstraction structure for WIN and MCL for cp stats component.
Since peer_adv_stats is MCL specific structure, this should be
moved to peer_mc_cp_stats which is MCL specific feature for
cp stats component.

Change-Id: Id46cdd153aa6b8137c24fdca30365221d2646d3f
CRs-Fixed: 2480147
2019-07-25 12:25:21 -07:00
Ashish Kumar Dhanotiya
c3001e4291 qcacmn: Remove invalid log from cp stats
While processing stats event there is an invalid debug
log which is always getting printed and resulting in
confusing loging.
Remove this invalid log from the stats event handling.

Change-Id: I5c60bf73b6b01afce82ebf93e19254f6e302042f
CRs-Fixed: 2493076
2019-07-20 00:36:41 -07:00
Ashish Kumar Dhanotiya
5255c99b43 qcacmn: Complete stats request on receiving last event
When driver requests for stats to FW, FW sends response with
all the requested stats, in this case if the FW buffer gets
filled it sends the remaining stats in next event and FW keeps
sending the stats event until it sends all the requested stats.
FW sets is_last_event field in the response event if the event
is the last event for the requested stats.
Currently driver is parsing only first event and completing the
request from all these events and not checking the last event
bit when it requests for peer stats because of which some of the
stats are getting dropped.

To avoid above issue, add a logic to check the last event bit set
by FW and complete the request only if FW sets the last event bit
in the response event.

Change-Id: Ia3a2f2b4960579ac67bbf1354755af9c2098975a
CRs-Fixed: 2470910
2019-06-25 13:07:05 -07:00
Tushnim Bhattacharyya
3f953f7193 qcacmn: Reduce log level for stats message
Reduce log level in tgt_mc_cp_stats_process_stats_event,
tgt_mc_cp_stats_update_peer_adv_stats &
tgt_mc_cp_stats_extract_peer_stats from error to debug because
a stats event can be received unsolicited.

Change-Id: I5ad216034eefd8197f80c2a50e8ae0833b149d06
CRs-Fixed: 2471465
2019-06-20 20:15:24 -07:00
Tushnim Bhattacharyya
21169b7e07 qcacmn: Reduce log level for stats message
Reduce log level from error to debug because a stats event can be
received unsolicited.

Change-Id: I11f3800594c6d623e72a214d832caa29666565a8
CRs-Fixed: 2466944
2019-06-11 09:51:00 -07:00
Ashish Kumar Dhanotiya
788ab15578 qcacmn: Move peer_extd_stats to peer_mc_cp_stats structure
Currently peer_extd_stats is present in peer_cp_stats structure
which is shared between WIN and MCL and only common features
should be part of this structure as peer_cp_stats is an
abstraction structure for WIN and MCL for cp stats component.
Since peer_extd_stats is MCL specific structure, this should be
moved to peer_mc_cp_stats which is MCL specific feature for
cp stats component.

Change-Id: I18c30db36d34dd3fb3e4f8ad2d3c553c4648548b
CRs-fixed: 2427126
2019-05-06 00:57:57 -07:00
Rajeev Kumar
0b1c7569cb qcacmn: Add dummy implementation of CP stats PMO handler
Add dummy implementation of CP stats PMO handler in case
QCA_SUPPORT_CP_STATS is not defined.

Change-Id: Ibe6fe863b0aa31bfda4431887a4f9dae5e74ae69
CRs-Fixed: 2439858
2019-04-29 04:17:51 -07:00
Rajeev Kumar
aba8b2edd2 qcacmn: Stats: Add handling of pmo suspend resume
Register pmo suspend resume handler to disable/enable stats requests.

Change-Id: If1112e3ef23bfa53f107eb5a668189da4f83bd0c
CRs-Fixed: 2406729
2019-04-18 00:28:40 -07:00
Harprit Chhabada
8f06c8286f qcacmn: Move the level of some cp stats from kernel to driver
Move some stats from tgt_mc_cp_stats_extract_vdev_summary_stats
and  target_if_cp_stats_extract_vdev_chain_rssi_stats, from kernel
to driver

Change-Id: I3475421828b51a229af4ac3ff6087d7ebb311c33
CRs-Fixed: 2430565
2019-04-11 01:14:25 -07:00
Ashish Kumar Dhanotiya
5e3af684b5 qcacmn: Add support to cache peer capability info
Currently capability information and RX multicast broadcast
packet count of the connected peer is not getting
cached.
Add support to cache the capability info from assoc request and
RX multicast broadcast packets from FW.

Change-Id: I105e055b1e440852e8e6b508c25e45f79db2d062
CRs-Fixed: 2409521
2019-04-08 10:50:14 -07:00
Paul Zhang
57ff3231aa qcacmn: resolve time out issue for get tx power
Currently, clearing the TYPE_CONNECTION_TX_POWER is
doing after the callback get_tx_power_cb.

Timeout issue happens because:
1\ the callback get_tx_power_cb is interrupted
   after invoking osif_request_complete.
2\ __wlan_hdd_cfg80211_get_txpower is called again
   and setting TYPE_CONNECTION_TX_POWER.
3\ the callback is rescheduled and clears the bit
   TYPE_CONNECTION_TX_POWER.
4\ Because the bit TYPE_CONNECTION_TX_POWER is cleared,
   and callback won't be invoke.

Change-Id: I6a5b155d2274551b637dc22095d292a70f836700
CRs-Fixed: 2418587
2019-03-29 11:05:55 -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
Sourav Mohapatra
d768fd9e1e qcacmn: Extract and populate peer_extd2 stats from fw
Presently, the driver doesnot extract the peer extended2 stats
(rx_bytes, rx_count, fcs_err) that are received from firmware.

Provide the support to extract and populate the peer extended stats2 at
the driver level.

Change-Id: If1f1bb1ef2d1202581744dd509d0da1da718d8c1
CRs-Fixed: 2397638
2019-03-18 09:53:02 -07:00
Madhvapathi Sriram
b73fc282d8 qcacmn: Remove error log for qdf_mem_malloc in umac files
qdf layer already has the error trace

Change-Id: I2ea22fe0e3e59b9d41ac21142615ffb96227abaf
CRs-Fixed: 2376418
2019-03-04 07:30:21 -08:00
Sourav Mohapatra
195164b7bb qcacmn: Populate proper rates received by FW
Due to unknown legacy reason, the rates received by the driver from the
firmware are currently divided by 500 to convert it into units of
500kbps. This division by 500 is later compensated by a multiplication
with 5 to maintain units of 100kbps before being sent to the upper
layer. This division and then subsequent multiplication results in the
loss of precision (in the case the rate is not divisible by 5).
Consequently, the rate being sent to the upper layer becomes inaccurate.
Also the calculation of the MCS rate flags is affected.

Do not carry out the unnecessary division and multiplication by 5.
Instead just convert the rates into units of 100kbps (which is as
mandated by the kernel) when driver receives the rate from the firmware.

Change-Id: Iab7b825f4067ad51174a0c545cf4a7d0ab426171
CRs-Fixed: 2378167
2019-01-15 03:13:28 -08:00
Yeshwanth Sriram Guntuka
c4a14ea149 qcacmn: Add host support for db2dbm RSSI changes
Add host support for db2dbm RSSI changes. Firmware
indicates this capability when underlying hardware
has RSSI reporting feature. Based on this capability
host will know if firmware sends SNR or RSSI. If no
capablity is present then host will convert SNR to
rssi using a fixed offset of -96. If capability is
present host will directly use the rssi as it is.

Change-Id: I9058f16c6280d466feb96cf88a8a0d8cd7b02032
CRs-Fixed: 2364025
2018-12-24 03:33:04 -08:00
Naga
cb25801fa9 qcacmn: Delete WIN specific files from cp_stats
Delete WIN specific files in cmd_dev cp_stats component
and add them in component_dev cp_stats

Change-Id: I16d0e251452225403e3e25f63a5105026c8f258c
2018-12-05 20:34:16 -08:00
Liangwei Dong
77d877285a qcacmn: Get peer with ref count
wlan_vdev_get_bsspeer doesn't hold ref
count on peer.
Use wlan_objmgr_get_peer to get peer
to avoid peer free race condition.

Change-Id: I04bfcf8ca20fa49d81a9e59aafc31caab98374a1
CRs-Fixed: 2337868
2018-10-24 23:00:24 -07:00
Naga
478d035baa qcacmn: Enhance cp stats component
Add new fields tx_tooshort, tx and rx discard
control plane stats at vdev level

CRs-Fixed: 2327398
Change-Id: I9f3ae1f4d043319fec8f08752d9112ab5e9f6ef9
2018-10-24 09:53:55 -07:00
Arif Hussain
b91687b07b qcacmn: Fix validation of stats_req_type in stats component
Use correct validation range.

Change-Id: I8ba12efee1f2ffac5a2193c7f9f5a5e44a1c8301
CRs-Fixed: 2326371
2018-10-03 14:13:57 -07:00
Sourav Mohapatra
23310e82bb qcacmn: Add support to send RX stats to framework
As a part of the cfg80211_get_station command, the driver sends TX stats
(tx rate, MCS index, NSS and flags). Currently there is no support to
send the similar RX stats.

Add support to send RX stats to the framework.

Change-Id: Ic66596d118ad1395706db7638da1b4fdef7dc2d5
CRs-Fixed: 2303308
2018-09-10 17:45:04 -07:00