Jelajahi Sumber

Merge "qcacmn: Add wrapper for nla_parse()"

Linux Build Service Account 7 tahun lalu
induk
melakukan
255259ce38

+ 1 - 1
dp/inc/cdp_txrx_ipa.h

@@ -30,7 +30,7 @@
  */
 #ifndef _CDP_TXRX_IPA_H_
 #define _CDP_TXRX_IPA_H_
-#include <ipa.h>
+#include <linux/ipa.h>
 #include <cdp_txrx_mob_def.h>
 #include "cdp_txrx_handle.h"
 

+ 1 - 1
dp/inc/cdp_txrx_ops.h

@@ -33,7 +33,7 @@
 #include <cdp_txrx_mon_struct.h>
 #include "wlan_objmgr_psoc_obj.h"
 #ifdef IPA_OFFLOAD
-#include <ipa.h>
+#include <linux/ipa.h>
 #endif
 
 /******************************************************************************

+ 1 - 1
dp/wifi3.0/dp_rx.c

@@ -22,7 +22,7 @@
 #include "hal_rx.h"
 #include "hal_api.h"
 #include "qdf_nbuf.h"
-#include <ieee80211.h>
+#include <linux/ieee80211.h>
 #ifdef MESH_MODE_SUPPORT
 #include "if_meta_hdr.h"
 #endif

+ 1 - 1
dp/wifi3.0/dp_rx_defrag.h

@@ -24,7 +24,7 @@
 #ifdef CONFIG_MCL
 #include <cds_ieee80211_common.h>
 #else
-#include <ieee80211.h>
+#include <linux/ieee80211.h>
 #endif
 
 #define DEFRAG_IEEE80211_ADDR_LEN	6

+ 1 - 1
dp/wifi3.0/dp_rx_err.c

@@ -26,7 +26,7 @@
 #ifdef CONFIG_MCL
 #include <cds_ieee80211_common.h>
 #else
-#include <ieee80211.h>
+#include <linux/ieee80211.h>
 #endif
 #include "dp_rx_defrag.h"
 #include <enet.h>	/* LLC_SNAP_HDR_LEN */

+ 1 - 1
dp/wifi3.0/dp_rx_mon_dest.c

@@ -24,7 +24,7 @@
 #include "qdf_trace.h"
 #include "qdf_nbuf.h"
 #include "hal_api_mon.h"
-#include "ieee80211.h"
+#include "linux/ieee80211.h"
 #include "dp_rx_mon.h"
 #include "wlan_cfg.h"
 

+ 1 - 1
dp/wifi3.0/dp_rx_mon_status.c

@@ -23,7 +23,7 @@
 #include "qdf_trace.h"
 #include "qdf_nbuf.h"
 #include "hal_api_mon.h"
-#include "ieee80211.h"
+#include "linux/ieee80211.h"
 #include "dp_rx_mon.h"
 #include "dp_internal.h"
 #include "qdf_mem.h"   /* qdf_mem_malloc,free */

+ 1 - 1
dp/wifi3.0/dp_types.h

@@ -33,7 +33,7 @@
 #ifdef CONFIG_MCL
 #include <cds_ieee80211_common.h>
 #else
-#include <ieee80211.h>
+#include <linux/ieee80211.h>
 #endif
 
 #ifndef CONFIG_WIN

+ 1 - 1
hif/src/hif_irq_affinity.c

@@ -23,7 +23,7 @@
  * an abstraction layer...  Should this be moved into a /linux folder?
  */
 
-#include <string.h> /* memset */
+#include <linux/string.h> /* memset */
 
 /* Linux headers */
 #include <linux/cpumask.h>

+ 1 - 1
hif/src/hif_napi.c

@@ -31,7 +31,7 @@
  * HIF NAPI interface implementation
  */
 
-#include <string.h> /* memset */
+#include <linux/string.h> /* memset */
 
 /* Linux headers */
 #include <linux/cpumask.h>

+ 2 - 2
os_if/linux/nan/src/os_if_nan.c

@@ -564,8 +564,8 @@ int os_if_nan_process_ndp_cmd(struct wlan_objmgr_psoc *psoc,
 	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1];
 	char *iface_name;
 
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX,
-			data, data_len, vendor_attr_policy)) {
+	if (wlan_cfg80211_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX,
+				    data, data_len, vendor_attr_policy)) {
 		cfg80211_err("Invalid NDP vendor command attributes");
 		return -EINVAL;
 	}

+ 2 - 2
os_if/linux/scan/src/wlan_cfg80211_scan.c

@@ -1458,8 +1458,8 @@ int wlan_vendor_abort_scan(struct wlan_objmgr_pdev *pdev,
 	uint8_t pdev_id;
 
 	pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SCAN_MAX, data,
-		      data_len, scan_policy)) {
+	if (wlan_cfg80211_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SCAN_MAX, data,
+				    data_len, scan_policy)) {
 		cfg80211_err("Invalid ATTR");
 		return ret;
 	}

+ 1 - 1
os_if/linux/wifi_pos/src/os_if_wifi_pos.c

@@ -93,7 +93,7 @@ static int  wifi_pos_parse_req(const void *data, int len, int pid,
 	tAniMsgHdr *msg_hdr;
 	struct nlattr *tb[CLD80211_ATTR_MAX + 1];
 
-	if (nla_parse(tb, CLD80211_ATTR_MAX, data, len, NULL)) {
+	if (wlan_cfg80211_nla_parse(tb, CLD80211_ATTR_MAX, data, len, NULL)) {
 		cfg80211_err("invalid data in request");
 		return OEM_ERR_INVALID_MESSAGE_TYPE;
 	}

+ 20 - 0
os_if/linux/wlan_cfg80211.h

@@ -64,6 +64,26 @@
 	.doit = NULL							\
 },
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
+static inline int wlan_cfg80211_nla_parse(struct nlattr **tb,
+					  int maxtype,
+					  const struct nlattr *head,
+					  int len,
+					  const struct nla_policy *policy)
+{
+	return nla_parse(tb, maxtype, head, len, policy);
+}
+#else
+static inline int wlan_cfg80211_nla_parse(struct nlattr **tb,
+					  int maxtype,
+					  const struct nlattr *head,
+					  int len,
+					  const struct nla_policy *policy)
+{
+	return nla_parse(tb, maxtype, head, len, policy, NULL);
+}
+#endif
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))
 static inline int
 wlan_cfg80211_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)

+ 2 - 2
qdf/linux/src/i_qdf_trace.h

@@ -36,8 +36,8 @@
 #define __I_QDF_TRACE_H
 
 /* older kernels have a bug in kallsyms, so ensure module.h is included */
-#include <module.h>
-#include <kallsyms.h>
+#include <linux/module.h>
+#include <linux/kallsyms.h>
 
 #if !defined(__printf)
 #define __printf(a, b)

+ 1 - 1
qdf/linux/src/qdf_threads.c

@@ -44,7 +44,7 @@
 #include <linux/interrupt.h>
 #include <linux/export.h>
 #include <linux/kthread.h>
-#include <stacktrace.h>
+#include <linux/stacktrace.h>
 
 /* Function declarations and documenation */
 

+ 74 - 0
umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -2011,4 +2011,78 @@ bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc,
  */
 uint8_t policy_mgr_mode_specific_get_channel(
 	struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode);
+
+/**
+ * policy_mgr_enable_disable_sap_mandatory_chan_list() - Update the value of
+ * enable_sap_mandatory_chan_list
+ * @psoc: Pointer to soc
+ * @val: value of enable_sap_mandatory_chan_list
+ *
+ * Update the value of enable_sap_mandatory_chan_list
+ *
+ * Return: void
+ */
+void policy_mgr_enable_disable_sap_mandatory_chan_list(
+		struct wlan_objmgr_psoc *psoc, bool val);
+
+/**
+ * policy_mgr_add_sap_mandatory_chan() - Add chan to SAP mandatory channel
+ * list
+ * @psoc: Pointer to soc
+ * @chan: Channel to be added
+ *
+ * Add chan to SAP mandatory channel list
+ *
+ * Return: None
+ */
+void policy_mgr_add_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc,
+		uint8_t chan);
+
+/**
+ * policy_mgr_is_sap_mandatory_chan_list_enabled() - Return the SAP mandatory
+ * channel list enabled status
+ * @psoc: Pointer to soc
+ *
+ * Get the SAP mandatory channel list enabled status
+ *
+ * Return: Enable or Disable
+ */
+bool policy_mgr_is_sap_mandatory_chan_list_enabled(
+		struct wlan_objmgr_psoc *psoc);
+
+/**
+ * policy_mgr_get_sap_mandatory_chan_list_len() - Return the SAP mandatory
+ * channel list len
+ * @psoc: Pointer to soc
+ *
+ * Get the SAP mandatory channel list len
+ *
+ * Return: Channel list length
+ */
+uint32_t policy_mgr_get_sap_mandatory_chan_list_len(
+		struct wlan_objmgr_psoc *psoc);
+
+/**
+ * policy_mgr_init_sap_mandatory_2g_chan() - Init 2.4G SAP mandatory channel
+ * list
+ * @psoc: Pointer to soc
+ *
+ * Initialize the 2.4G SAP mandatory channels
+ *
+ * Return: None
+ */
+void  policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * policy_mgr_remove_sap_mandatory_chan() - Remove channel from SAP mandatory
+ * channel list
+ * @psoc: Pointer to soc
+ * @chan: channel to be removed from mandatory channel list
+ *
+ * Remove channel from SAP mandatory channel list
+ *
+ * Return: None
+ */
+void policy_mgr_remove_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc,
+		uint8_t chan);
 #endif /* __WLAN_POLICY_MGR_API_H */

+ 126 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -2681,3 +2681,129 @@ QDF_STATUS policy_mgr_reset_sap_mandatory_channels(
 
 	return QDF_STATUS_SUCCESS;
 }
+
+void policy_mgr_enable_disable_sap_mandatory_chan_list(
+		struct wlan_objmgr_psoc *psoc, bool val)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return;
+	}
+
+	pm_ctx->enable_sap_mandatory_chan_list = val;
+}
+
+void policy_mgr_add_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc,
+		uint8_t chan)
+{
+	int i;
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return;
+	}
+
+	for (i = 0; i < pm_ctx->sap_mandatory_channels_len; i++) {
+		if (chan == pm_ctx->sap_mandatory_channels[i])
+			return;
+	}
+
+	policy_mgr_debug("chan %hu", chan);
+	pm_ctx->sap_mandatory_channels[pm_ctx->sap_mandatory_channels_len++]
+		= chan;
+}
+
+bool policy_mgr_is_sap_mandatory_chan_list_enabled(
+		struct wlan_objmgr_psoc *psoc)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return false;
+	}
+
+	return pm_ctx->enable_sap_mandatory_chan_list;
+}
+
+uint32_t policy_mgr_get_sap_mandatory_chan_list_len(
+		struct wlan_objmgr_psoc *psoc)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return 0;
+	}
+
+	return pm_ctx->sap_mandatory_channels_len;
+}
+
+void  policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc)
+{
+	uint8_t chan_list[QDF_MAX_NUM_CHAN] = {0};
+	uint32_t len = 0;
+	int i;
+	QDF_STATUS status;
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return;
+	}
+
+	status = policy_mgr_get_valid_chans(psoc, chan_list, &len);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		policy_mgr_err("Error in getting valid channels");
+		return;
+	}
+	for (i = 0; i < len; i++) {
+		if (WLAN_REG_IS_24GHZ_CH(chan_list[i])) {
+			policy_mgr_debug("Add chan %hu to mandatory list",
+					chan_list[i]);
+			pm_ctx->sap_mandatory_channels[
+				pm_ctx->sap_mandatory_channels_len++] =
+				chan_list[i];
+		}
+	}
+}
+
+void policy_mgr_remove_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc,
+		uint8_t chan)
+{
+	uint8_t chan_list[QDF_MAX_NUM_CHAN] = {0};
+	uint32_t num_chan = 0;
+	int i;
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return;
+	}
+
+	if (pm_ctx->sap_mandatory_channels_len >= QDF_MAX_NUM_CHAN) {
+		policy_mgr_err("Invalid channel len %d ",
+				pm_ctx->sap_mandatory_channels_len);
+		return;
+	}
+
+	for (i = 0; i < pm_ctx->sap_mandatory_channels_len; i++) {
+		if (chan == pm_ctx->sap_mandatory_channels[i])
+			continue;
+		chan_list[num_chan++] = pm_ctx->sap_mandatory_channels[i];
+	}
+
+	qdf_mem_zero(pm_ctx->sap_mandatory_channels,
+			pm_ctx->sap_mandatory_channels_len);
+	qdf_mem_copy(pm_ctx->sap_mandatory_channels, chan_list, num_chan);
+	pm_ctx->sap_mandatory_channels_len = num_chan;
+}

+ 1 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

@@ -251,6 +251,7 @@ struct policy_mgr_psoc_priv_obj {
 	struct policy_mgr_wma_cbacks wma_cbacks;
 	struct policy_mgr_tdls_cbacks tdls_cbacks;
 	struct policy_mgr_cdp_cbacks cdp_cbacks;
+	bool enable_sap_mandatory_chan_list;
 	uint8_t sap_mandatory_channels[QDF_MAX_NUM_CHAN];
 	uint32_t sap_mandatory_channels_len;
 	bool do_hw_mode_change;

+ 2 - 1
utils/fwlog/dbglog_host.c

@@ -4174,7 +4174,8 @@ static void cnss_diag_cmd_handler(const void *data, int data_len,
 	 * audit note: it is ok to pass a NULL policy here since a
 	 * length check on the data is added later already
 	 */
-	if (nla_parse(tb, CLD80211_ATTR_MAX, data, data_len, NULL)) {
+	if (wlan_cfg80211_nla_parse(tb, CLD80211_ATTR_MAX,
+				    data, data_len, NULL)) {
 		AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: nla parse fails \n",
 							__func__));
 		return;

+ 2 - 2
utils/logging/src/wlan_logging_sock_svc.c

@@ -31,7 +31,7 @@
 ******************************************************************************/
 
 #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
-#include <vmalloc.h>
+#include <linux/vmalloc.h>
 #ifdef CONFIG_MCL
 #include <cds_api.h>
 #include <host_diag_core_event.h>
@@ -43,7 +43,7 @@
 #include "pktlog_ac.h"
 #endif
 #include <wlan_logging_sock_svc.h>
-#include <kthread.h>
+#include <linux/kthread.h>
 #include <qdf_time.h>
 #include <qdf_trace.h>
 #include <qdf_mc_timer.h>

+ 2 - 1
utils/ptt/src/wlan_ptt_sock_svc.c

@@ -272,7 +272,8 @@ static void ptt_cmd_handler(const void *data, int data_len, void *ctx, int pid)
 	 * audit note: it is ok to pass a NULL policy here since a
 	 * length check on the data is added later already
 	 */
-	if (nla_parse(tb, CLD80211_ATTR_MAX, data, data_len, NULL)) {
+	if (wlan_cfg80211_nla_parse(tb, CLD80211_ATTR_MAX,
+				    data, data_len, NULL)) {
 		PTT_TRACE(QDF_TRACE_LEVEL_ERROR, "Invalid ATTR");
 		return;
 	}

+ 1 - 1
wmi/inc/wmi_unified_param.h

@@ -980,7 +980,7 @@ typedef struct {
 
 #define WMI_HOST_MAX_NUM_SS		8
 #define WMI_HOST_MAX_HECAP_PHY_SIZE	3
-#define WMI_HOST_MAX_HE_RATE_SET	1
+#define WMI_HOST_MAX_HE_RATE_SET	3
 /**
  * struct wmi_host_ppe_threshold -PPE threshold
  * @numss_m1: NSS - 1