qcacmn: Move disconnect wait logic from osif to connection mgr
Move disconnect wait logic from osif to connection mgr, so that MLO/IF manager can use the wait logic for disconnect during vdev delete. Change-Id: Ied2bbcfd6a532209f8008499424f94acc41efc0e CRs-Fixed: 2800990
This commit is contained in:

committed by
snandini

parent
abb7d72f97
commit
b8b58d8d12
@@ -160,7 +160,6 @@ QDF_STATUS osif_disconnect_handler(struct wlan_objmgr_vdev *vdev,
|
||||
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;
|
||||
}
|
||||
|
@@ -489,31 +489,12 @@ int osif_cm_disconnect(struct net_device *dev, struct wlan_objmgr_vdev *vdev,
|
||||
int osif_cm_disconnect_sync(struct wlan_objmgr_vdev *vdev, uint16_t reason)
|
||||
{
|
||||
uint8_t vdev_id = wlan_vdev_get_id(vdev);
|
||||
struct vdev_osif_priv *osif_priv = wlan_vdev_get_ospriv(vdev);
|
||||
QDF_STATUS status;
|
||||
|
||||
if (ucfg_cm_is_vdev_disconnected(vdev))
|
||||
return 0;
|
||||
|
||||
if (!osif_priv) {
|
||||
osif_err("vdev %d invalid vdev osif priv", vdev_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
osif_info("vdevid-%d: Received Disconnect reason:%d %s",
|
||||
vdev_id, reason, ucfg_cm_reason_code_to_str(reason));
|
||||
|
||||
qdf_event_reset(&osif_priv->cm_info.disconnect_complete);
|
||||
status = osif_cm_send_disconnect(vdev, reason);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
osif_err("Disconnect failed with status %d", status);
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
status = qdf_wait_single_event(&osif_priv->cm_info.disconnect_complete,
|
||||
CM_DISCONNECT_CMD_TIMEOUT);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
osif_err("Disconnect timeout with status %d", status);
|
||||
status = ucfg_cm_disconnect_sync(vdev, CM_OSIF_DISCONNECT, reason);
|
||||
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
@@ -337,7 +337,6 @@ QDF_STATUS osif_cm_osif_priv_init(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
struct vdev_osif_priv *osif_priv = wlan_vdev_get_ospriv(vdev);
|
||||
enum QDF_OPMODE mode = wlan_vdev_mlme_get_opmode(vdev);
|
||||
QDF_STATUS status;
|
||||
|
||||
if (mode != QDF_STA_MODE && mode != QDF_P2P_CLIENT_MODE)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
@@ -349,19 +348,7 @@ QDF_STATUS osif_cm_osif_priv_init(struct wlan_objmgr_vdev *vdev)
|
||||
|
||||
qdf_spinlock_create(&osif_priv->cm_info.cmd_id_lock);
|
||||
|
||||
status = qdf_event_create(&osif_priv->cm_info.disconnect_complete);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
osif_err("failed to create disconnect complete event fro vdev %d",
|
||||
wlan_vdev_get_id(vdev));
|
||||
goto event_create_fail;
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
event_create_fail:
|
||||
qdf_spinlock_destroy(&osif_priv->cm_info.cmd_id_lock);
|
||||
|
||||
return status;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS osif_cm_osif_priv_deinit(struct wlan_objmgr_vdev *vdev)
|
||||
@@ -376,7 +363,6 @@ QDF_STATUS osif_cm_osif_priv_deinit(struct wlan_objmgr_vdev *vdev)
|
||||
osif_err("Invalid vdev osif priv");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
qdf_event_destroy(&osif_priv->cm_info.disconnect_complete);
|
||||
qdf_spinlock_destroy(&osif_priv->cm_info.cmd_id_lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#define _WLAN_OSIF_PRIV_H_
|
||||
|
||||
#include "qdf_net_if.h"
|
||||
#include <qdf_event.h>
|
||||
#include "wlan_cm_public_struct.h"
|
||||
#include <qca_vendor.h>
|
||||
|
||||
@@ -50,7 +49,6 @@ struct pdev_osif_priv {
|
||||
* @cmd_id_lock: lock to update and read last command source
|
||||
* @last_disconnect_reason: last disconnect reason to be indicated in get
|
||||
* station
|
||||
* @disconnect_complete: disconnect completion wait event
|
||||
* @ext_priv: legacy data pointer.
|
||||
*/
|
||||
struct osif_cm_info {
|
||||
@@ -58,7 +56,6 @@ struct osif_cm_info {
|
||||
wlan_cm_id last_id;
|
||||
struct qdf_spinlock cmd_id_lock;
|
||||
enum qca_disconnect_reason_codes last_disconnect_reason;
|
||||
qdf_event_t disconnect_complete;
|
||||
void *ext_priv;
|
||||
};
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user