diff --git a/utils/host_diag_log/inc/host_diag_core_event.h b/utils/host_diag_log/inc/host_diag_core_event.h index d85f716acd..f974e3f603 100644 --- a/utils/host_diag_log/inc/host_diag_core_event.h +++ b/utils/host_diag_log/inc/host_diag_core_event.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -429,6 +429,8 @@ struct host_event_wlan_ssr_shutdown { * reason unspecified * @HOST_STA_KICKOUT_REASON_KEEP_ALIVE: Indicate sta is disconnected * because of keep alive + * @HOST_STA_KICKOUT_REASON_BTM: BTM request from AP with disassoc imminent + * reason * * This enum contains the event subtype */ @@ -437,6 +439,7 @@ enum host_sta_kickout_events { HOST_STA_KICKOUT_REASON_XRETRY, HOST_STA_KICKOUT_REASON_UNSPECIFIED, HOST_STA_KICKOUT_REASON_KEEP_ALIVE, + HOST_STA_KICKOUT_REASON_BTM, }; /*------------------------------------------------------------------------- diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 94a39ccef1..43dc0acf9a 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -1888,4 +1888,13 @@ QDF_STATUS wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data, struct nan_datapath_end_indication_event **ind); #endif +/** + * wmi_unified_send_btm_config() - Send BTM config to fw + * @wmi_hdl: wmi handle + * @params: pointer to wmi_btm_config + * + * Return: QDF_STATUS + */ +QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl, + struct wmi_btm_config *params); #endif /* _WMI_UNIFIED_API_H_ */ diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index c8b5431d9c..7b9cf72b10 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -8090,6 +8090,15 @@ struct wmi_mawc_roam_params { uint8_t rssi_stationary_high_adjust; uint8_t rssi_stationary_low_adjust; }; +/** + * struct wmi_btm_config - BSS Transition Management offload params + * @vdev_id: VDEV on which the parameters should be applied + * @btm_offload_config: BTM config + */ +struct wmi_btm_config { + uint8_t vdev_id; + uint32_t btm_offload_config; +}; /** * struct set_arp_stats - set/reset arp stats diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 834eab3c46..0c6898c892 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -1492,6 +1492,8 @@ QDF_STATUS (*extract_ndp_end_ind)(wmi_unified_t wmi_handle, uint8_t *data, struct nan_datapath_end_indication_event **ind); #endif +QDF_STATUS (*send_btm_config)(wmi_unified_t wmi_handle, + struct wmi_btm_config *params); }; /* Forward declartion for psoc*/ diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index ea96b53991..b65af493b4 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -7221,3 +7221,14 @@ QDF_STATUS wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data, return QDF_STATUS_E_FAILURE; } #endif +QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl, + struct wmi_btm_config *params) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_btm_config) + return wmi_handle->ops->send_btm_config(wmi_handle, + params); + + return QDF_STATUS_E_FAILURE; +} diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 9a7aa85161..8fd2e6d680 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -20822,6 +20822,44 @@ static QDF_STATUS extract_pdev_caldata_version_check_ev_param_tlv( return QDF_STATUS_SUCCESS; } +/* + * send_btm_config_cmd_tlv() - Send wmi cmd for BTM config + * @wmi_handle: wmi handle + * @params: pointer to wmi_btm_config + * + * Return: QDF_STATUS + */ +static QDF_STATUS send_btm_config_cmd_tlv(wmi_unified_t wmi_handle, + struct wmi_btm_config *params) +{ + + wmi_btm_config_fixed_param *cmd; + wmi_buf_t buf; + uint32_t len; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + qdf_print("%s:wmi_buf_alloc failed\n", __func__); + return QDF_STATUS_E_NOMEM; + } + + cmd = (wmi_btm_config_fixed_param *)wmi_buf_data(buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_btm_config_fixed_param, + WMITLV_GET_STRUCT_TLVLEN(wmi_btm_config_fixed_param)); + cmd->vdev_id = params->vdev_id; + cmd->flags = params->btm_offload_config; + if (wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_ROAM_BTM_CONFIG_CMDID)) { + WMI_LOGE("%s: failed to send WMI_ROAM_BTM_CONFIG_CMDID", + __func__); + wmi_buf_free(buf); + return QDF_STATUS_E_FAILURE; + } + return QDF_STATUS_SUCCESS; +} + struct wmi_ops tlv_ops = { .send_vdev_create_cmd = send_vdev_create_cmd_tlv, .send_vdev_delete_cmd = send_vdev_delete_cmd_tlv, @@ -21260,6 +21298,7 @@ struct wmi_ops tlv_ops = { .extract_ndp_end_rsp = extract_ndp_end_rsp_tlv, .extract_ndp_end_ind = extract_ndp_end_ind_tlv, #endif + .send_btm_config = send_btm_config_cmd_tlv, }; /**