mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
qcacmn: Add os_if callbacks for connection manager
Add support for osif callbacks for connection manager. Change-Id: Ibe86c94ac86e17f7ac42ad4c62426225f32c382e CRs-Fixed: 2758023
This commit is contained in:
parent
857e8a7579
commit
4fd0241eff
4 changed files with 288 additions and 0 deletions
|
|
@ -24,4 +24,11 @@
|
|||
#ifndef __WLAN_CFG80211_CM_UTIL_H
|
||||
#define __WLAN_CFG80211_CM_UTIL_H
|
||||
|
||||
/**
|
||||
* osif_cm_register_cb() - API to register connection manager
|
||||
* callbacks.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS osif_cm_register_cb(void);
|
||||
#endif /* __WLAN_CFG80211_CM_UTIL_H */
|
||||
|
|
|
|||
|
|
@ -20,3 +20,100 @@
|
|||
* This file maintains definitaions of connect, disconnect, roam
|
||||
* common apis.
|
||||
*/
|
||||
#include <include/wlan_mlme_cmn.h>
|
||||
#include "wlan_cfg80211_cm_util.h"
|
||||
|
||||
/**
|
||||
* osif_cm_connect_complete_cb() - Connect complete callback
|
||||
* @vdev: vdev pointer
|
||||
* @cm_conn_rsp: connect response
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void
|
||||
osif_cm_connect_complete_cb(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *cm_conn_rsp)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* osif_cm_failed_candidate_cb() - Callback to indicate failed candidate
|
||||
* @vdev: vdev pointer
|
||||
* @cm_conn_rsp: connect response
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void
|
||||
osif_cm_failed_candidate_cb(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *cm_conn_rsp)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* osif_cm_update_conn_id_and_src_cb() - Callback to update connect id and
|
||||
* source of the connect request
|
||||
* @vdev: vdev pointer
|
||||
* @Source: Source of the connect req
|
||||
* @conn_id: Connect id
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void
|
||||
osif_cm_update_conn_id_and_src_cb(struct wlan_objmgr_vdev *vdev,
|
||||
enum wlan_cm_source source, uint64_t conn_id)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* osif_cm_disconnect_complete_cb() - Disconnect done callback
|
||||
* @vdev: vdev pointer
|
||||
* @cm_disconnect_rsp: Disconnect response
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
|
||||
static void
|
||||
osif_cm_disconnect_complete_cb(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_discon_rsp *cm_disconnect_rsp)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* osif_cm_disconnect_start_cb() - Disconnect start callback
|
||||
* @vdev: vdev pointer
|
||||
*
|
||||
* This callback indicates os_if that disconnection is started
|
||||
* so that os_if can stop all the activity on this connection
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void
|
||||
osif_cm_disconnect_start_cb(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
}
|
||||
|
||||
static struct mlme_cm_ops cm_ops = {
|
||||
.mlme_cm_connect_complete_cb = osif_cm_connect_complete_cb,
|
||||
.mlme_cm_failed_candidate_cb = osif_cm_failed_candidate_cb,
|
||||
.mlme_cm_update_conn_id_and_src_cb = osif_cm_update_conn_id_and_src_cb,
|
||||
.mlme_cm_disconnect_complete_cb = osif_cm_disconnect_complete_cb,
|
||||
.mlme_cm_disconnect_start_cb = osif_cm_disconnect_start_cb,
|
||||
};
|
||||
|
||||
/**
|
||||
* osif_cm_get_global_ops() - Get connection manager global ops
|
||||
*
|
||||
* Return: Connection manager global ops
|
||||
*/
|
||||
static struct mlme_cm_ops *osif_cm_get_global_ops(void)
|
||||
{
|
||||
return &cm_ops;
|
||||
}
|
||||
|
||||
QDF_STATUS osif_cm_register_cb(void)
|
||||
{
|
||||
mlme_set_osif_cm_cb(osif_cm_get_global_ops);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,49 @@
|
|||
#include "wlan_cm_public_struct.h"
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_CM_ENABLE
|
||||
|
||||
/**
|
||||
* mlme_cm_ops: connection manager callbacks
|
||||
* @mlme_cm_connect_complete_cb: Connect done callback
|
||||
* @vdev: vdev pointer
|
||||
* @cm_conn_rsp: connect response
|
||||
*
|
||||
* @mlme_cm_failed_candidate_cb: Callback to indicate failed candidate
|
||||
* @vdev: vdev pointer
|
||||
* @cm_conn_rsp: connect response
|
||||
*
|
||||
* @mlme_cm_update_conn_id_and_src_cb: Callback to update connect id and
|
||||
* source of the connect request
|
||||
* @vdev: vdev pointer
|
||||
* @Source: Source of the connect req
|
||||
* @conn_id: Connect id
|
||||
*
|
||||
* @mlme_cm_disconnect_complete_cb: Disconnect done callback
|
||||
* @vdev: vdev pointer
|
||||
* @cm_disconnect_rsp: Disconnect response
|
||||
*
|
||||
* @mlme_cm_disconnect_start_cb: Disconnect start callback
|
||||
* @vdev: vdev pointer
|
||||
*/
|
||||
struct mlme_cm_ops {
|
||||
void (*mlme_cm_connect_complete_cb)(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *cm_conn_rsp);
|
||||
void (*mlme_cm_failed_candidate_cb)(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *cm_conn_rsp);
|
||||
void (*mlme_cm_update_conn_id_and_src_cb)(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
enum wlan_cm_source source,
|
||||
uint64_t conn_id);
|
||||
void (*mlme_cm_disconnect_complete_cb)(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_discon_rsp *cm_disconn_rsp);
|
||||
void (*mlme_cm_disconnect_start_cb)(struct wlan_objmgr_vdev *vdev);
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* struct vdev_mlme_ext_ops - VDEV MLME legacy callbacks structure
|
||||
* @mlme_psoc_ext_hdl_create: callback to invoke creation of legacy
|
||||
|
|
@ -458,6 +501,72 @@ QDF_STATUS mlme_cm_ops_ext_osif_disconnect(struct wlan_objmgr_vdev *vdev,
|
|||
*/
|
||||
QDF_STATUS mlme_cm_ext_vdev_down(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* mlme_cm_connect_complete() - Connect response
|
||||
* @vdev: vdev pointer
|
||||
* @cm_conn_rsp: Connect response
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void mlme_cm_connect_complete(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *cm_conn_rsp);
|
||||
|
||||
/**
|
||||
* mlme_cm_failed_candidate() - Failed Candidate indication
|
||||
* @vdev: vdev pointer
|
||||
* @cm_conn_rsp: Connect response
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void mlme_cm_failed_candidate(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *cm_conn_rsp);
|
||||
|
||||
/**
|
||||
* mlme_cm_update_conn_id_and_src() - Update connection id and source
|
||||
* @vdev: vdev pointer
|
||||
* @cm_conn_rsp: Connect response
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void mlme_cm_update_conn_id_and_src(struct wlan_objmgr_vdev *vdev,
|
||||
enum wlan_cm_source source,
|
||||
uint64_t cm_id);
|
||||
|
||||
/**
|
||||
* mlme_cm_disconnect_complete() - Disconnect response
|
||||
* @vdev: vdev pointer
|
||||
* @cm_conn_rsp: Connect response
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void mlme_cm_disconnect_complete(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_discon_rsp *cm_disconn_rsp);
|
||||
|
||||
/**
|
||||
* mlme_cm_disconnect_start() - Disconnect start
|
||||
* @vdev: vdev pointer
|
||||
* @cm_conn_rsp: Connect response
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void mlme_cm_disconnect_start(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* typedef osif_cm_get_global_ops_cb() - Callback to get connection manager
|
||||
* global ops
|
||||
*/
|
||||
typedef struct mlme_cm_ops *(*osif_cm_get_global_ops_cb)(void);
|
||||
|
||||
/**
|
||||
* mlme_set_osif_cm_cb() - Sets ops registration callback
|
||||
* @cm_osif_ops: Function pointer
|
||||
*
|
||||
* API to set ops registration call back
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void mlme_set_osif_cm_cb(osif_cm_get_global_ops_cb cm_osif_ops);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,6 +30,31 @@
|
|||
struct mlme_ext_ops *glbl_ops;
|
||||
mlme_get_global_ops_cb glbl_ops_cb;
|
||||
|
||||
#ifdef FEATURE_CM_ENABLE
|
||||
struct mlme_cm_ops *glbl_cm_ops;
|
||||
osif_cm_get_global_ops_cb glbl_cm_ops_cb;
|
||||
|
||||
static void mlme_cm_ops_init(void)
|
||||
{
|
||||
if (glbl_cm_ops_cb)
|
||||
glbl_cm_ops = glbl_cm_ops_cb();
|
||||
}
|
||||
|
||||
static void mlme_cm_ops_deinit(void)
|
||||
{
|
||||
if (glbl_cm_ops_cb)
|
||||
glbl_cm_ops = NULL;
|
||||
}
|
||||
#else
|
||||
static inline void mlme_cm_ops_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void mlme_cm_ops_deinit(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS wlan_cmn_mlme_init(void)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
|
@ -49,6 +74,8 @@ QDF_STATUS wlan_cmn_mlme_init(void)
|
|||
if (glbl_ops_cb)
|
||||
glbl_ops = glbl_ops_cb();
|
||||
|
||||
mlme_cm_ops_init();
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -68,6 +95,8 @@ QDF_STATUS wlan_cmn_mlme_deinit(void)
|
|||
if (status != QDF_STATUS_SUCCESS)
|
||||
return status;
|
||||
|
||||
mlme_cm_ops_deinit();
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -348,7 +377,53 @@ QDF_STATUS mlme_cm_ext_vdev_down(struct wlan_objmgr_vdev *vdev)
|
|||
ret = glbl_ops->mlme_cm_ext_vdev_down(vdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void mlme_cm_connect_complete(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *rsp)
|
||||
{
|
||||
if (glbl_cm_ops && glbl_cm_ops->mlme_cm_connect_complete_cb)
|
||||
glbl_cm_ops->mlme_cm_connect_complete_cb(vdev, rsp);
|
||||
}
|
||||
|
||||
void mlme_cm_failed_candidate(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *rsp)
|
||||
{
|
||||
if (glbl_cm_ops &&
|
||||
glbl_cm_ops->mlme_cm_failed_candidate_cb)
|
||||
glbl_cm_ops->mlme_cm_failed_candidate_cb(vdev, rsp);
|
||||
}
|
||||
|
||||
void mlme_cm_update_conn_id_and_src(struct wlan_objmgr_vdev *vdev,
|
||||
enum wlan_cm_source source,
|
||||
uint64_t cm_id)
|
||||
{
|
||||
if (glbl_cm_ops &&
|
||||
glbl_cm_ops->mlme_cm_update_conn_id_and_src_cb)
|
||||
glbl_cm_ops->mlme_cm_update_conn_id_and_src_cb(
|
||||
vdev, source, cm_id);
|
||||
}
|
||||
|
||||
void mlme_cm_disconnect_complete(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_discon_rsp *rsp)
|
||||
{
|
||||
if (glbl_cm_ops &&
|
||||
glbl_cm_ops->mlme_cm_disconnect_complete_cb)
|
||||
glbl_cm_ops->mlme_cm_disconnect_complete_cb(vdev, rsp);
|
||||
}
|
||||
|
||||
void mlme_cm_disconnect_start(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
if (glbl_cm_ops &&
|
||||
glbl_cm_ops->mlme_cm_disconnect_start_cb)
|
||||
glbl_cm_ops->mlme_cm_disconnect_start_cb(vdev);
|
||||
}
|
||||
|
||||
void mlme_set_osif_cm_cb(osif_cm_get_global_ops_cb osif_cm_ops)
|
||||
{
|
||||
glbl_cm_ops_cb = osif_cm_ops;
|
||||
}
|
||||
#endif
|
||||
|
||||
void mlme_set_ops_register_cb(mlme_get_global_ops_cb ops_cb)
|
||||
{
|
||||
glbl_ops_cb = ops_cb;
|
||||
|
|
|
|||
Loading…
Reference in a new issue