Commit Graph

56 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Naga
5ce6fc8d9a qcacmn: Add implementation of pdev cp stats
Add change to define pdev cp stats structure
and provide APIs to set cp stats fields
into cp stats component

Change-Id: I6559a19e11771d16e9207fb0a2fee96f620273b0
CRs-Fixed: 2236328
2018-05-24 07:52:15 -07:00
Naga
6a72f69904 qcacmn: Add implementation of vdev ucast and mcast cp stats
Add change to define vdev ucast and mcast cp stats
structure and provide APIs of set/get cp stats fields
to/from within cp stats component

Change-Id: I341ca6188c052438e1fea4f9326428b59a1db660
CRs-Fixed: 2236328
2018-05-24 07:52:10 -07:00
Naga
d8351b4740 qcacmn: Add implementation of peer cp stats
Add change to define peer cp stats structure
and provide APIs to set/get peer cp stats fields
to/from within cp stats component

Change-Id: I2d1a8d166a3e0ce5992eb670c83f6f5d37441dd1
CRs-Fixed: 2236328
2018-05-24 07:52:07 -07:00
Naga
670e851c19 qcacmn: Add implementation of WIN cp stats
Add change to alloc memory for WIN specific cp stats
structures, provide get/set API in cp stats component
for other umac component, reorganize files according
to usage inclusion in other header files

Change-Id: I8b4e4435f60cc0587917ad09ac99659f83f2cb10
CRs-Fixed: 2236328
2018-05-24 07:52:05 -07:00
Naveen Rawat
b901c80874 qcacmn: Fix compilation error in CP_STATs
Fix compilation error in CP_STATs due to change in definition
of of wlan_objmgr_get_peer.

Change-Id: I15753d942dd3932fbf0d2c8a361e5e507fd38b8e
CRs-Fixed: 2244161
2018-05-20 23:25:56 -07:00
Naveen Rawat
3d57f51826 qcacmn: Add umac implementation of get_stations_stats
Add changes to support get station stats from within the cp stats
component.

Change-Id: I3063125fe8c747f21f00b6f027da38010a2bdc61
CRs-Fixed: 2210313
2018-05-16 23:20:10 -07:00
Naga
78f803eb1e qcacmn: Remove DA specific from common cp_stats
Remove DA specific init APIs from common cp_stats and
change logic to not return callback status for psoc close
and disable to override devpool issue for DA arch

CRs-Fixed: 2224153
Change-Id: Ie5bfb7cb7773d3fc09237a9d14ec3611e78cc06f
2018-05-14 18:00:01 -07:00
Naveen Rawat
7b90f6cdfe qcacmn: Add umac implementation of get congestion stats
Add changes to support get congestion stats(arp stats) from
within cp_stats component.

Change-Id: Ieff7df33dd8f3a8a80cda57952eb8d5941ccaedc
CRs-Fixed: 2222781
2018-05-14 11:39:21 -07:00
Amir Patel
d338594cf9 qcacmn: Update API signature for vdev and peer search to include pdev_id
Add a pdev_id parameter to following API
    For peer:
        a. wlan_objmgr_get_peer()
        b. wlan_objmgr_get_peer_by_mac_n_vdev()
        c. wlan_objmgr_get_peer_by_mac_n_vdev_no_state()
        d. wlan_objmgr_get_peer_no_state()
        e. wlan_objmgr_get_peer_nolock()
        f. wlan_objmgr_populate_logically_
            deleted_peerlist_by_mac_n_vdev()
    For vdev:
        wlan_objmgr_get_vdev_by_macaddr_from_psoc()

Change-Id: I7480c5e17e24b5dfb1a7846cfa773821a86a27ca
CRs-Fixed: 2210118
2018-05-09 01:44:39 -07:00
Naveen Rawat
5f7085d09d qcacmn: Fix vdev ref leak in CP_STATs get_peer_rssi
Fix vdev ref leak in CP_STATs get_peer_rssi.

Change-Id: I583fe8c0c0fabd022fd52b4749a8b324c37ae5e5
CRs-Fixed: 2231395
2018-05-02 04:35:15 -07:00
Naveen Rawat
1a9ee7dc49 qcacmn: Define ucfg api to free stats_event
Define ucfg api to free stats_event, since it will be called from
osif and hdd.

Change-Id: Ifeea3e970ddca1ed508960c39a2a39f0ed755bd9
CRs-Fixed: 2231150
2018-05-02 04:35:12 -07:00