From 03d103d83bce1f90d7a0119a00f873ff5d9d870c Mon Sep 17 00:00:00 2001 From: yeshwanth sriram guntuka Date: Fri, 1 Sep 2017 17:56:07 +0530 Subject: qcacmn: Add config support for BTM offload Add ini to configure BTM offload configuration which is sent to firmware as part of RSO start via wmi btm config cmd. Change-Id: I69c792705b208014af8f1878f7645d957dde6c06 CRs-Fixed: 2105112 --- wmi/inc/wmi_unified_api.h | 12 +++++++++++- wmi/inc/wmi_unified_param.h | 11 ++++++++++- wmi/inc/wmi_unified_priv.h | 4 +++- wmi/src/wmi_unified_api.c | 14 +++++++++++++- wmi/src/wmi_unified_tlv.c | 39 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 76 insertions(+), 4 deletions(-) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index abf82efb19f6..14611e10ec5a 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2019 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 @@ -1623,4 +1623,14 @@ QDF_STATUS wmi_unified_offload_11k_cmd(void *wmi_hdl, */ QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl, struct wmi_invoke_neighbor_report_params *params); + +/** + * 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 4ea794073236..9d95fe8e428f 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019 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 @@ -7597,6 +7597,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; +}; /** * @time_offset: time offset after 11k offload command to trigger a neighbor diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 8c2e2daa2aaf..5b3b9b8be017 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2019 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 @@ -1250,6 +1250,8 @@ QDF_STATUS (*send_offload_11k_cmd)(wmi_unified_t wmi_handle, QDF_STATUS (*send_invoke_neighbor_report_cmd)(wmi_unified_t wmi_handle, struct wmi_invoke_neighbor_report_params *params); +QDF_STATUS (*send_btm_config)(wmi_unified_t wmi_handle, + struct wmi_btm_config *params); }; struct target_abi_version { diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index c2494eaf5365..44abdd757163 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019 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 @@ -6586,3 +6586,15 @@ wmi_extract_roam_scan_stats_res_evt(wmi_unified_t wmi, void *evt_buf, return QDF_STATUS_E_FAILURE; } + +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 d8320699bbc4..9699e0f333e4 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -15057,6 +15057,44 @@ static QDF_STATUS send_invoke_neighbor_report_cmd_tlv(wmi_unified_t wmi_handle, return status; } +/* + * 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, @@ -15359,6 +15397,7 @@ struct wmi_ops tlv_ops = { .extract_roam_scan_stats_res_evt = extract_roam_scan_stats_res_evt_tlv, .send_offload_11k_cmd = send_offload_11k_cmd_tlv, .send_invoke_neighbor_report_cmd = send_invoke_neighbor_report_cmd_tlv, + .send_btm_config = send_btm_config_cmd_tlv, }; #ifdef WMI_TLV_AND_NON_TLV_SUPPORT -- cgit v1.2.3 From bcd38c21b2f2ee1b3cb21a901569ed7e84587d68 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Mon, 8 Jan 2018 16:45:09 +0800 Subject: qcacmn: Add new config for BTM offload Add new parameters into wmi btm config cmd for solicited BTM offload Change-Id: I24cc680bbfde3d44a57b1e1ccf644c2bed515a2c CRs-Fixed: 2168259 --- wmi/inc/wmi_unified_param.h | 6 ++++++ wmi/src/wmi_unified_tlv.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 9d95fe8e428f..b1afaec7e143 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -7601,10 +7601,16 @@ struct wmi_mawc_roam_params { * struct wmi_btm_config - BSS Transition Management offload params * @vdev_id: VDEV on which the parameters should be applied * @btm_offload_config: BTM config + * @btm_solicited_timeout: Timeout value for waiting BTM request + * @btm_max_attempt_cnt: Maximum attempt for sending BTM query to ESS + * @btm_sticky_time: Stick time after roaming to new AP by BTM */ struct wmi_btm_config { uint8_t vdev_id; uint32_t btm_offload_config; + uint32_t btm_solicited_timeout; + uint32_t btm_max_attempt_cnt; + uint32_t btm_sticky_time; }; /** diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 9699e0f333e4..efe809903ab0 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -15085,6 +15085,10 @@ static QDF_STATUS send_btm_config_cmd_tlv(wmi_unified_t wmi_handle, WMITLV_GET_STRUCT_TLVLEN(wmi_btm_config_fixed_param)); cmd->vdev_id = params->vdev_id; cmd->flags = params->btm_offload_config; + cmd->max_attempt_cnt = params->btm_max_attempt_cnt; + cmd->solicited_timeout_ms = params->btm_solicited_timeout; + cmd->stick_time_seconds = params->btm_sticky_time; + 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", -- cgit v1.2.3 From f149fbd7a0931a6453b5f327f4c91f4aa28a91e7 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Mon, 25 Feb 2019 19:09:52 +0530 Subject: qcacmn: Add new config for BTM offload Currently, whenever roaming is triggered after a successful roam scan firmware sends a BTM query to current connected AP when it is 11v capable. Driver completes roaming with candidates received as part of BTM request from AP. STA respond to AP with BTM response after successful initiation of roaming. Now the requirement is driver could send "BTM query with a preferred candidate list" after a successful roam scan for some roam scan reasons like PER, LOW_RSSI, HIGH_RSSI, MAWC, DENSE etc. Preferred candidate list is obtained as part of roam scan based on firmware bss scoring logic. New ini "btm_query_bitmask" is introduced to configure the bitmask for various roam scan reasons. Fw sends "BTM query with preferred candidate list" only for those roam scans which are enabled through this bitmask. New INI: btm_query_bitmask Min: 0 Max: 0xFFFFFFFF Default: 0x8 Bitmask : 0x8 (LOW_RSSI) refer enum WMI_ROAM_TRIGGER_REASON_ID. Add a new parameter "btm_query_bitmask" into wmi btm config command in order to pass a value of btm_query_bitmask to fw while BTM offload Change-Id: I1b0a973bc5b2b50773aa82c7f8cc1dd080d66d86 CRs-Fixed: 2408112 --- wmi/inc/wmi_unified_param.h | 2 ++ wmi/src/wmi_unified_tlv.c | 1 + 2 files changed, 3 insertions(+) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index b1afaec7e143..f8fefa8f2896 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -7604,6 +7604,7 @@ struct wmi_mawc_roam_params { * @btm_solicited_timeout: Timeout value for waiting BTM request * @btm_max_attempt_cnt: Maximum attempt for sending BTM query to ESS * @btm_sticky_time: Stick time after roaming to new AP by BTM + * @btm_query_bitmask: roam trigger reasons to trigger BTM Query */ struct wmi_btm_config { uint8_t vdev_id; @@ -7611,6 +7612,7 @@ struct wmi_btm_config { uint32_t btm_solicited_timeout; uint32_t btm_max_attempt_cnt; uint32_t btm_sticky_time; + uint32_t btm_query_bitmask; }; /** diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index efe809903ab0..346879f9865b 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -15088,6 +15088,7 @@ static QDF_STATUS send_btm_config_cmd_tlv(wmi_unified_t wmi_handle, cmd->max_attempt_cnt = params->btm_max_attempt_cnt; cmd->solicited_timeout_ms = params->btm_solicited_timeout; cmd->stick_time_seconds = params->btm_sticky_time; + cmd->btm_bitmap = params->btm_query_bitmask; if (wmi_unified_cmd_send(wmi_handle, buf, len, WMI_ROAM_BTM_CONFIG_CMDID)) { -- cgit v1.2.3