qcacld-3.0: Handle vendor control command and event

WMI_ROAM_GET_VENDOR_CONTROL_PARAM_CMDID: Add support
for a new roam command to get vendor control parameters
from FW. Host needs to send proper param ID in command
(from enum WMI_ROAM_GET_VENDOR_CONTROL_PARAM_ID)
to get corresponding INI value from FW.

WMI_ROAM_GET_VENDOR_CONTROL_PARAM_EVENTID:
Add support for a new roam event to get param value
from FW. FW sends this event upon receiving
WMI_ROAM_GET_VENDOR_CONTROL_PARAM_CMDID command.

Change-Id: I03679bcf359a0f425aab7b9ea1c3cb6d84fbb0ca
CRs-Fixed: 3225160
This commit is contained in:
abhinav kumar
2022-05-22 21:16:49 +05:30
committed by Madan Koyyalamudi
parent 31fa2f653e
commit b2c27b3103
21 changed files with 890 additions and 13 deletions

View File

@@ -133,6 +133,30 @@ QDF_STATUS wmi_unified_roam_synch_complete_cmd(wmi_unified_t wmi_handle,
return QDF_STATUS_E_FAILURE;
}
#ifdef WLAN_VENDOR_HANDOFF_CONTROL
QDF_STATUS
wmi_unified_roam_vendor_handoff_req_cmd(wmi_unified_t wmi_handle,
uint8_t vdev_id, uint32_t param_id)
{
if (wmi_handle->ops->send_process_roam_vendor_handoff_req_cmd)
return wmi_handle->ops->send_process_roam_vendor_handoff_req_cmd(
wmi_handle, vdev_id, param_id);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS
wmi_extract_roam_vendor_control_param_event(wmi_unified_t wmi_handle,
uint8_t *event, uint32_t len,
struct roam_vendor_handoff_params **data)
{
if (wmi_handle->ops->extract_roam_vendor_control_param_event)
return wmi_handle->ops->extract_roam_vendor_control_param_event(
wmi_handle, event, len, data);
return QDF_STATUS_E_FAILURE;
}
#endif
QDF_STATUS wmi_unified_roam_invoke_cmd(wmi_unified_t wmi_handle,
struct roam_invoke_req *roaminvoke)
{

View File

@@ -314,11 +314,12 @@ static QDF_STATUS send_roam_scan_offload_rssi_thresh_cmd_tlv(
WMITLV_TAG_STRUC_wmi_roam_data_rssi_roaming_param,
WMITLV_GET_STRUCT_TLVLEN
(wmi_roam_data_rssi_roaming_param));
wmi_debug("vdev %d Data rssi threshold: %d, triggers: 0x%x, rx time: %d",
wmi_debug("vdev %d Data rssi threshold: %d, triggers: 0x%x, rx time: %d, rssi_thresh:%d",
rssi_threshold_fp->vdev_id,
data_rssi_param->roam_data_rssi_thres,
data_rssi_param->flags,
data_rssi_param->rx_inactivity_ms);
data_rssi_param->rx_inactivity_ms,
rssi_threshold_fp->roam_scan_rssi_thresh);
wmi_mtrace(WMI_ROAM_SCAN_RSSI_THRESHOLD, NO_SESSION, 0);
status = wmi_unified_cmd_send(wmi_handle, buf,
@@ -3375,6 +3376,142 @@ extract_roam_candidate_frame_tlv(wmi_unified_t wmi_handle, uint8_t *event,
return QDF_STATUS_SUCCESS;
}
#ifdef WLAN_VENDOR_HANDOFF_CONTROL
static QDF_STATUS
extract_roam_vendor_control_param_event_tlv(wmi_unified_t wmi_handle,
uint8_t *event, uint32_t len,
struct roam_vendor_handoff_params **list)
{
WMI_ROAM_GET_VENDOR_CONTROL_PARAM_EVENTID_param_tlvs *param_buf = NULL;
wmi_roam_get_vendor_control_param_event_fixed_param *fixed_param = NULL;
uint32_t num_entries, i;
wmi_vendor_control_param *src_list;
struct roam_vendor_handoff_params *dst_list;
struct roam_param_info *param_info;
if (!event || !len) {
wmi_debug("Empty roam vendor control param event");
return QDF_STATUS_E_FAILURE;
}
param_buf =
(WMI_ROAM_GET_VENDOR_CONTROL_PARAM_EVENTID_param_tlvs *)event;
if (!param_buf) {
wmi_err("received null buf from target");
return QDF_STATUS_E_INVAL;
}
fixed_param = (wmi_roam_get_vendor_control_param_event_fixed_param *)
param_buf->fixed_param;
if (!fixed_param) {
wmi_err("received null event data from target");
return QDF_STATUS_E_INVAL;
}
if (fixed_param->vdev_id >= WLAN_MAX_VDEVS) {
wmi_debug("Invalid VDEV id %d", fixed_param->vdev_id);
return QDF_STATUS_E_FAILURE;
}
num_entries = param_buf->num_vendor_control_param;
src_list = param_buf->vendor_control_param;
if (len < (sizeof(*fixed_param) + (num_entries * sizeof(*src_list)))) {
wmi_err("Invalid length: %d", len);
return QDF_STATUS_E_FAILURE;
}
dst_list = qdf_mem_malloc(sizeof(struct roam_vendor_handoff_params));
if (!dst_list)
return QDF_STATUS_E_FAILURE;
dst_list->vdev_id = fixed_param->vdev_id;
wmi_debug("vdev_id:%d, num_tlv:%d", dst_list->vdev_id, num_entries);
param_info = &dst_list->param_info[0];
for (i = 0; i < num_entries; i++) {
param_info->param_id = src_list->param_id;
param_info->param_value = src_list->param_value;
wmi_debug("param_info->param_id:%d, param_info->param_value:%d",
param_info->param_id, param_info->param_value);
param_info++;
src_list++;
}
dst_list->num_entries = num_entries;
*list = dst_list;
return QDF_STATUS_SUCCESS;
}
/**
* send_process_roam_vendor_handoff_req_cmd_tlv() - Send vendor handoff command
* to fw.
* @wmi_handle: wmi handle
* @vdev_id: vdev id
*
* Return: QDF STATUS
*/
static QDF_STATUS
send_process_roam_vendor_handoff_req_cmd_tlv(wmi_unified_t wmi_handle,
uint8_t vdev_id,
uint32_t param_id)
{
wmi_roam_get_vendor_control_param_cmd_fixed_param *cmd;
wmi_buf_t wmi_buf;
uint8_t *buf_ptr;
uint16_t len;
len = sizeof(wmi_roam_get_vendor_control_param_cmd_fixed_param);
wmi_buf = wmi_buf_alloc(wmi_handle, len);
if (!wmi_buf)
return QDF_STATUS_E_NOMEM;
cmd = (wmi_roam_get_vendor_control_param_cmd_fixed_param *)wmi_buf_data(
wmi_buf);
buf_ptr = (uint8_t *)cmd;
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_roam_get_vendor_control_param_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN
(wmi_roam_get_vendor_control_param_cmd_fixed_param));
cmd->vdev_id = vdev_id;
cmd->param_id = param_id;
wmi_debug("Send GET_VENDOR_CONTROL_PARAM cmd vdev_id:%d, param_id:0x%x",
cmd->vdev_id, cmd->param_id);
wmi_mtrace(WMI_ROAM_GET_VENDOR_CONTROL_PARAM_CMDID, cmd->vdev_id, 0);
if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len,
WMI_ROAM_GET_VENDOR_CONTROL_PARAM_CMDID)) {
wmi_err("Failed to send get vendor control param command");
wmi_buf_free(wmi_buf);
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
/**
* wmi_roam_offload_attach_vendor_handoff_tlv() - register wmi ops for vendor
* handoff related command and event
* @ops: wmi ops
*
* Return: none
*/
static inline void
wmi_roam_offload_attach_vendor_handoff_tlv(struct wmi_ops *ops)
{
ops->extract_roam_vendor_control_param_event =
extract_roam_vendor_control_param_event_tlv;
ops->send_process_roam_vendor_handoff_req_cmd =
send_process_roam_vendor_handoff_req_cmd_tlv;
}
#else
static inline void
wmi_roam_offload_attach_vendor_handoff_tlv(struct wmi_ops *ops)
{
}
#endif
void wmi_roam_offload_attach_tlv(wmi_unified_t wmi_handle)
{
struct wmi_ops *ops = wmi_handle->ops;
@@ -3400,6 +3537,7 @@ void wmi_roam_offload_attach_tlv(wmi_unified_t wmi_handle)
ops->send_vdev_set_pcl_cmd = send_vdev_set_pcl_cmd_tlv;
ops->send_set_roam_trigger_cmd = send_set_roam_trigger_cmd_tlv;
ops->extract_roam_candidate_frame = extract_roam_candidate_frame_tlv;
wmi_roam_offload_attach_vendor_handoff_tlv(ops);
}
#else
static inline QDF_STATUS
@@ -4099,8 +4237,9 @@ wmi_fill_rso_start_scan_tlv(struct wlan_roam_scan_offload_params *rso_req,
scan_tlv->scan_ctrl_flags_ext |=
WMI_SCAN_DBS_POLICY_DEFAULT;
wmi_debug("RSO_CFG: dwell time: active %d passive %d, active 6g %d passive 6g %d, minrest %d max rest %d repeat probe time %d probe_spacing:%d",
wmi_debug("RSO_CFG: dwell time: active %d passive %d, burst_duration:%d, active 6g %d passive 6g %d, min_rest_time %d max rest %d repeat probe time %d probe_spacing:%d",
scan_tlv->dwell_time_active, scan_tlv->dwell_time_passive,
scan_tlv->burst_duration,
scan_tlv->dwell_time_active_6ghz,
scan_tlv->dwell_time_passive_6ghz,
scan_tlv->min_rest_time, scan_tlv->max_rest_time,