qcacld-3.0: wma to target_if migration of wmi_roam_event
Currently, wmi_roam_event_id data is extracted and processing is also done in wma. This is not inline with component model where target_if takes care of data extraction and handover the extracted data to corresponding component(connection mgr in this case). Add changes to support the same. As the legacy CSR/LIM is not yet converged, have a wrapper from connection mgr to wma to call these legacy APIs. Change-Id: I0e22bbccfe21200b90771a01f9ee7454f4ecb119 CRs-Fixed: 2990355
This commit is contained in:

committed by
Madan Koyyalamudi

parent
a011a54fee
commit
78cb3008e6
@@ -264,6 +264,20 @@ QDF_STATUS
|
||||
wmi_extract_roam_sync_frame_event(wmi_unified_t wmi_handle, void *event,
|
||||
uint32_t len,
|
||||
struct roam_synch_frame_ind *frame_ptr);
|
||||
|
||||
/**
|
||||
* wmi_extract_roam_event - Extract roam event
|
||||
* @wmi_handle: WMI handle
|
||||
* @event: Event data received from firmware
|
||||
* @data_len: Event data length received from firmware
|
||||
* @roam_event: Extract the event and fill in roam_event
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wmi_extract_roam_event(wmi_unified_t wmi_handle, uint8_t *event,
|
||||
uint32_t data_len,
|
||||
struct roam_offload_roam_event *roam_event);
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
|
||||
|
@@ -365,5 +365,18 @@ wmi_extract_roam_sync_frame_event(wmi_unified_t wmi_handle, void *event,
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wmi_extract_roam_event(wmi_unified_t wmi_handle, uint8_t *event,
|
||||
uint32_t data_len,
|
||||
struct roam_offload_roam_event *roam_event)
|
||||
{
|
||||
if (wmi_handle->ops->extract_roam_event)
|
||||
return wmi_handle->ops->extract_roam_event(wmi_handle, event,
|
||||
data_len,
|
||||
roam_event);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
#endif
|
||||
|
@@ -20,7 +20,13 @@
|
||||
|
||||
#include <wmi_unified_priv.h>
|
||||
#include <wmi_unified_roam_api.h>
|
||||
#include <wmi_unified_roam_param.h>
|
||||
#include "wmi.h"
|
||||
#include "wlan_roam_debug.h"
|
||||
#include "ol_defines.h"
|
||||
|
||||
#define WMI_MAC_TO_PDEV_MAP(x) ((x) + (1))
|
||||
#define WMI_PDEV_TO_MAC_MAP(x) ((x) - (1))
|
||||
|
||||
#ifdef FEATURE_LFR_SUBNET_DETECTION
|
||||
/**
|
||||
@@ -1829,7 +1835,238 @@ extract_roam_sync_frame_event_tlv(wmi_unified_t wmi_handle, void *event,
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
|
||||
static char *wmi_get_roam_event_reason_string(uint32_t reason)
|
||||
{
|
||||
switch (reason) {
|
||||
case WMI_ROAM_REASON_INVALID:
|
||||
return "Default";
|
||||
case WMI_ROAM_REASON_BETTER_AP:
|
||||
return "Better AP";
|
||||
case WMI_ROAM_REASON_BMISS:
|
||||
return "BMISS";
|
||||
case WMI_ROAM_REASON_LOW_RSSI:
|
||||
return "Low Rssi";
|
||||
case WMI_ROAM_REASON_SUITABLE_AP:
|
||||
return "Suitable AP";
|
||||
case WMI_ROAM_REASON_HO_FAILED:
|
||||
return "Hand-off Failed";
|
||||
case WMI_ROAM_REASON_INVOKE_ROAM_FAIL:
|
||||
return "Roam Invoke failed";
|
||||
case WMI_ROAM_REASON_RSO_STATUS:
|
||||
return "RSO status";
|
||||
case WMI_ROAM_REASON_BTM:
|
||||
return "BTM";
|
||||
case WMI_ROAM_REASON_DEAUTH:
|
||||
return "Deauth";
|
||||
default:
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
static void
|
||||
wmi_extract_pdev_hw_mode_trans_ind(
|
||||
wmi_pdev_hw_mode_transition_event_fixed_param *fixed_param,
|
||||
wmi_pdev_set_hw_mode_response_vdev_mac_entry *vdev_mac_entry,
|
||||
struct cm_hw_mode_trans_ind *hw_mode_trans_ind)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
if (fixed_param->num_vdev_mac_entries > MAX_VDEV_SUPPORTED) {
|
||||
wmi_err("Number of Vdev mac entries %d exceeded max vdev supported %d",
|
||||
fixed_param->num_vdev_mac_entries,
|
||||
MAX_VDEV_SUPPORTED);
|
||||
return;
|
||||
}
|
||||
hw_mode_trans_ind->old_hw_mode_index = fixed_param->old_hw_mode_index;
|
||||
hw_mode_trans_ind->new_hw_mode_index = fixed_param->new_hw_mode_index;
|
||||
hw_mode_trans_ind->num_vdev_mac_entries =
|
||||
fixed_param->num_vdev_mac_entries;
|
||||
wmi_debug("old_hw_mode_index:%d new_hw_mode_index:%d entries=%d",
|
||||
fixed_param->old_hw_mode_index,
|
||||
fixed_param->new_hw_mode_index,
|
||||
fixed_param->num_vdev_mac_entries);
|
||||
|
||||
if (!vdev_mac_entry) {
|
||||
wmi_err("Invalid vdev_mac_entry");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Store the vdev-mac map in WMA and send to policy manager */
|
||||
for (i = 0; i < fixed_param->num_vdev_mac_entries; i++) {
|
||||
uint32_t vdev_id, mac_id, pdev_id;
|
||||
|
||||
vdev_id = vdev_mac_entry[i].vdev_id;
|
||||
pdev_id = vdev_mac_entry[i].pdev_id;
|
||||
|
||||
if (pdev_id == OL_TXRX_PDEV_ID) {
|
||||
wmi_err("soc level id received for mac id");
|
||||
return;
|
||||
}
|
||||
if (vdev_id >= WLAN_MAX_VDEVS) {
|
||||
wmi_err("vdev_id: %d is invalid, max_bssid: %d",
|
||||
vdev_id, WLAN_MAX_VDEVS);
|
||||
return;
|
||||
}
|
||||
|
||||
mac_id = WMI_PDEV_TO_MAC_MAP(vdev_mac_entry[i].pdev_id);
|
||||
|
||||
hw_mode_trans_ind->vdev_mac_map[i].vdev_id = vdev_id;
|
||||
hw_mode_trans_ind->vdev_mac_map[i].mac_id = mac_id;
|
||||
|
||||
wmi_debug("vdev_id:%d mac_id:%d", vdev_id, mac_id);
|
||||
}
|
||||
}
|
||||
|
||||
static enum roam_reason
|
||||
wmi_convert_fw_reason_to_cm_reason(uint32_t reason)
|
||||
{
|
||||
switch (reason) {
|
||||
case WMI_ROAM_REASON_INVALID:
|
||||
return ROAM_REASON_INVALID;
|
||||
case WMI_ROAM_REASON_BETTER_AP:
|
||||
return ROAM_REASON_BETTER_AP;
|
||||
case WMI_ROAM_REASON_BMISS:
|
||||
return ROAM_REASON_BMISS;
|
||||
case WMI_ROAM_REASON_LOW_RSSI:
|
||||
return ROAM_REASON_LOW_RSSI;
|
||||
case WMI_ROAM_REASON_SUITABLE_AP:
|
||||
return ROAM_REASON_SUITABLE_AP;
|
||||
case WMI_ROAM_REASON_HO_FAILED:
|
||||
return ROAM_REASON_HO_FAILED;
|
||||
case WMI_ROAM_REASON_INVOKE_ROAM_FAIL:
|
||||
return ROAM_REASON_INVOKE_ROAM_FAIL;
|
||||
case WMI_ROAM_REASON_RSO_STATUS:
|
||||
return ROAM_REASON_RSO_STATUS;
|
||||
case WMI_ROAM_REASON_BTM:
|
||||
return ROAM_REASON_BTM;
|
||||
case WMI_ROAM_REASON_DEAUTH:
|
||||
return ROAM_REASON_DEAUTH;
|
||||
default:
|
||||
return ROAM_REASON_INVALID;
|
||||
}
|
||||
|
||||
return ROAM_REASON_INVALID;
|
||||
}
|
||||
|
||||
static enum cm_roam_notif
|
||||
wmi_convert_fw_notif_to_cm_notif(uint32_t fw_notif)
|
||||
{
|
||||
switch (fw_notif) {
|
||||
case WMI_ROAM_NOTIF_ROAM_START:
|
||||
return CM_ROAM_NOTIF_ROAM_START;
|
||||
case WMI_ROAM_NOTIF_ROAM_ABORT:
|
||||
return CM_ROAM_NOTIF_ROAM_ABORT;
|
||||
case WMI_ROAM_NOTIF_ROAM_REASSOC:
|
||||
return CM_ROAM_NOTIF_ROAM_REASSOC;
|
||||
case WMI_ROAM_NOTIF_SCAN_MODE_SUCCESS:
|
||||
return CM_ROAM_NOTIF_SCAN_MODE_SUCCESS;
|
||||
case WMI_ROAM_NOTIF_SCAN_MODE_FAIL:
|
||||
return CM_ROAM_NOTIF_SCAN_MODE_FAIL;
|
||||
case WMI_ROAM_NOTIF_DISCONNECT:
|
||||
return CM_ROAM_NOTIF_DISCONNECT;
|
||||
case WMI_ROAM_NOTIF_SUBNET_CHANGED:
|
||||
return CM_ROAM_NOTIF_SUBNET_CHANGED;
|
||||
case WMI_ROAM_NOTIF_SCAN_START:
|
||||
return CM_ROAM_NOTIF_SCAN_START;
|
||||
case WMI_ROAM_NOTIF_DEAUTH_RECV:
|
||||
return CM_ROAM_NOTIF_DEAUTH_RECV;
|
||||
case WMI_ROAM_NOTIF_DISASSOC_RECV:
|
||||
return CM_ROAM_NOTIF_DISASSOC_RECV;
|
||||
default:
|
||||
return CM_ROAM_NOTIF_INVALID;
|
||||
}
|
||||
|
||||
return CM_ROAM_NOTIF_INVALID;
|
||||
}
|
||||
|
||||
/**
|
||||
* extract_roam_sync_event_tlv() - Extract the roam event
|
||||
* @wmi_handle: wmi handle
|
||||
* @evt_buf: Pointer to the event buffer
|
||||
* @len: Data length
|
||||
* @roam_event: Roam event data
|
||||
*/
|
||||
static QDF_STATUS
|
||||
extract_roam_event_tlv(wmi_unified_t wmi_handle, void *evt_buf, uint32_t len,
|
||||
struct roam_offload_roam_event *roam_event)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
wmi_roam_event_fixed_param *wmi_event = NULL;
|
||||
WMI_ROAM_EVENTID_param_tlvs *param_buf = NULL;
|
||||
struct cm_hw_mode_trans_ind *hw_mode_trans_ind;
|
||||
|
||||
if (!evt_buf) {
|
||||
wmi_debug("Empty roam_sync_event param buf");
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
param_buf = (WMI_ROAM_EVENTID_param_tlvs *)evt_buf;
|
||||
if (!param_buf) {
|
||||
wmi_debug("received null buf from target");
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
wmi_event = param_buf->fixed_param;
|
||||
if (!wmi_event) {
|
||||
wmi_debug("received null event data from target");
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
goto end;
|
||||
}
|
||||
roam_event->vdev_id = wmi_event->vdev_id;
|
||||
|
||||
if (roam_event->vdev_id >= WLAN_MAX_VDEVS) {
|
||||
wmi_err("Invalid vdev id from firmware: %u",
|
||||
roam_event->vdev_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
roam_event->reason =
|
||||
wmi_convert_fw_reason_to_cm_reason(wmi_event->reason);
|
||||
roam_event->rssi = wmi_event->rssi;
|
||||
roam_event->notif = wmi_convert_fw_notif_to_cm_notif(wmi_event->notif);
|
||||
roam_event->notif_params = wmi_event->notif_params;
|
||||
roam_event->notif_params1 = wmi_event->notif_params1;
|
||||
|
||||
wlan_roam_debug_log(roam_event->vdev_id, DEBUG_ROAM_EVENT,
|
||||
DEBUG_INVALID_PEER_ID, NULL, NULL,
|
||||
roam_event->reason,
|
||||
(roam_event->reason == WMI_ROAM_REASON_INVALID) ?
|
||||
roam_event->notif : roam_event->rssi);
|
||||
|
||||
DPTRACE(qdf_dp_trace_record_event(QDF_DP_TRACE_EVENT_RECORD,
|
||||
roam_event->vdev_id, QDF_TRACE_DEFAULT_PDEV_ID,
|
||||
QDF_PROTO_TYPE_EVENT, QDF_ROAM_EVENTID));
|
||||
|
||||
wmi_debug("FW_ROAM_EVT: Reason:%s[%d], Notif %x for vdevid %x, rssi %d",
|
||||
wmi_get_roam_event_reason_string(roam_event->reason),
|
||||
roam_event->reason,
|
||||
roam_event->notif, roam_event->vdev_id, roam_event->rssi);
|
||||
|
||||
if (param_buf->hw_mode_transition_fixed_param) {
|
||||
hw_mode_trans_ind = qdf_mem_malloc(sizeof(*hw_mode_trans_ind));
|
||||
if (!hw_mode_trans_ind) {
|
||||
status = QDF_STATUS_E_NOMEM;
|
||||
goto end;
|
||||
}
|
||||
wmi_extract_pdev_hw_mode_trans_ind(
|
||||
param_buf->hw_mode_transition_fixed_param,
|
||||
param_buf->wmi_pdev_set_hw_mode_response_vdev_mac_mapping,
|
||||
hw_mode_trans_ind);
|
||||
roam_event->hw_mode_trans_ind = hw_mode_trans_ind;
|
||||
}
|
||||
|
||||
if (wmi_event->notif_params1)
|
||||
roam_event->deauth_disassoc_frame =
|
||||
param_buf->deauth_disassoc_frame;
|
||||
end:
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
void wmi_roam_offload_attach_tlv(wmi_unified_t wmi_handle)
|
||||
{
|
||||
@@ -1842,6 +2079,7 @@ void wmi_roam_offload_attach_tlv(wmi_unified_t wmi_handle)
|
||||
#ifdef ROAM_TARGET_IF_CONVERGENCE
|
||||
ops->extract_roam_sync_event = extract_roam_sync_event_tlv;
|
||||
ops->extract_roam_sync_frame_event = extract_roam_sync_frame_event_tlv;
|
||||
ops->extract_roam_event = extract_roam_event_tlv;
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
ops->send_set_ric_req_cmd = send_set_ric_req_cmd_tlv;
|
||||
ops->send_process_roam_synch_complete_cmd =
|
||||
@@ -1887,6 +2125,13 @@ extract_roam_sync_frame_event(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS
|
||||
extract_roam_event(wmi_unified_t wmi_handle, void *evt_buf, uint32_t len,
|
||||
struct roam_offload_roam_event *roam_event)
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
|
||||
|
Reference in New Issue
Block a user