Browse Source

qcacld-3.0: Featurize WLAN_FEATURE_PACKET_FILTERING

Featurize WLAN_FEATURE_PACKET_FILTERING to compile out
in mission mode.

Change-Id: I373e65b9286dd6a6e870dce873d19bf3b3455adb
CRs-Fixed: 2241323
Qiwei Cai 6 years ago
parent
commit
4505fc6fde

+ 4 - 1
Kbuild

@@ -51,7 +51,6 @@ HDD_OBJS := 	$(HDD_SRC_DIR)/wlan_hdd_assoc.o \
 		$(HDD_SRC_DIR)/wlan_hdd_object_manager.o \
 		$(HDD_SRC_DIR)/wlan_hdd_oemdata.o \
 		$(HDD_SRC_DIR)/wlan_hdd_p2p.o \
-		$(HDD_SRC_DIR)/wlan_hdd_packet_filter.o \
 		$(HDD_SRC_DIR)/wlan_hdd_power.o \
 		$(HDD_SRC_DIR)/wlan_hdd_regulatory.o \
 		$(HDD_SRC_DIR)/wlan_hdd_request_manager.o \
@@ -150,6 +149,10 @@ ifeq ($(CONFIG_WLAN_NUD_TRACKING), y)
 HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_nud_tracking.o
 endif
 
+ifeq ($(CONFIG_WLAN_FEATURE_PACKET_FILTERING), y)
+HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_packet_filter.o
+endif
+
 ########### HOST DIAG LOG ###########
 HOST_DIAG_LOG_DIR :=	$(WLAN_COMMON_ROOT)/utils/host_diag_log
 

+ 4 - 1
core/hdd/inc/wlan_hdd_cfg.h

@@ -13369,6 +13369,7 @@ enum hdd_external_acs_policy {
 #define CFG_MBO_CAND_RSSI_BTC_THRESHOLD_MIN     (-120)
 #define CFG_MBO_CAND_RSSI_BTC_THRESHOLD_MAX     (0)
 
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 /*
  * <ini>
  * g_enable_packet_filter_bitmap - Enable Packet filters before going into
@@ -13406,7 +13407,7 @@ enum hdd_external_acs_policy {
 #define CFG_ENABLE_PACKET_FILTERS_DEFAULT  (0)
 #define CFG_ENABLE_PACKET_FILTERS_MIN      (0)
 #define CFG_ENABLE_PACKET_FILTERS_MAX      (63)
-
+#endif /* WLAN_FEATURE_PACKET_FILTERING */
 
 /*
  * <ini>
@@ -15047,7 +15048,9 @@ struct hdd_config {
 	int8_t mbo_current_rssi_thres;
 	int8_t mbo_current_rssi_mcc_thres;
 	int8_t mbo_candidate_rssi_btc_thres;
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 	uint8_t packet_filters_bitmap;
+#endif
 	uint8_t enable_phy_reg_retention;
 	uint8_t dfs_beacon_tx_enhanced;
 	uint16_t reduced_beacon_interval;

+ 2 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -1880,7 +1880,9 @@ struct hdd_context {
 	uint8_t bt_vo_active:1;
 	enum band_info curr_band;
 	bool imps_enabled;
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 	int user_configured_pkt_filter_rules;
+#endif
 	bool is_fils_roaming_supported;
 	QDF_STATUS (*receive_offload_cb)(struct hdd_adapter *,
 					 struct sk_buff *);

+ 20 - 1
core/hdd/inc/wlan_hdd_packet_filter_api.h

@@ -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
@@ -27,6 +27,9 @@
 /* Include files */
 #include "wlan_hdd_assoc.h"
 #include "wlan_hdd_power.h"
+
+#ifdef WLAN_FEATURE_PACKET_FILTERING
+
 /**
  * hdd_enable_default_pkt_filters() - Enable default packet filters based
  * on, filters bit map provided in INI, when target goes to suspend mode
@@ -56,4 +59,20 @@ int hdd_disable_default_pkt_filters(struct hdd_adapter *adapter);
 int wlan_hdd_set_filter(struct hdd_context *hdd_ctx,
 			struct pkt_filter_cfg *request,
 			uint8_t sessionId);
+
+#else /* WLAN_FEATURE_PACKET_FILTERING */
+
+static inline int
+hdd_enable_default_pkt_filters(struct hdd_adapter *adapter)
+{
+	return 0;
+}
+
+static inline int
+hdd_disable_default_pkt_filters(struct hdd_adapter *adapter)
+{
+	return 0;
+}
+
+#endif /* WLAN_FEATURE_PACKET_FILTERING */
 #endif

+ 5 - 4
core/hdd/inc/wlan_hdd_power.h

@@ -27,12 +27,9 @@
 
 #include "wlan_hdd_main.h"
 
-#ifdef WLAN_FEATURE_PACKET_FILTERING
-
-#define HDD_MAX_CMP_PER_PACKET_FILTER	5
-
 #define HDD_WAKELOCK_TIMEOUT_CONNECT 1000
 #define HDD_WAKELOCK_TIMEOUT_RESUME 1000
+
 /*
  * HDD_WAKELOCK_CONNECT_COMPLETE = CSR_JOIN_FAILURE_TIMEOUT_DEFAULT (3000) +
  *                      WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STADEF (1000) +
@@ -40,6 +37,10 @@
  */
 #define HDD_WAKELOCK_CONNECT_COMPLETE 6000
 
+#ifdef WLAN_FEATURE_PACKET_FILTERING
+
+#define HDD_MAX_CMP_PER_PACKET_FILTER	5
+
 /**
  * enum pkt_filter_protocol_layer - packet filter protocol layer
  * @HDD_FILTER_PROTO_TYPE_INVALID: Invalid initial value

+ 2 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -5125,12 +5125,14 @@ struct reg_table_entry g_registry_table[] = {
 		CFG_IS_FILS_ENABLED_MIN,
 		CFG_IS_FILS_ENABLED_MAX),
 
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 	REG_VARIABLE(CFG_ENABLE_PACKET_FILTERS_NAME, WLAN_PARAM_Integer,
 		struct hdd_config, packet_filters_bitmap,
 		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
 		CFG_ENABLE_PACKET_FILTERS_DEFAULT,
 		CFG_ENABLE_PACKET_FILTERS_MIN,
 		CFG_ENABLE_PACKET_FILTERS_MAX),
+#endif /* WLAN_FEATURE_PACKET_FILTERING */
 
 	REG_VARIABLE(CFG_DFS_BEACON_TX_ENHANCED, WLAN_PARAM_Integer,
 		struct hdd_config, dfs_beacon_tx_enhanced,

+ 4 - 0
core/hdd/src/wlan_hdd_ioctl.c

@@ -6227,6 +6227,7 @@ static int drv_cmd_get_linkspeed(struct hdd_adapter *adapter,
 	return ret;
 }
 
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 /**
  * hdd_set_rx_filter() - set RX filter
  * @adapter: Pointer to adapter
@@ -6407,6 +6408,7 @@ static int drv_cmd_rx_filter_add(struct hdd_adapter *adapter,
 {
 	return hdd_driver_rxfilter_command_handler(command, adapter, true);
 }
+#endif /* WLAN_FEATURE_PACKET_FILTERING */
 
 /**
  * hdd_parse_setantennamode_command() - HDD Parse SETANTENNAMODE
@@ -6997,8 +6999,10 @@ static const struct hdd_drv_cmd hdd_drv_cmds[] = {
 #endif
 	{"RSSI",                      drv_cmd_get_rssi, false},
 	{"LINKSPEED",                 drv_cmd_get_linkspeed, false},
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 	{"RXFILTER-REMOVE",           drv_cmd_rx_filter_remove, true},
 	{"RXFILTER-ADD",              drv_cmd_rx_filter_add, true},
+#endif
 	{"SET_FCC_CHANNEL",           drv_cmd_set_fcc_channel, true},
 	{"CHANNEL_SWITCH",            drv_cmd_set_channel_switch, true},
 	{"SETANTENNAMODE",            drv_cmd_set_antenna_mode, true},

+ 2 - 3
core/mac/inc/sir_api.h

@@ -2917,8 +2917,6 @@ typedef struct sSirRoamOffloadScanRsp {
 	uint32_t reason;
 } tSirRoamOffloadScanRsp, *tpSirRoamOffloadScanRsp;
 
-
-#ifdef WLAN_FEATURE_PACKET_FILTERING
 /*---------------------------------------------------------------------------
    Packet Filtering Parameters
    ---------------------------------------------------------------------------*/
@@ -2928,6 +2926,7 @@ typedef struct sSirRoamOffloadScanRsp {
 #define    SIR_MAX_NUM_FILTERS               20
 #define    SIR_MAX_NUM_TESTS_PER_FILTER      10
 
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 /* */
 /* Filter Packet Match Count Parameters */
 /* */
@@ -2955,6 +2954,7 @@ typedef struct sSirRcvFltPktClearParam {
 	struct qdf_mac_addr self_macaddr;
 	struct qdf_mac_addr bssid;
 } tSirRcvFltPktClearParam, *tpSirRcvFltPktClearParam;
+#endif /* WLAN_FEATURE_PACKET_FILTERING */
 
 /* */
 /* Multicast Address List Parameters */
@@ -2966,7 +2966,6 @@ typedef struct sSirRcvFltMcAddrList {
 	struct qdf_mac_addr bssid;
 	uint8_t action;
 } tSirRcvFltMcAddrList, *tpSirRcvFltMcAddrList;
-#endif /* WLAN_FEATURE_PACKET_FILTERING */
 
 /* */
 /* Generic version information */

+ 2 - 1
core/mac/src/include/sir_params.h

@@ -365,9 +365,10 @@ struct sir_mgmt_msg {
 
 /* (SIR_HAL_ITC_MSG_TYPES_BEGIN + 122) is unused */
 
-#ifdef WLAN_FEATURE_PACKET_FILTERING
 #define SIR_HAL_8023_MULTICAST_LIST_REQ \
 					   (SIR_HAL_ITC_MSG_TYPES_BEGIN + 123)
+
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 #define SIR_HAL_RECEIVE_FILTER_SET_FILTER_REQ \
 					   (SIR_HAL_ITC_MSG_TYPES_BEGIN + 124)
 #define SIR_HAL_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ \

+ 2 - 1
core/wma/inc/wma_types.h

@@ -257,8 +257,9 @@
 #define WMA_ROAM_OFFLOAD_SYNCH_FAIL SIR_HAL_ROAM_OFFLOAD_SYNCH_FAIL
 #endif
 
-#ifdef WLAN_FEATURE_PACKET_FILTERING
 #define WMA_8023_MULTICAST_LIST_REQ                     SIR_HAL_8023_MULTICAST_LIST_REQ
+
+#ifdef WLAN_FEATURE_PACKET_FILTERING
 #define WMA_RECEIVE_FILTER_SET_FILTER_REQ               SIR_HAL_RECEIVE_FILTER_SET_FILTER_REQ
 #define WMA_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ    SIR_HAL_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ
 #define WMA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP    SIR_HAL_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP