qcacld-3.0: Move get_peer_info into cp_stats component

Move WMI_REQUEST_PEER_STATS_INFO_CMDID related statistics into
cp_stats component.

Change-Id: I636221b0bc0e28180c97cd269440a7c733716a1d
CRs-Fixed: 2680618
Этот коммит содержится в:
Min Liu
2020-05-06 20:45:45 +08:00
коммит произвёл snandini
родитель 2600ecf4bc
Коммит f7d6bc2675
22 изменённых файлов: 1109 добавлений и 612 удалений

Просмотреть файл

@@ -28,6 +28,8 @@
#include "wlan_cmn.h"
#include "qdf_event.h"
/* For WMI_MAX_CHAINS */
#include "wmi_unified.h"
#ifdef WLAN_SUPPORT_TWT
@@ -53,12 +55,14 @@
* @TYPE_STATION_STATS: station stats was requested
* @TYPE_PEER_STATS: peer stats was requested
* @TYPE_MIB_STATS: MIB stats was requested
* @TYPE_PEER_STATS_INFO_EXT: peer stats info ext was requested
*/
enum stats_req_type {
TYPE_CONNECTION_TX_POWER = 0,
TYPE_STATION_STATS,
TYPE_PEER_STATS,
TYPE_MIB_STATS,
TYPE_PEER_STATS_INFO_EXT,
TYPE_MAX,
};
@@ -184,6 +188,8 @@ struct request_info {
void *cookie);
void (*get_mib_stats_cb)(struct stats_event *ev,
void *cookie);
void (*get_peer_stats_cb)(struct stats_event *ev,
void *cookie);
} u;
uint32_t vdev_id;
uint32_t pdev_id;
@@ -497,6 +503,40 @@ struct chain_rssi_event {
int8_t chain_rssi[MAX_NUM_CHAINS];
};
/**
* struct peer_stats_info_ext_event - peer extended stats info
* @peer_macaddr: MAC address
* @tx_packets: packets transmitted to this station
* @tx_bytes: bytes transmitted to this station
* @rx_packets: packets received from this station
* @rx_bytes: bytes received from this station
* @tx_retries: cumulative retry counts
* @tx_failed: the number of failed frames
* @tx_succeed: the number of succeed frames
* @rssi: the signal strength
* @tx_rate: last used tx bitrate (kbps)
* @tx_rate_code: last tx rate code (last_tx_rate_code of wmi_peer_stats_info)
* @rx_rate: last used rx bitrate (kbps)
* @rx_rate_code: last rx rate code (last_rx_rate_code of wmi_peer_stats_info)
* @peer_rssi_per_chain: the average value of RSSI (dbm) per chain
*/
struct peer_stats_info_ext_event {
struct qdf_mac_addr peer_macaddr;
uint32_t tx_packets;
uint64_t tx_bytes;
uint32_t rx_packets;
uint64_t rx_bytes;
uint32_t tx_retries;
uint32_t tx_failed;
uint32_t tx_succeed;
int32_t rssi;
uint32_t tx_rate;
uint32_t tx_rate_code;
uint32_t rx_rate;
uint32_t rx_rate_code;
int32_t peer_rssi_per_chain[WMI_MAX_CHAINS];
};
/**
* struct stats_event - parameters populated by stats event
* @num_pdev_stats: num pdev stats
@@ -518,6 +558,8 @@ struct chain_rssi_event {
* @tx_rate_flags: tx rate flags, (enum tx_rate_info)
* @last_event: The LSB indicates if the event is the last event or not and the
* MSB indicates if this feature is supported by FW or not.
* @num_peer_stats_info_ext: number of peer extended stats info
* @peer_stats_info_ext: peer extended stats info
*/
struct stats_event {
uint32_t num_pdev_stats;
@@ -541,6 +583,56 @@ struct stats_event {
uint32_t rx_rate;
enum tx_rate_info tx_rate_flags;
uint32_t last_event;
uint32_t num_peer_stats_info_ext;
struct peer_stats_info_ext_event *peer_stats_info_ext;
};
/**
* struct peer_stats_request_params - peer stats request parameter
* @request_type: request type, one peer or all peers of the vdev
* @vdev_id: vdev id
* @peer_mac_addr: peer mac address, omitted if request type is all peers
* @reset_after_request: whether reset stats after request
*/
struct peer_stats_request_params {
uint32_t request_type;
uint32_t vdev_id;
uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
uint32_t reset_after_request;
};
/**
* struct wmi_host_peer_stats_info - WMI peer stats info
* @peer_macaddr: peer mac address
* @tx_bytes: tx_bytes
* @tx_packets: tx packets
* @rx_bytes: rx_bytes
* @rx_packets: rx packets
* @tx_retries: tx retries of MPDU
* @tx_failed: tx failed MPDU
* @last_tx_rate_code: rate code of the last tx
* @last_rx_rate_code: rate code of the last rx
* @last_tx_bitrate_kbps: bitrate in bps of the last tx
* @last_rx_bitrate_kbps: bitrate in bps of the last rx
* @peer_rssi: peer rssi
* @tx_succeed: tx succeed MPDU
* @peer_rssi_per_chain: peer rssi per chain
*/
typedef struct {
struct qdf_mac_addr peer_macaddr;
uint64_t tx_bytes;
uint32_t tx_packets;
uint64_t rx_bytes;
uint32_t rx_packets;
uint32_t tx_retries;
uint32_t tx_failed;
uint32_t last_tx_rate_code;
uint32_t last_rx_rate_code;
uint32_t last_tx_bitrate_kbps;
uint32_t last_rx_bitrate_kbps;
int32_t peer_rssi;
uint32_t tx_succeed;
int32_t peer_rssi_per_chain[WMI_MAX_CHAINS];
} wmi_host_peer_stats_info;
#endif /* __WLAN_CP_STATS_MC_DEFS_H__ */

Просмотреть файл

@@ -584,6 +584,35 @@ static void tgt_mc_cp_stats_extract_mib_stats(struct wlan_objmgr_psoc *psoc,
}
#endif
static void
tgt_mc_cp_stats_extract_peer_stats_info_ext(struct wlan_objmgr_psoc *psoc,
struct stats_event *ev)
{
QDF_STATUS status;
struct request_info last_req = {0};
bool pending = false;
if (!ev->peer_stats_info_ext || ev->num_peer_stats_info_ext == 0) {
cp_stats_debug("no peer_stats_info_ext");
return;
}
status = ucfg_mc_cp_stats_get_pending_req(psoc,
TYPE_PEER_STATS_INFO_EXT,
&last_req);
if (QDF_IS_STATUS_ERROR(status)) {
cp_stats_err("ucfg_mc_cp_stats_get_pending_req failed");
return;
}
ucfg_mc_cp_stats_reset_pending_req(psoc, TYPE_PEER_STATS_INFO_EXT,
&last_req, &pending);
if (last_req.u.get_peer_stats_cb && pending) {
last_req.u.get_peer_stats_cb(ev, last_req.cookie);
last_req.u.get_peer_stats_cb = NULL;
}
}
static void tgt_mc_cp_stats_extract_cca_stats(struct wlan_objmgr_psoc *psoc,
struct stats_event *ev)
{
@@ -915,6 +944,9 @@ QDF_STATUS tgt_mc_cp_stats_process_stats_event(struct wlan_objmgr_psoc *psoc,
if (ucfg_mc_cp_stats_is_req_pending(psoc, TYPE_MIB_STATS))
tgt_mc_cp_stats_extract_mib_stats(psoc, ev);
if (ucfg_mc_cp_stats_is_req_pending(psoc, TYPE_PEER_STATS_INFO_EXT))
tgt_mc_cp_stats_extract_peer_stats_info_ext(psoc, ev);
tgt_mc_cp_stats_extract_cca_stats(psoc, ev);
tgt_mc_cp_send_lost_link_stats(psoc, ev);
@@ -942,12 +974,29 @@ QDF_STATUS tgt_send_mc_cp_stats_req(struct wlan_objmgr_psoc *psoc,
struct request_info *req)
{
struct wlan_lmac_if_cp_stats_tx_ops *tx_ops;
QDF_STATUS status;
tx_ops = target_if_cp_stats_get_tx_ops(psoc);
if (!tx_ops || !tx_ops->send_req_stats) {
if (!tx_ops) {
cp_stats_err("could not get tx_ops");
return QDF_STATUS_E_NULL_VALUE;
}
return tx_ops->send_req_stats(psoc, type, req);
switch (type) {
case TYPE_PEER_STATS_INFO_EXT:
if (!tx_ops->send_req_peer_stats) {
cp_stats_err("could not get send_req_peer_stats");
return QDF_STATUS_E_NULL_VALUE;
}
status = tx_ops->send_req_peer_stats(psoc, req);
break;
default:
if (!tx_ops->send_req_stats) {
cp_stats_err("could not get send_req_stats");
return QDF_STATUS_E_NULL_VALUE;
}
status = tx_ops->send_req_stats(psoc, type, req);
}
return status;
}

Просмотреть файл

@@ -850,6 +850,7 @@ void ucfg_mc_cp_stats_free_stats_resources(struct stats_event *ev)
qdf_mem_free(ev->vdev_summary_stats);
qdf_mem_free(ev->vdev_chain_rssi);
qdf_mem_free(ev->peer_extended_stats);
qdf_mem_free(ev->peer_stats_info_ext);
qdf_mem_zero(ev, sizeof(*ev));
}