Loading drivers/soc/qcom/glink.c +34 −0 Original line number Diff line number Diff line Loading @@ -1538,6 +1538,18 @@ static int dummy_mask_rx_irq(struct glink_transport_if *if_ptr, uint32_t lcid, return -EOPNOTSUPP; } /** * dummy_wait_link_down() - a dummy wait_link_down() for transports that don't * define one * @if_ptr: The transport interface handle for this transport. * * Return: An error to indicate that this operation is unsupported. */ static int dummy_wait_link_down(struct glink_transport_if *if_ptr) { return -EOPNOTSUPP; } /** * notif_if_up_all_xprts() - Check and notify existing transport state if up * @notif_info: Data structure containing transport information to be notified. Loading Loading @@ -2325,6 +2337,26 @@ int glink_rpm_mask_rx_interrupt(void *handle, bool mask, void *pstruct) } EXPORT_SYMBOL(glink_rpm_mask_rx_interrupt); /** * glink_wait_link_down() - Get status of link * @handle: Channel handle in which this operation is performed * * This function will query the transport for its status, to allow clients to * proceed in cleanup operations. */ int glink_wait_link_down(void *handle) { struct channel_ctx *ctx = (struct channel_ctx *)handle; if (!ctx) return -EINVAL; if (!ctx->transport_ptr) return -EOPNOTSUPP; return ctx->transport_ptr->ops->wait_link_down(ctx->transport_ptr->ops); } EXPORT_SYMBOL(glink_wait_link_down); /** * glink_xprt_ctx_release - Free the transport context * @ch_st_lock: handle to the rwref_lock associated with the transport Loading Loading @@ -2430,6 +2462,8 @@ int glink_core_register_transport(struct glink_transport_if *if_ptr, if_ptr->mask_rx_irq = dummy_mask_rx_irq; if (!if_ptr->reuse_rx_intent) if_ptr->reuse_rx_intent = dummy_reuse_rx_intent; if (!if_ptr->wait_link_down) if_ptr->wait_link_down = dummy_wait_link_down; xprt_ptr->capabilities = 0; xprt_ptr->ops = if_ptr; spin_lock_init(&xprt_ptr->xprt_ctx_lock_lhb1); Loading drivers/soc/qcom/glink_smem_native_xprt.c +22 −0 Original line number Diff line number Diff line Loading @@ -1151,6 +1151,27 @@ static int ssr(struct glink_transport_if *if_ptr) return 0; } /** * int wait_link_down() - Check status of read/write indices * @if_ptr: The transport to check * * Return: 1 if indices are all zero, 0 otherwise */ int wait_link_down(struct glink_transport_if *if_ptr) { struct edge_info *einfo; einfo = container_of(if_ptr, struct edge_info, xprt_if); if (einfo->tx_ch_desc->write_index == 0 && einfo->tx_ch_desc->read_index == 0 && einfo->rx_ch_desc->write_index == 0 && einfo->rx_ch_desc->read_index == 0) return 1; else return 0; } /** * allocate_rx_intent() - allocate/reserve space for RX Intent * @if_ptr: The transport the intent is associated with. Loading Loading @@ -1640,6 +1661,7 @@ static void init_xprt_if(struct edge_info *einfo) einfo->xprt_if.tx_cmd_set_sigs = tx_cmd_set_sigs; einfo->xprt_if.poll = poll; einfo->xprt_if.mask_rx_irq = mask_rx_irq; einfo->xprt_if.wait_link_down = wait_link_down; } /** Loading drivers/soc/qcom/glink_xprt_if.h +1 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ struct glink_transport_if { int (*poll)(struct glink_transport_if *if_ptr, uint32_t lcid); int (*mask_rx_irq)(struct glink_transport_if *if_ptr, uint32_t lcid, bool mask, void *pstruct); int (*wait_link_down)(struct glink_transport_if *if_ptr); /* * Keep data pointers at the end of the structure after all function Loading include/soc/qcom/glink_rpm_xprt.h +15 −1 Original line number Diff line number Diff line /* Copyright (c) 2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2015, 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 @@ -47,6 +47,16 @@ int glink_rpm_rx_poll(void *handle); */ int glink_rpm_mask_rx_interrupt(void *handle, bool mask, void *pstruct); /** * glink_wait_link_down() - Return whether read/write indices in FIFO are all 0. * @handle: Channel handle in which this operation is performed. * * This function returns the status of the read/write indices in the FIFO. * * Return: 1 if the indices are all 0, 0 otherwise. */ int glink_wait_link_down(void *handle); #else static inline int glink_rpm_rx_poll(void *handle) { Loading @@ -58,6 +68,10 @@ static inline int glink_rpm_mask_rx_interrupt(void *handle, bool mask, { return -ENODEV; } static inline int glink_wait_link_down(void *handle) { return -ENODEV; } #endif /* CONFIG_MSM_GLINK */ Loading Loading
drivers/soc/qcom/glink.c +34 −0 Original line number Diff line number Diff line Loading @@ -1538,6 +1538,18 @@ static int dummy_mask_rx_irq(struct glink_transport_if *if_ptr, uint32_t lcid, return -EOPNOTSUPP; } /** * dummy_wait_link_down() - a dummy wait_link_down() for transports that don't * define one * @if_ptr: The transport interface handle for this transport. * * Return: An error to indicate that this operation is unsupported. */ static int dummy_wait_link_down(struct glink_transport_if *if_ptr) { return -EOPNOTSUPP; } /** * notif_if_up_all_xprts() - Check and notify existing transport state if up * @notif_info: Data structure containing transport information to be notified. Loading Loading @@ -2325,6 +2337,26 @@ int glink_rpm_mask_rx_interrupt(void *handle, bool mask, void *pstruct) } EXPORT_SYMBOL(glink_rpm_mask_rx_interrupt); /** * glink_wait_link_down() - Get status of link * @handle: Channel handle in which this operation is performed * * This function will query the transport for its status, to allow clients to * proceed in cleanup operations. */ int glink_wait_link_down(void *handle) { struct channel_ctx *ctx = (struct channel_ctx *)handle; if (!ctx) return -EINVAL; if (!ctx->transport_ptr) return -EOPNOTSUPP; return ctx->transport_ptr->ops->wait_link_down(ctx->transport_ptr->ops); } EXPORT_SYMBOL(glink_wait_link_down); /** * glink_xprt_ctx_release - Free the transport context * @ch_st_lock: handle to the rwref_lock associated with the transport Loading Loading @@ -2430,6 +2462,8 @@ int glink_core_register_transport(struct glink_transport_if *if_ptr, if_ptr->mask_rx_irq = dummy_mask_rx_irq; if (!if_ptr->reuse_rx_intent) if_ptr->reuse_rx_intent = dummy_reuse_rx_intent; if (!if_ptr->wait_link_down) if_ptr->wait_link_down = dummy_wait_link_down; xprt_ptr->capabilities = 0; xprt_ptr->ops = if_ptr; spin_lock_init(&xprt_ptr->xprt_ctx_lock_lhb1); Loading
drivers/soc/qcom/glink_smem_native_xprt.c +22 −0 Original line number Diff line number Diff line Loading @@ -1151,6 +1151,27 @@ static int ssr(struct glink_transport_if *if_ptr) return 0; } /** * int wait_link_down() - Check status of read/write indices * @if_ptr: The transport to check * * Return: 1 if indices are all zero, 0 otherwise */ int wait_link_down(struct glink_transport_if *if_ptr) { struct edge_info *einfo; einfo = container_of(if_ptr, struct edge_info, xprt_if); if (einfo->tx_ch_desc->write_index == 0 && einfo->tx_ch_desc->read_index == 0 && einfo->rx_ch_desc->write_index == 0 && einfo->rx_ch_desc->read_index == 0) return 1; else return 0; } /** * allocate_rx_intent() - allocate/reserve space for RX Intent * @if_ptr: The transport the intent is associated with. Loading Loading @@ -1640,6 +1661,7 @@ static void init_xprt_if(struct edge_info *einfo) einfo->xprt_if.tx_cmd_set_sigs = tx_cmd_set_sigs; einfo->xprt_if.poll = poll; einfo->xprt_if.mask_rx_irq = mask_rx_irq; einfo->xprt_if.wait_link_down = wait_link_down; } /** Loading
drivers/soc/qcom/glink_xprt_if.h +1 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ struct glink_transport_if { int (*poll)(struct glink_transport_if *if_ptr, uint32_t lcid); int (*mask_rx_irq)(struct glink_transport_if *if_ptr, uint32_t lcid, bool mask, void *pstruct); int (*wait_link_down)(struct glink_transport_if *if_ptr); /* * Keep data pointers at the end of the structure after all function Loading
include/soc/qcom/glink_rpm_xprt.h +15 −1 Original line number Diff line number Diff line /* Copyright (c) 2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2015, 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 @@ -47,6 +47,16 @@ int glink_rpm_rx_poll(void *handle); */ int glink_rpm_mask_rx_interrupt(void *handle, bool mask, void *pstruct); /** * glink_wait_link_down() - Return whether read/write indices in FIFO are all 0. * @handle: Channel handle in which this operation is performed. * * This function returns the status of the read/write indices in the FIFO. * * Return: 1 if the indices are all 0, 0 otherwise. */ int glink_wait_link_down(void *handle); #else static inline int glink_rpm_rx_poll(void *handle) { Loading @@ -58,6 +68,10 @@ static inline int glink_rpm_mask_rx_interrupt(void *handle, bool mask, { return -ENODEV; } static inline int glink_wait_link_down(void *handle) { return -ENODEV; } #endif /* CONFIG_MSM_GLINK */ Loading