Răsfoiți Sursa

qcacld-3.0: Featurize WLAN_FEATURE_PACKET_FILTERING

Featurize packet filter properly, as this feature was partially featurized.

Change-Id: Ib4b0e94ab2b9847f824220e2cd4efc2cee6fae8d
CRs-Fixed: 2304233
Rachit Kankane 6 ani în urmă
părinte
comite
0cf4d4feb1

+ 7 - 2
Kbuild

@@ -768,7 +768,6 @@ PMO_OBJS :=     $(PMO_DIR)/core/src/wlan_pmo_main.o \
 		$(PMO_DIR)/core/src/wlan_pmo_lphb.o \
 		$(PMO_DIR)/core/src/wlan_pmo_suspend_resume.o \
 		$(PMO_DIR)/core/src/wlan_pmo_hw_filter.o \
-		$(PMO_DIR)/core/src/wlan_pmo_pkt_filter.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_obj_mgmt_api.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_ucfg_api.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_arp.o \
@@ -779,8 +778,12 @@ PMO_OBJS :=     $(PMO_DIR)/core/src/wlan_pmo_main.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_lphb.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_suspend_resume.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_hw_filter.o \
+
+ifeq ($(CONFIG_WLAN_FEATURE_PACKET_FILTERING), y)
+PMO_OBJS +=	$(PMO_DIR)/core/src/wlan_pmo_pkt_filter.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_pkt_filter.o
 endif
+endif
 
 ifeq ($(CONFIG_WLAN_NS_OFFLOAD), y)
 PMO_OBJS +=     $(PMO_DIR)/core/src/wlan_pmo_ns.o \
@@ -861,13 +864,15 @@ CLD_TARGET_IF_OBJ := $(CLD_TARGET_IF_DIR)/pmo/src/target_if_pmo_arp.o \
 		$(CLD_TARGET_IF_DIR)/pmo/src/target_if_pmo_lphb.o \
 		$(CLD_TARGET_IF_DIR)/pmo/src/target_if_pmo_main.o \
 		$(CLD_TARGET_IF_DIR)/pmo/src/target_if_pmo_mc_addr_filtering.o \
-		$(CLD_TARGET_IF_DIR)/pmo/src/target_if_pmo_pkt_filter.o \
 		$(CLD_TARGET_IF_DIR)/pmo/src/target_if_pmo_static_config.o \
 		$(CLD_TARGET_IF_DIR)/pmo/src/target_if_pmo_suspend_resume.o \
 		$(CLD_TARGET_IF_DIR)/pmo/src/target_if_pmo_wow.o
 ifeq ($(CONFIG_WLAN_NS_OFFLOAD), y)
 CLD_TARGET_IF_OBJ += $(CLD_TARGET_IF_DIR)/pmo/src/target_if_pmo_ns.o
 endif
+ifeq ($(CONFIG_WLAN_FEATURE_PACKET_FILTERING), y)
+CLD_TARGET_IF_OBJ += $(CLD_TARGET_IF_DIR)/pmo/src/target_if_pmo_pkt_filter.o
+endif
 endif
 
 ifeq ($(CONFIG_WLAN_FEATURE_DSRC), y)

+ 2 - 0
components/pmo/dispatcher/inc/wlan_pmo_obj_mgmt_public_struct.h

@@ -132,11 +132,13 @@ struct wlan_pmo_tx_ops {
 	QDF_STATUS (*send_ns_offload_req)(struct wlan_objmgr_vdev *vdev,
 			struct pmo_arp_offload_params *arp_offload_req,
 			struct pmo_ns_offload_params *ns_offload_req);
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 	QDF_STATUS(*send_set_pkt_filter)(struct wlan_objmgr_vdev *vdev,
 			struct pmo_rcv_pkt_fltr_cfg *pmo_set_pkt_fltr_req);
 	QDF_STATUS(*send_clear_pkt_filter)(struct wlan_objmgr_vdev *vdev,
 			struct pmo_rcv_pkt_fltr_clear_param
 						*pmo_clr_pkt_fltr_param);
+#endif
 	QDF_STATUS (*send_enable_wow_wakeup_event_req)(
 			struct wlan_objmgr_vdev *vdev,
 			uint32_t *bitmap);

+ 36 - 9
components/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h

@@ -42,14 +42,6 @@
  */
 uint32_t ucfg_pmo_get_apf_instruction_size(struct wlan_objmgr_psoc *psoc);
 
-/**
- * ucfg_pmo_get_num_packet_filters() - get the number of packet filters
- * @psoc: the psoc to query
- *
- * Return: number of packet filters
- */
-uint32_t ucfg_pmo_get_num_packet_filters(struct wlan_objmgr_psoc *psoc);
-
 /**
  * ucfg_pmo_get_num_wow_filters() - get the supported number of WoW filters
  * @psoc: the psoc to query
@@ -356,6 +348,16 @@ QDF_STATUS pmo_ucfg_enable_gtk_offload_in_fwr(struct wlan_objmgr_vdev *vdev);
  */
 QDF_STATUS pmo_ucfg_disable_gtk_offload_in_fwr(struct wlan_objmgr_vdev *vdev);
 
+#ifdef WLAN_FEATURE_PACKET_FILTERING
+
+/**
+ * ucfg_pmo_get_num_packet_filters() - get the number of packet filters
+ * @psoc: the psoc to query
+ *
+ * Return: number of packet filters
+ */
+uint32_t ucfg_pmo_get_num_packet_filters(struct wlan_objmgr_psoc *psoc);
+
 /**
  * pmo_ucfg_set_pkt_filter() - Set packet filter
  * @psoc: objmgr psoc handle
@@ -379,6 +381,31 @@ QDF_STATUS pmo_ucfg_set_pkt_filter(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS pmo_ucfg_clear_pkt_filter(struct wlan_objmgr_psoc *psoc,
 	struct pmo_rcv_pkt_fltr_clear_param *pmo_clr_pkt_fltr_param,
 	uint8_t vdev_id);
+#else
+static inline uint32_t
+ucfg_pmo_get_num_packet_filters(struct wlan_objmgr_psoc *psoc)
+{
+	return 0;
+}
+
+static inline QDF_STATUS
+pmo_ucfg_set_pkt_filter(
+		struct wlan_objmgr_psoc *psoc,
+		struct pmo_rcv_pkt_fltr_cfg *pmo_set_pkt_fltr_req,
+		uint8_t vdev_id)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+pmo_ucfg_clear_pkt_filter(
+		struct wlan_objmgr_psoc *psoc,
+		struct pmo_rcv_pkt_fltr_clear_param *pmo_clr_pkt_fltr_param,
+		uint8_t vdev_id)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif
 
 /**
  * pmo_ucfg_get_gtk_rsp(): API to send gtk response request to fwr
@@ -633,7 +660,7 @@ QDF_STATUS pmo_ucfg_config_listen_interval(struct wlan_objmgr_vdev *vdev,
  */
 QDF_STATUS pmo_ucfg_config_modulated_dtim(struct wlan_objmgr_vdev *vdev,
 				       uint32_t mod_dtim);
-#else
+#else /* WLAN_POWER_MANAGEMENT_OFFLOAD */
 static inline uint32_t
 ucfg_pmo_get_apf_instruction_size(struct wlan_objmgr_psoc *psoc)
 {

+ 11 - 9
components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c

@@ -41,15 +41,6 @@ uint32_t ucfg_pmo_get_apf_instruction_size(struct wlan_objmgr_psoc *psoc)
 	return pmo_get_apf_instruction_size(psoc);
 }
 
-uint32_t ucfg_pmo_get_num_packet_filters(struct wlan_objmgr_psoc *psoc)
-{
-	QDF_BUG(psoc);
-	if (!psoc)
-		return 0;
-
-	return pmo_get_num_packet_filters(psoc);
-}
-
 uint8_t ucfg_pmo_get_num_wow_filters(struct wlan_objmgr_psoc *psoc)
 {
 	QDF_BUG(psoc);
@@ -217,6 +208,16 @@ QDF_STATUS pmo_ucfg_disable_gtk_offload_in_fwr(struct wlan_objmgr_vdev *vdev)
 	return pmo_core_disable_gtk_offload_in_fwr(vdev);
 }
 
+#ifdef WLAN_FEATURE_PACKET_FILTERING
+uint32_t ucfg_pmo_get_num_packet_filters(struct wlan_objmgr_psoc *psoc)
+{
+	QDF_BUG(psoc);
+	if (!psoc)
+		return 0;
+
+	return pmo_get_num_packet_filters(psoc);
+}
+
 QDF_STATUS pmo_ucfg_set_pkt_filter(struct wlan_objmgr_psoc *psoc,
 		struct pmo_rcv_pkt_fltr_cfg *pmo_set_pkt_fltr_req,
 		uint8_t vdev_id)
@@ -231,6 +232,7 @@ QDF_STATUS pmo_ucfg_clear_pkt_filter(struct wlan_objmgr_psoc *psoc,
 	return pmo_core_clear_pkt_filter(psoc,
 				pmo_clr_pkt_fltr_param, vdev_id);
 }
+#endif
 
 QDF_STATUS pmo_ucfg_get_gtk_rsp(struct wlan_objmgr_vdev *vdev,
 		struct pmo_gtk_rsp_req *gtk_rsp_req)

+ 2 - 0
components/target_if/pmo/inc/target_if_pmo.h

@@ -172,6 +172,7 @@ QDF_STATUS target_if_pmo_send_action_frame_patterns(
 QDF_STATUS target_if_pmo_conf_hw_filter(struct wlan_objmgr_psoc *psoc,
 					struct pmo_hw_filter_params *req);
 
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 /**
  * target_if_pmo_send_pkt_filter_req() - enable packet filter
  * @vdev: objmgr vdev
@@ -195,6 +196,7 @@ QDF_STATUS target_if_pmo_send_pkt_filter_req(struct wlan_objmgr_vdev *vdev,
  */
 QDF_STATUS target_if_pmo_clear_pkt_filter_req(struct wlan_objmgr_vdev *vdev,
 			struct pmo_rcv_pkt_fltr_clear_param *rcv_clear_param);
+#endif
 
 /**
  * target_if_pmo_send_arp_offload_req() - sends arp request to fwr

+ 18 - 6
components/target_if/pmo/src/target_if_pmo_main.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 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
@@ -24,6 +24,22 @@
 #include "target_if_pmo.h"
 #include "wlan_pmo_common_public_struct.h"
 
+#ifdef WLAN_FEATURE_PACKET_FILTERING
+static inline
+void tgt_if_pmo_reg_pkt_filter_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
+{
+	pmo_tx_ops->send_set_pkt_filter =
+		target_if_pmo_send_pkt_filter_req;
+	pmo_tx_ops->send_clear_pkt_filter =
+		target_if_pmo_clear_pkt_filter_req;
+}
+#else
+static inline
+void tgt_if_pmo_reg_pkt_filter_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
+{
+}
+#endif
+
 void target_if_pmo_register_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
 {
 	if (!pmo_tx_ops) {
@@ -103,10 +119,6 @@ void target_if_pmo_register_tx_ops(struct wlan_pmo_tx_ops *pmo_tx_ops)
 		target_if_pmo_psoc_send_d0wow_enable_req;
 	pmo_tx_ops->psoc_send_d0wow_disable_req =
 		target_if_pmo_psoc_send_d0wow_disable_req;
-	pmo_tx_ops->send_set_pkt_filter =
-		target_if_pmo_send_pkt_filter_req;
-	pmo_tx_ops->send_clear_pkt_filter =
-		target_if_pmo_clear_pkt_filter_req;
-
+	tgt_if_pmo_reg_pkt_filter_ops(pmo_tx_ops);
 }