mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
Merge "Register more ipa API"
This commit is contained in:
commit
8a9d067807
30 changed files with 856 additions and 4099 deletions
|
|
@ -4,7 +4,7 @@ ifeq ($(CONFIG_ARCH_LAHAINA), y)
|
|||
LINUXINCLUDE += -include $(srctree)/techpack/dataipa/config/dataipa.h
|
||||
ifeq ($(CONFIG_QGKI),y)
|
||||
include $(srctree)/techpack/dataipa/config/dataipa_QGKI.conf
|
||||
ifeq ($(CONFIG_DEBUG_KERNEL), y)
|
||||
ifeq ($(CONFIG_LOCALVERSION), "-qgki-debug")
|
||||
include $(srctree)/techpack/dataipa/config/dataipa_debug.conf
|
||||
LINUXINCLUDE += -include $(srctree)/techpack/dataipa/config/dataipa_debug.h
|
||||
endif
|
||||
|
|
@ -17,7 +17,7 @@ ifeq ($(CONFIG_ARCH_HOLI), y)
|
|||
LINUXINCLUDE += -include $(srctree)/techpack/dataipa/config/dataipa.h
|
||||
ifeq ($(CONFIG_QGKI),y)
|
||||
include $(srctree)/techpack/dataipa/config/dataipa_QGKI.conf
|
||||
ifeq ($(CONFIG_DEBUG_KERNEL), y)
|
||||
ifeq ($(CONFIG_LOCALVERSION), "-qgki-debug")
|
||||
include $(srctree)/techpack/dataipa/config/dataipa_debug.conf
|
||||
LINUXINCLUDE += -include $(srctree)/techpack/dataipa/config/dataipa_debug.h
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -31,12 +31,6 @@ ipam-y += \
|
|||
ipa_v3/ipahal/ipahal_fltrt.o \
|
||||
ipa_v3/ipahal/ipahal_hw_stats.o \
|
||||
ipa_v3/ipahal/ipahal_nat.o \
|
||||
ipa_clients/odu_bridge.o \
|
||||
ipa_clients/ipa_mhi_client.o \
|
||||
ipa_clients/ipa_uc_offload.o \
|
||||
ipa_clients/ipa_wdi3.o \
|
||||
ipa_clients/ipa_gsb.o \
|
||||
ipa_clients/ipa_wigig.o
|
||||
|
||||
ipam-$(CONFIG_RMNET_IPA3) += ipa_v3/rmnet_ipa.o ipa_v3/ipa_qmi_service_v01.o \
|
||||
ipa_v3/ipa_qmi_service.o ipa_v3/rmnet_ctl_ipa.o \
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -12,12 +12,6 @@
|
|||
#define _IPA_API_H_
|
||||
|
||||
struct ipa_api_controller {
|
||||
int (*ipa_reset_endpoint)(u32 clnt_hdl);
|
||||
|
||||
int (*ipa_clear_endpoint_delay)(u32 clnt_hdl);
|
||||
|
||||
int (*ipa_disable_endpoint)(u32 clnt_hdl);
|
||||
|
||||
int (*ipa_cfg_ep)(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg);
|
||||
|
||||
int (*ipa_cfg_ep_nat)(u32 clnt_hdl,
|
||||
|
|
@ -56,32 +50,15 @@ struct ipa_api_controller {
|
|||
int (*ipa_cfg_ep_holb_by_client)(enum ipa_client_type client,
|
||||
const struct ipa_ep_cfg_holb *ipa_ep_cfg);
|
||||
|
||||
int (*ipa_cfg_ep_ctrl)(u32 clnt_hdl,
|
||||
const struct ipa_ep_cfg_ctrl *ep_ctrl);
|
||||
|
||||
int (*ipa_add_hdr)(struct ipa_ioc_add_hdr *hdrs);
|
||||
|
||||
int (*ipa_add_hdr_usr)(struct ipa_ioc_add_hdr *hdrs, bool user_only);
|
||||
|
||||
int (*ipa_del_hdr)(struct ipa_ioc_del_hdr *hdls);
|
||||
|
||||
int (*ipa_commit_hdr)(void);
|
||||
|
||||
int (*ipa_reset_hdr)(bool user_only);
|
||||
|
||||
int (*ipa_get_hdr)(struct ipa_ioc_get_hdr *lookup);
|
||||
|
||||
int (*ipa_put_hdr)(u32 hdr_hdl);
|
||||
|
||||
int (*ipa_copy_hdr)(struct ipa_ioc_copy_hdr *copy);
|
||||
|
||||
int (*ipa_add_hdr_proc_ctx)(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs,
|
||||
bool user_only);
|
||||
|
||||
int (*ipa_del_hdr_proc_ctx)(struct ipa_ioc_del_hdr_proc_ctx *hdls);
|
||||
|
||||
int (*ipa_add_rt_rule)(struct ipa_ioc_add_rt_rule *rules);
|
||||
|
||||
int (*ipa_add_rt_rule_v2)(struct ipa_ioc_add_rt_rule_v2 *rules);
|
||||
|
||||
int (*ipa_add_rt_rule_usr)(struct ipa_ioc_add_rt_rule *rules,
|
||||
|
|
@ -98,8 +75,6 @@ struct ipa_api_controller {
|
|||
|
||||
int (*ipa_get_rt_tbl)(struct ipa_ioc_get_rt_tbl *lookup);
|
||||
|
||||
int (*ipa_put_rt_tbl)(u32 rt_tbl_hdl);
|
||||
|
||||
int (*ipa_query_rt_index)(struct ipa_ioc_get_rt_tbl_indx *in);
|
||||
|
||||
int (*ipa_mdfy_rt_rule)(struct ipa_ioc_mdfy_rt_rule *rules);
|
||||
|
|
@ -150,41 +125,6 @@ struct ipa_api_controller {
|
|||
|
||||
int (*ipa_nat_mdfy_pdn)(struct ipa_ioc_nat_pdn_entry *mdfy_pdn);
|
||||
|
||||
int (*ipa_send_msg)(struct ipa_msg_meta *meta, void *buff,
|
||||
ipa_msg_free_fn callback);
|
||||
|
||||
int (*ipa_register_pull_msg)(struct ipa_msg_meta *meta,
|
||||
ipa_msg_pull_fn callback);
|
||||
|
||||
int (*ipa_deregister_pull_msg)(struct ipa_msg_meta *meta);
|
||||
|
||||
int (*ipa_register_intf)(const char *name,
|
||||
const struct ipa_tx_intf *tx,
|
||||
const struct ipa_rx_intf *rx);
|
||||
|
||||
int (*ipa_register_intf_ext)(const char *name,
|
||||
const struct ipa_tx_intf *tx,
|
||||
const struct ipa_rx_intf *rx,
|
||||
const struct ipa_ext_intf *ext);
|
||||
|
||||
int (*ipa_deregister_intf)(const char *name);
|
||||
|
||||
int (*ipa_set_aggr_mode)(enum ipa_aggr_mode mode);
|
||||
|
||||
int (*ipa_set_qcncm_ndp_sig)(char sig[3]);
|
||||
|
||||
int (*ipa_set_single_ndp_per_mbim)(bool enable);
|
||||
|
||||
int (*ipa_tx_dp_mul)(enum ipa_client_type dst,
|
||||
struct ipa_tx_data_desc *data_desc);
|
||||
|
||||
void (*ipa_free_skb)(struct ipa_rx_data *data);
|
||||
|
||||
int (*ipa_setup_sys_pipe)(struct ipa_sys_connect_params *sys_in,
|
||||
u32 *clnt_hdl);
|
||||
|
||||
int (*ipa_teardown_sys_pipe)(u32 clnt_hdl);
|
||||
|
||||
int (*ipa_sys_setup)(struct ipa_sys_connect_params *sys_in,
|
||||
unsigned long *ipa_bam_hdl,
|
||||
u32 *ipa_pipe_num, u32 *clnt_hdl, bool en_status);
|
||||
|
|
@ -194,36 +134,8 @@ struct ipa_api_controller {
|
|||
int (*ipa_sys_update_gsi_hdls)(u32 clnt_hdl, unsigned long gsi_ch_hdl,
|
||||
unsigned long gsi_ev_hdl);
|
||||
|
||||
int (*ipa_connect_wdi_pipe)(struct ipa_wdi_in_params *in,
|
||||
struct ipa_wdi_out_params *out);
|
||||
|
||||
int (*ipa_disconnect_wdi_pipe)(u32 clnt_hdl);
|
||||
|
||||
int (*ipa_enable_wdi_pipe)(u32 clnt_hdl);
|
||||
|
||||
int (*ipa_disable_wdi_pipe)(u32 clnt_hdl);
|
||||
|
||||
int (*ipa_resume_wdi_pipe)(u32 clnt_hdl);
|
||||
|
||||
int (*ipa_suspend_wdi_pipe)(u32 clnt_hdl);
|
||||
|
||||
int (*ipa_get_wdi_stats)(struct IpaHwStatsWDIInfoData_t *stats);
|
||||
|
||||
int (*ipa_uc_bw_monitor)(struct ipa_wdi_bw_info *info);
|
||||
|
||||
int (*ipa_set_wlan_tx_info)(struct ipa_wdi_tx_info *info);
|
||||
|
||||
u16 (*ipa_get_smem_restr_bytes)(void);
|
||||
|
||||
int (*ipa_broadcast_wdi_quota_reach_ind)(uint32_t fid,
|
||||
uint64_t num_bytes);
|
||||
|
||||
int (*ipa_uc_wdi_get_dbpa)(struct ipa_wdi_db_params *out);
|
||||
|
||||
int (*ipa_uc_reg_rdyCB)(struct ipa_wdi_uc_ready_params *param);
|
||||
|
||||
int (*ipa_uc_dereg_rdyCB)(void);
|
||||
|
||||
int (*teth_bridge_init)(struct teth_bridge_init_params *params);
|
||||
|
||||
int (*teth_bridge_disconnect)(enum ipa_client_type client);
|
||||
|
|
@ -238,21 +150,6 @@ struct ipa_api_controller {
|
|||
|
||||
bool (*ipa_get_client_uplink)(int pipe_idx);
|
||||
|
||||
int (*ipa_dma_init)(void);
|
||||
|
||||
int (*ipa_dma_enable)(void);
|
||||
|
||||
int (*ipa_dma_disable)(void);
|
||||
|
||||
int (*ipa_dma_sync_memcpy)(u64 dest, u64 src, int len);
|
||||
|
||||
int (*ipa_dma_async_memcpy)(u64 dest, u64 src, int len,
|
||||
void (*user_cb)(void *user1), void *user_param);
|
||||
|
||||
int (*ipa_dma_uc_memcpy)(phys_addr_t dest, phys_addr_t src, int len);
|
||||
|
||||
void (*ipa_dma_destroy)(void);
|
||||
|
||||
bool (*ipa_has_open_aggr_frame)(enum ipa_client_type client);
|
||||
|
||||
int (*ipa_generate_tag_process)(void);
|
||||
|
|
@ -318,70 +215,14 @@ struct ipa_api_controller {
|
|||
|
||||
int (*ipa_write_qmap_id)(struct ipa_ioc_write_qmapid *param_in);
|
||||
|
||||
int (*ipa_add_interrupt_handler)(enum ipa_irq_type interrupt,
|
||||
ipa_irq_handler_t handler,
|
||||
bool deferred_flag,
|
||||
void *private_data);
|
||||
|
||||
int (*ipa_remove_interrupt_handler)(enum ipa_irq_type interrupt);
|
||||
|
||||
int (*ipa_restore_suspend_handler)(void);
|
||||
|
||||
void (*ipa_bam_reg_dump)(void);
|
||||
|
||||
int (*ipa_get_ep_mapping)(enum ipa_client_type client);
|
||||
|
||||
bool (*ipa_is_ready)(void);
|
||||
|
||||
void (*ipa_proxy_clk_vote)(void);
|
||||
|
||||
void (*ipa_proxy_clk_unvote)(void);
|
||||
|
||||
bool (*ipa_is_client_handle_valid)(u32 clnt_hdl);
|
||||
|
||||
enum ipa_client_type (*ipa_get_client_mapping)(int pipe_idx);
|
||||
|
||||
bool (*ipa_get_modem_cfg_emb_pipe_flt)(void);
|
||||
|
||||
enum ipa_transport_type (*ipa_get_transport_type)(void);
|
||||
|
||||
int (*ipa_ap_suspend)(struct device *dev);
|
||||
|
||||
int (*ipa_ap_resume)(struct device *dev);
|
||||
|
||||
int (*ipa_stop_gsi_channel)(u32 clnt_hdl);
|
||||
|
||||
int (*ipa_start_gsi_channel)(u32 clnt_hdl);
|
||||
|
||||
struct iommu_domain *(*ipa_get_smmu_domain)(void);
|
||||
|
||||
int (*ipa_disable_apps_wan_cons_deaggr)(uint32_t agg_size,
|
||||
uint32_t agg_count);
|
||||
|
||||
struct device *(*ipa_get_dma_dev)(void);
|
||||
|
||||
int (*ipa_release_wdi_mapping)(u32 num_buffers,
|
||||
struct ipa_wdi_buffer_info *info);
|
||||
|
||||
int (*ipa_create_wdi_mapping)(u32 num_buffers,
|
||||
struct ipa_wdi_buffer_info *info);
|
||||
|
||||
const struct ipa_gsi_ep_config *(*ipa_get_gsi_ep_info)
|
||||
(enum ipa_client_type client);
|
||||
|
||||
int (*ipa_register_rmnet_ctl_cb)(
|
||||
void (*ipa_rmnet_ctl_ready_cb)(void *user_data1),
|
||||
void *user_data1,
|
||||
void (*ipa_rmnet_ctl_stop_cb)(void *user_data2),
|
||||
void *user_data2,
|
||||
void (*ipa_rmnet_ctl_rx_notify_cb)(
|
||||
void *user_data3, void *rx_data),
|
||||
void *user_data3);
|
||||
|
||||
int (*ipa_unregister_rmnet_ctl_cb)(void);
|
||||
|
||||
int (*ipa_rmnet_ctl_xmit)(struct sk_buff *skb);
|
||||
|
||||
void (*ipa_inc_client_enable_clks)(
|
||||
struct ipa_active_client_logging_info *id);
|
||||
|
||||
|
|
@ -478,8 +319,6 @@ struct ipa_api_controller {
|
|||
|
||||
void (*ipa_deregister_client_callback)(enum ipa_client_type client);
|
||||
|
||||
bool (*ipa_get_lan_rx_napi)(void);
|
||||
|
||||
int (*ipa_uc_debug_stats_alloc)(
|
||||
struct IpaHwOffloadStatsAllocCmdData_t cmdinfo);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ obj-$(CONFIG_ECM_IPA) += ecmipam.o
|
|||
ecmipam-objs := ecm_ipa.o
|
||||
|
||||
obj-$(CONFIG_IPA_CLIENTS_MANAGER) += ipa_clientsm.o
|
||||
ipa_clientsm-objs := ipa_clients_manager.o ipa_usb.o
|
||||
ipa_clientsm-objs := ipa_clients_manager.o ipa_usb.o ipa_wdi3.o ipa_gsb.o ipa_uc_offload.o ipa_wigig.o ipa_mhi_client.o
|
||||
|
|
|
|||
|
|
@ -408,13 +408,13 @@ int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl, void *priv)
|
|||
ecm_ipa_ctx->state = next_state;
|
||||
ECM_IPA_STATE_DEBUG(ecm_ipa_ctx);
|
||||
|
||||
if (!ipa_is_client_handle_valid(usb_to_ipa_hdl)) {
|
||||
if (!ipa3_is_client_handle_valid(usb_to_ipa_hdl)) {
|
||||
ECM_IPA_ERROR
|
||||
("usb_to_ipa_hdl(%d) is not a valid ipa handle\n",
|
||||
usb_to_ipa_hdl);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!ipa_is_client_handle_valid(ipa_to_usb_hdl)) {
|
||||
if (!ipa3_is_client_handle_valid(ipa_to_usb_hdl)) {
|
||||
ECM_IPA_ERROR
|
||||
("ipa_to_usb_hdl(%d) is not a valid ipa handle\n",
|
||||
ipa_to_usb_hdl);
|
||||
|
|
@ -424,7 +424,7 @@ int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl, void *priv)
|
|||
ecm_ipa_ctx->ipa_to_usb_hdl = ipa_to_usb_hdl;
|
||||
ecm_ipa_ctx->usb_to_ipa_hdl = usb_to_ipa_hdl;
|
||||
|
||||
ecm_ipa_ctx->ipa_to_usb_client = ipa_get_client_mapping(ipa_to_usb_hdl);
|
||||
ecm_ipa_ctx->ipa_to_usb_client = ipa3_get_client_mapping(ipa_to_usb_hdl);
|
||||
if (ecm_ipa_ctx->ipa_to_usb_client < 0) {
|
||||
ECM_IPA_ERROR(
|
||||
"Error getting IPA->USB client from handle %d\n",
|
||||
|
|
@ -434,7 +434,7 @@ int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl, void *priv)
|
|||
ECM_IPA_DEBUG("ipa_to_usb_client = %d\n",
|
||||
ecm_ipa_ctx->ipa_to_usb_client);
|
||||
|
||||
ecm_ipa_ctx->usb_to_ipa_client = ipa_get_client_mapping(usb_to_ipa_hdl);
|
||||
ecm_ipa_ctx->usb_to_ipa_client = ipa3_get_client_mapping(usb_to_ipa_hdl);
|
||||
if (ecm_ipa_ctx->usb_to_ipa_client < 0) {
|
||||
ECM_IPA_ERROR(
|
||||
"Error getting USB->IPA client from handle %d\n",
|
||||
|
|
@ -919,7 +919,7 @@ static int ecm_ipa_rules_cfg
|
|||
|
||||
hdrs->commit = 1;
|
||||
hdrs->num_hdrs = 2;
|
||||
result = ipa_add_hdr(hdrs);
|
||||
result = ipa3_add_hdr(hdrs);
|
||||
if (result) {
|
||||
ECM_IPA_ERROR("Fail on Header-Insertion(%d)\n", result);
|
||||
goto out_free_mem;
|
||||
|
|
@ -971,9 +971,9 @@ static void ecm_ipa_rules_destroy(struct ecm_ipa_dev *ecm_ipa_ctx)
|
|||
ipv4->hdl = ecm_ipa_ctx->eth_ipv4_hdr_hdl;
|
||||
ipv6 = &del_hdr->hdl[1];
|
||||
ipv6->hdl = ecm_ipa_ctx->eth_ipv6_hdr_hdl;
|
||||
result = ipa_del_hdr(del_hdr);
|
||||
result = ipa3_del_hdr(del_hdr);
|
||||
if (result || ipv4->status || ipv6->status)
|
||||
ECM_IPA_ERROR("ipa_del_hdr failed\n");
|
||||
ECM_IPA_ERROR("ipa3_del_hdr failed\n");
|
||||
kfree(del_hdr);
|
||||
}
|
||||
|
||||
|
|
@ -1034,7 +1034,7 @@ static int ecm_ipa_register_properties(struct ecm_ipa_dev *ecm_ipa_ctx)
|
|||
rx_ipv6_property->hdr_l2_type = hdr_l2_type;
|
||||
rx_properties.num_props = 2;
|
||||
|
||||
result = ipa_register_intf("ecm0", &tx_properties, &rx_properties);
|
||||
result = ipa3_register_intf("ecm0", &tx_properties, &rx_properties);
|
||||
if (result)
|
||||
ECM_IPA_ERROR("fail on Tx/Rx properties registration\n");
|
||||
|
||||
|
|
@ -1048,7 +1048,7 @@ static void ecm_ipa_deregister_properties(void)
|
|||
int result;
|
||||
|
||||
ECM_IPA_LOG_ENTRY();
|
||||
result = ipa_deregister_intf("ecm0");
|
||||
result = ipa3_deregister_intf("ecm0");
|
||||
if (result)
|
||||
ECM_IPA_DEBUG("Fail on Tx prop deregister\n");
|
||||
ECM_IPA_LOG_EXIT();
|
||||
|
|
|
|||
|
|
@ -9,4 +9,16 @@
|
|||
int ipa3_usb_init(void);
|
||||
void ipa3_usb_exit(void);
|
||||
|
||||
#endif /* _IPA_CLIENTS_I_H */
|
||||
void ipa_wdi3_register(void);
|
||||
|
||||
void ipa_gsb_register(void);
|
||||
|
||||
void ipa_odu_bridge_register(void);
|
||||
|
||||
void ipa_uc_offload_register(void);
|
||||
|
||||
void ipa_mhi_register(void);
|
||||
|
||||
void ipa_wigig_register(void);
|
||||
|
||||
#endif /* _IPA_CLIENTS_I_H */
|
||||
|
|
|
|||
|
|
@ -16,6 +16,16 @@ static int __init ipa_clients_manager_init(void)
|
|||
|
||||
ipa3_usb_init();
|
||||
|
||||
ipa_wdi3_register();
|
||||
|
||||
ipa_gsb_register();
|
||||
|
||||
ipa_uc_offload_register();
|
||||
|
||||
ipa_mhi_register();
|
||||
|
||||
ipa_wigig_register();
|
||||
|
||||
ipa3_notify_clients_registered();
|
||||
|
||||
return 0;
|
||||
|
|
@ -31,4 +41,4 @@ static void __exit ipa_clients_manager_exit(void)
|
|||
module_exit(ipa_clients_manager_exit);
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DESCRIPTION("IPA HW clients manager");
|
||||
MODULE_DESCRIPTION("IPA HW clients manager");
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@
|
|||
#include <linux/ipa_odu_bridge.h>
|
||||
#include "../ipa_common_i.h"
|
||||
#include "../ipa_v3/ipa_pm.h"
|
||||
#include "../ipa_v3/ipa_i.h"
|
||||
#include <linux/ipa_fmwk.h>
|
||||
|
||||
#define IPA_GSB_DRV_NAME "ipa_gsb"
|
||||
|
||||
|
|
@ -319,7 +321,7 @@ static int ipa_gsb_commit_partial_hdr(struct ipa_gsb_iface_info *iface_info)
|
|||
IPA_GSB_SKB_DUMMY_HEADER) = htons(ETH_P_IPV6);
|
||||
}
|
||||
|
||||
if (ipa_add_hdr(hdr)) {
|
||||
if (ipa3_add_hdr(hdr)) {
|
||||
IPA_GSB_ERR("fail to add partial headers\n");
|
||||
kfree(hdr);
|
||||
return -EFAULT;
|
||||
|
|
@ -352,7 +354,7 @@ static void ipa_gsb_delete_partial_hdr(struct ipa_gsb_iface_info *iface_info)
|
|||
del_hdr->hdl[IPA_IP_v4].hdl = iface_info->partial_hdr_hdl[IPA_IP_v4];
|
||||
del_hdr->hdl[IPA_IP_v6].hdl = iface_info->partial_hdr_hdl[IPA_IP_v6];
|
||||
|
||||
if (ipa_del_hdr(del_hdr) != 0)
|
||||
if (ipa3_del_hdr(del_hdr) != 0)
|
||||
IPA_GSB_ERR("failed to delete partial hdr\n");
|
||||
|
||||
IPA_GSB_DBG("deleted partial hdr hdl for ipv4: %d\n",
|
||||
|
|
@ -406,7 +408,7 @@ static int ipa_gsb_reg_intf_props(struct ipa_gsb_iface_info *iface_info)
|
|||
rx_prop[1].attrib.meta_data = iface_info->iface_hdl;
|
||||
rx_prop[1].attrib.meta_data_mask = 0xFF;
|
||||
|
||||
if (ipa_register_intf(iface_info->netdev_name, &tx, &rx)) {
|
||||
if (ipa3_register_intf(iface_info->netdev_name, &tx, &rx)) {
|
||||
IPA_GSB_ERR("fail to add interface prop\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -416,7 +418,7 @@ static int ipa_gsb_reg_intf_props(struct ipa_gsb_iface_info *iface_info)
|
|||
|
||||
static void ipa_gsb_dereg_intf_props(struct ipa_gsb_iface_info *iface_info)
|
||||
{
|
||||
if (ipa_deregister_intf(iface_info->netdev_name) != 0)
|
||||
if (ipa3_deregister_intf(iface_info->netdev_name) != 0)
|
||||
IPA_GSB_ERR("fail to dereg intf props\n");
|
||||
|
||||
IPA_GSB_DBG("deregistered iface props for %s\n",
|
||||
|
|
@ -475,7 +477,7 @@ fail_pm_reg:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int ipa_bridge_init(struct ipa_bridge_init_params *params, u32 *hdl)
|
||||
static int ipa_bridge_init_internal(struct ipa_bridge_init_params *params, u32 *hdl)
|
||||
{
|
||||
int i, ret;
|
||||
struct ipa_gsb_iface_info *new_intf;
|
||||
|
|
@ -592,7 +594,6 @@ fail_alloc_mem:
|
|||
mutex_unlock(&ipa_gsb_ctx->lock);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_bridge_init);
|
||||
|
||||
static void ipa_gsb_deregister_pm(void)
|
||||
{
|
||||
|
|
@ -602,7 +603,7 @@ static void ipa_gsb_deregister_pm(void)
|
|||
ipa_gsb_ctx->pm_hdl = ~0;
|
||||
}
|
||||
|
||||
int ipa_bridge_cleanup(u32 hdl)
|
||||
static int ipa_bridge_cleanup_internal(u32 hdl)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -657,7 +658,6 @@ int ipa_bridge_cleanup(u32 hdl)
|
|||
mutex_unlock(&ipa_gsb_ctx->lock);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_bridge_cleanup);
|
||||
|
||||
static void ipa_gsb_cons_cb(void *priv, enum ipa_dp_evt_type evt,
|
||||
unsigned long data)
|
||||
|
|
@ -835,7 +835,7 @@ fail_prod:
|
|||
return res;
|
||||
}
|
||||
|
||||
int ipa_bridge_connect(u32 hdl)
|
||||
static int ipa_bridge_connect_internal(u32 hdl)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -896,7 +896,6 @@ int ipa_bridge_connect(u32 hdl)
|
|||
mutex_unlock(&ipa_gsb_ctx->iface_lock[hdl]);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_bridge_connect);
|
||||
|
||||
static int ipa_gsb_disconnect_sys_pipe(void)
|
||||
{
|
||||
|
|
@ -922,7 +921,7 @@ static int ipa_gsb_disconnect_sys_pipe(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ipa_bridge_disconnect(u32 hdl)
|
||||
static int ipa_bridge_disconnect_internal(u32 hdl)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
|
|
@ -989,9 +988,8 @@ fail:
|
|||
mutex_unlock(&ipa_gsb_ctx->iface_lock[hdl]);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_bridge_disconnect);
|
||||
|
||||
int ipa_bridge_resume(u32 hdl)
|
||||
static int ipa_bridge_resume_internal(u32 hdl)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -1057,9 +1055,8 @@ int ipa_bridge_resume(u32 hdl)
|
|||
mutex_unlock(&ipa_gsb_ctx->iface_lock[hdl]);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_bridge_resume);
|
||||
|
||||
int ipa_bridge_suspend(u32 hdl)
|
||||
static int ipa_bridge_suspend_internal(u32 hdl)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -1100,7 +1097,7 @@ int ipa_bridge_suspend(u32 hdl)
|
|||
|
||||
mutex_lock(&ipa_gsb_ctx->lock);
|
||||
if (ipa_gsb_ctx->num_resumed_iface == 1) {
|
||||
ret = ipa_stop_gsi_channel(
|
||||
ret = ipa3_stop_gsi_channel(
|
||||
ipa_gsb_ctx->cons_hdl);
|
||||
if (ret) {
|
||||
IPA_GSB_ERR(
|
||||
|
|
@ -1132,9 +1129,8 @@ int ipa_bridge_suspend(u32 hdl)
|
|||
mutex_unlock(&ipa_gsb_ctx->iface_lock[hdl]);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_bridge_suspend);
|
||||
|
||||
int ipa_bridge_set_perf_profile(u32 hdl, u32 bandwidth)
|
||||
static int ipa_bridge_set_perf_profile_internal(u32 hdl, u32 bandwidth)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -1160,9 +1156,8 @@ int ipa_bridge_set_perf_profile(u32 hdl, u32 bandwidth)
|
|||
mutex_unlock(&ipa_gsb_ctx->iface_lock[hdl]);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_bridge_set_perf_profile);
|
||||
|
||||
int ipa_bridge_tx_dp(u32 hdl, struct sk_buff *skb,
|
||||
static int ipa_bridge_tx_dp_internal(u32 hdl, struct sk_buff *skb,
|
||||
struct ipa_tx_meta *metadata)
|
||||
{
|
||||
struct ipa_gsb_mux_hdr *mux_hdr;
|
||||
|
|
@ -1223,7 +1218,23 @@ int ipa_bridge_tx_dp(u32 hdl, struct sk_buff *skb,
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_bridge_tx_dp);
|
||||
|
||||
void ipa_gsb_register(void)
|
||||
{
|
||||
struct ipa_gsb_data funcs;
|
||||
|
||||
funcs.ipa_bridge_init = ipa_bridge_init_internal;
|
||||
funcs.ipa_bridge_connect = ipa_bridge_connect_internal;
|
||||
funcs.ipa_bridge_set_perf_profile = ipa_bridge_set_perf_profile_internal;
|
||||
funcs.ipa_bridge_disconnect = ipa_bridge_disconnect_internal;
|
||||
funcs.ipa_bridge_suspend = ipa_bridge_suspend_internal;
|
||||
funcs.ipa_bridge_resume = ipa_bridge_resume_internal;
|
||||
funcs.ipa_bridge_tx_dp = ipa_bridge_tx_dp_internal;
|
||||
funcs.ipa_bridge_cleanup = ipa_bridge_cleanup_internal;
|
||||
|
||||
if (ipa_fmwk_register_gsb(&funcs))
|
||||
pr_err("failed to register ipa_gsb APIs\n");
|
||||
}
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DESCRIPTION("ipa gsb driver");
|
||||
|
|
|
|||
|
|
@ -10,10 +10,11 @@
|
|||
#include <linux/mutex.h>
|
||||
#include <linux/ipa.h>
|
||||
#include <linux/msm_gsi.h>
|
||||
#include <linux/ipa_qmi_service_v01.h>
|
||||
#include <linux/ipa_mhi.h>
|
||||
#include "../ipa_common_i.h"
|
||||
#include "../ipa_v3/ipa_pm.h"
|
||||
#include "../ipa_v3/ipa_i.h"
|
||||
#include <linux/ipa_fmwk.h>
|
||||
|
||||
#define IPA_MHI_DRV_NAME "ipa_mhi_client"
|
||||
|
||||
|
|
@ -63,16 +64,6 @@
|
|||
#define IPA_MHI_CLIENT_HOST_ADDR_COND(addr) \
|
||||
((ipa_mhi_client_ctx->assert_bit40)?(IPA_MHI_HOST_ADDR(addr)):(addr))
|
||||
|
||||
enum ipa_mhi_state {
|
||||
IPA_MHI_STATE_INITIALIZED,
|
||||
IPA_MHI_STATE_READY,
|
||||
IPA_MHI_STATE_STARTED,
|
||||
IPA_MHI_STATE_SUSPEND_IN_PROGRESS,
|
||||
IPA_MHI_STATE_SUSPENDED,
|
||||
IPA_MHI_STATE_RESUME_IN_PROGRESS,
|
||||
IPA_MHI_STATE_MAX
|
||||
};
|
||||
|
||||
static char *ipa_mhi_state_str[] = {
|
||||
__stringify(IPA_MHI_STATE_INITIALIZED),
|
||||
__stringify(IPA_MHI_STATE_READY),
|
||||
|
|
@ -183,7 +174,7 @@ static int ipa_mhi_read_write_host(enum ipa_mhi_dma_dir dir, void *dev_addr,
|
|||
IPA_MHI_FUNC_ENTRY();
|
||||
|
||||
if (ipa_mhi_client_ctx->use_ipadma) {
|
||||
pdev = ipa_get_dma_dev();
|
||||
pdev = ipa3_get_dma_dev();
|
||||
host_addr = IPA_MHI_CLIENT_HOST_ADDR_COND(host_addr);
|
||||
|
||||
mem.size = size;
|
||||
|
|
@ -653,32 +644,6 @@ static int ipa_mhi_set_state(enum ipa_mhi_state new_state)
|
|||
return res;
|
||||
}
|
||||
|
||||
static void ipa_mhi_uc_ready_cb(void)
|
||||
{
|
||||
IPA_MHI_FUNC_ENTRY();
|
||||
ipa_mhi_set_state(IPA_MHI_STATE_READY);
|
||||
IPA_MHI_FUNC_EXIT();
|
||||
}
|
||||
|
||||
static void ipa_mhi_uc_wakeup_request_cb(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
IPA_MHI_FUNC_ENTRY();
|
||||
IPA_MHI_DBG("MHI state: %s\n",
|
||||
MHI_STATE_STR(ipa_mhi_client_ctx->state));
|
||||
spin_lock_irqsave(&ipa_mhi_client_ctx->state_lock, flags);
|
||||
if (ipa_mhi_client_ctx->state == IPA_MHI_STATE_SUSPENDED)
|
||||
ipa_mhi_notify_wakeup();
|
||||
else if (ipa_mhi_client_ctx->state ==
|
||||
IPA_MHI_STATE_SUSPEND_IN_PROGRESS)
|
||||
/* wakeup event will be triggered after suspend finishes */
|
||||
ipa_mhi_client_ctx->trigger_wakeup = true;
|
||||
|
||||
spin_unlock_irqrestore(&ipa_mhi_client_ctx->state_lock, flags);
|
||||
IPA_MHI_FUNC_EXIT();
|
||||
}
|
||||
|
||||
/**
|
||||
* ipa_mhi_start() - Start IPA MHI engine
|
||||
* @params: pcie addresses for MHI
|
||||
|
|
@ -691,7 +656,7 @@ static void ipa_mhi_uc_wakeup_request_cb(void)
|
|||
* Return codes: 0 : success
|
||||
* negative : error
|
||||
*/
|
||||
int ipa_mhi_start(struct ipa_mhi_start_params *params)
|
||||
static int ipa_mhi_start_internal(struct ipa_mhi_start_params *params)
|
||||
{
|
||||
int res;
|
||||
struct ipa_mhi_init_engine init_params;
|
||||
|
|
@ -1016,13 +981,8 @@ static bool ipa_mhi_wait_for_ul_empty_timeout(unsigned int msecs)
|
|||
for (i = 0; i < IPA_MHI_MAX_UL_CHANNELS; i++) {
|
||||
if (!ipa_mhi_client_ctx->ul_channels[i].valid)
|
||||
continue;
|
||||
if (ipa_get_transport_type() ==
|
||||
IPA_TRANSPORT_TYPE_GSI)
|
||||
empty &= ipa_mhi_gsi_channel_empty(
|
||||
&ipa_mhi_client_ctx->ul_channels[i]);
|
||||
else
|
||||
empty &= ipa_mhi_sps_channel_empty(
|
||||
ipa_mhi_client_ctx->ul_channels[i].client);
|
||||
empty &= ipa_mhi_gsi_channel_empty(
|
||||
&ipa_mhi_client_ctx->ul_channels[i]);
|
||||
}
|
||||
|
||||
if (time_after(jiffies, jiffies_start + jiffies_timeout)) {
|
||||
|
|
@ -1030,8 +990,7 @@ static bool ipa_mhi_wait_for_ul_empty_timeout(unsigned int msecs)
|
|||
break;
|
||||
}
|
||||
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI &&
|
||||
IPA_MHI_MAX_UL_CHANNELS == 1)
|
||||
if (IPA_MHI_MAX_UL_CHANNELS == 1)
|
||||
usleep_range(IPA_GSI_CHANNEL_STOP_SLEEP_MIN_USEC,
|
||||
IPA_GSI_CHANNEL_STOP_SLEEP_MAX_USEC);
|
||||
}
|
||||
|
|
@ -1098,45 +1057,6 @@ static int ipa_mhi_disable_force_clear(u32 request_id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void ipa_mhi_set_holb_on_dl_channels(bool enable,
|
||||
struct ipa_ep_cfg_holb old_holb[])
|
||||
{
|
||||
int i;
|
||||
struct ipa_ep_cfg_holb ep_holb;
|
||||
int ep_idx;
|
||||
int res;
|
||||
|
||||
for (i = 0; i < IPA_MHI_MAX_DL_CHANNELS; i++) {
|
||||
if (!ipa_mhi_client_ctx->dl_channels[i].valid)
|
||||
continue;
|
||||
if (ipa_mhi_client_ctx->dl_channels[i].state ==
|
||||
IPA_HW_MHI_CHANNEL_STATE_INVALID)
|
||||
continue;
|
||||
ep_idx = ipa_get_ep_mapping(
|
||||
ipa_mhi_client_ctx->dl_channels[i].client);
|
||||
if (-1 == ep_idx) {
|
||||
IPA_MHI_ERR("Client %u is not mapped\n",
|
||||
ipa_mhi_client_ctx->dl_channels[i].client);
|
||||
ipa_assert();
|
||||
return;
|
||||
}
|
||||
memset(&ep_holb, 0, sizeof(ep_holb));
|
||||
if (enable) {
|
||||
ipa_get_holb(ep_idx, &old_holb[i]);
|
||||
ep_holb.en = 1;
|
||||
ep_holb.tmr_val = 0;
|
||||
} else {
|
||||
ep_holb = old_holb[i];
|
||||
}
|
||||
res = ipa_cfg_ep_holb(ep_idx, &ep_holb);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_cfg_ep_holb failed %d\n", res);
|
||||
ipa_assert();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int ipa_mhi_suspend_gsi_channel(struct ipa_mhi_channel_ctx *channel)
|
||||
{
|
||||
int clnt_hdl;
|
||||
|
|
@ -1147,7 +1067,7 @@ static int ipa_mhi_suspend_gsi_channel(struct ipa_mhi_channel_ctx *channel)
|
|||
if (clnt_hdl < 0)
|
||||
return -EFAULT;
|
||||
|
||||
res = ipa_stop_gsi_channel(clnt_hdl);
|
||||
res = ipa3_stop_gsi_channel(clnt_hdl);
|
||||
if (res != 0 && res != -GSI_STATUS_AGAIN &&
|
||||
res != -GSI_STATUS_TIMED_OUT) {
|
||||
IPA_MHI_ERR("GSI stop channel failed %d\n", res);
|
||||
|
|
@ -1169,31 +1089,20 @@ static int ipa_mhi_reset_ul_channel(struct ipa_mhi_channel_ctx *channel)
|
|||
{
|
||||
int res;
|
||||
bool empty;
|
||||
struct ipa_ep_cfg_holb old_ep_holb[IPA_MHI_MAX_DL_CHANNELS];
|
||||
|
||||
IPA_MHI_FUNC_ENTRY();
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) {
|
||||
res = ipa_mhi_suspend_gsi_channel(channel);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_mhi_suspend_gsi_channel failed %d\n",
|
||||
res);
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
res = ipa_uc_mhi_reset_channel(channel->index);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_uc_mhi_reset_channel failed %d\n",
|
||||
res);
|
||||
return res;
|
||||
}
|
||||
|
||||
res = ipa_mhi_suspend_gsi_channel(channel);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_mhi_suspend_gsi_channel failed %d\n",
|
||||
res);
|
||||
return res;
|
||||
}
|
||||
|
||||
empty = ipa_mhi_wait_for_ul_empty_timeout(
|
||||
IPA_MHI_CH_EMPTY_TIMEOUT_MSEC);
|
||||
if (!empty) {
|
||||
IPA_MHI_DBG("%s not empty\n",
|
||||
(ipa_get_transport_type() ==
|
||||
IPA_TRANSPORT_TYPE_GSI) ? "GSI" : "BAM");
|
||||
IPA_MHI_DBG("not empty\n");
|
||||
res = ipa_mhi_enable_force_clear(
|
||||
ipa_mhi_client_ctx->qmi_req_id, false);
|
||||
if (res) {
|
||||
|
|
@ -1203,25 +1112,9 @@ static int ipa_mhi_reset_ul_channel(struct ipa_mhi_channel_ctx *channel)
|
|||
return res;
|
||||
}
|
||||
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) {
|
||||
empty = ipa_mhi_wait_for_ul_empty_timeout(
|
||||
IPA_MHI_CH_EMPTY_TIMEOUT_MSEC);
|
||||
|
||||
IPA_MHI_DBG("empty=%d\n", empty);
|
||||
} else {
|
||||
/* enable packet drop on all DL channels */
|
||||
ipa_mhi_set_holb_on_dl_channels(true, old_ep_holb);
|
||||
ipa_generate_tag_process();
|
||||
/* disable packet drop on all DL channels */
|
||||
ipa_mhi_set_holb_on_dl_channels(false, old_ep_holb);
|
||||
|
||||
res = ipa_disable_sps_pipe(channel->client);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("sps_pipe_disable fail %d\n", res);
|
||||
ipa_assert();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
empty = ipa_mhi_wait_for_ul_empty_timeout(
|
||||
IPA_MHI_CH_EMPTY_TIMEOUT_MSEC);
|
||||
IPA_MHI_DBG("empty=%d\n", empty);
|
||||
|
||||
res =
|
||||
ipa_mhi_disable_force_clear(ipa_mhi_client_ctx->qmi_req_id);
|
||||
|
|
@ -1251,37 +1144,19 @@ static int ipa_mhi_reset_dl_channel(struct ipa_mhi_channel_ctx *channel)
|
|||
int res;
|
||||
|
||||
IPA_MHI_FUNC_ENTRY();
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) {
|
||||
res = ipa_mhi_suspend_gsi_channel(channel);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_mhi_suspend_gsi_channel failed %d\n"
|
||||
, res);
|
||||
return res;
|
||||
}
|
||||
res = ipa_mhi_suspend_gsi_channel(channel);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_mhi_suspend_gsi_channel failed %d\n"
|
||||
, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
res = ipa_mhi_reset_channel_internal(channel->client);
|
||||
if (res) {
|
||||
IPA_MHI_ERR(
|
||||
"ipa_mhi_reset_ul_channel_internal failed %d\n"
|
||||
, res);
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
res = ipa_mhi_reset_channel_internal(channel->client);
|
||||
if (res) {
|
||||
IPA_MHI_ERR(
|
||||
"ipa_mhi_reset_ul_channel_internal failed %d\n"
|
||||
, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
res = ipa_uc_mhi_reset_channel(channel->index);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_uc_mhi_reset_channel failed %d\n",
|
||||
res);
|
||||
ipa_mhi_start_channel_internal(channel->client);
|
||||
return res;
|
||||
}
|
||||
res = ipa_mhi_reset_channel_internal(channel->client);
|
||||
if (res) {
|
||||
IPA_MHI_ERR(
|
||||
"ipa_mhi_reset_ul_channel_internal failed %d\n"
|
||||
, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
IPA_MHI_FUNC_EXIT();
|
||||
|
|
@ -1305,8 +1180,7 @@ static int ipa_mhi_reset_channel(struct ipa_mhi_channel_ctx *channel,
|
|||
|
||||
channel->state = IPA_HW_MHI_CHANNEL_STATE_DISABLE;
|
||||
|
||||
if ((ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) &&
|
||||
update_state) {
|
||||
if (update_state) {
|
||||
res = ipa_mhi_read_write_host(IPA_MHI_DMA_TO_HOST,
|
||||
&channel->state, channel->channel_context_addr +
|
||||
offsetof(struct ipa_mhi_ch_ctx, chstate),
|
||||
|
|
@ -1333,11 +1207,12 @@ static int ipa_mhi_reset_channel(struct ipa_mhi_channel_ctx *channel,
|
|||
* Return codes: 0 : success
|
||||
* negative : error
|
||||
*/
|
||||
int ipa_mhi_connect_pipe(struct ipa_mhi_connect_params *in, u32 *clnt_hdl)
|
||||
static int ipa_mhi_connect_pipe_internal(struct ipa_mhi_connect_params *in, u32 *clnt_hdl)
|
||||
{
|
||||
int res;
|
||||
unsigned long flags;
|
||||
struct ipa_mhi_channel_ctx *channel = NULL;
|
||||
struct ipa_mhi_connect_params_internal internal;
|
||||
|
||||
IPA_MHI_FUNC_ENTRY();
|
||||
|
||||
|
|
@ -1395,71 +1270,55 @@ int ipa_mhi_connect_pipe(struct ipa_mhi_connect_params *in, u32 *clnt_hdl)
|
|||
IPA_ACTIVE_CLIENTS_INC_EP(in->sys.client);
|
||||
|
||||
mutex_lock(&mhi_client_general_mutex);
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) {
|
||||
struct ipa_mhi_connect_params_internal internal;
|
||||
|
||||
IPA_MHI_DBG("reading ch/ev context from host\n");
|
||||
res = ipa_mhi_read_ch_ctx(channel);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_mhi_read_ch_ctx failed %d\n", res);
|
||||
goto fail_start_channel;
|
||||
}
|
||||
|
||||
internal.channel_id = in->channel_id;
|
||||
internal.sys = &in->sys;
|
||||
internal.start.gsi.state = channel->state;
|
||||
internal.start.gsi.msi = &ipa_mhi_client_ctx->msi;
|
||||
internal.start.gsi.ev_ctx_host = &channel->ev_ctx_host;
|
||||
internal.start.gsi.event_context_addr =
|
||||
channel->event_context_addr;
|
||||
internal.start.gsi.ch_ctx_host = &channel->ch_ctx_host;
|
||||
internal.start.gsi.channel_context_addr =
|
||||
channel->channel_context_addr;
|
||||
internal.start.gsi.ch_err_cb = ipa_mhi_gsi_ch_err_cb;
|
||||
internal.start.gsi.channel = (void *)channel;
|
||||
internal.start.gsi.ev_err_cb = ipa_mhi_gsi_ev_err_cb;
|
||||
internal.start.gsi.assert_bit40 =
|
||||
ipa_mhi_client_ctx->assert_bit40;
|
||||
internal.start.gsi.mhi = &channel->ch_scratch.mhi;
|
||||
internal.start.gsi.cached_gsi_evt_ring_hdl =
|
||||
&channel->cached_gsi_evt_ring_hdl;
|
||||
internal.start.gsi.evchid = channel->index;
|
||||
|
||||
res = ipa_connect_mhi_pipe(&internal, clnt_hdl);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_connect_mhi_pipe failed %d\n", res);
|
||||
goto fail_connect_pipe;
|
||||
}
|
||||
channel->state = IPA_HW_MHI_CHANNEL_STATE_RUN;
|
||||
channel->brstmode_enabled =
|
||||
channel->ch_scratch.mhi.burst_mode_enabled;
|
||||
|
||||
res = ipa_mhi_read_write_host(IPA_MHI_DMA_TO_HOST,
|
||||
&channel->state, channel->channel_context_addr +
|
||||
offsetof(struct ipa_mhi_ch_ctx, chstate),
|
||||
sizeof(((struct ipa_mhi_ch_ctx *)0)->chstate));
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_mhi_read_write_host failed\n");
|
||||
mutex_unlock(&mhi_client_general_mutex);
|
||||
IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client);
|
||||
return res;
|
||||
|
||||
}
|
||||
} else {
|
||||
struct ipa_mhi_connect_params_internal internal;
|
||||
|
||||
internal.channel_id = in->channel_id;
|
||||
internal.sys = &in->sys;
|
||||
internal.start.uC.index = channel->index;
|
||||
internal.start.uC.id = channel->id;
|
||||
internal.start.uC.state = channel->state;
|
||||
res = ipa_connect_mhi_pipe(&internal, clnt_hdl);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_connect_mhi_pipe failed %d\n", res);
|
||||
goto fail_connect_pipe;
|
||||
}
|
||||
channel->state = IPA_HW_MHI_CHANNEL_STATE_RUN;
|
||||
IPA_MHI_DBG("reading ch/ev context from host\n");
|
||||
res = ipa_mhi_read_ch_ctx(channel);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_mhi_read_ch_ctx failed %d\n", res);
|
||||
goto fail_start_channel;
|
||||
}
|
||||
|
||||
internal.channel_id = in->channel_id;
|
||||
internal.sys = &in->sys;
|
||||
internal.start.gsi.state = channel->state;
|
||||
internal.start.gsi.msi = &ipa_mhi_client_ctx->msi;
|
||||
internal.start.gsi.ev_ctx_host = &channel->ev_ctx_host;
|
||||
internal.start.gsi.event_context_addr =
|
||||
channel->event_context_addr;
|
||||
internal.start.gsi.ch_ctx_host = &channel->ch_ctx_host;
|
||||
internal.start.gsi.channel_context_addr =
|
||||
channel->channel_context_addr;
|
||||
internal.start.gsi.ch_err_cb = ipa_mhi_gsi_ch_err_cb;
|
||||
internal.start.gsi.channel = (void *)channel;
|
||||
internal.start.gsi.ev_err_cb = ipa_mhi_gsi_ev_err_cb;
|
||||
internal.start.gsi.assert_bit40 =
|
||||
ipa_mhi_client_ctx->assert_bit40;
|
||||
internal.start.gsi.mhi = &channel->ch_scratch.mhi;
|
||||
internal.start.gsi.cached_gsi_evt_ring_hdl =
|
||||
&channel->cached_gsi_evt_ring_hdl;
|
||||
internal.start.gsi.evchid = channel->index;
|
||||
|
||||
res = ipa_connect_mhi_pipe(&internal, clnt_hdl);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_connect_mhi_pipe failed %d\n", res);
|
||||
goto fail_connect_pipe;
|
||||
}
|
||||
channel->state = IPA_HW_MHI_CHANNEL_STATE_RUN;
|
||||
channel->brstmode_enabled =
|
||||
channel->ch_scratch.mhi.burst_mode_enabled;
|
||||
|
||||
res = ipa_mhi_read_write_host(IPA_MHI_DMA_TO_HOST,
|
||||
&channel->state, channel->channel_context_addr +
|
||||
offsetof(struct ipa_mhi_ch_ctx, chstate),
|
||||
sizeof(((struct ipa_mhi_ch_ctx *)0)->chstate));
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_mhi_read_write_host failed\n");
|
||||
mutex_unlock(&mhi_client_general_mutex);
|
||||
IPA_ACTIVE_CLIENTS_DEC_EP(in->sys.client);
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
mutex_unlock(&mhi_client_general_mutex);
|
||||
|
||||
if (!in->sys.keep_ipa_awake)
|
||||
|
|
@ -1490,7 +1349,7 @@ fail_start_channel:
|
|||
* Return codes: 0 : success
|
||||
* negative : error
|
||||
*/
|
||||
int ipa_mhi_disconnect_pipe(u32 clnt_hdl)
|
||||
static int ipa_mhi_disconnect_pipe_internal(u32 clnt_hdl)
|
||||
{
|
||||
int res;
|
||||
enum ipa_client_type client;
|
||||
|
|
@ -1503,7 +1362,7 @@ int ipa_mhi_disconnect_pipe(u32 clnt_hdl)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
client = ipa_get_client_mapping(clnt_hdl);
|
||||
client = ipa3_get_client_mapping(clnt_hdl);
|
||||
|
||||
if (!IPA_CLIENT_IS_MHI(client)) {
|
||||
IPA_MHI_ERR("invalid IPA MHI client, client: %d\n", client);
|
||||
|
|
@ -1516,7 +1375,7 @@ int ipa_mhi_disconnect_pipe(u32 clnt_hdl)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
IPA_ACTIVE_CLIENTS_INC_EP(ipa_get_client_mapping(clnt_hdl));
|
||||
IPA_ACTIVE_CLIENTS_INC_EP(client);
|
||||
|
||||
res = ipa_mhi_reset_channel(channel, false);
|
||||
if (res) {
|
||||
|
|
@ -1534,7 +1393,7 @@ int ipa_mhi_disconnect_pipe(u32 clnt_hdl)
|
|||
}
|
||||
mutex_unlock(&mhi_client_general_mutex);
|
||||
|
||||
IPA_ACTIVE_CLIENTS_DEC_EP(ipa_get_client_mapping(clnt_hdl));
|
||||
IPA_ACTIVE_CLIENTS_DEC_EP(client);
|
||||
|
||||
IPA_MHI_DBG("client (ep: %d) disconnected\n", clnt_hdl);
|
||||
IPA_MHI_FUNC_EXIT();
|
||||
|
|
@ -1542,7 +1401,7 @@ int ipa_mhi_disconnect_pipe(u32 clnt_hdl)
|
|||
fail_disconnect_pipe:
|
||||
mutex_unlock(&mhi_client_general_mutex);
|
||||
fail_reset_channel:
|
||||
IPA_ACTIVE_CLIENTS_DEC_EP(ipa_get_client_mapping(clnt_hdl));
|
||||
IPA_ACTIVE_CLIENTS_DEC_EP(client);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -1562,12 +1421,7 @@ static int ipa_mhi_suspend_channels(struct ipa_mhi_channel_ctx *channels,
|
|||
IPA_MHI_DBG("suspending channel %d\n",
|
||||
channels[i].id);
|
||||
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI)
|
||||
res = ipa_mhi_suspend_gsi_channel(
|
||||
&channels[i]);
|
||||
else
|
||||
res = ipa_uc_mhi_suspend_channel(
|
||||
channels[i].index);
|
||||
res = ipa_mhi_suspend_gsi_channel(&channels[i]);
|
||||
|
||||
if (res) {
|
||||
IPA_MHI_ERR("failed to suspend channel %d error %d\n",
|
||||
|
|
@ -1585,31 +1439,6 @@ static int ipa_mhi_suspend_channels(struct ipa_mhi_channel_ctx *channels,
|
|||
static int ipa_mhi_stop_event_update_channels(
|
||||
struct ipa_mhi_channel_ctx *channels, int max_channels)
|
||||
{
|
||||
int i;
|
||||
int res;
|
||||
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI)
|
||||
return 0;
|
||||
|
||||
IPA_MHI_FUNC_ENTRY();
|
||||
for (i = 0; i < max_channels; i++) {
|
||||
if (!channels[i].valid)
|
||||
continue;
|
||||
if (channels[i].state !=
|
||||
IPA_HW_MHI_CHANNEL_STATE_SUSPEND)
|
||||
continue;
|
||||
IPA_MHI_DBG("stop update event channel %d\n",
|
||||
channels[i].id);
|
||||
res = ipa_uc_mhi_stop_event_update_channel(
|
||||
channels[i].index);
|
||||
if (res) {
|
||||
IPA_MHI_ERR("failed stop event channel %d error %d\n",
|
||||
i, res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
IPA_MHI_FUNC_EXIT();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1732,8 +1561,7 @@ static int ipa_mhi_suspend_ul(bool force, bool *empty, bool *force_clear)
|
|||
*empty = ipa_mhi_wait_for_ul_empty_timeout(
|
||||
IPA_MHI_CH_EMPTY_TIMEOUT_MSEC);
|
||||
IPA_MHI_DBG("empty=%d\n", *empty);
|
||||
if (!*empty && ipa_get_transport_type()
|
||||
== IPA_TRANSPORT_TYPE_GSI) {
|
||||
if (!*empty) {
|
||||
IPA_MHI_ERR("Failed to suspend UL channels\n");
|
||||
if (ipa_mhi_client_ctx->test_mode) {
|
||||
res = -EAGAIN;
|
||||
|
|
@ -1761,7 +1589,7 @@ static int ipa_mhi_suspend_ul(bool force, bool *empty, bool *force_clear)
|
|||
ipa_mhi_client_ctx->qmi_req_id++;
|
||||
}
|
||||
|
||||
if (!force && ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) {
|
||||
if (!force) {
|
||||
if (ipa_mhi_check_pending_packets_from_host()) {
|
||||
res = -EAGAIN;
|
||||
goto fail_suspend_ul_channel;
|
||||
|
|
@ -1906,15 +1734,13 @@ static int ipa_mhi_suspend_dl(bool force)
|
|||
goto fail_stop_event_update_dl_channel;
|
||||
}
|
||||
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) {
|
||||
if (ipa_mhi_has_open_aggr_frame()) {
|
||||
IPA_MHI_DBG("There is an open aggr frame\n");
|
||||
if (force) {
|
||||
ipa_mhi_client_ctx->trigger_wakeup = true;
|
||||
} else {
|
||||
res = -EAGAIN;
|
||||
goto fail_stop_event_update_dl_channel;
|
||||
}
|
||||
if (ipa_mhi_has_open_aggr_frame()) {
|
||||
IPA_MHI_DBG("There is an open aggr frame\n");
|
||||
if (force) {
|
||||
ipa_mhi_client_ctx->trigger_wakeup = true;
|
||||
} else {
|
||||
res = -EAGAIN;
|
||||
goto fail_stop_event_update_dl_channel;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1943,7 +1769,7 @@ fail_suspend_dl_channel:
|
|||
* Return codes: 0 : success
|
||||
* negative : error
|
||||
*/
|
||||
int ipa_mhi_suspend(bool force)
|
||||
static int ipa_mhi_suspend_internal(bool force)
|
||||
{
|
||||
int res;
|
||||
bool empty;
|
||||
|
|
@ -1971,8 +1797,7 @@ int ipa_mhi_suspend(bool force)
|
|||
goto fail_suspend_ul_channel;
|
||||
}
|
||||
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI)
|
||||
ipa_mhi_update_host_ch_state(true);
|
||||
ipa_mhi_update_host_ch_state(true);
|
||||
|
||||
/*
|
||||
* hold IPA clocks and release them after all
|
||||
|
|
@ -2045,7 +1870,7 @@ fail_suspend_dl_channel:
|
|||
* Return codes: 0 : success
|
||||
* negative : error
|
||||
*/
|
||||
int ipa_mhi_resume(void)
|
||||
static int ipa_mhi_resume_internal(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
|
|
@ -2087,8 +1912,7 @@ int ipa_mhi_resume(void)
|
|||
goto fail_resume_dl_channels;
|
||||
}
|
||||
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI)
|
||||
ipa_mhi_update_host_ch_state(false);
|
||||
ipa_mhi_update_host_ch_state(false);
|
||||
|
||||
res = ipa_mhi_set_state(IPA_MHI_STATE_STARTED);
|
||||
if (res) {
|
||||
|
|
@ -2131,7 +1955,7 @@ static int ipa_mhi_destroy_channels(struct ipa_mhi_channel_ctx *channels,
|
|||
if (channel->state != IPA_HW_MHI_CHANNEL_STATE_DISABLE) {
|
||||
clnt_hdl = ipa_get_ep_mapping(channel->client);
|
||||
IPA_MHI_DBG("disconnect pipe (ep: %d)\n", clnt_hdl);
|
||||
res = ipa_mhi_disconnect_pipe(clnt_hdl);
|
||||
res = ipa_mhi_disconnect_pipe_internal(clnt_hdl);
|
||||
if (res) {
|
||||
IPA_MHI_ERR(
|
||||
"failed to disconnect pipe %d, err %d\n"
|
||||
|
|
@ -2211,7 +2035,7 @@ static void ipa_mhi_deregister_pm(void)
|
|||
* MHI resources.
|
||||
* When this function returns ipa_mhi can re-initialize.
|
||||
*/
|
||||
void ipa_mhi_destroy(void)
|
||||
static void ipa_mhi_destroy_internal(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
|
|
@ -2224,21 +2048,14 @@ void ipa_mhi_destroy(void)
|
|||
ipa_deregister_client_callback(IPA_CLIENT_MHI_PROD);
|
||||
|
||||
/* reset all UL and DL acc channels and its accociated event rings */
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) {
|
||||
res = ipa_mhi_destroy_all_channels();
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_mhi_destroy_all_channels failed %d\n",
|
||||
res);
|
||||
goto fail;
|
||||
}
|
||||
res = ipa_mhi_destroy_all_channels();
|
||||
if (res) {
|
||||
IPA_MHI_ERR("ipa_mhi_destroy_all_channels failed %d\n",
|
||||
res);
|
||||
goto fail;
|
||||
}
|
||||
IPA_MHI_DBG("All channels are disconnected\n");
|
||||
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_SPS) {
|
||||
IPA_MHI_DBG("cleanup uC MHI\n");
|
||||
ipa_uc_mhi_cleanup();
|
||||
}
|
||||
|
||||
ipa_mhi_deregister_pm();
|
||||
ipa_dma_destroy();
|
||||
ipa_mhi_debugfs_destroy();
|
||||
|
|
@ -2339,7 +2156,7 @@ fail_pm_cons:
|
|||
* Return codes: 0 : success
|
||||
* negative : error
|
||||
*/
|
||||
int ipa_mhi_init(struct ipa_mhi_init_params *params)
|
||||
static int ipa_mhi_init_internal(struct ipa_mhi_init_params *params)
|
||||
{
|
||||
int res;
|
||||
|
||||
|
|
@ -2411,15 +2228,7 @@ int ipa_mhi_init(struct ipa_mhi_init_params *params)
|
|||
goto fail_pm;
|
||||
}
|
||||
|
||||
if (ipa_get_transport_type() == IPA_TRANSPORT_TYPE_GSI) {
|
||||
ipa_mhi_set_state(IPA_MHI_STATE_READY);
|
||||
} else {
|
||||
/* Initialize uC interface */
|
||||
ipa_uc_mhi_init(ipa_mhi_uc_ready_cb,
|
||||
ipa_mhi_uc_wakeup_request_cb);
|
||||
if (ipa_uc_state_check() == 0)
|
||||
ipa_mhi_set_state(IPA_MHI_STATE_READY);
|
||||
}
|
||||
ipa_mhi_set_state(IPA_MHI_STATE_READY);
|
||||
|
||||
ipa_register_client_callback(&ipa_mhi_set_lock_unlock, NULL,
|
||||
IPA_CLIENT_MHI_PROD);
|
||||
|
|
@ -2441,21 +2250,6 @@ fail_alloc_ctx:
|
|||
return res;
|
||||
}
|
||||
|
||||
static void ipa_mhi_cache_dl_ul_sync_info(
|
||||
struct ipa_config_req_msg_v01 *config_req)
|
||||
{
|
||||
ipa_cached_dl_ul_sync_info.params.isDlUlSyncEnabled = true;
|
||||
ipa_cached_dl_ul_sync_info.params.UlAccmVal =
|
||||
(config_req->ul_accumulation_time_limit_valid) ?
|
||||
config_req->ul_accumulation_time_limit : 0;
|
||||
ipa_cached_dl_ul_sync_info.params.ulMsiEventThreshold =
|
||||
(config_req->ul_msi_event_threshold_valid) ?
|
||||
config_req->ul_msi_event_threshold : 0;
|
||||
ipa_cached_dl_ul_sync_info.params.dlMsiEventThreshold =
|
||||
(config_req->dl_msi_event_threshold_valid) ?
|
||||
config_req->dl_msi_event_threshold : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ipa_mhi_handle_ipa_config_req() - hanle IPA CONFIG QMI message
|
||||
*
|
||||
|
|
@ -2466,23 +2260,12 @@ static void ipa_mhi_cache_dl_ul_sync_info(
|
|||
* Return codes: 0 : success
|
||||
* negative : error
|
||||
*/
|
||||
int ipa_mhi_handle_ipa_config_req(struct ipa_config_req_msg_v01 *config_req)
|
||||
static int ipa_mhi_handle_ipa_config_req_cb(struct ipa_config_req_msg_v01 *config_req)
|
||||
{
|
||||
IPA_MHI_FUNC_ENTRY();
|
||||
|
||||
if (ipa_get_transport_type() != IPA_TRANSPORT_TYPE_GSI) {
|
||||
ipa_mhi_cache_dl_ul_sync_info(config_req);
|
||||
if (ipa_mhi_client_ctx &&
|
||||
ipa_mhi_client_ctx->state !=
|
||||
IPA_MHI_STATE_INITIALIZED)
|
||||
ipa_uc_mhi_send_dl_ul_sync_info(
|
||||
&ipa_cached_dl_ul_sync_info);
|
||||
}
|
||||
|
||||
IPA_MHI_FUNC_EXIT();
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_mhi_handle_ipa_config_req);
|
||||
|
||||
int ipa_mhi_is_using_dma(bool *flag)
|
||||
{
|
||||
|
|
@ -2498,12 +2281,25 @@ int ipa_mhi_is_using_dma(bool *flag)
|
|||
IPA_MHI_FUNC_EXIT();
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_mhi_is_using_dma);
|
||||
|
||||
const char *ipa_mhi_get_state_str(int state)
|
||||
void ipa_mhi_register(void)
|
||||
{
|
||||
return MHI_STATE_STR(state);
|
||||
struct ipa_mhi_data funcs;
|
||||
|
||||
funcs.ipa_mhi_init = ipa_mhi_init_internal;
|
||||
funcs.ipa_mhi_start = ipa_mhi_start_internal;
|
||||
funcs.ipa_mhi_connect_pipe = ipa_mhi_connect_pipe_internal;
|
||||
funcs.ipa_mhi_disconnect_pipe = ipa_mhi_disconnect_pipe_internal;
|
||||
funcs.ipa_mhi_suspend = ipa_mhi_suspend_internal;
|
||||
funcs.ipa_mhi_resume = ipa_mhi_resume_internal;
|
||||
funcs.ipa_mhi_destroy = ipa_mhi_destroy_internal;
|
||||
funcs.ipa_mhi_handle_ipa_config_req = ipa_mhi_handle_ipa_config_req_cb;
|
||||
|
||||
if (ipa_fmwk_register_ipa_mhi(&funcs))
|
||||
pr_err("failed to register ipa_mhi APIs\n");
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_mhi_get_state_str);
|
||||
EXPORT_SYMBOL(ipa_mhi_register);
|
||||
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DESCRIPTION("IPA MHI client driver");
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <linux/if_vlan.h>
|
||||
#include "../ipa_common_i.h"
|
||||
#include "../ipa_v3/ipa_pm.h"
|
||||
#include <linux/ipa_fmwk.h>
|
||||
|
||||
#define IPA_NTN_DMA_POOL_ALIGNMENT 8
|
||||
#define OFFLOAD_DRV_NAME "ipa_uc_offload"
|
||||
|
|
@ -99,7 +100,7 @@ static int ipa_commit_partial_hdr(
|
|||
hdr->hdr[i].eth2_ofst = hdr_info[i].dst_mac_addr_offset;
|
||||
}
|
||||
|
||||
if (ipa_add_hdr(hdr)) {
|
||||
if (ipa3_add_hdr(hdr)) {
|
||||
IPA_UC_OFFLOAD_ERR("fail to add partial headers\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -264,7 +265,7 @@ static int ipa_uc_offload_ntn_reg_intf(
|
|||
rx_prop[1].attrib.meta_data_mask = inp->meta_data_mask;
|
||||
}
|
||||
|
||||
if (ipa_register_intf(inp->netdev_name, &tx, &rx)) {
|
||||
if (ipa3_register_intf(inp->netdev_name, &tx, &rx)) {
|
||||
IPA_UC_OFFLOAD_ERR("fail to add interface prop\n");
|
||||
memset(ntn_ctx, 0, sizeof(*ntn_ctx));
|
||||
ret = -EFAULT;
|
||||
|
|
@ -286,7 +287,7 @@ fail_alloc:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int ipa_uc_offload_reg_intf(
|
||||
static int ipa_uc_offload_reg_intf_internal(
|
||||
struct ipa_uc_offload_intf_params *inp,
|
||||
struct ipa_uc_offload_out_params *outp)
|
||||
{
|
||||
|
|
@ -329,7 +330,6 @@ int ipa_uc_offload_reg_intf(
|
|||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_uc_offload_reg_intf);
|
||||
|
||||
|
||||
static int ipa_uc_ntn_alloc_conn_smmu_info(struct ipa_ntn_setup_info *dest,
|
||||
|
|
@ -438,7 +438,7 @@ fail:
|
|||
return result;
|
||||
}
|
||||
|
||||
int ipa_uc_offload_conn_pipes(struct ipa_uc_offload_conn_in_params *inp,
|
||||
static int ipa_uc_offload_conn_pipes_internal(struct ipa_uc_offload_conn_in_params *inp,
|
||||
struct ipa_uc_offload_conn_out_params *outp)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
@ -481,7 +481,6 @@ int ipa_uc_offload_conn_pipes(struct ipa_uc_offload_conn_in_params *inp,
|
|||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_uc_offload_conn_pipes);
|
||||
|
||||
static int ipa_uc_ntn_disconn_pipes(struct ipa_uc_offload_ctx *ntn_ctx)
|
||||
{
|
||||
|
|
@ -518,7 +517,7 @@ static int ipa_uc_ntn_disconn_pipes(struct ipa_uc_offload_ctx *ntn_ctx)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int ipa_uc_offload_disconn_pipes(u32 clnt_hdl)
|
||||
static int ipa_uc_offload_disconn_pipes_internal(u32 clnt_hdl)
|
||||
{
|
||||
struct ipa_uc_offload_ctx *offload_ctx;
|
||||
int ret = 0;
|
||||
|
|
@ -553,7 +552,6 @@ int ipa_uc_offload_disconn_pipes(u32 clnt_hdl)
|
|||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_uc_offload_disconn_pipes);
|
||||
|
||||
static int ipa_uc_ntn_cleanup(struct ipa_uc_offload_ctx *ntn_ctx)
|
||||
{
|
||||
|
|
@ -572,13 +570,13 @@ static int ipa_uc_ntn_cleanup(struct ipa_uc_offload_ctx *ntn_ctx)
|
|||
hdr->hdl[0].hdl = ntn_ctx->partial_hdr_hdl[0];
|
||||
hdr->hdl[1].hdl = ntn_ctx->partial_hdr_hdl[1];
|
||||
|
||||
if (ipa_del_hdr(hdr)) {
|
||||
if (ipa3_del_hdr(hdr)) {
|
||||
IPA_UC_OFFLOAD_ERR("fail to delete partial header\n");
|
||||
result = -EFAULT;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (ipa_deregister_intf(ntn_ctx->netdev_name)) {
|
||||
if (ipa3_deregister_intf(ntn_ctx->netdev_name)) {
|
||||
IPA_UC_OFFLOAD_ERR("fail to delete interface prop\n");
|
||||
result = -EFAULT;
|
||||
goto fail;
|
||||
|
|
@ -589,7 +587,7 @@ fail:
|
|||
return result;
|
||||
}
|
||||
|
||||
int ipa_uc_offload_cleanup(u32 clnt_hdl)
|
||||
static int ipa_uc_offload_cleanup_internal(u32 clnt_hdl)
|
||||
{
|
||||
struct ipa_uc_offload_ctx *offload_ctx;
|
||||
int ret = 0;
|
||||
|
|
@ -630,7 +628,6 @@ int ipa_uc_offload_cleanup(u32 clnt_hdl)
|
|||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_uc_offload_cleanup);
|
||||
|
||||
/**
|
||||
* ipa_uc_offload_uc_rdyCB() - To register uC ready CB if uC not
|
||||
|
|
@ -641,7 +638,7 @@ EXPORT_SYMBOL(ipa_uc_offload_cleanup);
|
|||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
*/
|
||||
int ipa_uc_offload_reg_rdyCB(struct ipa_uc_ready_params *inp)
|
||||
int ipa_uc_offload_reg_rdyCB_internal(struct ipa_uc_ready_params *inp)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
|
|
@ -661,11 +658,47 @@ int ipa_uc_offload_reg_rdyCB(struct ipa_uc_ready_params *inp)
|
|||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_uc_offload_reg_rdyCB);
|
||||
|
||||
void ipa_uc_offload_dereg_rdyCB(enum ipa_uc_offload_proto proto)
|
||||
void ipa_uc_offload_dereg_rdyCB_internal(enum ipa_uc_offload_proto proto)
|
||||
{
|
||||
if (proto == IPA_UC_NTN)
|
||||
ipa_ntn_uc_dereg_rdyCB();
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_uc_offload_dereg_rdyCB);
|
||||
|
||||
int ipa_set_perf_profile_internal(struct ipa_perf_profile *profile)
|
||||
{
|
||||
if (!profile) {
|
||||
IPA_UC_OFFLOAD_ERR("Invalid input\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (profile->client != IPA_CLIENT_ETHERNET_PROD &&
|
||||
profile->client != IPA_CLIENT_ETHERNET_CONS) {
|
||||
IPA_UC_OFFLOAD_ERR("not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
IPA_UC_OFFLOAD_DBG("setting throughput to %d\n",
|
||||
profile->max_supported_bw_mbps);
|
||||
|
||||
return ipa_pm_set_throughput(
|
||||
ipa_uc_offload_ctx[IPA_UC_NTN]->pm_hdl,
|
||||
profile->max_supported_bw_mbps);
|
||||
}
|
||||
|
||||
void ipa_uc_offload_register(void)
|
||||
{
|
||||
struct ipa_uc_offload_data funcs;
|
||||
|
||||
funcs.ipa_uc_offload_reg_intf = ipa_uc_offload_reg_intf_internal;
|
||||
funcs.ipa_uc_offload_cleanup = ipa_uc_offload_cleanup_internal;
|
||||
funcs.ipa_uc_offload_conn_pipes = ipa_uc_offload_conn_pipes_internal;
|
||||
funcs.ipa_uc_offload_disconn_pipes =
|
||||
ipa_uc_offload_disconn_pipes_internal;
|
||||
funcs.ipa_set_perf_profile = ipa_set_perf_profile_internal;
|
||||
funcs.ipa_uc_offload_reg_rdyCB = ipa_uc_offload_reg_rdyCB_internal;
|
||||
funcs.ipa_uc_offload_dereg_rdyCB = ipa_uc_offload_dereg_rdyCB_internal;
|
||||
|
||||
if (ipa_fmwk_register_uc_offload(&funcs))
|
||||
pr_err("failed to register uc_offload APIs\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -733,7 +733,7 @@ static int ipa_usb_set_lock_unlock(bool is_lock)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ipa_usb_init_teth_prot_api(enum ipa_usb_teth_prot teth_prot,
|
||||
static int ipa_usb_init_teth_prot_internal(enum ipa_usb_teth_prot teth_prot,
|
||||
struct ipa_usb_teth_params *teth_params,
|
||||
int (*ipa_usb_notify_cb)(enum ipa_usb_notify_event,
|
||||
void *),
|
||||
|
|
@ -1828,7 +1828,7 @@ static void ipa_usb_debugfs_init(void){}
|
|||
static void ipa_usb_debugfs_remove(void){}
|
||||
#endif /* CONFIG_DEBUG_FS */
|
||||
|
||||
static int ipa_usb_xdci_connect_api(struct ipa_usb_xdci_chan_params *ul_chan_params,
|
||||
static int ipa_usb_xdci_connect_internal(struct ipa_usb_xdci_chan_params *ul_chan_params,
|
||||
struct ipa_usb_xdci_chan_params *dl_chan_params,
|
||||
struct ipa_req_chan_out_params *ul_out_params,
|
||||
struct ipa_req_chan_out_params *dl_out_params,
|
||||
|
|
@ -1995,7 +1995,7 @@ static int ipa_usb_xdci_dismiss_channels(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ipa_usb_xdci_disconnect_api(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
|
||||
static int ipa_usb_xdci_disconnect_internal(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
|
||||
enum ipa_usb_teth_prot teth_prot)
|
||||
{
|
||||
int result = 0;
|
||||
|
|
@ -2106,7 +2106,7 @@ bad_params:
|
|||
|
||||
}
|
||||
|
||||
static int ipa_usb_deinit_teth_prot_api(enum ipa_usb_teth_prot teth_prot)
|
||||
static int ipa_usb_deinit_teth_prot_internal(enum ipa_usb_teth_prot teth_prot)
|
||||
{
|
||||
int result = -EFAULT;
|
||||
enum ipa3_usb_transport_type ttype;
|
||||
|
|
@ -2292,7 +2292,7 @@ fail_exit:
|
|||
return result;
|
||||
}
|
||||
|
||||
static int ipa_usb_xdci_suspend_api(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
|
||||
static int ipa_usb_xdci_suspend_internal(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
|
||||
enum ipa_usb_teth_prot teth_prot, bool with_remote_wakeup)
|
||||
{
|
||||
int result = 0;
|
||||
|
|
@ -2450,7 +2450,7 @@ fail_exit:
|
|||
return result;
|
||||
}
|
||||
|
||||
static int ipa_usb_xdci_resume_api(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
|
||||
static int ipa_usb_xdci_resume_internal(u32 ul_clnt_hdl, u32 dl_clnt_hdl,
|
||||
enum ipa_usb_teth_prot teth_prot)
|
||||
{
|
||||
int result = -EFAULT;
|
||||
|
|
@ -2605,12 +2605,12 @@ int ipa3_usb_init(void)
|
|||
|
||||
ipa_usb_debugfs_init();
|
||||
|
||||
funcs.ipa_usb_init_teth_prot = ipa_usb_init_teth_prot_api;
|
||||
funcs.ipa_usb_xdci_connect = ipa_usb_xdci_connect_api;
|
||||
funcs.ipa_usb_xdci_disconnect = ipa_usb_xdci_disconnect_api;
|
||||
funcs.ipa_usb_deinit_teth_prot = ipa_usb_deinit_teth_prot_api;
|
||||
funcs.ipa_usb_xdci_suspend = ipa_usb_xdci_suspend_api;
|
||||
funcs.ipa_usb_xdci_resume = ipa_usb_xdci_resume_api;
|
||||
funcs.ipa_usb_init_teth_prot = ipa_usb_init_teth_prot_internal;
|
||||
funcs.ipa_usb_xdci_connect = ipa_usb_xdci_connect_internal;
|
||||
funcs.ipa_usb_xdci_disconnect = ipa_usb_xdci_disconnect_internal;
|
||||
funcs.ipa_usb_deinit_teth_prot = ipa_usb_deinit_teth_prot_internal;
|
||||
funcs.ipa_usb_xdci_suspend = ipa_usb_xdci_suspend_internal;
|
||||
funcs.ipa_usb_xdci_resume = ipa_usb_xdci_resume_internal;
|
||||
if (ipa_fmwk_register_ipa_usb(&funcs)) {
|
||||
pr_err("failed to register ipa_usb APIs\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ struct ipa_wdi_context {
|
|||
|
||||
static struct ipa_wdi_context *ipa_wdi_ctx;
|
||||
|
||||
int ipa_wdi_init(struct ipa_wdi_init_in_params *in,
|
||||
static int ipa_wdi_init_internal(struct ipa_wdi_init_in_params *in,
|
||||
struct ipa_wdi_init_out_params *out)
|
||||
{
|
||||
struct ipa_wdi_uc_ready_params uc_ready_params;
|
||||
|
|
@ -97,7 +97,7 @@ int ipa_wdi_init(struct ipa_wdi_init_in_params *in,
|
|||
ipa_wdi_ctx->wdi_notify = in->wdi_notify;
|
||||
#endif
|
||||
|
||||
if (ipa_uc_reg_rdyCB(&uc_ready_params) != 0) {
|
||||
if (ipa3_uc_reg_rdyCB(&uc_ready_params) != 0) {
|
||||
mutex_destroy(&ipa_wdi_ctx->lock);
|
||||
kfree(ipa_wdi_ctx);
|
||||
ipa_wdi_ctx = NULL;
|
||||
|
|
@ -114,15 +114,14 @@ int ipa_wdi_init(struct ipa_wdi_init_in_params *in,
|
|||
|
||||
ipa_wdi_ctx->is_smmu_enabled = out->is_smmu_enabled;
|
||||
|
||||
if (ipa3_ctx->ipa_wdi3_over_gsi)
|
||||
if (ipa3_get_ctx()->ipa_wdi3_over_gsi)
|
||||
out->is_over_gsi = true;
|
||||
else
|
||||
out->is_over_gsi = false;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_init);
|
||||
|
||||
int ipa_wdi_cleanup(void)
|
||||
static int ipa_wdi_cleanup_internal(void)
|
||||
{
|
||||
struct ipa_wdi_intf_info *entry;
|
||||
struct ipa_wdi_intf_info *next;
|
||||
|
|
@ -138,7 +137,6 @@ int ipa_wdi_cleanup(void)
|
|||
ipa_wdi_ctx = NULL;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_cleanup);
|
||||
|
||||
static int ipa_wdi_commit_partial_hdr(
|
||||
struct ipa_ioc_add_hdr *hdr,
|
||||
|
|
@ -168,7 +166,7 @@ static int ipa_wdi_commit_partial_hdr(
|
|||
hdr->hdr[i].eth2_ofst = hdr_info[i].dst_mac_addr_offset;
|
||||
}
|
||||
|
||||
if (ipa_add_hdr(hdr)) {
|
||||
if (ipa3_add_hdr(hdr)) {
|
||||
IPA_WDI_ERR("fail to add partial headers\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -176,7 +174,7 @@ static int ipa_wdi_commit_partial_hdr(
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in)
|
||||
static int ipa_wdi_reg_intf_internal(struct ipa_wdi_reg_intf_in_params *in)
|
||||
{
|
||||
struct ipa_ioc_add_hdr *hdr;
|
||||
struct ipa_wdi_intf_info *new_intf;
|
||||
|
|
@ -248,7 +246,7 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in)
|
|||
|
||||
memset(tx_prop, 0, sizeof(tx_prop));
|
||||
tx_prop[0].ip = IPA_IP_v4;
|
||||
if (!ipa3_ctx->ipa_wdi3_over_gsi)
|
||||
if (!ipa3_get_ctx()->ipa_wdi3_over_gsi)
|
||||
tx_prop[0].dst_pipe = IPA_CLIENT_WLAN1_CONS;
|
||||
else
|
||||
tx_prop[0].dst_pipe = IPA_CLIENT_WLAN2_CONS;
|
||||
|
|
@ -258,7 +256,7 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in)
|
|||
sizeof(tx_prop[0].hdr_name));
|
||||
|
||||
tx_prop[1].ip = IPA_IP_v6;
|
||||
if (!ipa3_ctx->ipa_wdi3_over_gsi)
|
||||
if (!ipa3_get_ctx()->ipa_wdi3_over_gsi)
|
||||
tx_prop[1].dst_pipe = IPA_CLIENT_WLAN1_CONS;
|
||||
else
|
||||
tx_prop[1].dst_pipe = IPA_CLIENT_WLAN2_CONS;
|
||||
|
|
@ -272,7 +270,7 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in)
|
|||
rx.prop = rx_prop;
|
||||
memset(rx_prop, 0, sizeof(rx_prop));
|
||||
rx_prop[0].ip = IPA_IP_v4;
|
||||
if (!ipa3_ctx->ipa_wdi3_over_gsi)
|
||||
if (!ipa3_get_ctx()->ipa_wdi3_over_gsi)
|
||||
rx_prop[0].src_pipe = IPA_CLIENT_WLAN1_PROD;
|
||||
else
|
||||
rx_prop[0].src_pipe = IPA_CLIENT_WLAN2_PROD;
|
||||
|
|
@ -284,7 +282,7 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in)
|
|||
}
|
||||
|
||||
rx_prop[1].ip = IPA_IP_v6;
|
||||
if (!ipa3_ctx->ipa_wdi3_over_gsi)
|
||||
if (!ipa3_get_ctx()->ipa_wdi3_over_gsi)
|
||||
rx_prop[1].src_pipe = IPA_CLIENT_WLAN1_PROD;
|
||||
else
|
||||
rx_prop[1].src_pipe = IPA_CLIENT_WLAN2_PROD;
|
||||
|
|
@ -295,7 +293,7 @@ int ipa_wdi_reg_intf(struct ipa_wdi_reg_intf_in_params *in)
|
|||
rx_prop[1].attrib.meta_data_mask = in->meta_data_mask;
|
||||
}
|
||||
|
||||
if (ipa_register_intf(in->netdev_name, &tx, &rx)) {
|
||||
if (ipa3_register_intf(in->netdev_name, &tx, &rx)) {
|
||||
IPA_WDI_ERR("fail to add interface prop\n");
|
||||
ret = -EFAULT;
|
||||
goto fail_commit_hdr;
|
||||
|
|
@ -315,9 +313,8 @@ fail_alloc_hdr:
|
|||
mutex_unlock(&ipa_wdi_ctx->lock);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_reg_intf);
|
||||
|
||||
int ipa_wdi_dereg_intf(const char *netdev_name)
|
||||
static int ipa_wdi_dereg_intf_internal(const char *netdev_name)
|
||||
{
|
||||
int len, ret = 0;
|
||||
struct ipa_ioc_del_hdr *hdr = NULL;
|
||||
|
|
@ -354,13 +351,13 @@ int ipa_wdi_dereg_intf(const char *netdev_name)
|
|||
IPA_WDI_DBG("IPv4 hdr hdl: %d IPv6 hdr hdl: %d\n",
|
||||
hdr->hdl[0].hdl, hdr->hdl[1].hdl);
|
||||
|
||||
if (ipa_del_hdr(hdr)) {
|
||||
if (ipa3_del_hdr(hdr)) {
|
||||
IPA_WDI_ERR("fail to delete partial header\n");
|
||||
ret = -EFAULT;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (ipa_deregister_intf(entry->netdev_name)) {
|
||||
if (ipa3_deregister_intf(entry->netdev_name)) {
|
||||
IPA_WDI_ERR("fail to del interface props\n");
|
||||
ret = -EFAULT;
|
||||
goto fail;
|
||||
|
|
@ -377,7 +374,6 @@ fail:
|
|||
mutex_unlock(&ipa_wdi_ctx->lock);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_dereg_intf);
|
||||
|
||||
|
||||
static void ipa_wdi_pm_cb(void *p, enum ipa_pm_cb_event event)
|
||||
|
|
@ -385,7 +381,7 @@ static void ipa_wdi_pm_cb(void *p, enum ipa_pm_cb_event event)
|
|||
IPA_WDI_DBG("received pm event %d\n", event);
|
||||
}
|
||||
|
||||
int ipa_wdi_conn_pipes(struct ipa_wdi_conn_in_params *in,
|
||||
static int ipa_wdi_conn_pipes_internal(struct ipa_wdi_conn_in_params *in,
|
||||
struct ipa_wdi_conn_out_params *out)
|
||||
{
|
||||
int i, j, ret = 0;
|
||||
|
|
@ -468,7 +464,7 @@ int ipa_wdi_conn_pipes(struct ipa_wdi_conn_in_params *in,
|
|||
in->u_rx.rx.event_ring_doorbell_pa;
|
||||
in_rx.u.ul.rdy_comp_ring_size =
|
||||
in->u_rx.rx.event_ring_size;
|
||||
if (ipa_connect_wdi_pipe(&in_rx, &out_rx)) {
|
||||
if (ipa3_connect_wdi_pipe(&in_rx, &out_rx)) {
|
||||
IPA_WDI_ERR("fail to setup rx pipe\n");
|
||||
ret = -EFAULT;
|
||||
goto fail_connect_pipe;
|
||||
|
|
@ -493,7 +489,7 @@ int ipa_wdi_conn_pipes(struct ipa_wdi_conn_in_params *in,
|
|||
in->u_tx.tx.event_ring_size;
|
||||
in_tx.u.dl.num_tx_buffers =
|
||||
in->u_tx.tx.num_pkt_buffers;
|
||||
if (ipa_connect_wdi_pipe(&in_tx, &out_tx)) {
|
||||
if (ipa3_connect_wdi_pipe(&in_tx, &out_tx)) {
|
||||
IPA_WDI_ERR("fail to setup tx pipe\n");
|
||||
ret = -EFAULT;
|
||||
goto fail;
|
||||
|
|
@ -520,7 +516,7 @@ int ipa_wdi_conn_pipes(struct ipa_wdi_conn_in_params *in,
|
|||
in->u_rx.rx_smmu.event_ring_doorbell_pa;
|
||||
in_rx.u.ul_smmu.rdy_comp_ring_size =
|
||||
in->u_rx.rx_smmu.event_ring_size;
|
||||
if (ipa_connect_wdi_pipe(&in_rx, &out_rx)) {
|
||||
if (ipa3_connect_wdi_pipe(&in_rx, &out_rx)) {
|
||||
IPA_WDI_ERR("fail to setup rx pipe\n");
|
||||
ret = -EFAULT;
|
||||
goto fail_connect_pipe;
|
||||
|
|
@ -545,7 +541,7 @@ int ipa_wdi_conn_pipes(struct ipa_wdi_conn_in_params *in,
|
|||
in->u_tx.tx_smmu.event_ring_size;
|
||||
in_tx.u.dl_smmu.num_tx_buffers =
|
||||
in->u_tx.tx_smmu.num_pkt_buffers;
|
||||
if (ipa_connect_wdi_pipe(&in_tx, &out_tx)) {
|
||||
if (ipa3_connect_wdi_pipe(&in_tx, &out_tx)) {
|
||||
IPA_WDI_ERR("fail to setup tx pipe\n");
|
||||
ret = -EFAULT;
|
||||
goto fail;
|
||||
|
|
@ -559,7 +555,7 @@ int ipa_wdi_conn_pipes(struct ipa_wdi_conn_in_params *in,
|
|||
return 0;
|
||||
|
||||
fail:
|
||||
ipa_disconnect_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl);
|
||||
ipa3_disconnect_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl);
|
||||
fail_connect_pipe:
|
||||
ipa_pm_deregister(ipa_wdi_ctx->ipa_pm_hdl);
|
||||
|
||||
|
|
@ -568,9 +564,8 @@ fail_setup_sys_pipe:
|
|||
ipa_teardown_sys_pipe(ipa_wdi_ctx->sys_pipe_hdl[j]);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_conn_pipes);
|
||||
|
||||
int ipa_wdi_disconn_pipes(void)
|
||||
static int ipa_wdi_disconn_pipes_internal(void)
|
||||
{
|
||||
int i, ipa_ep_idx_rx, ipa_ep_idx_tx;
|
||||
|
||||
|
|
@ -587,7 +582,7 @@ int ipa_wdi_disconn_pipes(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (!ipa3_ctx->ipa_wdi3_over_gsi) {
|
||||
if (!ipa3_get_ctx()->ipa_wdi3_over_gsi) {
|
||||
ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD);
|
||||
ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS);
|
||||
} else {
|
||||
|
|
@ -601,11 +596,11 @@ int ipa_wdi_disconn_pipes(void)
|
|||
return -EFAULT;
|
||||
}
|
||||
} else {
|
||||
if (ipa_disconnect_wdi_pipe(ipa_wdi_ctx->tx_pipe_hdl)) {
|
||||
if (ipa3_disconnect_wdi_pipe(ipa_wdi_ctx->tx_pipe_hdl)) {
|
||||
IPA_WDI_ERR("fail to tear down wdi tx pipes\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
if (ipa_disconnect_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl)) {
|
||||
if (ipa3_disconnect_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl)) {
|
||||
IPA_WDI_ERR("fail to tear down wdi rx pipes\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -618,9 +613,8 @@ int ipa_wdi_disconn_pipes(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_disconn_pipes);
|
||||
|
||||
int ipa_wdi_enable_pipes(void)
|
||||
static int ipa_wdi_enable_pipes_internal(void)
|
||||
{
|
||||
int ret;
|
||||
int ipa_ep_idx_tx, ipa_ep_idx_rx;
|
||||
|
|
@ -630,7 +624,7 @@ int ipa_wdi_enable_pipes(void)
|
|||
return -EPERM;
|
||||
}
|
||||
|
||||
if (!ipa3_ctx->ipa_wdi3_over_gsi) {
|
||||
if (!ipa3_get_ctx()->ipa_wdi3_over_gsi) {
|
||||
ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD);
|
||||
ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS);
|
||||
} else {
|
||||
|
|
@ -644,19 +638,19 @@ int ipa_wdi_enable_pipes(void)
|
|||
return -EFAULT;
|
||||
}
|
||||
} else {
|
||||
if (ipa_enable_wdi_pipe(ipa_wdi_ctx->tx_pipe_hdl)) {
|
||||
if (ipa3_enable_wdi_pipe(ipa_wdi_ctx->tx_pipe_hdl)) {
|
||||
IPA_WDI_ERR("fail to enable wdi tx pipe\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
if (ipa_resume_wdi_pipe(ipa_wdi_ctx->tx_pipe_hdl)) {
|
||||
if (ipa3_resume_wdi_pipe(ipa_wdi_ctx->tx_pipe_hdl)) {
|
||||
IPA_WDI_ERR("fail to resume wdi tx pipe\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
if (ipa_enable_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl)) {
|
||||
if (ipa3_enable_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl)) {
|
||||
IPA_WDI_ERR("fail to enable wdi rx pipe\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
if (ipa_resume_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl)) {
|
||||
if (ipa3_resume_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl)) {
|
||||
IPA_WDI_ERR("fail to resume wdi rx pipe\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -670,9 +664,8 @@ int ipa_wdi_enable_pipes(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_enable_pipes);
|
||||
|
||||
int ipa_wdi_disable_pipes(void)
|
||||
static int ipa_wdi_disable_pipes_internal(void)
|
||||
{
|
||||
int ret;
|
||||
int ipa_ep_idx_tx, ipa_ep_idx_rx;
|
||||
|
|
@ -682,7 +675,7 @@ int ipa_wdi_disable_pipes(void)
|
|||
return -EPERM;
|
||||
}
|
||||
|
||||
if (!ipa3_ctx->ipa_wdi3_over_gsi) {
|
||||
if (!ipa3_get_ctx()->ipa_wdi3_over_gsi) {
|
||||
ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_PROD);
|
||||
ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN1_CONS);
|
||||
} else {
|
||||
|
|
@ -696,19 +689,19 @@ int ipa_wdi_disable_pipes(void)
|
|||
return -EFAULT;
|
||||
}
|
||||
} else {
|
||||
if (ipa_suspend_wdi_pipe(ipa_wdi_ctx->tx_pipe_hdl)) {
|
||||
if (ipa3_suspend_wdi_pipe(ipa_wdi_ctx->tx_pipe_hdl)) {
|
||||
IPA_WDI_ERR("fail to suspend wdi tx pipe\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
if (ipa_disable_wdi_pipe(ipa_wdi_ctx->tx_pipe_hdl)) {
|
||||
if (ipa3_disable_wdi_pipe(ipa_wdi_ctx->tx_pipe_hdl)) {
|
||||
IPA_WDI_ERR("fail to disable wdi tx pipe\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
if (ipa_suspend_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl)) {
|
||||
if (ipa3_suspend_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl)) {
|
||||
IPA_WDI_ERR("fail to suspend wdi rx pipe\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
if (ipa_disable_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl)) {
|
||||
if (ipa3_disable_wdi_pipe(ipa_wdi_ctx->rx_pipe_hdl)) {
|
||||
IPA_WDI_ERR("fail to disable wdi rx pipe\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -722,9 +715,8 @@ int ipa_wdi_disable_pipes(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_disable_pipes);
|
||||
|
||||
int ipa_wdi_set_perf_profile(struct ipa_wdi_perf_profile *profile)
|
||||
static int ipa_wdi_set_perf_profile_internal(struct ipa_wdi_perf_profile *profile)
|
||||
{
|
||||
if (profile == NULL) {
|
||||
IPA_WDI_ERR("Invalid input\n");
|
||||
|
|
@ -739,36 +731,26 @@ int ipa_wdi_set_perf_profile(struct ipa_wdi_perf_profile *profile)
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_set_perf_profile);
|
||||
|
||||
int ipa_wdi_create_smmu_mapping(u32 num_buffers,
|
||||
struct ipa_wdi_buffer_info *info)
|
||||
void ipa_wdi3_register(void)
|
||||
{
|
||||
return ipa_create_wdi_mapping(num_buffers, info);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_create_smmu_mapping);
|
||||
struct ipa_wdi3_data funcs;
|
||||
|
||||
int ipa_wdi_release_smmu_mapping(u32 num_buffers,
|
||||
struct ipa_wdi_buffer_info *info)
|
||||
{
|
||||
return ipa_release_wdi_mapping(num_buffers, info);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_release_smmu_mapping);
|
||||
funcs.ipa_wdi_bw_monitor = ipa_uc_bw_monitor;
|
||||
funcs.ipa_wdi_cleanup = ipa_wdi_cleanup_internal;
|
||||
funcs.ipa_wdi_conn_pipes = ipa_wdi_conn_pipes_internal;
|
||||
funcs.ipa_wdi_create_smmu_mapping = ipa3_create_wdi_mapping;
|
||||
funcs.ipa_wdi_dereg_intf = ipa_wdi_dereg_intf_internal;
|
||||
funcs.ipa_wdi_disable_pipes = ipa_wdi_disable_pipes_internal;
|
||||
funcs.ipa_wdi_disconn_pipes = ipa_wdi_disconn_pipes_internal;
|
||||
funcs.ipa_wdi_enable_pipes = ipa_wdi_enable_pipes_internal;
|
||||
funcs.ipa_wdi_get_stats = ipa_get_wdi_stats;
|
||||
funcs.ipa_wdi_init = ipa_wdi_init_internal;
|
||||
funcs.ipa_wdi_reg_intf = ipa_wdi_reg_intf_internal;
|
||||
funcs.ipa_wdi_release_smmu_mapping = ipa3_release_wdi_mapping;
|
||||
funcs.ipa_wdi_set_perf_profile = ipa_wdi_set_perf_profile_internal;
|
||||
funcs.ipa_wdi_sw_stats = ipa_set_wlan_tx_info;
|
||||
|
||||
int ipa_wdi_get_stats(struct IpaHwStatsWDIInfoData_t *stats)
|
||||
{
|
||||
return ipa_get_wdi_stats(stats);
|
||||
if (ipa_fmwk_register_ipa_wdi3(&funcs))
|
||||
pr_err("failed to register ipa_wdi3 APIs\n");
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_get_stats);
|
||||
|
||||
int ipa_wdi_bw_monitor(struct ipa_wdi_bw_info *info)
|
||||
{
|
||||
return ipa_uc_bw_monitor(info);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_bw_monitor);
|
||||
|
||||
int ipa_wdi_sw_stats(struct ipa_wdi_tx_info *info)
|
||||
{
|
||||
return ipa_set_wlan_tx_info(info);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wdi_sw_stats);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <linux/string.h>
|
||||
#include "../ipa_common_i.h"
|
||||
#include "../ipa_v3/ipa_pm.h"
|
||||
#include <linux/ipa_fmwk.h>
|
||||
|
||||
#define OFFLOAD_DRV_NAME "ipa_wigig"
|
||||
#define IPA_WIGIG_DBG(fmt, args...) \
|
||||
|
|
@ -123,7 +124,7 @@ static int ipa_wigig_init_debugfs(struct dentry *parent) { return 0; }
|
|||
static inline void ipa_wigig_deinit_debugfs(void) { }
|
||||
#endif
|
||||
|
||||
int ipa_wigig_init(struct ipa_wigig_init_in_params *in,
|
||||
static int ipa_wigig_init_internal(struct ipa_wigig_init_in_params *in,
|
||||
struct ipa_wigig_init_out_params *out)
|
||||
{
|
||||
struct ipa_wdi_uc_ready_params inout;
|
||||
|
|
@ -181,9 +182,8 @@ int ipa_wigig_init(struct ipa_wigig_init_in_params *in,
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_init);
|
||||
|
||||
int ipa_wigig_cleanup(void)
|
||||
static int ipa_wigig_cleanup_internal(void)
|
||||
{
|
||||
struct ipa_wigig_intf_info *entry;
|
||||
struct ipa_wigig_intf_info *next;
|
||||
|
|
@ -210,9 +210,8 @@ int ipa_wigig_cleanup(void)
|
|||
IPA_WIGIG_DBG("exit\n");
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_cleanup);
|
||||
|
||||
bool ipa_wigig_is_smmu_enabled(void)
|
||||
static bool ipa_wigig_is_smmu_enabled_internal(void)
|
||||
{
|
||||
struct ipa_smmu_in_params in;
|
||||
struct ipa_smmu_out_params out;
|
||||
|
|
@ -226,7 +225,6 @@ bool ipa_wigig_is_smmu_enabled(void)
|
|||
|
||||
return out.smmu_enable;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_is_smmu_enabled);
|
||||
|
||||
static int ipa_wigig_init_smmu_params(void)
|
||||
{
|
||||
|
|
@ -286,7 +284,7 @@ static int ipa_wigig_commit_partial_hdr(
|
|||
hdr->hdr[i].eth2_ofst = hdr_info[i].dst_mac_addr_offset;
|
||||
}
|
||||
|
||||
if (ipa_add_hdr(hdr)) {
|
||||
if (ipa3_add_hdr(hdr)) {
|
||||
IPA_WIGIG_ERR("fail to add partial headers\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -296,71 +294,6 @@ static int ipa_wigig_commit_partial_hdr(
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void ipa_wigig_free_msg(void *msg, uint32_t len, uint32_t type)
|
||||
{
|
||||
IPA_WIGIG_DBG("free msg type:%d, len:%d, buff %pK", type, len, msg);
|
||||
kfree(msg);
|
||||
IPA_WIGIG_DBG("exit\n");
|
||||
}
|
||||
|
||||
static int ipa_wigig_send_wlan_msg(enum ipa_wlan_event msg_type,
|
||||
const char *netdev_name, u8 *mac)
|
||||
{
|
||||
struct ipa_msg_meta msg_meta;
|
||||
struct ipa_wlan_msg *wlan_msg;
|
||||
int ret;
|
||||
|
||||
IPA_WIGIG_DBG("%d\n", msg_type);
|
||||
|
||||
wlan_msg = kzalloc(sizeof(*wlan_msg), GFP_KERNEL);
|
||||
if (wlan_msg == NULL)
|
||||
return -ENOMEM;
|
||||
strlcpy(wlan_msg->name, netdev_name, IPA_RESOURCE_NAME_MAX);
|
||||
memcpy(wlan_msg->mac_addr, mac, IPA_MAC_ADDR_SIZE);
|
||||
msg_meta.msg_len = sizeof(struct ipa_wlan_msg);
|
||||
msg_meta.msg_type = msg_type;
|
||||
|
||||
IPA_WIGIG_DBG("send msg type:%d, len:%d, buff %pK", msg_meta.msg_type,
|
||||
msg_meta.msg_len, wlan_msg);
|
||||
ret = ipa_send_msg(&msg_meta, wlan_msg, ipa_wigig_free_msg);
|
||||
|
||||
IPA_WIGIG_DBG("exit\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ipa_wigig_send_msg(int msg_type,
|
||||
const char *netdev_name, u8 *mac,
|
||||
enum ipa_client_type client, bool to_wigig)
|
||||
{
|
||||
struct ipa_msg_meta msg_meta;
|
||||
struct ipa_wigig_msg *wigig_msg;
|
||||
int ret;
|
||||
|
||||
IPA_WIGIG_DBG("\n");
|
||||
|
||||
wigig_msg = kzalloc(sizeof(struct ipa_wigig_msg), GFP_KERNEL);
|
||||
if (wigig_msg == NULL)
|
||||
return -ENOMEM;
|
||||
strlcpy(wigig_msg->name, netdev_name, IPA_RESOURCE_NAME_MAX);
|
||||
memcpy(wigig_msg->client_mac_addr, mac, IPA_MAC_ADDR_SIZE);
|
||||
if (msg_type == WIGIG_CLIENT_CONNECT)
|
||||
wigig_msg->u.ipa_client = client;
|
||||
else
|
||||
wigig_msg->u.to_wigig = to_wigig;
|
||||
|
||||
msg_meta.msg_type = msg_type;
|
||||
msg_meta.msg_len = sizeof(struct ipa_wigig_msg);
|
||||
|
||||
IPA_WIGIG_DBG("send msg type:%d, len:%d, buff %pK", msg_meta.msg_type,
|
||||
msg_meta.msg_len, wigig_msg);
|
||||
ret = ipa_send_msg(&msg_meta, wigig_msg, ipa_wigig_free_msg);
|
||||
|
||||
IPA_WIGIG_DBG("exit\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ipa_wigig_get_devname(char *netdev_name)
|
||||
{
|
||||
struct ipa_wigig_intf_info *entry;
|
||||
|
|
@ -382,7 +315,7 @@ static int ipa_wigig_get_devname(char *netdev_name)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ipa_wigig_reg_intf(
|
||||
static int ipa_wigig_reg_intf_internal(
|
||||
struct ipa_wigig_reg_intf_in_params *in)
|
||||
{
|
||||
struct ipa_wigig_intf_info *new_intf;
|
||||
|
|
@ -490,7 +423,7 @@ int ipa_wigig_reg_intf(
|
|||
rx_prop[1].src_pipe = IPA_CLIENT_WIGIG_PROD;
|
||||
rx_prop[1].hdr_l2_type = in->hdr_info[1].hdr_type;
|
||||
|
||||
if (ipa_register_intf(in->netdev_name, &tx, &rx)) {
|
||||
if (ipa3_register_intf(in->netdev_name, &tx, &rx)) {
|
||||
IPA_WIGIG_ERR("fail to add interface prop\n");
|
||||
ret = -EFAULT;
|
||||
goto fail_register;
|
||||
|
|
@ -512,7 +445,7 @@ int ipa_wigig_reg_intf(
|
|||
IPA_WIGIG_DBG("exit\n");
|
||||
return 0;
|
||||
fail_sendmsg:
|
||||
ipa_deregister_intf(in->netdev_name);
|
||||
ipa3_deregister_intf(in->netdev_name);
|
||||
fail_register:
|
||||
del_hdr = kzalloc(sizeof(struct ipa_ioc_del_hdr) +
|
||||
2 * sizeof(struct ipa_hdr_del), GFP_KERNEL);
|
||||
|
|
@ -521,7 +454,7 @@ fail_register:
|
|||
del_hdr->num_hdls = 2;
|
||||
del_hdr->hdl[0].hdl = new_intf->partial_hdr_hdl[IPA_IP_v4];
|
||||
del_hdr->hdl[1].hdl = new_intf->partial_hdr_hdl[IPA_IP_v6];
|
||||
ipa_del_hdr(del_hdr);
|
||||
ipa3_del_hdr(del_hdr);
|
||||
kfree(del_hdr);
|
||||
}
|
||||
new_intf->partial_hdr_hdl[IPA_IP_v4] = 0;
|
||||
|
|
@ -534,9 +467,8 @@ fail:
|
|||
mutex_unlock(&ipa_wigig_ctx->lock);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_reg_intf);
|
||||
|
||||
int ipa_wigig_dereg_intf(const char *netdev_name)
|
||||
static int ipa_wigig_dereg_intf_internal(const char *netdev_name)
|
||||
{
|
||||
int len, ret;
|
||||
struct ipa_ioc_del_hdr *hdr = NULL;
|
||||
|
|
@ -577,14 +509,14 @@ int ipa_wigig_dereg_intf(const char *netdev_name)
|
|||
IPA_WIGIG_DBG("IPv4 hdr hdl: %d IPv6 hdr hdl: %d\n",
|
||||
hdr->hdl[0].hdl, hdr->hdl[1].hdl);
|
||||
|
||||
if (ipa_del_hdr(hdr)) {
|
||||
if (ipa3_del_hdr(hdr)) {
|
||||
IPA_WIGIG_ERR(
|
||||
"fail to delete partial header\n");
|
||||
ret = -EFAULT;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (ipa_deregister_intf(entry->netdev_name)) {
|
||||
if (ipa3_deregister_intf(entry->netdev_name)) {
|
||||
IPA_WIGIG_ERR("fail to del interface props\n");
|
||||
ret = -EFAULT;
|
||||
goto fail;
|
||||
|
|
@ -611,7 +543,6 @@ fail:
|
|||
mutex_unlock(&ipa_wigig_ctx->lock);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_dereg_intf);
|
||||
|
||||
static void ipa_wigig_pm_cb(void *p, enum ipa_pm_cb_event event)
|
||||
{
|
||||
|
|
@ -674,7 +605,7 @@ static u8 ipa_wigig_pipe_to_bit_val(int client)
|
|||
return shift_val;
|
||||
}
|
||||
|
||||
int ipa_wigig_conn_rx_pipe(struct ipa_wigig_conn_rx_in_params *in,
|
||||
static int ipa_wigig_conn_rx_pipe_internal(struct ipa_wigig_conn_rx_in_params *in,
|
||||
struct ipa_wigig_conn_out_params *out)
|
||||
{
|
||||
int ret;
|
||||
|
|
@ -764,7 +695,6 @@ fail_msi:
|
|||
fail_pm:
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_conn_rx_pipe);
|
||||
|
||||
static int ipa_wigig_client_to_idx(enum ipa_client_type client,
|
||||
unsigned int *idx)
|
||||
|
|
@ -1040,7 +970,7 @@ fail_map_desc_h:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int ipa_wigig_save_regs(void)
|
||||
static int ipa_wigig_save_regs_cb(void)
|
||||
{
|
||||
void __iomem *desc_ring_h = NULL, *desc_ring_t = NULL,
|
||||
*status_ring_h = NULL, *status_ring_t = NULL,
|
||||
|
|
@ -1451,7 +1381,7 @@ static int ipa_wigig_clean_smmu_info(enum ipa_client_type client)
|
|||
|
||||
return 0;
|
||||
}
|
||||
int ipa_wigig_conn_rx_pipe_smmu(
|
||||
static int ipa_wigig_conn_rx_pipe_smmu_internal(
|
||||
struct ipa_wigig_conn_rx_in_params_smmu *in,
|
||||
struct ipa_wigig_conn_out_params *out)
|
||||
{
|
||||
|
|
@ -1548,9 +1478,8 @@ fail_msi:
|
|||
fail_pm:
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_conn_rx_pipe_smmu);
|
||||
|
||||
int ipa_wigig_set_perf_profile(u32 max_supported_bw_mbps)
|
||||
static int ipa_wigig_set_perf_profile_internal(u32 max_supported_bw_mbps)
|
||||
{
|
||||
IPA_WIGIG_DBG("setting throughput to %d\n", max_supported_bw_mbps);
|
||||
|
||||
|
|
@ -1569,7 +1498,6 @@ int ipa_wigig_set_perf_profile(u32 max_supported_bw_mbps)
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_set_perf_profile);
|
||||
|
||||
static int ipa_wigig_store_client_mac(enum ipa_client_type client,
|
||||
const char *mac)
|
||||
|
|
@ -1603,7 +1531,7 @@ static int ipa_wigig_clean_client_mac(enum ipa_client_type client)
|
|||
return ipa_wigig_store_client_mac(client, zero_mac);
|
||||
}
|
||||
|
||||
int ipa_wigig_conn_client(struct ipa_wigig_conn_tx_in_params *in,
|
||||
static int ipa_wigig_conn_client_internal(struct ipa_wigig_conn_tx_in_params *in,
|
||||
struct ipa_wigig_conn_out_params *out)
|
||||
{
|
||||
char dev_name[IPA_RESOURCE_NAME_MAX];
|
||||
|
|
@ -1682,9 +1610,8 @@ fail_convert_client_to_idx:
|
|||
ipa_disconn_wigig_pipe_i(out->client, NULL, NULL);
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_conn_client);
|
||||
|
||||
int ipa_wigig_conn_client_smmu(
|
||||
static int ipa_wigig_conn_client_smmu_internal(
|
||||
struct ipa_wigig_conn_tx_in_params_smmu *in,
|
||||
struct ipa_wigig_conn_out_params *out)
|
||||
{
|
||||
|
|
@ -1769,7 +1696,6 @@ fail_sendmsg:
|
|||
ipa_disconn_wigig_pipe_i(out->client, &in->pipe_smmu, &in->dbuff_smmu);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_conn_client_smmu);
|
||||
|
||||
static inline int ipa_wigig_validate_client_type(enum ipa_client_type client)
|
||||
{
|
||||
|
|
@ -1788,7 +1714,7 @@ static inline int ipa_wigig_validate_client_type(enum ipa_client_type client)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ipa_wigig_disconn_pipe(enum ipa_client_type client)
|
||||
static int ipa_wigig_disconn_pipe_internal(enum ipa_client_type client)
|
||||
{
|
||||
int ret;
|
||||
char dev_name[IPA_RESOURCE_NAME_MAX];
|
||||
|
|
@ -1890,9 +1816,8 @@ int ipa_wigig_disconn_pipe(enum ipa_client_type client)
|
|||
IPA_WIGIG_DBG("exit\n");
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_disconn_pipe);
|
||||
|
||||
int ipa_wigig_enable_pipe(enum ipa_client_type client)
|
||||
static int ipa_wigig_enable_pipe_internal(enum ipa_client_type client)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -1925,9 +1850,8 @@ fail_pm_active:
|
|||
ipa_disable_wigig_pipe_i(client);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_enable_pipe);
|
||||
|
||||
int ipa_wigig_disable_pipe(enum ipa_client_type client)
|
||||
static int ipa_wigig_disable_pipe_internal(enum ipa_client_type client)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -1953,9 +1877,8 @@ int ipa_wigig_disable_pipe(enum ipa_client_type client)
|
|||
IPA_WIGIG_DBG("exit\n");
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_disable_pipe);
|
||||
|
||||
int ipa_wigig_tx_dp(enum ipa_client_type dst, struct sk_buff *skb)
|
||||
static int ipa_wigig_tx_dp_internal(enum ipa_client_type dst, struct sk_buff *skb)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -1972,7 +1895,6 @@ int ipa_wigig_tx_dp(enum ipa_client_type dst, struct sk_buff *skb)
|
|||
IPA_WIGIG_DBG_LOW("exit\n");
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_tx_dp);
|
||||
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
|
@ -2126,3 +2048,32 @@ fail_conn_clients:
|
|||
return -EFAULT;
|
||||
}
|
||||
#endif
|
||||
|
||||
void ipa_wigig_register(void)
|
||||
{
|
||||
struct ipa_wigig_data funcs;
|
||||
|
||||
funcs.ipa_wigig_init = ipa_wigig_init_internal;
|
||||
funcs.ipa_wigig_cleanup = ipa_wigig_cleanup_internal;
|
||||
funcs.ipa_wigig_is_smmu_enabled = ipa_wigig_is_smmu_enabled_internal;
|
||||
funcs.ipa_wigig_reg_intf = ipa_wigig_reg_intf_internal;
|
||||
funcs.ipa_wigig_dereg_intf = ipa_wigig_dereg_intf_internal;
|
||||
funcs.ipa_wigig_conn_rx_pipe = ipa_wigig_conn_rx_pipe_internal;
|
||||
funcs.ipa_wigig_conn_rx_pipe_smmu =
|
||||
ipa_wigig_conn_rx_pipe_smmu_internal;
|
||||
funcs.ipa_wigig_conn_client = ipa_wigig_conn_client_internal;
|
||||
funcs.ipa_wigig_conn_client_smmu =
|
||||
ipa_wigig_conn_client_smmu_internal;
|
||||
funcs.ipa_wigig_disconn_pipe = ipa_wigig_disconn_pipe_internal;
|
||||
funcs.ipa_wigig_enable_pipe = ipa_wigig_enable_pipe_internal;
|
||||
funcs.ipa_wigig_disable_pipe = ipa_wigig_disable_pipe_internal;
|
||||
funcs.ipa_wigig_tx_dp = ipa_wigig_tx_dp_internal;
|
||||
funcs.ipa_wigig_set_perf_profile =
|
||||
ipa_wigig_set_perf_profile_internal;
|
||||
funcs.ipa_wigig_save_regs = ipa_wigig_save_regs_cb;
|
||||
|
||||
|
||||
if (ipa_fmwk_register_ipa_wigig(&funcs))
|
||||
pr_err("failed to register ipa_wigig APIs\n");
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_register);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1481,7 +1481,7 @@ static void rndis_ipa_xmit_error_aftercare_wq(struct work_struct *work)
|
|||
* for IPA driver
|
||||
* eth_type: the Ethernet type for this header-insertion header
|
||||
* hdr_name: string that shall represent this header in IPA data base
|
||||
* add_hdr: output for caller to be used with ipa_add_hdr() to configure
|
||||
* add_hdr: output for caller to be used with ipa3_add_hdr() to configure
|
||||
* the IPA core
|
||||
* dst_mac: tethered PC MAC (Ethernet) address to be added to packets
|
||||
* for IPA->USB pipe
|
||||
|
|
@ -1578,7 +1578,7 @@ static int rndis_ipa_hdrs_cfg(
|
|||
|
||||
hdrs->commit = 1;
|
||||
hdrs->num_hdrs = 2;
|
||||
result = ipa_add_hdr(hdrs);
|
||||
result = ipa3_add_hdr(hdrs);
|
||||
if (result) {
|
||||
RNDIS_IPA_ERROR("Fail on Header-Insertion(%d)\n", result);
|
||||
goto fail_add_hdr;
|
||||
|
|
@ -1634,9 +1634,9 @@ static int rndis_ipa_hdrs_destroy(struct rndis_ipa_dev *rndis_ipa_ctx)
|
|||
ipv6 = &del_hdr->hdl[1];
|
||||
ipv6->hdl = rndis_ipa_ctx->eth_ipv6_hdr_hdl;
|
||||
|
||||
result = ipa_del_hdr(del_hdr);
|
||||
result = ipa3_del_hdr(del_hdr);
|
||||
if (result || ipv4->status || ipv6->status)
|
||||
RNDIS_IPA_ERROR("ipa_del_hdr failed\n");
|
||||
RNDIS_IPA_ERROR("ipa3_del_hdr failed\n");
|
||||
else
|
||||
RNDIS_IPA_DEBUG("hdrs deletion done\n");
|
||||
|
||||
|
|
@ -1720,7 +1720,7 @@ static int rndis_ipa_register_properties(char *netdev_name, bool is_vlan_mode)
|
|||
rx_ipv6_property->hdr_l2_type = hdr_l2_type;
|
||||
rx_properties.num_props = 2;
|
||||
|
||||
result = ipa_register_intf("rndis0", &tx_properties, &rx_properties);
|
||||
result = ipa3_register_intf("rndis0", &tx_properties, &rx_properties);
|
||||
if (result)
|
||||
RNDIS_IPA_ERROR("fail on Tx/Rx properties registration\n");
|
||||
else
|
||||
|
|
@ -1743,7 +1743,7 @@ static int rndis_ipa_deregister_properties(char *netdev_name)
|
|||
|
||||
RNDIS_IPA_LOG_ENTRY();
|
||||
|
||||
result = ipa_deregister_intf(netdev_name);
|
||||
result = ipa3_deregister_intf(netdev_name);
|
||||
if (result) {
|
||||
RNDIS_IPA_DEBUG("Fail on Tx prop deregister\n");
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -3,11 +3,10 @@
|
|||
* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/ipa_mhi.h>
|
||||
#include <linux/ipa_qmi_service_v01.h>
|
||||
|
||||
#ifndef _IPA_COMMON_I_H_
|
||||
#define _IPA_COMMON_I_H_
|
||||
#include <linux/ipa_mhi.h>
|
||||
#include <linux/ipa_qmi_service_v01.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/ipc_logging.h>
|
||||
#include <linux/ipa.h>
|
||||
|
|
@ -226,6 +225,16 @@ enum ipa_hw_mhi_channel_states {
|
|||
IPA_HW_MHI_CHANNEL_STATE_INVALID = 0xFF
|
||||
};
|
||||
|
||||
enum ipa_mhi_state {
|
||||
IPA_MHI_STATE_INITIALIZED,
|
||||
IPA_MHI_STATE_READY,
|
||||
IPA_MHI_STATE_STARTED,
|
||||
IPA_MHI_STATE_SUSPEND_IN_PROGRESS,
|
||||
IPA_MHI_STATE_SUSPENDED,
|
||||
IPA_MHI_STATE_RESUME_IN_PROGRESS,
|
||||
IPA_MHI_STATE_MAX
|
||||
};
|
||||
|
||||
/**
|
||||
* Structure holding the parameters for IPA_CPU_2_HW_CMD_MHI_DL_UL_SYNC_INFO
|
||||
* command. Parameters are sent as 32b immediate parameters.
|
||||
|
|
@ -375,12 +384,10 @@ bool ipa_mhi_sps_channel_empty(enum ipa_client_type client);
|
|||
int ipa_mhi_resume_channels_internal(enum ipa_client_type client,
|
||||
bool LPTransitionRejected, bool brstmode_enabled,
|
||||
union __packed gsi_channel_scratch ch_scratch, u8 index);
|
||||
int ipa_mhi_handle_ipa_config_req(struct ipa_config_req_msg_v01 *config_req);
|
||||
int ipa_mhi_query_ch_info(enum ipa_client_type client,
|
||||
struct gsi_chan_info *ch_info);
|
||||
int ipa_mhi_destroy_channel(enum ipa_client_type client);
|
||||
int ipa_mhi_is_using_dma(bool *flag);
|
||||
const char *ipa_mhi_get_state_str(int state);
|
||||
|
||||
/* MHI uC */
|
||||
int ipa_uc_mhi_send_dl_ul_sync_info(union IpaHwMhiDlUlSyncCmdData_t *cmd);
|
||||
|
|
@ -477,11 +484,209 @@ int ipa_wigig_send_msg(int msg_type,
|
|||
const char *netdev_name, u8 *mac,
|
||||
enum ipa_client_type client, bool to_wigig);
|
||||
|
||||
int ipa_wigig_save_regs(void);
|
||||
int ipa_wigig_send_wlan_msg(enum ipa_wlan_event msg_type,
|
||||
const char *netdev_name, u8 *mac);
|
||||
|
||||
void ipa_register_client_callback(int (*client_cb)(bool is_lock),
|
||||
bool (*teth_port_state)(void), u32 ipa_ep_idx);
|
||||
|
||||
void ipa_deregister_client_callback(u32 ipa_ep_idx);
|
||||
|
||||
/*
|
||||
* Configuration
|
||||
*/
|
||||
int ipa_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_conn_track(u32 clnt_hdl,
|
||||
const struct ipa_ep_cfg_conn_track *ep_conn_track);
|
||||
|
||||
int ipa_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_hdr_ext(u32 clnt_hdl,
|
||||
const struct ipa_ep_cfg_hdr_ext *ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_mode(u32 clnt_hdl, const struct ipa_ep_cfg_mode *ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_aggr(u32 clnt_hdl, const struct ipa_ep_cfg_aggr *ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_deaggr(u32 clnt_hdl,
|
||||
const struct ipa_ep_cfg_deaggr *ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_route(u32 clnt_hdl, const struct ipa_ep_cfg_route *ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_holb(u32 clnt_hdl, const struct ipa_ep_cfg_holb *ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_cfg(u32 clnt_hdl, const struct ipa_ep_cfg_cfg *ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_metadata_mask(u32 clnt_hdl, const struct ipa_ep_cfg_metadata_mask
|
||||
*ipa_ep_cfg);
|
||||
|
||||
int ipa_cfg_ep_holb_by_client(enum ipa_client_type client,
|
||||
const struct ipa_ep_cfg_holb *ipa_ep_cfg);
|
||||
|
||||
/*
|
||||
* Header removal / addition
|
||||
*/
|
||||
int ipa3_add_hdr(struct ipa_ioc_add_hdr *hdrs);
|
||||
|
||||
int ipa3_del_hdr(struct ipa_ioc_del_hdr *hdls);
|
||||
|
||||
int ipa_add_hdr_usr(struct ipa_ioc_add_hdr *hdrs, bool user_only);
|
||||
|
||||
int ipa_reset_hdr(bool user_only);
|
||||
|
||||
/*
|
||||
* Header Processing Context
|
||||
*/
|
||||
int ipa_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs,
|
||||
bool user_only);
|
||||
|
||||
int ipa_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls);
|
||||
|
||||
/*
|
||||
* Routing
|
||||
*/
|
||||
|
||||
int ipa_add_rt_rule_v2(struct ipa_ioc_add_rt_rule_v2 *rules);
|
||||
|
||||
int ipa_add_rt_rule_usr(struct ipa_ioc_add_rt_rule *rules, bool user_only);
|
||||
|
||||
int ipa_add_rt_rule_usr_v2(struct ipa_ioc_add_rt_rule_v2 *rules,
|
||||
bool user_only);
|
||||
|
||||
int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls);
|
||||
|
||||
int ipa_commit_rt(enum ipa_ip_type ip);
|
||||
|
||||
int ipa_reset_rt(enum ipa_ip_type ip, bool user_only);
|
||||
|
||||
int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup);
|
||||
|
||||
int ipa_query_rt_index(struct ipa_ioc_get_rt_tbl_indx *in);
|
||||
|
||||
int ipa_mdfy_rt_rule(struct ipa_ioc_mdfy_rt_rule *rules);
|
||||
|
||||
int ipa_mdfy_rt_rule_v2(struct ipa_ioc_mdfy_rt_rule_v2 *rules);
|
||||
|
||||
/*
|
||||
* Filtering
|
||||
*/
|
||||
int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules);
|
||||
|
||||
int ipa_add_flt_rule_v2(struct ipa_ioc_add_flt_rule_v2 *rules);
|
||||
|
||||
int ipa_add_flt_rule_usr(struct ipa_ioc_add_flt_rule *rules, bool user_only);
|
||||
|
||||
int ipa_add_flt_rule_usr_v2(struct ipa_ioc_add_flt_rule_v2 *rules,
|
||||
bool user_only);
|
||||
|
||||
int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls);
|
||||
|
||||
int ipa_mdfy_flt_rule(struct ipa_ioc_mdfy_flt_rule *rules);
|
||||
|
||||
int ipa_mdfy_flt_rule_v2(struct ipa_ioc_mdfy_flt_rule_v2 *rules);
|
||||
|
||||
int ipa_commit_flt(enum ipa_ip_type ip);
|
||||
|
||||
int ipa_reset_flt(enum ipa_ip_type ip, bool user_only);
|
||||
|
||||
/*
|
||||
* NAT\IPv6CT
|
||||
*/
|
||||
int ipa_allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem);
|
||||
int ipa_allocate_nat_table(struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc);
|
||||
int ipa_allocate_ipv6ct_table(
|
||||
struct ipa_ioc_nat_ipv6ct_table_alloc *table_alloc);
|
||||
|
||||
int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init);
|
||||
int ipa_ipv6ct_init_cmd(struct ipa_ioc_ipv6ct_init *init);
|
||||
|
||||
int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma);
|
||||
int ipa_table_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma);
|
||||
|
||||
int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del);
|
||||
int ipa_del_nat_table(struct ipa_ioc_nat_ipv6ct_table_del *del);
|
||||
int ipa_del_ipv6ct_table(struct ipa_ioc_nat_ipv6ct_table_del *del);
|
||||
|
||||
int ipa_nat_mdfy_pdn(struct ipa_ioc_nat_pdn_entry *mdfy_pdn);
|
||||
|
||||
/*
|
||||
* Data path
|
||||
*/
|
||||
int ipa_rx_poll(u32 clnt_hdl, int budget);
|
||||
void ipa_recycle_wan_skb(struct sk_buff *skb);
|
||||
|
||||
/*
|
||||
* System pipes
|
||||
*/
|
||||
int ipa_set_wlan_tx_info(struct ipa_wdi_tx_info *info);
|
||||
|
||||
/*
|
||||
* Tethering bridge (Rmnet / MBIM)
|
||||
*/
|
||||
int teth_bridge_init(struct teth_bridge_init_params *params);
|
||||
|
||||
int teth_bridge_disconnect(enum ipa_client_type client);
|
||||
|
||||
int teth_bridge_connect(struct teth_bridge_connect_params *connect_params);
|
||||
|
||||
/*
|
||||
* Tethering client info
|
||||
*/
|
||||
void ipa_set_client(int index, enum ipacm_client_enum client, bool uplink);
|
||||
|
||||
enum ipacm_client_enum ipa_get_client(int pipe_idx);
|
||||
|
||||
bool ipa_get_client_uplink(int pipe_idx);
|
||||
|
||||
/*
|
||||
* mux id
|
||||
*/
|
||||
int ipa_write_qmap_id(struct ipa_ioc_write_qmapid *param_in);
|
||||
|
||||
/*
|
||||
* interrupts
|
||||
*/
|
||||
|
||||
int ipa_remove_interrupt_handler(enum ipa_irq_type interrupt);
|
||||
|
||||
/*
|
||||
* Interface
|
||||
*/
|
||||
int ipa3_register_intf(const char *name, const struct ipa_tx_intf *tx,
|
||||
const struct ipa_rx_intf *rx);
|
||||
int ipa3_register_intf_ext(const char *name, const struct ipa_tx_intf *tx,
|
||||
const struct ipa_rx_intf *rx,
|
||||
const struct ipa_ext_intf *ext);
|
||||
int ipa3_deregister_intf(const char *name);
|
||||
|
||||
/*
|
||||
* Miscellaneous
|
||||
*/
|
||||
|
||||
int ipa_uc_debug_stats_alloc(
|
||||
struct IpaHwOffloadStatsAllocCmdData_t cmdinfo);
|
||||
int ipa_uc_debug_stats_dealloc(uint32_t protocol);
|
||||
void ipa_get_gsi_stats(int prot_id,
|
||||
struct ipa_uc_dbg_ring_stats *stats);
|
||||
int ipa_get_prot_id(enum ipa_client_type client);
|
||||
bool ipa_is_client_handle_valid(u32 clnt_hdl);
|
||||
|
||||
/**
|
||||
* ipa_tz_unlock_reg - Unlocks memory regions so that they become accessible
|
||||
* from AP.
|
||||
* @reg_info - Pointer to array of memory regions to unlock
|
||||
* @num_regs - Number of elements in the array
|
||||
*
|
||||
* Converts the input array of regions to a struct that TZ understands and
|
||||
* issues an SCM call.
|
||||
* Also flushes the memory cache to DDR in order to make sure that TZ sees the
|
||||
* correct data structure.
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*/
|
||||
int ipa_tz_unlock_reg(struct ipa_tz_unlock_reg_info *reg_info, u16 num_regs);
|
||||
|
||||
#endif /* _IPA_COMMON_I_H_ */
|
||||
|
|
|
|||
|
|
@ -56,118 +56,6 @@ struct ipa_rm_notify_ipa_work_type {
|
|||
u32 bandwidth_mbps;
|
||||
};
|
||||
|
||||
/**
|
||||
* ipa_rm_create_resource() - create resource
|
||||
* @create_params: [in] parameters needed
|
||||
* for resource initialization
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
* This function is called by IPA RM client to initialize client's resources.
|
||||
* This API should be called before any other IPA RM API on a given resource
|
||||
* name.
|
||||
*
|
||||
*/
|
||||
int ipa_rm_create_resource(struct ipa_rm_create_params *create_params)
|
||||
{
|
||||
struct ipa_rm_resource *resource;
|
||||
unsigned long flags;
|
||||
int result;
|
||||
|
||||
if (unlikely(!ipa_rm_ctx)) {
|
||||
IPA_RM_ERR("IPA RM was not initialized\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!create_params) {
|
||||
IPA_RM_ERR("invalid args\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
IPA_RM_DBG("%s\n", ipa_rm_resource_str(create_params->name));
|
||||
|
||||
if (create_params->floor_voltage < 0 ||
|
||||
create_params->floor_voltage >= IPA_VOLTAGE_MAX) {
|
||||
IPA_RM_ERR("invalid voltage %d\n",
|
||||
create_params->floor_voltage);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
if (ipa_rm_dep_graph_get_resource(ipa_rm_ctx->dep_graph,
|
||||
create_params->name,
|
||||
&resource) == 0) {
|
||||
IPA_RM_ERR("resource already exists\n");
|
||||
result = -EEXIST;
|
||||
goto bail;
|
||||
}
|
||||
result = ipa_rm_resource_create(create_params,
|
||||
&resource);
|
||||
if (result) {
|
||||
IPA_RM_ERR("ipa_rm_resource_create() failed\n");
|
||||
goto bail;
|
||||
}
|
||||
result = ipa_rm_dep_graph_add(ipa_rm_ctx->dep_graph, resource);
|
||||
if (result) {
|
||||
IPA_RM_ERR("ipa_rm_dep_graph_add() failed\n");
|
||||
ipa_rm_resource_delete(resource);
|
||||
goto bail;
|
||||
}
|
||||
bail:
|
||||
spin_unlock_irqrestore(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
IPA_RM_DBG("EXIT with %d\n", result);
|
||||
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_create_resource);
|
||||
|
||||
/**
|
||||
* ipa_rm_delete_resource() - delete resource
|
||||
* @resource_name: name of resource to be deleted
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
* This function is called by IPA RM client to delete client's resources.
|
||||
*
|
||||
*/
|
||||
int ipa_rm_delete_resource(enum ipa_rm_resource_name resource_name)
|
||||
{
|
||||
struct ipa_rm_resource *resource;
|
||||
unsigned long flags;
|
||||
int result;
|
||||
|
||||
if (unlikely(!ipa_rm_ctx)) {
|
||||
IPA_RM_ERR("IPA RM was not initialized\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
IPA_RM_DBG("%s\n", ipa_rm_resource_str(resource_name));
|
||||
spin_lock_irqsave(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
if (ipa_rm_dep_graph_get_resource(ipa_rm_ctx->dep_graph,
|
||||
resource_name,
|
||||
&resource) != 0) {
|
||||
IPA_RM_ERR("resource does not exist\n");
|
||||
result = -EINVAL;
|
||||
goto bail;
|
||||
}
|
||||
result = ipa_rm_resource_delete(resource);
|
||||
if (result) {
|
||||
IPA_RM_ERR("ipa_rm_resource_delete() failed\n");
|
||||
goto bail;
|
||||
}
|
||||
result = ipa_rm_dep_graph_remove(ipa_rm_ctx->dep_graph,
|
||||
resource_name);
|
||||
if (result) {
|
||||
IPA_RM_ERR("ipa_rm_dep_graph_remove() failed\n");
|
||||
goto bail;
|
||||
}
|
||||
bail:
|
||||
spin_unlock_irqrestore(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
IPA_RM_DBG("EXIT with %d\n", result);
|
||||
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_delete_resource);
|
||||
|
||||
static int _ipa_rm_add_dependency(enum ipa_rm_resource_name resource_name,
|
||||
enum ipa_rm_resource_name depends_on_name,
|
||||
bool userspace_dep)
|
||||
|
|
@ -194,23 +82,6 @@ static int _ipa_rm_add_dependency(enum ipa_rm_resource_name resource_name,
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* ipa_rm_add_dependency() - create dependency between 2 resources
|
||||
* @resource_name: name of dependent resource
|
||||
* @depends_on_name: name of its dependency
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
* Side effects: IPA_RM_RESORCE_GRANTED could be generated
|
||||
* in case client registered with IPA RM
|
||||
*/
|
||||
int ipa_rm_add_dependency(enum ipa_rm_resource_name resource_name,
|
||||
enum ipa_rm_resource_name depends_on_name)
|
||||
{
|
||||
return _ipa_rm_add_dependency(resource_name, depends_on_name, false);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_add_dependency);
|
||||
|
||||
/**
|
||||
* ipa_rm_add_dependency_from_ioctl() - create dependency between 2 resources
|
||||
* @resource_name: name of dependent resource
|
||||
|
|
@ -280,29 +151,6 @@ static int _ipa_rm_add_dependency_sync(enum ipa_rm_resource_name resource_name,
|
|||
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* ipa_rm_add_dependency_sync() - Create a dependency between 2 resources
|
||||
* in a synchronized fashion. In case a producer resource is in GRANTED state
|
||||
* and the newly added consumer resource is in RELEASED state, the consumer
|
||||
* entity will be requested and the function will block until the consumer
|
||||
* is granted.
|
||||
* @resource_name: name of dependent resource
|
||||
* @depends_on_name: name of its dependency
|
||||
*
|
||||
* This function is expected to be called from IOCTL and the dependency will be
|
||||
* marked as is was added by the userspace.
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
* Side effects: May block. See documentation above.
|
||||
*/
|
||||
int ipa_rm_add_dependency_sync(enum ipa_rm_resource_name resource_name,
|
||||
enum ipa_rm_resource_name depends_on_name)
|
||||
{
|
||||
return _ipa_rm_add_dependency_sync(resource_name, depends_on_name,
|
||||
false);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_add_dependency_sync);
|
||||
|
||||
/**
|
||||
* ipa_rm_add_dependency_sync_from_ioctl() - Create a dependency between 2
|
||||
|
|
@ -351,23 +199,6 @@ static int _ipa_rm_delete_dependency(enum ipa_rm_resource_name resource_name,
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* ipa_rm_delete_dependency() - delete dependency between 2 resources
|
||||
* @resource_name: name of dependent resource
|
||||
* @depends_on_name: name of its dependency
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
* Side effects: IPA_RM_RESORCE_GRANTED could be generated
|
||||
* in case client registered with IPA RM
|
||||
*/
|
||||
int ipa_rm_delete_dependency(enum ipa_rm_resource_name resource_name,
|
||||
enum ipa_rm_resource_name depends_on_name)
|
||||
{
|
||||
return _ipa_rm_delete_dependency(resource_name, depends_on_name, false);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_delete_dependency);
|
||||
|
||||
/**
|
||||
* ipa_rm_delete_dependency_fron_ioctl() - delete dependency between 2 resources
|
||||
* @resource_name: name of dependent resource
|
||||
|
|
@ -387,48 +218,6 @@ int ipa_rm_delete_dependency_from_ioctl(enum ipa_rm_resource_name resource_name,
|
|||
return _ipa_rm_delete_dependency(resource_name, depends_on_name, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* ipa_rm_request_resource() - request resource
|
||||
* @resource_name: [in] name of the requested resource
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
* All registered callbacks are called with IPA_RM_RESOURCE_GRANTED
|
||||
* on successful completion of this operation.
|
||||
*/
|
||||
int ipa_rm_request_resource(enum ipa_rm_resource_name resource_name)
|
||||
{
|
||||
struct ipa_rm_resource *resource;
|
||||
unsigned long flags;
|
||||
int result;
|
||||
|
||||
if (unlikely(!ipa_rm_ctx)) {
|
||||
IPA_RM_ERR("IPA RM was not initialized\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!IPA_RM_RESORCE_IS_PROD(resource_name)) {
|
||||
IPA_RM_ERR("can be called on PROD only\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
spin_lock_irqsave(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
if (ipa_rm_dep_graph_get_resource(ipa_rm_ctx->dep_graph,
|
||||
resource_name,
|
||||
&resource) != 0) {
|
||||
IPA_RM_ERR("resource does not exist\n");
|
||||
result = -EPERM;
|
||||
goto bail;
|
||||
}
|
||||
result = ipa_rm_resource_producer_request(
|
||||
(struct ipa_rm_resource_prod *)resource);
|
||||
|
||||
bail:
|
||||
spin_unlock_irqrestore(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_request_resource);
|
||||
|
||||
void delayed_release_work_func(struct work_struct *work)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
|
@ -514,222 +303,6 @@ bail:
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* ipa_rm_release_resource() - release resource
|
||||
* @resource_name: [in] name of the requested resource
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
* All registered callbacks are called with IPA_RM_RESOURCE_RELEASED
|
||||
* on successful completion of this operation.
|
||||
*/
|
||||
int ipa_rm_release_resource(enum ipa_rm_resource_name resource_name)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct ipa_rm_resource *resource;
|
||||
int result;
|
||||
|
||||
if (unlikely(!ipa_rm_ctx)) {
|
||||
IPA_RM_ERR("IPA RM was not initialized\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!IPA_RM_RESORCE_IS_PROD(resource_name)) {
|
||||
IPA_RM_ERR("can be called on PROD only\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
spin_lock_irqsave(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
if (ipa_rm_dep_graph_get_resource(ipa_rm_ctx->dep_graph,
|
||||
resource_name,
|
||||
&resource) != 0) {
|
||||
IPA_RM_ERR("resource does not exists\n");
|
||||
result = -EPERM;
|
||||
goto bail;
|
||||
}
|
||||
result = ipa_rm_resource_producer_release(
|
||||
(struct ipa_rm_resource_prod *)resource);
|
||||
|
||||
bail:
|
||||
spin_unlock_irqrestore(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_release_resource);
|
||||
|
||||
/**
|
||||
* ipa_rm_register() - register for event
|
||||
* @resource_name: resource name
|
||||
* @reg_params: [in] registration parameters
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
* Registration parameters provided here should be the same
|
||||
* as provided later in ipa_rm_deregister() call.
|
||||
*/
|
||||
int ipa_rm_register(enum ipa_rm_resource_name resource_name,
|
||||
struct ipa_rm_register_params *reg_params)
|
||||
{
|
||||
int result;
|
||||
unsigned long flags;
|
||||
struct ipa_rm_resource *resource;
|
||||
|
||||
IPA_RM_DBG("%s\n", ipa_rm_resource_str(resource_name));
|
||||
|
||||
if (!IPA_RM_RESORCE_IS_PROD(resource_name)) {
|
||||
IPA_RM_ERR("can be called on PROD only\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
spin_lock_irqsave(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
if (ipa_rm_dep_graph_get_resource(ipa_rm_ctx->dep_graph,
|
||||
resource_name,
|
||||
&resource) != 0) {
|
||||
IPA_RM_ERR("resource does not exists\n");
|
||||
result = -EPERM;
|
||||
goto bail;
|
||||
}
|
||||
result = ipa_rm_resource_producer_register(
|
||||
(struct ipa_rm_resource_prod *)resource,
|
||||
reg_params,
|
||||
true);
|
||||
bail:
|
||||
spin_unlock_irqrestore(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
IPA_RM_DBG("EXIT with %d\n", result);
|
||||
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_register);
|
||||
|
||||
/**
|
||||
* ipa_rm_deregister() - cancel the registration
|
||||
* @resource_name: resource name
|
||||
* @reg_params: [in] registration parameters
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
* Registration parameters provided here should be the same
|
||||
* as provided in ipa_rm_register() call.
|
||||
*/
|
||||
int ipa_rm_deregister(enum ipa_rm_resource_name resource_name,
|
||||
struct ipa_rm_register_params *reg_params)
|
||||
{
|
||||
int result;
|
||||
unsigned long flags;
|
||||
struct ipa_rm_resource *resource;
|
||||
|
||||
IPA_RM_DBG("%s\n", ipa_rm_resource_str(resource_name));
|
||||
|
||||
if (!IPA_RM_RESORCE_IS_PROD(resource_name)) {
|
||||
IPA_RM_ERR("can be called on PROD only\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
spin_lock_irqsave(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
if (ipa_rm_dep_graph_get_resource(ipa_rm_ctx->dep_graph,
|
||||
resource_name,
|
||||
&resource) != 0) {
|
||||
IPA_RM_ERR("resource does not exists\n");
|
||||
result = -EPERM;
|
||||
goto bail;
|
||||
}
|
||||
result = ipa_rm_resource_producer_deregister(
|
||||
(struct ipa_rm_resource_prod *)resource,
|
||||
reg_params);
|
||||
bail:
|
||||
spin_unlock_irqrestore(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
IPA_RM_DBG("EXIT with %d\n", result);
|
||||
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_deregister);
|
||||
|
||||
/**
|
||||
* ipa_rm_set_perf_profile() - set performance profile
|
||||
* @resource_name: resource name
|
||||
* @profile: [in] profile information.
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*
|
||||
* Set resource performance profile.
|
||||
* Updates IPA driver if performance level changed.
|
||||
*/
|
||||
int ipa_rm_set_perf_profile(enum ipa_rm_resource_name resource_name,
|
||||
struct ipa_rm_perf_profile *profile)
|
||||
{
|
||||
int result;
|
||||
unsigned long flags;
|
||||
struct ipa_rm_resource *resource;
|
||||
|
||||
if (unlikely(!ipa_rm_ctx)) {
|
||||
IPA_RM_ERR("IPA RM was not initialized\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
IPA_RM_DBG("%s\n", ipa_rm_resource_str(resource_name));
|
||||
if (profile)
|
||||
IPA_RM_DBG("BW: %d\n", profile->max_supported_bandwidth_mbps);
|
||||
|
||||
spin_lock_irqsave(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
if (ipa_rm_dep_graph_get_resource(ipa_rm_ctx->dep_graph,
|
||||
resource_name,
|
||||
&resource) != 0) {
|
||||
IPA_RM_ERR("resource does not exists\n");
|
||||
result = -EPERM;
|
||||
goto bail;
|
||||
}
|
||||
result = ipa_rm_resource_set_perf_profile(resource, profile);
|
||||
if (result) {
|
||||
IPA_RM_ERR("ipa_rm_resource_set_perf_profile failed %d\n",
|
||||
result);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
bail:
|
||||
spin_unlock_irqrestore(&ipa_rm_ctx->ipa_rm_lock, flags);
|
||||
IPA_RM_DBG("EXIT with %d\n", result);
|
||||
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_set_perf_profile);
|
||||
|
||||
/**
|
||||
* ipa_rm_notify_completion() -
|
||||
* consumer driver notification for
|
||||
* request_resource / release_resource operations
|
||||
* completion
|
||||
* @event: notified event
|
||||
* @resource_name: resource name
|
||||
*
|
||||
* Returns: 0 on success, negative on failure
|
||||
*/
|
||||
int ipa_rm_notify_completion(enum ipa_rm_event event,
|
||||
enum ipa_rm_resource_name resource_name)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (unlikely(!ipa_rm_ctx)) {
|
||||
IPA_RM_ERR("IPA RM was not initialized\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
IPA_RM_DBG("event %d on %s\n", event,
|
||||
ipa_rm_resource_str(resource_name));
|
||||
if (!IPA_RM_RESORCE_IS_CONS(resource_name)) {
|
||||
IPA_RM_ERR("can be called on CONS only\n");
|
||||
result = -EINVAL;
|
||||
goto bail;
|
||||
}
|
||||
ipa_rm_wq_send_cmd(IPA_RM_WQ_RESOURCE_CB,
|
||||
resource_name,
|
||||
event,
|
||||
false);
|
||||
result = 0;
|
||||
bail:
|
||||
IPA_RM_DBG("EXIT with %d\n", result);
|
||||
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_notify_completion);
|
||||
|
||||
static void ipa_rm_wq_handler(struct work_struct *work)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
|
|
|||
|
|
@ -43,237 +43,3 @@ struct ipa_rm_it_private {
|
|||
struct wakeup_source *w_lock;
|
||||
char w_lock_name[MAX_WS_NAME];
|
||||
};
|
||||
|
||||
static struct ipa_rm_it_private ipa_rm_it_handles[IPA_RM_RESOURCE_MAX];
|
||||
|
||||
/**
|
||||
* ipa_rm_inactivity_timer_func() - called when timer expired in
|
||||
* the context of the shared workqueue. Checks internally if
|
||||
* reschedule_work flag is set. In case it is not set this function calls to
|
||||
* ipa_rm_release_resource(). In case reschedule_work is set this function
|
||||
* reschedule the work. This flag is cleared cleared when
|
||||
* calling to ipa_rm_inactivity_timer_release_resource().
|
||||
*
|
||||
* @work: work object provided by the work queue
|
||||
*
|
||||
* Return codes:
|
||||
* None
|
||||
*/
|
||||
static void ipa_rm_inactivity_timer_func(struct work_struct *work)
|
||||
{
|
||||
|
||||
struct ipa_rm_it_private *me = container_of(to_delayed_work(work),
|
||||
struct ipa_rm_it_private,
|
||||
work);
|
||||
unsigned long flags;
|
||||
|
||||
IPA_RM_DBG_LOW("timer expired for resource %d\n", me->resource_name);
|
||||
|
||||
spin_lock_irqsave(
|
||||
&ipa_rm_it_handles[me->resource_name].lock, flags);
|
||||
if (ipa_rm_it_handles[me->resource_name].reschedule_work) {
|
||||
IPA_RM_DBG_LOW("setting delayed work\n");
|
||||
ipa_rm_it_handles[me->resource_name].reschedule_work = false;
|
||||
queue_delayed_work(system_unbound_wq,
|
||||
&ipa_rm_it_handles[me->resource_name].work,
|
||||
ipa_rm_it_handles[me->resource_name].jiffies);
|
||||
} else if (ipa_rm_it_handles[me->resource_name].resource_requested) {
|
||||
IPA_RM_DBG_LOW("not calling release\n");
|
||||
ipa_rm_it_handles[me->resource_name].work_in_progress = false;
|
||||
} else {
|
||||
IPA_RM_DBG_LOW("calling release_resource on resource %d\n",
|
||||
me->resource_name);
|
||||
__pm_relax(ipa_rm_it_handles[me->resource_name].w_lock);
|
||||
ipa_rm_release_resource(me->resource_name);
|
||||
ipa_rm_it_handles[me->resource_name].work_in_progress = false;
|
||||
}
|
||||
spin_unlock_irqrestore(
|
||||
&ipa_rm_it_handles[me->resource_name].lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* ipa_rm_inactivity_timer_init() - Init function for IPA RM
|
||||
* inactivity timer. This function shall be called prior calling
|
||||
* any other API of IPA RM inactivity timer.
|
||||
*
|
||||
* @resource_name: Resource name. @see ipa_rm.h
|
||||
* @msecs: time in miliseccond, that IPA RM inactivity timer
|
||||
* shall wait prior calling to ipa_rm_release_resource().
|
||||
*
|
||||
* Return codes:
|
||||
* 0: success
|
||||
* -EINVAL: invalid parameters
|
||||
*/
|
||||
int ipa_rm_inactivity_timer_init(enum ipa_rm_resource_name resource_name,
|
||||
unsigned long msecs)
|
||||
{
|
||||
char *name;
|
||||
|
||||
IPA_RM_DBG_LOW("resource %d\n", resource_name);
|
||||
|
||||
if (resource_name < 0 ||
|
||||
resource_name >= IPA_RM_RESOURCE_MAX) {
|
||||
IPA_RM_ERR("Invalid parameter\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (ipa_rm_it_handles[resource_name].initied) {
|
||||
IPA_RM_ERR("resource %d already inited\n", resource_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
spin_lock_init(&ipa_rm_it_handles[resource_name].lock);
|
||||
ipa_rm_it_handles[resource_name].resource_name = resource_name;
|
||||
ipa_rm_it_handles[resource_name].jiffies = msecs_to_jiffies(msecs);
|
||||
ipa_rm_it_handles[resource_name].resource_requested = false;
|
||||
ipa_rm_it_handles[resource_name].reschedule_work = false;
|
||||
ipa_rm_it_handles[resource_name].work_in_progress = false;
|
||||
name = ipa_rm_it_handles[resource_name].w_lock_name;
|
||||
snprintf(name, MAX_WS_NAME, "IPA_RM%d\n", resource_name);
|
||||
ipa_rm_it_handles[resource_name].w_lock =
|
||||
wakeup_source_register(NULL, name);
|
||||
if (!ipa_rm_it_handles[resource_name].w_lock) {
|
||||
IPA_RM_ERR("IPA wakeup source register failed %s\n",
|
||||
name);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
INIT_DELAYED_WORK(&ipa_rm_it_handles[resource_name].work,
|
||||
ipa_rm_inactivity_timer_func);
|
||||
ipa_rm_it_handles[resource_name].initied = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_inactivity_timer_init);
|
||||
|
||||
/**
|
||||
* ipa_rm_inactivity_timer_destroy() - De-Init function for IPA
|
||||
* RM inactivity timer.
|
||||
* @resource_name: Resource name. @see ipa_rm.h
|
||||
* Return codes:
|
||||
* 0: success
|
||||
* -EINVAL: invalid parameters
|
||||
*/
|
||||
int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name)
|
||||
{
|
||||
IPA_RM_DBG_LOW("resource %d\n", resource_name);
|
||||
|
||||
if (resource_name < 0 ||
|
||||
resource_name >= IPA_RM_RESOURCE_MAX) {
|
||||
IPA_RM_ERR("Invalid parameter\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!ipa_rm_it_handles[resource_name].initied) {
|
||||
IPA_RM_ERR("resource %d already inited\n",
|
||||
resource_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
cancel_delayed_work_sync(&ipa_rm_it_handles[resource_name].work);
|
||||
wakeup_source_unregister(ipa_rm_it_handles[resource_name].w_lock);
|
||||
|
||||
memset(&ipa_rm_it_handles[resource_name], 0,
|
||||
sizeof(struct ipa_rm_it_private));
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_inactivity_timer_destroy);
|
||||
|
||||
/**
|
||||
* ipa_rm_inactivity_timer_request_resource() - Same as
|
||||
* ipa_rm_request_resource(), with a difference that calling to
|
||||
* this function will also cancel the inactivity timer, if
|
||||
* ipa_rm_inactivity_timer_release_resource() was called earlier.
|
||||
*
|
||||
* @resource_name: Resource name. @see ipa_rm.h
|
||||
*
|
||||
* Return codes:
|
||||
* 0: success
|
||||
* -EINVAL: invalid parameters
|
||||
*/
|
||||
int ipa_rm_inactivity_timer_request_resource(
|
||||
enum ipa_rm_resource_name resource_name)
|
||||
{
|
||||
int ret;
|
||||
unsigned long flags;
|
||||
|
||||
IPA_RM_DBG_LOW("resource %d\n", resource_name);
|
||||
|
||||
if (resource_name < 0 ||
|
||||
resource_name >= IPA_RM_RESOURCE_MAX) {
|
||||
IPA_RM_ERR("Invalid parameter\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!ipa_rm_it_handles[resource_name].initied) {
|
||||
IPA_RM_ERR("Not initialized\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&ipa_rm_it_handles[resource_name].lock, flags);
|
||||
ipa_rm_it_handles[resource_name].resource_requested = true;
|
||||
spin_unlock_irqrestore(&ipa_rm_it_handles[resource_name].lock, flags);
|
||||
ret = ipa_rm_request_resource(resource_name);
|
||||
IPA_RM_DBG_LOW("resource %d: returning %d\n", resource_name, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_inactivity_timer_request_resource);
|
||||
|
||||
/**
|
||||
* ipa_rm_inactivity_timer_release_resource() - Sets the
|
||||
* inactivity timer to the timeout set by
|
||||
* ipa_rm_inactivity_timer_init(). When the timeout expires, IPA
|
||||
* RM inactivity timer will call to ipa_rm_release_resource().
|
||||
* If a call to ipa_rm_inactivity_timer_request_resource() was
|
||||
* made BEFORE the timeout has expired, rge timer will be
|
||||
* cancelled.
|
||||
*
|
||||
* @resource_name: Resource name. @see ipa_rm.h
|
||||
*
|
||||
* Return codes:
|
||||
* 0: success
|
||||
* -EINVAL: invalid parameters
|
||||
*/
|
||||
int ipa_rm_inactivity_timer_release_resource(
|
||||
enum ipa_rm_resource_name resource_name)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
IPA_RM_DBG_LOW("resource %d\n", resource_name);
|
||||
|
||||
if (resource_name < 0 ||
|
||||
resource_name >= IPA_RM_RESOURCE_MAX) {
|
||||
IPA_RM_ERR("Invalid parameter\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!ipa_rm_it_handles[resource_name].initied) {
|
||||
IPA_RM_ERR("Not initialized\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&ipa_rm_it_handles[resource_name].lock, flags);
|
||||
ipa_rm_it_handles[resource_name].resource_requested = false;
|
||||
if (ipa_rm_it_handles[resource_name].work_in_progress) {
|
||||
IPA_RM_DBG_LOW("Timer already set, no sched again %d\n",
|
||||
resource_name);
|
||||
ipa_rm_it_handles[resource_name].reschedule_work = true;
|
||||
spin_unlock_irqrestore(
|
||||
&ipa_rm_it_handles[resource_name].lock, flags);
|
||||
return 0;
|
||||
}
|
||||
ipa_rm_it_handles[resource_name].work_in_progress = true;
|
||||
ipa_rm_it_handles[resource_name].reschedule_work = false;
|
||||
__pm_stay_awake(ipa_rm_it_handles[resource_name].w_lock);
|
||||
IPA_RM_DBG_LOW("setting delayed work\n");
|
||||
queue_delayed_work(system_unbound_wq,
|
||||
&ipa_rm_it_handles[resource_name].work,
|
||||
ipa_rm_it_handles[resource_name].jiffies);
|
||||
spin_unlock_irqrestore(&ipa_rm_it_handles[resource_name].lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_rm_inactivity_timer_release_resource);
|
||||
|
||||
|
|
|
|||
|
|
@ -423,6 +423,7 @@ struct device *ipa3_get_dma_dev(void)
|
|||
{
|
||||
return ipa3_ctx->pdev;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_get_dma_dev);
|
||||
|
||||
/**
|
||||
* ipa3_get_smmu_ctx()- Return smmu context for the given cb_type
|
||||
|
|
@ -3868,12 +3869,12 @@ int _ipa_init_sram_v3(void)
|
|||
IPA_MEM_PART(modem_hdr_proc_ctx_ofst) - 4);
|
||||
ipa3_sram_set_canary(ipa_sram_mmio,
|
||||
IPA_MEM_PART(modem_hdr_proc_ctx_ofst));
|
||||
if (ipa_get_hw_type() >= IPA_HW_v4_5) {
|
||||
if (ipa_get_hw_type_internal() >= IPA_HW_v4_5) {
|
||||
ipa3_sram_set_canary(ipa_sram_mmio,
|
||||
IPA_MEM_PART(nat_tbl_ofst) - 12);
|
||||
}
|
||||
if (ipa_get_hw_type() >= IPA_HW_v4_0) {
|
||||
if (ipa_get_hw_type() < IPA_HW_v4_5) {
|
||||
if (ipa_get_hw_type_internal() >= IPA_HW_v4_0) {
|
||||
if (ipa_get_hw_type_internal() < IPA_HW_v4_5) {
|
||||
ipa3_sram_set_canary(ipa_sram_mmio,
|
||||
IPA_MEM_PART(pdn_config_ofst) - 4);
|
||||
ipa3_sram_set_canary(ipa_sram_mmio,
|
||||
|
|
@ -3888,14 +3889,14 @@ int _ipa_init_sram_v3(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (ipa_get_hw_type() <= IPA_HW_v3_5 ||
|
||||
ipa_get_hw_type() >= IPA_HW_v4_5) {
|
||||
if (ipa_get_hw_type_internal() <= IPA_HW_v3_5 ||
|
||||
ipa_get_hw_type_internal() >= IPA_HW_v4_5) {
|
||||
ipa3_sram_set_canary(ipa_sram_mmio,
|
||||
IPA_MEM_PART(modem_ofst) - 4);
|
||||
ipa3_sram_set_canary(ipa_sram_mmio, IPA_MEM_PART(modem_ofst));
|
||||
}
|
||||
ipa3_sram_set_canary(ipa_sram_mmio,
|
||||
(ipa_get_hw_type() >= IPA_HW_v3_5) ?
|
||||
(ipa_get_hw_type_internal() >= IPA_HW_v3_5) ?
|
||||
IPA_MEM_PART(uc_descriptor_ram_ofst) :
|
||||
IPA_MEM_PART(end_ofst));
|
||||
|
||||
|
|
@ -5474,16 +5475,6 @@ int ipa3_restore_suspend_handler(void)
|
|||
return result;
|
||||
}
|
||||
|
||||
static int ipa3_apps_cons_release_resource(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipa3_apps_cons_request_resource(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipa3_transport_release_resource(struct work_struct *work)
|
||||
{
|
||||
mutex_lock(&ipa3_ctx->transport_pm.transport_pm_mutex);
|
||||
|
|
@ -5502,31 +5493,6 @@ static void ipa3_transport_release_resource(struct work_struct *work)
|
|||
mutex_unlock(&ipa3_ctx->transport_pm.transport_pm_mutex);
|
||||
}
|
||||
|
||||
int ipa3_create_apps_resource(void)
|
||||
{
|
||||
struct ipa_rm_create_params apps_cons_create_params;
|
||||
struct ipa_rm_perf_profile profile;
|
||||
int result = 0;
|
||||
|
||||
memset(&apps_cons_create_params, 0,
|
||||
sizeof(apps_cons_create_params));
|
||||
apps_cons_create_params.name = IPA_RM_RESOURCE_APPS_CONS;
|
||||
apps_cons_create_params.request_resource =
|
||||
ipa3_apps_cons_request_resource;
|
||||
apps_cons_create_params.release_resource =
|
||||
ipa3_apps_cons_release_resource;
|
||||
result = ipa_rm_create_resource(&apps_cons_create_params);
|
||||
if (result) {
|
||||
IPAERR("ipa_rm_create_resource failed\n");
|
||||
return result;
|
||||
}
|
||||
|
||||
profile.max_supported_bandwidth_mbps = IPA_APPS_MAX_BW_IN_MBPS;
|
||||
ipa_rm_set_perf_profile(IPA_RM_RESOURCE_APPS_CONS, &profile);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* ipa3_init_interrupts() - Register to IPA IRQs
|
||||
*
|
||||
|
|
@ -5781,6 +5747,40 @@ static inline void ipa3_register_to_fmwk(void)
|
|||
struct ipa_core_data data;
|
||||
|
||||
data.ipa_tx_dp = ipa3_tx_dp;
|
||||
data.ipa_get_hw_type = ipa_get_hw_type_internal;
|
||||
data.ipa_is_vlan_mode = ipa3_is_vlan_mode;
|
||||
data.ipa_get_smmu_params = ipa3_get_smmu_params;
|
||||
data.ipa_get_lan_rx_napi = ipa3_get_lan_rx_napi;
|
||||
data.ipa_dma_init = ipa3_dma_init;
|
||||
data.ipa_dma_enable = ipa3_dma_enable;
|
||||
data.ipa_dma_disable = ipa3_dma_disable;
|
||||
data.ipa_dma_sync_memcpy = ipa3_dma_sync_memcpy;
|
||||
data.ipa_dma_async_memcpy = ipa3_dma_async_memcpy;
|
||||
data.ipa_dma_destroy = ipa3_dma_destroy;
|
||||
data.ipa_get_ep_mapping = ipa3_get_ep_mapping;
|
||||
data.ipa_send_msg = ipa3_send_msg;
|
||||
data.ipa_free_skb = ipa3_free_skb;
|
||||
data.ipa_setup_sys_pipe = ipa3_setup_sys_pipe;
|
||||
data.ipa_teardown_sys_pipe = ipa3_teardown_sys_pipe;
|
||||
data.ipa_get_wdi_stats = ipa3_get_wdi_stats;
|
||||
data.ipa_uc_bw_monitor = ipa3_uc_bw_monitor;
|
||||
data.ipa_broadcast_wdi_quota_reach_ind =
|
||||
ipa3_broadcast_wdi_quota_reach_ind;
|
||||
data.ipa_uc_wdi_get_dbpa = ipa3_uc_wdi_get_dbpa;
|
||||
data.ipa_cfg_ep_ctrl = ipa3_cfg_ep_ctrl;
|
||||
data.ipa_add_rt_rule = ipa3_add_rt_rule;
|
||||
data.ipa_put_rt_tbl = ipa3_put_rt_tbl;
|
||||
data.ipa_register_intf = ipa3_register_intf;
|
||||
data.ipa_set_aggr_mode = ipa3_set_aggr_mode;
|
||||
data.ipa_set_qcncm_ndp_sig = ipa3_set_qcncm_ndp_sig;
|
||||
data.ipa_set_single_ndp_per_mbim = ipa3_set_single_ndp_per_mbim;
|
||||
data.ipa_add_interrupt_handler = ipa3_add_interrupt_handler;
|
||||
data.ipa_restore_suspend_handler = ipa3_restore_suspend_handler;
|
||||
data.ipa_get_gsi_ep_info = ipa3_get_gsi_ep_info;
|
||||
data.ipa_stop_gsi_channel = ipa3_stop_gsi_channel;
|
||||
data.ipa_rmnet_ctl_xmit = ipa3_rmnet_ctl_xmit;
|
||||
data.ipa_register_rmnet_ctl_cb = ipa3_register_rmnet_ctl_cb;
|
||||
data.ipa_unregister_rmnet_ctl_cb = ipa3_unregister_rmnet_ctl_cb;
|
||||
|
||||
if (ipa_fmwk_register_ipa(&data)) {
|
||||
IPAERR("couldn't register to IPA framework\n");
|
||||
|
|
@ -8695,6 +8695,7 @@ struct ipa3_context *ipa3_get_ctx(void)
|
|||
{
|
||||
return ipa3_ctx;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_get_ctx);
|
||||
|
||||
bool ipa3_get_lan_rx_napi(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -782,6 +782,7 @@ int ipa3_add_hdr(struct ipa_ioc_add_hdr *hdrs)
|
|||
{
|
||||
return ipa3_add_hdr_usr(hdrs, false);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_add_hdr);
|
||||
|
||||
/**
|
||||
* ipa3_add_hdr_usr() - add the specified headers to SW
|
||||
|
|
@ -883,6 +884,7 @@ int ipa3_del_hdr(struct ipa_ioc_del_hdr *hdls)
|
|||
{
|
||||
return ipa3_del_hdr_by_user(hdls, false);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_del_hdr);
|
||||
|
||||
/**
|
||||
* ipa3_add_hdr_proc_ctx() - add the specified headers to SW
|
||||
|
|
|
|||
|
|
@ -2501,12 +2501,10 @@ int ipa3_cfg_ep_ctrl(u32 clnt_hdl, const struct ipa_ep_cfg_ctrl *ep_ctrl);
|
|||
/*
|
||||
* Header removal / addition
|
||||
*/
|
||||
int ipa3_add_hdr(struct ipa_ioc_add_hdr *hdrs);
|
||||
|
||||
|
||||
int ipa3_add_hdr_usr(struct ipa_ioc_add_hdr *hdrs, bool by_user);
|
||||
|
||||
int ipa3_del_hdr(struct ipa_ioc_del_hdr *hdls);
|
||||
|
||||
int ipa3_del_hdr_by_user(struct ipa_ioc_del_hdr *hdls, bool by_user);
|
||||
|
||||
int ipa3_commit_hdr(void);
|
||||
|
|
@ -3261,6 +3259,8 @@ static inline void ipa_eth_exit(void) { }
|
|||
int ipa3_get_gsi_chan_info(struct gsi_chan_info *gsi_chan_info,
|
||||
unsigned long chan_hdl);
|
||||
|
||||
int ipa3_disable_apps_wan_cons_deaggr(uint32_t agg_size, uint32_t agg_count);
|
||||
|
||||
#if IS_ENABLED(CONFIG_IPA3_MHI_PRIME_MANAGER)
|
||||
int ipa_mpm_mhip_xdci_pipe_enable(enum ipa_usb_teth_prot prot);
|
||||
int ipa_mpm_mhip_xdci_pipe_disable(enum ipa_usb_teth_prot xdci_teth_prot);
|
||||
|
|
@ -3332,4 +3332,6 @@ int ipa3_uc_send_enable_flow_control(uint16_t gsi_chid,
|
|||
int ipa3_uc_send_disable_flow_control(void);
|
||||
int ipa3_uc_send_update_flow_control(uint32_t bitmask,
|
||||
uint8_t add_delete);
|
||||
|
||||
enum ipa_hw_type ipa_get_hw_type_internal(void);
|
||||
#endif /* _IPA3_I_H_ */
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ int ipa3_register_intf(const char *name, const struct ipa_tx_intf *tx,
|
|||
{
|
||||
return ipa3_register_intf_ext(name, tx, rx, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_register_intf);
|
||||
|
||||
/**
|
||||
* ipa3_register_intf_ext() - register "logical" interface which has only
|
||||
|
|
@ -191,6 +192,7 @@ int ipa3_deregister_intf(const char *name)
|
|||
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_deregister_intf);
|
||||
|
||||
/**
|
||||
* ipa3_query_intf() - query logical interface properties
|
||||
|
|
|
|||
|
|
@ -870,7 +870,7 @@ int ipa_pm_associate_ipa_cons_to_client(u32 hdl, enum ipa_client_type consumer)
|
|||
return -EPERM;
|
||||
}
|
||||
|
||||
idx = ipa_get_ep_mapping(consumer);
|
||||
idx = ipa3_get_ep_mapping(consumer);
|
||||
|
||||
if (idx < 0) {
|
||||
mutex_unlock(&ipa_pm_ctx->client_mutex);
|
||||
|
|
|
|||
|
|
@ -1726,7 +1726,7 @@ static void ipa3_qmi_service_init_worker(struct work_struct *work)
|
|||
IPAWANDBG("IPA A7 QMI init OK :>>>>\n");
|
||||
|
||||
ipa3_qmi_ctx->modem_cfg_emb_pipe_flt =
|
||||
ipa_get_modem_cfg_emb_pipe_flt();
|
||||
ipa3_get_modem_cfg_emb_pipe_flt();
|
||||
|
||||
ipa3_qmi_ctx->num_ipa_offload_connection = 0;
|
||||
ipa3_svc_handle = vzalloc(sizeof(*ipa3_svc_handle));
|
||||
|
|
|
|||
|
|
@ -2078,6 +2078,7 @@ dma_alloc_fail:
|
|||
fail:
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_connect_wdi_pipe);
|
||||
|
||||
int ipa3_disconnect_gsi_wdi_pipe(u32 clnt_hdl)
|
||||
{
|
||||
|
|
@ -2190,6 +2191,7 @@ uc_timeout:
|
|||
IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl));
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_disconnect_wdi_pipe);
|
||||
|
||||
int ipa3_enable_gsi_wdi_pipe(u32 clnt_hdl)
|
||||
{
|
||||
|
|
@ -2355,6 +2357,7 @@ uc_timeout:
|
|||
IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl));
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_enable_wdi_pipe);
|
||||
|
||||
/**
|
||||
* ipa3_disable_wdi_pipe() - WDI client disable
|
||||
|
|
@ -2461,6 +2464,7 @@ uc_timeout:
|
|||
IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl));
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_disable_wdi_pipe);
|
||||
|
||||
int ipa3_resume_gsi_wdi_pipe(u32 clnt_hdl)
|
||||
{
|
||||
|
|
@ -2603,6 +2607,7 @@ int ipa3_resume_wdi_pipe(u32 clnt_hdl)
|
|||
uc_timeout:
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_resume_wdi_pipe);
|
||||
|
||||
int ipa3_suspend_gsi_wdi_pipe(u32 clnt_hdl)
|
||||
{
|
||||
|
|
@ -2834,6 +2839,7 @@ int ipa3_suspend_wdi_pipe(u32 clnt_hdl)
|
|||
uc_timeout:
|
||||
return result;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_suspend_wdi_pipe);
|
||||
|
||||
/**
|
||||
* ipa_broadcast_wdi_quota_reach_ind() - quota reach
|
||||
|
|
@ -2968,6 +2974,7 @@ int ipa3_uc_reg_rdyCB(
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_uc_reg_rdyCB);
|
||||
|
||||
/**
|
||||
* ipa3_uc_dereg_rdyCB() - To de-register uC ready CB
|
||||
|
|
@ -3072,6 +3079,7 @@ int ipa3_create_wdi_mapping(u32 num_buffers, struct ipa_wdi_buffer_info *info)
|
|||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_create_wdi_mapping);
|
||||
|
||||
int ipa3_release_wdi_mapping(u32 num_buffers, struct ipa_wdi_buffer_info *info)
|
||||
{
|
||||
|
|
@ -3100,3 +3108,4 @@ int ipa3_release_wdi_mapping(u32 num_buffers, struct ipa_wdi_buffer_info *info)
|
|||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_release_wdi_mapping);
|
||||
|
|
|
|||
|
|
@ -4552,6 +4552,7 @@ enum ipa_client_type ipa3_get_client_mapping(int pipe_idx)
|
|||
|
||||
return ipa3_ctx->ep[pipe_idx].client;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_get_client_mapping);
|
||||
|
||||
/**
|
||||
* ipa3_get_client_by_pipe() - return client type relative to pipe
|
||||
|
|
@ -7026,6 +7027,7 @@ bool ipa3_is_client_handle_valid(u32 clnt_hdl)
|
|||
return true;
|
||||
return false;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_is_client_handle_valid);
|
||||
|
||||
/**
|
||||
* ipa3_proxy_clk_unvote() - called to remove IPA clock proxy vote
|
||||
|
|
@ -7064,6 +7066,7 @@ void ipa3_proxy_clk_vote(void)
|
|||
}
|
||||
mutex_unlock(&ipa3_ctx->q6_proxy_clk_vote_mutex);
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_proxy_clk_vote);
|
||||
|
||||
/**
|
||||
* ipa3_get_smem_restr_bytes()- Return IPA smem restricted bytes
|
||||
|
|
@ -7104,6 +7107,7 @@ enum ipa_transport_type ipa3_get_transport_type(void)
|
|||
{
|
||||
return IPA_TRANSPORT_TYPE_GSI;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa3_get_transport_type);
|
||||
|
||||
u32 ipa3_get_num_pipes(void)
|
||||
{
|
||||
|
|
@ -7196,9 +7200,6 @@ int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type,
|
|||
return -EPERM;
|
||||
}
|
||||
|
||||
api_ctrl->ipa_reset_endpoint = NULL;
|
||||
api_ctrl->ipa_clear_endpoint_delay = ipa3_clear_endpoint_delay;
|
||||
api_ctrl->ipa_disable_endpoint = NULL;
|
||||
api_ctrl->ipa_cfg_ep = ipa3_cfg_ep;
|
||||
api_ctrl->ipa_cfg_ep_nat = ipa3_cfg_ep_nat;
|
||||
api_ctrl->ipa_cfg_ep_conn_track = ipa3_cfg_ep_conn_track;
|
||||
|
|
@ -7215,18 +7216,10 @@ int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type,
|
|||
api_ctrl->ipa_cfg_ep_cfg = ipa3_cfg_ep_cfg;
|
||||
api_ctrl->ipa_cfg_ep_metadata_mask = ipa3_cfg_ep_metadata_mask;
|
||||
api_ctrl->ipa_cfg_ep_holb_by_client = ipa3_cfg_ep_holb_by_client;
|
||||
api_ctrl->ipa_cfg_ep_ctrl = ipa3_cfg_ep_ctrl;
|
||||
api_ctrl->ipa_add_hdr = ipa3_add_hdr;
|
||||
api_ctrl->ipa_add_hdr_usr = ipa3_add_hdr_usr;
|
||||
api_ctrl->ipa_del_hdr = ipa3_del_hdr;
|
||||
api_ctrl->ipa_commit_hdr = ipa3_commit_hdr;
|
||||
api_ctrl->ipa_reset_hdr = ipa3_reset_hdr;
|
||||
api_ctrl->ipa_get_hdr = ipa3_get_hdr;
|
||||
api_ctrl->ipa_put_hdr = ipa3_put_hdr;
|
||||
api_ctrl->ipa_copy_hdr = ipa3_copy_hdr;
|
||||
api_ctrl->ipa_add_hdr_proc_ctx = ipa3_add_hdr_proc_ctx;
|
||||
api_ctrl->ipa_del_hdr_proc_ctx = ipa3_del_hdr_proc_ctx;
|
||||
api_ctrl->ipa_add_rt_rule = ipa3_add_rt_rule;
|
||||
api_ctrl->ipa_add_rt_rule_v2 = ipa3_add_rt_rule_v2;
|
||||
api_ctrl->ipa_add_rt_rule_usr = ipa3_add_rt_rule_usr;
|
||||
api_ctrl->ipa_add_rt_rule_usr_v2 = ipa3_add_rt_rule_usr_v2;
|
||||
|
|
@ -7234,7 +7227,6 @@ int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type,
|
|||
api_ctrl->ipa_commit_rt = ipa3_commit_rt;
|
||||
api_ctrl->ipa_reset_rt = ipa3_reset_rt;
|
||||
api_ctrl->ipa_get_rt_tbl = ipa3_get_rt_tbl;
|
||||
api_ctrl->ipa_put_rt_tbl = ipa3_put_rt_tbl;
|
||||
api_ctrl->ipa_query_rt_index = ipa3_query_rt_index;
|
||||
api_ctrl->ipa_mdfy_rt_rule = ipa3_mdfy_rt_rule;
|
||||
api_ctrl->ipa_mdfy_rt_rule_v2 = ipa3_mdfy_rt_rule_v2;
|
||||
|
|
@ -7258,50 +7250,16 @@ int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type,
|
|||
api_ctrl->ipa_del_nat_table = ipa3_del_nat_table;
|
||||
api_ctrl->ipa_del_ipv6ct_table = ipa3_del_ipv6ct_table;
|
||||
api_ctrl->ipa_nat_mdfy_pdn = ipa3_nat_mdfy_pdn;
|
||||
api_ctrl->ipa_send_msg = ipa3_send_msg;
|
||||
api_ctrl->ipa_register_pull_msg = ipa3_register_pull_msg;
|
||||
api_ctrl->ipa_deregister_pull_msg = ipa3_deregister_pull_msg;
|
||||
api_ctrl->ipa_register_intf = ipa3_register_intf;
|
||||
api_ctrl->ipa_register_intf_ext = ipa3_register_intf_ext;
|
||||
api_ctrl->ipa_deregister_intf = ipa3_deregister_intf;
|
||||
api_ctrl->ipa_set_aggr_mode = ipa3_set_aggr_mode;
|
||||
api_ctrl->ipa_set_qcncm_ndp_sig = ipa3_set_qcncm_ndp_sig;
|
||||
api_ctrl->ipa_set_single_ndp_per_mbim = ipa3_set_single_ndp_per_mbim;
|
||||
api_ctrl->ipa_tx_dp_mul = ipa3_tx_dp_mul;
|
||||
api_ctrl->ipa_free_skb = ipa3_free_skb;
|
||||
api_ctrl->ipa_setup_sys_pipe = ipa3_setup_sys_pipe;
|
||||
api_ctrl->ipa_teardown_sys_pipe = ipa3_teardown_sys_pipe;
|
||||
api_ctrl->ipa_sys_setup = ipa3_sys_setup;
|
||||
api_ctrl->ipa_sys_teardown = ipa3_sys_teardown;
|
||||
api_ctrl->ipa_sys_update_gsi_hdls = ipa3_sys_update_gsi_hdls;
|
||||
api_ctrl->ipa_connect_wdi_pipe = ipa3_connect_wdi_pipe;
|
||||
api_ctrl->ipa_disconnect_wdi_pipe = ipa3_disconnect_wdi_pipe;
|
||||
api_ctrl->ipa_enable_wdi_pipe = ipa3_enable_wdi_pipe;
|
||||
api_ctrl->ipa_disable_wdi_pipe = ipa3_disable_wdi_pipe;
|
||||
api_ctrl->ipa_resume_wdi_pipe = ipa3_resume_wdi_pipe;
|
||||
api_ctrl->ipa_suspend_wdi_pipe = ipa3_suspend_wdi_pipe;
|
||||
api_ctrl->ipa_get_wdi_stats = ipa3_get_wdi_stats;
|
||||
api_ctrl->ipa_uc_bw_monitor = ipa3_uc_bw_monitor;
|
||||
api_ctrl->ipa_set_wlan_tx_info = ipa3_set_wlan_tx_info;
|
||||
api_ctrl->ipa_get_smem_restr_bytes = ipa3_get_smem_restr_bytes;
|
||||
api_ctrl->ipa_broadcast_wdi_quota_reach_ind =
|
||||
ipa3_broadcast_wdi_quota_reach_ind;
|
||||
api_ctrl->ipa_uc_wdi_get_dbpa = ipa3_uc_wdi_get_dbpa;
|
||||
api_ctrl->ipa_uc_reg_rdyCB = ipa3_uc_reg_rdyCB;
|
||||
api_ctrl->ipa_uc_dereg_rdyCB = ipa3_uc_dereg_rdyCB;
|
||||
api_ctrl->teth_bridge_init = ipa3_teth_bridge_init;
|
||||
api_ctrl->teth_bridge_disconnect = ipa3_teth_bridge_disconnect;
|
||||
api_ctrl->teth_bridge_connect = ipa3_teth_bridge_connect;
|
||||
api_ctrl->ipa_set_client = ipa3_set_client;
|
||||
api_ctrl->ipa_get_client = ipa3_get_client;
|
||||
api_ctrl->ipa_get_client_uplink = ipa3_get_client_uplink;
|
||||
api_ctrl->ipa_dma_init = ipa3_dma_init;
|
||||
api_ctrl->ipa_dma_enable = ipa3_dma_enable;
|
||||
api_ctrl->ipa_dma_disable = ipa3_dma_disable;
|
||||
api_ctrl->ipa_dma_sync_memcpy = ipa3_dma_sync_memcpy;
|
||||
api_ctrl->ipa_dma_async_memcpy = ipa3_dma_async_memcpy;
|
||||
api_ctrl->ipa_dma_uc_memcpy = ipa3_dma_uc_memcpy;
|
||||
api_ctrl->ipa_dma_destroy = ipa3_dma_destroy;
|
||||
api_ctrl->ipa_mhi_init_engine = ipa3_mhi_init_engine;
|
||||
api_ctrl->ipa_connect_mhi_pipe = ipa3_connect_mhi_pipe;
|
||||
api_ctrl->ipa_disconnect_mhi_pipe = ipa3_disconnect_mhi_pipe;
|
||||
|
|
@ -7329,33 +7287,10 @@ int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type,
|
|||
api_ctrl->ipa_uc_mhi_cleanup = ipa3_uc_mhi_cleanup;
|
||||
api_ctrl->ipa_uc_state_check = ipa3_uc_state_check;
|
||||
api_ctrl->ipa_write_qmap_id = ipa3_write_qmap_id;
|
||||
api_ctrl->ipa_add_interrupt_handler = ipa3_add_interrupt_handler;
|
||||
api_ctrl->ipa_remove_interrupt_handler = ipa3_remove_interrupt_handler;
|
||||
api_ctrl->ipa_restore_suspend_handler = ipa3_restore_suspend_handler;
|
||||
api_ctrl->ipa_bam_reg_dump = NULL;
|
||||
api_ctrl->ipa_get_ep_mapping = ipa3_get_ep_mapping;
|
||||
api_ctrl->ipa_is_ready = ipa3_is_ready;
|
||||
api_ctrl->ipa_proxy_clk_vote = ipa3_proxy_clk_vote;
|
||||
api_ctrl->ipa_proxy_clk_unvote = ipa3_proxy_clk_unvote;
|
||||
api_ctrl->ipa_is_client_handle_valid = ipa3_is_client_handle_valid;
|
||||
api_ctrl->ipa_get_client_mapping = ipa3_get_client_mapping;
|
||||
api_ctrl->ipa_get_modem_cfg_emb_pipe_flt =
|
||||
ipa3_get_modem_cfg_emb_pipe_flt;
|
||||
api_ctrl->ipa_get_transport_type = ipa3_get_transport_type;
|
||||
api_ctrl->ipa_ap_suspend = ipa3_ap_suspend;
|
||||
api_ctrl->ipa_ap_resume = ipa3_ap_resume;
|
||||
api_ctrl->ipa_get_smmu_domain = ipa3_get_smmu_domain;
|
||||
api_ctrl->ipa_disable_apps_wan_cons_deaggr =
|
||||
ipa3_disable_apps_wan_cons_deaggr;
|
||||
api_ctrl->ipa_get_dma_dev = ipa3_get_dma_dev;
|
||||
api_ctrl->ipa_release_wdi_mapping = ipa3_release_wdi_mapping;
|
||||
api_ctrl->ipa_create_wdi_mapping = ipa3_create_wdi_mapping;
|
||||
api_ctrl->ipa_get_gsi_ep_info = ipa3_get_gsi_ep_info;
|
||||
api_ctrl->ipa_stop_gsi_channel = ipa3_stop_gsi_channel;
|
||||
api_ctrl->ipa_start_gsi_channel = ipa3_start_gsi_channel;
|
||||
api_ctrl->ipa_unregister_rmnet_ctl_cb = ipa3_unregister_rmnet_ctl_cb;
|
||||
api_ctrl->ipa_register_rmnet_ctl_cb = ipa3_register_rmnet_ctl_cb;
|
||||
api_ctrl->ipa_rmnet_ctl_xmit = ipa3_rmnet_ctl_xmit;
|
||||
api_ctrl->ipa_inc_client_enable_clks = ipa3_inc_client_enable_clks;
|
||||
api_ctrl->ipa_dec_client_disable_clks = ipa3_dec_client_disable_clks;
|
||||
api_ctrl->ipa_inc_client_enable_clks_no_block =
|
||||
|
|
@ -7380,8 +7315,6 @@ int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type,
|
|||
api_ctrl->ipa_enable_wdi_pipes = ipa3_enable_wdi3_pipes;
|
||||
api_ctrl->ipa_disable_wdi_pipes = ipa3_disable_wdi3_pipes;
|
||||
api_ctrl->ipa_tz_unlock_reg = ipa3_tz_unlock_reg;
|
||||
api_ctrl->ipa_get_smmu_params = ipa3_get_smmu_params;
|
||||
api_ctrl->ipa_is_vlan_mode = ipa3_is_vlan_mode;
|
||||
api_ctrl->ipa_wigig_internal_init = ipa3_wigig_internal_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;
|
||||
|
|
@ -7393,7 +7326,6 @@ int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type,
|
|||
ipa3_register_client_callback;
|
||||
api_ctrl->ipa_deregister_client_callback =
|
||||
ipa3_deregister_client_callback;
|
||||
api_ctrl->ipa_get_lan_rx_napi = ipa3_get_lan_rx_napi;
|
||||
api_ctrl->ipa_uc_debug_stats_alloc =
|
||||
ipa3_uc_debug_stats_alloc;
|
||||
api_ctrl->ipa_uc_debug_stats_dealloc =
|
||||
|
|
|
|||
|
|
@ -1870,6 +1870,73 @@ fail_stop_channel:
|
|||
return res;
|
||||
}
|
||||
|
||||
static void ipa_wigig_free_msg(void *msg, uint32_t len, uint32_t type)
|
||||
{
|
||||
IPADBG("free msg type:%d, len:%d, buff %pK", type, len, msg);
|
||||
kfree(msg);
|
||||
IPADBG("exit\n");
|
||||
}
|
||||
|
||||
int ipa_wigig_send_wlan_msg(enum ipa_wlan_event msg_type,
|
||||
const char *netdev_name, u8 *mac)
|
||||
{
|
||||
struct ipa_msg_meta msg_meta;
|
||||
struct ipa_wlan_msg *wlan_msg;
|
||||
int ret;
|
||||
|
||||
IPADBG("%d\n", msg_type);
|
||||
|
||||
wlan_msg = kzalloc(sizeof(*wlan_msg), GFP_KERNEL);
|
||||
if (wlan_msg == NULL)
|
||||
return -ENOMEM;
|
||||
strlcpy(wlan_msg->name, netdev_name, IPA_RESOURCE_NAME_MAX);
|
||||
memcpy(wlan_msg->mac_addr, mac, IPA_MAC_ADDR_SIZE);
|
||||
msg_meta.msg_len = sizeof(struct ipa_wlan_msg);
|
||||
msg_meta.msg_type = msg_type;
|
||||
|
||||
IPADBG("send msg type:%d, len:%d, buff %pK", msg_meta.msg_type,
|
||||
msg_meta.msg_len, wlan_msg);
|
||||
ret = ipa_send_msg(&msg_meta, wlan_msg, ipa_wigig_free_msg);
|
||||
|
||||
IPADBG("exit\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_send_wlan_msg);
|
||||
|
||||
int ipa_wigig_send_msg(int msg_type,
|
||||
const char *netdev_name, u8 *mac,
|
||||
enum ipa_client_type client, bool to_wigig)
|
||||
{
|
||||
struct ipa_msg_meta msg_meta;
|
||||
struct ipa_wigig_msg *wigig_msg;
|
||||
int ret;
|
||||
|
||||
IPADBG("\n");
|
||||
|
||||
wigig_msg = kzalloc(sizeof(struct ipa_wigig_msg), GFP_KERNEL);
|
||||
if (wigig_msg == NULL)
|
||||
return -ENOMEM;
|
||||
strlcpy(wigig_msg->name, netdev_name, IPA_RESOURCE_NAME_MAX);
|
||||
memcpy(wigig_msg->client_mac_addr, mac, IPA_MAC_ADDR_SIZE);
|
||||
if (msg_type == WIGIG_CLIENT_CONNECT)
|
||||
wigig_msg->u.ipa_client = client;
|
||||
else
|
||||
wigig_msg->u.to_wigig = to_wigig;
|
||||
|
||||
msg_meta.msg_type = msg_type;
|
||||
msg_meta.msg_len = sizeof(struct ipa_wigig_msg);
|
||||
|
||||
IPADBG("send msg type:%d, len:%d, buff %pK", msg_meta.msg_type,
|
||||
msg_meta.msg_len, wigig_msg);
|
||||
ret = ipa_send_msg(&msg_meta, wigig_msg, ipa_wigig_free_msg);
|
||||
|
||||
IPADBG("exit\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(ipa_wigig_send_msg);
|
||||
|
||||
#ifndef CONFIG_DEBUG_FS
|
||||
int ipa3_wigig_init_debugfs_i(struct dentry *parent) { return 0; }
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -264,9 +264,9 @@ static void ipa3_del_a7_qmap_hdr(void)
|
|||
hdl_entry = &del_hdr->hdl[0];
|
||||
hdl_entry->hdl = rmnet_ipa3_ctx->qmap_hdr_hdl;
|
||||
|
||||
ret = ipa_del_hdr(del_hdr);
|
||||
ret = ipa3_del_hdr(del_hdr);
|
||||
if (ret || hdl_entry->status)
|
||||
IPAWANERR("ipa_del_hdr failed\n");
|
||||
IPAWANERR("ipa3_del_hdr failed\n");
|
||||
else
|
||||
IPAWANDBG("hdrs deletion done\n");
|
||||
|
||||
|
|
@ -299,9 +299,9 @@ static void ipa3_del_qmap_hdr(uint32_t hdr_hdl)
|
|||
hdl_entry = &del_hdr->hdl[0];
|
||||
hdl_entry->hdl = hdr_hdl;
|
||||
|
||||
ret = ipa_del_hdr(del_hdr);
|
||||
ret = ipa3_del_hdr(del_hdr);
|
||||
if (ret || hdl_entry->status)
|
||||
IPAWANERR("ipa_del_hdr failed\n");
|
||||
IPAWANERR("ipa3_del_hdr failed\n");
|
||||
else
|
||||
IPAWANDBG("header deletion done\n");
|
||||
|
||||
|
|
@ -1500,7 +1500,7 @@ static int handle3_ingress_format(struct net_device *dev,
|
|||
in->u.ingress_format.agg_size,
|
||||
in->u.ingress_format.agg_count);
|
||||
|
||||
ret = ipa_disable_apps_wan_cons_deaggr(
|
||||
ret = ipa3_disable_apps_wan_cons_deaggr(
|
||||
in->u.ingress_format.agg_size,
|
||||
in->u.ingress_format.agg_count);
|
||||
|
||||
|
|
@ -2896,7 +2896,7 @@ static int ipa3_lcl_mdm_ssr_notifier_cb(struct notifier_block *this,
|
|||
ipa3_q6_pre_powerup_cleanup();
|
||||
}
|
||||
/* hold a proxy vote for the modem. */
|
||||
ipa_proxy_clk_vote();
|
||||
ipa3_proxy_clk_vote();
|
||||
ipa3_reset_freeze_vote();
|
||||
IPAWANINFO("IPA BEFORE_POWERUP handling is complete\n");
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,20 @@
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
static char *ipa_mhi_state_str[] = {
|
||||
__stringify(IPA_MHI_STATE_INITIALIZED),
|
||||
__stringify(IPA_MHI_STATE_READY),
|
||||
__stringify(IPA_MHI_STATE_STARTED),
|
||||
__stringify(IPA_MHI_STATE_SUSPEND_IN_PROGRESS),
|
||||
__stringify(IPA_MHI_STATE_SUSPENDED),
|
||||
__stringify(IPA_MHI_STATE_RESUME_IN_PROGRESS),
|
||||
};
|
||||
|
||||
#define MHI_STATE_STR(state) \
|
||||
(((state) >= 0 && (state) < IPA_MHI_STATE_MAX) ? \
|
||||
ipa_mhi_state_str[(state)] : \
|
||||
"INVALID")
|
||||
|
||||
/**
|
||||
* check for MSI interrupt for one or both channels:
|
||||
* OUT channel MSI my be missed as it
|
||||
|
|
@ -932,7 +946,7 @@ static int ipa_mhi_test_initialize_driver(bool skip_start_and_conn)
|
|||
IPA_UT_LOG("ch: %d base: 0x%pK phys_addr 0x%llx chstate: %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID,
|
||||
p_ch_ctx_array, phys_addr,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
|
||||
memset(&prod_params, 0, sizeof(prod_params));
|
||||
prod_params.sys.client = IPA_CLIENT_MHI_PROD;
|
||||
|
|
@ -954,7 +968,7 @@ static int ipa_mhi_test_initialize_driver(bool skip_start_and_conn)
|
|||
|
||||
if (p_ch_ctx_array->chstate != IPA_HW_MHI_CHANNEL_STATE_RUN) {
|
||||
IPA_UT_LOG("MHI_PROD: chstate is not RUN chstate:%s\n",
|
||||
ipa_mhi_get_state_str(
|
||||
MHI_STATE_STR(
|
||||
p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("PROD pipe state is not run");
|
||||
return -EFAULT;
|
||||
|
|
@ -968,7 +982,7 @@ static int ipa_mhi_test_initialize_driver(bool skip_start_and_conn)
|
|||
IPA_UT_LOG("ch: %d base: 0x%pK phys_addr 0x%llx chstate: %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID + 1,
|
||||
p_ch_ctx_array, phys_addr,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
|
||||
memset(&cons_params, 0, sizeof(cons_params));
|
||||
cons_params.sys.client = IPA_CLIENT_MHI_CONS;
|
||||
|
|
@ -986,7 +1000,7 @@ static int ipa_mhi_test_initialize_driver(bool skip_start_and_conn)
|
|||
|
||||
if (p_ch_ctx_array->chstate != IPA_HW_MHI_CHANNEL_STATE_RUN) {
|
||||
IPA_UT_LOG("MHI_CONS: chstate is not RUN chstate:%s\n",
|
||||
ipa_mhi_get_state_str(
|
||||
MHI_STATE_STR(
|
||||
p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("CONS pipe state is not run");
|
||||
return -EFAULT;
|
||||
|
|
@ -1024,7 +1038,7 @@ static int ipa_mhi_test_destroy(struct ipa_test_mhi_context *ctx)
|
|||
(phys_addr - ctx->ch_ctx_array.phys_base);
|
||||
IPA_UT_LOG("channel id %d (CONS): chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID + 1,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
|
||||
phys_addr = p_mmio->ccabap +
|
||||
((IPA_MHI_TEST_FIRST_CHANNEL_ID) *
|
||||
|
|
@ -1033,7 +1047,7 @@ static int ipa_mhi_test_destroy(struct ipa_test_mhi_context *ctx)
|
|||
(phys_addr - ctx->ch_ctx_array.phys_base);
|
||||
IPA_UT_LOG("channel id %d (PROD): chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
|
||||
IPA_UT_LOG("MHI Destroy\n");
|
||||
ipa_mhi_destroy();
|
||||
|
|
@ -1157,7 +1171,7 @@ static int ipa_mhi_test_channel_reset(void)
|
|||
if (p_ch_ctx_array->chstate != IPA_HW_MHI_CHANNEL_STATE_DISABLE) {
|
||||
IPA_UT_LOG("chstate is not disabled! ch %d chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID + 1,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("CONS pipe state is not disabled");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1198,7 +1212,7 @@ static int ipa_mhi_test_channel_reset(void)
|
|||
if (p_ch_ctx_array->chstate != IPA_HW_MHI_CHANNEL_STATE_DISABLE) {
|
||||
IPA_UT_LOG("chstate is not disabled! ch %d chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("PROD pipe state is not disabled");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1244,7 +1258,7 @@ static int ipa_mhi_test_channel_reset(void)
|
|||
if (p_ch_ctx_array->chstate != IPA_HW_MHI_CHANNEL_STATE_RUN) {
|
||||
IPA_UT_LOG("chstate is not run! ch %d chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("PROD pipe state is not run");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1269,7 +1283,7 @@ static int ipa_mhi_test_channel_reset(void)
|
|||
if (p_ch_ctx_array->chstate != IPA_HW_MHI_CHANNEL_STATE_RUN) {
|
||||
IPA_UT_LOG("chstate is not run! ch %d chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID + 1,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("CONS pipe state is not run");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1566,7 +1580,7 @@ static int ipa_mhi_test_suspend(bool force, bool should_success)
|
|||
IPA_HW_MHI_CHANNEL_STATE_SUSPEND) {
|
||||
IPA_UT_LOG("chstate is not suspend! ch %d chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID + 1,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("channel state not suspend");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1581,7 +1595,7 @@ static int ipa_mhi_test_suspend(bool force, bool should_success)
|
|||
if (p_ch_ctx_array->chstate != IPA_HW_MHI_CHANNEL_STATE_RUN) {
|
||||
IPA_UT_LOG("chstate is not running! ch %d chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID + 1,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("channel state not run");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1596,7 +1610,7 @@ static int ipa_mhi_test_suspend(bool force, bool should_success)
|
|||
IPA_HW_MHI_CHANNEL_STATE_SUSPEND) {
|
||||
IPA_UT_LOG("chstate is not suspend! ch %d chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("channel state not suspend");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1611,7 +1625,7 @@ static int ipa_mhi_test_suspend(bool force, bool should_success)
|
|||
if (p_ch_ctx_array->chstate != IPA_HW_MHI_CHANNEL_STATE_RUN) {
|
||||
IPA_UT_LOG("chstate is not running! ch %d chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("channel state not run");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1647,7 +1661,7 @@ static int ipa_test_mhi_resume(void)
|
|||
if (p_ch_ctx_array->chstate != IPA_HW_MHI_CHANNEL_STATE_RUN) {
|
||||
IPA_UT_LOG("chstate is not running! ch %d chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID + 1,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("channel state not run");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
@ -1659,7 +1673,7 @@ static int ipa_test_mhi_resume(void)
|
|||
if (p_ch_ctx_array->chstate != IPA_HW_MHI_CHANNEL_STATE_RUN) {
|
||||
IPA_UT_LOG("chstate is not running! ch %d chstate %s\n",
|
||||
IPA_MHI_TEST_FIRST_CHANNEL_ID,
|
||||
ipa_mhi_get_state_str(p_ch_ctx_array->chstate));
|
||||
MHI_STATE_STR(p_ch_ctx_array->chstate));
|
||||
IPA_UT_TEST_FAIL_REPORT("channel state not run");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue