qcacld-3.0: Add support for audio transport switch vendor command
Based on the new requirement, add support for vendor command to switch the audio transport bearer. Change-Id: I1d3b74c18976b0927ebba228b73af5a10cc67391 CRs-Fixed: 3582788
This commit is contained in:

committed by
Rahul Choudhary

parent
d700e98e6a
commit
a0ad067df0
1
Kbuild
1
Kbuild
@@ -139,6 +139,7 @@ HDD_OBJS := $(HDD_SRC_DIR)/wlan_hdd_assoc.o \
|
|||||||
$(HDD_SRC_DIR)/wlan_hdd_tx_rx.o \
|
$(HDD_SRC_DIR)/wlan_hdd_tx_rx.o \
|
||||||
$(HDD_SRC_DIR)/wlan_hdd_wmm.o \
|
$(HDD_SRC_DIR)/wlan_hdd_wmm.o \
|
||||||
$(HDD_SRC_DIR)/wlan_hdd_wowl.o\
|
$(HDD_SRC_DIR)/wlan_hdd_wowl.o\
|
||||||
|
$(HDD_SRC_DIR)/wlan_hdd_ll_lt_sap.o\
|
||||||
|
|
||||||
ifeq ($(CONFIG_UNIT_TEST), y)
|
ifeq ($(CONFIG_UNIT_TEST), y)
|
||||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_unit_test.o
|
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_unit_test.o
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include "wlan_ll_sap_main.h"
|
#include "wlan_ll_sap_main.h"
|
||||||
#include <wlan_objmgr_global_obj.h>
|
#include <wlan_objmgr_global_obj.h>
|
||||||
|
#include "qca_vendor.h"
|
||||||
|
|
||||||
static QDF_STATUS ll_sap_psoc_obj_created_notification(struct wlan_objmgr_psoc *psoc, void *arg_list)
|
static QDF_STATUS ll_sap_psoc_obj_created_notification(struct wlan_objmgr_psoc *psoc, void *arg_list)
|
||||||
{
|
{
|
||||||
@@ -92,3 +93,23 @@ QDF_STATUS ll_sap_deinit(void)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDF_STATUS ll_lt_sap_request_for_audio_transport_switch(
|
||||||
|
uint8_t transport_switch_type)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* return status as QDF_STATUS_SUCCESS or failure based on the current
|
||||||
|
* pending requests of the transport switch
|
||||||
|
*/
|
||||||
|
if (transport_switch_type ==
|
||||||
|
QCA_WLAN_AUDIO_TRANSPORT_SWITCH_TYPE_NON_WLAN) {
|
||||||
|
ll_sap_debug("request SWITCH_TYPE_NON_WLAN accepted");
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
} else if (transport_switch_type ==
|
||||||
|
QCA_WLAN_AUDIO_TRANSPORT_SWITCH_TYPE_WLAN) {
|
||||||
|
ll_sap_debug("request SWITCH_TYPE_WLAN accepted");
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QDF_STATUS_E_RESOURCES;
|
||||||
|
}
|
||||||
|
@@ -48,4 +48,14 @@ QDF_STATUS ll_sap_init(void);
|
|||||||
*/
|
*/
|
||||||
QDF_STATUS ll_sap_deinit(void);
|
QDF_STATUS ll_sap_deinit(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ll_lt_sap_request_for_audio_transport_switch() - Check if audio transport
|
||||||
|
* switch request can be supported or not
|
||||||
|
* @transport_switch_type: requested transport switch type
|
||||||
|
*
|
||||||
|
* Return: True/False
|
||||||
|
*/
|
||||||
|
QDF_STATUS ll_lt_sap_request_for_audio_transport_switch(
|
||||||
|
uint8_t transport_switch_type);
|
||||||
|
|
||||||
#endif /* _WLAN_LL_SAP_MAIN_H_ */
|
#endif /* _WLAN_LL_SAP_MAIN_H_ */
|
||||||
|
@@ -46,6 +46,16 @@ QDF_STATUS ucfg_ll_sap_deinit(void);
|
|||||||
*/
|
*/
|
||||||
bool ucfg_is_ll_lt_sap_supported(void);
|
bool ucfg_is_ll_lt_sap_supported(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ucfg_ll_lt_sap_request_for_audio_transport_switch() - Request to switch the
|
||||||
|
* audio transport medium
|
||||||
|
* @transport_switch_type: Requested transport switch type
|
||||||
|
*
|
||||||
|
* Return: Accepted/Rejected
|
||||||
|
*/
|
||||||
|
QDF_STATUS ucfg_ll_lt_sap_request_for_audio_transport_switch(
|
||||||
|
uint8_t transport_switch_type);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
static inline QDF_STATUS ucfg_ll_sap_init(void)
|
static inline QDF_STATUS ucfg_ll_sap_init(void)
|
||||||
{
|
{
|
||||||
@@ -62,6 +72,12 @@ static inline bool ucfg_is_ll_lt_sap_supported(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline QDF_STATUS
|
||||||
|
ucfg_ll_lt_sap_request_for_audio_transport_switch(uint8_t transport_switch_type)
|
||||||
|
{
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* WLAN_FEATURE_LL_LT_SAP */
|
#endif /* WLAN_FEATURE_LL_LT_SAP */
|
||||||
#endif /* _WLAN_LL_SAP_UCFG_API_H_ */
|
#endif /* _WLAN_LL_SAP_UCFG_API_H_ */
|
||||||
|
|
||||||
|
@@ -38,3 +38,10 @@ bool ucfg_is_ll_lt_sap_supported(void)
|
|||||||
return ll_lt_sap_is_supported();
|
return ll_lt_sap_is_supported();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDF_STATUS ucfg_ll_lt_sap_request_for_audio_transport_switch(
|
||||||
|
uint8_t transport_switch_type)
|
||||||
|
{
|
||||||
|
return ll_lt_sap_request_for_audio_transport_switch(
|
||||||
|
transport_switch_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
60
core/hdd/inc/wlan_hdd_ll_lt_sap.h
Normal file
60
core/hdd/inc/wlan_hdd_ll_lt_sap.h
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
|
* above copyright notice and this permission notice appear in all
|
||||||
|
* copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||||
|
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||||
|
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||||
|
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||||
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DOC: contains ll_lt_sap_declarations specific to the ll_lt_sap module
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __WLAN_HDD_LL_LT_SAP_H
|
||||||
|
#define __WLAN_HDD_LL_LT_SAP_H
|
||||||
|
|
||||||
|
#include "wlan_hdd_main.h"
|
||||||
|
#include "qca_vendor.h"
|
||||||
|
|
||||||
|
extern const struct nla_policy
|
||||||
|
wlan_hdd_ll_lt_sap_transport_switch_policy
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_MAX + 1];
|
||||||
|
|
||||||
|
#define FEATURE_LL_LT_SAP_VENDOR_COMMANDS \
|
||||||
|
{ \
|
||||||
|
.info.vendor_id = QCA_NL80211_VENDOR_ID, \
|
||||||
|
.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_AUDIO_TRANSPORT_SWITCH, \
|
||||||
|
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
|
||||||
|
WIPHY_VENDOR_CMD_NEED_NETDEV | \
|
||||||
|
WIPHY_VENDOR_CMD_NEED_RUNNING, \
|
||||||
|
.doit = wlan_hdd_cfg80211_ll_lt_sap_transport_switch, \
|
||||||
|
vendor_command_policy(wlan_hdd_ll_lt_sap_transport_switch_policy, \
|
||||||
|
QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_MAX)\
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_hdd_cfg80211_ll_lt_sap_transport_switch() - Request to switch the
|
||||||
|
* transport
|
||||||
|
* @wiphy: pointer to wireless wiphy structure.
|
||||||
|
* @wdev: pointer to wireless_dev structure.
|
||||||
|
* @data: Pointer to the data to be passed via vendor interface
|
||||||
|
* @data_len:Length of the data to be passed
|
||||||
|
*
|
||||||
|
* Return: Return the Success or Failure code.
|
||||||
|
*/
|
||||||
|
int wlan_hdd_cfg80211_ll_lt_sap_transport_switch(struct wiphy *wiphy,
|
||||||
|
struct wireless_dev *wdev,
|
||||||
|
const void *data,
|
||||||
|
int data_len);
|
||||||
|
|
||||||
|
#endif /* __WLAN_HDD_LL_LT_SAP_H */
|
@@ -210,6 +210,7 @@
|
|||||||
#include "wlan_mlo_epcs_ucfg_api.h"
|
#include "wlan_mlo_epcs_ucfg_api.h"
|
||||||
#include <wlan_ll_sap_ucfg_api.h>
|
#include <wlan_ll_sap_ucfg_api.h>
|
||||||
#include <wlan_mlo_mgr_link_switch.h>
|
#include <wlan_mlo_mgr_link_switch.h>
|
||||||
|
#include <wlan_hdd_ll_lt_sap.h>
|
||||||
/*
|
/*
|
||||||
* A value of 100 (milliseconds) can be sent to FW.
|
* A value of 100 (milliseconds) can be sent to FW.
|
||||||
* FW would enable Tx beamforming based on this.
|
* FW would enable Tx beamforming based on this.
|
||||||
@@ -20452,6 +20453,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = {
|
|||||||
FEATURE_COAP_OFFLOAD_COMMANDS
|
FEATURE_COAP_OFFLOAD_COMMANDS
|
||||||
FEATURE_ML_LINK_STATE_COMMANDS
|
FEATURE_ML_LINK_STATE_COMMANDS
|
||||||
FEATURE_AFC_VENDOR_COMMANDS
|
FEATURE_AFC_VENDOR_COMMANDS
|
||||||
|
FEATURE_LL_LT_SAP_VENDOR_COMMANDS
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hdd_context *hdd_cfg80211_wiphy_alloc(void)
|
struct hdd_context *hdd_cfg80211_wiphy_alloc(void)
|
||||||
|
131
core/hdd/src/wlan_hdd_ll_lt_sap.c
Normal file
131
core/hdd/src/wlan_hdd_ll_lt_sap.c
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
|
* above copyright notice and this permission notice appear in all
|
||||||
|
* copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||||
|
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||||
|
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||||
|
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||||
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DOC: contains ll_lt_sap_definitions specific to the ll_lt_sap module
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "wlan_hdd_ll_lt_sap.h"
|
||||||
|
#include "wlan_ll_sap_ucfg_api.h"
|
||||||
|
#include "osif_sync.h"
|
||||||
|
|
||||||
|
const struct nla_policy
|
||||||
|
wlan_hdd_ll_lt_sap_transport_switch_policy
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_MAX + 1] = {
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_TYPE] = {
|
||||||
|
.type = NLA_U8},
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_STATUS] = {
|
||||||
|
.type = NLA_U8},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __wlan_hdd_cfg80211_ll_lt_sap_transport_switch() - Request to switch the
|
||||||
|
* transport
|
||||||
|
* @wiphy: pointer to wireless wiphy structure.
|
||||||
|
* @wdev: pointer to wireless_dev structure.
|
||||||
|
* @data: Pointer to the data to be passed via vendor interface
|
||||||
|
* @data_len:Length of the data to be passed
|
||||||
|
*
|
||||||
|
* Return: Return the Success or Failure code.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
__wlan_hdd_cfg80211_ll_lt_sap_transport_switch(struct wiphy *wiphy,
|
||||||
|
struct wireless_dev *wdev,
|
||||||
|
const void *data,
|
||||||
|
int data_len)
|
||||||
|
{
|
||||||
|
struct net_device *dev = wdev->netdev;
|
||||||
|
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
||||||
|
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||||
|
struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_MAX + 1];
|
||||||
|
uint8_t transport_switch_type;
|
||||||
|
uint8_t transport_switch_status;
|
||||||
|
QDF_STATUS status;
|
||||||
|
|
||||||
|
hdd_enter_dev(dev);
|
||||||
|
|
||||||
|
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
||||||
|
hdd_err("Command not allowed in FTM mode");
|
||||||
|
return -EPERM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 != wlan_hdd_validate_context(hdd_ctx))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (!adapter)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (wlan_cfg80211_nla_parse(
|
||||||
|
tb, QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_MAX,
|
||||||
|
data, data_len,
|
||||||
|
wlan_hdd_ll_lt_sap_transport_switch_policy)) {
|
||||||
|
hdd_err("Invalid attribute");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!tb[QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_TYPE]) {
|
||||||
|
hdd_err("attr transport switch type failed");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
transport_switch_type = nla_get_u8(
|
||||||
|
tb[QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_TYPE]);
|
||||||
|
|
||||||
|
if (!tb[QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_STATUS]) {
|
||||||
|
status = ucfg_ll_lt_sap_request_for_audio_transport_switch(
|
||||||
|
transport_switch_type);
|
||||||
|
hdd_debug("Transport switch request type %d status %d",
|
||||||
|
transport_switch_type, status);
|
||||||
|
return qdf_status_to_os_return(status);
|
||||||
|
}
|
||||||
|
|
||||||
|
transport_switch_status = nla_get_u8(
|
||||||
|
tb[QCA_WLAN_VENDOR_ATTR_AUDIO_TRANSPORT_SWITCH_STATUS]);
|
||||||
|
|
||||||
|
if (transport_switch_status ==
|
||||||
|
QCA_WLAN_AUDIO_TRANSPORT_SWITCH_STATUS_COMPLETED) {
|
||||||
|
hdd_debug("Transport switch request completed");
|
||||||
|
return 0;
|
||||||
|
} else if (transport_switch_status ==
|
||||||
|
QCA_WLAN_AUDIO_TRANSPORT_SWITCH_STATUS_REJECTED) {
|
||||||
|
hdd_debug("Transport switch request rejected");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hdd_err("Invalid transport switch status");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wlan_hdd_cfg80211_ll_lt_sap_transport_switch(struct wiphy *wiphy,
|
||||||
|
struct wireless_dev *wdev,
|
||||||
|
const void *data,
|
||||||
|
int data_len)
|
||||||
|
{
|
||||||
|
int errno;
|
||||||
|
struct osif_vdev_sync *vdev_sync;
|
||||||
|
|
||||||
|
errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
|
||||||
|
if (errno)
|
||||||
|
return errno;
|
||||||
|
|
||||||
|
errno = __wlan_hdd_cfg80211_ll_lt_sap_transport_switch(wiphy, wdev,
|
||||||
|
data, data_len);
|
||||||
|
|
||||||
|
osif_vdev_sync_op_stop(vdev_sync);
|
||||||
|
|
||||||
|
return errno;
|
||||||
|
}
|
@@ -523,6 +523,7 @@ _fixed_srcs = [
|
|||||||
"core/hdd/src/wlan_hdd_hostapd.c",
|
"core/hdd/src/wlan_hdd_hostapd.c",
|
||||||
"core/hdd/src/wlan_hdd_ioctl.c",
|
"core/hdd/src/wlan_hdd_ioctl.c",
|
||||||
"core/hdd/src/wlan_hdd_main.c",
|
"core/hdd/src/wlan_hdd_main.c",
|
||||||
|
"core/hdd/src/wlan_hdd_ll_lt_sap.c",
|
||||||
"core/hdd/src/wlan_hdd_object_manager.c",
|
"core/hdd/src/wlan_hdd_object_manager.c",
|
||||||
"core/hdd/src/wlan_hdd_oemdata.c",
|
"core/hdd/src/wlan_hdd_oemdata.c",
|
||||||
"core/hdd/src/wlan_hdd_p2p.c",
|
"core/hdd/src/wlan_hdd_p2p.c",
|
||||||
|
Reference in New Issue
Block a user