From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Jerome Arbez-Gindre <jeromearbezgindre@gmail.com>
Cc: linux-kernel@vger.kernel.org, deweerdt@free.fr
Subject: Re: New IDX in linux/connector.h ?
Date: Wed, 23 Jul 2008 18:04:50 +0400 [thread overview]
Message-ID: <20080723140450.GA30991@2ka.mipt.ru> (raw)
In-Reply-To: <a1d7a2f20807230645t461265ecu2d9e7f70484a8c91@mail.gmail.com>
On Wed, Jul 23, 2008 at 03:45:09PM +0200, Jerome Arbez-Gindre (jeromearbezgindre@gmail.com) wrote:
> diff --git a/include/linux/connector.h b/include/linux/connector.h
> index 96a89d3..361996c 100644
> --- a/include/linux/connector.h
> +++ b/include/linux/connector.h
> @@ -38,6 +38,7 @@
> #define CN_W1_VAL 0x1
> #define CN_IDX_V86D 0x4
> #define CN_VAL_V86D_UVESAFB 0x1
> +#define CN_IDX_BB 0x5
>
> #define CN_NETLINK_USERS 5
Update this number too.
While it is less than 32, it does not matter, but just for the record.
> > I even wanted to have private indexes, i.e. those which are supposed to
> > be used by out-of-the-tree code, and no in-kernel users would ever touch
> > this numbers.
>
> So which numbers am I suppose to use ... taking account that BB will
> probably stay for a long time out-of-the-tree ?
You can use whatever VAL number you like:
struct cb_id cn_dst_id[] = {{CN_DST_IDX, 1}, {CN_DST_IDX, 2}, {CN_DST_IDX, 3}};
for (i=0; i<ARRAY_SIZE(cn_dst_id); ++i)
cn_add_callback(&cn_dst_id[i], "DST", cn_dst_callback_func);
So cn_dst_callback_func() will be invoked for
idx=CN_DST_IDX,val={1,2,3}, you can determine val parameter from the
provided header and make appropriate decition.
You can also register multiple different callbacks for each idx.val
pair of course.
--
Evgeniy Polyakov
prev parent reply other threads:[~2008-07-23 14:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-23 12:40 Jerome Arbez-Gindre
2008-07-23 12:53 ` Evgeniy Polyakov
2008-07-23 13:45 ` Jerome Arbez-Gindre
2008-07-23 14:04 ` Evgeniy Polyakov [this message]
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=20080723140450.GA30991@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=deweerdt@free.fr \
--cc=jeromearbezgindre@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®