qcacmn: Add support to manage Wifi pos vdev private object
Add support to manage Wifi pos vdev private object. Add new peer type in enum wlan_peer_type. Add rx_ops and register the rx_ops for PASN peer create/peer delete request. Register 11az PASN related WMI events in target if. Change-Id: I2a5e4d8d7c9b9562d9ab02b287957e93ee6f4758 CRs-Fixed: 3154521
This commit is contained in:

committed by
Madan Koyyalamudi

parent
87ce989ee0
commit
7738bad9e9
@@ -53,8 +53,8 @@
|
||||
|
||||
#ifdef WIFI_POS_CONVERGED
|
||||
#include "target_if_wifi_pos.h"
|
||||
#include "target_if_wifi_pos_tx_ops.h"
|
||||
#include "target_if_wifi_pos_rx_ops.h"
|
||||
#include "target_if_wifi_pos_tx_ops.h"
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_WLAN_TDLS
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2019 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
|
||||
|
@@ -54,7 +54,7 @@ QDF_STATUS target_if_wifi_pos_get_indirect_data(
|
||||
struct wmi_host_oem_indirect_data *indirect,
|
||||
struct oem_data_rsp *rsp, uint32_t *cookie);
|
||||
/**
|
||||
* target_if_wifi_pos_replenish_ring() - Replenish the DMA ring
|
||||
* target_if_wifi_pos_replenish_ring() - Replenish the CFR DMA ring
|
||||
* @priv: Pointer to Wifi Pos psoc private object
|
||||
* @ring_idx: Ring Index
|
||||
* @vaddr: Virtual address
|
||||
|
@@ -76,4 +76,62 @@ int wifi_pos_oem_meas_rpt_ev_handler(ol_scn_t scn, uint8_t *buf,
|
||||
*/
|
||||
int wifi_pos_oem_err_rpt_ev_handler(ol_scn_t scn, uint8_t *buf,
|
||||
uint32_t len);
|
||||
|
||||
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
|
||||
/**
|
||||
* target_if_wifi_pos_pasn_peer_create_ev_handler() - Handle
|
||||
* wmi_rtt_pasn_peer_create_req_eventid event from firmware
|
||||
* @scn: scn handle
|
||||
* @buf: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: zero if success, non-zero status on failure
|
||||
*/
|
||||
int target_if_wifi_pos_pasn_peer_create_ev_handler(ol_scn_t scn,
|
||||
uint8_t *buf,
|
||||
uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_wifi_pos_pasn_peer_delete_ev_handler() - Handle
|
||||
* wmi_rtt_pasn_peer_delete_eventid event from firmware
|
||||
* @scn: scn handle
|
||||
* @buf: event buffer
|
||||
* @len: event buffer length
|
||||
*
|
||||
* Return: zero if success, non-zero status on failure
|
||||
*/
|
||||
int target_if_wifi_pos_pasn_peer_delete_ev_handler(ol_scn_t scn,
|
||||
uint8_t *buf,
|
||||
uint32_t len);
|
||||
|
||||
/**
|
||||
* target_if_wifi_pos_register_rx_ops() - Register wifi pos module target_if
|
||||
* RX ops
|
||||
* @rx_ops: RX ops pointer
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void target_if_wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops);
|
||||
|
||||
#else
|
||||
static inline
|
||||
int target_if_wifi_pos_pasn_peer_create_ev_handler(ol_scn_t scn,
|
||||
uint8_t *buf,
|
||||
uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
int target_if_wifi_pos_pasn_peer_delete_ev_handler(ol_scn_t scn,
|
||||
uint8_t *buf,
|
||||
uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
void target_if_wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
{}
|
||||
#endif /* WIFI_POS_CONVERGED && WLAN_FEATURE_RTT_11AZ_SUPPORT */
|
||||
#endif /* _WIFI_POS_TGT_IF_RX_OPS_H_ */
|
||||
|
@@ -23,6 +23,8 @@
|
||||
* target if layer.
|
||||
*/
|
||||
#include "wifi_pos_utils_pub.h"
|
||||
#include "wifi_pos_api.h"
|
||||
#include "wifi_pos_pasn_api.h"
|
||||
|
||||
#include "wmi_unified_api.h"
|
||||
#include "wlan_lmac_if_def.h"
|
||||
@@ -31,7 +33,7 @@
|
||||
#include "wifi_pos_utils_i.h"
|
||||
#include "target_if.h"
|
||||
|
||||
static inline struct wlan_lmac_if_wifi_pos_rx_ops *
|
||||
static struct wlan_lmac_if_wifi_pos_rx_ops *
|
||||
target_if_wifi_pos_get_rxops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_rx_ops *rx_ops;
|
||||
@@ -150,3 +152,134 @@ int wifi_pos_oem_err_rpt_ev_handler(ol_scn_t scn, uint8_t *buf,
|
||||
/* TBD */
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
|
||||
int target_if_wifi_pos_pasn_peer_create_ev_handler(ol_scn_t scn,
|
||||
uint8_t *buf,
|
||||
uint32_t len)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_lmac_if_wifi_pos_rx_ops *rx_ops;
|
||||
struct wifi_pos_pasn_peer_data *data = NULL;
|
||||
QDF_STATUS status;
|
||||
|
||||
data = qdf_mem_malloc(sizeof(*data));
|
||||
if (!data)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
qdf_mem_free(data);
|
||||
return QDF_STATUS_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
wlan_objmgr_psoc_get_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
qdf_mem_free(data);
|
||||
target_if_err("wmi_handle is null");
|
||||
return QDF_STATUS_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
status = wmi_extract_pasn_peer_create_req(wmi_handle, buf, data);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wifi_pos_err("Extract PASN peer create failed");
|
||||
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
qdf_mem_free(data);
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
rx_ops = wifi_pos_get_rx_ops(psoc);
|
||||
if (!rx_ops || !rx_ops->wifi_pos_ranging_peer_create_cb) {
|
||||
wifi_pos_err("%s is null",
|
||||
!rx_ops ? "rx_ops" : "rx_ops_cb");
|
||||
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
qdf_mem_free(data);
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
rx_ops->wifi_pos_ranging_peer_create_cb(psoc, data->peer_info,
|
||||
data->vdev_id,
|
||||
data->num_peers);
|
||||
|
||||
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
qdf_mem_free(data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int target_if_wifi_pos_pasn_peer_delete_ev_handler(ol_scn_t scn,
|
||||
uint8_t *buf,
|
||||
uint32_t len)
|
||||
{
|
||||
wmi_unified_t wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_lmac_if_wifi_pos_rx_ops *rx_ops;
|
||||
struct wifi_pos_pasn_peer_data *data = NULL;
|
||||
QDF_STATUS status;
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return QDF_STATUS_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
wlan_objmgr_psoc_get_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
target_if_err("wmi_handle is null");
|
||||
return QDF_STATUS_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
data = qdf_mem_malloc(sizeof(*data));
|
||||
if (!data) {
|
||||
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
status = wmi_extract_pasn_peer_delete_req(wmi_handle, buf, data);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wifi_pos_err("Extract PASN peer delete failed");
|
||||
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
qdf_mem_free(data);
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
rx_ops = wifi_pos_get_rx_ops(psoc);
|
||||
if (!rx_ops || !rx_ops->wifi_pos_ranging_peer_delete_cb) {
|
||||
wifi_pos_err("%s is null",
|
||||
!rx_ops ? "rx_ops" : "rx_ops_cb");
|
||||
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
qdf_mem_free(data);
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
rx_ops->wifi_pos_ranging_peer_delete_cb(psoc, data->peer_info,
|
||||
data->vdev_id,
|
||||
data->num_peers);
|
||||
|
||||
wlan_objmgr_psoc_release_ref(psoc, WLAN_WIFI_POS_TGT_IF_ID);
|
||||
qdf_mem_free(data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void target_if_wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
{
|
||||
struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops =
|
||||
&rx_ops->wifi_pos_rx_ops;
|
||||
|
||||
wifi_pos_rx_ops->wifi_pos_ranging_peer_create_cb =
|
||||
wifi_pos_handle_ranging_peer_create;
|
||||
wifi_pos_rx_ops->wifi_pos_ranging_peer_create_rsp_cb =
|
||||
wifi_pos_handle_ranging_peer_create_rsp;
|
||||
wifi_pos_rx_ops->wifi_pos_ranging_peer_delete_cb =
|
||||
wifi_pos_handle_ranging_peer_delete;
|
||||
}
|
||||
#endif
|
||||
|
@@ -103,6 +103,63 @@ target_if_wifi_pos_parse_measreq_chan_info(struct wlan_objmgr_pdev *pdev,
|
||||
#endif /* WLAN_RTT_MEASUREMENT_NOTIFICATION */
|
||||
|
||||
#ifdef WIFI_POS_CONVERGED
|
||||
#ifdef WLAN_FEATURE_RTT_11AZ_SUPPORT
|
||||
static QDF_STATUS
|
||||
target_if_wifi_pos_register_11az_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
status = wmi_unified_register_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_rtt_pasn_peer_create_req_eventid,
|
||||
target_if_wifi_pos_pasn_peer_create_ev_handler,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("register pasn peer create event_handler failed");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_rtt_pasn_peer_delete_eventid,
|
||||
target_if_wifi_pos_pasn_peer_delete_ev_handler,
|
||||
WMI_RX_SERIALIZER_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("register pasn peer delete event_handler failed");
|
||||
return status;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
target_if_wifi_pos_unregister_11az_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
if (!psoc || !GET_WMI_HDL_FROM_PSOC(psoc)) {
|
||||
target_if_err("psoc or psoc->tgt_if_handle is null");
|
||||
return;
|
||||
}
|
||||
|
||||
wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_rtt_pasn_peer_create_req_eventid);
|
||||
|
||||
wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_rtt_pasn_peer_delete_eventid);
|
||||
}
|
||||
#else
|
||||
static QDF_STATUS
|
||||
target_if_wifi_pos_register_11az_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
target_if_wifi_pos_unregister_11az_events(struct wlan_objmgr_psoc *psoc)
|
||||
{}
|
||||
#endif /* WLAN_FEATURE_RTT_11AZ_SUPPORT */
|
||||
|
||||
static
|
||||
QDF_STATUS target_if_wifi_pos_register_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
@@ -152,6 +209,8 @@ QDF_STATUS target_if_wifi_pos_register_events(struct wlan_objmgr_psoc *psoc)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
target_if_wifi_pos_register_11az_events(psoc);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -175,6 +234,7 @@ QDF_STATUS target_if_wifi_pos_deregister_events(struct wlan_objmgr_psoc *psoc)
|
||||
wmi_unified_unregister_event_handler(
|
||||
get_wmi_unified_hdl_from_psoc(psoc),
|
||||
wmi_oem_report_event_id);
|
||||
target_if_wifi_pos_unregister_11az_events(psoc);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
@@ -621,6 +621,7 @@ enum wifi_traffic_ac {
|
||||
* @WLAN_PEER_IBSS: IBSS Peer
|
||||
* @WLAN_PEER_NDP: NDP Peer
|
||||
* @WLAN_PEER_MLO_TEMP: MLO Peer Temp (host only node)
|
||||
* @WLAN_PEER_RTT_PASN: Ranging PASN peer
|
||||
*/
|
||||
enum wlan_peer_type {
|
||||
WLAN_PEER_SELF = 1,
|
||||
@@ -634,6 +635,7 @@ enum wlan_peer_type {
|
||||
WLAN_PEER_IBSS = 9,
|
||||
WLAN_PEER_NDP = 10,
|
||||
WLAN_PEER_MLO_TEMP = 11,
|
||||
WLAN_PEER_RTT_PASN = 12,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include <reg_services_public_struct.h>
|
||||
|
||||
#include "wlan_crypto_global_def.h"
|
||||
#include "wifi_pos_public_struct.h"
|
||||
|
||||
#ifdef WLAN_CFR_ENABLE
|
||||
#include "wlan_cfr_utils_api.h"
|
||||
@@ -1886,10 +1887,29 @@ struct wlan_lmac_if_iot_sim_rx_ops {
|
||||
* struct wlan_lmac_if_wifi_pos_rx_ops - structure of rx function
|
||||
* pointers for wifi_pos component
|
||||
* @oem_rsp_event_rx: callback for WMI_OEM_RESPONSE_EVENTID
|
||||
* @wifi_pos_ranging_peer_create_cb: Function pointer to handle PASN peer create
|
||||
* request
|
||||
* @wifi_pos_ranging_peer_create_rsp_cb: Function pointer to handle peer create
|
||||
* confirm event for PASN Peer.
|
||||
* @wifi_pos_ranging_peer_delete_cb: Ranging peer delete handle function
|
||||
* pointer.
|
||||
*/
|
||||
struct wlan_lmac_if_wifi_pos_rx_ops {
|
||||
int (*oem_rsp_event_rx)(struct wlan_objmgr_psoc *psoc,
|
||||
struct oem_data_rsp *oem_rsp);
|
||||
QDF_STATUS (*wifi_pos_ranging_peer_create_cb)
|
||||
(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_pasn_request *req,
|
||||
uint8_t vdev_id,
|
||||
uint8_t total_entries);
|
||||
QDF_STATUS (*wifi_pos_ranging_peer_create_rsp_cb)
|
||||
(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||
struct qdf_mac_addr *peer_mac,
|
||||
uint8_t status);
|
||||
QDF_STATUS (*wifi_pos_ranging_peer_delete_cb)
|
||||
(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_pasn_request *info,
|
||||
uint8_t vdev_id, uint8_t num_peers);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@@ -87,6 +87,8 @@
|
||||
#include <wlan_p2p_mcc_quota_tgt_api.h>
|
||||
#endif
|
||||
|
||||
#include "target_if.h"
|
||||
|
||||
/* Function pointer for OL/WMA specific UMAC tx_ops
|
||||
* registration.
|
||||
*/
|
||||
@@ -309,11 +311,24 @@ wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
wlan_lmac_if_umac_crypto_rxpn_ops_register(rx_ops);
|
||||
}
|
||||
|
||||
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
|
||||
static void
|
||||
wlan_lmac_if_wifi_pos_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
{
|
||||
target_if_wifi_pos_register_rx_ops(rx_ops);
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
wlan_lmac_if_wifi_pos_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#ifdef WIFI_POS_CONVERGED
|
||||
static void wlan_lmac_if_umac_rx_ops_register_wifi_pos(
|
||||
struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
static void
|
||||
wlan_lmac_if_umac_rx_ops_register_wifi_pos(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
{
|
||||
wifi_pos_register_rx_ops(rx_ops);
|
||||
wlan_lmac_if_wifi_pos_rx_ops(rx_ops);
|
||||
}
|
||||
#else
|
||||
static void wlan_lmac_if_umac_rx_ops_register_wifi_pos(
|
||||
|
@@ -342,6 +342,24 @@ struct wlan_lmac_if_rx_ops;
|
||||
*/
|
||||
void wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops);
|
||||
|
||||
/**
|
||||
* wifi_pos_get_tx_ops: api to get tx ops
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: tx ops
|
||||
*/
|
||||
struct wlan_lmac_if_wifi_pos_tx_ops *
|
||||
wifi_pos_get_tx_ops(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* wifi_pos_get_rx_ops: api to get rx ops
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: rx ops
|
||||
*/
|
||||
struct wlan_lmac_if_wifi_pos_rx_ops *
|
||||
wifi_pos_get_rx_ops(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* ucfg_wifi_pos_get_ftm_cap: API to get fine timing measurement caps
|
||||
* @psoc: psoc object
|
||||
@@ -402,6 +420,25 @@ bool wifi_pos_is_app_registered(struct wlan_objmgr_psoc *psoc);
|
||||
*/
|
||||
struct wlan_objmgr_psoc *wifi_pos_get_psoc(void);
|
||||
|
||||
/**
|
||||
* wifi_pos_get_legacy_ops() - Get wifi pos legacy ops
|
||||
* @psoc: PSOC pointer
|
||||
*
|
||||
* Return: Pointer to legacy ops
|
||||
*/
|
||||
struct wifi_pos_legacy_ops *
|
||||
wifi_pos_get_legacy_ops(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* wifi_pos_set_legacy_ops() - Set Wifi Pos legacy ops
|
||||
* @psoc: PSOC pointer
|
||||
* @legacy_ops: Legacy ops
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wifi_pos_set_legacy_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct wifi_pos_legacy_ops *legacy_ops);
|
||||
#else
|
||||
static inline QDF_STATUS wifi_pos_init(void)
|
||||
{
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "qdf_trace.h"
|
||||
#include "qdf_module.h"
|
||||
#include "wifi_pos_utils_pub.h"
|
||||
#include "wlan_objmgr_vdev_obj.h"
|
||||
#include "wlan_cmn.h"
|
||||
|
||||
struct wlan_objmgr_psoc;
|
||||
@@ -215,6 +216,21 @@ typedef void (*wifi_pos_send_rsp_handler)(struct wlan_objmgr_psoc *, uint32_t,
|
||||
enum wifi_pos_cmd_ids,
|
||||
uint32_t, uint8_t *);
|
||||
|
||||
/**
|
||||
* struct wifi_pos_legacy_ops - wifi pos module legacy callbacks
|
||||
* @pasn_peer_create_cb: PASN peer create callback
|
||||
* @pasn_peer_delete_cb: PASN peer delete callback
|
||||
*/
|
||||
struct wifi_pos_legacy_ops {
|
||||
QDF_STATUS (*pasn_peer_create_cb)(struct wlan_objmgr_psoc *psoc,
|
||||
struct qdf_mac_addr *peer_addr,
|
||||
uint8_t vdev_id);
|
||||
QDF_STATUS (*pasn_peer_delete_cb)(struct wlan_objmgr_psoc *psoc,
|
||||
struct qdf_mac_addr *peer_addr,
|
||||
uint8_t vdev_id,
|
||||
bool no_fw_peer_delete);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wifi_pos_psoc_priv_obj - psoc obj data for wifi_pos
|
||||
* @app_pid: pid of app registered to host driver
|
||||
@@ -251,6 +267,7 @@ typedef void (*wifi_pos_send_rsp_handler)(struct wlan_objmgr_psoc *, uint32_t,
|
||||
* @wifi_pos_measurement_request_notification: Call this API when the driver
|
||||
* receives measurement request
|
||||
* from the LOWI application
|
||||
* @legacy_ops: wifi pos legacy callbacks
|
||||
* @rsp_version: rsp version
|
||||
*
|
||||
* wifi pos request messages
|
||||
@@ -290,6 +307,7 @@ struct wifi_pos_psoc_priv_obj {
|
||||
|
||||
qdf_spinlock_t wifi_pos_lock;
|
||||
bool oem_6g_support_disable;
|
||||
struct wifi_pos_legacy_ops *legacy_ops;
|
||||
QDF_STATUS (*wifi_pos_req_handler)(struct wlan_objmgr_psoc *psoc,
|
||||
struct wifi_pos_req_msg *req);
|
||||
wifi_pos_send_rsp_handler wifi_pos_send_rsp;
|
||||
@@ -391,5 +409,15 @@ uint32_t wifi_pos_get_app_pid(struct wlan_objmgr_psoc *psoc);
|
||||
*/
|
||||
bool wifi_pos_is_app_registered(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* wifi_pos_get_vdev_priv_obj() - Get WIfi pos module vdev private
|
||||
* object
|
||||
* @vdev: vdev pointer
|
||||
*
|
||||
* Return: Pointer to vdev private obj
|
||||
*/
|
||||
struct wifi_pos_vdev_priv_obj *
|
||||
wifi_pos_get_vdev_priv_obj(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
#endif /* _WIFI_POS_UTILS_H_ */
|
||||
#endif /* WIFI_POS_CONVERGED */
|
||||
|
@@ -32,6 +32,71 @@
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include "wlan_lmac_if_def.h"
|
||||
|
||||
struct wlan_lmac_if_wifi_pos_rx_ops *
|
||||
wifi_pos_get_rx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_rx_ops *rx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
wifi_pos_err("psoc is null");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
|
||||
if (!rx_ops) {
|
||||
wifi_pos_err("rx_ops is NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &rx_ops->wifi_pos_rx_ops;
|
||||
}
|
||||
|
||||
struct wifi_pos_legacy_ops *
|
||||
wifi_pos_get_legacy_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wifi_pos_psoc_priv_obj *wifi_pos_obj =
|
||||
wifi_pos_get_psoc_priv_obj(psoc);
|
||||
|
||||
if (!wifi_pos_obj)
|
||||
return NULL;
|
||||
|
||||
return wifi_pos_obj->legacy_ops;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wifi_pos_set_legacy_ops(struct wlan_objmgr_psoc *psoc,
|
||||
struct wifi_pos_legacy_ops *legacy_ops)
|
||||
{
|
||||
struct wifi_pos_psoc_priv_obj *wifi_pos_obj =
|
||||
wifi_pos_get_psoc_priv_obj(psoc);
|
||||
|
||||
if (!wifi_pos_obj)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
wifi_pos_obj->legacy_ops = legacy_ops;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
struct wlan_lmac_if_wifi_pos_tx_ops *
|
||||
wifi_pos_get_tx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_tx_ops *tx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
wifi_pos_err("psoc is null");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
|
||||
if (!tx_ops) {
|
||||
wifi_pos_err("tx_ops is NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &tx_ops->wifi_pos_tx_ops;
|
||||
}
|
||||
|
||||
QDF_STATUS wifi_pos_init(void)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
@@ -57,8 +122,44 @@ QDF_STATUS wifi_pos_init(void)
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wifi_pos_err("register_psoc_destroy_handler failed, status: %d",
|
||||
status);
|
||||
goto fail_psoc_destroy_handler;
|
||||
}
|
||||
|
||||
status = wlan_objmgr_register_vdev_create_handler(
|
||||
WLAN_UMAC_COMP_WIFI_POS,
|
||||
wifi_pos_vdev_created_notification, NULL);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wifi_pos_err("register_vdev_create_handler failed, status: %d",
|
||||
status);
|
||||
goto fail_vdev_create_handler;
|
||||
}
|
||||
|
||||
status = wlan_objmgr_register_vdev_destroy_handler(
|
||||
WLAN_UMAC_COMP_WIFI_POS,
|
||||
wifi_pos_vdev_destroyed_notification, NULL);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wifi_pos_err("register_vdev_destroy_handler failed, status: %d",
|
||||
status);
|
||||
goto fail_vdev_destroy_handler;
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
fail_vdev_destroy_handler:
|
||||
wlan_objmgr_unregister_vdev_create_handler(
|
||||
WLAN_UMAC_COMP_WIFI_POS,
|
||||
wifi_pos_vdev_created_notification, NULL);
|
||||
|
||||
fail_vdev_create_handler:
|
||||
wlan_objmgr_unregister_psoc_destroy_handler(
|
||||
WLAN_UMAC_COMP_WIFI_POS,
|
||||
wifi_pos_psoc_obj_destroyed_notification, NULL);
|
||||
|
||||
fail_psoc_destroy_handler:
|
||||
wlan_objmgr_unregister_psoc_create_handler(
|
||||
WLAN_UMAC_COMP_WIFI_POS,
|
||||
wifi_pos_psoc_obj_created_notification, NULL);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -66,6 +167,20 @@ QDF_STATUS wifi_pos_deinit(void)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
status = wlan_objmgr_unregister_vdev_destroy_handler(
|
||||
WLAN_UMAC_COMP_WIFI_POS,
|
||||
wifi_pos_vdev_destroyed_notification, NULL);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
wifi_pos_err("unregister_vdev_destroy_handler failed, status: %d",
|
||||
status);
|
||||
|
||||
status = wlan_objmgr_unregister_vdev_create_handler(
|
||||
WLAN_UMAC_COMP_WIFI_POS,
|
||||
wifi_pos_vdev_created_notification, NULL);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
wifi_pos_err("unregister_vdev_create_handler failed, status: %d",
|
||||
status);
|
||||
|
||||
/* deregister psoc create handler functions. */
|
||||
status = wlan_objmgr_unregister_psoc_create_handler(
|
||||
WLAN_UMAC_COMP_WIFI_POS,
|
||||
|
@@ -84,44 +84,6 @@ static bool wifi_pos_get_tlv_support(struct wlan_objmgr_psoc *psoc)
|
||||
return true;
|
||||
}
|
||||
|
||||
struct wlan_lmac_if_wifi_pos_tx_ops *
|
||||
wifi_pos_get_tx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_tx_ops *tx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
wifi_pos_err("psoc is null");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
|
||||
if (!tx_ops) {
|
||||
wifi_pos_err("tx_ops is NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &tx_ops->wifi_pos_tx_ops;
|
||||
}
|
||||
|
||||
struct wlan_lmac_if_wifi_pos_rx_ops *
|
||||
wifi_pos_get_rx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_rx_ops *rx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
wifi_pos_err("psoc is null");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
|
||||
if (!rx_ops) {
|
||||
wifi_pos_err("rx_ops is NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &rx_ops->wifi_pos_rx_ops;
|
||||
}
|
||||
|
||||
#ifdef CNSS_GENL
|
||||
static uint8_t *
|
||||
wifi_pos_prepare_reg_resp(uint32_t *rsp_len,
|
||||
@@ -1031,6 +993,80 @@ QDF_STATUS wifi_pos_psoc_obj_destroyed_notification(
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
wifi_pos_init_11az_context(struct wifi_pos_vdev_priv_obj *vdev_pos_obj)
|
||||
{
|
||||
struct wifi_pos_11az_context *pasn_context;
|
||||
uint8_t i;
|
||||
|
||||
pasn_context = &vdev_pos_obj->pasn_context;
|
||||
for (i = 0; i < WLAN_MAX_11AZ_PEERS; i++) {
|
||||
qdf_set_macaddr_broadcast(
|
||||
&pasn_context->secure_peer_list[i].peer_mac);
|
||||
qdf_set_macaddr_broadcast(
|
||||
&pasn_context->secure_peer_list[i].self_mac);
|
||||
pasn_context->secure_peer_list[i].force_self_mac_usage = false;
|
||||
pasn_context->secure_peer_list[i].control_flags = 0;
|
||||
qdf_set_macaddr_broadcast(
|
||||
&pasn_context->unsecure_peer_list[i].peer_mac);
|
||||
qdf_set_macaddr_broadcast(&pasn_context->failed_peer_list[i]);
|
||||
}
|
||||
|
||||
pasn_context->num_secure_peers = 0;
|
||||
pasn_context->num_unsecure_peers = 0;
|
||||
pasn_context->num_failed_peers = 0;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wifi_pos_vdev_created_notification(struct wlan_objmgr_vdev *vdev,
|
||||
void *arg_list)
|
||||
{
|
||||
struct wifi_pos_vdev_priv_obj *vdev_pos_obj;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
vdev_pos_obj = qdf_mem_malloc(sizeof(*vdev_pos_obj));
|
||||
if (!vdev_pos_obj)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
status = wlan_objmgr_vdev_component_obj_attach(vdev,
|
||||
WLAN_UMAC_COMP_WIFI_POS,
|
||||
vdev_pos_obj,
|
||||
QDF_STATUS_SUCCESS);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
qdf_mem_free(vdev_pos_obj);
|
||||
wifi_pos_err("Wifi pos vdev attach failed");
|
||||
return status;
|
||||
}
|
||||
|
||||
wifi_pos_init_11az_context(vdev_pos_obj);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wifi_pos_vdev_destroyed_notification(struct wlan_objmgr_vdev *vdev,
|
||||
void *arg_list)
|
||||
{
|
||||
struct wifi_pos_vdev_priv_obj *vdev_pos_obj;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
vdev_pos_obj = wifi_pos_get_vdev_priv_obj(vdev);
|
||||
if (!vdev_pos_obj) {
|
||||
wifi_pos_err("Wifi pos vdev priv obj is null");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
status = wlan_objmgr_vdev_component_obj_detach(vdev,
|
||||
WLAN_UMAC_COMP_WIFI_POS,
|
||||
vdev_pos_obj);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
wifi_pos_err("Detach vdev private obj failed");
|
||||
|
||||
qdf_mem_free(vdev_pos_obj);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int wifi_pos_oem_rsp_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct oem_data_rsp *oem_rsp)
|
||||
{
|
||||
|
@@ -61,6 +61,30 @@ QDF_STATUS wifi_pos_psoc_obj_created_notification(
|
||||
QDF_STATUS wifi_pos_psoc_obj_destroyed_notification(
|
||||
struct wlan_objmgr_psoc *psoc, void *arg_list);
|
||||
|
||||
/**
|
||||
* wifi_pos_vdev_created_notification() - Vdev created notification callback
|
||||
* @vdev: Vdev object
|
||||
* @arg_list: argument list
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wifi_pos_vdev_created_notification(struct wlan_objmgr_vdev *vdev,
|
||||
void *arg_list);
|
||||
|
||||
/**
|
||||
* wifi_pos_vdev_destroyed_notification() - Wifi Pos vdev destroyed callback
|
||||
* @vdev: Vdev object
|
||||
* @arg_list: argument list
|
||||
*
|
||||
* This function will detach the Wifi Pos vdev private object and free it
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wifi_pos_vdev_destroyed_notification(struct wlan_objmgr_vdev *vdev,
|
||||
void *arg_list);
|
||||
|
||||
/**
|
||||
* wifi_pos_oem_rsp_handler: lmac rx ops registered
|
||||
* @psoc: pointer to psoc object
|
||||
@@ -70,22 +94,4 @@ QDF_STATUS wifi_pos_psoc_obj_destroyed_notification(
|
||||
*/
|
||||
int wifi_pos_oem_rsp_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct oem_data_rsp *oem_rsp);
|
||||
|
||||
/**
|
||||
* wifi_pos_get_tx_ops: api to get tx ops
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: tx ops
|
||||
*/
|
||||
struct wlan_lmac_if_wifi_pos_tx_ops *
|
||||
wifi_pos_get_tx_ops(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* wifi_pos_get_rx_ops: api to get rx ops
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: rx ops
|
||||
*/
|
||||
struct wlan_lmac_if_wifi_pos_rx_ops *
|
||||
wifi_pos_get_rx_ops(struct wlan_objmgr_psoc *psoc);
|
||||
#endif
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2019 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
|
||||
@@ -109,3 +109,16 @@ struct wifi_pos_psoc_priv_obj *wifi_pos_get_psoc_priv_obj(
|
||||
}
|
||||
|
||||
qdf_export_symbol(wifi_pos_get_psoc_priv_obj);
|
||||
|
||||
struct wifi_pos_vdev_priv_obj *
|
||||
wifi_pos_get_vdev_priv_obj(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
struct wifi_pos_vdev_priv_obj *vdev_obj;
|
||||
|
||||
vdev_obj = wlan_objmgr_vdev_get_comp_private_obj(
|
||||
vdev, WLAN_UMAC_COMP_WIFI_POS);
|
||||
|
||||
return vdev_obj;
|
||||
}
|
||||
|
||||
qdf_export_symbol(wifi_pos_get_vdev_priv_obj);
|
||||
|
Reference in New Issue
Block a user