qcacld-3.0: Roam sync frame event Wma cleanup
Wma to target_if migration for ROAM SYNC FRAME EVENT Change-Id: I2a56dadf7f45a13a577bdf49bc9514ab2e6dee29 CRs-Fixed: 2968404
This commit is contained in:

committed by
Madan Koyyalamudi

parent
e2171a078f
commit
0c30cb8f04
@@ -27,15 +27,69 @@
|
||||
#include "wlan_objmgr_pdev_obj.h"
|
||||
#include "wlan_objmgr_vdev_obj.h"
|
||||
#include "wlan_cm_roam_public_struct.h"
|
||||
#include <target_if.h>
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
#ifdef ROAM_TARGET_IF_CONVERGENCE
|
||||
/**
|
||||
* target_if_cm_roam_sync_event() - Target IF handler for roam sync events
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int target_if_cm_roam_sync_event(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_sync_frame_event() - Target IF handler for
|
||||
* roam sync frame events
|
||||
* @scn: target handle
|
||||
* @event: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: int for success or error code
|
||||
*/
|
||||
int
|
||||
target_if_cm_roam_sync_frame_event(ol_scn_t scn,
|
||||
uint8_t *event,
|
||||
uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_roam_offload_register_events() - register roam events
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc);
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_register_rx_ops - Target IF API to register roam
|
||||
* related rx op.
|
||||
* @rx_ops: Pointer to rx ops fp struct
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
* Return: none
|
||||
*/
|
||||
QDF_STATUS
|
||||
void
|
||||
target_if_cm_roam_register_rx_ops(struct wlan_cm_roam_rx_ops *rx_ops);
|
||||
|
||||
#else /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
static inline
|
||||
void
|
||||
target_if_cm_roam_register_rx_ops(struct wlan_cm_roam_rx_ops *rx_ops)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef ROAM_TARGET_IF_CONVERGENCE
|
||||
static inline
|
||||
QDF_STATUS
|
||||
target_if_roam_offload_register_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
#endif /* ROAM_TARGET_IF_CONVERGENCE */
|
||||
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
|
||||
#endif
|
||||
|
@@ -21,11 +21,181 @@
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include "wlan_objmgr_pdev_obj.h"
|
||||
#include "wlan_objmgr_vdev_obj.h"
|
||||
#include "wmi_unified_api.h"
|
||||
#include "scheduler_api.h"
|
||||
#include <wmi_unified.h>
|
||||
#include "target_if_cm_roam_event.h"
|
||||
#include "wlan_psoc_mlme_api.h"
|
||||
#include "wlan_mlme_main.h"
|
||||
#include <../../core/src/wlan_cm_roam_i.h>
|
||||
|
||||
QDF_STATUS
|
||||
target_if_cm_roam_register_rx_ops(struct wlan_cm_roam_rx_ops *rx_ops)
|
||||
static inline struct wlan_cm_roam_rx_ops *
|
||||
target_if_cm_get_roam_rx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
struct wlan_mlme_psoc_ext_obj *psoc_ext_priv;
|
||||
struct wlan_cm_roam_rx_ops *rx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("psoc object is NULL");
|
||||
return NULL;
|
||||
}
|
||||
psoc_ext_priv = wlan_psoc_mlme_get_ext_hdl(psoc);
|
||||
if (!psoc_ext_priv) {
|
||||
target_if_err("psoc legacy private object is NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rx_ops = &psoc_ext_priv->rso_rx_ops;
|
||||
return rx_ops;
|
||||
}
|
||||
|
||||
void
|
||||
target_if_cm_roam_register_rx_ops(struct wlan_cm_roam_rx_ops *rx_ops)
|
||||
{
|
||||
#ifdef ROAM_TARGET_IF_CONVERGENCE
|
||||
rx_ops->roam_sync_event = cm_roam_sync_event_handler;
|
||||
rx_ops->roam_sync_frame_event = cm_roam_sync_frame_event_handler;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ROAM_TARGET_IF_CONVERGENCE
|
||||
int
|
||||
target_if_cm_roam_sync_frame_event(ol_scn_t scn,
|
||||
uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
struct roam_synch_frame_ind *frame_ind_ptr;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
int status = 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;
|
||||
}
|
||||
|
||||
frame_ind_ptr = qdf_mem_malloc(sizeof(*frame_ind_ptr));
|
||||
|
||||
if (!frame_ind_ptr)
|
||||
return -EINVAL;
|
||||
|
||||
qdf_status = wmi_extract_roam_sync_frame_event(wmi_handle, event,
|
||||
len,
|
||||
frame_ind_ptr);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
||||
target_if_err("parsing of event failed, %d", qdf_status);
|
||||
status = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
|
||||
if (!roam_rx_ops || !roam_rx_ops->roam_sync_frame_event) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
status = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
qdf_status = roam_rx_ops->roam_sync_frame_event(psoc,
|
||||
frame_ind_ptr);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
status = -EINVAL;
|
||||
|
||||
err:
|
||||
qdf_mem_free(frame_ind_ptr);
|
||||
return status;
|
||||
}
|
||||
|
||||
int target_if_cm_roam_sync_event(ol_scn_t scn, uint8_t *event,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS qdf_status;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_cm_roam_rx_ops *roam_rx_ops;
|
||||
int status = 0;
|
||||
uint8_t vdev_id;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
status = wmi_extract_roam_sync_event(wmi_handle, event,
|
||||
len, &vdev_id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("parsing of event failed, %d", status);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc);
|
||||
|
||||
if (!roam_rx_ops || !roam_rx_ops->roam_sync_event) {
|
||||
target_if_err("No valid roam rx ops");
|
||||
status = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
qdf_status = roam_rx_ops->roam_sync_event(psoc,
|
||||
event,
|
||||
len,
|
||||
vdev_id);
|
||||
|
||||
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)
|
||||
{
|
||||
QDF_STATUS ret;
|
||||
wmi_unified_t handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!handle) {
|
||||
target_if_err("handle is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/* Register for roam offload event */
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_roam_synch_event_id,
|
||||
target_if_cm_roam_sync_event,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event registration failed, ret: %d", ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/* Register for roam offload event */
|
||||
ret = wmi_unified_register_event_handler(handle,
|
||||
wmi_roam_synch_frame_event_id,
|
||||
target_if_cm_roam_sync_frame_event,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
target_if_err("wmi event registration failed, ret: %d", ret);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user