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
This commit is contained in:
Naga
2018-04-24 23:25:41 +05:30
کامیت شده توسط nshrivas
والد efc0b71831
کامیت 670e851c19
14فایلهای تغییر یافته به همراه223 افزوده شده و 480 حذف شده

مشاهده پرونده

@@ -27,66 +27,7 @@
#define __WLAN_CFG80211_IC_CP_STATS_H__
#ifdef QCA_SUPPORT_CP_STATS
#include <linux/version.h>
#include <linux/netdevice.h>
#include <net/cfg80211.h>
#include <wlan_objmgr_cmn.h>
/**
* wlan_cfg80211_register_cp_stats_cmd_handler() - api to register cfg80211
* command handler for cp_stats
* @pdev: Pointer to pdev
* @idx: Index in function table
* @handler: Pointer to function handler
*
* Return: void
*/
void wlan_cfg80211_register_cp_stats_cmd_handler
(struct wlan_objmgr_pdev *pdev,
int idx, void *handler);
/**
* wlan_cfg80211_unregister_cp_stats_cmd_handler() - api to unregister cfg80211
* command handler for cp_stats
* @pdev: Pointer to pdev
* @idx: Index in function table
* @handler: Pointer to function handler
*
* Return: void
*/
void wlan_cfg80211_unregister_cp_stats_cmd_handler
(struct wlan_objmgr_pdev *pdev,
int idx, void *handler);
/**
* wlan_cfg80211_cp_stats_get_atf_stats() - api to get atf stats
* @wiphy: Pointer to wireless phy
* @wdev: Pointer to wireless device
* @data: Pointer to data
* @data_len: Length of @data
*
* Return: Return: 0 on success, negative errno on failure
*/
int wlan_cfg80211_cp_stats_get_atf_stats
(struct wiphy *wiphy,
struct wlan_objmgr_pdev *pdev,
const void *data,
int data_len);
/**
* wlan_cfg80211_cp_stats_get_vow_ext_stats() - api to get vow stats
* @wiphy: Pointer to wireless phy
* @wdev: Pointer to wireless device
* @data: Pointer to data
* @data_len: Length of @data
*
* Return: Return: 0 on success, negative errno on failure
*/
int wlan_cfg80211_cp_stats_get_vow_ext_stats
(struct wiphy *wiphy,
struct wlan_objmgr_pdev *pdev,
const void *data,
int data_len);
#endif /* QCA_SUPPORT_CP_STATS */
#endif /* __WLAN_CFG80211_IC_CP_STATS_H__ */

مشاهده پرونده

@@ -22,17 +22,3 @@
* This file provide definitions to cp stats supported cfg80211 cmd handlers
*/
#include <wlan_cfg80211_ic_cp_stats.h>
int wlan_cfg80211_cp_stats_get_atf_stats(struct wiphy *wiphy,
struct wlan_objmgr_pdev *pdev,
const void *data, int data_len)
{
return 0;
}
int wlan_cfg80211_cp_stats_get_vow_ext_stats(struct wiphy *wiphy,
struct wlan_objmgr_pdev *pdev,
const void *data, int data_len)
{
return 0;
}

مشاهده پرونده

@@ -21,6 +21,10 @@
*
* This file maintain definitions to APIs which handle attach/detach of other
* UMAC component specific cp stat object to cp stats
*
* Components calling configure API should alloc data structure while attaching
* dealloc while detaching, where as address for which to be deallocated will
* be passed back to component for data
*/
#include "wlan_cp_stats_comp_handler.h"
#include "wlan_cp_stats_defs.h"
@@ -30,7 +34,7 @@
static QDF_STATUS
wlan_cp_stats_psoc_comp_obj_config
(struct wlan_objmgr_psoc *psoc, enum wlan_cp_stats_comp_id comp_id,
enum wlan_cp_stats_cfg_state cfg_state, void *comp_priv_obj)
enum wlan_cp_stats_cfg_state cfg_state, void *data)
{
struct psoc_cp_stats *psoc_cs;
@@ -46,13 +50,18 @@ wlan_cp_stats_psoc_comp_obj_config
wlan_cp_stats_psoc_obj_unlock(psoc_cs);
return QDF_STATUS_E_EXISTS;
}
psoc_cs->psoc_comp_priv_obj[comp_id] = comp_priv_obj;
psoc_cs->psoc_comp_priv_obj[comp_id] = data;
} else if (cfg_state == WLAN_CP_STATS_OBJ_DETACH) {
if (psoc_cs->psoc_comp_priv_obj[comp_id] != comp_priv_obj) {
if (psoc_cs->psoc_comp_priv_obj[comp_id] != data) {
wlan_cp_stats_psoc_obj_unlock(psoc_cs);
return QDF_STATUS_E_INVAL;
}
data = psoc_cs->psoc_comp_priv_obj[comp_id];
psoc_cs->psoc_comp_priv_obj[comp_id] = NULL;
} else if (cfg_state == WLAN_CP_STATS_OBJ_INVALID) {
cp_stats_err("Invalid cp stats cfg_state");
wlan_cp_stats_psoc_obj_unlock(psoc_cs);
return QDF_STATUS_E_INVAL;
}
wlan_cp_stats_psoc_obj_unlock(psoc_cs);
@@ -62,7 +71,7 @@ wlan_cp_stats_psoc_comp_obj_config
static QDF_STATUS
wlan_cp_stats_pdev_comp_obj_config
(struct wlan_objmgr_pdev *pdev, enum wlan_cp_stats_comp_id comp_id,
enum wlan_cp_stats_cfg_state cfg_state, void *comp_priv_obj)
enum wlan_cp_stats_cfg_state cfg_state, void *data)
{
struct pdev_cp_stats *pdev_cs;
@@ -78,13 +87,18 @@ wlan_cp_stats_pdev_comp_obj_config
wlan_cp_stats_pdev_obj_unlock(pdev_cs);
return QDF_STATUS_E_EXISTS;
}
pdev_cs->pdev_comp_priv_obj[comp_id] = comp_priv_obj;
pdev_cs->pdev_comp_priv_obj[comp_id] = data;
} else if (cfg_state == WLAN_CP_STATS_OBJ_DETACH) {
if (pdev_cs->pdev_comp_priv_obj[comp_id] != comp_priv_obj) {
if (pdev_cs->pdev_comp_priv_obj[comp_id] != data) {
wlan_cp_stats_pdev_obj_unlock(pdev_cs);
return QDF_STATUS_E_INVAL;
}
data = pdev_cs->pdev_comp_priv_obj[comp_id];
pdev_cs->pdev_comp_priv_obj[comp_id] = NULL;
} else if (cfg_state == WLAN_CP_STATS_OBJ_INVALID) {
cp_stats_err("Invalid cp stats cfg_state");
wlan_cp_stats_pdev_obj_unlock(pdev_cs);
return QDF_STATUS_E_INVAL;
}
wlan_cp_stats_pdev_obj_unlock(pdev_cs);
@@ -94,7 +108,7 @@ wlan_cp_stats_pdev_comp_obj_config
static QDF_STATUS
wlan_cp_stats_vdev_comp_obj_config
(struct wlan_objmgr_vdev *vdev, enum wlan_cp_stats_comp_id comp_id,
enum wlan_cp_stats_cfg_state cfg_state, void *comp_priv_obj)
enum wlan_cp_stats_cfg_state cfg_state, void *data)
{
struct vdev_cp_stats *vdev_cs;
@@ -110,13 +124,18 @@ wlan_cp_stats_vdev_comp_obj_config
wlan_cp_stats_vdev_obj_unlock(vdev_cs);
return QDF_STATUS_E_EXISTS;
}
vdev_cs->vdev_comp_priv_obj[comp_id] = comp_priv_obj;
vdev_cs->vdev_comp_priv_obj[comp_id] = data;
} else if (cfg_state == WLAN_CP_STATS_OBJ_DETACH) {
if (vdev_cs->vdev_comp_priv_obj[comp_id] != comp_priv_obj) {
if (vdev_cs->vdev_comp_priv_obj[comp_id] != data) {
wlan_cp_stats_vdev_obj_unlock(vdev_cs);
return QDF_STATUS_E_INVAL;
}
data = vdev_cs->vdev_comp_priv_obj[comp_id];
vdev_cs->vdev_comp_priv_obj[comp_id] = NULL;
} else if (cfg_state == WLAN_CP_STATS_OBJ_INVALID) {
cp_stats_err("Invalid cp stats cfg_state");
wlan_cp_stats_vdev_obj_unlock(vdev_cs);
return QDF_STATUS_E_INVAL;
}
wlan_cp_stats_vdev_obj_unlock(vdev_cs);
@@ -126,7 +145,7 @@ wlan_cp_stats_vdev_comp_obj_config
static QDF_STATUS
wlan_cp_stats_peer_comp_obj_config
(struct wlan_objmgr_peer *peer, enum wlan_cp_stats_comp_id comp_id,
enum wlan_cp_stats_cfg_state cfg_state, void *comp_priv_obj)
enum wlan_cp_stats_cfg_state cfg_state, void *data)
{
struct peer_cp_stats *peer_cs;
@@ -142,13 +161,18 @@ wlan_cp_stats_peer_comp_obj_config
wlan_cp_stats_peer_obj_unlock(peer_cs);
return QDF_STATUS_E_EXISTS;
}
peer_cs->peer_comp_priv_obj[comp_id] = comp_priv_obj;
peer_cs->peer_comp_priv_obj[comp_id] = data;
} else if (cfg_state == WLAN_CP_STATS_OBJ_DETACH) {
if (peer_cs->peer_comp_priv_obj[comp_id] != comp_priv_obj) {
if (peer_cs->peer_comp_priv_obj[comp_id] != data) {
wlan_cp_stats_peer_obj_unlock(peer_cs);
return QDF_STATUS_E_INVAL;
}
data = peer_cs->peer_comp_priv_obj[comp_id];
peer_cs->peer_comp_priv_obj[comp_id] = NULL;
} else if (cfg_state == WLAN_CP_STATS_OBJ_INVALID) {
cp_stats_err("Invalid cp stats cfg_state");
wlan_cp_stats_peer_obj_unlock(peer_cs);
return QDF_STATUS_E_INVAL;
}
wlan_cp_stats_peer_obj_unlock(peer_cs);
@@ -157,9 +181,9 @@ wlan_cp_stats_peer_comp_obj_config
QDF_STATUS
wlan_cp_stats_comp_obj_config(enum wlan_objmgr_obj_type obj_type,
enum wlan_cp_stats_cfg_state cfg_state,
enum wlan_cp_stats_comp_id comp_id,
void *cmn_obj, void *comp_priv_obj)
enum wlan_cp_stats_cfg_state cfg_state,
enum wlan_cp_stats_comp_id comp_id,
void *cmn_obj, void *data)
{
QDF_STATUS status;
@@ -179,25 +203,25 @@ wlan_cp_stats_comp_obj_config(enum wlan_objmgr_obj_type obj_type,
status =
wlan_cp_stats_psoc_comp_obj_config(
(struct wlan_objmgr_psoc *)cmn_obj,
comp_id, cfg_state, comp_priv_obj);
comp_id, cfg_state, data);
break;
case WLAN_PDEV_OP:
status =
wlan_cp_stats_pdev_comp_obj_config(
(struct wlan_objmgr_pdev *)cmn_obj,
comp_id, cfg_state, comp_priv_obj);
comp_id, cfg_state, data);
break;
case WLAN_VDEV_OP:
status =
wlan_cp_stats_vdev_comp_obj_config(
(struct wlan_objmgr_vdev *)cmn_obj,
comp_id, cfg_state, comp_priv_obj);
comp_id, cfg_state, data);
break;
case WLAN_PEER_OP:
status =
wlan_cp_stats_peer_comp_obj_config(
(struct wlan_objmgr_peer *)cmn_obj,
comp_id, cfg_state, comp_priv_obj);
comp_id, cfg_state, data);
break;
default:
cp_stats_err("Invalid common object");

مشاهده پرونده

@@ -1,98 +0,0 @@
/*
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cp_stats_ic_defs.h
*
* This header file maintain structure definitions for cp stats specific to ic
*/
#ifndef __WLAN_CP_STATS_IC_DEFS_H__
#define __WLAN_CP_STATS_IC_DEFS_H__
#ifdef QCA_SUPPORT_CP_STATS
#include <wlan_cp_stats_ic_atf_defs.h>
#include <wlan_cp_stats_ic_arpdbg_defs.h>
#include <wlan_cp_stats_ic_vow_defs.h>
#include <wlan_cp_stats_ic_rrm_bcn_defs.h>
#include <ieee80211_rrm.h>
/**
* struct pdev_ic_cp_stats - control plane stats specific to WIN at pdev
* @rx_mgmt: rx management frames
* @tx_mgmt: tx management frames
* @tx_bcn: tx beacon frames
* @rx_phyofdmerr: rx PHY error
* @rx_phycckerr: rx PHY error
* @tx_fcs_err: tx fcs error
* @vow_stats: vow ext stats
* @arp_dbg_cs: arp dbg stats
*/
struct pdev_ic_cp_stats {
uint64_t rx_mgmt;
uint64_t tx_mgmt;
uint64_t tx_bcn;
uint64_t rx_phyofdmerr;
uint64_t rx_phycckerr;
uint64_t tx_fcs_err;
struct vow_extstats vow_stats;
struct arp_dbg_stats arp_dbg_cs;
};
/**
* struct vdev_ic_cp_stats - control plane stats specific to WIN at vdev
* @tx_success: total tx success
* @tx_failure: total tx failures
* @rx_mgmt: rx mgmt frames
* @tx_mgmt: tx mgmt frames
* @rx_ctrl: rx control frames
* @tx_ctrl: tx control frames
* @tx_bcn_swba: beacon intr SWBA counter
* @tx_offchan_mgmt: tx offchan mgmt success
* @tx_offchan_date: tx offchan data success
* @tx_offchan_fail: tx offchan total failures
* @atf_cs: atf stats
* @rrm_bcnreq_info: beacon report
*/
struct vdev_ic_cp_stats {
uint64_t tx_success;
uint64_t tx_failure;
uint64_t rx_mgmt;
uint64_t tx_mgmt;
uint64_t rx_ctrl;
uint64_t tx_ctrl;
uint64_t tx_bcn_swba;
uint64_t tx_offchan_mgmt;
uint64_t tx_offchan_data;
uint64_t tx_offchan_fail;
struct atf_cp_stats atf_cs;
ieee80211_rrm_beaconreq_info_t rrm_bcnreq_info;
};
/**
* struct peer_ic_cp_stats - control plane stats specific to WIN at peer
* @rx_mgmt_rate: rx mgmt rate
* @rx_mgmt_rssi: rx mgmt rssi
*/
struct peer_ic_cp_stats {
uint32_t rx_mgmt_rate;
int8_t rx_mgmt_rssi;
};
#endif /* QCA_SUPPORT_CP_STATS */
#endif /* __WLAN_CP_STATS_IC_DEFS_H__ */

مشاهده پرونده

@@ -28,6 +28,7 @@
#include "wlan_cp_stats_defs.h"
#include "wlan_cp_stats_ol_api.h"
#include "wlan_cp_stats_defs.h"
#include <wlan_cp_stats_ucfg_api.h>
#include "wlan_cp_stats_utils_api.h"
QDF_STATUS
@@ -88,8 +89,9 @@ wlan_cp_stats_psoc_obj_create_handler(struct wlan_objmgr_psoc *psoc, void *arg)
}
status = wlan_objmgr_psoc_component_obj_attach(psoc,
WLAN_UMAC_COMP_CP_STATS, csc,
QDF_STATUS_SUCCESS);
WLAN_UMAC_COMP_CP_STATS,
csc,
QDF_STATUS_SUCCESS);
wlan_cp_stats_psoc_obj_create_handler_return:
if (QDF_IS_STATUS_ERROR(status)) {
@@ -125,14 +127,14 @@ wlan_cp_stats_psoc_obj_destroy_handler(struct wlan_objmgr_psoc *psoc, void *arg)
return QDF_STATUS_E_NOMEM;
}
csc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_CP_STATS);
WLAN_UMAC_COMP_CP_STATS);
if (!csc) {
cp_stats_err("cp_stats context is NULL!");
return QDF_STATUS_E_INVAL;
}
wlan_objmgr_psoc_component_obj_detach(psoc,
WLAN_UMAC_COMP_CP_STATS, csc);
WLAN_UMAC_COMP_CP_STATS, csc);
if (csc->cp_stats_psoc_obj_deinit)
csc->cp_stats_psoc_obj_deinit(csc->psoc_cs);
qdf_mem_free(csc->psoc_cs);
@@ -179,8 +181,9 @@ wlan_cp_stats_pdev_obj_create_handler(struct wlan_objmgr_pdev *pdev, void *arg)
}
status = wlan_objmgr_pdev_component_obj_attach(pdev,
WLAN_UMAC_COMP_CP_STATS, pdev_cs,
QDF_STATUS_SUCCESS);
WLAN_UMAC_COMP_CP_STATS,
pdev_cs,
QDF_STATUS_SUCCESS);
cp_stats_debug("pdev cp stats object attached");
wlan_cp_stats_pdev_obj_create_handler_return:
@@ -209,7 +212,7 @@ wlan_cp_stats_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev, void *arg)
}
pdev_cs = wlan_objmgr_pdev_get_comp_private_obj(pdev,
WLAN_UMAC_COMP_CP_STATS);
WLAN_UMAC_COMP_CP_STATS);
if (!pdev_cs) {
cp_stats_err("pdev is NULL");
return QDF_STATUS_E_INVAL;
@@ -224,7 +227,7 @@ wlan_cp_stats_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev, void *arg)
csc->cp_stats_pdev_obj_deinit(pdev_cs);
wlan_objmgr_pdev_component_obj_detach(pdev, WLAN_UMAC_COMP_CP_STATS,
pdev_cs);
pdev_cs);
qdf_mem_free(pdev_cs);
cp_stats_debug("pdev cp stats object dettached");
@@ -266,8 +269,9 @@ wlan_cp_stats_vdev_obj_create_handler(struct wlan_objmgr_vdev *vdev, void *arg)
}
status = wlan_objmgr_vdev_component_obj_attach(vdev,
WLAN_UMAC_COMP_CP_STATS, vdev_cs,
QDF_STATUS_SUCCESS);
WLAN_UMAC_COMP_CP_STATS,
vdev_cs,
QDF_STATUS_SUCCESS);
wlan_cp_stats_vdev_obj_create_handler_return:
if (QDF_IS_STATUS_ERROR(status)) {
@@ -296,7 +300,7 @@ wlan_cp_stats_vdev_obj_destroy_handler(struct wlan_objmgr_vdev *vdev, void *arg)
}
vdev_cs = wlan_objmgr_vdev_get_comp_private_obj(vdev,
WLAN_UMAC_COMP_CP_STATS);
WLAN_UMAC_COMP_CP_STATS);
if (!vdev_cs) {
cp_stats_err("vdev is NULL");
return QDF_STATUS_E_INVAL;
@@ -311,7 +315,7 @@ wlan_cp_stats_vdev_obj_destroy_handler(struct wlan_objmgr_vdev *vdev, void *arg)
csc->cp_stats_vdev_obj_deinit(vdev_cs);
wlan_objmgr_vdev_component_obj_detach(vdev, WLAN_UMAC_COMP_CP_STATS,
vdev_cs);
vdev_cs);
qdf_mem_free(vdev_cs);
cp_stats_debug("vdev cp stats object dettach");
@@ -353,8 +357,9 @@ wlan_cp_stats_peer_obj_create_handler(struct wlan_objmgr_peer *peer, void *arg)
}
status = wlan_objmgr_peer_component_obj_attach(peer,
WLAN_UMAC_COMP_CP_STATS, peer_cs,
QDF_STATUS_SUCCESS);
WLAN_UMAC_COMP_CP_STATS,
peer_cs,
QDF_STATUS_SUCCESS);
wlan_cp_stats_peer_obj_create_handler_return:
if (QDF_IS_STATUS_ERROR(status)) {
@@ -383,7 +388,7 @@ wlan_cp_stats_peer_obj_destroy_handler(struct wlan_objmgr_peer *peer, void *arg)
}
peer_cs = wlan_objmgr_peer_get_comp_private_obj(peer,
WLAN_UMAC_COMP_CP_STATS);
WLAN_UMAC_COMP_CP_STATS);
if (!peer_cs) {
cp_stats_err("peer is NULL");
return QDF_STATUS_E_INVAL;
@@ -398,7 +403,7 @@ wlan_cp_stats_peer_obj_destroy_handler(struct wlan_objmgr_peer *peer, void *arg)
csc->cp_stats_peer_obj_deinit(peer_cs);
wlan_objmgr_peer_component_obj_detach(peer, WLAN_UMAC_COMP_CP_STATS,
peer_cs);
peer_cs);
qdf_mem_free(peer_cs);
cp_stats_debug("peer cp stats object dettached");

مشاهده پرونده

@@ -29,8 +29,6 @@
#include "wlan_cp_stats_ol_api.h"
#include "wlan_cp_stats_cmn_api_i.h"
#include <wlan_cp_stats_ucfg_api.h>
#include "wlan_cp_stats_ic_ucfg_handler.h"
#include <wlan_cp_stats_utils_api.h>
#include <target_if_cp_stats.h>

مشاهده پرونده

@@ -0,0 +1,108 @@
/*
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cp_stats_ic_defs.h
*
* This header file maintain structure definitions for cp stats specific to ic
*/
#ifndef __WLAN_CP_STATS_IC_DEFS_H__
#define __WLAN_CP_STATS_IC_DEFS_H__
#ifdef QCA_SUPPORT_CP_STATS
/**
* struct pdev_80211_stats - control plane stats at pdev
*
* the same statistics were earlier maintained with a reference to
* ieee80211_mac_stats in vap structure, now the same structure will be
* used as interface structure with user space application
* make sure to align this structure with ieee80211_mac_stats
*
* @cs_tx_hw_retries:
* @cs_tx_hw_failures:
*/
struct pdev_80211_stats {
uint64_t cs_tx_hw_retries;
uint64_t cs_tx_hw_failures;
};
/**
* struct pdev_ic_cp_stats - control plane stats specific to WIN at pdev
* @stats: 80211 stats
*/
struct pdev_ic_cp_stats {
struct pdev_80211_stats stats;
};
/**
* struct vdev_80211_stats - control plane 80211 stats at vdev
*
* the same statistics were earlier maintained with a reference to
* ieee80211_mac_stats in vap structure, now the same structure will be
* used as interface structure with user space application
* make sure to align this structure with ieee80211_mac_stats
*
* @cs_rx_mgmt: rx mgmt
*/
struct vdev_80211_stats {
uint64_t cs_rx_mgmt;
};
/**
* struct vdev_80211_mac_stats - control plane 80211 mac stats at vdev
*
* the same statistics were earlier maintained with a reference to
* ieee80211_mac_stats in vap structure, now the same structure will be
* used as interface structure with user space application
* make sure to align this structure with ieee80211_mac_stats
*
* @cs_rx_mgmt: rx mgmt
*/
struct vdev_80211_mac_stats {
uint64_t cs_rx_mgmt;
};
/**
* struct vdev_ic_cp_stats - control plane stats specific to WIN at vdev
* @stats: 80211 stats
* @ucast_stats: unicast stats
* @mcast_stats: multicast or broadcast stats
*/
struct vdev_ic_cp_stats {
struct vdev_80211_stats stats;
struct vdev_80211_mac_stats ucast_stats;
struct vdev_80211_mac_stats mcast_stats;
};
/**
* struct peer_ic_cp_stats - control plane stats specific to WIN at peer
* the same statistics were earlier maintained with a reference to
* ieee80211_nodestats in ni structure, now the same structure will be
* as interface structure with user space application
* make sure to align this structure with ieee80211_nodestats always
*
* @cs_rx_mgmt: rx mgmt
*/
struct peer_ic_cp_stats {
uint32_t cs_rx_mgmt;
};
#endif /* QCA_SUPPORT_CP_STATS */
#endif /* __WLAN_CP_STATS_IC_DEFS_H__ */

مشاهده پرونده

@@ -17,28 +17,17 @@
*/
/**
* DOC: wlan_cp_stats_ic_arpdbg_defs.h
* DOC: wlan_cp_stats_ic_ucfg_api.h
*
* This header file provide structure definitions for arp dbg stats
*/
#ifndef __WLAN_CP_STATS_IC_ARPDBG_DEFS_H__
#define __WLAN_CP_STATS_IC_ARPDBG_DEFS_H__
#ifndef __WLAN_CP_STATS_IC_UCFG_API_H__
#define __WLAN_CP_STATS_IC_UCFG_API_H__
#ifdef QCA_SUPPORT_CP_STATS
/**
* struct arp_dbg_stats - defines arp debug stats
* @tx_arp_req_count: tx arp req count
* @tx_arp_resp_count: tx arp response count
* @rx_arp_req_count: rx arp req count
* @rx_arp_resp_count: rx arp response count
*/
struct arp_dbg_stats {
uint32_t tx_arp_req_count; /* tx arp request counters */
uint32_t rx_arp_req_count; /* rx arp request counters */
uint32_t tx_arp_resp_count; /* tx arp response counters */
uint32_t rx_arp_resp_count; /* rx arp response counters */
};
#include <wlan_objmgr_cmn.h>
#include <wlan_cp_stats_ic_defs.h>
#include "../../core/src/wlan_cp_stats_defs.h"
#endif /* QCA_SUPPORT_CP_STATS */
#endif /* __WLAN_CP_STATS_IC_ARPDBG_DEFS_H__ */
#endif /* __WLAN_CP_STATS_IC_UCFG_API_H__ */

مشاهده پرونده

@@ -1,114 +0,0 @@
/*
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cp_stats_ic_ucfg_handler.h
*
* This header file provide APIs declaration required for (de)register ucfg
* handlers, these APIs are invoked from architecture specific (de)init
* APIs when corresponding common object specific obj mgt event notification is
* triggered
*/
#ifndef __WLAN_CP_STATS_IC_UCFG_HANDLER_H__
#define __WLAN_CP_STATS_IC_UCFG_HANDLER_H__
#ifdef QCA_SUPPORT_CP_STATS
#include <wlan_objmgr_cmn.h>
#include <wlan_cp_stats_ucfg_api.h>
/**
* wlan_cp_stats_register_pdev_ucfg_handlers() : API to register callbacks
* for commands at pdev object
* @pdev: reference to pdev global object
*
* This API is invoked from pdev create handler and used to register callbacks
* required by ucfg layer
*
* Return: QDF_STATUS - Success or Failure
*/
QDF_STATUS
wlan_cp_stats_register_pdev_ucfg_handlers(struct wlan_objmgr_pdev *pdev);
/**
* wlan_cp_stats_register_vdev_ucfg_handlers() : API to register callbacks
* for commands at vdev object
* @vdev: reference to vdev global object
*
* This API is invoked from vdev create handler and used to register callbacks
* required by ucfg layer
*
* Return: QDF_STATUS - Success or Failure
*/
QDF_STATUS
wlan_cp_stats_register_vdev_ucfg_handlers(struct wlan_objmgr_vdev *vdev);
/**
* wlan_cp_stats_register_peer_ucfg_handlers() : API to register callbacks
* for commands at peer object
* @peer: reference to peer global object
*
* This API is invoked from peer create handler and used to register callbacks
* required by ucfg layer
*
* Return: QDF_STATUS - Success or Failure
*/
QDF_STATUS
wlan_cp_stats_register_peer_ucfg_handlers(struct wlan_objmgr_peer *peer);
/**
* wlan_cp_stats_unregister_pdev_ucfg_handlers() : API to unregister callbacks
* for commands at pdev object
* @pdev: reference to pdev global object
*
* This API is invoked from pdev create handler and used to unregister callbacks
* required by ucfg layer
*
* Return: QDF_STATUS - Success or Failure
*/
QDF_STATUS
wlan_cp_stats_unregister_pdev_ucfg_handlers(struct wlan_objmgr_pdev *pdev);
/**
* wlan_cp_stats_unregister_vdev_ucfg_handlers() : API to unregister callbacks
* for commands at vdev object
* @vdev: reference to vdev global object
*
* This API is invoked from vdev create handler and used to unregister callbacks
* required by ucfg layer
*
* Return: QDF_STATUS - Success or Failure
*/
QDF_STATUS
wlan_cp_stats_unregister_vdev_ucfg_handlers(struct wlan_objmgr_vdev *vdev);
/**
* wlan_cp_stats_unregister_peer_ucfg_handlers() : API to unregister callbacks
* for commands at peer object
* @peer: reference to peer global object
*
* This API is invoked from peer create handler and used to unregister callbacks
* required by ucfg layer
*
* Return: QDF_STATUS - Success or Failure
*/
QDF_STATUS
wlan_cp_stats_unregister_peer_ucfg_handlers(struct wlan_objmgr_peer *peer);
#endif /* QCA_SUPPORT_CP_STATS */
#endif /* __WLAN_CP_STATS_IC_UCFG_HANDLER_H__ */

مشاهده پرونده

@@ -17,28 +17,17 @@
*/
/**
* DOC: wlan_cp_stats_ic_ucfg_defs.h
* DOC: wlan_cp_stats_ic_utils_api.h
*
* This header file provide definitions and declarations required for northbound
* specific to WIN
*/
#ifndef __WLAN_CP_STATS_IC_UCFG_DEFS_H__
#define __WLAN_CP_STATS_IC_UCFG_DEFS_H__
#ifndef __WLAN_CP_STATS_IC_UTILS_API_H__
#define __WLAN_CP_STATS_IC_UTILS_API_H__
#ifdef QCA_SUPPORT_CP_STATS
/**
* enum wlan_ucfg_cp_stats_vendorcmd_handler_idx - cp stats commands
* @CP_STATS_GET_ATF_HANDLER_IDX: get ATF stats id
* @CP_STATS_GET_VOW_STATS_HANDLER_IDX: get vow ext stats id
* @CP_STATS_VENDOR_CMD_HANDLER_MAX: max command id
*/
enum wlan_ucfg_cp_stats_vendorcmd_handler_idx {
CP_STATS_GET_ATF_HANDLER_IDX,
CP_STATS_GET_VOW_STATS_HANDLER_IDX,
CP_STATS_VENDOR_CMD_HANDLER_MAX,
};
#include "wlan_cp_stats_ic_ucfg_api.h"
#endif /* QCA_SUPPORT_CP_STATS */
#endif /* __WLAN_CP_STATS_IC_UCFG_DEFS_H__ */
#endif /* __WLAN_CP_STATS_IC_UTILS_API_H__ */

مشاهده پرونده

@@ -1,69 +0,0 @@
/*
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wlan_cp_stats_ic_vow_defs.h
*
* This header file provide structure definitions vow ext stats
*/
#ifndef __WLAN_CP_STATS_IC_VOW_DEFS_H__
#define __WLAN_CP_STATS_IC_VOW_DEFS_H__
#ifdef QCA_SUPPORT_CP_STATS
/**
* struct vow_extstats - vow extension structure
* @rx_rssi_ctl0: control channel chain0 rssi
* @rx_rssi_ctl1: control channel chain1 rssi
* @rx_rssi_ctl2: control channel chain2 rssi
* @rx_rssi_ext0: extension channel chain0 rssi
* @rx_rssi_ext1: extension channel chain1 rssi
* @rx_rssi_ext2: extension channel chain2 rssi
* @rx_rssi_comb: combined RSSI value
* @rx_bw: Band width 0-20, 1-40, 2-80
* @rx_sgi: Guard interval, 0-Long GI, 1-Short GI
* @rx_nss: Number of spatial streams
* @rx_mcs: Rate MCS value
* @rx_ratecode: Hardware rate code
* @rx_rs_flags: Receive misc flags
* @rx_moreaggr: 0 - non aggr frame
* @rx_mac_ts: Time stamp
* @rx_seqno: rx sequence number
*/
struct vow_extstats {
uint8_t rx_rssi_ctl0;
uint8_t rx_rssi_ctl1;
uint8_t rx_rssi_ctl2;
uint8_t rx_rssi_ext0;
uint8_t rx_rssi_ext1;
uint8_t rx_rssi_ext2;
uint8_t rx_rssi_comb;
uint8_t rx_bw;
uint8_t rx_sgi;
uint8_t rx_nss;
uint8_t rx_mcs;
uint8_t rx_ratecode;
uint8_t rx_rs_flags;
uint8_t rx_moreaggr;
uint32_t rx_mac_ts;
uint16_t rx_seqno;
};
#endif /* QCA_SUPPORT_CP_STATS */
#endif /* __WLAN_CP_STATS_IC_VOW_DEFS_H__ */

مشاهده پرونده

@@ -38,17 +38,20 @@
/**
* enum wlan_cp_stats_cfg_state - State of Object configuration to
* indicate whether object has to be attached/detached in cp stats
* @WLAN_OBJ_DETACH: Object has to be detached
* @WLAN_OBJ_ATTACH: Object has to be attached
* @WLAN_CP_STATS_OBJ_DETACH: Object has to be detached
* @WLAN_CP_STATS_OBJ_ATTACH: Object has to be attached
* @WLAN_CP_STATS_OBJ_INVALID: Object is invalid
*/
enum wlan_cp_stats_cfg_state {
WLAN_CP_STATS_OBJ_DETACH = 0,
WLAN_CP_STATS_OBJ_ATTACH = 1,
WLAN_CP_STATS_OBJ_INVALID
};
/**
* enum wlan_cp_stats_comp_id - component id for other umac components
* @WLAN_CP_STATS_ATF: ATF component specific id
* @WLAN_CP_STATS_ATF: ATF component specific id
* @WLAN_CP_STATS_MAX_COMPONENTS : Max id of cp stats components
*/
enum wlan_cp_stats_comp_id {
WLAN_CP_STATS_ATF = 0,
@@ -122,7 +125,8 @@ QDF_STATUS wlan_cp_stats_enable(struct wlan_objmgr_psoc *psoc);
QDF_STATUS wlan_cp_stats_disable(struct wlan_objmgr_psoc *psoc);
/**
* wlan_cp_stats_comp_obj_configure() - public API to attach/deattach umac
* wlan_cp_stats_comp_obj_cfg() - public API to umac for
* attach/detach
* component specific stat obj to cp stats obj
* @obj_type: common object type
* @cfg_state: config state either to attach of detach
@@ -132,7 +136,7 @@ QDF_STATUS wlan_cp_stats_disable(struct wlan_objmgr_psoc *psoc);
*
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
*/
QDF_STATUS wlan_cp_stats_comp_obj_configure(
QDF_STATUS wlan_cp_stats_comp_obj_cfg(
enum wlan_objmgr_obj_type obj_type,
enum wlan_cp_stats_cfg_state cfg_state,
enum wlan_umac_comp_id comp_id,

مشاهده پرونده

@@ -17,14 +17,15 @@
*/
/**
* DOC:wlan_cp_stats_ic_ucfg_handler.c
* DOC:wlan_cp_stats_ic_ucfg_api.c
*
* This file provide APIs definition for registering cp stats cfg80211 command
* handlers
*/
#include "wlan_cp_stats_ic_ucfg_handler.h"
#include "wlan_cp_stats_ic_ucfg_api.h"
#include <wlan_cfg80211_ic_cp_stats.h>
#include <wlan_cp_stats_ic_ucfg_defs.h>
#include <wlan_cp_stats_ic_atf_defs.h>
#include <wlan_cp_stats_ic_defs.h>
#include "../../core/src/wlan_cp_stats_cmn_api_i.h"
QDF_STATUS wlan_cp_stats_psoc_cs_init(struct psoc_cp_stats *psoc_cs)
@@ -39,72 +40,51 @@ QDF_STATUS wlan_cp_stats_psoc_cs_deinit(struct psoc_cp_stats *psoc_cs)
QDF_STATUS wlan_cp_stats_pdev_cs_init(struct pdev_cp_stats *pdev_cs)
{
wlan_cp_stats_register_pdev_ucfg_handlers(pdev_cs->pdev_obj);
pdev_cs->pdev_stats = qdf_mem_malloc(sizeof(struct pdev_ic_cp_stats));
if (!pdev_cs->pdev_stats) {
cp_stats_err("malloc failed");
return QDF_STATUS_E_NOMEM;
}
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_cp_stats_pdev_cs_deinit(struct pdev_cp_stats *pdev_cs)
{
wlan_cp_stats_unregister_pdev_ucfg_handlers(pdev_cs->pdev_obj);
qdf_mem_free(pdev_cs->pdev_stats);
pdev_cs->pdev_stats = NULL;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_cp_stats_vdev_cs_init(struct vdev_cp_stats *vdev_cs)
{
wlan_cp_stats_register_vdev_ucfg_handlers(vdev_cs->vdev_obj);
vdev_cs->vdev_stats = qdf_mem_malloc(sizeof(struct vdev_ic_cp_stats));
if (!vdev_cs->vdev_stats) {
cp_stats_err("malloc failed");
return QDF_STATUS_E_NOMEM;
}
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_cp_stats_vdev_cs_deinit(struct vdev_cp_stats *vdev_cs)
{
wlan_cp_stats_unregister_vdev_ucfg_handlers(vdev_cs->vdev_obj);
qdf_mem_free(vdev_cs->vdev_stats);
vdev_cs->vdev_stats = NULL;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_cp_stats_peer_cs_init(struct peer_cp_stats *peer_cs)
{
wlan_cp_stats_register_peer_ucfg_handlers(peer_cs->peer_obj);
peer_cs->peer_stats = qdf_mem_malloc(sizeof(struct peer_ic_cp_stats));
if (!peer_cs->peer_stats) {
cp_stats_err("malloc failed");
return QDF_STATUS_E_NOMEM;
}
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_cp_stats_peer_cs_deinit(struct peer_cp_stats *peer_cs)
{
wlan_cp_stats_unregister_peer_ucfg_handlers(peer_cs->peer_obj);
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_cp_stats_register_pdev_ucfg_handlers(struct wlan_objmgr_pdev *pdev)
{
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_cp_stats_unregister_pdev_ucfg_handlers(struct wlan_objmgr_pdev *pdev)
{
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_cp_stats_register_vdev_ucfg_handlers(struct wlan_objmgr_vdev *vdev)
{
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_cp_stats_unregister_vdev_ucfg_handlers(struct wlan_objmgr_vdev *vdev)
{
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_cp_stats_register_peer_ucfg_handlers(struct wlan_objmgr_peer *peer)
{
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_cp_stats_unregister_peer_ucfg_handlers(struct wlan_objmgr_peer *peer)
{
qdf_mem_free(peer_cs->peer_stats);
peer_cs->peer_stats = NULL;
return QDF_STATUS_SUCCESS;
}

مشاهده پرونده

@@ -289,10 +289,10 @@ QDF_STATUS wlan_cp_stats_disable(struct wlan_objmgr_psoc *psoc)
}
QDF_STATUS
wlan_cp_stats_comp_obj_configure(enum wlan_objmgr_obj_type obj_type,
enum wlan_cp_stats_cfg_state cfg_state,
enum wlan_umac_comp_id comp_id,
void *cmn_obj, void *data)
wlan_cp_stats_comp_obj_cfg(enum wlan_objmgr_obj_type obj_type,
enum wlan_cp_stats_cfg_state cfg_state,
enum wlan_umac_comp_id comp_id,
void *cmn_obj, void *data)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct cp_stats_context *csc;