qcacmn: Add support to initiate PASN authentication request

Register OSIF callbacks with Wifi_pos module to initiate PASN
authentication request.

Call cfg80211_pasn_auth_request() to initiate PASN authentication
from wpa_supplicant for the list of secure peers.

Change-Id: I52b9518526f1b04ad520f2f19c7a4caa9b62b6b0
CRs-Fixed: 3149968
このコミットが含まれているのは:
Pragaspathi Thilagaraj
2022-06-15 18:35:54 +05:30
committed by Madan Koyyalamudi
コミット 957b6d2307
8個のファイルの変更353行の追加19行の削除

ファイルの表示

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012-2017, 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
@@ -25,7 +26,8 @@
#include "qdf_types.h"
#include "qdf_status.h"
#include <wlan_objmgr_cmn.h>
#include "wifi_pos_public_struct.h"
/* forward declaration */
struct wifi_pos_ch_info;
@@ -283,4 +285,30 @@ enum cld80211_sub_attr_peer_info {
CLD80211_SUB_ATTR_PEER_AFTER_LAST - 1
};
#endif
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
/**
* os_if_wifi_pos_initiate_pasn_auth() - Initiate PASN authentication from
* userspace
* @vdev: Vdev object pointer
* @pasn_peer: PASN Peer list
* @num_pasn_peers: number of PASN peers
* @is_initiate_pasn: Initiate pasn or initiate flush keys
*
* Return: QDF_STATUS
*/
QDF_STATUS os_if_wifi_pos_initiate_pasn_auth(struct wlan_objmgr_vdev *vdev,
struct wlan_pasn_request *pasn_peer,
uint8_t num_pasn_peers,
bool is_initiate_pasn);
#else
static inline
QDF_STATUS os_if_wifi_pos_initiate_pasn_auth(struct wlan_objmgr_vdev *vdev,
struct wlan_pasn_request *pasn_peer,
uint8_t num_pasn_peers,
bool is_initiate_pasn)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif /* WLAN_FEATURE_RTT_11AZ_SUPPORT */
#endif /* _OS_IF_WIFI_POS_H_ */

ファイルの表示

@@ -0,0 +1,72 @@
/*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: os_if_wifi_pos_utils.h
* This file provide declaration of wifi_pos's os_if APIs
*/
#ifndef _OS_IF_WIFI_POS_UTILS_H_
#define _OS_IF_WIFI_POS_UTILS_H_
#include "qdf_types.h"
#include "qdf_status.h"
#include <wlan_objmgr_cmn.h>
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
/**
* struct wifi_pos_osif_ops - Wifi POS osif callbacks
* @osif_initiate_pasn_cb: Callback to initiate PASN authentication
*/
struct wifi_pos_osif_ops {
QDF_STATUS (*osif_initiate_pasn_cb)(struct wlan_objmgr_vdev *vdev,
struct wlan_pasn_request *pasn_peer,
uint8_t num_pasn_peers,
bool is_initiate_pasn);
};
#endif
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
/**
* osif_wifi_pos_register_ops() - Register Wifi-Pos module OS_IF callbacks
* @psoc: Pointer to PSOC obj
*
* Return: QDF_STATUS
*/
QDF_STATUS
osif_wifi_pos_register_ops(struct wlan_objmgr_psoc *psoc);
/**
* osif_wifi_pos_deregister_ops - Deregister the wifi pos OS_IF callbacks
* @psoc: Pointer to PSOC obj
*
* Return: QDF_STATUS
*/
QDF_STATUS
osif_wifi_pos_deregister_ops(struct wlan_objmgr_psoc *psoc);
#else
static inline QDF_STATUS
osif_wifi_pos_register_ops(struct wlan_objmgr_psoc *psoc)
{
return QDF_STATUS_SUCCESS;
}
static inline QDF_STATUS
osif_wifi_pos_deregister_ops(struct wlan_objmgr_psoc *psoc)
{
return QDF_STATUS_SUCCESS;
}
#endif /* WIFI_POS_CONVERGED */
#endif /* _OS_IF_WIFI_POS_UTILS_H_ */

ファイルの表示

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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
@@ -33,6 +33,7 @@
#include "wifi_pos_api.h"
#include "wlan_cfg80211.h"
#include "wlan_objmgr_psoc_obj.h"
#include "wlan_osif_priv.h"
#ifdef CNSS_GENL
#ifdef CONFIG_CNSS_OUT_OF_TREE
#include "cnss_nl.h"
@@ -1083,3 +1084,66 @@ int os_if_wifi_pos_populate_caps(struct wlan_objmgr_psoc *psoc,
return qdf_status_to_os_return(wifi_pos_populate_caps(psoc, caps));
}
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
QDF_STATUS
os_if_wifi_pos_initiate_pasn_auth(struct wlan_objmgr_vdev *vdev,
struct wlan_pasn_request *pasn_peer,
uint8_t num_pasn_peers,
bool is_initiate_pasn)
{
struct net_device *netdev;
struct cfg80211_pasn_params *pasn_params;
struct vdev_osif_priv *osif_priv;
int i, ret;
QDF_STATUS status = QDF_STATUS_SUCCESS;
osif_priv = wlan_vdev_get_ospriv(vdev);
if (!osif_priv) {
osif_err("OSIF priv is NULL");
return QDF_STATUS_E_FAILURE;
}
netdev = osif_priv->wdev->netdev;
pasn_params = qdf_mem_malloc(sizeof(*pasn_params) +
(num_pasn_peers *
sizeof(struct pasn_peer)));
if (!pasn_params)
return QDF_STATUS_E_NOMEM;
pasn_params->action = (is_initiate_pasn ?
NL80211_PASN_ACTION_AUTH : NL80211_PASN_ACTION_DEAUTH);
pasn_params->num_pasn_peers = num_pasn_peers;
for (i = 0; i < num_pasn_peers; i++) {
qdf_mem_copy(pasn_params->peer[i].peer_addr,
pasn_peer[i].peer_mac.bytes,
QDF_MAC_ADDR_SIZE);
qdf_mem_copy(pasn_params->peer[i].src_addr,
pasn_peer[i].self_mac.bytes,
QDF_MAC_ADDR_SIZE);
if (pasn_peer[i].force_self_mac_usage)
pasn_params->peer[i].flags = PASN_PEER_USE_SRC_MAC;
osif_debug("PASN peer_mac[%d]:" QDF_MAC_ADDR_FMT " src_mac:" QDF_MAC_ADDR_FMT,
i,
QDF_MAC_ADDR_REF(pasn_params->peer[i].peer_addr),
QDF_MAC_ADDR_REF(pasn_params->peer[i].src_addr));
}
osif_debug("action:%d num_pasn_peers:%d", pasn_params->action,
pasn_params->num_pasn_peers);
ret = cfg80211_pasn_auth_request(netdev, pasn_params,
qdf_mem_malloc_flags());
if (ret) {
status = qdf_status_from_os_return(ret);
osif_err("PASN Auth request failed");
}
qdf_mem_free(pasn_params);
return status;
}
#endif /* WIFI_POS_CONVERGED && WLAN_FEATURE_RTT_11AZ_SUPPORT */

ファイルの表示

@@ -0,0 +1,44 @@
/*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: os_if_wifi_pos_utils.c
* This file defines the important functions pertinent to wifi positioning
* component's os_if layer.
*/
#include "wlan_objmgr_psoc_obj.h"
#include "os_if_wifi_pos_utils.h"
#include "wifi_pos_ucfg_i.h"
#include "os_if_wifi_pos.h"
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
static struct wifi_pos_osif_ops osif_ops = {
.osif_initiate_pasn_cb = os_if_wifi_pos_initiate_pasn_auth,
};
QDF_STATUS
osif_wifi_pos_register_ops(struct wlan_objmgr_psoc *psoc)
{
return ucfg_wifi_pos_register_osif_callbacks(psoc, &osif_ops);
}
QDF_STATUS
osif_wifi_pos_deregister_ops(struct wlan_objmgr_psoc *psoc)
{
return ucfg_wifi_pos_deregister_osif_callbacks(psoc);
}
#endif