diff --git a/wmi_unified.c b/wmi_unified.c index 3fe8779520..bb2a06deaf 100644 --- a/wmi_unified.c +++ b/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; diff --git a/wmi_unified_api.c b/wmi_unified_api.c index 1e68163fef..5db4912542 100644 --- a/wmi_unified_api.c +++ b/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 diff --git a/wmi_unified_tlv.c b/wmi_unified_tlv.c index a652113a30..a4b5ef569a 100644 --- a/wmi_unified_tlv.c +++ b/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,