Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 191d7b54 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 17e22b53 on remote branch

Change-Id: I35d9cc1a91f4ba56b0aba41a3904abd7eb9a00a1
parents 4f066723 17e22b53
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-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
@@ -5792,6 +5792,7 @@ static inline void dp_peer_delete_ast_entries(struct dp_soc *soc,
{
	struct dp_ast_entry *ast_entry, *temp_ast_entry;

	dp_debug("peer: %pK, self_ast: %pK", peer, peer->self_ast_entry);
	DP_PEER_ITERATE_ASE_LIST(peer, ast_entry, temp_ast_entry)
		dp_peer_del_ast(soc, ast_entry);

+17 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-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
@@ -286,6 +286,9 @@ static inline void dp_peer_ast_cleanup(struct dp_soc *soc,
	txrx_ast_free_cb cb = ast->callback;
	void *cookie = ast->cookie;

	dp_debug("mac_addr: " QDF_MAC_ADDR_FMT ", cb: %pK, cookie: %pK",
		 QDF_MAC_ADDR_REF(ast->mac_addr.raw), cb, cookie);

	/* Call the callbacks to free up the cookie */
	if (cb) {
		ast->callback = NULL;
@@ -314,6 +317,8 @@ static void dp_peer_ast_hash_detach(struct dp_soc *soc)
	if (!soc->ast_hash.bins)
		return;

	dp_debug("%pK: num_ast_entries: %u", soc, soc->num_ast_entries);

	qdf_spin_lock_bh(&soc->ast_lock);
	for (index = 0; index <= soc->ast_hash.mask; index++) {
		if (!TAILQ_EMPTY(&soc->ast_hash.bins[index])) {
@@ -390,6 +395,9 @@ void dp_peer_ast_hash_remove(struct dp_soc *soc,
	/* Check if tail is not empty before delete*/
	QDF_ASSERT(!TAILQ_EMPTY(&soc->ast_hash.bins[index]));

	dp_debug("ast_idx: %u idx: %u mac_addr: " QDF_MAC_ADDR_FMT,
		 ase->ast_idx, index, QDF_MAC_ADDR_REF(ase->mac_addr.raw));

	TAILQ_FOREACH(tmpase, &soc->ast_hash.bins[index], hash_list_elem) {
		if (tmpase == ase) {
			found = 1;
@@ -881,6 +889,10 @@ void dp_peer_free_ast_entry(struct dp_soc *soc,
	 * NOTE: Ensure that call to this API is done
	 * after soc->ast_lock is taken
	 */
	dp_debug("type: %d ast_idx: %u mac_addr: " QDF_MAC_ADDR_FMT,
		 ast_entry->type, ast_entry->ast_idx,
		 QDF_MAC_ADDR_REF(ast_entry->mac_addr.raw));

	ast_entry->callback = NULL;
	ast_entry->cookie = NULL;

@@ -946,6 +958,10 @@ void dp_peer_del_ast(struct dp_soc *soc, struct dp_ast_entry *ast_entry)
	if (ast_entry->delete_in_progress)
		return;

	dp_debug("call by %ps: ast_idx: %u mac_addr: " QDF_MAC_ADDR_FMT,
		 (void *)_RET_IP_, ast_entry->ast_idx,
		 QDF_MAC_ADDR_REF(ast_entry->mac_addr.raw));

	ast_entry->delete_in_progress = true;

	peer = ast_entry->peer;
+27 −0
Original line number Diff line number Diff line
@@ -416,6 +416,16 @@ static QDF_STATUS dispatcher_deinit_crypto(void)
{
	return wlan_crypto_deinit();
}

static QDF_STATUS dispatcher_crypto_psoc_enable(struct wlan_objmgr_psoc *psoc)
{
	return wlan_crypto_psoc_enable(psoc);
}

static QDF_STATUS dispatcher_crypto_psoc_disable(struct wlan_objmgr_psoc *psoc)
{
	return wlan_crypto_psoc_disable(psoc);
}
#else
static QDF_STATUS dispatcher_init_crypto(void)
{
@@ -426,6 +436,16 @@ static QDF_STATUS dispatcher_deinit_crypto(void)
{
	return QDF_STATUS_SUCCESS;
}

static QDF_STATUS dispatcher_crypto_psoc_enable(struct wlan_objmgr_psoc *psoc)
{
	return QDF_STATUS_SUCCESS;
}

static QDF_STATUS dispatcher_crypto_psoc_disable(struct wlan_objmgr_psoc *psoc)
{
	return QDF_STATUS_SUCCESS;
}
#endif /* END of WLAN_CONV_CRYPTO_SUPPORTED */

#ifdef WIFI_POS_CONVERGED
@@ -1055,12 +1075,17 @@ QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc)
	if (QDF_STATUS_SUCCESS != dispatcher_dbr_psoc_enable(psoc))
		goto dbr_psoc_enable_fail;

	if (QDF_STATUS_SUCCESS != dispatcher_crypto_psoc_enable(psoc))
		goto crypto_psoc_enable_fail;

	if (QDF_STATUS_SUCCESS != wlan_mlme_psoc_enable(psoc))
		goto mlme_psoc_enable_fail;

	return QDF_STATUS_SUCCESS;

mlme_psoc_enable_fail:
	dispatcher_crypto_psoc_disable(psoc);
crypto_psoc_enable_fail:
	dispatcher_dbr_psoc_disable(psoc);
dbr_psoc_enable_fail:
	fd_psoc_disable(psoc);
@@ -1087,6 +1112,8 @@ QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc)
{
	QDF_BUG(QDF_STATUS_SUCCESS == wlan_mlme_psoc_disable(psoc));

	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_crypto_psoc_disable(psoc));

	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_dbr_psoc_disable(psoc));

	QDF_BUG(QDF_STATUS_SUCCESS == fd_psoc_disable(psoc));
+4 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2019,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
@@ -65,10 +65,12 @@ int wlan_cfg80211_store_key(struct wlan_objmgr_vdev *vdev,
 * @vdev: vdev object
 * @key_type: denotes if the add key request is for pairwise or group key
 * @key_index: Index of the key that needs to be added
 * @sync: flag to indicate whether or not to add key synchronously.
 *  DO NOT set to true if it's in scheduler context.
 *
 * Return: Zero on Success, negative value on failure
 */
int wlan_cfg80211_crypto_add_key(struct wlan_objmgr_vdev *vdev,
				 enum wlan_crypto_key_type key_type,
				 uint8_t key_index);
				 uint8_t key_index, bool sync);
#endif
+72 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2019-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
@@ -23,10 +23,15 @@
#include <wlan_crypto_global_api.h>
#include <wlan_objmgr_vdev_obj.h>
#include <wlan_crypto_main_i.h>
#include <wlan_objmgr_pdev_obj.h>
#include <wlan_objmgr_peer_obj.h>
#include <wlan_crypto_def_i.h>
#include <wlan_crypto_obj_mgr_i.h>
#include <net/cfg80211.h>
#include <wlan_nl_to_crypto_params.h>
#include "wlan_cfg80211_crypto.h"
#include <wlan_cfg80211.h>
#include <wlan_osif_request_manager.h>

static void wlan_cfg80211_translate_key(struct wlan_objmgr_vdev *vdev,
					uint8_t key_index,
@@ -134,19 +139,83 @@ int wlan_cfg80211_store_key(struct wlan_objmgr_vdev *vdev,
	return 0;
}

#define WLAN_WAIT_TIME_ADD_KEY 100

static void
wlan_cfg80211_crypto_add_key_cb(void *context,
				struct crypto_add_key_result *result)
{
	struct osif_request *request;
	struct crypto_add_key_result *priv;

	request = osif_request_get(context);
	if (!request) {
		osif_err("Obsolete request");
		return;
	}

	priv = osif_request_priv(request);
	qdf_mem_copy(priv, result, sizeof(*priv));
	osif_request_complete(request);
	osif_request_put(request);
}

int wlan_cfg80211_crypto_add_key(struct wlan_objmgr_vdev *vdev,
				 enum wlan_crypto_key_type key_type,
				 uint8_t key_index)
				 uint8_t key_index, bool sync)
{
	struct wlan_crypto_key *crypto_key;
	QDF_STATUS status;
	struct osif_request *request;
	struct crypto_add_key_result *result;
	struct wlan_crypto_comp_priv *priv;
	int ret;
	static const struct osif_request_params params = {
		.priv_size = sizeof(*result),
		.timeout_ms = WLAN_WAIT_TIME_ADD_KEY,
	};

	crypto_key = wlan_crypto_get_key(vdev, key_index);
	if (!crypto_key) {
		osif_err("Crypto KEY is NULL");
		return -EINVAL;
	}

	if (sync) {
		priv = wlan_get_vdev_crypto_obj(vdev);
		if (!priv) {
			osif_err("Invalid crypto_priv");
			return -EINVAL;
		}

		request = osif_request_alloc(&params);
		if (!request) {
			osif_err("Request allocation failure");
			return -ENOMEM;
		}

		priv->add_key_ctx = osif_request_cookie(request);;
		priv->add_key_cb = wlan_cfg80211_crypto_add_key_cb;

		status  = ucfg_crypto_set_key_req(vdev, crypto_key, key_type);
		if (QDF_IS_STATUS_SUCCESS(status)) {
			ret = osif_request_wait_for_response(request);
			if (ret) {
				osif_err("Target response timed out");
			} else {
				result = osif_request_priv(request);
				osif_debug("complete, vdev_id %u, ix: %u, flags: %u, status: %u",
					   result->vdev_id, result->key_ix,
					   result->key_flags, result->status);
			}
		}

		priv->add_key_ctx = NULL;
		priv->add_key_cb = NULL;
		osif_request_put(request);
	} else {
		status  = ucfg_crypto_set_key_req(vdev, crypto_key, key_type);
	}

	return qdf_status_to_os_return(status);
}
Loading