qcacld-3.0: API to send UT commands to LPASS using QMI

Add API to send unit test commands using QMI messages
to generate direct link traffic from LPASS.

Change-Id: I68b69303ef715677f6056c1f6c4d336466720f45
CRs-Fixed: 3362513
Šī revīzija ir iekļauta:
Ananya Gupta
2022-12-16 13:49:24 +05:30
revīziju iesūtīja Madan Koyyalamudi
vecāks 44fa5da8e1
revīzija 605019d3b1
4 mainīti faili ar 243 papildinājumiem un 4 dzēšanām

Parādīt failu

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-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
@@ -38,6 +38,39 @@
#define QMI_WFDS_TIMEOUT_JF \
qdf_system_msecs_to_ticks(QMI_WFDS_TIMEOUT_MS)
/**
* enum os_if_qmi_wfds_ut_cmd_type - WFDS unit test command type
* @WFDS_STOP_TRAFFIC: Stop WFDS traffic
* @WFDS_START_TRAFFIC: Start WFDS Traffic
* @WFDS_GET_STATS: Get WFDS traffic stats
*/
enum os_if_qmi_wfds_ut_cmd_type {
WFDS_STOP_TRAFFIC,
WFDS_START_TRAFFIC,
WFDS_GET_STATS
};
/**
* struct os_if_qmi_wfds_ut_cmd_info - WFDS UT cmd info structure
* @cmd: Command type
* @duration: Traffic duration
* @num_pkts: Buffers per flush
* @flush_period: Buffer flushing periodicity
* @buf_size: Buffer size
* @ether_type: ether_type of packet
* @dest_mac: Destination MAC address
* @src_mac: Source MAC address
*/
struct os_if_qmi_wfds_ut_cmd_info {
enum os_if_qmi_wfds_ut_cmd_type cmd;
uint32_t duration;
uint32_t flush_period;
uint32_t num_pkts;
uint32_t buf_size;
uint16_t ether_type;
struct qdf_mac_addr src_mac;
struct qdf_mac_addr dest_mac;
};
#ifdef QMI_COMPONENT_ENABLE
/**
@@ -151,11 +184,26 @@ void os_if_qmi_register_callbacks(struct wlan_objmgr_psoc *psoc,
* Return: None
*/
void os_if_qmi_wfds_register_callbacks(struct wlan_qmi_psoc_callbacks *cb_obj);
/**
* os_if_qmi_wfds_send_ut_cmd_req_msg() - Send WFDS unit test command
* @cmd_info: Unit test command info
*
* Return: QDF_STATUS
*/
QDF_STATUS
os_if_qmi_wfds_send_ut_cmd_req_msg(struct os_if_qmi_wfds_ut_cmd_info *cmd_info);
#else
static inline
void os_if_qmi_wfds_register_callbacks(struct wlan_qmi_psoc_callbacks *cb_obj)
{
}
static inline QDF_STATUS
os_if_qmi_wfds_send_ut_cmd_req_msg(struct os_if_qmi_wfds_ut_cmd_info *cmd_info)
{
}
#endif
#else
static inline

Parādīt failu

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-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
@@ -23,11 +23,13 @@
#define WFDS_SERVICE_VERS_V01 0x01
#define QMI_WFDS_IPCC_MAP_N_CFG_RESP_V01 0x0003
#define QMI_WFDS_UT_CMD_RESP_V01 0x0005
#define QMI_WFDS_MISC_REQ_V01 0x0004
#define QMI_WFDS_MISC_RESP_V01 0x0004
#define QMI_WFDS_MEM_RESP_V01 0x0002
#define QMI_WFDS_IPCC_MAP_N_CFG_REQ_V01 0x0003
#define QMI_WFDS_MISC_IND_V01 0x0004
#define QMI_WFDS_UT_CMD_REQ_V01 0x0005
#define QMI_WFDS_CONFIG_REQ_V01 0x0001
#define QMI_WFDS_IPCC_MAP_N_CFG_IND_V01 0x0003
#define QMI_WFDS_CONFIG_RESP_V01 0x0001
@@ -289,4 +291,45 @@ struct wfds_misc_ind_msg_v01 {
#define WFDS_MISC_IND_MSG_V01_MAX_MSG_LEN 7
extern struct qmi_elem_info wfds_misc_ind_msg_v01_ei[];
/**
* enum wifi_drv_qmi_ut_cmd_v01 - driver event
* @WIFI_DRV_QMI_UT_CMD_MIN_VAL_V01: event enum min value
* @WFDS_UT_CMD_STOP_V01: Stop WFDS traffic
* @WFDS_UT_CMD_START_V01: Start WFDS Traffic
* @WFDS_UT_CMD_STATS_V01: Get WFDS traffic stats
* @WIFI_DRV_QMI_UT_CMD_MAX_VAL_V01: event enum max value
*/
enum wifi_drv_qmi_ut_cmd_v01 {
WIFI_DRV_QMI_UT_CMD_MIN_VAL_V01 = INT_MIN,
WFDS_UT_CMD_STOP_V01 = 0,
WFDS_UT_CMD_START_V01 = 1,
WFDS_UT_CMD_STATS_V01 = 2,
WIFI_DRV_QMI_UT_CMD_MAX_VAL_V01 = INT_MAX,
};
/**
* struct wfds_ut_cmd_req_msg_v01 - WFDS QMI UT cmd info structure
* @cmd: Command type
* @duration: Traffic duration
* @flush_period: Buffer flushing periodicity
* @num_pkts: Number of packets per flush
* @buf_size: Buffer size
* @ether_type: ether_type of packet
* @src_mac: Source MAC address
* @dest_mac: Destination MAC address
*/
struct wfds_ut_cmd_req_msg_v01 {
enum wifi_drv_qmi_ut_cmd_v01 cmd;
u32 duration;
u32 flush_period;
u32 num_pkts;
u32 buf_size;
u16 ether_type;
u8 src_mac[6];
u8 dest_mac[6];
};
#define WFDS_UT_CMD_REQ_MSG_V01_MAX_MSG_LEN 58
extern struct qmi_elem_info wfds_ut_cmd_req_msg_v01_ei[];
#endif

Parādīt failu

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-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
@@ -410,6 +410,66 @@ static void os_if_wfds_ipcc_map_n_cfg_ind_cb(struct qmi_handle *qmi_hdl,
ucfg_dp_wfds_handle_ipcc_map_n_cfg_ind(&ipcc_ind_msg);
}
QDF_STATUS
os_if_qmi_wfds_send_ut_cmd_req_msg(struct os_if_qmi_wfds_ut_cmd_info *cmd_info)
{
struct wfds_ut_cmd_req_msg_v01 *req;
struct wfds_gen_resp_msg_v01 *resp;
struct qmi_txn txn;
QDF_STATUS status;
int i;
req = qdf_mem_malloc(sizeof(*req));
if (!req)
return QDF_STATUS_E_NOMEM;
resp = qdf_mem_malloc(sizeof(*resp));
if (!resp) {
qdf_mem_free(req);
return QDF_STATUS_E_NOMEM;
}
req->cmd = cmd_info->cmd;
req->duration = cmd_info->duration;
req->flush_period = cmd_info->flush_period;
req->num_pkts = cmd_info->num_pkts;
req->buf_size = cmd_info->buf_size;
req->ether_type = cmd_info->ether_type;
for (i = 0; i < QDF_MAC_ADDR_SIZE; i++) {
req->src_mac[i] = cmd_info->src_mac.bytes[i];
req->dest_mac[i] = cmd_info->dest_mac.bytes[i];
}
osif_debug("cmd: %u for duration: %u s, flush period: %u ms",
req->cmd, req->duration, req->flush_period);
status = os_if_qmi_txn_init(&qmi_wfds, &txn, wfds_gen_resp_msg_v01_ei,
resp);
if (QDF_IS_STATUS_ERROR(status)) {
osif_info("QMI transaction for WFDS unit test cmd init failed");
goto out;
}
status = os_if_qmi_send_request(&qmi_wfds, NULL, &txn,
QMI_WFDS_UT_CMD_REQ_V01,
WFDS_UT_CMD_REQ_MSG_V01_MAX_MSG_LEN,
wfds_ut_cmd_req_msg_v01_ei, req);
status = os_if_qmi_txn_wait(&txn, QMI_WFDS_TIMEOUT_JF);
if (QDF_IS_STATUS_ERROR(status)) {
osif_info("Failed to wait for unit test cmd response");
goto out;
}
qdf_assert(resp->resp.result == QMI_RESULT_SUCCESS_V01);
out:
qdf_mem_free(resp);
qdf_mem_free(req);
return status;
}
/**
* os_if_qmi_wfds_new_server() - New server callback triggered when service is
* up.

Parādīt failu

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-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
@@ -487,3 +487,91 @@ struct qmi_elem_info wfds_misc_ind_msg_v01_ei[] = {
.tlv_type = QMI_COMMON_TLV_TYPE,
},
};
struct qmi_elem_info wfds_ut_cmd_req_msg_v01_ei[] = {
{
.data_type = QMI_SIGNED_4_BYTE_ENUM,
.elem_len = 1,
.elem_size = sizeof(enum wifi_drv_qmi_ut_cmd_v01),
.array_type = NO_ARRAY,
.tlv_type = 0x01,
.offset = offsetof(struct
wfds_ut_cmd_req_msg_v01,
cmd),
},
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
.elem_size = sizeof(u32),
.array_type = NO_ARRAY,
.tlv_type = 0x02,
.offset = offsetof(struct
wfds_ut_cmd_req_msg_v01,
duration),
},
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
.elem_size = sizeof(u32),
.array_type = NO_ARRAY,
.tlv_type = 0x03,
.offset = offsetof(struct
wfds_ut_cmd_req_msg_v01,
flush_period),
},
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
.elem_size = sizeof(u32),
.array_type = NO_ARRAY,
.tlv_type = 0x04,
.offset = offsetof(struct
wfds_ut_cmd_req_msg_v01,
num_pkts),
},
{
.data_type = QMI_UNSIGNED_4_BYTE,
.elem_len = 1,
.elem_size = sizeof(u32),
.array_type = NO_ARRAY,
.tlv_type = 0x05,
.offset = offsetof(struct
wfds_ut_cmd_req_msg_v01,
buf_size),
},
{
.data_type = QMI_UNSIGNED_2_BYTE,
.elem_len = 1,
.elem_size = sizeof(u16),
.array_type = NO_ARRAY,
.tlv_type = 0x06,
.offset = offsetof(struct
wfds_ut_cmd_req_msg_v01,
ether_type),
},
{
.data_type = QMI_UNSIGNED_1_BYTE,
.elem_len = 6,
.elem_size = sizeof(u8),
.array_type = STATIC_ARRAY,
.tlv_type = 0x07,
.offset = offsetof(struct
wfds_ut_cmd_req_msg_v01,
src_mac),
},
{
.data_type = QMI_UNSIGNED_1_BYTE,
.elem_len = 6,
.elem_size = sizeof(u8),
.array_type = STATIC_ARRAY,
.tlv_type = 0x08,
.offset = offsetof(struct
wfds_ut_cmd_req_msg_v01,
dest_mac),
},
{
.data_type = QMI_EOTI,
.array_type = NO_ARRAY,
.tlv_type = QMI_COMMON_TLV_TYPE,
},
};