Commit Graph

71 Commits

Author SHA1 Message Date
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
Rajasekaran Kalidoss
caa1764721 qcacmn: Register cp stats legacy ops
Currently there is no support to register both common cp stats
ops and MC specific cp stats ops. Add support to register common
ops and MC/WIN specific cp stats ops.

Change-Id: Ibaee9da8b1ce3185161821f2be751d8bb4bf10e2
CRs-Fixed: 2851235
2021-01-12 17:44:42 -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
suresh
0ddf3353fd qcacmn: Remove DA source code dependency
Remove DA header file reference and other DA
dependent code changes.

Change-Id: I49804f753390b8952e45679b178162dd60bb43f6
2020-09-03 01:58:32 -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
Himanshu Batra
d9f04e1c71 qcacmn: Replace void * data members of cp_stats with specific type
Replace cp_stats void * data members having different types
across different drivers with specific type

Change-Id: I5497df358e495aaf187097b093622b34ab637f42
CRs-Fixed: 2477447
2019-07-26 18:22:01 -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
Harprit Chhabada
38d7f92a30 qcacmn: Fix null pointer dereference, wlan_cp_stats_psoc_obj_create_handler
In wlan_cp_stats_psoc_obj_create_handler() multiple error paths
lead to label wlan_cp_stats_psoc_obj_create_handler_return.

In the label, posc_cs is not null checked before passing to the
csc->cp_stats_psoc_obj_deinit() causing NULL pointer dereference.

Change-Id: I82a48cee7d2734a96960aeedff42fc4cdf94bf9c
CRs-Fixed: 2336830
2018-10-25 01:38:00 -07: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
Arif Hussain
89557a3838 qcacmn: Validate stats_req_type type before use as index of req array
Validate type which is used as index of req array to avoid any
out of bond access issue.

Change-Id: I75d08054b94b7066f7bdc030cf9896469c923a65
CRs-Fixed: 2305555
2018-09-06 07:20:00 -07:00
Naga
e85b72a4ae qcacmn: Add support for Extended BSS IE
Add implementation to enhance structure
corresponding to WMI_DCS_INTERFERENCE_EVENT_ID
handler in cp stats component which hold
secondary 40 and 80MHz utilization
which are required parameters of Extended BSS IE

Change-Id: I1c471608394d5c395632742098d2c92fc02ec238
CRs-Fixed: 2298073
2018-09-06 01:42:16 -07:00
Debasis Das
72521f8c0a qcacmn: Support channel utilization stats
Provide support for following channel utilization stats:
self_bss_util,obss_util,ap_rx_util,free_medium,
ap_tx_util,obss_rx_util,non_wifi_util

Change-Id: Ib1358988ae0b5794e70ba4348a78646e9d2a6cba
CRs-Fixed: 2298865
2018-08-28 13:09:48 -07:00
Arif Hussain
35d89071c2 qcacmn: Refactor cp status callback handlers
Duplicate stats buffer in the callback so that all
allocations get freed by its owner, this will avoid
memory leak issue because of race condition between
umac and upper layer.

Change-Id: Id18d75eb9adc46a6147634eb5b1e0babe32c7c37
CRs-Fixed: 2289355
2018-08-09 14:34:22 -07:00
Naga
5233ffe848 qcacmn: Enhance cp_stats component
Add implementation to remove unused stats from pdev, vdev
peer cp_stats structure, reorder ol_ath_radiostats and
add inline macro for phy_err

Change-Id: Id91f11526c03bf14dfc285a1c87b24c8e5e00b02
CRs-Fixed: 2262329
2018-06-22 02:58:56 -07:00
Visudha Sathurappan
3ca68af4ff qcacmn: Support PDEV CP Stats for DA
Add change to define pdev cp stats structure
for DA and provide APIs to get/set cp stats

Change-Id: Ib46d8b55b4c38b2c7a9e2bea45977de23ad21939
2018-06-14 13:04:52 -07:00
Naga
6f5ff952ab qcacmn: Add implementation of dcs chan stats
Add change to provide API to get DCS chan stats
structure from within cp stats component

Change-Id: Ie67725931f8c9b4870c711e560b06b41854a1af0
CRs-Fixed: 2236328
2018-05-24 07:52:20 -07:00
Naga
a488d16e81 qcacmn: Add implementation for atf peer cp stats
Add change to provide API to get ATF peer
cp stats structure from within cp stats component

Change-Id: I8465bd04e915419abb8de2d35d039ab812727ab1
CRs-Fixed: 2236328
2018-05-24 07:52:17 -07:00