soc: qcom: glink: Add notify_remote_rx_intent callback support

In some cases local clients transmit the data without GLINK_TX_REQ_INTENT
flag and fails if remote client not queued the matching rx_intent.

Add callback support to notify the local clients when remote client queue
an RX intent so that the client can track the remote intents.

CRs-Fixed: 847641
Change-Id: I649a054324ae7ed758a849345f41e3e26137f1f1
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
This commit is contained in:
Arun Kumar Neelakantam 2015-05-25 18:34:14 +05:30
parent 931faaad60
commit 89272719f9
2 changed files with 13 additions and 2 deletions

View File

@ -123,6 +123,7 @@ struct glink_core_xprt_ctx {
* @notify_rx_abort: Channel close RX Intent aborted
* @notify_tx_abort: Channel close TX aborted
* @notify_rx_tracer_pkt: Receive notification for tracer packet
* @notify_remote_rx_intent: Receive notification for remote-queued RX intent
*
* @transport_ptr: Transport this channel uses
* @lcid: Local channel ID
@ -188,6 +189,8 @@ struct channel_ctx {
const void *pkt_priv);
void (*notify_rx_tracer_pkt)(void *handle, const void *priv,
const void *pkt_priv, const void *ptr, size_t size);
void (*notify_remote_rx_intent)(void *handle, const void *priv,
size_t size);
/* internal port state */
struct glink_core_xprt_ctx *transport_ptr;
@ -1935,8 +1938,10 @@ void *glink_open(const struct glink_open_config *cfg)
}
/* confirm required notification parameters */
if (!(cfg->notify_rx || cfg->notify_rxv) || !cfg->notify_tx_done ||
!cfg->notify_state) {
if (!(cfg->notify_rx || cfg->notify_rxv) || !cfg->notify_tx_done
|| !cfg->notify_state
|| ((cfg->options & GLINK_OPT_RX_INTENT_NOTIF)
&& !cfg->notify_remote_rx_intent)) {
GLINK_ERR("%s: Incorrect notification parameters\n", __func__);
return ERR_PTR(-EINVAL);
}
@ -1983,6 +1988,7 @@ void *glink_open(const struct glink_open_config *cfg)
ctx->notify_rx_abort = cfg->notify_rx_abort;
ctx->notify_tx_abort = cfg->notify_tx_abort;
ctx->notify_rx_tracer_pkt = cfg->notify_rx_tracer_pkt;
ctx->notify_remote_rx_intent = cfg->notify_remote_rx_intent;
if (!ctx->notify_rx_intent_req)
ctx->notify_rx_intent_req = glink_dummy_notify_rx_intent_req;
@ -3811,6 +3817,8 @@ static void glink_core_remote_rx_intent_put(struct glink_transport_if *if_ptr,
ch_push_remote_rx_intent(ctx, size, riid);
complete_all(&ctx->int_req_complete);
if (ctx->notify_remote_rx_intent)
ctx->notify_remote_rx_intent(ctx, ctx->user_priv, size);
rwref_put(&ctx->ch_state_lhc0);
}

View File

@ -53,6 +53,7 @@ enum {
* notify_rx is not provided)
* notify_sig: Signal-change notification (optional)
* notify_rx_tracer_pkt: Receive notification for tracer packet
* notify_remote_rx_intent: Receive notification for remote-queued RX intent
*
* This structure is passed into the glink_open() call to setup
* configuration handles. All unused fields should be set to 0.
@ -88,6 +89,8 @@ struct glink_open_config {
const void *pkt_priv);
void (*notify_rx_tracer_pkt)(void *handle, const void *priv,
const void *pkt_priv, const void *ptr, size_t size);
void (*notify_remote_rx_intent)(void *handle, const void *priv,
size_t size);
};
enum glink_link_state {