qcacmn: Track netlink allocations
Track netlink allocations when mem debug is enabled. Change-Id: Icba58f93cf0364678d730f32bd56645efab934e1 CRs-Fixed: 2588037
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -98,7 +98,7 @@ static int wlan_cfg80211_mc_cp_stats_send_wake_lock_stats(struct wiphy *wiphy,
|
|||||||
nl_buf_len += QCA_WLAN_VENDOR_GET_WAKE_STATS_MAX *
|
nl_buf_len += QCA_WLAN_VENDOR_GET_WAKE_STATS_MAX *
|
||||||
(NLMSG_HDRLEN + sizeof(uint32_t));
|
(NLMSG_HDRLEN + sizeof(uint32_t));
|
||||||
|
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, nl_buf_len);
|
skb = wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, nl_buf_len);
|
||||||
|
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
osif_err("cfg80211_vendor_cmd_alloc_reply_skb failed");
|
osif_err("cfg80211_vendor_cmd_alloc_reply_skb failed");
|
||||||
@@ -202,11 +202,11 @@ static int wlan_cfg80211_mc_cp_stats_send_wake_lock_stats(struct wiphy *wiphy,
|
|||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg80211_vendor_cmd_reply(skb);
|
wlan_cfg80211_vendor_cmd_reply(skb);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
nla_put_failure:
|
nla_put_failure:
|
||||||
kfree_skb(skb);
|
wlan_cfg80211_vendor_free_skb(skb);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -839,10 +839,12 @@ static void wlan_vendor_scan_callback(struct cfg80211_scan_request *req,
|
|||||||
int i;
|
int i;
|
||||||
uint8_t scan_status;
|
uint8_t scan_status;
|
||||||
uint64_t cookie;
|
uint64_t cookie;
|
||||||
|
int index = QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE_INDEX;
|
||||||
|
|
||||||
skb = cfg80211_vendor_event_alloc(req->wdev->wiphy, req->wdev,
|
skb = wlan_cfg80211_vendor_event_alloc(req->wdev->wiphy, req->wdev,
|
||||||
SCAN_DONE_EVENT_BUF_SIZE + 4 + NLMSG_HDRLEN,
|
SCAN_DONE_EVENT_BUF_SIZE + 4 +
|
||||||
QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE_INDEX,
|
NLMSG_HDRLEN,
|
||||||
|
index,
|
||||||
GFP_ATOMIC);
|
GFP_ATOMIC);
|
||||||
|
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
@@ -889,13 +891,13 @@ static void wlan_vendor_scan_callback(struct cfg80211_scan_request *req,
|
|||||||
if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_SCAN_STATUS, scan_status))
|
if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_SCAN_STATUS, scan_status))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
|
|
||||||
cfg80211_vendor_event(skb, GFP_ATOMIC);
|
wlan_cfg80211_vendor_event(skb, GFP_ATOMIC);
|
||||||
qdf_mem_free(req);
|
qdf_mem_free(req);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nla_put_failure:
|
nla_put_failure:
|
||||||
kfree_skb(skb);
|
wlan_cfg80211_vendor_free_skb(skb);
|
||||||
qdf_mem_free(req);
|
qdf_mem_free(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -31,7 +31,6 @@
|
|||||||
#include <wlan_spectral_ucfg_api.h>
|
#include <wlan_spectral_ucfg_api.h>
|
||||||
#include <wlan_cfg80211_spectral.h>
|
#include <wlan_cfg80211_spectral.h>
|
||||||
#include <spectral_ioctl.h>
|
#include <spectral_ioctl.h>
|
||||||
#include "qal_devcfg.h"
|
|
||||||
|
|
||||||
static const struct nla_policy spectral_scan_policy[
|
static const struct nla_policy spectral_scan_policy[
|
||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX + 1] = {
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX + 1] = {
|
||||||
@@ -377,7 +376,8 @@ int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
|
|||||||
skb_len += NLA_HDRLEN + sizeof(u32);
|
skb_len += NLA_HDRLEN + sizeof(u32);
|
||||||
/* QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_COOKIE */
|
/* QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_COOKIE */
|
||||||
skb_len += NLA_HDRLEN + sizeof(u64);
|
skb_len += NLA_HDRLEN + sizeof(u64);
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, skb_len);
|
skb = wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, skb_len);
|
||||||
|
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
osif_err(" reply skb alloc failed");
|
osif_err(" reply skb alloc failed");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@@ -385,8 +385,10 @@ int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
|
|||||||
|
|
||||||
status = wlan_cfg80211_spectral_scan_dma_debug_config(
|
status = wlan_cfg80211_spectral_scan_dma_debug_config(
|
||||||
pdev, tb, sscan_mode);
|
pdev, tb, sscan_mode);
|
||||||
if (QDF_IS_STATUS_ERROR(status))
|
if (QDF_IS_STATUS_ERROR(status)) {
|
||||||
return -EINVAL;
|
status = QDF_STATUS_E_INVAL;
|
||||||
|
goto free_skb_return_os_status;
|
||||||
|
}
|
||||||
|
|
||||||
if (CONFIG_REQUESTED(scan_req_type)) {
|
if (CONFIG_REQUESTED(scan_req_type)) {
|
||||||
sscan_req.ss_mode = sscan_mode;
|
sscan_req.ss_mode = sscan_mode;
|
||||||
@@ -401,25 +403,23 @@ int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
|
|||||||
|
|
||||||
/* No error reasons populated, just return error */
|
/* No error reasons populated, just return error */
|
||||||
if (sscan_req.config_req.sscan_err_code ==
|
if (sscan_req.config_req.sscan_err_code ==
|
||||||
SPECTRAL_SCAN_ERR_INVALID) {
|
SPECTRAL_SCAN_ERR_INVALID)
|
||||||
kfree_skb(skb);
|
goto free_skb_return_os_status;
|
||||||
return qdf_status_to_os_return(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
status = convert_spectral_err_code_internal_to_nl
|
status = convert_spectral_err_code_internal_to_nl
|
||||||
(sscan_req.config_req.sscan_err_code,
|
(sscan_req.config_req.sscan_err_code,
|
||||||
&spectral_nl_err_code);
|
&spectral_nl_err_code);
|
||||||
if (QDF_IS_STATUS_ERROR(status)) {
|
if (QDF_IS_STATUS_ERROR(status)) {
|
||||||
kfree_skb(skb);
|
status = QDF_STATUS_E_INVAL;
|
||||||
return -EINVAL;
|
goto free_skb_return_os_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nla_put_u32
|
if (nla_put_u32
|
||||||
(skb,
|
(skb,
|
||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_ERROR_CODE,
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_ERROR_CODE,
|
||||||
spectral_nl_err_code)) {
|
spectral_nl_err_code)) {
|
||||||
kfree_skb(skb);
|
status = QDF_STATUS_E_INVAL;
|
||||||
return -EINVAL;
|
goto free_skb_return_os_status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -434,25 +434,23 @@ int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
|
|||||||
|
|
||||||
/* No error reasons populated, just return error */
|
/* No error reasons populated, just return error */
|
||||||
if (sscan_req.action_req.sscan_err_code ==
|
if (sscan_req.action_req.sscan_err_code ==
|
||||||
SPECTRAL_SCAN_ERR_INVALID) {
|
SPECTRAL_SCAN_ERR_INVALID)
|
||||||
kfree_skb(skb);
|
goto free_skb_return_os_status;
|
||||||
return qdf_status_to_os_return(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
status = convert_spectral_err_code_internal_to_nl
|
status = convert_spectral_err_code_internal_to_nl
|
||||||
(sscan_req.action_req.sscan_err_code,
|
(sscan_req.action_req.sscan_err_code,
|
||||||
&spectral_nl_err_code);
|
&spectral_nl_err_code);
|
||||||
if (QDF_IS_STATUS_ERROR(status)) {
|
if (QDF_IS_STATUS_ERROR(status)) {
|
||||||
kfree_skb(skb);
|
status = QDF_STATUS_E_INVAL;
|
||||||
return -EINVAL;
|
goto free_skb_return_os_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nla_put_u32
|
if (nla_put_u32
|
||||||
(skb,
|
(skb,
|
||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_ERROR_CODE,
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_ERROR_CODE,
|
||||||
spectral_nl_err_code)) {
|
spectral_nl_err_code)) {
|
||||||
kfree_skb(skb);
|
status = QDF_STATUS_E_INVAL;
|
||||||
return -EINVAL;
|
goto free_skb_return_os_status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -461,13 +459,15 @@ int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
|
|||||||
if (wlan_cfg80211_nla_put_u64(skb,
|
if (wlan_cfg80211_nla_put_u64(skb,
|
||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_COOKIE,
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_COOKIE,
|
||||||
cookie)) {
|
cookie)) {
|
||||||
kfree_skb(skb);
|
status = QDF_STATUS_E_INVAL;
|
||||||
return -EINVAL;
|
goto free_skb_return_os_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
qal_devcfg_send_response((qdf_nbuf_t)skb);
|
wlan_cfg80211_qal_devcfg_send_response((qdf_nbuf_t)skb);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
free_skb_return_os_status:
|
||||||
|
wlan_cfg80211_vendor_free_skb(skb);
|
||||||
|
return qdf_status_to_os_return(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
int wlan_cfg80211_spectral_scan_stop(struct wiphy *wiphy,
|
int wlan_cfg80211_spectral_scan_stop(struct wiphy *wiphy,
|
||||||
@@ -517,8 +517,9 @@ int wlan_cfg80211_spectral_scan_stop(struct wiphy *wiphy,
|
|||||||
if (QDF_IS_STATUS_ERROR(status))
|
if (QDF_IS_STATUS_ERROR(status))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, NLMSG_HDRLEN +
|
skb = wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
|
||||||
sizeof(u32) + NLA_HDRLEN);
|
NLMSG_HDRLEN + sizeof(u32) + NLA_HDRLEN);
|
||||||
|
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
osif_err(" reply skb alloc failed");
|
osif_err(" reply skb alloc failed");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@@ -528,10 +529,10 @@ int wlan_cfg80211_spectral_scan_stop(struct wiphy *wiphy,
|
|||||||
(skb,
|
(skb,
|
||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_ERROR_CODE,
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_ERROR_CODE,
|
||||||
spectral_nl_err_code)) {
|
spectral_nl_err_code)) {
|
||||||
kfree_skb(skb);
|
wlan_cfg80211_vendor_free_skb(skb);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
qal_devcfg_send_response((qdf_nbuf_t)skb);
|
wlan_cfg80211_qal_devcfg_send_response((qdf_nbuf_t)skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -568,7 +569,8 @@ int wlan_cfg80211_spectral_scan_get_config(struct wiphy *wiphy,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, (sizeof(u32) +
|
skb = wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
|
||||||
|
(sizeof(u32) +
|
||||||
NLA_HDRLEN) * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX +
|
NLA_HDRLEN) * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX +
|
||||||
NLMSG_HDRLEN);
|
NLMSG_HDRLEN);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
@@ -643,10 +645,8 @@ int wlan_cfg80211_spectral_scan_get_config(struct wiphy *wiphy,
|
|||||||
sconfig->ss_short_report) ||
|
sconfig->ss_short_report) ||
|
||||||
nla_put_u32(skb,
|
nla_put_u32(skb,
|
||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FREQUENCY,
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FREQUENCY,
|
||||||
sconfig->ss_frequency)) {
|
sconfig->ss_frequency))
|
||||||
kfree_skb(skb);
|
goto fail;
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
sscan_req.ss_mode = sscan_mode;
|
sscan_req.ss_mode = sscan_mode;
|
||||||
sscan_req.req_id = SPECTRAL_GET_DEBUG_LEVEL;
|
sscan_req.req_id = SPECTRAL_GET_DEBUG_LEVEL;
|
||||||
@@ -654,13 +654,14 @@ int wlan_cfg80211_spectral_scan_get_config(struct wiphy *wiphy,
|
|||||||
spectral_dbg_level = sscan_req.debug_req.spectral_dbg_level;
|
spectral_dbg_level = sscan_req.debug_req.spectral_dbg_level;
|
||||||
if (nla_put_u32(skb,
|
if (nla_put_u32(skb,
|
||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_DEBUG_LEVEL,
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_DEBUG_LEVEL,
|
||||||
spectral_dbg_level)) {
|
spectral_dbg_level))
|
||||||
kfree_skb(skb);
|
goto fail;
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
qal_devcfg_send_response((qdf_nbuf_t)skb);
|
|
||||||
|
|
||||||
|
wlan_cfg80211_qal_devcfg_send_response((qdf_nbuf_t)skb);
|
||||||
return 0;
|
return 0;
|
||||||
|
fail:
|
||||||
|
wlan_cfg80211_vendor_free_skb(skb);
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wlan_cfg80211_spectral_scan_get_cap(struct wiphy *wiphy,
|
int wlan_cfg80211_spectral_scan_get_cap(struct wiphy *wiphy,
|
||||||
@@ -677,7 +678,8 @@ int wlan_cfg80211_spectral_scan_get_cap(struct wiphy *wiphy,
|
|||||||
status = ucfg_spectral_control(pdev, &sscan_req);
|
status = ucfg_spectral_control(pdev, &sscan_req);
|
||||||
scaps = &sscan_req.caps_req.sscan_caps;
|
scaps = &sscan_req.caps_req.sscan_caps;
|
||||||
|
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, (sizeof(u32) +
|
skb = wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
|
||||||
|
(sizeof(u32) +
|
||||||
NLA_HDRLEN) * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_MAX +
|
NLA_HDRLEN) * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_MAX +
|
||||||
NLMSG_HDRLEN);
|
NLMSG_HDRLEN);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
@@ -773,12 +775,12 @@ int wlan_cfg80211_spectral_scan_get_cap(struct wiphy *wiphy,
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
qal_devcfg_send_response((qdf_nbuf_t)skb);
|
wlan_cfg80211_qal_devcfg_send_response((qdf_nbuf_t)skb);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
kfree_skb(skb);
|
wlan_cfg80211_vendor_free_skb(skb);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -796,8 +798,9 @@ int wlan_cfg80211_spectral_scan_get_diag_stats(struct wiphy *wiphy,
|
|||||||
status = ucfg_spectral_control(pdev, &sscan_req);
|
status = ucfg_spectral_control(pdev, &sscan_req);
|
||||||
spetcral_diag = &sscan_req.diag_req.sscan_diag;
|
spetcral_diag = &sscan_req.diag_req.sscan_diag;
|
||||||
|
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, (sizeof(u64) +
|
skb = wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
|
||||||
NLA_HDRLEN) * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_MAX +
|
(sizeof(u64) + NLA_HDRLEN) *
|
||||||
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_MAX +
|
||||||
NLMSG_HDRLEN);
|
NLMSG_HDRLEN);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
osif_err(" reply skb alloc failed");
|
osif_err(" reply skb alloc failed");
|
||||||
@@ -824,10 +827,10 @@ int wlan_cfg80211_spectral_scan_get_diag_stats(struct wiphy *wiphy,
|
|||||||
skb,
|
skb,
|
||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_VHTSEG2ID_MISMATCH,
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_VHTSEG2ID_MISMATCH,
|
||||||
spetcral_diag->spectral_vhtseg2id_mismatch)) {
|
spetcral_diag->spectral_vhtseg2id_mismatch)) {
|
||||||
kfree_skb(skb);
|
wlan_cfg80211_vendor_free_skb(skb);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
qal_devcfg_send_response((qdf_nbuf_t)skb);
|
wlan_cfg80211_qal_devcfg_send_response((qdf_nbuf_t)skb);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -873,8 +876,8 @@ int wlan_cfg80211_spectral_scan_get_status(struct wiphy *wiphy,
|
|||||||
status = ucfg_spectral_control(pdev, &sscan_req);
|
status = ucfg_spectral_control(pdev, &sscan_req);
|
||||||
sscan_state.is_enabled = sscan_req.status_req.is_enabled;
|
sscan_state.is_enabled = sscan_req.status_req.is_enabled;
|
||||||
|
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 2 * (sizeof(u32) +
|
skb = wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
|
||||||
NLA_HDRLEN) + NLMSG_HDRLEN);
|
2 * (sizeof(u32) + NLA_HDRLEN) + NLMSG_HDRLEN);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
osif_err(" reply skb alloc failed");
|
osif_err(" reply skb alloc failed");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@@ -891,10 +894,10 @@ int wlan_cfg80211_spectral_scan_get_status(struct wiphy *wiphy,
|
|||||||
skb,
|
skb,
|
||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_IS_ACTIVE))
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_IS_ACTIVE))
|
||||||
goto fail;
|
goto fail;
|
||||||
qal_devcfg_send_response((qdf_nbuf_t)skb);
|
wlan_cfg80211_qal_devcfg_send_response((qdf_nbuf_t)skb);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
kfree_skb(skb);
|
wlan_cfg80211_vendor_free_skb(skb);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -29,6 +29,8 @@
|
|||||||
#include <net/netlink.h>
|
#include <net/netlink.h>
|
||||||
#include <net/cfg80211.h>
|
#include <net/cfg80211.h>
|
||||||
#include <qca_vendor.h>
|
#include <qca_vendor.h>
|
||||||
|
#include <qdf_nbuf.h>
|
||||||
|
#include "qal_devcfg.h"
|
||||||
|
|
||||||
#define osif_alert(params...) \
|
#define osif_alert(params...) \
|
||||||
QDF_TRACE_FATAL(QDF_MODULE_ID_OS_IF, params)
|
QDF_TRACE_FATAL(QDF_MODULE_ID_OS_IF, params)
|
||||||
@@ -56,6 +58,94 @@
|
|||||||
#define osif_nofl_debug(params...) \
|
#define osif_nofl_debug(params...) \
|
||||||
QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_OS_IF, params)
|
QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_OS_IF, params)
|
||||||
|
|
||||||
|
#if defined(NBUF_MEMORY_DEBUG) && defined(NETLINK_BUF_TRACK)
|
||||||
|
#define wlan_cfg80211_vendor_free_skb(skb) \
|
||||||
|
qdf_nbuf_free(skb)
|
||||||
|
|
||||||
|
#define wlan_cfg80211_vendor_event(skb, gfp) \
|
||||||
|
{ \
|
||||||
|
qdf_nbuf_count_dec(skb); \
|
||||||
|
qdf_net_buf_debug_release_skb(skb); \
|
||||||
|
cfg80211_vendor_event(skb, gfp); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define wlan_cfg80211_vendor_cmd_reply(skb) \
|
||||||
|
{ \
|
||||||
|
qdf_nbuf_count_dec(skb); \
|
||||||
|
qdf_net_buf_debug_release_skb(skb); \
|
||||||
|
cfg80211_vendor_cmd_reply(skb); \
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline QDF_STATUS wlan_cfg80211_qal_devcfg_send_response(qdf_nbuf_t skb)
|
||||||
|
{
|
||||||
|
qdf_nbuf_count_dec(skb);
|
||||||
|
qdf_net_buf_debug_release_skb(skb);
|
||||||
|
return qal_devcfg_send_response(skb);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline struct sk_buff *
|
||||||
|
__cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, int len,
|
||||||
|
const char *func, uint32_t line)
|
||||||
|
{
|
||||||
|
struct sk_buff *skb;
|
||||||
|
|
||||||
|
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len);
|
||||||
|
if (skb) {
|
||||||
|
qdf_nbuf_count_inc(skb);
|
||||||
|
qdf_net_buf_debug_acquire_skb(skb, func, line);
|
||||||
|
}
|
||||||
|
return skb;
|
||||||
|
}
|
||||||
|
#define wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len) \
|
||||||
|
__cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len, __func__, __LINE__)
|
||||||
|
|
||||||
|
static inline struct sk_buff *
|
||||||
|
__cfg80211_vendor_event_alloc(struct wiphy *wiphy,
|
||||||
|
struct wireless_dev *wdev,
|
||||||
|
int approxlen,
|
||||||
|
int event_idx,
|
||||||
|
gfp_t gfp,
|
||||||
|
const char *func,
|
||||||
|
uint32_t line)
|
||||||
|
{
|
||||||
|
struct sk_buff *skb;
|
||||||
|
|
||||||
|
skb = cfg80211_vendor_event_alloc(wiphy, wdev,
|
||||||
|
approxlen,
|
||||||
|
event_idx,
|
||||||
|
gfp);
|
||||||
|
if (skb) {
|
||||||
|
qdf_nbuf_count_inc(skb);
|
||||||
|
qdf_net_buf_debug_acquire_skb(skb, func, line);
|
||||||
|
}
|
||||||
|
return skb;
|
||||||
|
}
|
||||||
|
#define wlan_cfg80211_vendor_event_alloc(wiphy, wdev, len, idx, gfp) \
|
||||||
|
__cfg80211_vendor_event_alloc(wiphy, wdev, len, \
|
||||||
|
idx, gfp, \
|
||||||
|
__func__, __LINE__)
|
||||||
|
#else /* NBUF_MEMORY_DEBUG && NETLINK_BUF_TRACK */
|
||||||
|
#define wlan_cfg80211_vendor_free_skb(skb) \
|
||||||
|
kfree_skb(skb)
|
||||||
|
|
||||||
|
#define wlan_cfg80211_vendor_event(skb, gfp) \
|
||||||
|
cfg80211_vendor_event(skb, gfp)
|
||||||
|
|
||||||
|
#define wlan_cfg80211_vendor_cmd_reply(skb) \
|
||||||
|
cfg80211_vendor_cmd_reply(skb)
|
||||||
|
|
||||||
|
#define wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len) \
|
||||||
|
cfg80211_vendor_cmd_alloc_reply_skb(wiphy, len)
|
||||||
|
|
||||||
|
#define wlan_cfg80211_vendor_event_alloc(wiphy, wdev, len, idx, gfp) \
|
||||||
|
cfg80211_vendor_event_alloc(wiphy, wdev, len, idx, gfp)
|
||||||
|
|
||||||
|
static inline QDF_STATUS wlan_cfg80211_qal_devcfg_send_response( qdf_nbuf_t skb)
|
||||||
|
{
|
||||||
|
return qal_devcfg_send_response(skb);
|
||||||
|
}
|
||||||
|
#endif /* NBUF_MEMORY_DEBUG && NETLINK_BUF_TRACK */
|
||||||
|
|
||||||
#undef nla_parse
|
#undef nla_parse
|
||||||
#undef nla_parse_nested
|
#undef nla_parse_nested
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
|
||||||
@@ -111,5 +201,4 @@ wlan_cfg80211_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
|
|||||||
return nla_put_u64_64bit(skb, attrtype, value, NL80211_ATTR_PAD);
|
return nla_put_u64_64bit(skb, attrtype, value, NL80211_ATTR_PAD);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user