qcacld-3.0: Remove legacy wakelock stats implementation

Driver has a stats infrastructure and all the stats related
commands are using this infrastructure.

Remove legacy implementation for wakelock stats command
as part of cleanup.

Change-Id: Ie60293ae06401f841ef8dd9545587819ebe4cd4a
CRs-fixed: 2480191
This commit is contained in:
Ashish Kumar Dhanotiya 2019-06-04 16:20:31 +05:30 • committed by nshrivas
commit 136bc8ea73
5 changed files with 2 additions and 421 deletions

View file

@ -9528,194 +9528,6 @@ static int wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy,
return errno;
}
#ifndef QCA_SUPPORT_CP_STATS
/**
* define short names for the global vendor params
* used by wlan_hdd_cfg80211_wakelock_stats_rsp_callback()
*/
#define PARAM_TOTAL_CMD_EVENT_WAKE \
QCA_WLAN_VENDOR_ATTR_TOTAL_CMD_EVENT_WAKE
#define PARAM_CMD_EVENT_WAKE_CNT_PTR \
QCA_WLAN_VENDOR_ATTR_CMD_EVENT_WAKE_CNT_PTR
#define PARAM_CMD_EVENT_WAKE_CNT_SZ \
QCA_WLAN_VENDOR_ATTR_CMD_EVENT_WAKE_CNT_SZ
#define PARAM_TOTAL_DRIVER_FW_LOCAL_WAKE \
QCA_WLAN_VENDOR_ATTR_TOTAL_DRIVER_FW_LOCAL_WAKE
#define PARAM_DRIVER_FW_LOCAL_WAKE_CNT_PTR \
QCA_WLAN_VENDOR_ATTR_DRIVER_FW_LOCAL_WAKE_CNT_PTR
#define PARAM_DRIVER_FW_LOCAL_WAKE_CNT_SZ \
QCA_WLAN_VENDOR_ATTR_DRIVER_FW_LOCAL_WAKE_CNT_SZ
#define PARAM_TOTAL_RX_DATA_WAKE \
QCA_WLAN_VENDOR_ATTR_TOTAL_RX_DATA_WAKE
#define PARAM_RX_UNICAST_CNT \
QCA_WLAN_VENDOR_ATTR_RX_UNICAST_CNT
#define PARAM_RX_MULTICAST_CNT \
QCA_WLAN_VENDOR_ATTR_RX_MULTICAST_CNT
#define PARAM_RX_BROADCAST_CNT \
QCA_WLAN_VENDOR_ATTR_RX_BROADCAST_CNT
#define PARAM_ICMP_PKT \
QCA_WLAN_VENDOR_ATTR_ICMP_PKT
#define PARAM_ICMP6_PKT \
QCA_WLAN_VENDOR_ATTR_ICMP6_PKT
#define PARAM_ICMP6_RA \
QCA_WLAN_VENDOR_ATTR_ICMP6_RA
#define PARAM_ICMP6_NA \
QCA_WLAN_VENDOR_ATTR_ICMP6_NA
#define PARAM_ICMP6_NS \
QCA_WLAN_VENDOR_ATTR_ICMP6_NS
#define PARAM_ICMP4_RX_MULTICAST_CNT \
QCA_WLAN_VENDOR_ATTR_ICMP4_RX_MULTICAST_CNT
#define PARAM_ICMP6_RX_MULTICAST_CNT \
QCA_WLAN_VENDOR_ATTR_ICMP6_RX_MULTICAST_CNT
#define PARAM_OTHER_RX_MULTICAST_CNT \
QCA_WLAN_VENDOR_ATTR_OTHER_RX_MULTICAST_CNT
#define PARAM_RSSI_BREACH_CNT \
QCA_WLAN_VENDOR_ATTR_RSSI_BREACH_CNT
#define PARAM_LOW_RSSI_CNT \
QCA_WLAN_VENDOR_ATTR_LOW_RSSI_CNT
#define PARAM_GSCAN_CNT \
QCA_WLAN_VENDOR_ATTR_GSCAN_CNT
#define PARAM_PNO_COMPLETE_CNT \
QCA_WLAN_VENDOR_ATTR_PNO_COMPLETE_CNT
#define PARAM_PNO_MATCH_CNT \
QCA_WLAN_VENDOR_ATTR_PNO_MATCH_CNT
/**
* hdd_send_wakelock_stats() - API to send wakelock stats
* @ctx: context to be passed to callback
* @data: data passed to callback
*
* This function is used to send wake lock stats to HAL layer
*
* Return: 0 on success, error number otherwise.
*/
static uint32_t hdd_send_wakelock_stats(struct hdd_context *hdd_ctx,
const struct sir_wake_lock_stats *data)
{
struct sk_buff *skb;
uint32_t nl_buf_len;
uint32_t total_rx_data_wake, rx_multicast_cnt;
uint32_t ipv6_rx_multicast_addr_cnt;
uint32_t icmpv6_cnt;
hdd_enter();
nl_buf_len = NLMSG_HDRLEN;
nl_buf_len +=
QCA_WLAN_VENDOR_GET_WAKE_STATS_MAX *
(NLMSG_HDRLEN + sizeof(uint32_t));
skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy, nl_buf_len);
if (!skb) {
hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed");
return -ENOMEM;
}
hdd_debug("wow_ucast_wake_up_count %d",
data->wow_ucast_wake_up_count);
hdd_debug("wow_bcast_wake_up_count %d",
data->wow_bcast_wake_up_count);
hdd_debug("wow_ipv4_mcast_wake_up_count %d",
data->wow_ipv4_mcast_wake_up_count);
hdd_debug("wow_ipv6_mcast_wake_up_count %d",
data->wow_ipv6_mcast_wake_up_count);
hdd_debug("wow_ipv6_mcast_ra_stats %d",
data->wow_ipv6_mcast_ra_stats);
hdd_debug("wow_ipv6_mcast_ns_stats %d",
data->wow_ipv6_mcast_ns_stats);
hdd_debug("wow_ipv6_mcast_na_stats %d",
data->wow_ipv6_mcast_na_stats);
hdd_debug("wow_icmpv4_count %d", data->wow_icmpv4_count);
hdd_debug("wow_icmpv6_count %d",
data->wow_icmpv6_count);
hdd_debug("wow_rssi_breach_wake_up_count %d",
data->wow_rssi_breach_wake_up_count);
hdd_debug("wow_low_rssi_wake_up_count %d",
data->wow_low_rssi_wake_up_count);
hdd_debug("wow_gscan_wake_up_count %d",
data->wow_gscan_wake_up_count);
hdd_debug("wow_pno_complete_wake_up_count %d",
data->wow_pno_complete_wake_up_count);
hdd_debug("wow_pno_match_wake_up_count %d",
data->wow_pno_match_wake_up_count);
ipv6_rx_multicast_addr_cnt =
data->wow_ipv6_mcast_wake_up_count;
icmpv6_cnt =
data->wow_icmpv6_count;
rx_multicast_cnt =
data->wow_ipv4_mcast_wake_up_count +
ipv6_rx_multicast_addr_cnt;
total_rx_data_wake =
data->wow_ucast_wake_up_count +
data->wow_bcast_wake_up_count +
rx_multicast_cnt;
if (nla_put_u32(skb, PARAM_TOTAL_CMD_EVENT_WAKE, 0) ||
nla_put_u32(skb, PARAM_CMD_EVENT_WAKE_CNT_PTR, 0) ||
nla_put_u32(skb, PARAM_CMD_EVENT_WAKE_CNT_SZ, 0) ||
nla_put_u32(skb, PARAM_TOTAL_DRIVER_FW_LOCAL_WAKE, 0) ||
nla_put_u32(skb, PARAM_DRIVER_FW_LOCAL_WAKE_CNT_PTR, 0) ||
nla_put_u32(skb, PARAM_DRIVER_FW_LOCAL_WAKE_CNT_SZ, 0) ||
nla_put_u32(skb, PARAM_TOTAL_RX_DATA_WAKE,
total_rx_data_wake) ||
nla_put_u32(skb, PARAM_RX_UNICAST_CNT,
data->wow_ucast_wake_up_count) ||
nla_put_u32(skb, PARAM_RX_MULTICAST_CNT,
rx_multicast_cnt) ||
nla_put_u32(skb, PARAM_RX_BROADCAST_CNT,
data->wow_bcast_wake_up_count) ||
nla_put_u32(skb, PARAM_ICMP_PKT,
data->wow_icmpv4_count) ||
nla_put_u32(skb, PARAM_ICMP6_PKT,
icmpv6_cnt) ||
nla_put_u32(skb, PARAM_ICMP6_RA,
data->wow_ipv6_mcast_ra_stats) ||
nla_put_u32(skb, PARAM_ICMP6_NA,
data->wow_ipv6_mcast_na_stats) ||
nla_put_u32(skb, PARAM_ICMP6_NS,
data->wow_ipv6_mcast_ns_stats) ||
nla_put_u32(skb, PARAM_ICMP4_RX_MULTICAST_CNT,
data->wow_ipv4_mcast_wake_up_count) ||
nla_put_u32(skb, PARAM_ICMP6_RX_MULTICAST_CNT,
ipv6_rx_multicast_addr_cnt) ||
nla_put_u32(skb, PARAM_OTHER_RX_MULTICAST_CNT, 0) ||
nla_put_u32(skb, PARAM_RSSI_BREACH_CNT,
data->wow_rssi_breach_wake_up_count) ||
nla_put_u32(skb, PARAM_LOW_RSSI_CNT,
data->wow_low_rssi_wake_up_count) ||
nla_put_u32(skb, PARAM_GSCAN_CNT,
data->wow_gscan_wake_up_count) ||
nla_put_u32(skb, PARAM_PNO_COMPLETE_CNT,
data->wow_pno_complete_wake_up_count) ||
nla_put_u32(skb, PARAM_PNO_MATCH_CNT,
data->wow_pno_match_wake_up_count)) {
hdd_err("nla put fail");
goto nla_put_failure;
}
cfg80211_vendor_cmd_reply(skb);
hdd_exit();
return 0;
nla_put_failure:
kfree_skb(skb);
return -EINVAL;
}
#endif
#ifdef QCA_SUPPORT_CP_STATS
static int wlan_hdd_process_wake_lock_stats(struct hdd_context *hdd_ctx)
{
return wlan_cfg80211_mc_cp_stats_get_wakelock_stats(hdd_ctx->psoc,
hdd_ctx->wiphy);
}
#else
/**
* wlan_hdd_process_wake_lock_stats() - wrapper function to absract cp_stats
* or legacy get_wake_lock_stats API.
@ -9725,23 +9537,9 @@ static int wlan_hdd_process_wake_lock_stats(struct hdd_context *hdd_ctx)
*/
static int wlan_hdd_process_wake_lock_stats(struct hdd_context *hdd_ctx)
{
int ret;
QDF_STATUS qdf_status;
struct sir_wake_lock_stats wake_lock_stats = {0};
qdf_status = wma_get_wakelock_stats(&wake_lock_stats);
if (qdf_status != QDF_STATUS_SUCCESS) {
hdd_err("failed to get wakelock stats(err=%d)", qdf_status);
return -EINVAL;
}
ret = hdd_send_wakelock_stats(hdd_ctx, &wake_lock_stats);
if (ret)
hdd_err("Failed to post wake lock stats");
return ret;
return wlan_cfg80211_mc_cp_stats_get_wakelock_stats(hdd_ctx->psoc,
hdd_ctx->wiphy);
}
#endif
/**
* __wlan_hdd_cfg80211_get_wakelock_stats() - gets wake lock stats

View file

@ -3174,7 +3174,6 @@ void hdd_wlan_get_stats(struct hdd_adapter *adapter, uint16_t *length,
*
* Return - length of written content, negative number on error
*/
#ifdef QCA_SUPPORT_CP_STATS
static int wlan_hdd_write_suspend_resume_stats(struct hdd_context *hdd_ctx,
char *buffer, uint16_t max_len)
{
@ -3212,72 +3211,7 @@ static int wlan_hdd_write_suspend_resume_stats(struct hdd_context *hdd_ctx,
return ret;
}
#else
static int wlan_hdd_write_suspend_resume_stats(struct hdd_context *hdd_ctx,
char *buffer, uint16_t max_len)
{
QDF_STATUS status;
struct suspend_resume_stats *sr_stats;
struct sir_wake_lock_stats wow_stats;
sr_stats = &hdd_ctx->suspend_resume_stats;
status = wma_get_wakelock_stats(&wow_stats);
if (QDF_IS_STATUS_ERROR(status)) {
hdd_err("Failed to get WoW stats");
return qdf_status_to_os_return(status);
}
return scnprintf(buffer, max_len,
"\n"
"Suspends: %u\n"
"Resumes: %u\n"
"\n"
"Suspend Fail Reasons\n"
"\tIPA: %u\n"
"\tRadar: %u\n"
"\tRoam: %u\n"
"\tScan: %u\n"
"\tInitial Wakeup: %u\n"
"\n"
"WoW Wake Reasons\n"
"\tunicast: %u\n"
"\tbroadcast: %u\n"
"\tIPv4 multicast: %u\n"
"\tIPv6 multicast: %u\n"
"\tIPv6 multicast RA: %u\n"
"\tIPv6 multicast NS: %u\n"
"\tIPv6 multicast NA: %u\n"
"\tICMPv4: %u\n"
"\tICMPv6: %u\n"
"\tRSSI Breach: %u\n"
"\tLow RSSI: %u\n"
"\tG-Scan: %u\n"
"\tPNO Complete: %u\n"
"\tPNO Match: %u\n",
sr_stats->suspends,
sr_stats->resumes,
sr_stats->suspend_fail[SUSPEND_FAIL_IPA],
sr_stats->suspend_fail[SUSPEND_FAIL_RADAR],
sr_stats->suspend_fail[SUSPEND_FAIL_ROAM],
sr_stats->suspend_fail[SUSPEND_FAIL_SCAN],
sr_stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP],
wow_stats.wow_ucast_wake_up_count,
wow_stats.wow_bcast_wake_up_count,
wow_stats.wow_ipv4_mcast_wake_up_count,
wow_stats.wow_ipv6_mcast_wake_up_count,
wow_stats.wow_ipv6_mcast_ra_stats,
wow_stats.wow_ipv6_mcast_ns_stats,
wow_stats.wow_ipv6_mcast_na_stats,
wow_stats.wow_icmpv4_count,
wow_stats.wow_icmpv6_count,
wow_stats.wow_rssi_breach_wake_up_count,
wow_stats.wow_low_rssi_wake_up_count,
wow_stats.wow_gscan_wake_up_count,
wow_stats.wow_pno_complete_wake_up_count,
wow_stats.wow_pno_match_wake_up_count);
}
#endif
/**
* hdd_wlan_list_fw_profile() - Get fw profiling points
* @length: Size of the data copied

View file

@ -4716,46 +4716,6 @@ struct sir_apf_get_offload {
};
#ifndef QCA_SUPPORT_CP_STATS
/**
* struct sir_wake_lock_stats - wake lock stats structure
* @wow_unspecified_wake_up_count: number of non-wow related wake ups
* @wow_ucast_wake_up_count: Unicast wakeup count
* @wow_bcast_wake_up_count: Broadcast wakeup count
* @wow_ipv4_mcast_wake_up_count: ipv4 multicast wakeup count
* @wow_ipv6_mcast_wake_up_count: ipv6 multicast wakeup count
* @wow_ipv6_mcast_ra_stats: ipv6 multicast ra stats
* @wow_ipv6_mcast_ns_stats: ipv6 multicast ns stats
* @wow_ipv6_mcast_na_stats: ipv6 multicast na stats
* @wow_icmpv4_count: ipv4 icmp packet count
* @wow_icmpv6_count: ipv6 icmp packet count
* @wow_rssi_breach_wake_up_count: rssi breach wakeup count
* @wow_low_rssi_wake_up_count: low rssi wakeup count
* @wow_gscan_wake_up_count: gscan wakeup count
* @wow_pno_complete_wake_up_count: pno complete wakeup count
* @wow_pno_match_wake_up_count: pno match wakeup count
* @wow_oem_response_wake_up_count: oem response wakeup count
* @pwr_save_fail_detected: pwr save fail detected wakeup count
*/
struct sir_wake_lock_stats {
uint32_t wow_unspecified_wake_up_count;
uint32_t wow_ucast_wake_up_count;
uint32_t wow_bcast_wake_up_count;
uint32_t wow_ipv4_mcast_wake_up_count;
uint32_t wow_ipv6_mcast_wake_up_count;
uint32_t wow_ipv6_mcast_ra_stats;
uint32_t wow_ipv6_mcast_ns_stats;
uint32_t wow_ipv6_mcast_na_stats;
uint32_t wow_icmpv4_count;
uint32_t wow_icmpv6_count;
uint32_t wow_rssi_breach_wake_up_count;
uint32_t wow_low_rssi_wake_up_count;
uint32_t wow_gscan_wake_up_count;
uint32_t wow_pno_complete_wake_up_count;
uint32_t wow_pno_match_wake_up_count;
uint32_t wow_oem_response_wake_up_count;
uint32_t pwr_save_fail_detected;
};
/**
* struct sir_vdev_wow_stats - container for per vdev wow related stat counters
* @ucast: Unicast wakeup count

View file

@ -249,9 +249,6 @@ static inline bool wma_is_p2p_lo_capable(void)
}
#endif
bool wma_capability_enhanced_mcast_filter(void);
#ifndef QCA_SUPPORT_CP_STATS
QDF_STATUS wma_get_wakelock_stats(struct sir_wake_lock_stats *wake_lock_stats);
#endif
void wma_process_pdev_hw_mode_trans_ind(void *wma,
wmi_pdev_hw_mode_transition_event_fixed_param *fixed_param,
wmi_pdev_set_hw_mode_response_vdev_mac_entry *vdev_mac_entry,

View file

@ -77,7 +77,6 @@
*/
#define WMA_SET_VDEV_IE_SOURCE_HOST 0x0
#if defined(FEATURE_WLAN_DIAG_SUPPORT)
/**
* qdf_wma_wow_wakeup_stats_event()- send wow wakeup stats
@ -87,7 +86,6 @@
*
* Return: void.
*/
#ifdef QCA_SUPPORT_CP_STATS
static inline void qdf_wma_wow_wakeup_stats_event(tp_wma_handle wma)
{
QDF_STATUS status;
@ -121,52 +119,6 @@ static inline void qdf_wma_wow_wakeup_stats_event(tp_wma_handle wma)
WLAN_HOST_DIAG_EVENT_REPORT(&wow_stats, EVENT_WLAN_POWERSAVE_WOW_STATS);
}
#else /* QCA_SUPPORT_CP_STATS*/
static inline void qdf_wma_wow_wakeup_stats_event(tp_wma_handle wma)
{
QDF_STATUS status;
struct sir_wake_lock_stats stats;
WLAN_HOST_DIAG_EVENT_DEF(WowStats,
struct host_event_wlan_powersave_wow_stats);
status = wma_get_wakelock_stats(&stats);
if (QDF_IS_STATUS_ERROR(status))
return;
qdf_mem_zero(&WowStats, sizeof(WowStats));
WowStats.wow_bcast_wake_up_count =
stats.wow_bcast_wake_up_count;
WowStats.wow_ipv4_mcast_wake_up_count =
stats.wow_ipv4_mcast_wake_up_count;
WowStats.wow_ipv6_mcast_wake_up_count =
stats.wow_ipv6_mcast_wake_up_count;
WowStats.wow_ipv6_mcast_ra_stats =
stats.wow_ipv6_mcast_ra_stats;
WowStats.wow_ipv6_mcast_ns_stats =
stats.wow_ipv6_mcast_ns_stats;
WowStats.wow_ipv6_mcast_na_stats =
stats.wow_ipv6_mcast_na_stats;
WowStats.wow_pno_match_wake_up_count =
stats.wow_pno_match_wake_up_count;
WowStats.wow_pno_complete_wake_up_count =
stats.wow_pno_complete_wake_up_count;
WowStats.wow_gscan_wake_up_count =
stats.wow_gscan_wake_up_count;
WowStats.wow_low_rssi_wake_up_count =
stats.wow_low_rssi_wake_up_count;
WowStats.wow_rssi_breach_wake_up_count =
stats.wow_rssi_breach_wake_up_count;
WowStats.wow_icmpv4_count =
stats.wow_icmpv4_count;
WowStats.wow_icmpv6_count =
stats.wow_icmpv6_count;
WowStats.wow_oem_response_wake_up_count =
stats.wow_oem_response_wake_up_count;
WLAN_HOST_DIAG_EVENT_REPORT(&WowStats, EVENT_WLAN_POWERSAVE_WOW_STATS);
}
#endif /* QCA_SUPPORT_CP_STATS */
#else
static inline void qdf_wma_wow_wakeup_stats_event(tp_wma_handle wma)
{
@ -4730,66 +4682,6 @@ QDF_STATUS wma_set_sw_retry_threshold(uint8_t vdev_id, uint32_t retry,
return QDF_STATUS_SUCCESS;
}
#ifndef QCA_SUPPORT_CP_STATS
/**
* wma_get_wakelock_stats() - Populates wake lock stats
* @stats: non-null wakelock structure to populate
*
* This function collects wake lock stats
*
* Return: QDF_STATUS_SUCCESS on success, error value otherwise
*/
QDF_STATUS wma_get_wakelock_stats(struct sir_wake_lock_stats *stats)
{
t_wma_handle *wma;
struct sir_vdev_wow_stats *vstats;
int i;
if (!stats) {
WMA_LOGE("%s: invalid stats pointer", __func__);
return QDF_STATUS_E_INVAL;
}
wma = cds_get_context(QDF_MODULE_ID_WMA);
if (!wma) {
WMA_LOGE("%s: invalid WMA context", __func__);
return QDF_STATUS_E_INVAL;
}
/* ensure counters are zeroed */
qdf_mem_zero(stats, sizeof(*stats));
/* populate global level stats */
stats->wow_unspecified_wake_up_count = wma->wow_unspecified_wake_count;
/* populate vdev level stats */
for (i = 0; i < wma->max_bssid; ++i) {
if (!wma->interfaces[i].handle)
continue;
vstats = &wma->interfaces[i].wow_stats;
stats->wow_ucast_wake_up_count += vstats->ucast;
stats->wow_bcast_wake_up_count += vstats->bcast;
stats->wow_ipv4_mcast_wake_up_count += vstats->ipv4_mcast;
stats->wow_ipv6_mcast_wake_up_count += vstats->ipv6_mcast;
stats->wow_ipv6_mcast_ra_stats += vstats->ipv6_mcast_ra;
stats->wow_ipv6_mcast_ns_stats += vstats->ipv6_mcast_ns;
stats->wow_ipv6_mcast_na_stats += vstats->ipv6_mcast_na;
stats->wow_icmpv4_count += vstats->icmpv4;
stats->wow_icmpv6_count += vstats->icmpv6;
stats->wow_rssi_breach_wake_up_count += vstats->rssi_breach;
stats->wow_low_rssi_wake_up_count += vstats->low_rssi;
stats->wow_gscan_wake_up_count += vstats->gscan;
stats->wow_pno_complete_wake_up_count += vstats->pno_complete;
stats->wow_pno_match_wake_up_count += vstats->pno_match;
stats->wow_oem_response_wake_up_count += vstats->oem_response;
}
return QDF_STATUS_SUCCESS;
}
#endif
/**
* wma_process_fw_test_cmd() - send unit test command to fw.
* @handle: wma handle