qcacld-3.0: wma to target_if migration of vdev_disconnect_event
Currently, wmi_vdev_disconnect_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. Change-Id: I2486cc3f63c4b35305b60ac55cd0a622c7185323 CRs-Fixed: 2990373
This commit is contained in:

committed by
Madan Koyyalamudi

parent
cb5b2dde46
commit
a655f5e64e
@@ -74,6 +74,18 @@ int target_if_cm_roam_event(ol_scn_t scn, uint8_t *event, uint32_t len);
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_vdev_disconnect_event_handler - vdev disconnect evt handler
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int
|
||||
target_if_cm_roam_vdev_disconnect_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len);
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
|
||||
/**
|
||||
@@ -85,7 +97,6 @@ target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc);
|
||||
*/
|
||||
void
|
||||
target_if_cm_roam_register_rx_ops(struct wlan_cm_roam_rx_ops *rx_ops);
|
||||
|
||||
#else /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
static inline
|
||||
void
|
||||
@@ -106,6 +117,13 @@ target_if_cm_roam_event(ol_scn_t scn, uint8_t *event, uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
target_if_cm_roam_vdev_disconnect_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
#endif
|
||||
|
@@ -58,6 +58,7 @@ target_if_cm_roam_register_rx_ops(struct wlan_cm_roam_rx_ops *rx_ops)
|
||||
rx_ops->roam_sync_frame_event = cm_roam_sync_frame_event_handler;
|
||||
rx_ops->roam_event_rx = cm_roam_event_handler;
|
||||
rx_ops->btm_blacklist_event = cm_btm_blacklist_event_handler;
|
||||
rx_ops->vdev_disconnect_event = cm_vdev_disconnect_event_handler;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -252,6 +253,50 @@ target_if_cm_btm_blacklist_event(ol_scn_t scn, uint8_t *event, uint32_t len)
|
||||
return status;
|
||||
}
|
||||
|
||||
int
|
||||
target_if_cm_roam_vdev_disconnect_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
int status = 0;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
struct vdev_disconnect_event_data data = {0};
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
qdf_status = wmi_extract_vdev_disconnect_event(wmi_handle, event, len,
|
||||
&data);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
if (!roam_rx_ops || !roam_rx_ops->vdev_disconnect_event) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
status = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
qdf_status = roam_rx_ops->vdev_disconnect_event(&data);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
status = -EINVAL;
|
||||
|
||||
err:
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
@@ -300,6 +345,17 @@ target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_vdev_disconnect_event_id,
|
||||
target_if_cm_roam_vdev_disconnect_event_handler,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event(%u) registration failed, ret: %d",
|
||||
wmi_vdev_disconnect_event_id, ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1139,5 +1139,23 @@ cm_roam_event_handler(struct roam_offload_roam_event roam_event);
|
||||
QDF_STATUS
|
||||
cm_btm_blacklist_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct roam_blacklist_event *list);
|
||||
|
||||
/**
|
||||
* cm_vdev_disconnect_event_handler() - disconnect evt handler for target_if
|
||||
* @data: disconnect event data
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
cm_vdev_disconnect_event_handler(struct vdev_disconnect_event_data *data);
|
||||
|
||||
/**
|
||||
* cm_handle_disconnect_reason() - disconnect reason evt wrapper for wma
|
||||
* @data: disconnect event data
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
cm_handle_disconnect_reason(struct vdev_disconnect_event_data *data);
|
||||
#endif
|
||||
#endif /* WLAN_CM_ROAM_API_H__ */
|
||||
|
@@ -1809,6 +1809,28 @@ struct roam_blacklist_event {
|
||||
uint32_t num_entries;
|
||||
struct roam_blacklist_timeout roam_blacklist[];
|
||||
};
|
||||
|
||||
/*
|
||||
* enum cm_vdev_disconnect_reason - Roam disconnect reason
|
||||
* @CM_DISCONNECT_REASON_CSA_SA_QUERY_TIMEOUT: Disconnect due to SA query
|
||||
* timeout after moving to new channel due to CSA in OCV enabled case.
|
||||
* @CM_DISCONNECT_REASON_MOVE_TO_CELLULAR: Disconnect from WiFi to move
|
||||
* to cellular
|
||||
*/
|
||||
enum cm_vdev_disconnect_reason {
|
||||
CM_DISCONNECT_REASON_CSA_SA_QUERY_TIMEOUT = 1,
|
||||
CM_DISCONNECT_REASON_MOVE_TO_CELLULAR,
|
||||
};
|
||||
|
||||
/*
|
||||
* struct vdev_disconnect_event_data - Roam disconnect event data
|
||||
* @vdev_id: vdev id
|
||||
* @reason: roam reason of type @enum cm_vdev_disconnect_reason
|
||||
*/
|
||||
struct vdev_disconnect_event_data {
|
||||
uint8_t vdev_id;
|
||||
enum cm_vdev_disconnect_reason reason;
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1883,6 +1905,7 @@ struct wlan_cm_roam_tx_ops {
|
||||
* @roam_sync_frame_event: Rx ops function pointer for roam sync frame event
|
||||
* @roam_event_rx: Rx ops function pointer for roam info event
|
||||
* @btm_blacklist_event: Rx ops function pointer for btm blacklist event
|
||||
* @vdev_disconnect_event: Rx ops function pointer for vdev disconnect event
|
||||
*/
|
||||
struct wlan_cm_roam_rx_ops {
|
||||
QDF_STATUS (*roam_sync_event)(struct wlan_objmgr_psoc *psoc,
|
||||
@@ -1895,6 +1918,8 @@ struct wlan_cm_roam_rx_ops {
|
||||
#ifdef ROAM_TARGET_IF_CONVERGENCE
|
||||
QDF_STATUS (*btm_blacklist_event)(struct wlan_objmgr_psoc *psoc,
|
||||
struct roam_blacklist_event *list);
|
||||
QDF_STATUS
|
||||
(*vdev_disconnect_event)(struct vdev_disconnect_event_data *data);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@@ -1998,6 +1998,12 @@ cm_handle_roam_offload_events(struct roam_offload_roam_event roam_event)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
cm_vdev_disconnect_event_handler(struct vdev_disconnect_event_data *data)
|
||||
{
|
||||
return cm_handle_disconnect_reason(data);
|
||||
}
|
||||
#else
|
||||
static void
|
||||
cm_handle_roam_offload_events(struct roam_offload_roam_event roam_event)
|
||||
@@ -2005,6 +2011,12 @@ cm_handle_roam_offload_events(struct roam_offload_roam_event roam_event)
|
||||
mlme_debug("Unhandled roam event with reason 0x%x for vdev_id %u",
|
||||
roam_event.reason, roam_event.vdev_id);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
cm_vdev_disconnect_event_handler(struct vdev_disconnect_event_data *data)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS
|
||||
|
@@ -292,6 +292,20 @@ QDF_STATUS
|
||||
wmi_extract_btm_blacklist_event(wmi_unified_t wmi_handle,
|
||||
uint8_t *event, uint32_t data_len,
|
||||
struct roam_blacklist_event **dst_list);
|
||||
|
||||
/**
|
||||
* wmi_extract_vdev_disconnect_event - Extract disconnect event data
|
||||
* @wmi_handle: WMI handle
|
||||
* @event: Event data received from firmware
|
||||
* @data_len: Event data length received from firmware
|
||||
* @data: Extract the event and fill in data
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wmi_extract_vdev_disconnect_event(wmi_unified_t wmi_handle,
|
||||
uint8_t *event, uint32_t data_len,
|
||||
struct vdev_disconnect_event_data *data);
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
|
||||
|
@@ -391,5 +391,16 @@ wmi_extract_btm_blacklist_event(wmi_unified_t wmi_handle,
|
||||
dst_list);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wmi_extract_vdev_disconnect_event(wmi_unified_t wmi_handle,
|
||||
uint8_t *event, uint32_t data_len,
|
||||
struct vdev_disconnect_event_data *data)
|
||||
{
|
||||
if (wmi_handle->ops->extract_vdev_disconnect_event)
|
||||
return wmi_handle->ops->extract_vdev_disconnect_event(
|
||||
wmi_handle, event, data_len, data);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
#endif
|
||||
|
@@ -2175,6 +2175,35 @@ extract_btm_blacklist_event(wmi_unified_t wmi_handle,
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
extract_vdev_disconnect_event_tlv(wmi_unified_t wmi_handle,
|
||||
uint8_t *event, uint32_t data_len,
|
||||
struct vdev_disconnect_event_data *data)
|
||||
{
|
||||
WMI_VDEV_DISCONNECT_EVENTID_param_tlvs *param_buf;
|
||||
wmi_vdev_disconnect_event_fixed_param *roam_vdev_disc_ev;
|
||||
|
||||
param_buf = (WMI_VDEV_DISCONNECT_EVENTID_param_tlvs *)event;
|
||||
|
||||
roam_vdev_disc_ev = param_buf->fixed_param;
|
||||
if (!roam_vdev_disc_ev) {
|
||||
wmi_err("roam cap event is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (roam_vdev_disc_ev->vdev_id >= WLAN_MAX_VDEVS) {
|
||||
wmi_err("Invalid vdev id %d", roam_vdev_disc_ev->vdev_id);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
data->vdev_id = roam_vdev_disc_ev->vdev_id;
|
||||
data->reason = roam_vdev_disc_ev->reason;
|
||||
|
||||
wmi_debug("Received disconnect roam event on vdev_id : %d, reason:%d",
|
||||
data->vdev_id, data->reason);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
void wmi_roam_offload_attach_tlv(wmi_unified_t wmi_handle)
|
||||
@@ -2190,6 +2219,7 @@ void wmi_roam_offload_attach_tlv(wmi_unified_t wmi_handle)
|
||||
ops->extract_roam_sync_frame_event = extract_roam_sync_frame_event_tlv;
|
||||
ops->extract_roam_event = extract_roam_event_tlv;
|
||||
ops->extract_btm_bl_event = extract_btm_blacklist_event;
|
||||
ops->extract_vdev_disconnect_event = extract_vdev_disconnect_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 =
|
||||
|
@@ -2810,8 +2810,13 @@ static int wma_wake_event_piggybacked(
|
||||
break;
|
||||
case WOW_REASON_VDEV_DISCONNECT:
|
||||
wma_debug("Host woken up because of vdev disconnect event");
|
||||
#ifndef ROAM_TARGET_IF_CONVERGENCE
|
||||
errno = wma_roam_vdev_disconnect_event_handler(wma, pb_event,
|
||||
pb_event_len);
|
||||
#else
|
||||
errno = target_if_cm_roam_vdev_disconnect_event_handler(wma,
|
||||
pb_event, pb_event_len);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
wma_err("Wake reason %s(%u) is not a piggybacked event",
|
||||
|
@@ -3348,10 +3348,16 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
|
||||
wmi_roam_synch_frame_event_id,
|
||||
wma_roam_synch_frame_event_handler,
|
||||
WMA_RX_SERIALIZER_CTX);
|
||||
|
||||
wmi_unified_register_event_handler(wma_handle->wmi_handle,
|
||||
wmi_roam_blacklist_event_id,
|
||||
wma_handle_btm_blacklist_event,
|
||||
WMA_RX_SERIALIZER_CTX);
|
||||
|
||||
wmi_unified_register_event_handler(wma_handle->wmi_handle,
|
||||
wmi_vdev_disconnect_event_id,
|
||||
wma_roam_vdev_disconnect_event_handler,
|
||||
WMA_RX_SERIALIZER_CTX);
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
wmi_unified_register_event_handler(wma_handle->wmi_handle,
|
||||
wmi_roam_auth_offload_event_id,
|
||||
@@ -3370,11 +3376,6 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
|
||||
|
||||
wma_register_pmkid_req_event_handler(wma_handle);
|
||||
|
||||
wmi_unified_register_event_handler(wma_handle->wmi_handle,
|
||||
wmi_vdev_disconnect_event_id,
|
||||
wma_roam_vdev_disconnect_event_handler,
|
||||
WMA_RX_SERIALIZER_CTX);
|
||||
|
||||
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
wmi_unified_register_event_handler(wma_handle->wmi_handle,
|
||||
wmi_rssi_breach_event_id,
|
||||
|
@@ -266,6 +266,34 @@ static void wma_handle_disconnect_reason(tp_wma_handle wma_handle,
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
#ifdef ROAM_TARGET_IF_CONVERGENCE
|
||||
QDF_STATUS
|
||||
cm_handle_disconnect_reason(struct vdev_disconnect_event_data *data)
|
||||
{
|
||||
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
|
||||
|
||||
if (!wma) {
|
||||
QDF_ASSERT(0);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
switch (data->reason) {
|
||||
case CM_DISCONNECT_REASON_CSA_SA_QUERY_TIMEOUT:
|
||||
wma_handle_disconnect_reason(wma, data->vdev_id,
|
||||
HAL_DEL_STA_REASON_CODE_SA_QUERY_TIMEOUT);
|
||||
break;
|
||||
case CM_DISCONNECT_REASON_MOVE_TO_CELLULAR:
|
||||
wma_handle_disconnect_reason(wma, data->vdev_id,
|
||||
HAL_DEL_STA_REASON_CODE_BTM_DISASSOC_IMMINENT);
|
||||
break;
|
||||
default:
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int wma_roam_vdev_disconnect_event_handler(void *handle, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
@@ -309,6 +337,7 @@ int wma_roam_vdev_disconnect_event_handler(void *handle, uint8_t *event,
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* wma_process_set_pdev_ie_req() - process the pdev set IE req
|
||||
|
Reference in New Issue
Block a user