2019-08-08 09:43:48 +09:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
2021-01-22 05:39:27 +09:00
|
|
|
* Copyright (c) 2018 - 2021, The Linux Foundation. All rights reserved.
|
2021-09-30 20:40:59 +09:00
|
|
|
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
2019-08-08 09:43:48 +09:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _IPA_WDI3_H_
|
|
|
|
#define _IPA_WDI3_H_
|
|
|
|
|
|
|
|
#include <linux/ipa.h>
|
|
|
|
|
|
|
|
#define IPA_HW_WDI3_TCL_DATA_CMD_ER_DESC_SIZE 32
|
|
|
|
#define IPA_HW_WDI3_IPA2FW_ER_DESC_SIZE 8
|
|
|
|
|
|
|
|
#define IPA_HW_WDI3_MAX_ER_DESC_SIZE \
|
|
|
|
(((IPA_HW_WDI3_TCL_DATA_CMD_ER_DESC_SIZE) > \
|
|
|
|
(IPA_HW_WDI3_IPA2FW_ER_DESC_SIZE)) ? \
|
|
|
|
(IPA_HW_WDI3_TCL_DATA_CMD_ER_DESC_SIZE) : \
|
|
|
|
(IPA_HW_WDI3_IPA2FW_ER_DESC_SIZE))
|
|
|
|
|
|
|
|
#define IPA_WDI_MAX_SUPPORTED_SYS_PIPE 3
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
typedef u32 ipa_wdi_hdl_t;
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
enum ipa_wdi_version {
|
|
|
|
IPA_WDI_1,
|
|
|
|
IPA_WDI_2,
|
2021-09-30 20:40:59 +09:00
|
|
|
IPA_WDI_3,
|
|
|
|
IPA_WDI_VER_MAX
|
2019-08-08 09:43:48 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
#define IPA_WDI3_TX_DIR 1
|
2021-01-22 05:39:27 +09:00
|
|
|
#define IPA_WDI3_TX1_DIR 2
|
|
|
|
#define IPA_WDI3_RX_DIR 3
|
2021-09-30 20:40:59 +09:00
|
|
|
#define IPA_WDI_INST_MAX (2)
|
2019-08-08 09:43:48 +09:00
|
|
|
|
2022-02-24 11:51:21 +09:00
|
|
|
/*
|
|
|
|
* <28 bytes of rx_msdu_end_tlv> + <16 bytes of attn_tlv> +
|
|
|
|
* <52 bytes of rx_msdu_start tlv>.
|
|
|
|
*/
|
|
|
|
#define IPA_WDI_RX_TLV_SIZE 96
|
|
|
|
|
|
|
|
/** struct ipa_ast_info_type - structure used for updating the AST table.
|
|
|
|
* @mac_addr_ad4_valid: bool to indicate whethere peer supports 4 address
|
|
|
|
* scheme or not.
|
|
|
|
* @sa_valid: bool to indicate whether SA has a valid entry in AST table.
|
|
|
|
* @first_msdu_in_mpdu_flag: bool to indicate whether current packet is
|
|
|
|
* first frame in mpdu aggregation or not.
|
|
|
|
* @sa_idx: Index to AST table.
|
|
|
|
* @sa_peer_id: TA peer id associated with SA.
|
|
|
|
* @ta_peer_id: TA peer id for the current frame.
|
|
|
|
* @skb: Packet pointer.
|
|
|
|
*/
|
|
|
|
struct ipa_ast_info_type {
|
|
|
|
bool mac_addr_ad4_valid;
|
|
|
|
bool sa_valid;
|
|
|
|
bool first_msdu_in_mpdu_flag;
|
|
|
|
u16 sa_idx;
|
|
|
|
u16 sa_peer_id;
|
|
|
|
u16 ta_peer_id;
|
|
|
|
struct sk_buff *skb;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef void (*ipa_wdi_mesh_ast_notifier_cb)(void *priv, unsigned long data);
|
|
|
|
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* struct ipa_wdi_init_in_params - wdi init input parameters
|
|
|
|
*
|
|
|
|
* @wdi_version: wdi version
|
|
|
|
* @notify: uc ready callback
|
|
|
|
* @priv: uc ready callback cookie
|
2022-02-24 11:51:21 +09:00
|
|
|
* @wdi_notify: bw notification cb
|
|
|
|
* inst_id: Instance ID
|
|
|
|
* @ast_update: AST update needed or not.
|
2019-08-08 09:43:48 +09:00
|
|
|
*/
|
|
|
|
struct ipa_wdi_init_in_params {
|
|
|
|
enum ipa_wdi_version wdi_version;
|
|
|
|
ipa_uc_ready_cb notify;
|
|
|
|
void *priv;
|
|
|
|
#ifdef IPA_WAN_MSG_IPv6_ADDR_GW_LEN
|
|
|
|
ipa_wdi_meter_notifier_cb wdi_notify;
|
|
|
|
#endif
|
2021-09-30 20:40:59 +09:00
|
|
|
int inst_id;
|
2022-02-24 11:51:21 +09:00
|
|
|
bool ast_update;
|
2019-08-08 09:43:48 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ipa_wdi_init_out_params - wdi init output parameters
|
|
|
|
*
|
|
|
|
* @is_uC_ready: is uC ready. No API should be called until uC
|
|
|
|
is ready.
|
|
|
|
* @is_smmu_enable: is smmu enabled
|
|
|
|
* @is_over_gsi: is wdi over GSI or uC
|
|
|
|
*/
|
|
|
|
struct ipa_wdi_init_out_params {
|
|
|
|
bool is_uC_ready;
|
|
|
|
bool is_smmu_enabled;
|
|
|
|
bool is_over_gsi;
|
2021-09-30 20:40:59 +09:00
|
|
|
ipa_wdi_hdl_t hdl;
|
2019-08-08 09:43:48 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ipa_wdi_hdr_info - Header to install on IPA HW
|
|
|
|
*
|
|
|
|
* @hdr: header to install on IPA HW
|
|
|
|
* @hdr_len: length of header
|
|
|
|
* @dst_mac_addr_offset: destination mac address offset
|
|
|
|
* @hdr_type: layer two header type
|
|
|
|
*/
|
|
|
|
struct ipa_wdi_hdr_info {
|
|
|
|
u8 *hdr;
|
|
|
|
u8 hdr_len;
|
|
|
|
u8 dst_mac_addr_offset;
|
|
|
|
enum ipa_hdr_l2_type hdr_type;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ipa_wdi_reg_intf_in_params - parameters for uC offload
|
|
|
|
* interface registration
|
|
|
|
*
|
|
|
|
* @netdev_name: network interface name
|
|
|
|
* @hdr_info: header information
|
|
|
|
* @is_meta_data_valid: if meta data is valid
|
|
|
|
* @meta_data: meta data if any
|
|
|
|
* @meta_data_mask: meta data mask
|
2021-01-22 05:39:27 +09:00
|
|
|
* @is_tx1_used: to indicate whether 2.4g or 5g iface
|
2022-02-24 11:51:21 +09:00
|
|
|
* @is_rx1_used: to indicate whether additional RX pipe for
|
|
|
|
* tagged traffic is needed
|
2019-08-08 09:43:48 +09:00
|
|
|
*/
|
|
|
|
struct ipa_wdi_reg_intf_in_params {
|
|
|
|
const char *netdev_name;
|
2022-06-07 06:16:14 +09:00
|
|
|
struct ipa_wdi_hdr_info hdr_info[IPA_IP_MAX_WLAN];
|
2019-08-08 09:43:48 +09:00
|
|
|
enum ipa_client_type alt_dst_pipe;
|
|
|
|
u8 is_meta_data_valid;
|
|
|
|
u32 meta_data;
|
|
|
|
u32 meta_data_mask;
|
2021-01-22 05:39:27 +09:00
|
|
|
u8 is_tx1_used;
|
2021-09-30 20:40:59 +09:00
|
|
|
ipa_wdi_hdl_t hdl;
|
2022-02-24 11:51:21 +09:00
|
|
|
u8 is_rx1_used;
|
2019-08-08 09:43:48 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ipa_wdi_pipe_setup_info - WDI TX/Rx configuration
|
|
|
|
* @ipa_ep_cfg: ipa endpoint configuration
|
|
|
|
* @client: type of "client"
|
|
|
|
* @transfer_ring_base_pa: physical address of the base of the transfer ring
|
|
|
|
* @transfer_ring_size: size of the transfer ring
|
|
|
|
* @transfer_ring_doorbell_pa: physical address of the doorbell that
|
|
|
|
IPA uC will update the tailpointer of the transfer ring
|
|
|
|
* @is_txr_rn_db_pcie_addr: Bool indicated txr ring DB is pcie or not
|
|
|
|
* @event_ring_base_pa: physical address of the base of the event ring
|
|
|
|
* @event_ring_size: event ring size
|
|
|
|
* @event_ring_doorbell_pa: physical address of the doorbell that IPA uC
|
|
|
|
will update the headpointer of the event ring
|
|
|
|
* @is_evt_rn_db_pcie_addr: Bool indicated evt ring DB is pcie or not
|
|
|
|
* @num_pkt_buffers: Number of pkt buffers allocated. The size of the event
|
|
|
|
ring and the transfer ring has to be atleast ( num_pkt_buffers + 1)
|
|
|
|
* @pkt_offset: packet offset (wdi header length)
|
|
|
|
* @desc_format_template[IPA_HW_WDI3_MAX_ER_DESC_SIZE]: Holds a cached
|
|
|
|
template of the desc format
|
|
|
|
*/
|
|
|
|
struct ipa_wdi_pipe_setup_info {
|
|
|
|
struct ipa_ep_cfg ipa_ep_cfg;
|
|
|
|
enum ipa_client_type client;
|
|
|
|
phys_addr_t transfer_ring_base_pa;
|
|
|
|
u32 transfer_ring_size;
|
|
|
|
phys_addr_t transfer_ring_doorbell_pa;
|
|
|
|
bool is_txr_rn_db_pcie_addr;
|
|
|
|
|
|
|
|
phys_addr_t event_ring_base_pa;
|
|
|
|
u32 event_ring_size;
|
|
|
|
phys_addr_t event_ring_doorbell_pa;
|
|
|
|
bool is_evt_rn_db_pcie_addr;
|
|
|
|
u16 num_pkt_buffers;
|
|
|
|
|
|
|
|
u16 pkt_offset;
|
|
|
|
|
|
|
|
u32 desc_format_template[IPA_HW_WDI3_MAX_ER_DESC_SIZE];
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ipa_wdi_pipe_setup_info_smmu - WDI TX/Rx configuration
|
|
|
|
* @ipa_ep_cfg: ipa endpoint configuration
|
|
|
|
* @client: type of "client"
|
|
|
|
* @transfer_ring_base_pa: physical address of the base of the transfer ring
|
|
|
|
* @transfer_ring_size: size of the transfer ring
|
|
|
|
* @transfer_ring_doorbell_pa: physical address of the doorbell that
|
|
|
|
IPA uC will update the tailpointer of the transfer ring
|
|
|
|
* @is_txr_rn_db_pcie_addr: Bool indicated txr ring DB is pcie or not
|
|
|
|
* @event_ring_base_pa: physical address of the base of the event ring
|
|
|
|
* @event_ring_size: event ring size
|
|
|
|
* @event_ring_doorbell_pa: physical address of the doorbell that IPA uC
|
|
|
|
will update the headpointer of the event ring
|
|
|
|
* @is_evt_rn_db_pcie_addr: Bool indicated evt ring DB is pcie or not
|
|
|
|
* @num_pkt_buffers: Number of pkt buffers allocated. The size of the event
|
|
|
|
ring and the transfer ring has to be atleast ( num_pkt_buffers + 1)
|
|
|
|
* @pkt_offset: packet offset (wdi header length)
|
|
|
|
* @desc_format_template[IPA_HW_WDI3_MAX_ER_DESC_SIZE]: Holds a cached
|
|
|
|
template of the desc format
|
|
|
|
*/
|
|
|
|
struct ipa_wdi_pipe_setup_info_smmu {
|
|
|
|
struct ipa_ep_cfg ipa_ep_cfg;
|
|
|
|
enum ipa_client_type client;
|
|
|
|
struct sg_table transfer_ring_base;
|
|
|
|
u32 transfer_ring_size;
|
|
|
|
phys_addr_t transfer_ring_doorbell_pa;
|
|
|
|
bool is_txr_rn_db_pcie_addr;
|
|
|
|
|
|
|
|
struct sg_table event_ring_base;
|
|
|
|
u32 event_ring_size;
|
|
|
|
phys_addr_t event_ring_doorbell_pa;
|
|
|
|
bool is_evt_rn_db_pcie_addr;
|
|
|
|
u16 num_pkt_buffers;
|
|
|
|
|
|
|
|
u16 pkt_offset;
|
|
|
|
|
|
|
|
u32 desc_format_template[IPA_HW_WDI3_MAX_ER_DESC_SIZE];
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ipa_wdi_conn_in_params - information provided by
|
|
|
|
* uC offload client
|
|
|
|
* @notify: client callback function
|
2022-02-24 11:51:21 +09:00
|
|
|
* @ast_notify: ast notification cb
|
2019-08-08 09:43:48 +09:00
|
|
|
* @priv: client cookie
|
|
|
|
* @is_smmu_enabled: if smmu is enabled
|
|
|
|
* @num_sys_pipe_needed: number of sys pipe needed
|
|
|
|
* @sys_in: parameters to setup sys pipe in mcc mode
|
|
|
|
* @tx: parameters to connect TX pipe(from IPA to WLAN)
|
|
|
|
* @tx_smmu: smmu parameters to connect TX pipe(from IPA to WLAN)
|
|
|
|
* @rx: parameters to connect RX pipe(from WLAN to IPA)
|
|
|
|
* @rx_smmu: smmu parameters to connect RX pipe(from WLAN to IPA)
|
2021-01-22 05:39:27 +09:00
|
|
|
* @is_tx1_used: to notify extra pipe required/not
|
|
|
|
* @tx1: parameters to connect TX1 pipe(from IPA to WLAN second pipe)
|
|
|
|
* @tx1_smmu: smmu parameters to connect TX1 pipe(from IPA to WLAN second pipe)
|
2022-02-24 11:51:21 +09:00
|
|
|
* @hdl: handle associated with this instance.
|
|
|
|
* @is_rx1_used: bool to indicate if additional rx pipe required or not
|
|
|
|
* @rx1: parameters to connect RX1 pipe(from WLAN to IPA second pipe)
|
|
|
|
* @rx1_smmu: smmu parameters to connect RX1 pipe(WLAN to IPA second pipe)
|
2019-08-08 09:43:48 +09:00
|
|
|
*/
|
|
|
|
struct ipa_wdi_conn_in_params {
|
|
|
|
ipa_notify_cb notify;
|
2022-02-24 11:51:21 +09:00
|
|
|
ipa_wdi_mesh_ast_notifier_cb ast_notify;
|
2019-08-08 09:43:48 +09:00
|
|
|
void *priv;
|
|
|
|
bool is_smmu_enabled;
|
|
|
|
u8 num_sys_pipe_needed;
|
|
|
|
struct ipa_sys_connect_params sys_in[IPA_WDI_MAX_SUPPORTED_SYS_PIPE];
|
|
|
|
union {
|
|
|
|
struct ipa_wdi_pipe_setup_info tx;
|
|
|
|
struct ipa_wdi_pipe_setup_info_smmu tx_smmu;
|
|
|
|
} u_tx;
|
|
|
|
union {
|
|
|
|
struct ipa_wdi_pipe_setup_info rx;
|
|
|
|
struct ipa_wdi_pipe_setup_info_smmu rx_smmu;
|
|
|
|
} u_rx;
|
2021-01-22 05:39:27 +09:00
|
|
|
bool is_tx1_used;
|
|
|
|
union {
|
|
|
|
struct ipa_wdi_pipe_setup_info tx;
|
|
|
|
struct ipa_wdi_pipe_setup_info_smmu tx_smmu;
|
|
|
|
} u_tx1;
|
2021-09-30 20:40:59 +09:00
|
|
|
ipa_wdi_hdl_t hdl;
|
2022-02-24 11:51:21 +09:00
|
|
|
bool is_rx1_used;
|
|
|
|
union {
|
|
|
|
struct ipa_wdi_pipe_setup_info rx;
|
|
|
|
struct ipa_wdi_pipe_setup_info_smmu rx_smmu;
|
|
|
|
} u_rx1;
|
2019-08-08 09:43:48 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ipa_wdi_conn_out_params - information provided
|
|
|
|
* to WLAN driver
|
|
|
|
* @tx_uc_db_pa: physical address of IPA uC doorbell for TX
|
|
|
|
* @rx_uc_db_pa: physical address of IPA uC doorbell for RX
|
2021-01-22 05:39:27 +09:00
|
|
|
* @tx1_uc_db_pa: physical address of IPA uC doorbell for TX1
|
2020-09-19 03:40:17 +09:00
|
|
|
* @is_ddr_mapped: flag set to true if address is from DDR
|
2022-02-24 11:51:21 +09:00
|
|
|
* @rx1_uc_db_pa: physical address of IPA uC doorbell for RX1
|
2019-08-08 09:43:48 +09:00
|
|
|
*/
|
|
|
|
struct ipa_wdi_conn_out_params {
|
|
|
|
phys_addr_t tx_uc_db_pa;
|
|
|
|
phys_addr_t rx_uc_db_pa;
|
2021-01-22 05:39:27 +09:00
|
|
|
phys_addr_t tx1_uc_db_pa;
|
2020-09-19 03:40:17 +09:00
|
|
|
bool is_ddr_mapped;
|
2022-02-24 11:51:21 +09:00
|
|
|
phys_addr_t rx1_uc_db_pa;
|
2019-08-08 09:43:48 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ipa_wdi_perf_profile - To set BandWidth profile
|
|
|
|
*
|
|
|
|
* @client: type of client
|
|
|
|
* @max_supported_bw_mbps: maximum bandwidth needed (in Mbps)
|
|
|
|
*/
|
|
|
|
struct ipa_wdi_perf_profile {
|
|
|
|
enum ipa_client_type client;
|
|
|
|
u32 max_supported_bw_mbps;
|
|
|
|
};
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct ipa_wdi_capabilities - wdi capability parameters
|
|
|
|
*
|
|
|
|
* @num_of_instances: Number of WLAN instances supported.
|
|
|
|
*/
|
|
|
|
struct ipa_wdi_capabilities_out_params {
|
|
|
|
u8 num_of_instances;
|
|
|
|
};
|
|
|
|
|
2019-11-11 02:22:55 +09:00
|
|
|
#if IS_ENABLED(CONFIG_IPA3)
|
2019-08-08 09:43:48 +09:00
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_get_capabilities - Client should call this function to
|
|
|
|
* know the WDI capabilities
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context and only
|
|
|
|
* after checking IPA readiness using ipa_register_ipa_ready_cb()
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_get_capabilities(
|
|
|
|
struct ipa_wdi_capabilities_out_params *out);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_init - Client should call this function to
|
|
|
|
* init WDI IPA offload data path
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context and only
|
|
|
|
* after checking IPA readiness using ipa_register_ipa_ready_cb()
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_init(struct ipa_wdi_init_in_params *in,
|
|
|
|
struct ipa_wdi_init_out_params *out);
|
|
|
|
|
2021-04-27 20:22:41 +09:00
|
|
|
/** ipa_get_wdi_version - return wdi version
|
|
|
|
*
|
|
|
|
* @Return void
|
|
|
|
*/
|
|
|
|
int ipa_get_wdi_version(void);
|
|
|
|
|
2021-06-23 10:11:04 +09:00
|
|
|
/** ipa_wdi_is_tx1_used - return if DBS mode is active
|
|
|
|
*
|
|
|
|
* @Return bool
|
|
|
|
*/
|
|
|
|
bool ipa_wdi_is_tx1_used(void);
|
2021-04-27 20:22:41 +09:00
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_init_per_inst - Client should call this function to
|
|
|
|
* init WDI IPA offload data path
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context and only
|
|
|
|
* after checking IPA readiness using ipa_register_ipa_ready_cb()
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_init_per_inst(struct ipa_wdi_init_in_params *in,
|
|
|
|
struct ipa_wdi_init_out_params *out);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_cleanup - Client should call this function to
|
|
|
|
* clean up WDI IPA offload data path
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_cleanup(void);
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_cleanup_per_inst - Client should call this function to
|
|
|
|
* clean up WDI IPA offload data path
|
|
|
|
*
|
|
|
|
* @hdl: hdl to wdi client
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_cleanup_per_inst(ipa_wdi_hdl_t hdl);
|
|
|
|
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_reg_intf - Client should call this function to
|
|
|
|
* register interface
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_reg_intf(
|
|
|
|
struct ipa_wdi_reg_intf_in_params *in);
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_reg_intf_per_inst - Client should call this function to
|
|
|
|
* register interface
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_reg_intf_per_inst(
|
|
|
|
struct ipa_wdi_reg_intf_in_params *in);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_dereg_intf - Client Driver should call this
|
|
|
|
* function to deregister before unload and after disconnect
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_dereg_intf(const char *netdev_name);
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_dereg_intf_per_inst - Client Driver should call this
|
|
|
|
* function to deregister before unload and after disconnect
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_dereg_intf_per_inst(const char *netdev_name, ipa_wdi_hdl_t hdl);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_conn_pipes - Client should call this
|
|
|
|
* function to connect pipes
|
|
|
|
*
|
|
|
|
* @in: [in] input parameters from client
|
|
|
|
* @out: [out] output params to client
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_conn_pipes(struct ipa_wdi_conn_in_params *in,
|
|
|
|
struct ipa_wdi_conn_out_params *out);
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_conn_pipes_per_inst - Client should call this
|
|
|
|
* function to connect pipes
|
|
|
|
*
|
|
|
|
* @in: [in] input parameters from client
|
|
|
|
* @out: [out] output params to client
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_conn_pipes_per_inst(struct ipa_wdi_conn_in_params *in,
|
|
|
|
struct ipa_wdi_conn_out_params *out);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_disconn_pipes() - Client should call this
|
|
|
|
* function to disconnect pipes
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_disconn_pipes(void);
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_disconn_pipes_per_inst() - Client should call this
|
|
|
|
* function to disconnect pipes
|
|
|
|
*
|
|
|
|
* @hdl: hdl to wdi client
|
|
|
|
* Note: Should not be called from atomic context
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_disconn_pipes_per_inst(ipa_wdi_hdl_t hdl);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_enable_pipes() - Client should call this
|
|
|
|
* function to enable IPA offload data path
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_enable_pipes(void);
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_enable_pipes_per_inst() - Client should call this
|
|
|
|
* function to enable IPA offload data path
|
|
|
|
*
|
|
|
|
* @hdl: hdl to wdi client
|
|
|
|
* Note: Should not be called from atomic context
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_enable_pipes_per_inst(ipa_wdi_hdl_t hdl);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_disable_pipes() - Client should call this
|
|
|
|
* function to disable IPA offload data path
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_disable_pipes(void);
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_disable_pipes_per_inst() - Client should call this
|
|
|
|
* function to disable IPA offload data path
|
|
|
|
*
|
|
|
|
* @hdl: hdl to wdi client
|
|
|
|
* Note: Should not be called from atomic context
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_disable_pipes_per_inst(ipa_wdi_hdl_t hdl);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_set_perf_profile() - Client should call this function to
|
|
|
|
* set IPA clock bandwidth based on data rates
|
|
|
|
*
|
|
|
|
* @profile: [in] BandWidth profile to use
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_set_perf_profile(struct ipa_wdi_perf_profile *profile);
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_set_perf_profile_per_inst() - Client should call this function to
|
|
|
|
* set IPA clock bandwidth based on data rates
|
|
|
|
*
|
|
|
|
* @hdl: hdl to wdi client
|
|
|
|
* @profile: [in] BandWidth profile to use
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_set_perf_profile_per_inst(ipa_wdi_hdl_t hdl,
|
|
|
|
struct ipa_wdi_perf_profile *profile);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_create_smmu_mapping() - Create smmu mapping
|
|
|
|
*
|
|
|
|
* @num_buffers: number of buffers
|
|
|
|
*
|
|
|
|
* @info: wdi buffer info
|
|
|
|
*/
|
|
|
|
int ipa_wdi_create_smmu_mapping(u32 num_buffers,
|
|
|
|
struct ipa_wdi_buffer_info *info);
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_create_smmu_mapping_per_inst() - Create smmu mapping
|
|
|
|
*
|
|
|
|
* @hdl: hdl to wdi client
|
|
|
|
* @num_buffers: number of buffers
|
|
|
|
* @info: wdi buffer info
|
|
|
|
*/
|
|
|
|
int ipa_wdi_create_smmu_mapping_per_inst(ipa_wdi_hdl_t hdl,
|
|
|
|
u32 num_buffers,
|
|
|
|
struct ipa_wdi_buffer_info *info);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_release_smmu_mapping() - Release smmu mapping
|
|
|
|
*
|
|
|
|
* @num_buffers: number of buffers
|
|
|
|
*
|
|
|
|
* @info: wdi buffer info
|
|
|
|
*/
|
|
|
|
int ipa_wdi_release_smmu_mapping(u32 num_buffers,
|
|
|
|
struct ipa_wdi_buffer_info *info);
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_release_smmu_mapping_per_inst() - Release smmu mapping
|
|
|
|
*
|
|
|
|
* @hdl: hdl to wdi client
|
|
|
|
* @num_buffers: number of buffers
|
|
|
|
*
|
|
|
|
* @info: wdi buffer info
|
|
|
|
*/
|
|
|
|
int ipa_wdi_release_smmu_mapping_per_inst(ipa_wdi_hdl_t hdl,
|
|
|
|
u32 num_buffers,
|
|
|
|
struct ipa_wdi_buffer_info *info);
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_get_stats() - Query WDI statistics
|
|
|
|
* @stats: [inout] stats blob from client populated by driver
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*
|
|
|
|
* @note Cannot be called from atomic context
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int ipa_wdi_get_stats(struct IpaHwStatsWDIInfoData_t *stats);
|
|
|
|
|
2019-06-28 17:56:44 +09:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ipa_wdi_bw_monitor() - set wdi BW monitoring
|
|
|
|
* @info: [inout] info blob from client populated by driver
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*
|
|
|
|
* @note Cannot be called from atomic context
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int ipa_wdi_bw_monitor(struct ipa_wdi_bw_info *info);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ipa_wdi_sw_stats() - set wdi BW monitoring
|
|
|
|
* @info: [inout] info blob from client populated by driver
|
|
|
|
*
|
|
|
|
* Returns: 0 on success, negative on failure
|
|
|
|
*
|
|
|
|
* @note Cannot be called from atomic context
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int ipa_wdi_sw_stats(struct ipa_wdi_tx_info *info);
|
|
|
|
|
2019-11-11 02:22:55 +09:00
|
|
|
#else /* IS_ENABLED(CONFIG_IPA3) */
|
2019-08-08 09:43:48 +09:00
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
/**
|
|
|
|
* ipa_wdi_get_capabilities - Client should call this function to
|
|
|
|
* know the WDI capabilities
|
|
|
|
*
|
|
|
|
* Note: Should not be called from atomic context and only
|
|
|
|
* after checking IPA readiness using ipa_register_ipa_ready_cb()
|
|
|
|
*
|
|
|
|
* @Return 0 on success, negative on failure
|
|
|
|
*/
|
|
|
|
int ipa_wdi_get_capabilities(
|
|
|
|
struct ipa_wdi_capabilities_out_params *out)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_init(struct ipa_wdi_init_in_params *in,
|
|
|
|
struct ipa_wdi_init_out_params *out)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_init_per_inst(
|
|
|
|
struct ipa_wdi_init_in_params *in,
|
|
|
|
struct ipa_wdi_init_out_params *out)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-04-27 20:22:41 +09:00
|
|
|
static inline int ipa_get_wdi_version(void)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-06-23 10:11:04 +09:00
|
|
|
static inline int ipa_wdi_is_tx1_used(void)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_cleanup(void)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_cleanup_per_inst(ipa_wdi_hdl_t hdl)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_reg_intf(
|
|
|
|
struct ipa_wdi_reg_intf_in_params *in)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_reg_intf_per_inst(
|
|
|
|
struct ipa_wdi_reg_intf_in_params *in)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_dereg_intf(const char *netdev_name)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_dereg_intf_per_inst(const char *netdev_name,
|
|
|
|
ipa_wdi_hdl_t hdl)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_conn_pipes(struct ipa_wdi_conn_in_params *in,
|
|
|
|
struct ipa_wdi_conn_out_params *out)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_conn_pipes_per_inst(
|
|
|
|
struct ipa_wdi_conn_in_params *in,
|
|
|
|
struct ipa_wdi_conn_out_params *out)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_disconn_pipes(void)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_disconn_pipes_per_inst(ipa_wdi_hdl_t hdl)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_enable_pipes(void)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_enable_pipes_per_inst(ipa_wdi_hdl_t hdl)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_disable_pipes(void)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_disable_pipes_per_inst(ipa_wdi_hdl_t hdl)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_set_perf_profile(
|
|
|
|
struct ipa_wdi_perf_profile *profile)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_set_perf_profile_per_inst(
|
|
|
|
ipa_wdi_hdl_t hdl,
|
|
|
|
struct ipa_wdi_perf_profile *profile)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_create_smmu_mapping(u32 num_buffers,
|
|
|
|
struct ipa_wdi_buffer_info *info)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_create_smmu_mapping_per_inst(
|
|
|
|
ipa_wdi_hdl_t hdl,
|
|
|
|
u32 num_buffers,
|
|
|
|
struct ipa_wdi_buffer_info *info)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_release_smmu_mapping(u32 num_buffers,
|
|
|
|
struct ipa_wdi_buffer_info *info)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2021-09-30 20:40:59 +09:00
|
|
|
static inline int ipa_wdi_release_smmu_mapping_per_inst(
|
|
|
|
ipa_wdi_hdl_t hdl,
|
|
|
|
u32 num_buffers,
|
|
|
|
struct ipa_wdi_buffer_info *info)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-08-08 09:43:48 +09:00
|
|
|
static inline int ipa_wdi_get_stats(struct IpaHwStatsWDIInfoData_t *stats)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-06-28 17:56:44 +09:00
|
|
|
static inline int ipa_wdi_bw_monitor(struct ipa_wdi_bw_info *info)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int ipa_wdi_sw_stats(struct ipa_wdi_tx_info *info)
|
|
|
|
{
|
|
|
|
return -EPERM;
|
|
|
|
}
|
|
|
|
|
2019-11-11 02:22:55 +09:00
|
|
|
#endif /* IS_ENABLED(CONFIG_IPA3) */
|
2019-08-08 09:43:48 +09:00
|
|
|
|
|
|
|
#endif /* _IPA_WDI3_H_ */
|