From 00f4aa9f6430080051d8ac247e1afaf7797cdcd8 Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Tue, 3 Mar 2020 12:13:11 -0800 Subject: [PATCH] qcacld-3.0: Add policy attribute to SPECTRAL_SCAN subcommands According to new changes in kernel 5.4 version onwards, driver has to provide the policy for a NL command to be verified against while registering wiphy to the kernel. To satisfy kernel 5.4 requirement add policy to following vendor commands as part of this change: QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_START QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_STOP QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CONFIG Change-Id: I2c7f4e6b41d341aac7b0984838c72f33a1e1ac5e CRs-Fixed: 2634094 --- core/hdd/inc/wlan_hdd_spectralscan.h | 14 ++++++++++---- core/hdd/src/wlan_hdd_cfg80211.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_spectralscan.h b/core/hdd/inc/wlan_hdd_spectralscan.h index c1754e5b56cf..5cf4b48c2ec8 100644 --- a/core/hdd/inc/wlan_hdd_spectralscan.h +++ b/core/hdd/inc/wlan_hdd_spectralscan.h @@ -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 * any purpose with or without fee is hereby granted, provided that the @@ -74,21 +74,27 @@ struct spectral_scan_msg_v { .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_START, \ .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ WIPHY_VENDOR_CMD_NEED_NETDEV, \ - .doit = wlan_hdd_cfg80211_spectral_scan_start \ + .doit = wlan_hdd_cfg80211_spectral_scan_start, \ + vendor_command_policy(spectral_scan_policy, \ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX) \ }, \ { \ .info.vendor_id = QCA_NL80211_VENDOR_ID, \ .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_STOP, \ .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ WIPHY_VENDOR_CMD_NEED_NETDEV, \ - .doit = wlan_hdd_cfg80211_spectral_scan_stop \ + .doit = wlan_hdd_cfg80211_spectral_scan_stop, \ + vendor_command_policy(spectral_scan_policy, \ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX) \ }, \ { \ .info.vendor_id = QCA_NL80211_VENDOR_ID, \ .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CONFIG, \ .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ WIPHY_VENDOR_CMD_NEED_NETDEV, \ - .doit = wlan_hdd_cfg80211_spectral_scam_get_config \ + .doit = wlan_hdd_cfg80211_spectral_scam_get_config, \ + vendor_command_policy(spectral_scan_policy, \ + QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX) \ }, \ { \ .info.vendor_id = QCA_NL80211_VENDOR_ID, \ diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index a17049187a98..fcf98af48161 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -29,6 +29,7 @@ #include #include #include +#include struct hdd_context;