diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 2278aa7e13f0..258bbf45fc36 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -14903,17 +14903,8 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = wlan_hdd_cfg80211_set_fast_roaming }, -#ifdef WLAN_FEATURE_DISA - { - .info.vendor_id = QCA_NL80211_VENDOR_ID, - .info.subcmd = - QCA_NL80211_VENDOR_SUBCMD_ENCRYPTION_TEST, - .flags = WIPHY_VENDOR_CMD_NEED_WDEV | - WIPHY_VENDOR_CMD_NEED_NETDEV | - WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_encrypt_decrypt_msg - }, -#endif + FEATURE_DISA_VENDOR_COMMANDS + #ifdef FEATURE_WLAN_TDLS { .info.vendor_id = QCA_NL80211_VENDOR_ID, diff --git a/core/hdd/src/wlan_hdd_disa.c b/core/hdd/src/wlan_hdd_disa.c index d021e400da07..eeb5e74aebb0 100644 --- a/core/hdd/src/wlan_hdd_disa.c +++ b/core/hdd/src/wlan_hdd_disa.c @@ -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 * any purpose with or without fee is hereby granted, provided that the @@ -146,7 +146,7 @@ nla_put_failure: return -EINVAL; } -static const struct nla_policy +const struct nla_policy encrypt_decrypt_policy[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_NEEDS_DECRYPTION] = { .type = NLA_FLAG}, diff --git a/core/hdd/src/wlan_hdd_disa.h b/core/hdd/src/wlan_hdd_disa.h index 2116ea14ecdf..de56337dbadd 100644 --- a/core/hdd/src/wlan_hdd_disa.h +++ b/core/hdd/src/wlan_hdd_disa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017, 2020 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 @@ -21,8 +21,24 @@ #include "wlan_hdd_main.h" #include "sir_api.h" +#include "qca_vendor.h" #ifdef WLAN_FEATURE_DISA +extern const struct nla_policy +encrypt_decrypt_policy[QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_MAX + 1]; + +#define FEATURE_DISA_VENDOR_COMMANDS \ +{ \ + .info.vendor_id = QCA_NL80211_VENDOR_ID, \ + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_ENCRYPTION_TEST, \ + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ + WIPHY_VENDOR_CMD_NEED_NETDEV | \ + WIPHY_VENDOR_CMD_NEED_RUNNING, \ + .doit = wlan_hdd_cfg80211_encrypt_decrypt_msg, \ + vendor_command_policy(encrypt_decrypt_policy, \ + QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_MAX) \ +}, + /** * wlan_hdd_cfg80211_encrypt_decrypt_msg () - Encrypt/Decrypt msg * @wiphy: Pointer to wireless phy @@ -36,6 +52,8 @@ int wlan_hdd_cfg80211_encrypt_decrypt_msg(struct wiphy *wiphy, struct wireless_dev *wdev, const void *data, int data_len); +#else +#define FEATURE_DISA_VENDOR_COMMANDS #endif #endif