Loading arch/arm/mach-msm/include/mach/ipa.h +92 −8 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -356,11 +356,15 @@ struct ipa_ep_cfg_metadata { * struct ipa_ep_cfg - configuration of IPA end-point * @nat: NAT parmeters * @hdr: Header parameters * @hdr_ext: Extended header parameters * @mode: Mode parameters * @aggr: Aggregation parameters * @deaggr: Deaggregation params * @route: Routing parameters * @status: Status parameters * @cfg: Configuration register data * @metadata_mask: Hdr metadata mask * @meta: Meta Data */ struct ipa_ep_cfg { struct ipa_ep_cfg_nat nat; Loading @@ -376,6 +380,19 @@ struct ipa_ep_cfg { struct ipa_ep_cfg_metadata meta; }; /** * struct ipa_ep_cfg_ctrl - Control configuration in IPA end-point * @ipa_ep_suspend: 0 - ENDP is enabled, 1 - ENDP is suspended (disabled). * Valid for PROD Endpoints * @ipa_ep_delay: 0 - ENDP is free-running, 1 - ENDP is delayed. * SW controls the data flow of an endpoint usind this bit. * Valid for CONS Endpoints */ struct ipa_ep_cfg_ctrl { bool ipa_ep_suspend; bool ipa_ep_delay; }; /** * x should be in bytes */ Loading Loading @@ -689,6 +706,44 @@ struct ipa_rx_data { dma_addr_t dma_addr; }; enum ipa_irq_type { IPA_BAD_SNOC_ACCESS_IRQ = 0, IPA_EOT_COAL_IRQ, IPA_UC_IRQ_0, IPA_UC_IRQ_1, IPA_UC_IRQ_2, IPA_UC_IRQ_3, IPA_UC_IN_Q_NOT_EMPTY_IRQ, IPA_UC_RX_CMD_Q_NOT_FULL_IRQ, IPA_UC_TX_CMD_Q_NOT_FULL_IRQ, IPA_UC_TO_PROC_ACK_Q_NOT_FULL_IRQ, IPA_PROC_TO_UC_ACK_Q_NOT_EMPTY_IRQ, IPA_RX_ERR_IRQ, IPA_DEAGGR_ERR_IRQ, IPA_TX_ERR_IRQ, IPA_STEP_MODE_IRQ, IPA_PROC_ERR_IRQ, IPA_TX_SUSPEND_IRQ = 16, IPA_TX_HOLB_DROP_IRQ = 17, IPA_IRQ_MAX }; /** * typedef ipa_irq_handler_t - irq handler/callback type * @param ipa_irq_type - [in] interrupt type * @param private_data - [in, out] the client private data * @param interrupt_data - [out] interrupt information data * * callback registered by ipa_add_interrupt_handler function to * handle a specific interrupt type * * No return value */ typedef void (*ipa_irq_handler_t)(enum ipa_irq_type interrupt, void *private_data, void *interrupt_data); #ifdef CONFIG_IPA /* Loading Loading @@ -738,6 +793,8 @@ int ipa_cfg_ep_metadata_mask(u32 clnt_hdl, const struct ipa_ep_cfg_metadata_mask 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); /* * Header removal / addition */ Loading Loading @@ -930,6 +987,14 @@ bool ipa_emb_ul_pipes_empty(void); /* mux id*/ int ipa_write_qmap_id(struct ipa_ioc_write_qmapid *param_in); /*interrupts*/ 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); #else /* CONFIG_IPA */ static inline int a2_mux_open_channel(enum a2_mux_logical_channel_id lcid, Loading Loading @@ -1073,6 +1138,12 @@ static inline int ipa_cfg_ep_metadata_mask(u32 clnt_hdl, return -EPERM; } static inline int ipa_cfg_ep_ctrl(u32 clnt_hdl, const struct ipa_ep_cfg_ctrl *ep_ctrl) { return -EPERM; } /* * Header removal / addition */ Loading Loading @@ -1444,6 +1515,19 @@ static inline int ipa_write_qmap_id(struct ipa_ioc_write_qmapid *param_in) return -EPERM; } /* interrupts */ static inline int ipa_add_interrupt_handler(enum ipa_irq_type interrupt, ipa_irq_handler_t handler, bool deferred_flag, void *private_data) { return -EPERM; } static inline int ipa_remove_interrupt_handler(enum ipa_irq_type interrupt) { return -EPERM; } #endif /* CONFIG_IPA*/ #endif /* _IPA_H_ */ drivers/platform/msm/ipa/Makefile +2 −1 Original line number Diff line number Diff line obj-$(CONFIG_IPA) += 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 a2_service.o ipa_bridge.o ipa_intf.o teth_bridge.o \ ipa_rm.o ipa_rm_dependency_graph.o ipa_rm_peers_list.o ipa_rm_resource.o ipa_rm_inactivity_timer.o ipa_rm.o ipa_rm_dependency_graph.o ipa_rm_peers_list.o ipa_rm_resource.o ipa_rm_inactivity_timer.o \ ipa_interrupts.o obj-$(CONFIG_RMNET_IPA) += rmnet_ipa.o ipa_qmi_service_v01.o ipa_qmi_service.o rmnet_ipa_fd_ioctl.o drivers/platform/msm/ipa/ipa.c +10 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -2076,6 +2076,15 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p, } IPADBG("IPA resource manager initialized"); /*register IPA IRQ handler*/ result = ipa_interrupts_init(resource_p->ipa_irq, resource_p->ee, ipa_dev); if (result) { IPAERR("ipa interrupts initialization failed\n"); result = -ENODEV; goto fail_ipa_rm_init; } if (ipa_ctx->use_a2_service) { result = a2_mux_init(); if (result) { Loading drivers/platform/msm/ipa/ipa_client.c +13 −5 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading @@ -23,19 +23,24 @@ static void ipa_enable_data_path(u32 clnt_hdl) { struct ipa_ep_cfg_ctrl ep_cfg_ctrl; IPADBG("Enabling data path\n"); /* IPA_HW_MODE_VIRTUAL lacks support for TAG IC & EP suspend */ if (ipa_ctx->ipa_hw_mode == IPA_HW_MODE_VIRTUAL) return; ipa_write_reg(ipa_ctx->mmio, IPA_ENDP_INIT_CTRL_N_OFST(clnt_hdl), 0); memset(&ep_cfg_ctrl, 0 , sizeof(struct ipa_ep_cfg_ctrl)); ep_cfg_ctrl.ipa_ep_suspend = false; ipa_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); } static int ipa_disable_data_path(u32 clnt_hdl) { struct ipa_ep_context *ep = &ipa_ctx->ep[clnt_hdl]; struct ipa_ep_cfg_ctrl ep_cfg_ctrl; IPADBG("Disabling data path\n"); Loading @@ -43,8 +48,11 @@ static int ipa_disable_data_path(u32 clnt_hdl) if (ipa_ctx->ipa_hw_mode == IPA_HW_MODE_VIRTUAL) return 0; ipa_write_reg(ipa_ctx->mmio, IPA_ENDP_INIT_CTRL_N_OFST(clnt_hdl), 1); memset(&ep_cfg_ctrl, 0 , sizeof(struct ipa_ep_cfg_ctrl)); ep_cfg_ctrl.ipa_ep_suspend = true; ipa_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); udelay(IPA_PKT_FLUSH_TO_US); if (IPA_CLIENT_IS_CONS(ep->client) && ep->cfg.aggr.aggr_en == IPA_ENABLE_AGGR && Loading drivers/platform/msm/ipa/ipa_i.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -901,6 +901,7 @@ void ipa_enable_clks(void); void ipa_disable_clks(void); void ipa_inc_client_enable_clks(void); void ipa_dec_client_disable_clks(void); int ipa_interrupts_init(u32 ipa_irq, u32 ee, struct device *ipa_dev); int __ipa_del_rt_rule(u32 rule_hdl); int __ipa_del_hdr(u32 hdr_hdl); int __ipa_release_hdr(u32 hdr_hdl); Loading Loading
arch/arm/mach-msm/include/mach/ipa.h +92 −8 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -356,11 +356,15 @@ struct ipa_ep_cfg_metadata { * struct ipa_ep_cfg - configuration of IPA end-point * @nat: NAT parmeters * @hdr: Header parameters * @hdr_ext: Extended header parameters * @mode: Mode parameters * @aggr: Aggregation parameters * @deaggr: Deaggregation params * @route: Routing parameters * @status: Status parameters * @cfg: Configuration register data * @metadata_mask: Hdr metadata mask * @meta: Meta Data */ struct ipa_ep_cfg { struct ipa_ep_cfg_nat nat; Loading @@ -376,6 +380,19 @@ struct ipa_ep_cfg { struct ipa_ep_cfg_metadata meta; }; /** * struct ipa_ep_cfg_ctrl - Control configuration in IPA end-point * @ipa_ep_suspend: 0 - ENDP is enabled, 1 - ENDP is suspended (disabled). * Valid for PROD Endpoints * @ipa_ep_delay: 0 - ENDP is free-running, 1 - ENDP is delayed. * SW controls the data flow of an endpoint usind this bit. * Valid for CONS Endpoints */ struct ipa_ep_cfg_ctrl { bool ipa_ep_suspend; bool ipa_ep_delay; }; /** * x should be in bytes */ Loading Loading @@ -689,6 +706,44 @@ struct ipa_rx_data { dma_addr_t dma_addr; }; enum ipa_irq_type { IPA_BAD_SNOC_ACCESS_IRQ = 0, IPA_EOT_COAL_IRQ, IPA_UC_IRQ_0, IPA_UC_IRQ_1, IPA_UC_IRQ_2, IPA_UC_IRQ_3, IPA_UC_IN_Q_NOT_EMPTY_IRQ, IPA_UC_RX_CMD_Q_NOT_FULL_IRQ, IPA_UC_TX_CMD_Q_NOT_FULL_IRQ, IPA_UC_TO_PROC_ACK_Q_NOT_FULL_IRQ, IPA_PROC_TO_UC_ACK_Q_NOT_EMPTY_IRQ, IPA_RX_ERR_IRQ, IPA_DEAGGR_ERR_IRQ, IPA_TX_ERR_IRQ, IPA_STEP_MODE_IRQ, IPA_PROC_ERR_IRQ, IPA_TX_SUSPEND_IRQ = 16, IPA_TX_HOLB_DROP_IRQ = 17, IPA_IRQ_MAX }; /** * typedef ipa_irq_handler_t - irq handler/callback type * @param ipa_irq_type - [in] interrupt type * @param private_data - [in, out] the client private data * @param interrupt_data - [out] interrupt information data * * callback registered by ipa_add_interrupt_handler function to * handle a specific interrupt type * * No return value */ typedef void (*ipa_irq_handler_t)(enum ipa_irq_type interrupt, void *private_data, void *interrupt_data); #ifdef CONFIG_IPA /* Loading Loading @@ -738,6 +793,8 @@ int ipa_cfg_ep_metadata_mask(u32 clnt_hdl, const struct ipa_ep_cfg_metadata_mask 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); /* * Header removal / addition */ Loading Loading @@ -930,6 +987,14 @@ bool ipa_emb_ul_pipes_empty(void); /* mux id*/ int ipa_write_qmap_id(struct ipa_ioc_write_qmapid *param_in); /*interrupts*/ 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); #else /* CONFIG_IPA */ static inline int a2_mux_open_channel(enum a2_mux_logical_channel_id lcid, Loading Loading @@ -1073,6 +1138,12 @@ static inline int ipa_cfg_ep_metadata_mask(u32 clnt_hdl, return -EPERM; } static inline int ipa_cfg_ep_ctrl(u32 clnt_hdl, const struct ipa_ep_cfg_ctrl *ep_ctrl) { return -EPERM; } /* * Header removal / addition */ Loading Loading @@ -1444,6 +1515,19 @@ static inline int ipa_write_qmap_id(struct ipa_ioc_write_qmapid *param_in) return -EPERM; } /* interrupts */ static inline int ipa_add_interrupt_handler(enum ipa_irq_type interrupt, ipa_irq_handler_t handler, bool deferred_flag, void *private_data) { return -EPERM; } static inline int ipa_remove_interrupt_handler(enum ipa_irq_type interrupt) { return -EPERM; } #endif /* CONFIG_IPA*/ #endif /* _IPA_H_ */
drivers/platform/msm/ipa/Makefile +2 −1 Original line number Diff line number Diff line obj-$(CONFIG_IPA) += 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 a2_service.o ipa_bridge.o ipa_intf.o teth_bridge.o \ ipa_rm.o ipa_rm_dependency_graph.o ipa_rm_peers_list.o ipa_rm_resource.o ipa_rm_inactivity_timer.o ipa_rm.o ipa_rm_dependency_graph.o ipa_rm_peers_list.o ipa_rm_resource.o ipa_rm_inactivity_timer.o \ ipa_interrupts.o obj-$(CONFIG_RMNET_IPA) += rmnet_ipa.o ipa_qmi_service_v01.o ipa_qmi_service.o rmnet_ipa_fd_ioctl.o
drivers/platform/msm/ipa/ipa.c +10 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -2076,6 +2076,15 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p, } IPADBG("IPA resource manager initialized"); /*register IPA IRQ handler*/ result = ipa_interrupts_init(resource_p->ipa_irq, resource_p->ee, ipa_dev); if (result) { IPAERR("ipa interrupts initialization failed\n"); result = -ENODEV; goto fail_ipa_rm_init; } if (ipa_ctx->use_a2_service) { result = a2_mux_init(); if (result) { Loading
drivers/platform/msm/ipa/ipa_client.c +13 −5 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading @@ -23,19 +23,24 @@ static void ipa_enable_data_path(u32 clnt_hdl) { struct ipa_ep_cfg_ctrl ep_cfg_ctrl; IPADBG("Enabling data path\n"); /* IPA_HW_MODE_VIRTUAL lacks support for TAG IC & EP suspend */ if (ipa_ctx->ipa_hw_mode == IPA_HW_MODE_VIRTUAL) return; ipa_write_reg(ipa_ctx->mmio, IPA_ENDP_INIT_CTRL_N_OFST(clnt_hdl), 0); memset(&ep_cfg_ctrl, 0 , sizeof(struct ipa_ep_cfg_ctrl)); ep_cfg_ctrl.ipa_ep_suspend = false; ipa_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); } static int ipa_disable_data_path(u32 clnt_hdl) { struct ipa_ep_context *ep = &ipa_ctx->ep[clnt_hdl]; struct ipa_ep_cfg_ctrl ep_cfg_ctrl; IPADBG("Disabling data path\n"); Loading @@ -43,8 +48,11 @@ static int ipa_disable_data_path(u32 clnt_hdl) if (ipa_ctx->ipa_hw_mode == IPA_HW_MODE_VIRTUAL) return 0; ipa_write_reg(ipa_ctx->mmio, IPA_ENDP_INIT_CTRL_N_OFST(clnt_hdl), 1); memset(&ep_cfg_ctrl, 0 , sizeof(struct ipa_ep_cfg_ctrl)); ep_cfg_ctrl.ipa_ep_suspend = true; ipa_cfg_ep_ctrl(clnt_hdl, &ep_cfg_ctrl); udelay(IPA_PKT_FLUSH_TO_US); if (IPA_CLIENT_IS_CONS(ep->client) && ep->cfg.aggr.aggr_en == IPA_ENABLE_AGGR && Loading
drivers/platform/msm/ipa/ipa_i.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -901,6 +901,7 @@ void ipa_enable_clks(void); void ipa_disable_clks(void); void ipa_inc_client_enable_clks(void); void ipa_dec_client_disable_clks(void); int ipa_interrupts_init(u32 ipa_irq, u32 ee, struct device *ipa_dev); int __ipa_del_rt_rule(u32 rule_hdl); int __ipa_del_hdr(u32 hdr_hdl); int __ipa_release_hdr(u32 hdr_hdl); Loading