Эх сурвалжийг харах

qcacmn: Drop Action frame in FW config by host

Propagation from qcacld-2.0 to qcacmn.

Several Action frame categories are not processed in host and they
are not forwarded to supplicant either, but they are dropped in host.
These unprocessed action frames are forwarded to host by FW and
wake up host unnecessarily which leads to battery drain. With this fix,
host conveys FW the disallowed action frames list at HDD startup
so that the remaining frames can be dropped in FW itself thereafter
when under WoW mode.

Change-Id: I40b49d42df94085784c8f1d8321de0ee61473ae0
CRs-Fixed: 999114
Paul Zhang 8 жил өмнө
parent
commit
c028941135

+ 5 - 1
wmi/inc/wmi_unified_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -646,8 +646,12 @@ QDF_STATUS wmi_unified_get_link_speed_cmd(void *wmi_hdl,
 
 QDF_STATUS wmi_unified_egap_conf_params_cmd(void *wmi_hdl,
 		wmi_ap_ps_egap_param_cmd_fixed_param *egap_params);
+
 #endif
 
+QDF_STATUS wmi_unified_action_frame_patterns_cmd(void *wmi_hdl,
+			struct action_wakeup_set_param *action_params);
+
 QDF_STATUS wmi_unified_fw_profiling_data_cmd(void *wmi_hdl,
 			uint32_t cmd, uint32_t value1, uint32_t value2);
 

+ 16 - 0
wmi/inc/wmi_unified_param.h

@@ -7084,4 +7084,20 @@ enum WMI_HOST_CALIBRATION_STATUS {
 	WMI_HOST_CALIBRATION_NOT_OK,
 };
 
+#define WMI_SUPPORTED_ACTION_CATEGORY           256
+#define WMI_SUPPORTED_ACTION_CATEGORY_ELE_LIST  (WMI_SUPPORTED_ACTION_CATEGORY/32)
+
+/**
+ * struct action_wakeup_set_param - action wakeup set params
+ * @vdev_id: virtual device id
+ * @operation: 0 reset to fw default, 1 set the bits,
+ *    2 add the setting bits, 3 delete the setting bits
+ * @action_category_map: bit mapping.
+ */
+struct action_wakeup_set_param {
+	uint32_t vdev_id;
+	uint32_t operation;
+	uint32_t action_category_map[WMI_SUPPORTED_ACTION_CATEGORY_ELE_LIST];
+};
+
 #endif /* _WMI_UNIFIED_PARAM_H_ */

+ 4 - 1
wmi/inc/wmi_unified_priv.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -514,6 +514,9 @@ QDF_STATUS (*send_pktlog_wmi_send_cmd)(wmi_unified_t wmi_handle,
 				   WMI_CMD_ID cmd_id, uint8_t user_triggered);
 #endif
 
+QDF_STATUS (*send_action_frame_patterns_cmd)(wmi_unified_t wmi_handle,
+			struct action_wakeup_set_param *action_params);
+
 QDF_STATUS (*send_fw_profiling_cmd)(wmi_unified_t wmi_handle,
 			uint32_t cmd, uint32_t value1, uint32_t value2);
 

+ 4 - 1
wmi/inc/wmi_unified_tlv.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -357,6 +357,9 @@ QDF_STATUS send_get_link_speed_cmd_tlv(wmi_unified_t wmi_handle,
 QDF_STATUS send_egap_conf_params_cmd_tlv(wmi_unified_t wmi_handle,
 				     wmi_ap_ps_egap_param_cmd_fixed_param *egap_params);
 
+QDF_STATUS send_action_frame_patterns_cmd_tlv(wmi_unified_t wmi_handle,
+		struct action_wakeup_set_param *action_params);
+
 QDF_STATUS send_fw_profiling_cmd_tlv(wmi_unified_t wmi_handle,
 			uint32_t cmd, uint32_t value1, uint32_t value2);
 

+ 2 - 1
wmi/src/wmi_unified.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -1704,6 +1704,7 @@ static bool wmi_is_runtime_pm_cmd(uint32_t cmd_id)
 	case WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID:
 	case WMI_PDEV_RESUME_CMDID:
 	case WMI_WOW_DEL_WAKE_PATTERN_CMDID:
+	case WMI_WOW_SET_ACTION_WAKE_UP_CMDID:
 	case WMI_D0_WOW_ENABLE_DISABLE_CMDID:
 		return true;
 

+ 22 - 1
wmi/src/wmi_unified_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -2213,8 +2213,29 @@ QDF_STATUS wmi_unified_egap_conf_params_cmd(void *wmi_hdl,
 
 	return QDF_STATUS_E_FAILURE;
 }
+
 #endif
 
+/**
+ * wmi_unified_action_frame_patterns_cmd() - send wmi cmd of action filter params
+ * @wmi_handle: wmi handler
+ * @action_params: pointer to action_params
+ *
+ * Return: 0 for success, otherwise appropriate error code
+ */
+QDF_STATUS wmi_unified_action_frame_patterns_cmd(void *wmi_hdl,
+				struct action_wakeup_set_param *action_params)
+{
+	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
+
+	if (wmi_handle->ops->send_action_frame_patterns_cmd)
+		return wmi_handle->ops->send_action_frame_patterns_cmd(
+				wmi_handle,
+				action_params);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
 /**
  * wmi_unified_fw_profiling_data_cmd() - send FW profiling cmd to WLAN FW
  * @wmi_handl: wmi handle

+ 46 - 1
wmi/src/wmi_unified_tlv.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -7368,6 +7368,50 @@ QDF_STATUS send_egap_conf_params_cmd_tlv(wmi_unified_t wmi_handle,
 	return QDF_STATUS_SUCCESS;
 }
 
+/**
+ * send_action_frame_patterns_cmd_tlv() - send wmi cmd of action filter params
+ * @wmi_handle: wmi handler
+ * @action_params: pointer to action_params
+ *
+ * Return: 0 for success, otherwise appropriate error code
+ */
+QDF_STATUS send_action_frame_patterns_cmd_tlv(wmi_unified_t wmi_handle,
+				struct action_wakeup_set_param *action_params)
+{
+	WMI_WOW_SET_ACTION_WAKE_UP_CMD_fixed_param *cmd;
+	wmi_buf_t buf;
+	int i;
+	int32_t err;
+
+	buf = wmi_buf_alloc(wmi_handle, sizeof(*cmd));
+	if (!buf) {
+		WMI_LOGE("Failed to allocate buffer to send action filter cmd");
+		return QDF_STATUS_E_NOMEM;
+	}
+	cmd = (WMI_WOW_SET_ACTION_WAKE_UP_CMD_fixed_param *) wmi_buf_data(buf);
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		WMITLV_TAG_STRUC_wmi_wow_set_action_wake_up_cmd_fixed_param,
+		WMITLV_GET_STRUCT_TLVLEN(
+				WMI_WOW_SET_ACTION_WAKE_UP_CMD_fixed_param));
+
+	cmd->vdev_id = action_params->vdev_id;
+	cmd->operation = action_params->operation;
+
+	for (i = 0; i < MAX_SUPPORTED_ACTION_CATEGORY_ELE_LIST; i++)
+		cmd->action_category_map[i] =
+				action_params->action_category_map[i];
+
+	err = wmi_unified_cmd_send(wmi_handle, buf,
+			sizeof(*cmd), WMI_WOW_SET_ACTION_WAKE_UP_CMDID);
+	if (err) {
+		WMI_LOGE("Failed to send ap_ps_egap cmd");
+		wmi_buf_free(buf);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
 /**
  * send_fw_profiling_cmd_tlv() - send FW profiling cmd to WLAN FW
  * @wmi_handl: wmi handle
@@ -12981,6 +13025,7 @@ struct wmi_ops tlv_ops =  {
 	.send_process_dhcp_ind_cmd = send_process_dhcp_ind_cmd_tlv,
 	.send_get_link_speed_cmd = send_get_link_speed_cmd_tlv,
 	.send_egap_conf_params_cmd = send_egap_conf_params_cmd_tlv,
+	.send_action_frame_patterns_cmd = send_action_frame_patterns_cmd_tlv,
 	.send_bcn_buf_ll_cmd = send_bcn_buf_ll_cmd_tlv,
 	.send_process_update_edca_param_cmd =
 				 send_process_update_edca_param_cmd_tlv,