qcacmn: Support roaming request to connection manager

Add change to support roaming request to connection manager.

Change-Id: I7f580e042522a245fc6a263d0e8f8b32b2f693f7
CRs-Fixed: 2845076
此提交包含在:
Santosh Anbu
2020-12-17 20:01:56 +05:30
提交者 snandini
父節點 d788ea076d
當前提交 45a300ce7b
共有 22 個檔案被更改,包括 737 行新增109 行删除

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2015, 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2015,2020-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -44,12 +44,14 @@
* 0 = hunting-and-pecking loop only
* 1 = hash-to-element only
* 2 = both hunting-and-pecking loop and hash-to-element enabled
* @prev_bssid: Previous bssid in case of roam scenario
*/
struct osif_connect_params {
struct element_info scan_ie;
bool force_rsne_override;
enum dot11_mode_filter dot11mode_filter;
uint8_t sae_pwe;
struct qdf_mac_addr prev_bssid;
};
/**

查看文件

@@ -183,6 +183,22 @@ typedef QDF_STATUS (*osif_cm_set_hlp_data_cb)(struct net_device *dev,
struct wlan_cm_connect_resp *rsp);
#endif
/**
* typedef osif_cm_reassoc_comp_cb - Reassoc complete callback
* @vdev: vdev pointer
* @rsp: Reassoc response
* @type: indicates update type
*
* This callback indicates reassoc complete to the legacy module
*
* Context: Any context.
* Return: QDF_STATUS
*/
typedef QDF_STATUS
(*osif_cm_reassoc_comp_cb)(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_roam_resp *rsp,
enum osif_cb_type type);
/**
* typedef osif_cm_disconnect_comp_cb: Disonnect complete callback
* @vdev: vdev pointer
@@ -249,12 +265,15 @@ void osif_cm_unlink_bss(struct wlan_objmgr_vdev *vdev,
* modules
* osif_cm_disconnect_comp_cb: callback for disconnect complete to
* legacy modules
* osif_cm_reassoc_comp_cb: callback for reassoc 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;
osif_cm_reassoc_comp_cb reassoc_complete_cb;
#ifdef CONN_MGR_ADV_FEATURE
osif_cm_netif_queue_ctrl_cb netif_queue_control_cb;
#endif
@@ -280,6 +299,22 @@ QDF_STATUS osif_cm_connect_comp_ind(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_connect_resp *rsp,
enum osif_cb_type type);
/**
* osif_cm_reassoc_comp_ind() - Function to indicate reassoc
* complete to legacy module
* @vdev: vdev pointer
* @rsp: Roam response
* @type: indicates update type
*
* This function indicates connect complete to the legacy module
*
* Context: Any context.
* Return: QDF_STATUS
*/
QDF_STATUS osif_cm_reassoc_comp_ind(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_roam_resp *rsp,
enum osif_cb_type type);
/**
* osif_cm_disconnect_comp_ind() - Function to indicate disconnect
* complete to legacy module

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2015, 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2015,2020-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -350,6 +350,10 @@ osif_cm_fill_connect_params(struct wlan_cm_connect_req *req,
req->dot11mode_filter = params->dot11mode_filter;
req->force_rsne_override = params->force_rsne_override;
req->sae_pwe = params->sae_pwe;
if (!qdf_is_macaddr_zero((struct qdf_mac_addr *)&params->prev_bssid))
qdf_copy_macaddr(&req->prev_bssid,
(struct qdf_mac_addr *)&params->prev_bssid);
}
static void osif_cm_free_connect_req(struct wlan_cm_connect_req *connect_req)

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2015, 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2015,2020-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -19,3 +19,77 @@
*
* This file maintains definitaions of roam response apis.
*/
#include <linux/version.h>
#include <linux/nl80211.h>
#include <net/cfg80211.h>
#include <wlan_osif_priv.h>
#include "osif_cm_rsp.h"
#include <osif_cm_util.h>
#include <wlan_cfg80211.h>
#include <wlan_cfg80211_scan.h>
static QDF_STATUS
osif_validate_reassoc_and_reset_src_id(struct vdev_osif_priv *osif_priv,
wlan_cm_id cm_id)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
qdf_spinlock_acquire(&osif_priv->cm_info.cmd_id_lock);
if (cm_id != osif_priv->cm_info.last_id) {
osif_debug("Ignore as cm_id(%d) didn't match stored cm_id(%d)",
cm_id, osif_priv->cm_info.last_id);
status = QDF_STATUS_E_INVAL;
goto rel_lock;
}
osif_cm_reset_id_and_src_no_lock(osif_priv);
rel_lock:
qdf_spinlock_release(&osif_priv->cm_info.cmd_id_lock);
return status;
}
#ifdef CONN_MGR_ADV_FEATURE
static void osif_indicate_reassoc_results(struct wlan_objmgr_vdev *vdev,
struct vdev_osif_priv *osif_priv,
struct wlan_cm_roam_resp *rsp)
{
/*
* To notify kernel on connection completion
*/
}
#else
static void osif_indicate_reassoc_results(struct wlan_objmgr_vdev *vdev,
struct vdev_osif_priv *osif_priv,
struct wlan_cm_roam_resp *rsp)
{}
#endif
QDF_STATUS osif_reassoc_handler(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_roam_resp *rsp)
{
struct vdev_osif_priv *osif_priv = wlan_vdev_get_ospriv(vdev);
QDF_STATUS status;
enum wlan_cm_source source;
osif_nofl_info("%s(vdevid-%d): " QDF_MAC_ADDR_FMT " Roam with " QDF_MAC_ADDR_FMT " SSID \"%.*s\" is %s cm_id %d cm_reason %d status_code %d",
osif_priv->wdev->netdev->name, rsp->vdev_id,
QDF_MAC_ADDR_REF(wlan_vdev_mlme_get_macaddr(vdev)),
QDF_MAC_ADDR_REF(rsp->bssid.bytes),
rsp->ssid.length, rsp->ssid.ssid,
rsp->reassoc_status ? "FAILURE" : "SUCCESS", rsp->cm_id,
rsp->reason, rsp->status_code);
source = osif_priv->cm_info.last_source;
status = osif_validate_reassoc_and_reset_src_id(osif_priv, rsp->cm_id);
if (QDF_IS_STATUS_ERROR(status)) {
osif_cm_reassoc_comp_ind(vdev, rsp, OSIF_NOT_HANDLED);
return status;
}
osif_cm_reassoc_comp_ind(vdev, rsp, OSIF_PRE_USERSPACE_UPDATE);
osif_indicate_reassoc_results(vdev, osif_priv, rsp);
osif_cm_reassoc_comp_ind(vdev, rsp, OSIF_POST_USERSPACE_UPDATE);
return QDF_STATUS_SUCCESS;
}

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2015, 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2015,2020-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -56,6 +56,19 @@ QDF_STATUS osif_disconnect_handler(struct wlan_objmgr_vdev *vdev,
QDF_STATUS osif_connect_handler(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_connect_resp *rsp);
/**
* osif_reassoc_handler() - API to send reassoc response to kernel
* @vdev: vdev pointer
* @rsp: Connection manager reassoc response
*
* The API is used to send reassoc response to kernel
*
* Context: Any context.
* Return: QDF_STATUS
*/
QDF_STATUS osif_reassoc_handler(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_roam_resp *rsp);
/**
* osif_failed_candidate_handler() - API to indicate individual candidate
* connect failure resp

查看文件

@@ -198,6 +198,20 @@ osif_cm_connect_complete_cb(struct wlan_objmgr_vdev *vdev,
return osif_connect_handler(vdev, rsp);
}
/**
* osif_cm_reassoc_complete_cb() - Reassoc complete callback
* @vdev: vdev pointer
* @rsp: Reassoc response
*
* Return: QDF_STATUS
*/
static QDF_STATUS
osif_cm_reassoc_complete_cb(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_roam_resp *rsp)
{
return osif_reassoc_handler(vdev, rsp);
}
/**
* osif_cm_failed_candidate_cb() - Callback to indicate failed candidate
* @vdev: vdev pointer
@@ -315,6 +329,7 @@ static struct mlme_cm_ops cm_ops = {
.mlme_cm_update_id_and_src_cb = osif_cm_update_id_and_src_cb,
.mlme_cm_disconnect_complete_cb = osif_cm_disconnect_complete_cb,
.mlme_cm_disconnect_start_cb = osif_cm_disconnect_start_cb,
.mlme_cm_reassoc_complete_cb = osif_cm_reassoc_complete_cb,
};
/**
@@ -384,6 +399,21 @@ QDF_STATUS osif_cm_connect_comp_ind(struct wlan_objmgr_vdev *vdev,
return ret;
}
QDF_STATUS osif_cm_reassoc_comp_ind(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_roam_resp *rsp,
enum osif_cb_type type)
{
osif_cm_reassoc_comp_cb cb = NULL;
QDF_STATUS ret = QDF_STATUS_SUCCESS;
if (osif_cm_legacy_ops)
cb = osif_cm_legacy_ops->reassoc_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)