qcacmn: Add support for 11k offload related WMI commands
Add WMI TLV functions for 11k offload command and neighbor report request invoke command. Change-Id: If37cace93d4f719eed6abfabcd878879d804161e CRs-Fixed: 2162030
This commit is contained in:

committed by
snandini

parent
86db6ab400
commit
26fc2e1e98
@@ -2012,4 +2012,27 @@ QDF_STATUS wmi_extract_swfda_vdev_id(void *wmi_hdl, void *evt_buf,
|
||||
QDF_STATUS wmi_unified_fils_discovery_send_cmd(void *wmi_hdl,
|
||||
struct fd_params *param);
|
||||
#endif /* WLAN_SUPPORT_FILS */
|
||||
|
||||
/**
|
||||
* wmi_unified_offload_11k_cmd() - send 11k offload command
|
||||
* @wmi_hdl: wmi handle
|
||||
* @params: 11k offload params
|
||||
*
|
||||
* This function passes the 11k offload command params to FW
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
||||
*/
|
||||
QDF_STATUS wmi_unified_offload_11k_cmd(void *wmi_hdl,
|
||||
struct wmi_11k_offload_params *params);
|
||||
/**
|
||||
* wmi_unified_invoke_neighbor_report_cmd() - send invoke neighbor report cmd
|
||||
* @wmi_hdl: wmi handle
|
||||
* @params: invoke neighbor report params
|
||||
*
|
||||
* This function passes the invoke neighbor report command to fw
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
||||
*/
|
||||
QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl,
|
||||
struct wmi_invoke_neighbor_report_params *params);
|
||||
#endif /* _WMI_UNIFIED_API_H_ */
|
||||
|
@@ -8427,4 +8427,56 @@ struct wmi_obss_detect_info {
|
||||
uint8_t matched_bssid_addr[IEEE80211_ADDR_LEN];
|
||||
};
|
||||
|
||||
/**
|
||||
* @time_offset: time offset after 11k offload command to trigger a neighbor
|
||||
* report request (in seconds)
|
||||
* @low_rssi_offset: Offset from rssi threshold to trigger a neighbor
|
||||
* report request (in dBm)
|
||||
* @bmiss_count_trigger: Number of beacon miss events to trigger neighbor
|
||||
* report request
|
||||
* @per_threshold_offset: offset from PER threshold to trigger neighbor
|
||||
* report request (in %)
|
||||
* @neighbor_report_cache_timeout: timeout after which new trigger can enable
|
||||
* sending of a neighbor report request (in seconds)
|
||||
* @max_neighbor_report_req_cap: max number of neighbor report requests that
|
||||
* can be sent to the peer in the current session
|
||||
* @ssid: Current connect SSID info
|
||||
*/
|
||||
struct wmi_11k_offload_neighbor_report_params {
|
||||
uint32_t time_offset;
|
||||
uint32_t low_rssi_offset;
|
||||
uint32_t bmiss_count_trigger;
|
||||
uint32_t per_threshold_offset;
|
||||
uint32_t neighbor_report_cache_timeout;
|
||||
uint32_t max_neighbor_report_req_cap;
|
||||
struct mac_ssid ssid;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wmi_11k_offload_params - offload 11k features to FW
|
||||
* @vdev_id: vdev id
|
||||
* @offload_11k_bitmask: bitmask to specify offloaded features
|
||||
* B0: Neighbor Report Request offload
|
||||
* B1-B31: Reserved
|
||||
* @neighbor_report_params: neighbor report offload params
|
||||
*/
|
||||
struct wmi_11k_offload_params {
|
||||
uint32_t vdev_id;
|
||||
uint32_t offload_11k_bitmask;
|
||||
struct wmi_11k_offload_neighbor_report_params neighbor_report_params;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wmi_invoke_neighbor_report_params - Invoke neighbor report request
|
||||
* from IW to FW
|
||||
* @vdev_id: vdev id
|
||||
* @send_resp_to_host: bool to send response to host or not
|
||||
* @ssid: ssid given from the IW command
|
||||
*/
|
||||
struct wmi_invoke_neighbor_report_params {
|
||||
uint32_t vdev_id;
|
||||
uint32_t send_resp_to_host;
|
||||
struct mac_ssid ssid;
|
||||
};
|
||||
|
||||
#endif /* _WMI_UNIFIED_PARAM_H_ */
|
||||
|
@@ -1518,6 +1518,11 @@ QDF_STATUS (*extract_swfda_vdev_id)(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
QDF_STATUS (*send_fils_discovery_send_cmd)(wmi_unified_t wmi_handle,
|
||||
struct fd_params *param);
|
||||
#endif /* WLAN_SUPPORT_FILS */
|
||||
QDF_STATUS (*send_offload_11k_cmd)(wmi_unified_t wmi_handle,
|
||||
struct wmi_11k_offload_params *params);
|
||||
|
||||
QDF_STATUS (*send_invoke_neighbor_report_cmd)(wmi_unified_t wmi_handle,
|
||||
struct wmi_invoke_neighbor_report_params *params);
|
||||
};
|
||||
|
||||
/* Forward declartion for psoc*/
|
||||
|
@@ -7351,3 +7351,27 @@ QDF_STATUS wmi_unified_extract_obss_detection_info(void *wmi_hdl,
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS wmi_unified_offload_11k_cmd(void *wmi_hdl,
|
||||
struct wmi_11k_offload_params *params)
|
||||
{
|
||||
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
|
||||
|
||||
if (wmi_handle->ops->send_offload_11k_cmd)
|
||||
return wmi_handle->ops->send_offload_11k_cmd(
|
||||
wmi_handle, params);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl,
|
||||
struct wmi_invoke_neighbor_report_params *params)
|
||||
{
|
||||
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
|
||||
|
||||
if (wmi_handle->ops->send_invoke_neighbor_report_cmd)
|
||||
return wmi_handle->ops->send_invoke_neighbor_report_cmd(
|
||||
wmi_handle, params);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
@@ -21307,6 +21307,150 @@ static QDF_STATUS extract_obss_detection_info_tlv(uint8_t *evt_buf,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* send_offload_11k_cmd_tlv() - send wmi cmd with 11k offload params
|
||||
* @wmi_handle: wmi handler
|
||||
* @params: pointer to 11k offload params
|
||||
*
|
||||
* Return: 0 for success and non zero for failure
|
||||
*/
|
||||
static QDF_STATUS send_offload_11k_cmd_tlv(wmi_unified_t wmi_handle,
|
||||
struct wmi_11k_offload_params *params)
|
||||
{
|
||||
wmi_11k_offload_report_fixed_param *cmd;
|
||||
wmi_buf_t buf;
|
||||
QDF_STATUS status;
|
||||
uint8_t *buf_ptr;
|
||||
wmi_neighbor_report_11k_offload_tlv_param
|
||||
*neighbor_report_offload_params;
|
||||
wmi_neighbor_report_offload *neighbor_report_offload;
|
||||
|
||||
uint32_t len = sizeof(*cmd);
|
||||
|
||||
if (params->offload_11k_bitmask &
|
||||
WMI_11K_OFFLOAD_BITMAP_NEIGHBOR_REPORT_REQ)
|
||||
len += WMI_TLV_HDR_SIZE +
|
||||
sizeof(wmi_neighbor_report_11k_offload_tlv_param);
|
||||
|
||||
buf = wmi_buf_alloc(wmi_handle, len);
|
||||
if (!buf) {
|
||||
WMI_LOGP("%s: failed to allocate memory for 11k offload params",
|
||||
__func__);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
buf_ptr = (uint8_t *) wmi_buf_data(buf);
|
||||
cmd = (wmi_11k_offload_report_fixed_param *) buf_ptr;
|
||||
|
||||
WMITLV_SET_HDR(&cmd->tlv_header,
|
||||
WMITLV_TAG_STRUC_wmi_offload_11k_report_fixed_param,
|
||||
WMITLV_GET_STRUCT_TLVLEN(
|
||||
wmi_11k_offload_report_fixed_param));
|
||||
|
||||
cmd->vdev_id = params->vdev_id;
|
||||
cmd->offload_11k = params->offload_11k_bitmask;
|
||||
|
||||
if (params->offload_11k_bitmask &
|
||||
WMI_11K_OFFLOAD_BITMAP_NEIGHBOR_REPORT_REQ) {
|
||||
buf_ptr += sizeof(wmi_11k_offload_report_fixed_param);
|
||||
|
||||
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
|
||||
sizeof(wmi_neighbor_report_11k_offload_tlv_param));
|
||||
buf_ptr += WMI_TLV_HDR_SIZE;
|
||||
|
||||
neighbor_report_offload_params =
|
||||
(wmi_neighbor_report_11k_offload_tlv_param *)buf_ptr;
|
||||
WMITLV_SET_HDR(&neighbor_report_offload_params->tlv_header,
|
||||
WMITLV_TAG_STRUC_wmi_neighbor_report_offload_tlv_param,
|
||||
WMITLV_GET_STRUCT_TLVLEN(
|
||||
wmi_neighbor_report_11k_offload_tlv_param));
|
||||
|
||||
neighbor_report_offload = &neighbor_report_offload_params->
|
||||
neighbor_rep_ofld_params;
|
||||
|
||||
neighbor_report_offload->time_offset =
|
||||
params->neighbor_report_params.time_offset;
|
||||
neighbor_report_offload->low_rssi_offset =
|
||||
params->neighbor_report_params.low_rssi_offset;
|
||||
neighbor_report_offload->bmiss_count_trigger =
|
||||
params->neighbor_report_params.bmiss_count_trigger;
|
||||
neighbor_report_offload->per_threshold_offset =
|
||||
params->neighbor_report_params.per_threshold_offset;
|
||||
neighbor_report_offload->neighbor_report_cache_timeout =
|
||||
params->neighbor_report_params.
|
||||
neighbor_report_cache_timeout;
|
||||
neighbor_report_offload->max_neighbor_report_req_cap =
|
||||
params->neighbor_report_params.
|
||||
max_neighbor_report_req_cap;
|
||||
neighbor_report_offload->ssid.ssid_len =
|
||||
params->neighbor_report_params.ssid.length;
|
||||
qdf_mem_copy(neighbor_report_offload->ssid.ssid,
|
||||
¶ms->neighbor_report_params.ssid.mac_ssid,
|
||||
neighbor_report_offload->ssid.ssid_len);
|
||||
}
|
||||
|
||||
status = wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||
WMI_11K_OFFLOAD_REPORT_CMDID);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
WMI_LOGE("%s: failed to send 11k offload command %d",
|
||||
__func__, status);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* send_invoke_neighbor_report_cmd_tlv() - send invoke 11k neighbor report
|
||||
* command
|
||||
* @wmi_handle: wmi handler
|
||||
* @params: pointer to neighbor report invoke params
|
||||
*
|
||||
* Return: 0 for success and non zero for failure
|
||||
*/
|
||||
static QDF_STATUS send_invoke_neighbor_report_cmd_tlv(wmi_unified_t wmi_handle,
|
||||
struct wmi_invoke_neighbor_report_params *params)
|
||||
{
|
||||
wmi_11k_offload_invoke_neighbor_report_fixed_param *cmd;
|
||||
wmi_buf_t buf;
|
||||
QDF_STATUS status;
|
||||
uint8_t *buf_ptr;
|
||||
uint32_t len = sizeof(*cmd);
|
||||
|
||||
buf = wmi_buf_alloc(wmi_handle, len);
|
||||
if (!buf) {
|
||||
WMI_LOGP("%s:failed to allocate memory for neighbor invoke cmd",
|
||||
__func__);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
buf_ptr = (uint8_t *) wmi_buf_data(buf);
|
||||
cmd = (wmi_11k_offload_invoke_neighbor_report_fixed_param *) buf_ptr;
|
||||
|
||||
WMITLV_SET_HDR(&cmd->tlv_header,
|
||||
WMITLV_TAG_STRUC_wmi_invoke_neighbor_report_fixed_param,
|
||||
WMITLV_GET_STRUCT_TLVLEN(
|
||||
wmi_11k_offload_invoke_neighbor_report_fixed_param));
|
||||
|
||||
cmd->vdev_id = params->vdev_id;
|
||||
cmd->flags = params->send_resp_to_host;
|
||||
|
||||
cmd->ssid.ssid_len = params->ssid.length;
|
||||
qdf_mem_copy(cmd->ssid.ssid,
|
||||
¶ms->ssid.mac_ssid,
|
||||
cmd->ssid.ssid_len);
|
||||
|
||||
status = wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||
WMI_11K_INVOKE_NEIGHBOR_REPORT_CMDID);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
WMI_LOGE("%s: failed to send invoke neighbor report command %d",
|
||||
__func__, status);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
struct wmi_ops tlv_ops = {
|
||||
.send_vdev_create_cmd = send_vdev_create_cmd_tlv,
|
||||
.send_vdev_delete_cmd = send_vdev_delete_cmd_tlv,
|
||||
@@ -21758,6 +21902,8 @@ struct wmi_ops tlv_ops = {
|
||||
.extract_swfda_vdev_id = extract_swfda_vdev_id_tlv,
|
||||
.send_fils_discovery_send_cmd = send_fils_discovery_send_cmd_tlv,
|
||||
#endif /* WLAN_SUPPORT_FILS */
|
||||
.send_offload_11k_cmd = send_offload_11k_cmd_tlv,
|
||||
.send_invoke_neighbor_report_cmd = send_invoke_neighbor_report_cmd_tlv,
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user