|
@@ -13319,8 +13319,6 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
|
|
|
const void *data, int data_len)
|
|
|
{
|
|
|
int err = 0;
|
|
|
- unsigned long rc;
|
|
|
- struct hdd_nud_stats_context *context;
|
|
|
struct net_device *dev = wdev->netdev;
|
|
|
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
|
@@ -13328,6 +13326,12 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
|
|
|
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
|
|
|
uint32_t pkt_type_bitmap;
|
|
|
struct sk_buff *skb;
|
|
|
+ struct hdd_request *request = NULL;
|
|
|
+ static const struct hdd_request_params params = {
|
|
|
+ .priv_size = 0,
|
|
|
+ .timeout_ms = WLAN_WAIT_TIME_NUD_STATS,
|
|
|
+ };
|
|
|
+ void *cookie = NULL;
|
|
|
|
|
|
hdd_enter();
|
|
|
|
|
@@ -13349,14 +13353,17 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
+ request = hdd_request_alloc(¶ms);
|
|
|
+ if (!request) {
|
|
|
+ hdd_err("Request allocation failure");
|
|
|
+ return -ENOMEM;
|
|
|
+ }
|
|
|
+
|
|
|
+ cookie = hdd_request_cookie(request);
|
|
|
+
|
|
|
arp_stats_params.pkt_type = WLAN_NUD_STATS_ARP_PKT_TYPE;
|
|
|
arp_stats_params.vdev_id = adapter->session_id;
|
|
|
|
|
|
- spin_lock(&hdd_context_lock);
|
|
|
- context = &hdd_ctx->nud_stats_context;
|
|
|
- INIT_COMPLETION(context->response_event);
|
|
|
- spin_unlock(&hdd_context_lock);
|
|
|
-
|
|
|
pkt_type_bitmap = adapter->pkt_type_bitmap;
|
|
|
|
|
|
/* send NUD failure event only when ARP tracking is enabled. */
|
|
@@ -13368,18 +13375,25 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
|
|
|
0xFF, 0XFF,
|
|
|
DATA_STALL_LOG_RECOVERY_TRIGGER_PDR);
|
|
|
|
|
|
+ if (sme_set_nud_debug_stats_cb(hdd_ctx->hHal, hdd_get_nud_stats_cb,
|
|
|
+ cookie) != QDF_STATUS_SUCCESS) {
|
|
|
+ hdd_err("Setting NUD debug stats callback failure");
|
|
|
+ err = -EINVAL;
|
|
|
+ goto exit;
|
|
|
+ }
|
|
|
+
|
|
|
if (QDF_STATUS_SUCCESS !=
|
|
|
sme_get_nud_debug_stats(hdd_ctx->hHal, &arp_stats_params)) {
|
|
|
hdd_err("STATS_SET_START CMD Failed!");
|
|
|
- return -EINVAL;
|
|
|
+ err = -EINVAL;
|
|
|
+ goto exit;
|
|
|
}
|
|
|
|
|
|
- rc = wait_for_completion_timeout(&context->response_event,
|
|
|
- msecs_to_jiffies(
|
|
|
- WLAN_WAIT_TIME_NUD_STATS));
|
|
|
- if (!rc) {
|
|
|
- hdd_err("Target response timed out request ");
|
|
|
- return -ETIMEDOUT;
|
|
|
+ err = hdd_request_wait_for_response(request);
|
|
|
+ if (err) {
|
|
|
+ hdd_err("SME timedout while retrieving NUD stats");
|
|
|
+ err = -ETIMEDOUT;
|
|
|
+ goto exit;
|
|
|
}
|
|
|
|
|
|
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
|
|
@@ -13387,7 +13401,8 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
|
|
|
if (!skb) {
|
|
|
hdd_err("%s: cfg80211_vendor_cmd_alloc_reply_skb failed",
|
|
|
__func__);
|
|
|
- return -ENOMEM;
|
|
|
+ err = -ENOMEM;
|
|
|
+ goto exit;
|
|
|
}
|
|
|
|
|
|
if (nla_put_u16(skb, COUNT_FROM_NETDEV,
|
|
@@ -13409,7 +13424,8 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
|
|
|
rx_host_drop_reorder)) {
|
|
|
hdd_err("nla put fail");
|
|
|
kfree_skb(skb);
|
|
|
- return -EINVAL;
|
|
|
+ err = -EINVAL;
|
|
|
+ goto exit;
|
|
|
}
|
|
|
if (adapter->con_status)
|
|
|
nla_put_flag(skb, AP_LINK_ACTIVE);
|
|
@@ -13420,11 +13436,15 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
|
|
|
pkt_type_bitmap &= ~CONNECTIVITY_CHECK_SET_ARP;
|
|
|
|
|
|
if (pkt_type_bitmap) {
|
|
|
- if (hdd_populate_connectivity_check_stats_info(adapter, skb))
|
|
|
- return -EINVAL;
|
|
|
+ if (hdd_populate_connectivity_check_stats_info(adapter, skb)) {
|
|
|
+ err = -EINVAL;
|
|
|
+ goto exit;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
cfg80211_vendor_cmd_reply(skb);
|
|
|
+exit:
|
|
|
+ hdd_request_put(request);
|
|
|
return err;
|
|
|
}
|
|
|
|