msm: ipa4: add wigig client

Add IPA client named ipa_wigig. This client provides API for
the 11AD protocol driver to configure IPA for 11AD clients offload.
Currently up to 4 clients are supported. The clients share the RX
pipe and have a separate TX pipe. The ipa_wigig client shall SMMU map
11AD HW registers and buffers and shall configure IPA uC and GSI for
11AD clients offload.

Signed-off-by: Amir Levy <alevy@codeaurora.org>
Change-Id: I6c87dcea5d6e8e0b861cc402d52a83d8388af90d
tirimbino
Amir Levy 6 years ago
parent 676bb42bc0
commit bec5800dd2
  1. 127
      drivers/platform/msm/ipa/ipa_api.c
  2. 26
      drivers/platform/msm/ipa/ipa_api.h
  3. 2
      drivers/platform/msm/ipa/ipa_clients/Makefile
  4. 1334
      drivers/platform/msm/ipa/ipa_clients/ipa_wigig.c
  5. 26
      drivers/platform/msm/ipa/ipa_common_i.h
  6. 2
      drivers/platform/msm/ipa/ipa_v3/Makefile
  7. 6
      drivers/platform/msm/ipa/ipa_v3/ipa.c
  8. 2
      drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
  9. 42
      drivers/platform/msm/ipa/ipa_v3/ipa_i.h
  10. 29
      drivers/platform/msm/ipa/ipa_v3/ipa_uc.c
  11. 7
      drivers/platform/msm/ipa/ipa_v3/ipa_utils.c
  12. 1507
      drivers/platform/msm/ipa/ipa_v3/ipa_wigig_i.c
  13. 491
      include/linux/ipa_wigig.h
  14. 10
      include/linux/msm_gsi.h
  15. 15
      include/uapi/linux/msm_ipa.h

@ -200,6 +200,14 @@ const char *ipa_clients_strings[IPA_CLIENT_MAX] = {
__stringify(IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS),
__stringify(RESERVED_PROD_86),
__stringify(IPA_CLIENT_APPS_WAN_COAL_CONS),
__stringify(IPA_CLIENT_WIGIG_PROD),
__stringify(IPA_CLIENT_WIGIG_CONS1),
__stringify(RESERVERD_PROD_90),
__stringify(IPA_CLIENT_WIGIG_CONS2),
__stringify(RESERVERD_PROD_92),
__stringify(IPA_CLIENT_WIGIG_CONS3),
__stringify(RESERVERD_PROD_94),
__stringify(IPA_CLIENT_WIGIG_CONS4),
};
/**
@ -1929,7 +1937,7 @@ EXPORT_SYMBOL(ipa_uc_wdi_get_dbpa);
/**
* ipa_uc_reg_rdyCB() - To register uC
* ready CB if uC not ready
* ready CB if uC not ready, wdi only.
* @inout: [in/out] input/output parameters
* from/to client
*
@ -1947,6 +1955,31 @@ int ipa_uc_reg_rdyCB(
}
EXPORT_SYMBOL(ipa_uc_reg_rdyCB);
/**
* ipa_wigig_uc_init() - get uc db and register uC
* ready CB if uC not ready, wigig only.
* @inout: [in/out] uc ready input/output parameters
* from/to client
* @int_notify: [in] wigig misc interrupt handler function
*
* Returns: 0 on success, negative on failure
*
*/
int ipa_wigig_uc_init(
struct ipa_wdi_uc_ready_params *inout,
ipa_wigig_misc_int_cb int_notify,
phys_addr_t *uc_db_pa)
{
int ret;
IPA_API_DISPATCH_RETURN(ipa_wigig_uc_init, inout,
int_notify, uc_db_pa);
return ret;
}
EXPORT_SYMBOL(ipa_wigig_uc_init);
/**
* ipa_uc_dereg_rdyCB() - To de-register uC ready CB
*
@ -3374,6 +3407,98 @@ int ipa_disable_wdi_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx)
return ret;
}
/**
* ipa_wigig_uc_msi_init() - smmu map\unmap msi related wigig HW registers
* and init\deinit uC msi config
*/
int ipa_wigig_uc_msi_init(bool init,
phys_addr_t periph_baddr_pa,
phys_addr_t pseudo_cause_pa,
phys_addr_t int_gen_tx_pa,
phys_addr_t int_gen_rx_pa,
phys_addr_t dma_ep_misc_pa)
{
int ret;
IPA_API_DISPATCH_RETURN(ipa_wigig_uc_msi_init, init,
periph_baddr_pa,
pseudo_cause_pa,
int_gen_tx_pa,
int_gen_rx_pa,
dma_ep_misc_pa);
return ret;
}
EXPORT_SYMBOL(ipa_wigig_uc_msi_init);
/**
* ipa_conn_wigig_rx_pipe_i() - connect wigig rx pipe
*/
int ipa_conn_wigig_rx_pipe_i(void *in, struct ipa_wigig_conn_out_params *out)
{
int ret;
IPA_API_DISPATCH_RETURN(ipa_conn_wigig_rx_pipe_i, in, out);
return ret;
}
EXPORT_SYMBOL(ipa_conn_wigig_rx_pipe_i);
/**
* ipa_conn_wigig_client_i() - connect a wigig client
*/
int ipa_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out)
{
int ret;
IPA_API_DISPATCH_RETURN(ipa_conn_wigig_client_i, in, out);
return ret;
}
EXPORT_SYMBOL(ipa_conn_wigig_client_i);
/**
* ipa_disconn_wigig_pipe_i() - disconnect a wigig pipe
*/
int ipa_disconn_wigig_pipe_i(enum ipa_client_type client,
struct ipa_wigig_pipe_setup_info_smmu *pipe_smmu,
void *dbuff)
{
int ret;
IPA_API_DISPATCH_RETURN(ipa_disconn_wigig_pipe_i, client,
pipe_smmu, dbuff);
return ret;
}
EXPORT_SYMBOL(ipa_disconn_wigig_pipe_i);
/**
* ipa_enable_wigig_pipe() - enable a wigig pipe
*/
int ipa_enable_wigig_pipe_i(enum ipa_client_type client)
{
int ret;
IPA_API_DISPATCH_RETURN(ipa_enable_wigig_pipe_i, client);
return ret;
}
EXPORT_SYMBOL(ipa_enable_wigig_pipe_i);
/**
* ipa_disable_wigig_pipe_i() - disable a wigig pipe
*/
int ipa_disable_wigig_pipe_i(enum ipa_client_type client)
{
int ret;
IPA_API_DISPATCH_RETURN(ipa_disable_wigig_pipe_i, client);
return ret;
}
EXPORT_SYMBOL(ipa_disable_wigig_pipe_i);
/**
* ipa_tz_unlock_reg() - Allow AP access to memory regions controlled by TZ
*/

@ -428,6 +428,32 @@ struct ipa_api_controller {
int (*ipa_is_vlan_mode)(enum ipa_vlan_ifaces iface, bool *res);
bool (*ipa_pm_is_used)(void);
int (*ipa_wigig_uc_init)(
struct ipa_wdi_uc_ready_params *inout,
ipa_wigig_misc_int_cb int_notify,
phys_addr_t *uc_db_pa);
int (*ipa_conn_wigig_rx_pipe_i)(void *in,
struct ipa_wigig_conn_out_params *out);
int (*ipa_conn_wigig_client_i)(void *in,
struct ipa_wigig_conn_out_params *out);
int (*ipa_disconn_wigig_pipe_i)(enum ipa_client_type client,
struct ipa_wigig_pipe_setup_info_smmu *pipe_smmu,
void *dbuff);
int (*ipa_wigig_uc_msi_init)(bool init,
phys_addr_t periph_baddr_pa,
phys_addr_t pseudo_cause_pa,
phys_addr_t int_gen_tx_pa,
phys_addr_t int_gen_rx_pa,
phys_addr_t dma_ep_misc_pa);
int (*ipa_enable_wigig_pipe_i)(enum ipa_client_type client);
int (*ipa_disable_wigig_pipe_i)(enum ipa_client_type client);
};
#ifdef CONFIG_IPA3

@ -1,4 +1,4 @@
obj-$(CONFIG_IPA3) += ipa_usb.o odu_bridge.o ipa_mhi_client.o ipa_uc_offload.o ipa_wdi3.o ipa_gsb.o
obj-$(CONFIG_IPA3) += ipa_usb.o odu_bridge.o ipa_mhi_client.o ipa_uc_offload.o ipa_wdi3.o ipa_gsb.o ipa_wigig.o
obj-$(CONFIG_IPA) += odu_bridge.o ipa_mhi_client.o ipa_uc_offload.o ipa_wdi3.o
obj-$(CONFIG_ECM_IPA) += ecm_ipa.o
obj-$(CONFIG_RNDIS_IPA) += rndis_ipa.o

File diff suppressed because it is too large Load Diff

@ -20,6 +20,7 @@
#include <linux/ipa.h>
#include <linux/ipa_uc_offload.h>
#include <linux/ipa_wdi3.h>
#include <linux/ipa_wigig.h>
#include <linux/ratelimit.h>
#define WARNON_RATELIMIT_BURST 1
@ -445,4 +446,29 @@ int ipa_smmu_free_sgt(struct sg_table **out_sgt_ptr);
int ipa_ut_module_init(void);
void ipa_ut_module_exit(void);
int ipa_wigig_uc_init(
struct ipa_wdi_uc_ready_params *inout,
ipa_wigig_misc_int_cb int_notify,
phys_addr_t *uc_db_pa);
int ipa_conn_wigig_rx_pipe_i(void *in, struct ipa_wigig_conn_out_params *out);
int ipa_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out);
int ipa_wigig_uc_msi_init(
bool init,
phys_addr_t periph_baddr_pa,
phys_addr_t pseudo_cause_pa,
phys_addr_t int_gen_tx_pa,
phys_addr_t int_gen_rx_pa,
phys_addr_t dma_ep_misc_pa);
int ipa_disconn_wigig_pipe_i(enum ipa_client_type client,
struct ipa_wigig_pipe_setup_info_smmu *pipe_smmu,
void *dbuff);
int ipa_enable_wigig_pipe_i(enum ipa_client_type client);
int ipa_disable_wigig_pipe_i(enum ipa_client_type client);
#endif /* _IPA_COMMON_I_H_ */

@ -4,7 +4,7 @@ obj-$(CONFIG_IPA3) += ipat.o
ipat-y := ipa.o ipa_debugfs.o ipa_hdr.o ipa_flt.o ipa_rt.o ipa_dp.o ipa_client.o \
ipa_utils.o ipa_nat.o ipa_intf.o teth_bridge.o ipa_interrupts.o \
ipa_uc.o ipa_uc_wdi.o ipa_dma.o ipa_uc_mhi.o ipa_mhi.o ipa_uc_ntn.o \
ipa_hw_stats.o ipa_pm.o ipa_wdi3_i.o ipa_odl.o
ipa_hw_stats.o ipa_pm.o ipa_wdi3_i.o ipa_odl.o ipa_wigig_i.o
ipat-$(CONFIG_IPA_EMULATION) += ipa_dt_replacement.o

@ -4855,6 +4855,12 @@ static int ipa3_post_init(const struct ipa3_plat_drv_res *resource_p,
else
IPADBG(":wdi init ok\n");
result = ipa3_wigig_init_i();
if (result)
IPAERR(":wigig init failed (%d)\n", -result);
else
IPADBG(":wigig init ok\n");
result = ipa3_ntn_init();
if (result)
IPAERR(":ntn init failed (%d)\n", -result);

@ -55,8 +55,6 @@
/* less 1 nominal MTU (1500 bytes) rounded to units of KB */
#define IPA_ADJUST_AGGR_BYTE_LIMIT(X) (((X) - IPA_MTU)/1000)
#define IPA_ADJUST_AGGR_BYTE_HARD_LIMIT(X) (X/1000)
#define IPA_RX_BUFF_CLIENT_HEADROOM 256
#define IPA_WLAN_RX_POOL_SZ 100

@ -254,6 +254,8 @@ enum {
#define IPA_AGGR_STR_IN_BYTES(str) \
(strnlen((str), IPA_AGGR_MAX_STR_LENGTH - 1) + 1)
#define IPA_ADJUST_AGGR_BYTE_HARD_LIMIT(X) (X/1000)
#define IPA_TRANSPORT_PROD_TIMEOUT_MSEC 100
#define IPA3_ACTIVE_CLIENTS_TABLE_BUF_SIZE 2048
@ -1286,6 +1288,18 @@ struct ipa3_uc_wdi_ctx {
#endif
};
/**
* struct ipa3_uc_wigig_ctx
* @priv: wigig driver private data
* @uc_ready_cb: wigig driver uc ready callback
* @int_notify: wigig driver misc interrupt callback
*/
struct ipa3_uc_wigig_ctx {
void *priv;
ipa_uc_ready_cb uc_ready_cb;
ipa_wigig_misc_int_cb misc_notify_cb;
};
/**
* struct ipa3_wdi2_ctx - IPA wdi2 context
*/
@ -1499,6 +1513,7 @@ struct ipa3_char_device_context {
* @wcstats: wlan common buffer stats
* @uc_ctx: uC interface context
* @uc_wdi_ctx: WDI specific fields for uC interface
* @uc_wigig_ctx: WIGIG specific fields for uC interface
* @ipa_num_pipes: The number of pipes used by IPA HW
* @skip_uc_pipe_reset: Indicates whether pipe reset via uC needs to be avoided
* @ipa_client_apps_wan_cons_agg_gro: RMNET_IOCTL_INGRESS_FORMAT_AGG_DATA
@ -1621,6 +1636,7 @@ struct ipa3_context {
struct ipa3_uc_wdi_ctx uc_wdi_ctx;
struct ipa3_uc_ntn_ctx uc_ntn_ctx;
struct ipa3_uc_wigig_ctx uc_wigig_ctx;
u32 wan_rx_ring_size;
u32 lan_rx_ring_size;
bool skip_uc_pipe_reset;
@ -2217,6 +2233,26 @@ int ipa3_disconn_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx);
int ipa3_enable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx);
int ipa3_disable_wdi3_pipes(int ipa_ep_idx_tx, int ipa_ep_idx_rx);
int ipa3_conn_wigig_rx_pipe_i(void *in,
struct ipa_wigig_conn_out_params *out);
int ipa3_conn_wigig_client_i(void *in, struct ipa_wigig_conn_out_params *out);
int ipa3_wigig_uc_msi_init(bool init,
phys_addr_t periph_baddr_pa,
phys_addr_t pseudo_cause_pa,
phys_addr_t int_gen_tx_pa,
phys_addr_t int_gen_rx_pa,
phys_addr_t dma_ep_misc_pa);
int ipa3_disconn_wigig_pipe_i(enum ipa_client_type client,
struct ipa_wigig_pipe_setup_info_smmu *pipe_smmu,
void *dbuff);
int ipa3_enable_wigig_pipe_i(enum ipa_client_type client);
int ipa3_disable_wigig_pipe_i(enum ipa_client_type client);
/*
* To retrieve doorbell physical address of
* wlan pipes
@ -2523,6 +2559,12 @@ void ipa3_tag_destroy_imm(void *user1, int user2);
const struct ipa_gsi_ep_config *ipa3_get_gsi_ep_info
(enum ipa_client_type client);
int ipa3_wigig_init_i(void);
int ipa3_wigig_uc_init(
struct ipa_wdi_uc_ready_params *inout,
ipa_wigig_misc_int_cb int_notify,
phys_addr_t *uc_db_pa);
/* Hardware stats */
#define IPA_STATS_MAX_PIPE_BIT 32

@ -524,6 +524,21 @@ static void ipa3_uc_response_hdlr(enum ipa_irq_type interrupt,
IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
}
static void ipa3_uc_wigig_misc_int_handler(enum ipa_irq_type interrupt,
void *private_data,
void *interrupt_data)
{
IPADBG("\n");
WARN_ON(private_data != ipa3_ctx);
if (ipa3_ctx->uc_wigig_ctx.misc_notify_cb)
ipa3_ctx->uc_wigig_ctx.misc_notify_cb(
ipa3_ctx->uc_wigig_ctx.priv);
IPADBG("exit\n");
}
static int ipa3_uc_send_cmd_64b_param(u32 cmd_lo, u32 cmd_hi, u32 opcode,
u32 expected_status, bool polling_mode, unsigned long timeout_jiffies)
{
@ -687,7 +702,7 @@ int ipa3_uc_interface_init(void)
ipa3_uc_event_handler, true,
ipa3_ctx);
if (result) {
IPAERR("Fail to register for UC_IRQ0 rsp interrupt\n");
IPAERR("Fail to register for UC_IRQ0 event interrupt\n");
result = -EFAULT;
goto irq_fail0;
}
@ -701,11 +716,21 @@ int ipa3_uc_interface_init(void)
goto irq_fail1;
}
result = ipa3_add_interrupt_handler(IPA_UC_IRQ_2,
ipa3_uc_wigig_misc_int_handler, true,
ipa3_ctx);
if (result) {
IPAERR("fail to register for UC_IRQ2 wigig misc interrupt\n");
result = -EFAULT;
goto irq_fail2;
}
ipa3_ctx->uc_ctx.uc_inited = true;
IPADBG("IPA uC interface is initialized\n");
return 0;
irq_fail2:
ipa3_remove_interrupt_handler(IPA_UC_IRQ_1);
irq_fail1:
ipa3_remove_interrupt_handler(IPA_UC_IRQ_0);
irq_fail0:

@ -6197,6 +6197,13 @@ int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type,
api_ctrl->ipa_get_smmu_params = ipa3_get_smmu_params;
api_ctrl->ipa_is_vlan_mode = ipa3_is_vlan_mode;
api_ctrl->ipa_pm_is_used = ipa3_pm_is_used;
api_ctrl->ipa_wigig_uc_init = ipa3_wigig_uc_init;
api_ctrl->ipa_conn_wigig_rx_pipe_i = ipa3_conn_wigig_rx_pipe_i;
api_ctrl->ipa_conn_wigig_client_i = ipa3_conn_wigig_client_i;
api_ctrl->ipa_disconn_wigig_pipe_i = ipa3_disconn_wigig_pipe_i;
api_ctrl->ipa_wigig_uc_msi_init = ipa3_wigig_uc_msi_init;
api_ctrl->ipa_enable_wigig_pipe_i = ipa3_enable_wigig_pipe_i;
api_ctrl->ipa_disable_wigig_pipe_i = ipa3_disable_wigig_pipe_i;
return 0;
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,491 @@
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _IPA_WIGIG_H_
#define _IPA_WIGIG_H_
#include <linux/msm_ipa.h>
#include <linux/ipa.h>
typedef void (*ipa_wigig_misc_int_cb)(void *priv);
/*
* struct ipa_wigig_init_in_params - wigig init input parameters
*
* @periph_baddr_pa: physical address of wigig HW base
* @pseudo_cause_pa: physical address of wigig HW pseudo_cause register
* @int_gen_tx_pa: physical address of wigig HW int_gen_tx register
* @int_gen_rx_pa: physical address of wigig HW int_gen_rx register
* @dma_ep_misc_pa: physical address of wigig HW dma_ep_misc register
* @notify: uc ready callback
* @int_notify: wigig misc interrupt callback
* @priv: uc ready callback cookie
*/
struct ipa_wigig_init_in_params {
phys_addr_t periph_baddr_pa;
phys_addr_t pseudo_cause_pa;
phys_addr_t int_gen_tx_pa;
phys_addr_t int_gen_rx_pa;
phys_addr_t dma_ep_misc_pa;
ipa_uc_ready_cb notify;
ipa_wigig_misc_int_cb int_notify;
void *priv;
};
/*
* struct ipa_wigig_init_out_params - wigig init output parameters
*
* @is_uC_ready: is uC ready. No API should be called until uC is ready.
* @uc_db_pa: physical address of IPA uC doorbell
*/
struct ipa_wigig_init_out_params {
bool is_uc_ready;
phys_addr_t uc_db_pa;
};
/*
* struct ipa_wigig_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_wigig_hdr_info {
u8 *hdr;
u8 hdr_len;
u8 dst_mac_addr_offset;
enum ipa_hdr_l2_type hdr_type;
};
/*
* struct ipa_wigig_reg_intf_in_params - parameters for offload interface
* registration
*
* @netdev_name: network interface name
* @netdev_mac: netdev mac address
* @hdr_info: header information
*/
struct ipa_wigig_reg_intf_in_params {
const char *netdev_name;
u8 netdev_mac[IPA_MAC_ADDR_SIZE];
struct ipa_wigig_hdr_info hdr_info[IPA_IP_MAX];
};
/*
* struct ipa_wigig_pipe_setup_info - WIGIG TX/Rx configuration
* @desc_ring_base_pa: physical address of the base of the descriptor ring
* @desc_ring_size: size of the descriptor ring
* @desc_ring_HWHEAD_pa: physical address of the wigig descriptor ring HWHEAD
* @desc_ring_HWTAIL_pa: physical address of the wigig descriptor ring HWTAIL
* @status_ring_base_pa: physical address of the base of the status ring
* @status_ring_size: status ring size
* @desc_ring_HWHEAD_pa: physical address of the wigig descriptor ring HWHEAD
* @desc_ring_HWTAIL_pa: physical address of the wigig descriptor ring HWTAIL
*/
struct ipa_wigig_pipe_setup_info {
phys_addr_t desc_ring_base_pa;
u32 desc_ring_size;
phys_addr_t desc_ring_HWHEAD_pa;
phys_addr_t desc_ring_HWTAIL_pa;
phys_addr_t status_ring_base_pa;
u32 status_ring_size;
phys_addr_t status_ring_HWHEAD_pa;
phys_addr_t status_ring_HWTAIL_pa;
};
/*
* struct ipa_wigig_pipe_setup_info_smmu - WIGIG TX/Rx configuration smmu mode
* @desc_ring_base: sg_table of the base of the descriptor ring
* @desc_ring_base_iova: IO virtual address mapped to physical base address
* @desc_ring_size: size of the descriptor ring
* @desc_ring_HWHEAD_pa: physical address of the wigig descriptor ring HWHEAD
* @desc_ring_HWTAIL_pa: physical address of the wigig descriptor ring HWTAIL
* @status_ring_base: sg_table of the base of the status ring
* @status_ring_base_iova: IO virtual address mapped to physical base address
* @status_ring_size: status ring size
* @desc_ring_HWHEAD_pa: physical address of the wigig descriptor ring HWHEAD
* @desc_ring_HWTAIL_pa: physical address of the wigig descriptor ring HWTAIL
*/
struct ipa_wigig_pipe_setup_info_smmu {
struct sg_table desc_ring_base;
u64 desc_ring_base_iova;
u32 desc_ring_size;
phys_addr_t desc_ring_HWHEAD_pa;
phys_addr_t desc_ring_HWTAIL_pa;
struct sg_table status_ring_base;
u64 status_ring_base_iova;
u32 status_ring_size;
phys_addr_t status_ring_HWHEAD_pa;
phys_addr_t status_ring_HWTAIL_pa;
};
/*
* struct ipa_wigig_rx_pipe_data_buffer_info - WIGIG Rx data buffer
* configuration
* @data_buffer_base_pa: physical address of the physically contiguous
* Rx data buffer
* @data_buffer_size: size of the data buffer
*/
struct ipa_wigig_rx_pipe_data_buffer_info {
phys_addr_t data_buffer_base_pa;
u32 data_buffer_size;
};
/*
* struct ipa_wigig_rx_pipe_data_buffer_info_smmu - WIGIG Rx data buffer
* configuration smmu mode
* @data_buffer_base: sg_table of the physically contiguous
* Rx data buffer
* @data_buffer_base_iova: IO virtual address mapped to physical base address
* @data_buffer_size: size of the data buffer
*/
struct ipa_wigig_rx_pipe_data_buffer_info_smmu {
struct sg_table data_buffer_base;
u64 data_buffer_base_iova;
u32 data_buffer_size;
};
/*
* struct ipa_wigig_conn_rx_in_params - information provided by
* WIGIG offload client for Rx pipe
* @notify: client callback function
* @priv: client cookie
* @pipe: parameters to connect Rx pipe (WIGIG to IPA)
* @dbuff: Rx data buffer info
*/
struct ipa_wigig_conn_rx_in_params {
ipa_notify_cb notify;
void *priv;
struct ipa_wigig_pipe_setup_info pipe;
struct ipa_wigig_rx_pipe_data_buffer_info dbuff;
};
/*
* struct ipa_wigig_conn_rx_in_params_smmu - information provided by
* WIGIG offload client for Rx pipe
* @notify: client callback function
* @priv: client cookie
* @pipe_smmu: parameters to connect Rx pipe (WIGIG to IPA) smmu mode
* @dbuff_smmu: Rx data buffer info smmu mode
*/
struct ipa_wigig_conn_rx_in_params_smmu {
ipa_notify_cb notify;
void *priv;
struct ipa_wigig_pipe_setup_info_smmu pipe_smmu;
struct ipa_wigig_rx_pipe_data_buffer_info_smmu dbuff_smmu;
};
/*
* struct ipa_wigig_conn_out_params - information provided
* to WIGIG driver
* @client: client type allocated by IPA driver
*/
struct ipa_wigig_conn_out_params {
enum ipa_client_type client;
};
/*
* struct ipa_wigig_tx_pipe_data_buffer_info - WIGIG Tx data buffer
* configuration
* @data_buffer_size: size of a single data buffer
*/
struct ipa_wigig_tx_pipe_data_buffer_info {
u32 data_buffer_size;
};
/*
* struct ipa_wigig_tx_pipe_data_buffer_info_smmu - WIGIG Tx data buffer
* configuration smmu mode
* @data_buffer_base_pa: sg_tables of the Tx data buffers
* @data_buffer_base_iova: IO virtual address mapped to physical base address
* @num_buffers: number of buffers
* @data_buffer_size: size of a single data buffer
*/
struct ipa_wigig_tx_pipe_data_buffer_info_smmu {
struct sg_table *data_buffer_base;
u64 *data_buffer_base_iova;
u32 num_buffers;
u32 data_buffer_size;
};
/*
* struct ipa_wigig_conn_tx_in_params - information provided by
* wigig offload client for Tx pipe
* @pipe: parameters to connect Tx pipe (IPA to WIGIG)
* @dbuff: Tx data buffer info
* @int_gen_tx_bit_num: bit in int_gen_tx register associated with this client
* @client_mac: MAC address of client to be connected
*/
struct ipa_wigig_conn_tx_in_params {
struct ipa_wigig_pipe_setup_info pipe;
struct ipa_wigig_tx_pipe_data_buffer_info dbuff;
u8 int_gen_tx_bit_num;
u8 client_mac[IPA_MAC_ADDR_SIZE];
};
/*
* struct ipa_wigig_conn_tx_in_params_smmu - information provided by
* wigig offload client for Tx pipe
* @pipe_smmu: parameters to connect Tx pipe (IPA to WIGIG) smmu mode
* @dbuff_smmu: Tx data buffer info smmu mode
* @int_gen_tx_bit_num: bit in int_gen_tx register associated with this client
* @client_mac: MAC address of client to be connected
*/
struct ipa_wigig_conn_tx_in_params_smmu {
struct ipa_wigig_pipe_setup_info_smmu pipe_smmu;
struct ipa_wigig_tx_pipe_data_buffer_info_smmu dbuff_smmu;
u8 int_gen_tx_bit_num;
u8 client_mac[IPA_MAC_ADDR_SIZE];
};
#if defined CONFIG_IPA || defined CONFIG_IPA3
/*
* ipa_wigig_init - Client should call this function to
* init WIGIG IPA offload data path
*
* Note: Should not be called from atomic context
*
* @Return 0 on success, negative on failure
*/
int ipa_wigig_init(struct ipa_wigig_init_in_params *in,
struct ipa_wigig_init_out_params *out);
/*
* ipa_wigig_cleanup - Client should call this function to
* clean up WIGIG IPA offload data path
*
* @Return 0 on success, negative on failure
*/
int ipa_wigig_cleanup(void);
/*
* ipa_wigig_is_smmu_enabled - get smmu state
*
* @Return true if smmu is enabled, false if disabled
*/
bool ipa_wigig_is_smmu_enabled(void);
/*
* ipa_wigig_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_wigig_reg_intf(struct ipa_wigig_reg_intf_in_params *in);
/*
* ipa_wigig_dereg_intf - Client Driver should call this
* function to deregister before unload and after disconnect
*
* @Return 0 on success, negative on failure
*/
int ipa_wigig_dereg_intf(const char *netdev_name);
/*
* ipa_wigig_conn_rx_pipe - Client should call this
* function to connect the rx (UL) pipe
*
* @in: [in] input parameters from client
* @out: [out] output params to client
*
* Note: Non SMMU mode only, Should not be called from atomic context
*
* @Return 0 on success, negative on failure
*/
int ipa_wigig_conn_rx_pipe(struct ipa_wigig_conn_rx_in_params *in,
struct ipa_wigig_conn_out_params *out);
/*
* ipa_wigig_conn_rx_pipe_smmu - Client should call this
* function to connect the rx (UL) pipe
*
* @in: [in] input parameters from client
* @out: [out] output params to client
*
* Note: SMMU mode only, Should not be called from atomic context
*
* @Return 0 on success, negative on failure
*/
int ipa_wigig_conn_rx_pipe_smmu(struct ipa_wigig_conn_rx_in_params_smmu *in,
struct ipa_wigig_conn_out_params *out);
/*
* ipa_wigig_conn_client - Client should call this
* function to connect one of the tx (DL) pipes when a WIGIG client connects
*
* @in: [in] input parameters from client
* @out: [out] output params to client
*
* Note: Non SMMU mode only, Should not be called from atomic context
*
* @Return 0 on success, negative on failure
*/
int ipa_wigig_conn_client(struct ipa_wigig_conn_tx_in_params *in,
struct ipa_wigig_conn_out_params *out);
/*
* ipa_wigig_conn_client_smmu - Client should call this
* function to connect one of the tx (DL) pipes when a WIGIG client connects
*
* @in: [in] input parameters from client
* @out: [out] output params to client
*
* Note: SMMU mode only, Should not be called from atomic context
*
* @Return 0 on success, negative on failure
*/
int ipa_wigig_conn_client_smmu(struct ipa_wigig_conn_tx_in_params_smmu *in,
struct ipa_wigig_conn_out_params *out);
/*
* ipa_wigig_disconn_pipe() - Client should call this
* function to disconnect a pipe
*
* @client: [in] pipe to be disconnected
*
* Note: Should not be called from atomic context
*
* Returns: 0 on success, negative on failure
*/
int ipa_wigig_disconn_pipe(enum ipa_client_type client);
/*
* ipa_wigig_enable_pipe() - Client should call this
* function to enable IPA offload data path
*
* @client: [in] pipe to be enabled
* Note: Should not be called from atomic context
*
* Returns: 0 on success, negative on failure
*/
int ipa_wigig_enable_pipe(enum ipa_client_type client);
/*
* ipa_wigig_disable_pipe() - Client should call this
* function to disable IPA offload data path
*
* @client: [in] pipe to be disabled
* Note: Should not be called from atomic context
*
* Returns: 0 on success, negative on failure
*/
int ipa_wigig_disable_pipe(enum ipa_client_type client);
/*
* ipa_wigig_tx_dp() - transmit tx packet through IPA to 11ad HW
*
* @dst: [in] destination ipa client pipe to be used
* @skb: [in] skb to be transmitted
*
* Returns: 0 on success, negative on failure
*/
int ipa_wigig_tx_dp(enum ipa_client_type dst, struct sk_buff *skb);
/**
* ipa_wigig_set_perf_profile() - Client should call this function to
* set IPA clock bandwidth based on data rates
*
* @max_supported_bw_mbps: [in] maximum bandwidth needed (in Mbps)
*
* Returns: 0 on success, negative on failure
*/
int ipa_wigig_set_perf_profile(u32 max_supported_bw_mbps);
#else /* (CONFIG_IPA || CONFIG_IPA3) */
static inline int ipa_wigig_init(struct ipa_wigig_init_in_params *in,
struct ipa_wigig_init_out_params *out)
{
return -EPERM;
}
static inline int ipa_wigig_cleanup(void)
{
return -EPERM;
}
static inline bool ipa_wigig_is_smmu_enabled(void)
{
return -EPERM;
}
static inline int ipa_wigig_reg_intf(struct ipa_wigig_reg_intf_in_params *in)
{
return -EPERM;
}
static inline int ipa_wigig_dereg_intf(const char *netdev_name)
{
return -EPERM;
}
static inline int ipa_wigig_conn_rx_pipe(
struct ipa_wigig_conn_rx_in_params *in,
struct ipa_wigig_conn_out_params *out)
{
return -EPERM;
}
static inline int ipa_wigig_conn_rx_pipe_smmu(
struct ipa_wigig_conn_rx_in_params_smmu *in,
struct ipa_wigig_conn_out_params *out)
{
return -EPERM;
}
static inline int ipa_wigig_conn_client(
struct ipa_wigig_conn_tx_in_params *in,
struct ipa_wigig_conn_out_params *out)
{
return -EPERM;
}
static inline int ipa_wigig_conn_client_smmu(
struct ipa_wigig_conn_tx_in_params_smmu *in,
struct ipa_wigig_conn_out_params *out)
{
return -EPERM;
}
static inline int ipa_wigig_disconn_pipe(enum ipa_client_type client)
{
return -EPERM;
}
static inline int ipa_wigig_enable_pipe(enum ipa_client_type client)
{
return -EPERM;
}
static inline int ipa_wigig_disable_pipe(enum ipa_client_type client)
{
return -EPERM;
}
static inline int ipa_wigig_tx_dp(enum ipa_client_type dst,
struct sk_buff *skb)
{
return -EPERM;
}
int ipa_wigig_set_perf_profile(u32 max_supported_bw_mbps)
{
return -EPERM;
}
#endif /* CONFIG_IPA3 */
#endif /* _IPA_WIGIG_H_ */

@ -711,7 +711,7 @@ struct __packed gsi_wdi_channel_scratch {
* @status_ring_hwtail_address_msb: High 32 bits of status ring hwtail address.
* @data_buffers_base_address_lsb: Low 32 bits of the data buffers address.
* @data_buffers_base_address_msb: High 32 bits of the data buffers address.
* @fixed_data_buffer_size: the fixed buffer size (> MTU).
* @fixed_data_buffer_size_pow_2: the fixed buffer size power of 2 (> MTU).
* @resv1: reserved bits.
*/
struct __packed gsi_11ad_rx_channel_scratch {
@ -719,7 +719,7 @@ struct __packed gsi_11ad_rx_channel_scratch {
uint32_t status_ring_hwtail_address_msb;
uint32_t data_buffers_base_address_lsb;
uint32_t data_buffers_base_address_msb:8;
uint32_t fixed_data_buffer_size:16;
uint32_t fixed_data_buffer_size_pow_2:16;
uint32_t resv1:8;
};
@ -733,7 +733,7 @@ struct __packed gsi_11ad_rx_channel_scratch {
* updating descriptor ring 11ad HWTAIL pointer moderation.
* @resv1: reserved bits.
* @resv2: reserved bit.
* @fixed_data_buffer_size: the fixed buffer size (> MTU).
* @fixed_data_buffer_size_pow_2: the fixed buffer size power of 2 (> MTU).
* @resv3: reserved bits.
*/
struct __packed gsi_11ad_tx_channel_scratch {
@ -742,7 +742,7 @@ struct __packed gsi_11ad_tx_channel_scratch {
uint32_t update_status_hwtail_mod_threshold:8;
uint32_t resv1:24;
uint32_t resv2:8;
uint32_t fixed_data_buffer_size:16;
uint32_t fixed_data_buffer_size_pow_2:16;
uint32_t resv3:8;
};
@ -843,7 +843,7 @@ union __packed gsi_evt_scratch {
struct __packed gsi_mhi_evt_scratch mhi;
struct __packed gsi_xdci_evt_scratch xdci;
struct __packed gsi_wdi_evt_scratch wdi;
struct __packed gsi_11ad_evt_scratch ad11;
struct __packed gsi_11ad_evt_scratch w11ad;
struct __packed {
uint32_t word1;
uint32_t word2;

@ -328,9 +328,17 @@ enum ipa_client_type {
/* RESERVED PROD = 86, */
IPA_CLIENT_APPS_WAN_COAL_CONS = 87,
IPA_CLIENT_WIGIG_PROD = 88,
IPA_CLIENT_WIGIG1_CONS = 89,
/* RESERVERD PROD = 90, */
IPA_CLIENT_WIGIG2_CONS = 91,
/* RESERVERD PROD = 92, */
IPA_CLIENT_WIGIG3_CONS = 93,
/* RESERVERD PROD = 94, */
IPA_CLIENT_WIGIG4_CONS = 95,
};
#define IPA_CLIENT_MAX (IPA_CLIENT_APPS_WAN_COAL_CONS + 1)
#define IPA_CLIENT_MAX (IPA_CLIENT_WIGIG4_CONS + 1)
#define IPA_CLIENT_Q6_DL_NLO_DATA_PROD IPA_CLIENT_Q6_DL_NLO_DATA_PROD
#define IPA_CLIENT_Q6_UL_NLO_ACK_CONS IPA_CLIENT_Q6_UL_NLO_ACK_CONS
@ -338,6 +346,11 @@ enum ipa_client_type {
#define IPA_CLIENT_MHI_DPL_CONS IPA_CLIENT_MHI_DPL_CONS
#define IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD IPA_CLIENT_Q6_AUDIO_DMA_MHI_PROD
#define IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS IPA_CLIENT_Q6_AUDIO_DMA_MHI_CONS
#define IPA_CLIENT_WIGIG_PROD IPA_CLIENT_WIGIG_PROD
#define IPA_CLIENT_WIGIG1_CONS IPA_CLIENT_WIGIG1_CONS
#define IPA_CLIENT_WIGIG2_CONS IPA_CLIENT_WIGIG2_CONS
#define IPA_CLIENT_WIGIG3_CONS IPA_CLIENT_WIGIG3_CONS
#define IPA_CLIENT_WIGIG4_CONS IPA_CLIENT_WIGIG4_CONS
#define IPA_CLIENT_IS_APPS_CONS(client) \
((client) == IPA_CLIENT_APPS_LAN_CONS || \

Loading…
Cancel
Save