mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
qcacmn: Init/deinit of mgmt txrx converged component
Initialization/deinitialization of mgmt txrx context, mgmt desc pool, declaration of APIs for sending and receiving mgmt. frames. Change-Id: Icc1f181761721387bcd1f134c937204bfd3b645f CRs-Fixed: 1103247
This commit is contained in:
parent
5d1df0fa51
commit
74782880c8
7 changed files with 1497 additions and 0 deletions
|
|
@ -244,6 +244,7 @@ typedef void (*qdf_timer_func_t)(void *);
|
|||
* @QDF_MODULE_ID_OS_IF: Scheduler OS interface queue module ID
|
||||
* @QDF_MODULE_ID_TARGET_IF: Scheduler target interface queue module ID
|
||||
* @QDF_MODULE_ID_SCHEDULER: Scheduler's module ID
|
||||
* @QDF_MODULE_ID_MGMT_TXRX: MGMT_TXRX module ID
|
||||
* @QDF_MODULE_ID_MAX: Max place holder module ID
|
||||
*
|
||||
* These are generic IDs that identify the various modules in the software
|
||||
|
|
@ -279,6 +280,7 @@ typedef enum {
|
|||
QDF_MODULE_ID_OS_IF = 26,
|
||||
QDF_MODULE_ID_TARGET_IF = 27,
|
||||
QDF_MODULE_ID_SCHEDULER = 28,
|
||||
QDF_MODULE_ID_MGMT_TXRX = 29,
|
||||
QDF_MODULE_ID_MAX
|
||||
} QDF_MODULE_ID;
|
||||
|
||||
|
|
|
|||
153
umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_main.c
Normal file
153
umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_main.c
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
/*
|
||||
* Copyright (c) 2016 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 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: wlan_mgmt_txrx_main.c
|
||||
* This file contains mgmt txrx private API definitions for
|
||||
* mgmt txrx component.
|
||||
*/
|
||||
|
||||
#include "wlan_mgmt_txrx_main_i.h"
|
||||
#include "qdf_nbuf.h"
|
||||
|
||||
QDF_STATUS wlan_mgmt_txrx_desc_pool_init(
|
||||
struct mgmt_txrx_priv_context *mgmt_txrx_ctx,
|
||||
uint32_t pool_size)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
if (!pool_size) {
|
||||
mgmt_txrx_err("Invalid pool size %u given", pool_size);
|
||||
qdf_assert_always(pool_size);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
mgmt_txrx_info("mgmt_txrx ctx: %p psoc: %p, initialize mgmt desc pool of size %d",
|
||||
mgmt_txrx_ctx, mgmt_txrx_ctx->psoc, pool_size);
|
||||
mgmt_txrx_ctx->mgmt_desc_pool.pool = qdf_mem_malloc(pool_size *
|
||||
sizeof(struct mgmt_txrx_desc_elem_t));
|
||||
|
||||
if (!mgmt_txrx_ctx->mgmt_desc_pool.pool) {
|
||||
mgmt_txrx_err("Failed to allocate desc pool");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
qdf_list_create(&mgmt_txrx_ctx->mgmt_desc_pool.free_list, pool_size);
|
||||
|
||||
for (i = 0; i < (pool_size - 1); i++) {
|
||||
mgmt_txrx_ctx->mgmt_desc_pool.pool[i].desc_id = i;
|
||||
mgmt_txrx_ctx->mgmt_desc_pool.pool[i].in_use = false;
|
||||
qdf_list_insert_front(&mgmt_txrx_ctx->mgmt_desc_pool.free_list,
|
||||
&mgmt_txrx_ctx->mgmt_desc_pool.pool[i].entry);
|
||||
}
|
||||
|
||||
qdf_spinlock_create(
|
||||
&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void wlan_mgmt_txrx_desc_pool_deinit(
|
||||
struct mgmt_txrx_priv_context *mgmt_txrx_ctx)
|
||||
{
|
||||
uint8_t i;
|
||||
uint32_t pool_size;
|
||||
QDF_STATUS status;
|
||||
|
||||
qdf_spin_lock_bh(&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
if (!mgmt_txrx_ctx->mgmt_desc_pool.pool) {
|
||||
qdf_spin_unlock_bh(
|
||||
&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
mgmt_txrx_err("Empty mgmt descriptor pool");
|
||||
qdf_assert_always(0);
|
||||
return;
|
||||
}
|
||||
|
||||
pool_size = mgmt_txrx_ctx->mgmt_desc_pool.free_list.max_size;
|
||||
for (i = 0; i < (pool_size - 1); i++) {
|
||||
status = qdf_list_remove_node(
|
||||
&mgmt_txrx_ctx->mgmt_desc_pool.free_list,
|
||||
&mgmt_txrx_ctx->mgmt_desc_pool.pool[i].entry);
|
||||
if (status != QDF_STATUS_SUCCESS)
|
||||
mgmt_txrx_err("Failed to get mgmt descriptor from freelist, desc id: %d with status %d",
|
||||
i, status);
|
||||
}
|
||||
|
||||
qdf_list_destroy(&mgmt_txrx_ctx->mgmt_desc_pool.free_list);
|
||||
qdf_mem_free(mgmt_txrx_ctx->mgmt_desc_pool.pool);
|
||||
mgmt_txrx_ctx->mgmt_desc_pool.pool = NULL;
|
||||
|
||||
qdf_spin_unlock_bh(
|
||||
&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
qdf_spinlock_destroy(
|
||||
&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
}
|
||||
|
||||
struct mgmt_txrx_desc_elem_t *wlan_mgmt_txrx_desc_get(
|
||||
struct mgmt_txrx_priv_context *mgmt_txrx_ctx)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
qdf_list_node_t *desc_node;
|
||||
struct mgmt_txrx_desc_elem_t *mgmt_txrx_desc;
|
||||
|
||||
qdf_spin_lock_bh(&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
if (qdf_list_peek_front(&mgmt_txrx_ctx->mgmt_desc_pool.free_list,
|
||||
&desc_node)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
qdf_spin_unlock_bh(
|
||||
&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
mgmt_txrx_err("mgmt descriptor freelist is empty");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
status = qdf_list_remove_node(&mgmt_txrx_ctx->mgmt_desc_pool.free_list,
|
||||
desc_node);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
qdf_spin_unlock_bh(
|
||||
&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
mgmt_txrx_err("Failed to get mgmt descriptor from freelist with status %d",
|
||||
status);
|
||||
qdf_assert_always(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mgmt_txrx_desc = qdf_container_of(desc_node,
|
||||
struct mgmt_txrx_desc_elem_t,
|
||||
entry);
|
||||
mgmt_txrx_desc->in_use = true;
|
||||
qdf_spin_unlock_bh(&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
|
||||
mgmt_txrx_info("retrieved mgmt desc: %p with desc id: %d",
|
||||
mgmt_txrx_desc, mgmt_txrx_desc->desc_id);
|
||||
return mgmt_txrx_desc;
|
||||
}
|
||||
|
||||
void wlan_mgmt_txrx_desc_put(struct mgmt_txrx_priv_context *mgmt_txrx_ctx,
|
||||
uint32_t desc_id)
|
||||
{
|
||||
struct mgmt_txrx_desc_elem_t *desc;
|
||||
|
||||
desc = &mgmt_txrx_ctx->mgmt_desc_pool.pool[desc_id];
|
||||
qdf_spin_lock_bh(&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
desc->in_use = false;
|
||||
qdf_list_insert_front(&mgmt_txrx_ctx->mgmt_desc_pool.free_list,
|
||||
&desc->entry);
|
||||
qdf_spin_unlock_bh(&mgmt_txrx_ctx->mgmt_desc_pool.desc_pool_lock);
|
||||
|
||||
mgmt_txrx_info("put mgmt desc: %p with desc id: %d into freelist",
|
||||
desc, desc->desc_id);
|
||||
}
|
||||
200
umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_main_i.h
Normal file
200
umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_main_i.h
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
/*
|
||||
* Copyright (c) 2016 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 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.
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_MGMT_TXRX_MAIN_I_H_
|
||||
#define _WLAN_MGMT_TXRX_MAIN_I_H_
|
||||
|
||||
/**
|
||||
* DOC: wlan_mgmt_txrx_main_i.h
|
||||
*
|
||||
* management tx/rx layer private API and structures
|
||||
*
|
||||
*/
|
||||
|
||||
#include "wlan_mgmt_txrx_utils_api.h"
|
||||
#include "wlan_objmgr_cmn.h"
|
||||
#include "qdf_list.h"
|
||||
|
||||
|
||||
/**
|
||||
* struct mgmt_txrx_desc_elem_t - element in mgmt desc pool linked list
|
||||
* @entry: list entry
|
||||
* @tx_dwnld_cmpl_cb: dma completion callback function pointer
|
||||
* @tx_ota_cmpl_cb: ota completion callback function pointer
|
||||
* @nbuf: frame buffer
|
||||
* @desc_id: descriptor id
|
||||
* @peer: peer who wants to send this frame
|
||||
* @context: caller component specific context
|
||||
* @vdev_id: vdev id
|
||||
* @in_use: flag to denote whether desc is in use
|
||||
*/
|
||||
struct mgmt_txrx_desc_elem_t {
|
||||
qdf_list_node_t entry;
|
||||
mgmt_tx_download_comp_cb tx_dwnld_cmpl_cb;
|
||||
mgmt_ota_comp_cb tx_ota_cmpl_cb;
|
||||
qdf_nbuf_t nbuf;
|
||||
uint32_t desc_id;
|
||||
struct wlan_objmgr_peer *peer;
|
||||
void *context;
|
||||
uint8_t vdev_id;
|
||||
bool in_use;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct mgmt_desc_pool_t - linked list mgmt desc pool
|
||||
* @free_list: linked list of free descriptors
|
||||
* @pool: pool of descriptors in use
|
||||
* @desc_pool_lock: mgmt. descriptor free pool spinlock
|
||||
*/
|
||||
struct mgmt_desc_pool_t {
|
||||
qdf_list_t free_list;
|
||||
struct mgmt_txrx_desc_elem_t *pool;
|
||||
qdf_spinlock_t desc_pool_lock;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct mgmt_rx_handler - structure for storing rx cb
|
||||
* @comp_id: component id
|
||||
* @rx_cb: rx callback for the mgmt. frame
|
||||
* @next: pointer to next rx cb structure
|
||||
*/
|
||||
struct mgmt_rx_handler {
|
||||
enum wlan_umac_comp_id comp_id;
|
||||
mgmt_frame_rx_callback rx_cb;
|
||||
struct mgmt_rx_handler *next;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct txrx_stats - txrx stats for mgmt frames
|
||||
* @pkts_success: no. of packets successfully txed/rcvd
|
||||
* @pkts_fail: no. of packets unsuccessfullt txed/rcvd
|
||||
* @bytes_success: no. of bytes successfully txed/rcvd
|
||||
* @bytes_fail: no. of bytes successfully txed/rcvd
|
||||
* @assoc_req_rcvd: no. of assoc requests rcvd
|
||||
* @assoc_rsp_rcvd: no. of assoc responses rcvd
|
||||
* @reassoc_req_rcvd: no. of reassoc requests rcvd
|
||||
* @reassoc_rsp_rcvd: no. of reassoc responses rcvd
|
||||
* @probe_req_rcvd: no. of probe requests rcvd
|
||||
* @prob_resp_rcvd: no. of probe responses rcvd
|
||||
* @beacon_rcvd: no. of beacons rcvd
|
||||
* @atim_rcvd: no. of ATIMs rcvd
|
||||
* @disassoc_rcvd: no. of disassocs rcvd
|
||||
* @auth_rcvd: no. of auths rcvd
|
||||
* @deauth_rcvd: no. of deauths rcvd
|
||||
* @action_rcvd: no. of action frames rcvd
|
||||
* @action_no_ack_rcvd: no. of action frames with no ack rcvd
|
||||
*/
|
||||
struct txrx_stats {
|
||||
uint64_t pkts_success;
|
||||
uint64_t pkts_fail;
|
||||
uint64_t bytes_success;
|
||||
uint64_t bytes_fail;
|
||||
uint64_t assoc_req_rcvd;
|
||||
uint64_t assoc_rsp_rcvd;
|
||||
uint64_t reassoc_req_rcvd;
|
||||
uint64_t reassoc_rsp_rcvd;
|
||||
uint64_t probe_req_rcvd;
|
||||
uint64_t prob_resp_rcvd;
|
||||
uint64_t beacon_rcvd;
|
||||
uint64_t atim_rcvd;
|
||||
uint64_t disassoc_rcvd;
|
||||
uint64_t auth_rcvd;
|
||||
uint64_t deauth_rcvd;
|
||||
uint64_t action_rcvd;
|
||||
uint64_t action_no_ack_rcvd;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct mgmt_txrx_stats_t - mgmt txrx stats
|
||||
* @mgmt_tx_stats: mgmt tx stats
|
||||
* @mgmt_rx_stats: mgmt rx stats
|
||||
* @ota_comp: no. of ota completions rcvd
|
||||
* @dma_comp: no. of dma completions rcvd
|
||||
*/
|
||||
struct mgmt_txrx_stats_t {
|
||||
struct txrx_stats mgmt_tx_stats;
|
||||
struct txrx_stats mgmt_rx_stats;
|
||||
uint64_t ota_comp;
|
||||
uint64_t dma_comp;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct mgmt_txrx_priv_context - mgmt txrx private context
|
||||
* @psoc_context: psoc context
|
||||
* @mgmt_rx_comp_cb: array of pointers of mgmt rx cbs
|
||||
* @mgmt_desc_pool: pointer to mgmt desc. pool
|
||||
* @mgmt_txrx_stats: pointer to mgmt txrx stats
|
||||
*/
|
||||
struct mgmt_txrx_priv_context {
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct mgmt_rx_handler *mgmt_rx_comp_cb[MGMT_MAX_FRAME_TYPE];
|
||||
struct mgmt_desc_pool_t mgmt_desc_pool;
|
||||
struct mgmt_txrx_stats_t *mgmt_txrx_stats;
|
||||
qdf_spinlock_t mgmt_txrx_ctx_lock;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_desc_pool_init() - initializes mgmt. desc. pool
|
||||
* @mgmt_txrx_ctx: mgmt txrx context
|
||||
* @pool_size: desc. pool size
|
||||
*
|
||||
* This function initializes the mgmt descriptor pool.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS wlan_mgmt_txrx_desc_pool_init(
|
||||
struct mgmt_txrx_priv_context *mgmt_txrx_ctx,
|
||||
uint32_t pool_size);
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_desc_pool_deinit() - deinitializes mgmt. desc. pool
|
||||
* @mgmt_txrx_ctx: mgmt txrx context
|
||||
*
|
||||
* This function deinitializes the mgmt descriptor pool.
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void wlan_mgmt_txrx_desc_pool_deinit(
|
||||
struct mgmt_txrx_priv_context *mgmt_txrx_ctx);
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_desc_get() - gets mgmt. descriptor from freelist
|
||||
* @mgmt_txrx_ctx: mgmt txrx context
|
||||
*
|
||||
* This function retrieves the mgmt. descriptor for mgmt. tx frames
|
||||
* from the mgmt. descriptor freelist.
|
||||
*
|
||||
* Return: mgmt. descriptor retrieved.
|
||||
*/
|
||||
struct mgmt_txrx_desc_elem_t *wlan_mgmt_txrx_desc_get(
|
||||
struct mgmt_txrx_priv_context *mgmt_txrx_ctx);
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_desc_put() - puts mgmt. descriptor back in freelist
|
||||
* @mgmt_txrx_ctx: mgmt txrx context
|
||||
* @desc_id: mgmt txrx descriptor id
|
||||
*
|
||||
* This function puts the mgmt. descriptor back in to the freelist.
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void wlan_mgmt_txrx_desc_put(struct mgmt_txrx_priv_context *mgmt_txrx_ctx,
|
||||
uint32_t desc_id);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
* Copyright (c) 2016 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 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.
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_MGMT_TXRX_TGT_API_H_
|
||||
#define _WLAN_MGMT_TXRX_TGT_API_H_
|
||||
|
||||
/**
|
||||
* DOC: wlan_mgmt_txrx_tgt_api.h
|
||||
*
|
||||
* management tx/rx layer public API and structures for
|
||||
* umac southbound interface.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "wlan_objmgr_cmn.h"
|
||||
#include "qdf_nbuf.h"
|
||||
|
||||
|
||||
/**
|
||||
* tgt_mgmt_txrx_rx_frame_handler() - handles rx mgmt. frames
|
||||
* @psoc: psoc context
|
||||
* @buf: buffer
|
||||
* @params: rx event params
|
||||
*
|
||||
* This function handles mgmt. rx frames and is registered to southbound
|
||||
* interface through rx ops.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_mgmt_txrx_rx_frame_handler(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
qdf_nbuf_t buf, void *params);
|
||||
|
||||
/**
|
||||
* tgt_mgmt_txrx_tx_completion_handler() - handles mgmt. tx completions
|
||||
* @psoc: psoc context
|
||||
* @desc_id: mgmt desc. id
|
||||
* @status: status of download of tx packet
|
||||
* @tx_compl_params: tx completion params
|
||||
*
|
||||
* This function handles tx completions of mgmt. frames and is registered to
|
||||
* LMAC_if layer through lmac_if cbs.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS tgt_mgmt_txrx_tx_completion_handler(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t desc_id, uint32_t status,
|
||||
void *tx_compl_params);
|
||||
|
||||
/**
|
||||
* tgt_mgmt_txrx_get_nbuf_from_desc_id() - extracts nbuf from mgmt desc
|
||||
* @psoc: psoc context
|
||||
* @desc_id: desc_id
|
||||
*
|
||||
* This function extracts nbuf from mgmt desc extracted from desc id.
|
||||
*
|
||||
* Return: nbuf - in case of success
|
||||
* NULL - in case of failure
|
||||
*/
|
||||
qdf_nbuf_t tgt_mgmt_txrx_get_nbuf_from_desc_id(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t desc_id);
|
||||
|
||||
/**
|
||||
* tgt_mgmt_txrx_get_peer_from_desc_id() - extracts peer from mgmt desc
|
||||
* @psoc: psoc context
|
||||
* @desc_id: desc_id
|
||||
*
|
||||
* This function extracts peer from mgmt desc extracted from desc id.
|
||||
*
|
||||
* Return: peer - in case of success
|
||||
* NULL - in case of failure
|
||||
*/
|
||||
struct wlan_objmgr_peer *
|
||||
tgt_mgmt_txrx_get_peer_from_desc_id(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t desc_id);
|
||||
|
||||
/**
|
||||
* tgt_mgmt_txrx_get_vdev_id_from_desc_id() - extracts vdev id from mgmt desc
|
||||
* @psoc: psoc context
|
||||
* @desc_id: desc_id
|
||||
*
|
||||
* This function extracts vdev id from mgmt desc extracted from desc id.
|
||||
*
|
||||
* Return: vdev_id - in case of success
|
||||
* 0 - in case of failure
|
||||
*/
|
||||
uint8_t tgt_mgmt_txrx_get_vdev_id_from_desc_id(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t desc_id);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,731 @@
|
|||
/*
|
||||
* Copyright (c) 2016 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 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.
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_MGMT_TXRX_UTILS_API_H_
|
||||
#define _WLAN_MGMT_TXRX_UTILS_API_H_
|
||||
|
||||
/**
|
||||
* DOC: wlan_mgmt_txrx_utils_api.h
|
||||
*
|
||||
* management tx/rx layer public API and structures
|
||||
* for umac converged components.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "wlan_objmgr_cmn.h"
|
||||
#include "qdf_nbuf.h"
|
||||
|
||||
/**
|
||||
* Current HTC credit is 2 so pool size of 50 is sufficient as non
|
||||
* converged code will still be using similar implementation from WMA path
|
||||
*/
|
||||
#define MGMT_DESC_POOL_MAX 50
|
||||
|
||||
#define mgmt_txrx_log(level, args...) \
|
||||
QDF_TRACE(QDF_MODULE_ID_MGMT_TXRX, level, ## args)
|
||||
#define mgmt_txrx_logfl(level, format, args...) \
|
||||
mgmt_txrx_log(level, FL(format), ## args)
|
||||
|
||||
#define mgmt_txrx_alert(format, args...) \
|
||||
mgmt_txrx_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args)
|
||||
#define mgmt_txrx_err(format, args...) \
|
||||
mgmt_txrx_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args)
|
||||
#define mgmt_txrx_warn(format, args...) \
|
||||
mgmt_txrx_logfl(QDF_TRACE_LEVEL_WARN, format, ## args)
|
||||
#define mgmt_txrx_notice(format, args...) \
|
||||
mgmt_txrx_logfl(QDF_TRACE_LEVEL_INFO, format, ## args)
|
||||
#define mgmt_txrx_info(format, args...) \
|
||||
mgmt_txrx_logfl(QDF_TRACE_LEVEL_INFO_HIGH, format, ## args)
|
||||
#define mgmt_txrx_debug(format, args...) \
|
||||
mgmt_txrx_logfl(QDF_TRACE_LEVEL_DEBUG, format, ## args)
|
||||
|
||||
|
||||
/**
|
||||
* enum mgmt_subtype - enum of mgmt. subtypes
|
||||
* @MGMT_SUBTYPE_ASSOC_REQ: association request frame
|
||||
* @MGMT_SUBTYPE_ASSOC_RESP: association response frame
|
||||
* @MGMT_SUBTYPE_REASSOC_REQ: reassociation request frame
|
||||
* @MGMT_SUBTYPE_REASSOC_RESP: reassociation response frame
|
||||
* @MGMT_SUBTYPE_PROBE_REQ: probe request frame
|
||||
* @MGMT_SUBTYPE_PROBE_RESP: probe response frame
|
||||
* @MGMT_SUBTYPE_BEACON: beacon frame
|
||||
* @MGMT_SUBTYPE_ATIM: ATIM frame
|
||||
* @MGMT_SUBTYPE_DISASSOC: disassociation frame
|
||||
* @MGMT_SUBTYPE_AUTH: authentication frame
|
||||
* @MGMT_SUBTYPE_DEAUTH: deauthentication frame
|
||||
* @MGMT_SUBTYPE_ACTION: action frame
|
||||
* @MGMT_SUBTYPE_ACTION_NO_ACK: action no ack frame
|
||||
*/
|
||||
enum mgmt_subtype {
|
||||
MGMT_SUBTYPE_ASSOC_REQ = 0x00,
|
||||
MGMT_SUBTYPE_ASSOC_RESP = 0x10,
|
||||
MGMT_SUBTYPE_REASSOC_REQ = 0x20,
|
||||
MGMT_SUBTYPE_REASSOC_RESP = 0x30,
|
||||
MGMT_SUBTYPE_PROBE_REQ = 0x40,
|
||||
MGMT_SUBTYPE_PROBE_RESP = 0x50,
|
||||
MGMT_SUBTYPE_BEACON = 0x80,
|
||||
MGMT_SUBTYPE_ATIM = 0x90,
|
||||
MGMT_SUBTYPE_DISASSOC = 0xa0,
|
||||
MGMT_SUBTYPE_AUTH = 0xb0,
|
||||
MGMT_SUBTYPE_DEAUTH = 0xc0,
|
||||
MGMT_SUBTYPE_ACTION = 0xd0,
|
||||
MGMT_SUBTYPE_ACTION_NO_ACK = 0xe0,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum mgmt_action_category - mgmt. action categories
|
||||
* @ACTION_CATEGORY_SPECTRUM_MGMT: spectrum mgmt. action category
|
||||
* @ACTION_CATEGORY_QOS: qos action category
|
||||
* @ACTION_CATEGORY_DLS: dls action category
|
||||
* @ACTION_CATEGORY_BACK: block ack action category
|
||||
* @ACTION_CATEGORY_PUBLIC: public action category
|
||||
* @ACTION_CATEGORY_RRM: rrm action category
|
||||
* @ACTION_FAST_BSS_TRNST: trnst action category
|
||||
* @ACTION_CATEGORY_HT: ht actipon category
|
||||
* @ACTION_CATEGORY_SA_QUERY: sa query action category
|
||||
* @ACTION_CATEGORY_PROTECTED_DUAL_OF_PUBLIC_ACTION: protected
|
||||
* public action category
|
||||
* @ACTION_CATEGORY_WNM: wnm action category
|
||||
* @ACTION_CATEGORY_WNM_UNPROTECTED: wnm protected action category
|
||||
* @ACTION_CATEGORY_TDLS: tdls action category
|
||||
* @ACTION_CATEGORY_MESH_ACTION: mesh action category
|
||||
* @ACTION_CATEGORY_MULTIHOP_ACTION: multihop action category
|
||||
* @ACTION_CATEGORY_SELF_PROTECTED: self protected action category
|
||||
* @ACTION_CATEGORY_DMG: unprotected dmg action category
|
||||
* @ACTION_CATEGORY_WMM: wmm action category
|
||||
* @ACTION_CATEGORY_FST: fst action category
|
||||
* @ACTION_CATEGORY_UNPROT_DMG: dmg action category
|
||||
* @ACTION_CATEGORY_VHT: vht action category
|
||||
* @ACTION_CATEGORY_VENDOR_SPECIFIC_PROTECTED: vendor specific protected
|
||||
* action category
|
||||
* @ACTION_CATEGORY_VENDOR_SPECIFIC: vendor specific action category
|
||||
*/
|
||||
enum mgmt_action_category {
|
||||
ACTION_CATEGORY_SPECTRUM_MGMT = 0,
|
||||
ACTION_CATEGORY_QOS = 1,
|
||||
ACTION_CATEGORY_DLS = 2,
|
||||
ACTION_CATEGORY_BACK = 3,
|
||||
ACTION_CATEGORY_PUBLIC = 4,
|
||||
ACTION_CATEGORY_RRM = 5,
|
||||
ACTION_FAST_BSS_TRNST = 6,
|
||||
ACTION_CATEGORY_HT = 7,
|
||||
ACTION_CATEGORY_SA_QUERY = 8,
|
||||
ACTION_CATEGORY_PROTECTED_DUAL_OF_PUBLIC_ACTION = 9,
|
||||
ACTION_CATEGORY_WNM = 10,
|
||||
ACTION_CATEGORY_WNM_UNPROTECTED = 11,
|
||||
ACTION_CATEGORY_TDLS = 12,
|
||||
ACTION_CATEGORY_MESH_ACTION = 13,
|
||||
ACTION_CATEGORY_MULTIHOP_ACTION = 14,
|
||||
ACTION_CATEGORY_SELF_PROTECTED = 15,
|
||||
ACTION_CATEGORY_DMG = 16,
|
||||
ACTION_CATEGORY_WMM = 17,
|
||||
ACTION_CATEGORY_FST = 18,
|
||||
ACTION_CATEGORY_UNPROT_DMG = 20,
|
||||
ACTION_CATEGORY_VHT = 21,
|
||||
ACTION_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
|
||||
ACTION_CATEGORY_VENDOR_SPECIFIC = 127,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum spectrum_mgmt_actioncode - spectrum mgmt. action frms
|
||||
* @ACTION_SPCT_MSR_REQ: spectrum measurement request frame
|
||||
* @ACTION_SPCT_MSR_RPRT: spectrum measurement report frame
|
||||
* @ACTION_SPCT_TPC_REQ: spectrum tpc request frame
|
||||
* @ACTION_SPCT_TPC_RPRT: spectrum tpc report frame
|
||||
* @ACTION_SPCT_CHL_SWITCH: spectrum channel switch frame
|
||||
*/
|
||||
enum spectrum_mgmt_actioncode {
|
||||
ACTION_SPCT_MSR_REQ,
|
||||
ACTION_SPCT_MSR_RPRT,
|
||||
ACTION_SPCT_TPC_REQ,
|
||||
ACTION_SPCT_TPC_RPRT,
|
||||
ACTION_SPCT_CHL_SWITCH,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum qos_actioncode - qos action frames
|
||||
* @QOS_ADD_TS_REQ: qos add ts request frame
|
||||
* @QOS_ADD_TS_RSP: qos add ts response frame
|
||||
* @QOS_DEL_TS_REQ: qos del ts request frame
|
||||
* @QOS_SCHEDULE: qos schecule frame
|
||||
* @QOS_MAP_CONFIGURE: qos map configure frame
|
||||
*/
|
||||
enum qos_actioncode {
|
||||
QOS_ADD_TS_REQ,
|
||||
QOS_ADD_TS_RSP,
|
||||
QOS_DEL_TS_REQ,
|
||||
QOS_SCHEDULE,
|
||||
QOS_MAP_CONFIGURE,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum dls_actioncode - dls action frames
|
||||
* @DLS_REQUEST: dls request frame
|
||||
* @DLS_RESPONSE: dls response frame
|
||||
* @DLS_TEARDOWN: dls teardown frame
|
||||
*/
|
||||
enum dls_actioncode {
|
||||
DLS_REQUEST,
|
||||
DLS_RESPONSE,
|
||||
DLS_TEARDOWN,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum block_ack_actioncode - block ack action frames
|
||||
* @ADDBA_REQUEST: add block ack request frame
|
||||
* @ADDBA_RESPONSE: add block ack response frame
|
||||
* @DELBA: delete block ack frame
|
||||
*/
|
||||
enum block_ack_actioncode {
|
||||
ADDBA_REQUEST,
|
||||
ADDBA_RESPONSE,
|
||||
DELBA,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum pub_actioncode - public action frames
|
||||
* @PUB_ACTION_2040_BSS_COEXISTENCE: public 20-40 bss coex action frame
|
||||
* @PUB_ACTION_P2P_SUBTYPE_PRESENCE_RSP: public p2p subtype presence
|
||||
* response action frame
|
||||
* @PUB_ACTION_EXT_CHANNEL_SWITCH_ID: public ext channel switch id action frame
|
||||
* @PUB_ACTION_VENDOR_SPECIFIC: vendor specific public action frame
|
||||
* @PUB_ACTION_TDLS_DISCRESP: tdls discovery response public action frame
|
||||
*/
|
||||
enum pub_actioncode {
|
||||
PUB_ACTION_2040_BSS_COEXISTENCE = 0,
|
||||
PUB_ACTION_P2P_SUBTYPE_PRESENCE_RSP = 2,
|
||||
PUB_ACTION_EXT_CHANNEL_SWITCH_ID = 4,
|
||||
PUB_ACTION_VENDOR_SPECIFIC = 9,
|
||||
PUB_ACTION_TDLS_DISCRESP = 14,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum rrm_actioncode - rrm action frames
|
||||
* @RRM_RADIO_MEASURE_REQ: rrm radio meas. request frame
|
||||
* @RRM_RADIO_MEASURE_RPT: rrm radio meas. report frame
|
||||
* @RRM_LINK_MEASUREMENT_REQ: rrm link meas. request frmae
|
||||
* @RRM_LINK_MEASUREMENT_RPT: rrm link meas. report frame
|
||||
* @RRM_NEIGHBOR_REQ: rrm neighbor request frame
|
||||
* @RRM_NEIGHBOR_RPT: rrm neighbor report frame
|
||||
*/
|
||||
enum rrm_actioncode {
|
||||
RRM_RADIO_MEASURE_REQ,
|
||||
RRM_RADIO_MEASURE_RPT,
|
||||
RRM_LINK_MEASUREMENT_REQ,
|
||||
RRM_LINK_MEASUREMENT_RPT,
|
||||
RRM_NEIGHBOR_REQ,
|
||||
RRM_NEIGHBOR_RPT,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ht_actioncode - ht action frames
|
||||
* @HT_ACTION_NOTIFY_CHANWIDTH: ht notify bw action frame
|
||||
* @HT_ACTION_SMPS: ht smps action frame
|
||||
* @HT_ACTION_PSMP: ht psmp action frame
|
||||
* @HT_ACTION_PCO_PHASE: ht pco phase action frame
|
||||
* @HT_ACTION_CSI: ht csi action frame
|
||||
* @HT_ACTION_NONCOMPRESSED_BF: ht noncompressed bf action frame
|
||||
* @HT_ACTION_COMPRESSED_BF: ht compressed bf action frame
|
||||
* @HT_ACTION_ASEL_IDX_FEEDBACK: ht asel idx feedback action frame
|
||||
*/
|
||||
enum ht_actioncode {
|
||||
HT_ACTION_NOTIFY_CHANWIDTH,
|
||||
HT_ACTION_SMPS,
|
||||
HT_ACTION_PSMP,
|
||||
HT_ACTION_PCO_PHASE,
|
||||
HT_ACTION_CSI,
|
||||
HT_ACTION_NONCOMPRESSED_BF,
|
||||
HT_ACTION_COMPRESSED_BF,
|
||||
HT_ACTION_ASEL_IDX_FEEDBACK,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum sa_query_action - sa query action frames
|
||||
* @SA_QUERY_REQUEST: sa query request frame
|
||||
* @SA_QUERY_RESPONSE: sa query response frame
|
||||
*/
|
||||
enum sa_query_action {
|
||||
SA_QUERY_REQUEST,
|
||||
SA_QUERY_RESPONSE,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum protected_dual_actioncode - protected dual action frames
|
||||
* @PDPA_GAS_INIT_REQ: pdpa gas init request frame
|
||||
* @PDPA_GAS_INIT_RSP: pdpa gas init response frame
|
||||
* @PDPA_GAS_COMEBACK_REQ: pdpa gas comeback request frame
|
||||
* @PDPA_GAS_COMEBACK_RSP: pdpa gas comeback response frame
|
||||
*/
|
||||
enum protected_dual_actioncode {
|
||||
PDPA_GAS_INIT_REQ = 10,
|
||||
PDPA_GAS_INIT_RSP = 11,
|
||||
PDPA_GAS_COMEBACK_REQ = 12,
|
||||
PDPA_GAS_COMEBACK_RSP = 13,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum wnm_actioncode - wnm action frames
|
||||
* @WNM_BSS_TM_QUERY: wnm bss tm query frame
|
||||
* @WNM_BSS_TM_REQUEST: wnm bss tm request frame
|
||||
* @WNM_BSS_TM_RESPONSE: wnm bss tm response frame
|
||||
* @WNM_NOTIF_REQUEST: wnm notify request frame
|
||||
* @WNM_NOTIF_RESPONSE: wnm notify response frame
|
||||
*/
|
||||
enum wnm_actioncode {
|
||||
WNM_BSS_TM_QUERY = 6,
|
||||
WNM_BSS_TM_REQUEST = 7,
|
||||
WNM_BSS_TM_RESPONSE = 8,
|
||||
WNM_NOTIF_REQUEST = 26,
|
||||
WNM_NOTIF_RESPONSE = 27,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum tdls_actioncode - tdls action frames
|
||||
* @TDLS_SETUP_REQUEST: tdls setup request frame
|
||||
* @TDLS_SETUP_RESPONSE: tdls setup response frame
|
||||
* @TDLS_SETUP_CONFIRM: tdls setup confirm frame
|
||||
* @TDLS_TEARDOWN: tdls teardown frame
|
||||
* @TDLS_PEER_TRAFFIC_INDICATION: tdls peer traffic indication frame
|
||||
* @TDLS_CHANNEL_SWITCH_REQUEST: tdls channel switch req. frame
|
||||
* @TDLS_CHANNEL_SWITCH_RESPONSE: tdls channel switch response frame
|
||||
* @TDLS_PEER_PSM_REQUEST: tdls peer psm request frame
|
||||
* @TDLS_PEER_PSM_RESPONSE: tdls peer psm response frame
|
||||
* @TDLS_PEER_TRAFFIC_RESPONSE: tdls peer traffic response frame
|
||||
* @TDLS_DISCOVERY_REQUEST: tdls discovery request frame
|
||||
*/
|
||||
enum tdls_actioncode {
|
||||
TDLS_SETUP_REQUEST,
|
||||
TDLS_SETUP_RESPONSE,
|
||||
TDLS_SETUP_CONFIRM,
|
||||
TDLS_TEARDOWN,
|
||||
TDLS_PEER_TRAFFIC_INDICATION,
|
||||
TDLS_CHANNEL_SWITCH_REQUEST,
|
||||
TDLS_CHANNEL_SWITCH_RESPONSE,
|
||||
TDLS_PEER_PSM_REQUEST,
|
||||
TDLS_PEER_PSM_RESPONSE,
|
||||
TDLS_PEER_TRAFFIC_RESPONSE,
|
||||
TDLS_DISCOVERY_REQUEST,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum mesh_actioncode - mesh action frames
|
||||
* @MESH_ACTION_LINK_METRIC_REPORT: mesh link metric report action frame
|
||||
* @MESH_ACTION_HWMP_PATH_SELECTION: mesh hwmp path selection action frame
|
||||
* @MESH_ACTION_GATE_ANNOUNCEMENT: mesh gate announcement action frame
|
||||
* @MESH_ACTION_CONGESTION_CONTROL_NOTIFICATION: mesh congestion control frame
|
||||
* @MESH_ACTION_MCCA_SETUP_REQUEST: mesh mcca setup request action frame
|
||||
* @MESH_ACTION_MCCA_SETUP_REPLY: mesh mcca setup reply action frame
|
||||
* @MESH_ACTION_MCCA_ADVERTISEMENT_REQUEST: mesh mcca advertisement req. frame
|
||||
* @MESH_ACTION_MCCA_ADVERTISEMENT: mesh mcca advertisement action frame
|
||||
* @MESH_ACTION_MCCA_TEARDOWN: mesh mcca teardown action frame
|
||||
* @MESH_ACTION_TBTT_ADJUSTMENT_REQUEST: mesh tbtt adjustment req. frame
|
||||
* @MESH_ACTION_TBTT_ADJUSTMENT_RESPONSE: mesh tbtt adjustment rsp. frame
|
||||
*/
|
||||
enum mesh_actioncode {
|
||||
MESH_ACTION_LINK_METRIC_REPORT,
|
||||
MESH_ACTION_HWMP_PATH_SELECTION,
|
||||
MESH_ACTION_GATE_ANNOUNCEMENT,
|
||||
MESH_ACTION_CONGESTION_CONTROL_NOTIFICATION,
|
||||
MESH_ACTION_MCCA_SETUP_REQUEST,
|
||||
MESH_ACTION_MCCA_SETUP_REPLY,
|
||||
MESH_ACTION_MCCA_ADVERTISEMENT_REQUEST,
|
||||
MESH_ACTION_MCCA_ADVERTISEMENT,
|
||||
MESH_ACTION_MCCA_TEARDOWN,
|
||||
MESH_ACTION_TBTT_ADJUSTMENT_REQUEST,
|
||||
MESH_ACTION_TBTT_ADJUSTMENT_RESPONSE,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum self_protected_actioncode - self protected action frames
|
||||
* @SP_RESERVED: self protected reserved
|
||||
* @SP_MESH_PEERING_OPEN: self protected mesh peering open frame
|
||||
* @SP_MESH_PEERING_CONFIRM: self protected mesh peering confirm frame
|
||||
* @SP_MESH_PEERING_CLOSE: self protected mesh peering close frame
|
||||
* @SP_MGK_INFORM: self protected mgk inform frame
|
||||
* @SP_MGK_ACK: self protected mgk ack frame
|
||||
*/
|
||||
enum self_protected_actioncode {
|
||||
SP_RESERVED,
|
||||
SP_MESH_PEERING_OPEN,
|
||||
SP_MESH_PEERING_CONFIRM,
|
||||
SP_MESH_PEERING_CLOSE,
|
||||
SP_MGK_INFORM,
|
||||
SP_MGK_ACK,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum wmm_actioncode - wmm action frames
|
||||
* @WMM_QOS_SETUP_REQ: wmm qos setup request frame
|
||||
* @WMM_QOS_SETUP_RESP: q wmm qos setup response frame
|
||||
* @WMM_QOS_TEARDOWN: wmm qos teardown frame
|
||||
*/
|
||||
enum wmm_actioncode {
|
||||
WMM_QOS_SETUP_REQ,
|
||||
WMM_QOS_SETUP_RESP,
|
||||
WMM_QOS_TEARDOWN,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum vht_actioncode - vht action frames
|
||||
* @VHT_ACTION_COMPRESSED_BF: vht compressed bf action frame
|
||||
* @VHT_ACTION_GID_NOTIF: vht gid notification action frame
|
||||
* @VHT_ACTION_OPMODE_NOTIF: vht opmode notification action frame
|
||||
*/
|
||||
enum vht_actioncode {
|
||||
VHT_ACTION_COMPRESSED_BF,
|
||||
VHT_ACTION_GID_NOTIF,
|
||||
VHT_ACTION_OPMODE_NOTIF,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct action_frm_hdr - action frame header
|
||||
* @action_category: action category
|
||||
* @action_code: action code
|
||||
*/
|
||||
struct action_frm_hdr {
|
||||
uint8_t action_category;
|
||||
uint8_t action_code;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum mgmt_frame_type - enum of mgmt. frames
|
||||
* @MGMT_FRM_UNSPECIFIED: unspecified
|
||||
* @MGMT_ASSOC_REQ: association request frame
|
||||
* @MGMT_ASSOC_RESP: association response frame
|
||||
* @MGMT_REASSOC_REQ: reassociation request frame
|
||||
* @MGMT_REASSOC_RESP: reassociation response frame
|
||||
* @MGMT_PROBE_REQ: probe request frame
|
||||
* @MGMT_PROBE_RESP: probe response frame
|
||||
* @MGMT_BEACON: beacon frame
|
||||
* @MGMT_ATIM: ATIM frame
|
||||
* @MGMT_DISASSOC: disassociation frame
|
||||
* @MGMT_AUTH: authentication frame
|
||||
* @MGMT_DEAUTH: deauthentication frame
|
||||
* @MGMT_ACTION_MEAS_REQUEST: measure channels request action frame
|
||||
* @MGMT_ACTION_MEAS_REPORT: measure channels response action frame
|
||||
* @MGMT_ACTION_TPC_REQUEST: transmit power control request action frame
|
||||
* @MGMT_ACTION_TPC_REPORT: transmit power control response action frame
|
||||
* @MGMT_ACTION_CHAN_SWITCH: 802.11 channel switch announcement frame
|
||||
* @MGMT_ACTION_QOS_ADD_TS_REQ: qos add ts request frame
|
||||
* @MGMT_ACTION_QOS_ADD_TS_RSP: qos add ts response frame
|
||||
* @MGMT_ACTION_QOS_DEL_TS_REQ: qos del ts request frame
|
||||
* @MGMT_ACTION_QOS_SCHEDULE: qos schedule frame
|
||||
* @MGMT_ACTION_QOS_MAP_CONFIGURE: qos map configure frame
|
||||
* @MGMT_ACTION_DLS_REQUEST: DLS request action frame
|
||||
* @MGMT_ACTION_DLS_RESPONSE: DLS response action frame
|
||||
* @MGMT_ACTION_DLS_TEARDOWN: DLS taerdown action frame
|
||||
* @MGMT_ACTION_BA_ADDBA_REQUEST: ADDBA request action frame
|
||||
* @MGMT_ACTION_BA_ADDBA_RESPONSE: ADDBA response action frame
|
||||
* @MGMT_ACTION_BA_DELBA: DELBA action frame
|
||||
* @MGMT_ACTION_2040_BSS_COEXISTENCE: 20-40 bss coex action frame
|
||||
* @MGMT_ACTION_P2P_SUBTYPE_PRESENCE_RSP: p2p subtype presence rsp action frame
|
||||
* @MGMT_ACTION_EXT_CHANNEL_SWITCH_ID: ext channel switch id action frame
|
||||
* @MGMT_ACTION_VENDOR_SPECIFIC: vendor specific action frame
|
||||
* @MGMT_ACTION_TDLS_DISCRESP: TDLS discovery response frame
|
||||
* @MGMT_ACTION_RRM_RADIO_MEASURE_REQ: rrm radio meas. req. action frame
|
||||
* @MGMT_ACTION_RRM_RADIO_MEASURE_RPT: rrm radio meas. report action frame
|
||||
* @MGMT_ACTION_RRM_LINK_MEASUREMENT_REQ: rrm link meas. req. action frame
|
||||
* @MGMT_ACTION_RRM_LINK_MEASUREMENT_RPT: rrm link meas. report action frame
|
||||
* @MGMT_ACTION_RRM_NEIGHBOR_REQ: rrm neighbor request action frame
|
||||
* @MGMT_ACTION_RRM_NEIGHBOR_RPT: rrm neighbor response action frame
|
||||
* @MGMT_ACTION_HT_NOTIFY_CHANWIDTH: notify channel width action frame
|
||||
* @MGMT_ACTION_HT_SMPS: spatial multiplexing power save action frame
|
||||
* @MGMT_ACTION_HT_PSMP: psmp action frame
|
||||
* @MGMT_ACTION_HT_PCO_PHASE: pco phase action frame
|
||||
* @MGMT_ACTION_HT_CSI: CSI action frame
|
||||
* @MGMT_ACTION_HT_NONCOMPRESSED_BF: non-compressed beamforming action frame
|
||||
* @MGMT_ACTION_HT_COMPRESSED_BF: compressed beamforming action frame
|
||||
* @MGMT_ACTION_HT_ASEL_IDX_FEEDBACK: asel idx feedback action frame
|
||||
* @MGMT_ACTION_SA_QUERY_REQUEST: SA query request frame
|
||||
* @MGMT_ACTION_SA_QUERY_RESPONSE: SA query response frame
|
||||
* @MGMT_ACTION_PDPA_GAS_INIT_REQ: pdpa gas init request action frame
|
||||
* @MGMT_ACTION_PDPA_GAS_INIT_RSP: pdpa gas init response frame
|
||||
* @MGMT_ACTION_PDPA_GAS_COMEBACK_REQ: pdpa gas comeback req. action frame
|
||||
* @MGMT_ACTION_PDPA_GAS_COMEBACK_RSP: pdpa gas comeback rsp. action frame
|
||||
* @MGMT_ACTION_WNM_BSS_TM_QUERY: wnm bss tm query action frame
|
||||
* @MGMT_ACTION_WNM_BSS_TM_REQUEST: wnm bss tm request action frame
|
||||
* @MGMT_ACTION_WNM_BSS_TM_RESPONSE: wnm bss tm response action frame
|
||||
* @MGMT_ACTION_WNM_NOTIF_REQUEST: wnm notification request action frame
|
||||
* @MGMT_ACTION_WNM_NOTIF_RESPONSE: wnm notification response action frame
|
||||
* @MGMT_ACTION_TDLS_SETUP_REQ: tdls setup request action frame
|
||||
* @MGMT_ACTION_TDLS_SETUP_RSP: tdls setup response frame
|
||||
* @MGMT_ACTION_TDLS_SETUP_CNF: tdls setup confirm frame
|
||||
* @MGMT_ACTION_TDLS_TEARDOWN: tdls teardown frame
|
||||
* @MGMT_ACTION_TDLS_PEER_TRAFFIC_IND: tdls peer traffic indication frame
|
||||
* @MGMT_ACTION_TDLS_CH_SWITCH_REQ: tdls channel switch req. frame
|
||||
* @MGMT_ACTION_TDLS_CH_SWITCH_RSP: tdls channel switch response frame
|
||||
* @MGMT_ACTION_TDLS_PEER_PSM_REQUEST: tdls peer psm request frame
|
||||
* @MGMT_ACTION_TDLS_PEER_PSM_RESPONSE: tdls peer psm response frame
|
||||
* @MGMT_ACTION_TDLS_PEER_TRAFFIC_RSP: tdls peer traffic response frame
|
||||
* @MGMT_ACTION_TDLS_DIS_REQ: tdls discovery request frame
|
||||
* @MGMT_ACTION_MESH_LINK_METRIC_REPORT: mesh link metric report action frame
|
||||
* @MGMT_ACTION_MESH_HWMP_PATH_SELECTION: mesh hwmp path selection action frame
|
||||
* @MGMT_ACTION_MESH_GATE_ANNOUNCEMENT: mesh gate announcement action frame
|
||||
* @MGMT_ACTION_MESH_CONGESTION_CONTROL_NOTIFICATION: mesh congestion control
|
||||
* @MGMT_ACTION_MESH_MCCA_SETUP_REQUEST: mesh mcca setup request action frame
|
||||
* @MGMT_ACTION_MESH_MCCA_SETUP_REPLY: mesh mcca setup reply action frame
|
||||
* @MGMT_ACTION_MESH_MCCA_ADVERTISEMENT_REQUEST: mesh mcca advertisement req.
|
||||
* @MGMT_ACTION_MESH_MCCA_ADVERTISEMENT: mesh mcca advertisement action frame
|
||||
* @MGMT_ACTION_MESH_MCCA_TEARDOWN: mesh mcca teardown action fram
|
||||
* @MGMT_ACTION_MESH_TBTT_ADJUSTMENT_REQUEST: mesh tbtt adjustment req. frame
|
||||
* @MGMT_ACTION_MESH_TBTT_ADJUSTMENT_RESPONSE: mesh tbtt adjustment rsp. frame
|
||||
* @MGMT_ACTION_SP_MESH_PEERING_OPEN: self protected mesh peering open frame
|
||||
* @MGMT_ACTION_SP_MESH_PEERING_CONFIRM: self protected mesh peering confirm
|
||||
* @MGMT_ACTION_SP_MESH_PEERING_CLOSE: self protected mesh peering close frame
|
||||
* @MGMT_ACTION_SP_MGK_INFORM: self protected mgk inform frame
|
||||
* @MGMT_ACTION_SP_MGK_ACK: self protected mgk ack frame
|
||||
* @MGMT_ACTION_WMM_QOS_SETUP_REQ: WMM qos setup request action frame
|
||||
* @MGMT_ACTION_WMM_QOS_SETUP_RESP: WMM qos setup response action frame
|
||||
* @MGMT_ACTION_WMM_QOS_TEARDOWN: WMM qos teardown action frame
|
||||
* @MGMT_ACTION_VHT_COMPRESSED_BF: vht compressed bf action frame
|
||||
* @MGMT_ACTION_VHT_GID_NOTIF: vht gid notification action frame
|
||||
* @MGMT_ACTION_VHT_OPMODE_NOTIF: vht opmode notification action frame
|
||||
* @MGMT_MAX_FRAME_TYPE: max. mgmt frame types
|
||||
*/
|
||||
enum mgmt_frame_type {
|
||||
MGMT_FRM_UNSPECIFIED,
|
||||
MGMT_ASSOC_REQ,
|
||||
MGMT_ASSOC_RESP,
|
||||
MGMT_REASSOC_REQ,
|
||||
MGMT_REASSOC_RESP,
|
||||
MGMT_PROBE_REQ,
|
||||
MGMT_PROBE_RESP,
|
||||
MGMT_BEACON,
|
||||
MGMT_ATIM,
|
||||
MGMT_DISASSOC,
|
||||
MGMT_AUTH,
|
||||
MGMT_DEAUTH,
|
||||
MGMT_ACTION_MEAS_REQUEST,
|
||||
MGMT_ACTION_MEAS_REPORT,
|
||||
MGMT_ACTION_TPC_REQUEST,
|
||||
MGMT_ACTION_TPC_REPORT,
|
||||
MGMT_ACTION_CHAN_SWITCH,
|
||||
MGMT_ACTION_QOS_ADD_TS_REQ,
|
||||
MGMT_ACTION_QOS_ADD_TS_RSP,
|
||||
MGMT_ACTION_QOS_DEL_TS_REQ,
|
||||
MGMT_ACTION_QOS_SCHEDULE,
|
||||
MGMT_ACTION_QOS_MAP_CONFIGURE,
|
||||
MGMT_ACTION_DLS_REQUEST,
|
||||
MGMT_ACTION_DLS_RESPONSE,
|
||||
MGMT_ACTION_DLS_TEARDOWN,
|
||||
MGMT_ACTION_BA_ADDBA_REQUEST,
|
||||
MGMT_ACTION_BA_ADDBA_RESPONSE,
|
||||
MGMT_ACTION_BA_DELBA,
|
||||
MGMT_ACTION_2040_BSS_COEXISTENCE,
|
||||
MGMT_ACTION_P2P_SUBTYPE_PRESENCE_RSP,
|
||||
MGMT_ACTION_EXT_CHANNEL_SWITCH_ID,
|
||||
MGMT_ACTION_VENDOR_SPECIFIC,
|
||||
MGMT_ACTION_TDLS_DISCRESP,
|
||||
MGMT_ACTION_RRM_RADIO_MEASURE_REQ,
|
||||
MGMT_ACTION_RRM_RADIO_MEASURE_RPT,
|
||||
MGMT_ACTION_RRM_LINK_MEASUREMENT_REQ,
|
||||
MGMT_ACTION_RRM_LINK_MEASUREMENT_RPT,
|
||||
MGMT_ACTION_RRM_NEIGHBOR_REQ,
|
||||
MGMT_ACTION_RRM_NEIGHBOR_RPT,
|
||||
MGMT_ACTION_HT_NOTIFY_CHANWIDTH,
|
||||
MGMT_ACTION_HT_SMPS,
|
||||
MGMT_ACTION_HT_PSMP,
|
||||
MGMT_ACTION_HT_PCO_PHASE,
|
||||
MGMT_ACTION_HT_CSI,
|
||||
MGMT_ACTION_HT_NONCOMPRESSED_BF,
|
||||
MGMT_ACTION_HT_COMPRESSED_BF,
|
||||
MGMT_ACTION_HT_ASEL_IDX_FEEDBACK,
|
||||
MGMT_ACTION_SA_QUERY_REQUEST,
|
||||
MGMT_ACTION_SA_QUERY_RESPONSE,
|
||||
MGMT_ACTION_PDPA_GAS_INIT_REQ,
|
||||
MGMT_ACTION_PDPA_GAS_INIT_RSP,
|
||||
MGMT_ACTION_PDPA_GAS_COMEBACK_REQ,
|
||||
MGMT_ACTION_PDPA_GAS_COMEBACK_RSP,
|
||||
MGMT_ACTION_WNM_BSS_TM_QUERY,
|
||||
MGMT_ACTION_WNM_BSS_TM_REQUEST,
|
||||
MGMT_ACTION_WNM_BSS_TM_RESPONSE,
|
||||
MGMT_ACTION_WNM_NOTIF_REQUEST,
|
||||
MGMT_ACTION_WNM_NOTIF_RESPONSE,
|
||||
MGMT_ACTION_TDLS_SETUP_REQ,
|
||||
MGMT_ACTION_TDLS_SETUP_RSP,
|
||||
MGMT_ACTION_TDLS_SETUP_CNF,
|
||||
MGMT_ACTION_TDLS_TEARDOWN,
|
||||
MGMT_ACTION_TDLS_PEER_TRAFFIC_IND,
|
||||
MGMT_ACTION_TDLS_CH_SWITCH_REQ,
|
||||
MGMT_ACTION_TDLS_CH_SWITCH_RSP,
|
||||
MGMT_ACTION_TDLS_PEER_PSM_REQUEST,
|
||||
MGMT_ACTION_TDLS_PEER_PSM_RESPONSE,
|
||||
MGMT_ACTION_TDLS_PEER_TRAFFIC_RSP,
|
||||
MGMT_ACTION_TDLS_DIS_REQ,
|
||||
MGMT_ACTION_MESH_LINK_METRIC_REPORT,
|
||||
MGMT_ACTION_MESH_HWMP_PATH_SELECTION,
|
||||
MGMT_ACTION_MESH_GATE_ANNOUNCEMENT,
|
||||
MGMT_ACTION_MESH_CONGESTION_CONTROL_NOTIFICATION,
|
||||
MGMT_ACTION_MESH_MCCA_SETUP_REQUEST,
|
||||
MGMT_ACTION_MESH_MCCA_SETUP_REPLY,
|
||||
MGMT_ACTION_MESH_MCCA_ADVERTISEMENT_REQUEST,
|
||||
MGMT_ACTION_MESH_MCCA_ADVERTISEMENT,
|
||||
MGMT_ACTION_MESH_MCCA_TEARDOWN,
|
||||
MGMT_ACTION_MESH_TBTT_ADJUSTMENT_REQUEST,
|
||||
MGMT_ACTION_MESH_TBTT_ADJUSTMENT_RESPONSE,
|
||||
MGMT_ACTION_SP_MESH_PEERING_OPEN,
|
||||
MGMT_ACTION_SP_MESH_PEERING_CONFIRM,
|
||||
MGMT_ACTION_SP_MESH_PEERING_CLOSE,
|
||||
MGMT_ACTION_SP_MGK_INFORM,
|
||||
MGMT_ACTION_SP_MGK_ACK,
|
||||
MGMT_ACTION_WMM_QOS_SETUP_REQ,
|
||||
MGMT_ACTION_WMM_QOS_SETUP_RESP,
|
||||
MGMT_ACTION_WMM_QOS_TEARDOWN,
|
||||
MGMT_ACTION_VHT_COMPRESSED_BF,
|
||||
MGMT_ACTION_VHT_GID_NOTIF,
|
||||
MGMT_ACTION_VHT_OPMODE_NOTIF,
|
||||
MGMT_MAX_FRAME_TYPE,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* mgmt_tx_download_comp_cb - function pointer for tx download completions.
|
||||
* @context: caller component specific context
|
||||
* @buf: buffer
|
||||
* @free: to free/not free the buffer
|
||||
*
|
||||
* This is the function pointer to be called on tx download completion
|
||||
* if download complete is required.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
typedef QDF_STATUS (*mgmt_tx_download_comp_cb)(void *context,
|
||||
qdf_nbuf_t buf, bool free);
|
||||
|
||||
/**
|
||||
* mgmt_ota_comp_cb - function pointer for tx ota completions.
|
||||
* @context: caller component specific context
|
||||
* @buf: buffer
|
||||
* @status: tx completion status
|
||||
* @tx_compl_params: tx completion params
|
||||
*
|
||||
* This is the function pointer to be called on tx ota completion.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
typedef QDF_STATUS (*mgmt_ota_comp_cb)(void *context, qdf_nbuf_t buf,
|
||||
uint32_t status, void *tx_compl_params);
|
||||
|
||||
/**
|
||||
* mgmt_frame_rx_callback - function pointer for receiving mgmt rx frames
|
||||
* @psoc: psoc context
|
||||
* @peer: peer
|
||||
* @buf: buffer
|
||||
* @params: rx params
|
||||
* @frm_type: mgmt rx frame type
|
||||
*
|
||||
* This is the function pointer to be called on receiving mgmt rx frames.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
typedef QDF_STATUS (*mgmt_frame_rx_callback)(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_objmgr_peer *peer,
|
||||
qdf_nbuf_t buf, void *params,
|
||||
enum mgmt_frame_type frm_type);
|
||||
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_init() - initialize mgmt txrx context.
|
||||
*
|
||||
* This function initializes the mgmt txrx context,
|
||||
* mgmt descriptor pool, etc.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS wlan_mgmt_txrx_init(void);
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_deinit() - deinitialize mgmt txrx context.
|
||||
*
|
||||
* This function deinitializes the mgmt txrx context,
|
||||
* mgmt descriptor pool, etc.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS wlan_mgmt_txrx_deinit(void);
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_mgmt_frame_tx() - transmits mgmt. frame
|
||||
* @peer: peer
|
||||
* @context: caller component specific context
|
||||
* @buf: buffer to be transmitted
|
||||
* @comp_cb: download completion cb function
|
||||
* @ota_cb: post processing cb function
|
||||
* @comp_id: umac component id
|
||||
* @mgmt_tx_params: mgmt tx params
|
||||
*
|
||||
* This function transmits the mgmt. frame to southbound interface.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS wlan_mgmt_txrx_mgmt_frame_tx(struct wlan_objmgr_peer *peer,
|
||||
void *context,
|
||||
qdf_nbuf_t buf,
|
||||
mgmt_tx_download_comp_cb tx_comp_cb,
|
||||
mgmt_ota_comp_cb tx_ota_comp_cb,
|
||||
enum wlan_umac_comp_id comp_id,
|
||||
void *mgmt_tx_params);
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_beacon_frame_tx() - transmits mgmt. beacon
|
||||
* @psoc: psoc context
|
||||
* @buf: buffer to be transmitted
|
||||
* @comp_id: umac component id
|
||||
*
|
||||
* This function transmits the mgmt. beacon to southbound interface.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS wlan_mgmt_txrx_beacon_frame_tx(struct wlan_objmgr_peer *peer,
|
||||
qdf_nbuf_t buf,
|
||||
enum wlan_umac_comp_id comp_id);
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_register_rx_cb() - registers the rx cb for mgmt. frames
|
||||
* @psoc: psoc context
|
||||
* @mgmt_rx_cb: mgmt rx callback to be registered
|
||||
* @comp_id: umac component id
|
||||
* @frm_type: mgmt. frame for which cb to be registered.
|
||||
*
|
||||
* This function registers rx callback for mgmt. frames for
|
||||
* the corresponding umac component passed in the func.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS wlan_mgmt_txrx_register_rx_cb(struct wlan_objmgr_psoc *psoc,
|
||||
mgmt_frame_rx_callback mgmt_rx_cb,
|
||||
enum wlan_umac_comp_id comp_id,
|
||||
enum mgmt_frame_type frm_type);
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_deregister_rx_cb() - deregisters the rx cb for mgmt. frames
|
||||
* @psoc: psoc context
|
||||
* @comp_id: umac component id
|
||||
* @frm_type: mgmt. frame for which cb to be registered.
|
||||
*
|
||||
* This function deregisters rx callback for mgmt. frames for
|
||||
* the corresponding umac component passed in the func.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
QDF_STATUS wlan_mgmt_txrx_deregister_rx_cb(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
enum wlan_umac_comp_id comp_id,
|
||||
enum mgmt_frame_type frm_type);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Copyright (c) 2016 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 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: wlan_mgmt_txrx_tgt_api.c
|
||||
* This file contains mgmt txrx public API definitions for
|
||||
* southbound interface.
|
||||
*/
|
||||
|
||||
#include "wlan_mgmt_txrx_tgt_api.h"
|
||||
#include "wlan_mgmt_txrx_utils_api.h"
|
||||
#include "wlan_mgmt_txrx_main_i.h"
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
|
||||
QDF_STATUS tgt_mgmt_txrx_rx_frame_handler(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
qdf_nbuf_t buf, void *params)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_mgmt_txrx_tx_completion_handler(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t desc_id, uint32_t status,
|
||||
void *tx_compl_params)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
qdf_nbuf_t tgt_mgmt_txrx_get_nbuf_from_desc_id(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t desc_id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct wlan_objmgr_peer *
|
||||
tgt_mgmt_txrx_get_peer_from_desc_id(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t desc_id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint8_t tgt_mgmt_txrx_get_vdev_id_from_desc_id(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t desc_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,237 @@
|
|||
/*
|
||||
* Copyright (c) 2016 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 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: wlan_mgmt_txrx_utils_api.c
|
||||
* This file contains mgmt txrx public API definitions for umac
|
||||
* converged components.
|
||||
*/
|
||||
|
||||
#include "wlan_mgmt_txrx_utils_api.h"
|
||||
#include "wlan_mgmt_txrx_main_i.h"
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include "wlan_objmgr_global_obj.h"
|
||||
#include "qdf_nbuf.h"
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_psoc_obj_create_notification() - called from objmgr when psoc
|
||||
* is created
|
||||
* @psoc: psoc context
|
||||
* @arg: argument
|
||||
*
|
||||
* This function gets called from object manager when psoc is being created and
|
||||
* creates mgmt_txrx context, mgmt desc pool.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
static QDF_STATUS wlan_mgmt_txrx_psoc_obj_create_notification(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
struct mgmt_txrx_priv_context *mgmt_txrx_ctx;
|
||||
struct mgmt_txrx_stats_t *mgmt_txrx_stats;
|
||||
QDF_STATUS status;
|
||||
|
||||
if (!psoc) {
|
||||
mgmt_txrx_err("psoc context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
mgmt_txrx_ctx = qdf_mem_malloc(sizeof(*mgmt_txrx_ctx));
|
||||
if (!mgmt_txrx_ctx) {
|
||||
mgmt_txrx_err("Failed to allocate mgmt txrx context");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
mgmt_txrx_ctx->psoc = psoc;
|
||||
|
||||
status = wlan_mgmt_txrx_desc_pool_init(mgmt_txrx_ctx,
|
||||
MGMT_DESC_POOL_MAX);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
mgmt_txrx_err("Failed to initialize mgmt desc. pool with status: %u",
|
||||
status);
|
||||
goto err_desc_pool_init;
|
||||
}
|
||||
|
||||
mgmt_txrx_stats = qdf_mem_malloc(sizeof(*mgmt_txrx_stats));
|
||||
if (!mgmt_txrx_stats) {
|
||||
mgmt_txrx_err("Failed to allocate memory for mgmt txrx stats structure");
|
||||
status = QDF_STATUS_E_NOMEM;
|
||||
goto err_mgmt_txrx_stats;
|
||||
}
|
||||
mgmt_txrx_ctx->mgmt_txrx_stats = mgmt_txrx_stats;
|
||||
|
||||
qdf_spinlock_create(&mgmt_txrx_ctx->mgmt_txrx_ctx_lock);
|
||||
|
||||
if (wlan_objmgr_psoc_component_obj_attach(psoc,
|
||||
WLAN_UMAC_COMP_MGMT_TXRX,
|
||||
mgmt_txrx_ctx, QDF_STATUS_SUCCESS)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
mgmt_txrx_err("Failed to attach mgmt txrx ctx in psoc ctx");
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
goto err_psoc_attach;
|
||||
}
|
||||
|
||||
mgmt_txrx_info("Mgmt txrx creation successful, mgmt txrx ctx: %p, psoc: %p",
|
||||
mgmt_txrx_ctx, psoc);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
err_psoc_attach:
|
||||
qdf_spinlock_destroy(&mgmt_txrx_ctx->mgmt_txrx_ctx_lock);
|
||||
qdf_mem_free(mgmt_txrx_stats);
|
||||
err_mgmt_txrx_stats:
|
||||
wlan_mgmt_txrx_desc_pool_deinit(mgmt_txrx_ctx);
|
||||
err_desc_pool_init:
|
||||
qdf_mem_free(mgmt_txrx_ctx);
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_mgmt_txrx_psoc_obj_delete_notification() - called from objmgr when psoc
|
||||
* is deleted
|
||||
* @psoc: psoc context
|
||||
* @arg: argument
|
||||
*
|
||||
* This function gets called from object manager when psoc is being deleted and
|
||||
* deletes mgmt_txrx context, mgmt desc pool.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS - in case of success
|
||||
*/
|
||||
static QDF_STATUS wlan_mgmt_txrx_psoc_obj_delete_notification(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
void *arg)
|
||||
{
|
||||
struct mgmt_txrx_priv_context *mgmt_txrx_ctx;
|
||||
|
||||
if (!psoc) {
|
||||
mgmt_txrx_err("psoc context passed is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
mgmt_txrx_ctx = wlan_objmgr_psoc_get_comp_private_obj(
|
||||
psoc, WLAN_UMAC_COMP_MGMT_TXRX);
|
||||
if (!mgmt_txrx_ctx) {
|
||||
mgmt_txrx_err("mgmt txrx context is already NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
mgmt_txrx_info("deleting mgmt txrx psoc obj, mgmt txrx ctx: %p, psoc: %p",
|
||||
mgmt_txrx_ctx, psoc);
|
||||
if (wlan_objmgr_psoc_component_obj_detach(psoc,
|
||||
WLAN_UMAC_COMP_MGMT_TXRX, mgmt_txrx_ctx)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
mgmt_txrx_err("Failed to detach mgmt txrx ctx in psoc ctx");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
wlan_mgmt_txrx_desc_pool_deinit(mgmt_txrx_ctx);
|
||||
qdf_mem_free(mgmt_txrx_ctx->mgmt_txrx_stats);
|
||||
qdf_spinlock_destroy(&mgmt_txrx_ctx->mgmt_txrx_ctx_lock);
|
||||
qdf_mem_free(mgmt_txrx_ctx);
|
||||
|
||||
mgmt_txrx_info("mgmt txrx deletion successful, psoc: %p", psoc);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_mgmt_txrx_init(void)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
status = wlan_objmgr_register_psoc_create_handler(
|
||||
WLAN_UMAC_COMP_MGMT_TXRX,
|
||||
wlan_mgmt_txrx_psoc_obj_create_notification,
|
||||
NULL);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
mgmt_txrx_err("Failed to register mgmt txrx obj create handler");
|
||||
goto err_psoc_create;
|
||||
}
|
||||
|
||||
status = wlan_objmgr_register_psoc_delete_handler(
|
||||
WLAN_UMAC_COMP_MGMT_TXRX,
|
||||
wlan_mgmt_txrx_psoc_obj_delete_notification,
|
||||
NULL);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
mgmt_txrx_err("Failed to register mgmt txrx obj delete handler");
|
||||
goto err_psoc_delete;
|
||||
}
|
||||
|
||||
mgmt_txrx_info("Successfully registered create and delete handlers with objmgr");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
err_psoc_delete:
|
||||
wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_MGMT_TXRX,
|
||||
wlan_mgmt_txrx_psoc_obj_create_notification, NULL);
|
||||
err_psoc_create:
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_mgmt_txrx_deinit(void)
|
||||
{
|
||||
if (wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_MGMT_TXRX,
|
||||
wlan_mgmt_txrx_psoc_obj_create_notification,
|
||||
NULL)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (wlan_objmgr_unregister_psoc_delete_handler(WLAN_UMAC_COMP_MGMT_TXRX,
|
||||
wlan_mgmt_txrx_psoc_obj_delete_notification,
|
||||
NULL)
|
||||
!= QDF_STATUS_SUCCESS) {
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
mgmt_txrx_info("Successfully unregistered create and delete handlers with objmgr");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_mgmt_txrx_mgmt_frame_tx(struct wlan_objmgr_peer *peer,
|
||||
void *context,
|
||||
qdf_nbuf_t buf,
|
||||
mgmt_tx_download_comp_cb tx_comp_cb,
|
||||
mgmt_ota_comp_cb tx_ota_comp_cb,
|
||||
enum wlan_umac_comp_id comp_id,
|
||||
void *mgmt_tx_params)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_mgmt_txrx_beacon_frame_tx(struct wlan_objmgr_peer *peer,
|
||||
qdf_nbuf_t buf,
|
||||
enum wlan_umac_comp_id comp_id)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_mgmt_txrx_register_rx_cb(struct wlan_objmgr_psoc *psoc,
|
||||
mgmt_frame_rx_callback mgmt_rx_cb,
|
||||
enum wlan_umac_comp_id comp_id,
|
||||
enum mgmt_frame_type frm_type)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_mgmt_txrx_deregister_rx_cb(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
enum wlan_umac_comp_id comp_id,
|
||||
enum mgmt_frame_type frm_type)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
Loading…
Reference in a new issue