diff --git a/drivers/platform/msm/gsi/Makefile b/drivers/platform/msm/gsi/Makefile index be6968ef9496..298c67042882 100644 --- a/drivers/platform/msm/gsi/Makefile +++ b/drivers/platform/msm/gsi/Makefile @@ -1,6 +1,9 @@ # SPDX-License-Identifier: GPL-2.0-only -gsidbg-$(CONFIG_DEBUG_FS) += gsi_dbg.o -obj-$(CONFIG_GSI) += gsi.o gsidbg.o +obj-$(CONFIG_GSI) += gsim.o -obj-$(CONFIG_IPA_EMULATION) += gsi_emulation.o +gsim-objs := gsi.o + +gsim-$(CONFIG_DEBUG_FS) += gsi_dbg.o + +gsim-$(CONFIG_IPA_EMULATION) += gsi_emulation.o diff --git a/drivers/platform/msm/gsi/gsi_dbg.c b/drivers/platform/msm/gsi/gsi_dbg.c index dd5802b45463..8d6fdd35562f 100644 --- a/drivers/platform/msm/gsi/gsi_dbg.c +++ b/drivers/platform/msm/gsi/gsi_dbg.c @@ -638,35 +638,35 @@ static ssize_t gsi_enable_ipc_low(struct file *file, return count; } -const struct file_operations gsi_ev_dump_ops = { +static const struct file_operations gsi_ev_dump_ops = { .write = gsi_dump_evt, }; -const struct file_operations gsi_ch_dump_ops = { +static const struct file_operations gsi_ch_dump_ops = { .write = gsi_dump_ch, }; -const struct file_operations gsi_stats_ops = { +static const struct file_operations gsi_stats_ops = { .write = gsi_dump_stats, }; -const struct file_operations gsi_enable_dp_stats_ops = { +static const struct file_operations gsi_enable_dp_stats_ops = { .write = gsi_enable_dp_stats, }; -const struct file_operations gsi_max_elem_dp_stats_ops = { +static const struct file_operations gsi_max_elem_dp_stats_ops = { .write = gsi_set_max_elem_dp_stats, }; -const struct file_operations gsi_rst_stats_ops = { +static const struct file_operations gsi_rst_stats_ops = { .write = gsi_rst_stats, }; -const struct file_operations gsi_print_dp_stats_ops = { +static const struct file_operations gsi_print_dp_stats_ops = { .write = gsi_print_dp_stats, }; -const struct file_operations gsi_ipc_low_ops = { +static const struct file_operations gsi_ipc_low_ops = { .write = gsi_enable_ipc_low, }; diff --git a/drivers/platform/msm/ipa/Makefile b/drivers/platform/msm/ipa/Makefile index d1c26b6bed6d..b86acfc9ecd8 100644 --- a/drivers/platform/msm/ipa/Makefile +++ b/drivers/platform/msm/ipa/Makefile @@ -1,6 +1,61 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_IPA3) += ipa_v3/ ipa_clients/ ipa_common -obj-$(CONFIG_IPA_UT) += test/ +ipam-y += \ + ipa_api.o ipa_rm.o ipa_rm_dependency_graph.o ipa_rm_peers_list.o ipa_rm_resource.o ipa_rm_inactivity_timer.o \ + ipa_v3/ipa.o \ + ipa_v3/ipa_debugfs.o \ + ipa_v3/ipa_hdr.o \ + ipa_v3/ipa_flt.o \ + ipa_v3/ipa_rt.o \ + ipa_v3/ipa_dp.o \ + ipa_v3/ipa_client.o \ + ipa_v3/ipa_utils.o \ + ipa_v3/ipa_nat.o \ + ipa_v3/ipa_intf.o \ + ipa_v3/teth_bridge.o \ + ipa_v3/ipa_interrupts.o \ + ipa_v3/ipa_uc.o \ + ipa_v3/ipa_uc_wdi.o \ + ipa_v3/ipa_dma.o \ + ipa_v3/ipa_uc_mhi.o \ + ipa_v3/ipa_mhi.o \ + ipa_v3/ipa_uc_ntn.o \ + ipa_v3/ipa_hw_stats.o \ + ipa_v3/ipa_pm.o \ + ipa_v3/ipa_wdi3_i.o \ + ipa_v3/ipa_odl.o \ + ipa_v3/ipa_wigig_i.o \ + ipa_v3/ipahal/ipahal.o \ + ipa_v3/ipahal/ipahal_reg.o \ + 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 -ipa_common += ipa_api.o ipa_rm.o ipa_rm_dependency_graph.o ipa_rm_peers_list.o ipa_rm_resource.o ipa_rm_inactivity_timer.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_ipa_fd_ioctl.o + +ipam-$(CONFIG_IPA3_MHI_PROXY) += ipa_v3/ipa_mhi_proxy.o +ipam-$(CONFIG_IPA_EMULATION) += ipa_v3/ipa_dt_replacement.o +ipam-$(CONFIG_IPA3_REGDUMP) += ipa_v3/dump/ipa_reg_dump.o + +ipam-$(CONFIG_IPA_UT) += test/ipa_ut_framework.o test/ipa_test_example.o \ + test/ipa_test_mhi.o test/ipa_test_dma.o \ + test/ipa_test_hw_stats.o test/ipa_pm_ut.o \ + test/ipa_test_wdi3.o + +obj-$(CONFIG_IPA3) += ipam.o + +obj-y += ipa_v3/ ipa_clients/ + +ccflags-$(CONFIG_IPA3) += -Idrivers/platform/msm/ipa/ipa_v3 +ccflags-$(CONFIG_IPA3) += -Idrivers/platform/msm/ipa/ipa_v3/ipahal +ccflags-$(CONFIG_IPA3) += -Idrivers/platform/msm/ipa/ipa_clients +ccflags-$(CONFIG_IPA3_REGDUMP) += -Idrivers/platform/msm/ipa/ipa_v3/dump +ccflags-$(CONFIG_IPA3_REGDUMP_IPA_4_5) += -Idrivers/platform/msm/ipa/ipa_v3/dump/ipa4.5 diff --git a/drivers/platform/msm/ipa/ipa_api.c b/drivers/platform/msm/ipa/ipa_api.c index 2d38c8aba77b..8d0afd450bd6 100644 --- a/drivers/platform/msm/ipa/ipa_api.c +++ b/drivers/platform/msm/ipa/ipa_api.c @@ -372,6 +372,7 @@ int ipa_smmu_store_sgt(struct sg_table **out_ch_ptr, } return 0; } +EXPORT_SYMBOL(ipa_smmu_store_sgt); int ipa_smmu_free_sgt(struct sg_table **out_sgt_ptr) { @@ -383,6 +384,7 @@ int ipa_smmu_free_sgt(struct sg_table **out_sgt_ptr) } return 0; } +EXPORT_SYMBOL(ipa_smmu_free_sgt); /** * ipa_clear_endpoint_delay() - Clear ep_delay. @@ -3406,6 +3408,7 @@ void ipa_assert(void) pr_err("IPA: unrecoverable error has occurred, asserting\n"); BUG(); } +EXPORT_SYMBOL(ipa_assert); /** * ipa_rx_poll() - Poll the rx packets from IPA HW in the @@ -3694,12 +3697,14 @@ void ipa_register_client_callback(int (*client_cb)(bool is_lock), IPA_API_DISPATCH(ipa_register_client_callback, client_cb, teth_port_state, client); } +EXPORT_SYMBOL(ipa_register_client_callback); void ipa_deregister_client_callback(enum ipa_client_type client) { IPA_API_DISPATCH(ipa_deregister_client_callback, client); } +EXPORT_SYMBOL(ipa_deregister_client_callback); static const struct dev_pm_ops ipa_pm_ops = { @@ -3757,16 +3762,11 @@ static int ipa_pci_probe( if (result && result != -EPROBE_DEFER) pr_err("ipa: ipa3_pci_drv_probe failed\n"); - if (running_emulation) - ipa_ut_module_init(); - return result; } static void ipa_pci_remove(struct pci_dev *pci_dev) { - if (running_emulation) - ipa_ut_module_exit(); } static void ipa_pci_shutdown(struct pci_dev *pci_dev) @@ -3801,5 +3801,14 @@ static int __init ipa_module_init(void) } subsys_initcall(ipa_module_init); +static void __exit ipa_module_exit(void) +{ + if (running_emulation) + pci_unregister_driver(&ipa_pci_driver); + platform_driver_unregister(&ipa_plat_drv); +} +module_exit(ipa_module_exit); + + MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("IPA HW device driver"); diff --git a/drivers/platform/msm/ipa/ipa_api.h b/drivers/platform/msm/ipa/ipa_api.h index 113cedfe72b8..6bd6bdd0f4e3 100644 --- a/drivers/platform/msm/ipa/ipa_api.h +++ b/drivers/platform/msm/ipa/ipa_api.h @@ -474,7 +474,8 @@ struct ipa_api_controller { }; -#ifdef CONFIG_IPA3 +#if IS_ENABLED(CONFIG_IPA3) + int ipa3_plat_drv_probe(struct platform_device *pdev_p, struct ipa_api_controller *api_ctrl, const struct of_device_id *pdrv_match); @@ -482,7 +483,9 @@ int ipa3_pci_drv_probe( struct pci_dev *pci_dev, struct ipa_api_controller *api_ctrl, const struct of_device_id *pdrv_match); -#else + +#else /* IS_ENABLED(CONFIG_IPA3) */ + static inline int ipa3_plat_drv_probe(struct platform_device *pdev_p, struct ipa_api_controller *api_ctrl, const struct of_device_id *pdrv_match) @@ -496,6 +499,7 @@ static inline int ipa3_pci_drv_probe( { return -ENODEV; } -#endif /* (CONFIG_IPA3) */ + +#endif /* IS_ENABLED(CONFIG_IPA3) */ #endif /* _IPA_API_H_ */ diff --git a/drivers/platform/msm/ipa/ipa_clients/Makefile b/drivers/platform/msm/ipa/ipa_clients/Makefile index 537d46881f62..47ae2d3c9408 100644 --- a/drivers/platform/msm/ipa/ipa_clients/Makefile +++ b/drivers/platform/msm/ipa/ipa_clients/Makefile @@ -1,6 +1,10 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_IPA3) += ipa_usb.o odu_bridge.o ipa_mhi_client.o ipa_uc_offload.o ipa_wdi3.o ipa_gsb.o ipa_wigig.o -obj-$(CONFIG_IPA) += odu_bridge.o ipa_mhi_client.o ipa_uc_offload.o ipa_wdi3.o -obj-$(CONFIG_ECM_IPA) += ecm_ipa.o -obj-$(CONFIG_RNDIS_IPA) += rndis_ipa.o +obj-$(CONFIG_IPA_USB) += ipausbm.o +ipausbm-objs := ipa_usb.o + +obj-$(CONFIG_RNDIS_IPA) += rndisipam.o +rndisipam-objs := rndis_ipa.o + +obj-$(CONFIG_ECM_IPA) += ecmipam.o +ecmipam-objs := ecm_ipa.o diff --git a/drivers/platform/msm/ipa/ipa_clients/ecm_ipa.c b/drivers/platform/msm/ipa/ipa_clients/ecm_ipa.c index ffd4a9b7f6bc..e2c78477d2fa 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ecm_ipa.c +++ b/drivers/platform/msm/ipa/ipa_clients/ecm_ipa.c @@ -213,7 +213,7 @@ static const struct net_device_ops ecm_ipa_netdev_ops = { .ndo_get_stats = ecm_ipa_get_stats, }; -const struct file_operations ecm_ipa_debugfs_atomic_ops = { +static const struct file_operations ecm_ipa_debugfs_atomic_ops = { .open = ecm_ipa_debugfs_atomic_open, .read = ecm_ipa_debugfs_atomic_read, }; @@ -1455,9 +1455,10 @@ static const char *ecm_ipa_state_string(enum ecm_ipa_state state) * ecm_ipa_init_module() - module initialization * */ -static int ecm_ipa_init_module(void) +static int __init ecm_ipa_init_module(void) { ECM_IPA_LOG_ENTRY(); + pr_info("ecm driver init\n"); ipa_ecm_logbuf = ipc_log_context_create(IPA_ECM_IPC_LOG_PAGES, "ipa_ecm", 0); if (ipa_ecm_logbuf == NULL) @@ -1470,7 +1471,7 @@ static int ecm_ipa_init_module(void) * ecm_ipa_cleanup_module() - module cleanup * */ -static void ecm_ipa_cleanup_module(void) +static void __exit ecm_ipa_cleanup_module(void) { ECM_IPA_LOG_ENTRY(); if (ipa_ecm_logbuf) diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c b/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c index c8f514a492fb..5c1522819343 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_gsb.c @@ -20,9 +20,7 @@ #include #include #include "../ipa_common_i.h" -#ifdef CONFIG_IPA3 #include "../ipa_v3/ipa_pm.h" -#endif #define IPA_GSB_DRV_NAME "ipa_gsb" diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c b/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c index 134cc626cf06..9bf586f59d36 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c @@ -2478,6 +2478,7 @@ int ipa_mhi_handle_ipa_config_req(struct ipa_config_req_msg_v01 *config_req) IPA_MHI_FUNC_EXIT(); return 0; } +EXPORT_SYMBOL(ipa_mhi_handle_ipa_config_req); int ipa_mhi_is_using_dma(bool *flag) { diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c b/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c index 24535a2a31d7..846364fca944 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c @@ -220,7 +220,7 @@ static DECLARE_WORK(ipa3_usb_notify_remote_wakeup_work, static DECLARE_WORK(ipa3_usb_dpl_notify_remote_wakeup_work, ipa3_usb_wq_dpl_notify_remote_wakeup); -struct ipa3_usb_context *ipa3_usb_ctx; +static struct ipa3_usb_context *ipa3_usb_ctx; static char *ipa3_usb_op_to_string(enum ipa3_usb_op op) { @@ -492,7 +492,7 @@ static void ipa3_usb_notify_do(enum ipa3_usb_transport_type ttype, * This call-back is called from ECM or RNDIS drivers. * Both drivers are data tethering drivers and not DPL */ -void ipa3_usb_device_ready_notify_cb(void) +static void ipa3_usb_device_ready_notify_cb(void) { IPA_USB_DBG_LOW("entry\n"); ipa3_usb_notify_do(IPA_USB_TRANSPORT_TETH, @@ -681,7 +681,7 @@ static bool ipa3_usb_is_teth_switch_valid(enum ipa_usb_teth_prot new_teth) if (IPA3_USB_IS_TTYPE_DPL(IPA3_USB_GET_TTYPE(new_teth))) return true; - if (ipa3_ctx->ipa_hw_type != IPA_HW_v4_5) + if (ipa_get_hw_type() != IPA_HW_v4_5) return true; ipa_r_rev = ipa3_get_r_rev_version(); @@ -869,7 +869,7 @@ int ipa_usb_init_teth_prot(enum ipa_usb_teth_prot teth_prot, * If needed we can include the same for IPA_PROD ep. * For IPA_USB_DIAG/DPL config there will not be any UL ep. */ - ipa3_register_client_callback(&ipa_usb_set_lock_unlock, + ipa_register_client_callback(&ipa_usb_set_lock_unlock, &ipa3_usb_get_teth_port_state, IPA_CLIENT_USB_PROD); break; case IPA_USB_DIAG: @@ -908,7 +908,7 @@ bad_params: } EXPORT_SYMBOL(ipa_usb_init_teth_prot); -void ipa3_usb_gsi_evt_err_cb(struct gsi_evt_err_notify *notify) +static void ipa3_usb_gsi_evt_err_cb(struct gsi_evt_err_notify *notify) { IPA_USB_DBG_LOW("entry\n"); if (!notify) @@ -918,7 +918,7 @@ void ipa3_usb_gsi_evt_err_cb(struct gsi_evt_err_notify *notify) IPA_USB_DBG_LOW("exit\n"); } -void ipa3_usb_gsi_chan_err_cb(struct gsi_chan_err_notify *notify) +static void ipa3_usb_gsi_chan_err_cb(struct gsi_chan_err_notify *notify) { IPA_USB_DBG_LOW("entry\n"); if (!notify) @@ -1188,7 +1188,7 @@ static int ipa3_usb_request_xdci_channel( chan_params.chan_params.ring_base_addr = params->xfer_ring_base_addr_iova; chan_params.chan_params.ring_base_vaddr = NULL; - if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) + if (ipa_get_hw_type() >= IPA_HW_v4_0) chan_params.chan_params.use_db_eng = GSI_CHAN_DIRECT_MODE; else chan_params.chan_params.use_db_eng = GSI_CHAN_DB_MODE; @@ -1220,7 +1220,7 @@ static int ipa3_usb_request_xdci_channel( * At IPA 4.0/4.1/4.2, we do not use MCS smart prefetch * so keep the fields zero. */ - if (ipa3_ctx->ipa_hw_type < IPA_HW_v4_0) { + if (ipa_get_hw_type() < IPA_HW_v4_0) { chan_params.chan_scratch.xdci.outstanding_threshold = ((params->teth_prot == IPA_USB_MBIM) ? 1 : 2) * chan_params.chan_params.re_size; @@ -1330,7 +1330,6 @@ static int ipa3_usb_connect_teth_bridge( return 0; } - static int ipa3_usb_connect_teth_prot(enum ipa_usb_teth_prot teth_prot) { int result; @@ -1782,7 +1781,7 @@ static ssize_t ipa3_read_usb_state_info(struct file *file, char __user *ubuf, return simple_read_from_buffer(ubuf, count, ppos, dbg_buff, cnt); } -const struct file_operations ipa3_ipa_usb_ops = { +static const struct file_operations ipa3_ipa_usb_ops = { .read = ipa3_read_usb_state_info, }; @@ -2043,7 +2042,7 @@ int ipa_usb_xdci_disconnect(u32 ul_clnt_hdl, u32 dl_clnt_hdl, memset(&holb_cfg, 0, sizeof(holb_cfg)); holb_cfg.en = IPA_HOLB_TMR_EN; holb_cfg.tmr_val = 0; - ipa3_cfg_ep_holb(dl_clnt_hdl, &holb_cfg); + ipa_cfg_ep_holb(dl_clnt_hdl, &holb_cfg); } spin_lock_irqsave(&ipa3_usb_ctx->state_lock, flags); @@ -2562,7 +2561,7 @@ static int __init ipa3_usb_init(void) int res; struct ipa3_usb_pm_context *pm_ctx; - pr_debug("entry\n"); + pr_info("ipa_usb driver init\n"); ipa3_usb_ctx = kzalloc(sizeof(struct ipa3_usb_context), GFP_KERNEL); if (ipa3_usb_ctx == NULL) { pr_err(":ipa_usb init failed\n"); @@ -2626,59 +2625,12 @@ static void ipa3_usb_exit(void) * If needed we can include the same for IPA_PROD ep. * For IPA_USB_DIAG/DPL config there will not be any UL config. */ - ipa3_deregister_client_callback(IPA_CLIENT_USB_PROD); + ipa_deregister_client_callback(IPA_CLIENT_USB_PROD); ipa_usb_debugfs_remove(); kfree(ipa3_usb_ctx); } -/** - * ipa3_get_usb_gsi_stats() - Query USB gsi stats from uc - * @stats: [inout] stats blob from client populated by driver - * - * Returns: 0 on success, negative on failure - * - * @note Cannot be called from atomic context - * - */ -int ipa3_get_usb_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats) -{ - int i; - - if (!ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio) { - IPAERR("bad parms NULL usb_gsi_stats_mmio\n"); - return -EINVAL; - } - IPA_ACTIVE_CLIENTS_INC_SIMPLE(); - for (i = 0; i < MAX_USB_CHANNELS; i++) { - stats->ring[i].ringFull = ioread32( - ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio - + i * IPA3_UC_DEBUG_STATS_OFF + - IPA3_UC_DEBUG_STATS_RINGFULL_OFF); - stats->ring[i].ringEmpty = ioread32( - ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio - + i * IPA3_UC_DEBUG_STATS_OFF + - IPA3_UC_DEBUG_STATS_RINGEMPTY_OFF); - stats->ring[i].ringUsageHigh = ioread32( - ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio - + i * IPA3_UC_DEBUG_STATS_OFF + - IPA3_UC_DEBUG_STATS_RINGUSAGEHIGH_OFF); - stats->ring[i].ringUsageLow = ioread32( - ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio - + i * IPA3_UC_DEBUG_STATS_OFF + - IPA3_UC_DEBUG_STATS_RINGUSAGELOW_OFF); - stats->ring[i].RingUtilCount = ioread32( - ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio - + i * IPA3_UC_DEBUG_STATS_OFF + - IPA3_UC_DEBUG_STATS_RINGUTILCOUNT_OFF); - } - IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); - - - return 0; -} - - arch_initcall(ipa3_usb_init); module_exit(ipa3_usb_exit); diff --git a/drivers/platform/msm/ipa/ipa_clients/rndis_ipa.c b/drivers/platform/msm/ipa/ipa_clients/rndis_ipa.c index 5f37a77a3740..9d43f9230233 100644 --- a/drivers/platform/msm/ipa/ipa_clients/rndis_ipa.c +++ b/drivers/platform/msm/ipa/ipa_clients/rndis_ipa.c @@ -287,10 +287,8 @@ static enum rndis_ipa_state rndis_ipa_next_state (enum rndis_ipa_state current_state, enum rndis_ipa_operation operation); static const char *rndis_ipa_state_string(enum rndis_ipa_state state); -static int rndis_ipa_init_module(void); -static void rndis_ipa_cleanup_module(void); -struct rndis_ipa_dev *rndis_ipa; +static struct rndis_ipa_dev *rndis_ipa; static const struct net_device_ops rndis_ipa_netdev_ops = { .ndo_open = rndis_ipa_open, @@ -301,12 +299,12 @@ static const struct net_device_ops rndis_ipa_netdev_ops = { .ndo_set_mac_address = eth_mac_addr, }; -const struct file_operations rndis_ipa_debugfs_atomic_ops = { +static const struct file_operations rndis_ipa_debugfs_atomic_ops = { .open = rndis_ipa_debugfs_atomic_open, .read = rndis_ipa_debugfs_atomic_read, }; -const struct file_operations rndis_ipa_aggr_ops = { +static const struct file_operations rndis_ipa_aggr_ops = { .open = rndis_ipa_debugfs_aggr_open, .write = rndis_ipa_debugfs_aggr_write, }; @@ -458,7 +456,7 @@ static struct ipa_ep_cfg usb_to_ipa_ep_cfg_deaggr_en = { * @data_len: set as skb length to get final size * @zeroes: make sure all OOB data is not used */ -struct rndis_pkt_hdr rndis_template_hdr = { +static struct rndis_pkt_hdr rndis_template_hdr = { .msg_type = RNDIS_IPA_PKT_TYPE, .msg_len = sizeof(struct rndis_pkt_hdr), .data_ofst = sizeof(struct rndis_pkt_hdr) - RNDIS_HDR_OFST(data_ofst), @@ -1753,8 +1751,6 @@ static int rndis_ipa_deregister_properties(char *netdev_name) return 0; } - - static void rndis_ipa_pm_cb(void *p, enum ipa_pm_cb_event event) { struct rndis_ipa_dev *rndis_ipa_ctx = p; @@ -1778,7 +1774,6 @@ static void rndis_ipa_pm_cb(void *p, enum ipa_pm_cb_event event) RNDIS_IPA_LOG_EXIT(); } - static int rndis_ipa_register_pm_client(struct rndis_ipa_dev *rndis_ipa_ctx) { int result; @@ -2418,18 +2413,18 @@ static ssize_t rndis_ipa_debugfs_atomic_read return simple_read_from_buffer(ubuf, count, ppos, atomic_str, nbytes); } -static int rndis_ipa_init_module(void) +static int __init rndis_ipa_init_module(void) { ipa_rndis_logbuf = ipc_log_context_create(IPA_RNDIS_IPC_LOG_PAGES, "ipa_rndis", 0); if (ipa_rndis_logbuf == NULL) - RNDIS_IPA_DEBUG("failed to create IPC log, continue...\n"); + RNDIS_IPA_ERROR("failed to create IPC log, continue...\n"); pr_info("RNDIS_IPA module is loaded.\n"); return 0; } -static void rndis_ipa_cleanup_module(void) +static void __exit rndis_ipa_cleanup_module(void) { if (ipa_rndis_logbuf) ipc_log_context_destroy(ipa_rndis_logbuf); diff --git a/drivers/platform/msm/ipa/ipa_common_i.h b/drivers/platform/msm/ipa/ipa_common_i.h index 88e361997697..3dc4305dc8e6 100644 --- a/drivers/platform/msm/ipa/ipa_common_i.h +++ b/drivers/platform/msm/ipa/ipa_common_i.h @@ -432,8 +432,18 @@ int ipa_smmu_store_sgt(struct sg_table **out_ch_ptr, struct sg_table *in_sgt_ptr); int ipa_smmu_free_sgt(struct sg_table **out_sgt_ptr); +#ifdef CONFIG_IPA_UT int ipa_ut_module_init(void); void ipa_ut_module_exit(void); +#else +static inline int ipa_ut_module_init(void) +{ + return -EPERM; +} +static inline void ipa_ut_module_exit(void) +{ +} +#endif int ipa_wigig_internal_init( struct ipa_wdi_uc_ready_params *inout, diff --git a/drivers/platform/msm/ipa/ipa_v3/Makefile b/drivers/platform/msm/ipa/ipa_v3/Makefile index 3fbd67327ff4..4f4fa06fa615 100644 --- a/drivers/platform/msm/ipa/ipa_v3/Makefile +++ b/drivers/platform/msm/ipa/ipa_v3/Makefile @@ -1,23 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_IPA3) += ipahal/ - -obj-$(CONFIG_IPA3) += ipat.o -ipat-y := ipa.o ipa_debugfs.o ipa_hdr.o ipa_flt.o ipa_rt.o ipa_dp.o ipa_client.o \ - ipa_utils.o ipa_nat.o ipa_intf.o teth_bridge.o ipa_interrupts.o \ - ipa_uc.o ipa_uc_wdi.o ipa_dma.o ipa_uc_mhi.o ipa_mhi.o ipa_uc_ntn.o \ - ipa_hw_stats.o ipa_pm.o ipa_wdi3_i.o ipa_odl.o ipa_wigig_i.o - -ipat-$(CONFIG_IPA_EMULATION) += ipa_dt_replacement.o - -obj-$(CONFIG_RMNET_IPA3) += rmnet_ipa.o ipa_qmi_service_v01.o ipa_qmi_service.o rmnet_ipa_fd_ioctl.o - -obj-$(CONFIG_IPA3_MHI_PROXY) += ipa_mhi_proxy.o - -obj-$(CONFIG_IPA3_MHI_PRIME_MANAGER) += ipa_mpm.o - -ipat-$(CONFIG_IPA3_REGDUMP) += dump/ipa_reg_dump.o - -ccflags-$(CONFIG_IPA3_REGDUMP) += -Idrivers/platform/msm/ipa/ipa_v3/dump - -ccflags-$(CONFIG_IPA3_REGDUMP_IPA_4_5) += -Idrivers/platform/msm/ipa/ipa_v3/dump/ipa4.5 +obj-$(CONFIG_IPA3_MHI_PRIME_MANAGER) += ipampmm.o +ipampmm-objs := ipa_mpm.o diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c index 575b537251c0..4573b98be123 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c @@ -5967,6 +5967,9 @@ static int ipa3_post_init(const struct ipa3_plat_drv_res *resource_p, ipa3_enable_napi_lan_rx(); ipa3_trigger_ipa_ready_cbs(); complete_all(&ipa3_ctx->init_completion_obj); + + ipa_ut_module_init(); + pr_info("IPA driver initialization was successful.\n"); return 0; @@ -6897,7 +6900,10 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, /* Create the dummy netdev for LAN RX NAPI*/ ipa3_enable_napi_netdev(); + ipa3_wwan_init(); + return 0; + fail_cdev_add: fail_gsi_pre_fw_load_init: ipa3_dma_shutdown(); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_client.c b/drivers/platform/msm/ipa/ipa_v3/ipa_client.c index 605cdb5b8228..6d1b43e3dfd7 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_client.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_client.c @@ -203,6 +203,7 @@ reset_chan_fail: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; } +EXPORT_SYMBOL(ipa3_reset_gsi_channel); int ipa3_reset_gsi_event_ring(u32 clnt_hdl) { @@ -240,6 +241,7 @@ reset_evt_fail: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; } +EXPORT_SYMBOL(ipa3_reset_gsi_event_ring); static bool ipa3_is_legal_params(struct ipa_request_gsi_channel_params *params) { @@ -351,6 +353,7 @@ int ipa3_smmu_map_peer_reg(phys_addr_t phys_addr, bool map, return 0; } +EXPORT_SYMBOL(ipa3_smmu_map_peer_reg); int ipa3_smmu_map_peer_buff(u64 iova, u32 size, bool map, struct sg_table *sgt, enum ipa_smmu_cb_type cb_type) @@ -430,6 +433,7 @@ int ipa3_smmu_map_peer_buff(u64 iova, u32 size, bool map, struct sg_table *sgt, IPADBG("Peer buff %s 0x%llx\n", map ? "map" : "unmap", iova); return 0; } +EXPORT_SYMBOL(ipa3_smmu_map_peer_buff); static enum ipa_client_cb_type ipa_get_client_cb_type( enum ipa_client_type client_type) @@ -696,6 +700,7 @@ ipa_cfg_ep_fail: fail: return result; } +EXPORT_SYMBOL(ipa3_request_gsi_channel); int ipa3_set_usb_max_packet_size( enum ipa_usb_max_usb_packet_size usb_max_packet_size) @@ -723,6 +728,53 @@ int ipa3_set_usb_max_packet_size( IPADBG("exit\n"); return 0; } +EXPORT_SYMBOL(ipa3_set_usb_max_packet_size); + +/** + * ipa3_get_usb_gsi_stats() - Query USB gsi stats from uc + * @stats: [inout] stats blob from client populated by driver + * + * Returns: 0 on success, negative on failure + * + * @note Cannot be called from atomic context + * + */ +int ipa3_get_usb_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats) +{ + int i; + + if (!ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio) { + IPAERR("bad parms NULL usb_gsi_stats_mmio\n"); + return -EINVAL; + } + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); + for (i = 0; i < MAX_USB_CHANNELS; i++) { + stats->ring[i].ringFull = ioread32( + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGFULL_OFF); + stats->ring[i].ringEmpty = ioread32( + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGEMPTY_OFF); + stats->ring[i].ringUsageHigh = ioread32( + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGUSAGEHIGH_OFF); + stats->ring[i].ringUsageLow = ioread32( + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGUSAGELOW_OFF); + stats->ring[i].RingUtilCount = ioread32( + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGUTILCOUNT_OFF); + } + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); + + + return 0; +} /* This function called as part of usb pipe resume */ int ipa3_xdci_connect(u32 clnt_hdl) @@ -763,7 +815,7 @@ exit: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; } - +EXPORT_SYMBOL(ipa3_xdci_connect); /* This function called as part of usb pipe connect */ int ipa3_xdci_start(u32 clnt_hdl, u8 xferrscidx, bool xferrscidx_valid) @@ -825,6 +877,7 @@ write_chan_scratch_fail: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; } +EXPORT_SYMBOL(ipa3_xdci_start); int ipa3_get_gsi_chan_info(struct gsi_chan_info *gsi_chan_info, unsigned long chan_hdl) @@ -1348,6 +1401,7 @@ void ipa3_xdci_ep_delay_rm(u32 clnt_hdl) } } } +EXPORT_SYMBOL(ipa3_xdci_ep_delay_rm); int ipa3_xdci_disconnect(u32 clnt_hdl, bool should_force_clear, u32 qmi_req_id) { @@ -1402,6 +1456,7 @@ stop_chan_fail: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; } +EXPORT_SYMBOL(ipa3_xdci_disconnect); int ipa3_release_gsi_channel(u32 clnt_hdl) { @@ -1449,6 +1504,7 @@ dealloc_chan_fail: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; } +EXPORT_SYMBOL(ipa3_release_gsi_channel); int ipa3_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl, bool should_force_clear, u32 qmi_req_id, bool is_dpl) @@ -1589,6 +1645,7 @@ disable_clk_and_exit: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(dl_clnt_hdl)); return result; } +EXPORT_SYMBOL(ipa3_xdci_suspend); int ipa3_start_gsi_channel(u32 clnt_hdl) { @@ -1627,6 +1684,7 @@ start_chan_fail: IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); return result; } +EXPORT_SYMBOL(ipa3_start_gsi_channel); int ipa3_xdci_resume(u32 ul_clnt_hdl, u32 dl_clnt_hdl, bool is_dpl) { @@ -1677,6 +1735,8 @@ int ipa3_xdci_resume(u32 ul_clnt_hdl, u32 dl_clnt_hdl, bool is_dpl) IPADBG("exit\n"); return 0; } +EXPORT_SYMBOL(ipa3_xdci_resume); + /** * ipa3_clear_endpoint_delay() - Remove ep delay set on the IPA pipe before * client disconnect. diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h index 83456f22e1b8..a237d81cd09c 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h @@ -3054,9 +3054,11 @@ void ipa_eth_exit(void); static inline int ipa_eth_init(void) { return 0; } static inline void ipa_eth_exit(void) { } #endif // CONFIG_IPA_ETH + int ipa3_get_gsi_chan_info(struct gsi_chan_info *gsi_chan_info, unsigned long chan_hdl); -#ifdef CONFIG_IPA3_MHI_PRIME_MANAGER + +#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); int ipa_mpm_notify_wan_state(struct wan_ioctl_notify_wan_state *state); @@ -3066,7 +3068,7 @@ int ipa_mpm_reset_dma_mode(enum ipa_client_type src_pipe, int ipa_mpm_panic_handler(char *buf, int size); int ipa3_get_mhip_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats); int ipa3_mpm_enable_adpl_over_odl(bool enable); -#else +#else /* IS_ENABLED(CONFIG_IPA3_MHI_PRIME_MANAGER) */ static inline int ipa_mpm_mhip_xdci_pipe_enable( enum ipa_usb_teth_prot prot) { @@ -3105,8 +3107,7 @@ static inline int ipa3_mpm_enable_adpl_over_odl(bool enable) { return 0; } - -#endif /* CONFIG_IPA3_MHI_PRIME_MANAGER */ +#endif /* IS_ENABLED(CONFIG_IPA3_MHI_PRIME_MANAGER) */ static inline void *alloc_and_init(u32 size, u32 init_val) { diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c b/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c index 91ec580e9f19..116a685efe20 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c @@ -2970,6 +2970,12 @@ static int __init ipa_mpm_init(void) return platform_driver_register(&ipa_ipa_mpm_driver); } +static void __exit ipa_mpm_exit(void) +{ + IPA_MPM_DBG("unregister ipa_mpm platform device\n"); + platform_driver_unregister(&ipa_ipa_mpm_driver); +} + /** * ipa3_is_mhip_offload_enabled() - check if IPA MPM module was initialized * successfully. If it is initialized, MHIP is enabled for teth @@ -3137,5 +3143,6 @@ int ipa3_mpm_enable_adpl_over_odl(bool enable) } late_initcall(ipa_mpm_init); +module_exit(ipa_mpm_exit); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("MHI Proxy Manager Driver"); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c b/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c index 38b32cfad3cd..ab71f7fae654 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c @@ -774,6 +774,7 @@ int ipa_pm_register(struct ipa_pm_register_params *params, u32 *hdl) IPA_PM_DBG("IPA PM client registered with handle %d\n", *hdl); return 0; } +EXPORT_SYMBOL(ipa_pm_register); /** * ipa_pm_deregister() - deregister IPA client from the PM @@ -836,6 +837,7 @@ int ipa_pm_deregister(u32 hdl) return 0; } +EXPORT_SYMBOL(ipa_pm_deregister); /** * ipa_pm_associate_ipa_cons_to_client() - add mapping to pipe with ipa cllent @@ -890,6 +892,7 @@ int ipa_pm_associate_ipa_cons_to_client(u32 hdl, enum ipa_client_type consumer) return 0; } +EXPORT_SYMBOL(ipa_pm_associate_ipa_cons_to_client); static int ipa_pm_activate_helper(struct ipa_pm_client *client, bool sync) { @@ -987,6 +990,7 @@ int ipa_pm_activate(u32 hdl) return ipa_pm_activate_helper(ipa_pm_ctx->clients[hdl], false); } +EXPORT_SYMBOL(ipa_pm_activate); /** * ipa_pm_activate(): activate ipa client to vote for clock synchronously. @@ -1009,6 +1013,7 @@ int ipa_pm_activate_sync(u32 hdl) return ipa_pm_activate_helper(ipa_pm_ctx->clients[hdl], true); } +EXPORT_SYMBOL(ipa_pm_activate_sync); /** * ipa_pm_deferred_deactivate(): schedule a timer to deactivate client and @@ -1071,6 +1076,7 @@ int ipa_pm_deferred_deactivate(u32 hdl) return 0; } +EXPORT_SYMBOL(ipa_pm_deferred_deactivate); /** * ipa_pm_deactivate_all_deferred(): Cancel the deferred deactivation timer and @@ -1190,6 +1196,7 @@ int ipa_pm_deactivate_sync(u32 hdl) return 0; } +EXPORT_SYMBOL(ipa_pm_deactivate_sync); /** * ipa_pm_handle_suspend(): calls the callbacks of suspended clients to wake up @@ -1288,6 +1295,7 @@ int ipa_pm_set_throughput(u32 hdl, int throughput) return 0; } +EXPORT_SYMBOL(ipa_pm_set_throughput); void ipa_pm_set_clock_index(int index) { diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_pm.h b/drivers/platform/msm/ipa/ipa_v3/ipa_pm.h index 044330b1760c..2468a330acba 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_pm.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_pm.h @@ -82,7 +82,7 @@ struct ipa_pm_register_params { bool skip_clk_vote; }; -#ifdef CONFIG_IPA3 +#if IS_ENABLED(CONFIG_IPA3) int ipa_pm_register(struct ipa_pm_register_params *params, u32 *hdl); int ipa_pm_associate_ipa_cons_to_client(u32 hdl, enum ipa_client_type consumer); @@ -102,7 +102,7 @@ int ipa_pm_stat(char *buf, int size); int ipa_pm_exceptions_stat(char *buf, int size); void ipa_pm_set_clock_index(int index); -#else +#else /* IS_ENABLED(CONFIG_IPA3) */ static inline int ipa_pm_register( struct ipa_pm_register_params *params, u32 *hdl) @@ -176,6 +176,6 @@ static inline int ipa_pm_exceptions_stat(char *buf, int size) { return -EPERM; } -#endif +#endif /* IS_ENABLED(CONFIG_IPA3) */ #endif /* _IPA_PM_H_ */ diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c index 3d6cf9de9614..b84976b27daa 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c @@ -545,7 +545,7 @@ static int ipa3_qmi_init_modem_send_sync_msg(void) } else { req.ctrl_comm_dest_end_pt_valid = true; req.ctrl_comm_dest_end_pt = - ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS); + ipa_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS); } req.hdr_proc_ctx_tbl_info_valid = @@ -1718,7 +1718,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 = - ipa3_get_modem_cfg_emb_pipe_flt(); + ipa_get_modem_cfg_emb_pipe_flt(); ipa3_qmi_ctx->num_ipa_offload_connection = 0; ipa3_svc_handle = vzalloc(sizeof(*ipa3_svc_handle)); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.h b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.h index 8a102cf88a6d..030845aff832 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.h @@ -228,7 +228,7 @@ struct ipa3_rmnet_context { extern struct ipa3_rmnet_context ipa3_rmnet_ctx; -#ifdef CONFIG_RMNET_IPA3 +#if IS_ENABLED(CONFIG_RMNET_IPA3) int ipa3_qmi_service_init(uint32_t wan_platform_type); @@ -266,8 +266,6 @@ int ipa3_qmi_disable_force_clear_datapath_send( int ipa3_copy_ul_filter_rule_to_ipa(struct ipa_install_fltr_rule_req_msg_v01 *rule_req); -int ipa3_wwan_update_mux_channel_prop(void); - int ipa3_wan_ioctl_init(void); void ipa3_wan_ioctl_stop_qmi_messages(void); @@ -345,7 +343,11 @@ void ipa3_qmi_init(void); void ipa3_qmi_cleanup(void); -#else /* CONFIG_RMNET_IPA3 */ +int ipa3_wwan_init(void); + +void ipa3_wwan_cleanup(void); + +#else /* IS_ENABLED(CONFIG_RMNET_IPA3) */ static inline int ipa3_qmi_service_init(uint32_t wan_platform_type) { @@ -368,7 +370,7 @@ static inline int ipa3_qmi_add_offload_request_send( } static inline int ipa3_qmi_rmv_offload_request_send( - struct ipa_rmv_offload_connection_req_msg_v01 *req) + struct ipa_remove_offload_connection_req_msg_v01 *req) { return -EPERM; } @@ -410,11 +412,6 @@ static inline int ipa3_copy_ul_filter_rule_to_ipa( return -EPERM; } -static inline int ipa3_wwan_update_mux_channel_prop(void) -{ - return -EPERM; -} - static inline int ipa3_wan_ioctl_init(void) { return -EPERM; @@ -481,7 +478,7 @@ static inline int ipa3_qmi_send_mhi_ready_indication( return -EPERM; } -static int ipa3_qmi_send_rsc_pipe_indication( +static inline int ipa3_qmi_send_rsc_pipe_indication( struct ipa_endp_desc_indication_msg_v01 *req) { return -EPERM; @@ -528,6 +525,16 @@ static inline void ipa3_qmi_cleanup(void) } -#endif /* CONFIG_RMNET_IPA3 */ +static inline int ipa3_wwan_init(void) +{ + return -EPERM; +} + +static inline void ipa3_wwan_cleanup(void) +{ + +} + +#endif /* IS_ENABLED(CONFIG_RMNET_IPA3) */ #endif /* IPA_QMI_SERVICE_H */ diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c index ae02a9da827b..d1f914433894 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c @@ -8015,6 +8015,7 @@ int ipa3_stop_gsi_channel(u32 clnt_hdl) return res; } +EXPORT_SYMBOL(ipa3_stop_gsi_channel); static int _ipa_suspend_resume_pipe(enum ipa_client_type client, bool suspend) { @@ -8899,6 +8900,7 @@ u32 ipa3_get_r_rev_version(void) return r_rev; } +EXPORT_SYMBOL(ipa3_get_r_rev_version); /** * ipa3_ctx_get_type() - to get platform type, hw type diff --git a/drivers/platform/msm/ipa/ipa_v3/ipahal/Makefile b/drivers/platform/msm/ipa/ipa_v3/ipahal/Makefile deleted file mode 100644 index 4c3a20f9f0a2..000000000000 --- a/drivers/platform/msm/ipa/ipa_v3/ipahal/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -obj-$(CONFIG_IPA3) += ipa_hal.o - -ipa_hal-y := ipahal.o ipahal_reg.o ipahal_fltrt.o ipahal_hw_stats.o ipahal_nat.o diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c index 2add00016650..c49e3e637920 100644 --- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c @@ -250,9 +250,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 = ipa3_del_hdr(del_hdr); + ret = ipa_del_hdr(del_hdr); if (ret || hdl_entry->status) - IPAWANERR("ipa3_del_hdr failed\n"); + IPAWANERR("ipa_del_hdr failed\n"); else IPAWANDBG("hdrs deletion done\n"); @@ -285,9 +285,9 @@ static void ipa3_del_qmap_hdr(uint32_t hdr_hdl) hdl_entry = &del_hdr->hdl[0]; hdl_entry->hdl = hdr_hdl; - ret = ipa3_del_hdr(del_hdr); + ret = ipa_del_hdr(del_hdr); if (ret || hdl_entry->status) - IPAWANERR("ipa3_del_hdr failed\n"); + IPAWANERR("ipa_del_hdr failed\n"); else IPAWANDBG("header deletion done\n"); @@ -457,7 +457,7 @@ static void ipa3_del_dflt_wan_rt_tables(void) IPAWANERR("Deleting Route hdl:(0x%x) with ip type: %d\n", rt_rule_entry->hdl, IPA_IP_v4); - if (ipa3_del_rt_rule(rt_rule) || + if (ipa_del_rt_rule(rt_rule) || (rt_rule_entry->status)) { IPAWANERR("Routing rule deletion failed\n"); } @@ -466,7 +466,7 @@ static void ipa3_del_dflt_wan_rt_tables(void) rt_rule_entry->hdl = rmnet_ipa3_ctx->dflt_v6_wan_rt_hdl; IPAWANERR("Deleting Route hdl:(0x%x) with ip type: %d\n", rt_rule_entry->hdl, IPA_IP_v6); - if (ipa3_del_rt_rule(rt_rule) || + if (ipa_del_rt_rule(rt_rule) || (rt_rule_entry->status)) { IPAWANERR("Routing rule deletion failed\n"); } @@ -781,7 +781,7 @@ static int ipa3_wwan_add_ul_flt_rule_to_ipa(void) sizeof(struct ipa_ipfltri_rule_eq)); memcpy(&(param->rules[0]), &flt_rule_entry, sizeof(struct ipa_flt_rule_add)); - if (ipa3_add_flt_rule((struct ipa_ioc_add_flt_rule *)param)) { + if (ipa_add_flt_rule((struct ipa_ioc_add_flt_rule *)param)) { retval = -EFAULT; IPAWANERR("add A7 UL filter rule(%d) failed\n", i); } else { @@ -793,7 +793,7 @@ static int ipa3_wwan_add_ul_flt_rule_to_ipa(void) /* send ipa_fltr_installed_notif_req_msg_v01 to Q6*/ req->source_pipe_index = - ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_PROD); + ipa_get_ep_mapping(IPA_CLIENT_APPS_WAN_PROD); if (req->source_pipe_index == IPA_EP_NOT_ALLOCATED) { IPAWANERR("ep mapping failed\n"); retval = -EFAULT; @@ -843,7 +843,7 @@ static int ipa3_wwan_del_ul_flt_rule_to_ipa(void) IPAWANDBG("delete-IPA rule index(%d)\n", i); memcpy(&(param->hdl[0]), &flt_rule_entry, sizeof(struct ipa_flt_rule_del)); - if (ipa3_del_flt_rule((struct ipa_ioc_del_flt_rule *)param)) { + if (ipa_del_flt_rule((struct ipa_ioc_del_flt_rule *)param)) { IPAWANERR("del A7 UL filter rule(%d) failed\n", i); kfree(param); return -EFAULT; @@ -1065,55 +1065,6 @@ static void ipa3_cleanup_deregister_intf(void) } } -int ipa3_wwan_update_mux_channel_prop(void) -{ - int ret = 0, i; - /* install UL filter rules */ - if (rmnet_ipa3_ctx->egress_set) { - if (!ipa3_qmi_ctx->modem_cfg_emb_pipe_flt) { - IPAWANDBG("setup UL filter rules\n"); - if (rmnet_ipa3_ctx->a7_ul_flt_set) { - IPAWANDBG("del previous UL filter rules\n"); - /* delete rule hdlers */ - ret = ipa3_wwan_del_ul_flt_rule_to_ipa(); - if (ret) { - IPAWANERR("failed to del old rules\n"); - return -EINVAL; - } - IPAWANDBG("deleted old UL rules\n"); - } - ret = ipa3_wwan_add_ul_flt_rule_to_ipa(); - } - if (ret) - IPAWANERR("failed to install UL rules\n"); - else - rmnet_ipa3_ctx->a7_ul_flt_set = true; - } - /* update Tx/Rx/Ext property */ - IPAWANDBG("update Tx/Rx/Ext property in IPA\n"); - if (rmnet_ipa3_ctx->rmnet_index == 0) { - IPAWANDBG("no Tx/Rx/Ext property registered in IPA\n"); - return ret; - } - - ipa3_cleanup_deregister_intf(); - - for (i = 0; i < rmnet_ipa3_ctx->rmnet_index; i++) { - ret = ipa3_wwan_register_to_ipa(i); - if (ret < 0) { - IPAWANERR("failed to re-regist %s, mux %d, index %d\n", - rmnet_ipa3_ctx->mux_channel[i].vchannel_name, - rmnet_ipa3_ctx->mux_channel[i].mux_id, - i); - return -ENODEV; - } - IPAWANERR("dev(%s) has registered to IPA\n", - rmnet_ipa3_ctx->mux_channel[i].vchannel_name); - rmnet_ipa3_ctx->mux_channel[i].ul_flt_reg = true; - } - return ret; -} - #ifdef INIT_COMPLETION #define reinit_completion(x) INIT_COMPLETION(*(x)) #endif /* INIT_COMPLETION */ @@ -1483,7 +1434,7 @@ static int handle3_ingress_format(struct net_device *dev, IPAWANDBG("Get RMNET_IOCTL_SET_INGRESS_DATA_FORMAT\n"); - ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS); + ep_idx = ipa_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS); if (ep_idx == IPA_EP_NOT_ALLOCATED) { IPAWANDBG("Embedded datapath not supported\n"); return -EFAULT; @@ -1559,7 +1510,7 @@ static int handle3_ingress_format(struct net_device *dev, mutex_unlock(&rmnet_ipa3_ctx->pipe_handle_guard); return -EFAULT; } - ret = ipa3_setup_sys_pipe(&rmnet_ipa3_ctx->ipa_to_apps_ep_cfg, + ret = ipa_setup_sys_pipe(&rmnet_ipa3_ctx->ipa_to_apps_ep_cfg, &rmnet_ipa3_ctx->ipa3_to_apps_hdl); mutex_unlock(&rmnet_ipa3_ctx->pipe_handle_guard); @@ -1615,7 +1566,7 @@ static int handle3_egress_format(struct net_device *dev, return rc; } - ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_PROD); + ep_idx = ipa_get_ep_mapping(IPA_CLIENT_APPS_WAN_PROD); if (ep_idx == IPA_EP_NOT_ALLOCATED) { IPAWANDBG("Embedded datapath not supported\n"); return -EFAULT; @@ -1676,7 +1627,7 @@ static int handle3_egress_format(struct net_device *dev, mutex_unlock(&rmnet_ipa3_ctx->pipe_handle_guard); return -EFAULT; } - rc = ipa3_setup_sys_pipe( + rc = ipa_setup_sys_pipe( ipa_wan_ep_cfg, &rmnet_ipa3_ctx->apps_to_ipa3_hdl); if (rc) { IPAWANERR("failed to config egress endpoint\n"); @@ -1862,7 +1813,7 @@ static int ipa3_wwan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) /* Endpoint pair */ case RMNET_IOCTL_GET_EP_PAIR: IPAWANDBG("get ioctl: RMNET_IOCTL_GET_EP_PAIR\n"); - wan_ep = ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS); + wan_ep = ipa_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS); if (wan_ep == IPA_EP_NOT_ALLOCATED) { IPAWANERR("Embedded datapath not supported\n"); rc = -EFAULT; @@ -1871,7 +1822,7 @@ static int ipa3_wwan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ext_ioctl_data.u.ipa_ep_pair.producer_pipe_num = wan_ep; - wan_ep = ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_PROD); + wan_ep = ipa_get_ep_mapping(IPA_CLIENT_APPS_WAN_PROD); if (wan_ep == IPA_EP_NOT_ALLOCATED) { IPAWANERR("Embedded datapath not supported\n"); rc = -EFAULT; @@ -2003,7 +1954,7 @@ static int ipa3_wwan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) memset(&msg_meta, 0, sizeof(struct ipa_msg_meta)); msg_meta.msg_type = WAN_XLAT_CONNECT; msg_meta.msg_len = sizeof(struct ipa_wan_msg); - rc = ipa3_send_msg(&msg_meta, wan_msg, + rc = ipa_send_msg(&msg_meta, wan_msg, ipa3_wwan_msg_free_cb); if (rc) { IPAWANERR("Failed to send XLAT_CONNECT msg\n"); @@ -2270,7 +2221,6 @@ static struct notifier_block ipa3_rmt_mdm_ssr_notifier = { .notifier_call = ipa3_rmt_mdm_ssr_notifier_cb, }; - static int get_ipa_rmnet_dts_configuration(struct platform_device *pdev, struct ipa3_rmnet_plat_drv_res *ipa_rmnet_drv_res) { @@ -2311,7 +2261,7 @@ static int get_ipa_rmnet_dts_configuration(struct platform_device *pdev, struct ipa3_rmnet_context ipa3_rmnet_ctx; static int ipa3_wwan_probe(struct platform_device *pdev); -struct platform_device *m_pdev; +static struct platform_device *m_pdev; static void ipa3_delayed_probe(struct work_struct *work) { @@ -2411,7 +2361,7 @@ static int ipa3_wwan_probe(struct platform_device *pdev) } } - wan_cons_ep = ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS); + wan_cons_ep = ipa_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS); ret = get_ipa_rmnet_dts_configuration(pdev, &ipa3_rmnet_res); ipa3_rmnet_ctx.ipa_rmnet_ssr = ipa3_rmnet_res.ipa_rmnet_ssr; @@ -2593,7 +2543,7 @@ static int ipa3_wwan_remove(struct platform_device *pdev) /* No need to remove wwan_ioctl during SSR */ if (!atomic_read(&rmnet_ipa3_ctx->is_ssr)) ipa3_wan_ioctl_deinit(); - if (ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS) != + if (ipa_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS) != IPA_EP_NOT_ALLOCATED) { ipa3_del_dflt_wan_rt_tables(); ipa3_del_a7_qmap_hdr(); @@ -2806,7 +2756,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. */ - ipa3_proxy_clk_vote(); + ipa_proxy_clk_vote(); ipa3_reset_freeze_vote(); IPAWANINFO("IPA BEFORE_POWERUP handling is complete\n"); break; @@ -3197,10 +3147,10 @@ int rmnet_ipa3_set_tether_client_pipe( IPAWANDBG("UL index-%d pipe %d\n", i, data->ul_src_pipe_list[i]); if (data->reset_client) - ipa3_set_client(data->ul_src_pipe_list[i], + ipa_set_client(data->ul_src_pipe_list[i], 0, false); else - ipa3_set_client(data->ul_src_pipe_list[i], + ipa_set_client(data->ul_src_pipe_list[i], data->ipa_client, true); } number = data->dl_dst_pipe_len; @@ -3208,10 +3158,10 @@ int rmnet_ipa3_set_tether_client_pipe( IPAWANDBG("DL index-%d pipe %d\n", i, data->dl_dst_pipe_list[i]); if (data->reset_client) - ipa3_set_client(data->dl_dst_pipe_list[i], + ipa_set_client(data->dl_dst_pipe_list[i], 0, false); else - ipa3_set_client(data->dl_dst_pipe_list[i], + ipa_set_client(data->dl_dst_pipe_list[i], data->ipa_client, false); } return 0; @@ -3693,7 +3643,6 @@ skip_nlo_stats: con_stats->client[index].num_ipv4_bytes; data->ipv6_tx_bytes += con_stats->client[index].num_ipv6_bytes; - if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_5 && ipa3_ctx->platform_type == IPA_PLAT_TYPE_MSM) { index = IPA_CLIENT_Q6_UL_NLO_DATA_CONS; @@ -3715,7 +3664,7 @@ skip_nlo_stats: con_stats->client[index].num_ipv6_bytes; } - if (ipa3_get_ep_mapping(IPA_CLIENT_WIGIG_PROD) != + if (ipa_get_ep_mapping(IPA_CLIENT_WIGIG_PROD) != IPA_EP_NOT_ALLOCATED) { /* query WIGIG UL stats */ memset(con_stats, 0, sizeof(struct ipa_quota_stats_all)); @@ -4323,7 +4272,7 @@ int rmnet_ipa3_set_lan_client_info( /* Update the Source pipe. */ rmnet_ipa3_ctx->tether_device[data->device_type].ul_src_pipe = - ipa3_get_ep_mapping(data->ul_src_pipe); + ipa_get_ep_mapping(data->ul_src_pipe); /* Update the header length if not set. */ if (!rmnet_ipa3_ctx->tether_device[data->device_type].hdr_len) @@ -4761,7 +4710,7 @@ static void rmnet_ipa_debugfs_remove(void){} -static int __init ipa3_wwan_init(void) +int ipa3_wwan_init(void) { int i, j; struct ipa_tether_device_info *teth_ptr = NULL; @@ -4809,6 +4758,7 @@ static int __init ipa3_wwan_init(void) rmnet_ipa3_ctx->lcl_mdm_subsys_notify_handle = ssr_hdl; else if (!rmnet_ipa3_ctx->ipa_config_is_apq) { rc = PTR_ERR(ssr_hdl); + IPAWANERR_RL("local modem ssr register fail rc=%d\n", rc); goto fail_dbgfs_rm; } @@ -4818,14 +4768,18 @@ static int __init ipa3_wwan_init(void) &ipa3_rmt_mdm_ssr_notifier); if (IS_ERR(ssr_hdl)) { rc = PTR_ERR(ssr_hdl); + IPAWANERR_RL("remote modem ssr register fail rc=%d\n", + rc); goto fail_unreg_lcl_mdm_ssr; } rmnet_ipa3_ctx->rmt_mdm_subsys_notify_handle = ssr_hdl; } rc = platform_driver_register(&rmnet_ipa_driver); - if (rc) + if (rc) { + IPAWANERR_RL("rmnet_ipa driver register fail rc=%d\n", rc); goto fail_unreg_rmt_mdm_ssr; + } return 0; @@ -4848,7 +4802,7 @@ fail_dbgfs_rm: return rc; } -static void __exit ipa3_wwan_cleanup(void) +void ipa3_wwan_cleanup(void) { int ret; @@ -4894,8 +4848,3 @@ static int ipa3_rmnet_poll(struct napi_struct *napi, int budget) IPAWANDBG_LOW("rcvd packets: %d\n", rcvd_pkts); return rcvd_pkts; } - -late_initcall(ipa3_wwan_init); -module_exit(ipa3_wwan_cleanup); -MODULE_DESCRIPTION("WWAN Network Interface"); -MODULE_LICENSE("GPL v2"); diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa_fd_ioctl.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa_fd_ioctl.c index bad741fa926f..7c3f05135fb1 100644 --- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa_fd_ioctl.c +++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa_fd_ioctl.c @@ -526,7 +526,7 @@ static int ipa3_wan_ioctl_open(struct inode *inode, struct file *filp) return 0; } -const struct file_operations rmnet_ipa3_fops = { +static const struct file_operations rmnet_ipa3_fops = { .owner = THIS_MODULE, .open = ipa3_wan_ioctl_open, .read = NULL, diff --git a/drivers/platform/msm/ipa/test/Makefile b/drivers/platform/msm/ipa/test/Makefile deleted file mode 100644 index be6487d973cb..000000000000 --- a/drivers/platform/msm/ipa/test/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -obj-$(CONFIG_IPA_UT) += ipa_ut_mod.o -ipa_ut_mod-y := ipa_ut_framework.o ipa_test_example.o ipa_test_mhi.o ipa_test_dma.o ipa_test_hw_stats.o ipa_pm_ut.o ipa_test_wdi3.o diff --git a/drivers/platform/msm/ipa/test/ipa_ut_framework.c b/drivers/platform/msm/ipa/test/ipa_ut_framework.c index 0dfb8184fd9b..f5e076b7aa69 100644 --- a/drivers/platform/msm/ipa/test/ipa_ut_framework.c +++ b/drivers/platform/msm/ipa/test/ipa_ut_framework.c @@ -689,7 +689,7 @@ unlock_mutex: * * Return: Zero in success, otherwise in failure */ -int ipa_ut_framework_load_suites(void) +static int ipa_ut_framework_load_suites(void) { int suite_idx; int tst_idx; @@ -1026,7 +1026,7 @@ static void ipa_ut_ipa_ready_cb(void *user_data) * If IPA driver already ready, continue initialization immediately. * if not, wait for IPA ready notification by IPA driver context */ -int __init ipa_ut_module_init(void) +int ipa_ut_module_init(void) { int ret = 0; bool init_framewok = true; @@ -1107,9 +1107,3 @@ void ipa_ut_module_exit(void) ipa_ut_ctx = NULL; } -#if !defined(CONFIG_IPA_EMULATION) /* On real UE, we have a module */ -module_init(ipa_ut_module_init); -module_exit(ipa_ut_module_exit); -MODULE_LICENSE("GPL v2"); -MODULE_DESCRIPTION("IPA Unit Test module"); -#endif diff --git a/include/linux/ecm_ipa.h b/include/linux/ecm_ipa.h index 67fefc4488cf..87df9162d854 100644 --- a/include/linux/ecm_ipa.h +++ b/include/linux/ecm_ipa.h @@ -50,7 +50,7 @@ struct ecm_ipa_params { }; -#ifdef CONFIG_ECM_IPA +#if IS_ENABLED(CONFIG_ECM_IPA) int ecm_ipa_init(struct ecm_ipa_params *params); @@ -61,7 +61,7 @@ int ecm_ipa_disconnect(void *priv); void ecm_ipa_cleanup(void *priv); -#else /* CONFIG_ECM_IPA*/ +#else /* IS_ENABLED(CONFIG_ECM_IPA) */ static inline int ecm_ipa_init(struct ecm_ipa_params *params) { @@ -83,6 +83,6 @@ static inline void ecm_ipa_cleanup(void *priv) { } -#endif /* CONFIG_ECM_IPA*/ +#endif /* IS_ENABLED(CONFIG_ECM_IPA) */ #endif /* _ECM_IPA_H_ */ diff --git a/include/linux/ipa.h b/include/linux/ipa.h index a0b319348713..0f60f3a89427 100644 --- a/include/linux/ipa.h +++ b/include/linux/ipa.h @@ -1255,7 +1255,7 @@ struct ipa_smmu_out_params { bool shared_cb; }; -#if defined CONFIG_IPA || defined CONFIG_IPA3 +#if IS_ENABLED(CONFIG_IPA3) /* * Resume / Suspend @@ -1671,11 +1671,13 @@ int ipa_get_smmu_params(struct ipa_smmu_in_params *in, * Returns: 0 on success, negative on failure */ int ipa_is_vlan_mode(enum ipa_vlan_ifaces iface, bool *res); + /** * ipa_get_lan_rx_napi - returns true if NAPI is enabled in the LAN RX dp */ bool ipa_get_lan_rx_napi(void); -#else /* (CONFIG_IPA || CONFIG_IPA3) */ + +#else /* IS_ENABLED(CONFIG_IPA3) */ /* * Resume / Suspend @@ -2528,11 +2530,12 @@ static inline int ipa_is_vlan_mode(enum ipa_vlan_ifaces iface, bool *res) { return -EPERM; } + static inline bool ipa_get_lan_rx_napi(void) { return false; } -#endif /* (CONFIG_IPA || CONFIG_IPA3) */ +#endif /* IS_ENABLED(CONFIG_IPA3) */ #endif /* _IPA_H_ */ diff --git a/include/linux/ipa_mhi.h b/include/linux/ipa_mhi.h index f4701d853981..13fa2475118f 100644 --- a/include/linux/ipa_mhi.h +++ b/include/linux/ipa_mhi.h @@ -95,7 +95,7 @@ struct ipa_mhi_connect_params { /* bit #40 in address should be asserted for MHI transfers over pcie */ #define IPA_MHI_HOST_ADDR(addr) ((addr) | BIT_ULL(40)) -#if defined CONFIG_IPA || defined CONFIG_IPA3 +#if IS_ENABLED(CONFIG_IPA3) int ipa_mhi_init(struct ipa_mhi_init_params *params); @@ -111,7 +111,7 @@ int ipa_mhi_resume(void); void ipa_mhi_destroy(void); -#else /* (CONFIG_IPA || CONFIG_IPA3) */ +#else /* IS_ENABLED(CONFIG_IPA3) */ static inline int ipa_mhi_init(struct ipa_mhi_init_params *params) { @@ -149,6 +149,6 @@ static inline void ipa_mhi_destroy(void) } -#endif /* (CONFIG_IPA || CONFIG_IPA3) */ +#endif /* IS_ENABLED(CONFIG_IPA3) */ #endif /* IPA_MHI_H_ */ diff --git a/include/linux/ipa_odu_bridge.h b/include/linux/ipa_odu_bridge.h index bddc71522781..db2ed9b61bd6 100644 --- a/include/linux/ipa_odu_bridge.h +++ b/include/linux/ipa_odu_bridge.h @@ -45,7 +45,7 @@ struct ipa_bridge_init_params { void (*wakeup_request)(void *cl_priv); }; -#ifdef CONFIG_IPA3 +#if IS_ENABLED(CONFIG_IPA3) int ipa_bridge_init(struct ipa_bridge_init_params *params, u32 *hdl); @@ -64,7 +64,7 @@ int ipa_bridge_tx_dp(u32 hdl, struct sk_buff *skb, int ipa_bridge_cleanup(u32 hdl); -#else +#else /* IS_ENABLED(CONFIG_IPA3) */ static inline int ipa_bridge_init(struct odu_bridge_params *params, u32 *hdl) { @@ -107,10 +107,10 @@ static inline int ipa_bridge_cleanup(u32 hdl) return -EPERM; } -#endif /* CONFIG_IPA3 */ +#endif /* IS_ENABLED(CONFIG_IPA3) */ /* Below API is deprecated. Please use the API above */ -# if defined CONFIG_IPA || defined CONFIG_IPA3 +#if IS_ENABLED(CONFIG_IPA3) int odu_bridge_init(struct odu_bridge_params *params); @@ -122,7 +122,7 @@ int odu_bridge_tx_dp(struct sk_buff *skb, struct ipa_tx_meta *metadata); int odu_bridge_cleanup(void); -#else +#else /* IS_ENABLED(CONFIG_IPA3) */ static inline int odu_bridge_init(struct odu_bridge_params *params) { @@ -150,6 +150,6 @@ static inline int odu_bridge_cleanup(void) return -EPERM; } -#endif /* CONFIG_IPA || defined CONFIG_IPA3 */ +#endif /* IS_ENABLED(CONFIG_IPA3) */ #endif /* _IPA_ODO_BRIDGE_H */ diff --git a/include/linux/ipa_uc_offload.h b/include/linux/ipa_uc_offload.h index f3f17bcd933a..4664b0fbd6f8 100644 --- a/include/linux/ipa_uc_offload.h +++ b/include/linux/ipa_uc_offload.h @@ -196,7 +196,7 @@ struct ipa_uc_ready_params { enum ipa_uc_offload_proto proto; }; -#if defined CONFIG_IPA || defined CONFIG_IPA3 +#if IS_ENABLED(CONFIG_IPA3) /** * ipa_uc_offload_reg_intf - Client should call this function to @@ -269,7 +269,7 @@ int ipa_uc_offload_reg_rdyCB(struct ipa_uc_ready_params *param); */ void ipa_uc_offload_dereg_rdyCB(enum ipa_uc_offload_proto proto); -#else /* (CONFIG_IPA || CONFIG_IPA3) */ +#else /* IS_ENABLED(CONFIG_IPA3) */ static inline int ipa_uc_offload_reg_intf( struct ipa_uc_offload_intf_params *in, diff --git a/include/linux/ipa_usb.h b/include/linux/ipa_usb.h index 85dac9dd1fa7..80f09285d5c2 100644 --- a/include/linux/ipa_usb.h +++ b/include/linux/ipa_usb.h @@ -163,7 +163,7 @@ struct ipa_req_chan_out_params { u32 db_reg_phs_addr_msb; }; -#ifdef CONFIG_IPA3 +#if IS_ENABLED(CONFIG_IPA_USB) /** * ipa_usb_init_teth_prot - Peripheral should call this function to initialize @@ -278,7 +278,7 @@ int ipa_usb_xdci_suspend(u32 ul_clnt_hdl, u32 dl_clnt_hdl, int ipa_usb_xdci_resume(u32 ul_clnt_hdl, u32 dl_clnt_hdl, enum ipa_usb_teth_prot teth_prot); -#else /* CONFIG_IPA3 */ +#else /* IS_ENABLED(CONFIG_IPA_USB) */ static inline int ipa_usb_init_teth_prot(enum ipa_usb_teth_prot teth_prot, struct ipa_usb_teth_params *teth_params, @@ -324,6 +324,6 @@ static inline int ipa_usb_xdci_resume(u32 ul_clnt_hdl, u32 dl_clnt_hdl, } -#endif /* CONFIG_IPA3 */ +#endif /* IS_ENABLED(CONFIG_IPA_USB) */ #endif /* _IPA_USB_H_ */ diff --git a/include/linux/ipa_wdi3.h b/include/linux/ipa_wdi3.h index 4f4189b51242..2db9173d22b7 100644 --- a/include/linux/ipa_wdi3.h +++ b/include/linux/ipa_wdi3.h @@ -221,7 +221,7 @@ struct ipa_wdi_perf_profile { u32 max_supported_bw_mbps; }; -#if defined CONFIG_IPA || defined CONFIG_IPA3 +#if IS_ENABLED(CONFIG_IPA3) /** * ipa_wdi_init - Client should call this function to @@ -370,7 +370,7 @@ int ipa_wdi_bw_monitor(struct ipa_wdi_bw_info *info); */ int ipa_wdi_sw_stats(struct ipa_wdi_tx_info *info); -#else /* (CONFIG_IPA || CONFIG_IPA3) */ +#else /* IS_ENABLED(CONFIG_IPA3) */ static inline int ipa_wdi_init(struct ipa_wdi_init_in_params *in, struct ipa_wdi_init_out_params *out) @@ -448,6 +448,6 @@ static inline int ipa_wdi_sw_stats(struct ipa_wdi_tx_info *info) return -EPERM; } -#endif /* CONFIG_IPA3 */ +#endif /* IS_ENABLED(CONFIG_IPA3) */ #endif /* _IPA_WDI3_H_ */ diff --git a/include/linux/ipa_wigig.h b/include/linux/ipa_wigig.h index 4a261d700738..d3be69ca6336 100644 --- a/include/linux/ipa_wigig.h +++ b/include/linux/ipa_wigig.h @@ -245,7 +245,7 @@ struct ipa_wigig_conn_tx_in_params_smmu { u8 client_mac[IPA_MAC_ADDR_SIZE]; }; -#if defined CONFIG_IPA || defined CONFIG_IPA3 +#if IS_ENABLED(CONFIG_IPA3) /* * ipa_wigig_init - Client should call this function to @@ -402,7 +402,7 @@ int ipa_wigig_tx_dp(enum ipa_client_type dst, struct sk_buff *skb); */ int ipa_wigig_set_perf_profile(u32 max_supported_bw_mbps); -#else /* (CONFIG_IPA || CONFIG_IPA3) */ +#else /* IS_ENABLED(CONFIG_IPA3) */ static inline int ipa_wigig_init(struct ipa_wigig_init_in_params *in, struct ipa_wigig_init_out_params *out) { @@ -482,5 +482,5 @@ int ipa_wigig_set_perf_profile(u32 max_supported_bw_mbps) { return -EPERM; } -#endif /* CONFIG_IPA3 */ +#endif /* IS_ENABLED(CONFIG_IPA3) */ #endif /* _IPA_WIGIG_H_ */ diff --git a/include/linux/msm_gsi.h b/include/linux/msm_gsi.h index 7a680da1416f..e50fb89c923f 100644 --- a/include/linux/msm_gsi.h +++ b/include/linux/msm_gsi.h @@ -1065,7 +1065,7 @@ struct gsi_chan_info { uint64_t evt_rp; }; -#ifdef CONFIG_GSI +#if IS_ENABLED(CONFIG_GSI) /** * gsi_register_device - Peripheral should call this function to * register itself with GSI before invoking any other APIs @@ -1683,7 +1683,7 @@ int gsi_alloc_channel_ee(unsigned int chan_idx, unsigned int ee, int *code); * gsi_deregister_device * */ -#else +#else /* IS_ENABLED(CONFIG_GSI) */ static inline int gsi_register_device(struct gsi_per_props *props, unsigned long *dev_hdl) { @@ -1935,5 +1935,5 @@ static inline void gsi_wdi3_dump_register(unsigned long chan_hdl) { } -#endif +#endif /* IS_ENABLED(CONFIG_GSI) */ #endif diff --git a/include/linux/rndis_ipa.h b/include/linux/rndis_ipa.h index 8cdbe79bf849..27b778a26375 100644 --- a/include/linux/rndis_ipa.h +++ b/include/linux/rndis_ipa.h @@ -49,7 +49,7 @@ struct ipa_usb_init_params { bool skip_ep_cfg; }; -#ifdef CONFIG_RNDIS_IPA +#if IS_ENABLED(CONFIG_RNDIS_IPA) int rndis_ipa_init(struct ipa_usb_init_params *params); @@ -64,7 +64,7 @@ int rndis_ipa_pipe_disconnect_notify(void *private); void rndis_ipa_cleanup(void *private); -#else /* CONFIG_RNDIS_IPA*/ +#else /* IS_ENABLED(CONFIG_RNDIS_IPA) */ static inline int rndis_ipa_init(struct ipa_usb_init_params *params) { @@ -88,8 +88,8 @@ static inline int rndis_ipa_pipe_disconnect_notify(void *private) static inline void rndis_ipa_cleanup(void *private) { - } -#endif /* CONFIG_RNDIS_IPA */ + +#endif /* IS_ENABLED(CONFIG_RNDIS_IPA) */ #endif /* _RNDIS_IPA_H_ */