qcacmn: Reset auth type for partner link connect request
Currently ML secure connection is failing for second link at STA. This is because, auth type is not proper in connect request crypto params. Hence failed to get the partner scan entry with matching auth type. To resolve this, reset auth type while preparing partner link connect request. Change-Id: Ic291ad4e4405ea2f625c1e47d052166eba21036b CRs-Fixed: 3040789
This commit is contained in:

کامیت شده توسط
Madan Koyyalamudi

والد
c180315712
کامیت
8c5f682d9d
@@ -24,6 +24,7 @@
|
||||
#include "wlan_mlo_mgr_main.h"
|
||||
#include <wlan_mlo_mgr_ap.h>
|
||||
#include <wlan_mlo_mgr_peer.h>
|
||||
#include <wlan_cm_public_struct.h>
|
||||
|
||||
static void mlo_global_ctx_deinit(void)
|
||||
{
|
||||
@@ -297,6 +298,7 @@ static QDF_STATUS mlo_dev_ctx_deinit(struct wlan_objmgr_vdev *vdev)
|
||||
struct qdf_mac_addr *mld_addr;
|
||||
struct mlo_mgr_context *g_mlo_ctx = wlan_objmgr_get_mlo_ctx();
|
||||
uint8_t id = 0;
|
||||
struct wlan_cm_connect_req *connect_req;
|
||||
|
||||
mld_addr = (struct qdf_mac_addr *)wlan_vdev_mlme_get_mldaddr(vdev);
|
||||
ml_dev = wlan_mlo_get_mld_ctx_by_mldaddr(mld_addr);
|
||||
@@ -331,9 +333,19 @@ static QDF_STATUS mlo_dev_ctx_deinit(struct wlan_objmgr_vdev *vdev)
|
||||
qdf_list_remove_node(&g_mlo_ctx->ml_dev_list,
|
||||
&ml_dev->node);
|
||||
if (wlan_vdev_mlme_get_opmode(vdev) == QDF_STA_MODE) {
|
||||
if (ml_dev->sta_ctx->connect_req)
|
||||
qdf_mem_free(ml_dev->sta_ctx->connect_req);
|
||||
connect_req = ml_dev->sta_ctx->connect_req;
|
||||
if (connect_req) {
|
||||
if (connect_req->scan_ie.ptr) {
|
||||
qdf_mem_free(connect_req->scan_ie.ptr);
|
||||
connect_req->scan_ie.ptr = NULL;
|
||||
}
|
||||
|
||||
if (connect_req->assoc_ie.ptr) {
|
||||
qdf_mem_free(connect_req->assoc_ie.ptr);
|
||||
connect_req->assoc_ie.ptr = NULL;
|
||||
}
|
||||
qdf_mem_free(ml_dev->sta_ctx->connect_req);
|
||||
}
|
||||
if (ml_dev->sta_ctx->assoc_rsp.ptr)
|
||||
qdf_mem_free(ml_dev->sta_ctx->assoc_rsp.ptr);
|
||||
|
||||
|
@@ -42,6 +42,47 @@ static QDF_STATUS mlo_disconnect_no_lock(struct wlan_objmgr_vdev *vdev,
|
||||
enum wlan_cm_source source,
|
||||
enum wlan_reason_code reason_code,
|
||||
struct qdf_mac_addr *bssid);
|
||||
|
||||
static inline void
|
||||
mlo_allocate_and_copy_ies(struct wlan_cm_connect_req *target,
|
||||
struct wlan_cm_connect_req *source)
|
||||
{
|
||||
target->assoc_ie.ptr = NULL;
|
||||
target->scan_ie.ptr = NULL;
|
||||
|
||||
if (source->scan_ie.ptr) {
|
||||
target->scan_ie.ptr = qdf_mem_malloc(source->scan_ie.len);
|
||||
if (!target->scan_ie.ptr)
|
||||
target->scan_ie.len = 0;
|
||||
else
|
||||
qdf_mem_copy(target->scan_ie.ptr,
|
||||
source->scan_ie.ptr, source->scan_ie.len);
|
||||
}
|
||||
|
||||
if (source->assoc_ie.ptr) {
|
||||
target->assoc_ie.ptr = qdf_mem_malloc(source->assoc_ie.len);
|
||||
if (!target->assoc_ie.ptr)
|
||||
target->assoc_ie.len = 0;
|
||||
else
|
||||
qdf_mem_copy(target->assoc_ie.ptr, source->assoc_ie.ptr,
|
||||
source->assoc_ie.len);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
mlo_free_connect_ies(struct wlan_cm_connect_req *connect_req)
|
||||
{
|
||||
if (connect_req->scan_ie.ptr) {
|
||||
qdf_mem_free(connect_req->scan_ie.ptr);
|
||||
connect_req->scan_ie.ptr = NULL;
|
||||
}
|
||||
|
||||
if (connect_req->assoc_ie.ptr) {
|
||||
qdf_mem_free(connect_req->assoc_ie.ptr);
|
||||
connect_req->assoc_ie.ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* mlo_get_assoc_link_vdev - API to get assoc link vdev
|
||||
*
|
||||
@@ -163,11 +204,13 @@ mlo_cm_handle_connect_in_disconnection_state(struct wlan_objmgr_vdev *vdev,
|
||||
sta_ctx->connect_req = qdf_mem_malloc(
|
||||
sizeof(struct wlan_cm_connect_req));
|
||||
|
||||
if (sta_ctx->connect_req)
|
||||
if (sta_ctx->connect_req) {
|
||||
qdf_mem_copy(sta_ctx->connect_req, req,
|
||||
sizeof(struct wlan_cm_connect_req));
|
||||
else
|
||||
mlo_allocate_and_copy_ies(sta_ctx->connect_req, req);
|
||||
} else {
|
||||
mlo_err("Failed to allocate connect req");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -243,6 +286,7 @@ QDF_STATUS mlo_connect(struct wlan_objmgr_vdev *vdev,
|
||||
if (sta_ctx->orig_conn_req) {
|
||||
qdf_mem_copy(sta_ctx->orig_conn_req, req,
|
||||
sizeof(struct wlan_cm_connect_req));
|
||||
mlo_allocate_and_copy_ies(sta_ctx->orig_conn_req, req);
|
||||
} else {
|
||||
mlo_err("Failed to allocate orig connect req");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
@@ -292,7 +336,7 @@ mlo_prepare_and_send_connect(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_mlo_dev_context *mlo_dev_ctx = vdev->mlo_dev_ctx;
|
||||
struct wlan_mlo_sta *sta_ctx = mlo_dev_ctx->sta_ctx;
|
||||
|
||||
mlo_debug("Partner link connect mac:" QDF_MAC_ADDR_FMT "vdev_id:%d",
|
||||
mlo_debug("Partner link connect mac:" QDF_MAC_ADDR_FMT " vdev_id:%d",
|
||||
QDF_MAC_ADDR_REF(wlan_vdev_mlme_get_macaddr(vdev)),
|
||||
wlan_vdev_get_id(vdev));
|
||||
|
||||
@@ -312,23 +356,20 @@ mlo_prepare_and_send_connect(struct wlan_objmgr_vdev *vdev,
|
||||
req.ssid.length = ssid.length;
|
||||
qdf_mem_copy(&req.ssid.ssid, &ssid.ssid, ssid.length);
|
||||
|
||||
req.assoc_ie.len = sta_ctx->orig_conn_req->assoc_ie.len;
|
||||
req.assoc_ie.ptr = qdf_mem_malloc(req.assoc_ie.len);
|
||||
if (req.assoc_ie.ptr) {
|
||||
qdf_mem_copy(req.assoc_ie.ptr,
|
||||
sta_ctx->orig_conn_req->assoc_ie.ptr,
|
||||
req.assoc_ie.len);
|
||||
} else {
|
||||
req.assoc_ie.len = 0;
|
||||
mlo_err("Failed to allocate assoc IE");
|
||||
}
|
||||
mlo_allocate_and_copy_ies(&req, sta_ctx->orig_conn_req);
|
||||
if (!req.assoc_ie.ptr)
|
||||
mlo_err("Failed to allocate assoc IEs");
|
||||
|
||||
if (!req.scan_ie.ptr)
|
||||
mlo_err("Failed to allocate scan IEs");
|
||||
|
||||
/* Reset crypto auth type for partner link.
|
||||
* It will be set based on partner scan cache entry
|
||||
*/
|
||||
req.crypto.auth_type = 0;
|
||||
|
||||
wlan_cm_start_connect(vdev, &req);
|
||||
if (req.assoc_ie.ptr) {
|
||||
qdf_mem_free(req.assoc_ie.ptr);
|
||||
req.assoc_ie.ptr = NULL;
|
||||
req.assoc_ie.len = 0;
|
||||
}
|
||||
mlo_free_connect_ies(&req);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -435,12 +476,20 @@ void mlo_sta_link_connect_notify(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_connect_resp *rsp)
|
||||
{
|
||||
struct wlan_mlo_dev_context *mlo_dev_ctx = vdev->mlo_dev_ctx;
|
||||
struct wlan_mlo_sta *sta_ctx = NULL;
|
||||
|
||||
if (mlo_dev_ctx && wlan_vdev_mlme_is_mlo_vdev(vdev)) {
|
||||
mlo_debug("Vdev: %d", wlan_vdev_get_id(vdev));
|
||||
if (wlan_cm_is_vdev_disconnected(vdev)) {
|
||||
// Connect Failure
|
||||
if (vdev == mlo_get_assoc_link_vdev(mlo_dev_ctx)) {
|
||||
sta_ctx = mlo_dev_ctx->sta_ctx;
|
||||
if (sta_ctx->orig_conn_req) {
|
||||
mlo_free_connect_ies(
|
||||
sta_ctx->orig_conn_req);
|
||||
qdf_mem_free(sta_ctx->orig_conn_req);
|
||||
sta_ctx->orig_conn_req = NULL;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
if (rsp->reason == CM_NO_CANDIDATE_FOUND ||
|
||||
@@ -641,11 +690,13 @@ static QDF_STATUS mlo_disconnect_no_lock(struct wlan_objmgr_vdev *vdev,
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
if (sta_ctx->connect_req) {
|
||||
mlo_free_connect_ies(sta_ctx->connect_req);
|
||||
qdf_mem_free(sta_ctx->connect_req);
|
||||
sta_ctx->connect_req = NULL;
|
||||
}
|
||||
|
||||
if (sta_ctx->orig_conn_req) {
|
||||
mlo_free_connect_ies(sta_ctx->orig_conn_req);
|
||||
qdf_mem_free(sta_ctx->orig_conn_req);
|
||||
sta_ctx->orig_conn_req = NULL;
|
||||
}
|
||||
@@ -687,11 +738,13 @@ QDF_STATUS mlo_disconnect(struct wlan_objmgr_vdev *vdev,
|
||||
sta_ctx = mlo_dev_ctx->sta_ctx;
|
||||
mlo_dev_lock_acquire(mlo_dev_ctx);
|
||||
if (sta_ctx->connect_req) {
|
||||
mlo_free_connect_ies(sta_ctx->connect_req);
|
||||
qdf_mem_free(sta_ctx->connect_req);
|
||||
sta_ctx->connect_req = NULL;
|
||||
}
|
||||
|
||||
if (sta_ctx->orig_conn_req) {
|
||||
mlo_free_connect_ies(sta_ctx->orig_conn_req);
|
||||
qdf_mem_free(sta_ctx->orig_conn_req);
|
||||
sta_ctx->orig_conn_req = NULL;
|
||||
}
|
||||
@@ -738,11 +791,13 @@ QDF_STATUS mlo_sync_disconnect(struct wlan_objmgr_vdev *vdev,
|
||||
if (mlo_dev_ctx && wlan_vdev_mlme_is_mlo_vdev(vdev)) {
|
||||
sta_ctx = mlo_dev_ctx->sta_ctx;
|
||||
if (sta_ctx->connect_req) {
|
||||
mlo_free_connect_ies(sta_ctx->connect_req);
|
||||
qdf_mem_free(sta_ctx->connect_req);
|
||||
sta_ctx->connect_req = NULL;
|
||||
}
|
||||
|
||||
if (sta_ctx->orig_conn_req) {
|
||||
mlo_free_connect_ies(sta_ctx->orig_conn_req);
|
||||
qdf_mem_free(sta_ctx->orig_conn_req);
|
||||
sta_ctx->orig_conn_req = NULL;
|
||||
}
|
||||
@@ -849,6 +904,7 @@ void mlo_sta_link_disconn_notify(struct wlan_objmgr_vdev *vdev,
|
||||
if (sta_ctx->connect_req) {
|
||||
mlo_connect(mlo_get_assoc_link_vdev(mlo_dev_ctx),
|
||||
sta_ctx->connect_req);
|
||||
mlo_free_connect_ies(sta_ctx->connect_req);
|
||||
qdf_mem_free(sta_ctx->connect_req);
|
||||
sta_ctx->connect_req = NULL;
|
||||
}
|
||||
|
مرجع در شماره جدید
Block a user