qcacmn: Initialize osif and legacy callbacks for connection manager
Initialize osif callbacks to connection manager and add legacy callbacks to osif and initialize these legacy callbacks for connection manager. Change-Id: Ic3e8bd6f55b6cdbbc8cdd5c9c3a6631e8d3bd83e CRs-Fixed: 2797472
This commit is contained in:

committed by
snandini

orang tua
f2c65a9b4c
melakukan
88efb959a6
@@ -26,7 +26,12 @@
|
||||
|
||||
#include <qca_vendor.h>
|
||||
#include "wlan_cm_ucfg_api.h"
|
||||
#include "wlan_cm_public_struct.h"
|
||||
#ifdef CONN_MGR_ADV_FEATURE
|
||||
#include <cdp_txrx_mob_def.h>
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_CM_ENABLE
|
||||
/**
|
||||
* osif_cm_qca_reason_to_str() - return string conversion of qca reason code
|
||||
* @reason: enum qca_disconnect_reason_codes
|
||||
@@ -104,4 +109,174 @@ void osif_cm_reset_id_and_src_no_lock(struct vdev_osif_priv *osif_priv);
|
||||
*/
|
||||
QDF_STATUS osif_cm_reset_id_and_src(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* enum osif_cb_type - Type of the update from osif to legacy module
|
||||
* @OSIF_POST_USERSPACE_UPDATE: Indicates that when this update is received
|
||||
* userspace is already updated.
|
||||
* @OSIF_PRE_USERSPACE_UPDATE: Indicates that when this update is received
|
||||
* userspace is not yet updated.
|
||||
* @OSIF_NOT_HANDLED: Indicates that last command is not handled
|
||||
*/
|
||||
|
||||
enum osif_cb_type {
|
||||
OSIF_POST_USERSPACE_UPDATE,
|
||||
OSIF_PRE_USERSPACE_UPDATE,
|
||||
OSIF_NOT_HANDLED,
|
||||
};
|
||||
|
||||
/**
|
||||
* typedef osif_cm_connect_comp_cb - Connect complete callback
|
||||
* @vdev: vdev pointer
|
||||
* @rsp: connect response
|
||||
* @type: indicates update type
|
||||
*
|
||||
* This callback indicates connect complete to the legacy module
|
||||
*
|
||||
* Context: Any context.
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
typedef QDF_STATUS
|
||||
(*osif_cm_connect_comp_cb)(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *rsp,
|
||||
enum osif_cb_type type);
|
||||
|
||||
/**
|
||||
* typedef osif_cm_disconnect_comp_cb: Disonnect complete callback
|
||||
* @vdev: vdev pointer
|
||||
* @rsp: disconnect response
|
||||
* @type: indicates update type
|
||||
*
|
||||
* This callback indicates disconnect complete to the legacy module
|
||||
*
|
||||
* Context: Any context.
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
typedef QDF_STATUS
|
||||
(*osif_cm_disconnect_comp_cb)(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_discon_rsp *rsp,
|
||||
enum osif_cb_type type);
|
||||
|
||||
#ifdef CONN_MGR_ADV_FEATURE
|
||||
/**
|
||||
* typedef osif_cm_netif_queue_ctrl_cb: Callback to update netif queue
|
||||
* @vdev: vdev pointer
|
||||
* @action: Action to take on netif queue
|
||||
* @reason: netif reason type
|
||||
*
|
||||
* This callback indicates legacy modules to take the actions related to netif
|
||||
* queue
|
||||
*
|
||||
* Context: Any context.
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
typedef QDF_STATUS
|
||||
(*osif_cm_netif_queue_ctrl_cb)(struct wlan_objmgr_vdev *vdev,
|
||||
enum netif_action_type action,
|
||||
enum netif_reason_type reason);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* osif_cm_ops: connection manager legacy callbacks
|
||||
* osif_cm_connect_comp_cb: callback for connect complete to legacy
|
||||
* modules
|
||||
* osif_cm_disconnect_comp_cb: callback for disconnect complete to
|
||||
* legacy modules
|
||||
* osif_cm_netif_queue_ctrl_cb: callback to legacy module to take
|
||||
* actions on netif queue
|
||||
*/
|
||||
struct osif_cm_ops {
|
||||
osif_cm_connect_comp_cb connect_complete_cb;
|
||||
osif_cm_disconnect_comp_cb disconnect_complete_cb;
|
||||
#ifdef CONN_MGR_ADV_FEATURE
|
||||
osif_cm_netif_queue_ctrl_cb netif_queue_control_cb;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* osif_cm_connect_comp_ind() - Function to indicate connect
|
||||
* complete to legacy module
|
||||
* @vdev: vdev pointer
|
||||
* @rsp: connect response
|
||||
* @type: indicates update type
|
||||
*
|
||||
* This function indicates connect complete to the legacy module
|
||||
*
|
||||
* Context: Any context.
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS osif_cm_connect_comp_ind(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *rsp,
|
||||
enum osif_cb_type type);
|
||||
|
||||
/**
|
||||
* osif_cm_disconnect_comp_ind() - Function to indicate disconnect
|
||||
* complete to legacy module
|
||||
* @vdev: vdev pointer
|
||||
* @rsp: disconnect response
|
||||
* @type: indicates update type
|
||||
*
|
||||
* This function indicates disconnect complete to the legacy module
|
||||
*
|
||||
* Context: Any context.
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS osif_cm_disconnect_comp_ind(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_discon_rsp *rsp,
|
||||
enum osif_cb_type type);
|
||||
|
||||
#ifdef CONN_MGR_ADV_FEATURE
|
||||
/**
|
||||
* osif_cm_netif_queue_ind() - Function to indicate netif queue update
|
||||
* complete to legacy module
|
||||
* @vdev: vdev pointer
|
||||
* @action: Action to take on netif queue
|
||||
* @reason: netif reason type
|
||||
*
|
||||
* This function indicates to take the actions related to netif queue
|
||||
*
|
||||
* Context: Any context.
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS osif_cm_netif_queue_ind(struct wlan_objmgr_vdev *vdev,
|
||||
enum netif_action_type action,
|
||||
enum netif_reason_type reason);
|
||||
#endif
|
||||
/**
|
||||
* osif_cm_set_legacy_cb() - Sets legacy callbacks to osif
|
||||
* @osif_legacy_ops: Function pointer to legacy ops structure
|
||||
*
|
||||
* API to set legacy callbacks to osif
|
||||
* Context: Any context.
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void osif_cm_set_legacy_cb(struct osif_cm_ops *osif_legacy_ops);
|
||||
|
||||
/**
|
||||
* osif_cm_reset_legacy_cb() - Resets legacy callbacks to osif
|
||||
*
|
||||
* API to reset legacy callbacks to osif
|
||||
* Context: Any context.
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void osif_cm_reset_legacy_cb(void);
|
||||
|
||||
#else
|
||||
static inline QDF_STATUS osif_cm_osif_priv_init(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS osif_cm_osif_priv_deinit(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS osif_cm_register_cb(void)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __OSIF_CM_UTIL_H */
|
||||
|
@@ -443,10 +443,14 @@ QDF_STATUS osif_connect_handler(struct wlan_objmgr_vdev *vdev,
|
||||
rsp->reason, rsp->reason_code);
|
||||
|
||||
status = osif_validate_connect_and_reset_src_id(osif_priv, rsp->cm_id);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
osif_cm_connect_comp_ind(vdev, rsp, OSIF_NOT_HANDLED);
|
||||
return status;
|
||||
}
|
||||
|
||||
osif_cm_connect_comp_ind(vdev, rsp, OSIF_PRE_USERSPACE_UPDATE);
|
||||
osif_indcate_connect_results(vdev, osif_priv, rsp);
|
||||
osif_cm_connect_comp_ind(vdev, rsp, OSIF_POST_USERSPACE_UPDATE);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
@@ -140,16 +140,20 @@ QDF_STATUS osif_disconnect_handler(struct wlan_objmgr_vdev *vdev,
|
||||
osif_cm_qca_reason_to_str(osif_priv->cm_info.last_disconnect_reason));
|
||||
|
||||
status = osif_validate_disconnect_and_reset_src_id(osif_priv, rsp);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
osif_cm_disconnect_comp_ind(vdev, rsp, OSIF_NOT_HANDLED);
|
||||
return status;
|
||||
}
|
||||
|
||||
if (rsp->req.req.source == CM_PEER_DISCONNECT)
|
||||
locally_generated = false;
|
||||
|
||||
osif_cm_disconnect_comp_ind(vdev, rsp, OSIF_PRE_USERSPACE_UPDATE);
|
||||
osif_cm_indicate_disconnect(osif_priv->wdev->netdev, ieee80211_reason,
|
||||
locally_generated, rsp->ap_discon_ie.ptr,
|
||||
rsp->ap_discon_ie.len, GFP_KERNEL);
|
||||
|
||||
osif_cm_disconnect_comp_ind(vdev, rsp, OSIF_POST_USERSPACE_UPDATE);
|
||||
qdf_event_set(&osif_priv->cm_info.disconnect_complete);
|
||||
|
||||
return status;
|
||||
|
@@ -26,6 +26,8 @@
|
||||
#include "wlan_cfg80211.h"
|
||||
#include "osif_cm_rsp.h"
|
||||
|
||||
static struct osif_cm_ops *osif_cm_legacy_ops;
|
||||
|
||||
const char *
|
||||
osif_cm_qca_reason_to_str(enum qca_disconnect_reason_codes reason)
|
||||
{
|
||||
@@ -217,6 +219,21 @@ osif_cm_disconnect_complete_cb(struct wlan_objmgr_vdev *vdev,
|
||||
return osif_disconnect_handler(vdev, rsp);
|
||||
}
|
||||
|
||||
#ifdef CONN_MGR_ADV_FEATURE
|
||||
static QDF_STATUS
|
||||
osif_cm_disable_netif_queue(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
return osif_cm_netif_queue_ind(vdev,
|
||||
WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER,
|
||||
WLAN_CONTROL_PATH);
|
||||
}
|
||||
#else
|
||||
static inline QDF_STATUS
|
||||
osif_cm_disable_netif_queue(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* osif_cm_disconnect_start_cb() - Disconnect start callback
|
||||
* @vdev: vdev pointer
|
||||
@@ -229,7 +246,8 @@ osif_cm_disconnect_complete_cb(struct wlan_objmgr_vdev *vdev,
|
||||
static QDF_STATUS
|
||||
osif_cm_disconnect_start_cb(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
/* Disable netif queue on disconnect start */
|
||||
return osif_cm_disable_netif_queue(vdev);
|
||||
}
|
||||
|
||||
static struct mlme_cm_ops cm_ops = {
|
||||
@@ -305,3 +323,61 @@ QDF_STATUS osif_cm_osif_priv_deinit(struct wlan_objmgr_vdev *vdev)
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS osif_cm_connect_comp_ind(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_rsp *rsp,
|
||||
enum osif_cb_type type)
|
||||
{
|
||||
osif_cm_connect_comp_cb cb = NULL;
|
||||
QDF_STATUS ret = QDF_STATUS_SUCCESS;
|
||||
|
||||
if (osif_cm_legacy_ops)
|
||||
cb = osif_cm_legacy_ops->connect_complete_cb;
|
||||
if (cb)
|
||||
ret = cb(vdev, rsp, type);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
QDF_STATUS osif_cm_disconnect_comp_ind(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_discon_rsp *rsp,
|
||||
enum osif_cb_type type)
|
||||
{
|
||||
osif_cm_disconnect_comp_cb cb = NULL;
|
||||
QDF_STATUS ret = QDF_STATUS_SUCCESS;
|
||||
|
||||
if (osif_cm_legacy_ops)
|
||||
cb = osif_cm_legacy_ops->disconnect_complete_cb;
|
||||
if (cb)
|
||||
ret = cb(vdev, rsp, type);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONN_MGR_ADV_FEATURE
|
||||
QDF_STATUS osif_cm_netif_queue_ind(struct wlan_objmgr_vdev *vdev,
|
||||
enum netif_action_type action,
|
||||
enum netif_reason_type reason)
|
||||
{
|
||||
osif_cm_netif_queue_ctrl_cb cb = NULL;
|
||||
QDF_STATUS ret = QDF_STATUS_SUCCESS;
|
||||
|
||||
if (osif_cm_legacy_ops)
|
||||
cb = osif_cm_legacy_ops->netif_queue_control_cb;
|
||||
if (cb)
|
||||
ret = cb(vdev, action, reason);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
void osif_cm_set_legacy_cb(struct osif_cm_ops *osif_legacy_ops)
|
||||
{
|
||||
osif_cm_legacy_ops = osif_legacy_ops;
|
||||
}
|
||||
|
||||
void osif_cm_reset_legacy_cb(void)
|
||||
{
|
||||
osif_cm_legacy_ops = NULL;
|
||||
}
|
||||
|
||||
|
@@ -618,7 +618,7 @@ cm_inform_blm_connect_complete(struct wlan_objmgr_vdev *vdev,
|
||||
|
||||
static inline
|
||||
bool cm_is_retry_with_same_candidate(struct cnx_mgr *cm_ctx,
|
||||
struct cm_connect_req req,
|
||||
struct cm_connect_req *req,
|
||||
struct wlan_cm_connect_rsp *resp)
|
||||
{
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user