|
@@ -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
|