public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Suman Anna <s-anna@ti.com>
To: Jassi Brar <jassisinghbrar@gmail.com>
Cc: <loic.pallardy@st.com>, <arnd@arndb.de>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Jassi Brar <jaswinder.singh@linaro.org>
Subject: Re: [PATCHv2 2/4] mailbox: Introduce a new common API
Date: Thu, 9 May 2013 11:31:07 -0500	[thread overview]
Message-ID: <518BCF4B.1060504@ti.com> (raw)
In-Reply-To: <1367825046-6229-1-git-send-email-jaswinder.singh@linaro.org>

Hi Jassi,

On 05/06/2013 02:24 AM, Jassi Brar wrote:
> +++ b/include/linux/mailbox_client.h
> @@ -0,0 +1,85 @@
> +/*
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef __MAILBOX_CLIENT_H
> +#define __MAILBOX_CLIENT_H
> +
> +#include <linux/mailbox.h>
> +
> +/**
> + * struct ipc_client - User of a mailbox
> + * @chan_name: the "controller:channel" this client wants
> + * @rxcb: atomic callback to provide client the data received
> + * @txcb: atomic callback to tell client of data transmission
> + * @tx_block: if the ipc_send_message should block until data is transmitted
> + * @tx_tout: Max block period in ms before TX is assumed failure
> + * @knows_txdone: if the client could run the TX state machine. Usually if
> + *    the client receives some ACK packet for transmission. Unused if the
> + *    controller already has TX_Done/RTR IRQ.
> + * @cntlr_data: Optional controller specific parameters during channel request
> + */
> +struct ipc_client {
> +	char *chan_name;
> +	void (*rxcb)(void *data);
> +	void (*txcb)(request_token_t t, enum xfer_result r);

We have to introduce a callback data pointer, so that the calling
clients can retrieve a context object variable or some other useful
data within the callback functions, just like most normal callback
function declarations and registrations do.

> +	bool tx_block;
> +	unsigned long tx_tout;
> +	bool knows_txdone;
> +	void *cntlr_data;
> +};

regards
Suman





  reply	other threads:[~2013-05-09 16:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06  7:22 [PATCHv2 0/4] mailbox: Common API Jassi Brar
2013-05-06  7:23 ` [PATCHv2 1/4] mailbox: rename pl320-ipc specific mailbox.h Jassi Brar
2013-05-06  7:24 ` [PATCHv2 2/4] mailbox: Introduce a new common API Jassi Brar
2013-05-09 16:31   ` Suman Anna [this message]
2013-05-09 16:41     ` Jassi Brar
2013-05-09 16:40       ` Suman Anna
2013-05-09 17:48         ` Jassi Brar
2013-05-09 18:05           ` Suman Anna
2013-05-09 18:49             ` Jassi Brar
2013-05-09 23:43               ` Suman Anna
2013-05-06  7:24 ` [PATCHv2 3/4] mailbox: pl320: Introduce common API driver Jassi Brar
2013-05-07  1:58   ` Rob Herring
2013-05-07 16:56     ` Jassi Brar
2013-05-06  7:24 ` [PATCHv2 4/4] mailbox: omap2: " Jassi Brar
2013-05-07  0:02 ` [PATCHv2 0/4] mailbox: Common API Suman Anna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=518BCF4B.1060504@ti.com \
    --to=s-anna@ti.com \
    --cc=arnd@arndb.de \
    --cc=jassisinghbrar@gmail.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.pallardy@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox