linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: KY Srinivasan <kys@microsoft.com>
Cc: "olaf@aepfle.de" <olaf@aepfle.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"vojtech@suse.cz" <vojtech@suse.cz>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"apw@canonical.com" <apw@canonical.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>
Subject: Re: [PATCH 1/1] Drivers: input: serio: New driver to support Hyper-V synthetic keyboard
Date: Mon, 16 Sep 2013 10:13:20 -0700	[thread overview]
Message-ID: <20130916171320.GC20734@core.coreip.homeip.net> (raw)
In-Reply-To: <076938490f5141ef957947dc10b82c65@SN2PR03MB061.namprd03.prod.outlook.com>

On Mon, Sep 16, 2013 at 03:52:18PM +0000, KY Srinivasan wrote:
> 
> 
> > -----Original Message-----
> > From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> > Sent: Monday, September 16, 2013 8:20 AM
> > To: KY Srinivasan
> > Cc: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org;
> > devel@linuxdriverproject.org; linux-input@vger.kernel.org; vojtech@suse.cz;
> > olaf@aepfle.de; apw@canonical.com; jasowang@redhat.com
> > Subject: Re: [PATCH 1/1] Drivers: input: serio: New driver to support Hyper-V
> > synthetic keyboard
> > 
> > Hi K. Y.
> > 
> > On Sun, Sep 15, 2013 at 10:28:54PM -0700, K. Y. Srinivasan wrote:
> > > Add a new driver to support synthetic keyboard. On the next generation
> > > Hyper-V guest firmware, many legacy devices will not be emulated and this
> > > driver will be required.
> > >
> > > I would like to thank Vojtech Pavlik <vojtech@suse.cz> for helping me with the
> > > details of the AT keyboard driver.
> > >
> > 
> > In addition to what Dan said:
> > 
> > > +
> > > +struct synth_kbd_protocol_response {
> > > +	struct synth_kbd_msg_hdr header;
> > > +	u32 accepted:1;
> > > +	u32 reserved:31;
> > > +};
> > 
> > Use of bitfields for on the wire structures makes me uneasy. I know that
> > currently you only going to run LE on LE, but still, maybe using
> > explicit shifts and masks would be better,
> 
> This definition of the data structure is defined by the host. I will see what I
> can do here.

You do not really need to change protocol, you just sat that accepted is
the bit 0 of the word and define endianness (LE in your case). Then you
do:

	struct synth_kbd_protocol_response {
		struct synth_kbd_msg_hdr header;
		__le32 status;
	}

	#define KBD_PROTOCOL_ACCEPTED BIT(0)

	...

	status = _le32_to_cpu(response->status);
	accepted = status & KBD_PROTOCOL_ACCEPTED;

Thanks.

-- 
Dmitry

      reply	other threads:[~2013-09-16 17:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16  5:28 [PATCH 1/1] Drivers: input: serio: New driver to support Hyper-V synthetic keyboard K. Y. Srinivasan
2013-09-16  8:21 ` Dan Carpenter
2013-09-16 14:46   ` KY Srinivasan
2013-09-16 15:05     ` Dan Carpenter
2013-09-16 16:56       ` KY Srinivasan
2013-09-16 17:09         ` Dmitry Torokhov
2013-09-16 18:29           ` KY Srinivasan
2013-09-16 18:33             ` Dan Carpenter
2013-09-16 18:42               ` KY Srinivasan
2013-09-16 20:13                 ` Dan Carpenter
2013-09-16 21:55                   ` KY Srinivasan
2013-09-16 22:13                     ` Dan Carpenter
2013-09-16 22:16             ` Dmitry Torokhov
2013-09-16 15:20 ` Dmitry Torokhov
2013-09-16 15:52   ` KY Srinivasan
2013-09-16 17:13     ` Dmitry Torokhov [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=20130916171320.GC20734@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=vojtech@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).