Re: [Xen-devel] [PATCH v1 1/2] xen/kbdif: update protocol documentation

2017-01-20 Thread Stefano Stabellini
On Fri, 20 Jan 2017, Oleksandr Andrushchenko wrote:
> On 01/19/2017 08:56 PM, Stefano Stabellini wrote:
> > On Thu, 19 Jan 2017, Oleksandr Andrushchenko wrote:
> > > From: Oleksandr Andrushchenko 
> > > 
> > > Signed-off-by: Oleksandr Andrushchenko 
> > > ---
> > >   xen/include/public/io/kbdif.h | 248
> > > +-
> > >   1 file changed, 221 insertions(+), 27 deletions(-)
> > > 
> > > diff --git a/xen/include/public/io/kbdif.h b/xen/include/public/io/kbdif.h
> > > index 2d2aebdd3f28..c00faa3af5d2 100644
> > > --- a/xen/include/public/io/kbdif.h
> > > +++ b/xen/include/public/io/kbdif.h
> > > @@ -26,46 +26,226 @@
> > >   #ifndef __XEN_PUBLIC_IO_KBDIF_H__
> > >   #define __XEN_PUBLIC_IO_KBDIF_H__
> > >   -/* In events (backend -> frontend) */
> > > +/*
> > > +
> > > *
> > > + * Feature and Parameter Negotiation
> > > +
> > > *
> > > + *
> > > + * The two halves of a para-virtual driver utilize nodes within the
> > within "XenStore", drop "the"
> > 
> > Aside from this minor this:
> > 
> > Reviewed-by: Stefano Stabellini 
> Thanks,
> with this change done, can I put your Reviewed-by
> into the next version of this patch?

Of course. Thanks,

Stefano

> > > + * XenStore to communicate capabilities and to negotiate operating
> > > parameters.
> > > + * This section enumerates these nodes which reside in the respective
> > > front and
> > > + * backend portions of XenStore, following XenBus convention.
> > > + *
> > > + * All data in XenStore is stored as strings.  Nodes specifying numeric
> > > + * values are encoded in decimal. Integer value ranges listed below are
> > > + * expressed as fixed sized integer types capable of storing the
> > > conversion
> > > + * of a properly formated node string, without loss of information.
> > > + *
> > > +
> > > *
> > > + *Backend XenBus Nodes
> > > +
> > > *
> > > + *
> > > + * Features supported
> > > 
> > > + *
> > > + * Capable backend advertises supported features by publishing
> > > + * corresponding entries in XenStore and puts 1 as the value of the
> > > entry.
> > > + * If a feature is not supported then 0 must be set or feature entry
> > > omitted.
> > > + *
> > > + * feature-abs-pointer
> > > + *  Values: 
> > > + *
> > > + *  Backends, which support reporting of absolute coordinates for
> > > pointer
> > > + *  device should set this to 1.
> > > + *
> > > + *- Pointer Device Parameters
> > > 
> > > + *
> > > + * width
> > > + *  Values: 
> > > + *
> > > + *  Maximum X coordinate (width) to be used by the frontend
> > > + *  while reporting input events, pixels, [0; UINT32_MAX].
> > > + *
> > > + * height
> > > + *  Values: 
> > > + *
> > > + *  Maximum Y coordinate (height) to be used by the frontend
> > > + *  while reporting input events, pixels, [0; UINT32_MAX].
> > > + *
> > > +
> > > *
> > > + *Frontend XenBus Nodes
> > > +
> > > *
> > > + *
> > > + *-- Feature request
> > > -
> > > + *
> > > + * Capable frontend requests features from backend via setting
> > > corresponding
> > > + * entries to 1 in XenStore. Requests for features not advertised as
> > > supported
> > > + * by the backend have no effect.
> > > + *
> > > + * request-abs-pointer
> > > + *  Values: 
> > > + *
> > > + *  Request backend to report absolute pointer coordinates
> > > + *  (XENKBD_TYPE_POS) instead of relative ones (XENKBD_TYPE_MOTION).
> > > + *
> > > + *--- Request Transport Parameters
> > > ---
> > > + *
> > > + * event-channel
> > > + *  Values: 
> > > + *
> > > + *  The identifier of the Xen event channel used to signal activity
> > > + *  in the ring buffer.
> > > + *
> > > + * page-gref
> > > + *  Values: 
> > > + *
> > > + *  The Xen grant reference granting permission for the backend to
> > > map
> > > + *  a sole page in a single page sized event ring buffer.
> > > + *
> > > + * page-ref
> > > + *  Values: 
> > > + *
> > > + *  OBSOLETE, not recommended for use.
> > > + *  PFN of the shared page.
> > > + */
> > > /*
> > > - * Frontends should ignore unknown in events.
> > > + * EVENT CODES.
> > >*/
> > >   -/* Pointer movement event */
> > > -#define XENKBD_TYPE_MOTION  

Re: [Xen-devel] [PATCH v1 1/2] xen/kbdif: update protocol documentation

2017-01-19 Thread Oleksandr Andrushchenko

On 01/19/2017 08:56 PM, Stefano Stabellini wrote:

On Thu, 19 Jan 2017, Oleksandr Andrushchenko wrote:

From: Oleksandr Andrushchenko 

Signed-off-by: Oleksandr Andrushchenko 
---
  xen/include/public/io/kbdif.h | 248 +-
  1 file changed, 221 insertions(+), 27 deletions(-)

diff --git a/xen/include/public/io/kbdif.h b/xen/include/public/io/kbdif.h
index 2d2aebdd3f28..c00faa3af5d2 100644
--- a/xen/include/public/io/kbdif.h
+++ b/xen/include/public/io/kbdif.h
@@ -26,46 +26,226 @@
  #ifndef __XEN_PUBLIC_IO_KBDIF_H__
  #define __XEN_PUBLIC_IO_KBDIF_H__
  
-/* In events (backend -> frontend) */

+/*
+ *
+ * Feature and Parameter Negotiation
+ *
+ *
+ * The two halves of a para-virtual driver utilize nodes within the

within "XenStore", drop "the"

Aside from this minor this:

Reviewed-by: Stefano Stabellini 

Thanks,
with this change done, can I put your Reviewed-by
into the next version of this patch?



+ * XenStore to communicate capabilities and to negotiate operating parameters.
+ * This section enumerates these nodes which reside in the respective front and
+ * backend portions of XenStore, following XenBus convention.
+ *
+ * All data in XenStore is stored as strings.  Nodes specifying numeric
+ * values are encoded in decimal. Integer value ranges listed below are
+ * expressed as fixed sized integer types capable of storing the conversion
+ * of a properly formated node string, without loss of information.
+ *
+ *
+ *Backend XenBus Nodes
+ *
+ *
+ * Features supported 
+ *
+ * Capable backend advertises supported features by publishing
+ * corresponding entries in XenStore and puts 1 as the value of the entry.
+ * If a feature is not supported then 0 must be set or feature entry omitted.
+ *
+ * feature-abs-pointer
+ *  Values: 
+ *
+ *  Backends, which support reporting of absolute coordinates for pointer
+ *  device should set this to 1.
+ *
+ *- Pointer Device Parameters 
+ *
+ * width
+ *  Values: 
+ *
+ *  Maximum X coordinate (width) to be used by the frontend
+ *  while reporting input events, pixels, [0; UINT32_MAX].
+ *
+ * height
+ *  Values: 
+ *
+ *  Maximum Y coordinate (height) to be used by the frontend
+ *  while reporting input events, pixels, [0; UINT32_MAX].
+ *
+ *
+ *Frontend XenBus Nodes
+ *
+ *
+ *-- Feature request -
+ *
+ * Capable frontend requests features from backend via setting corresponding
+ * entries to 1 in XenStore. Requests for features not advertised as supported
+ * by the backend have no effect.
+ *
+ * request-abs-pointer
+ *  Values: 
+ *
+ *  Request backend to report absolute pointer coordinates
+ *  (XENKBD_TYPE_POS) instead of relative ones (XENKBD_TYPE_MOTION).
+ *
+ *--- Request Transport Parameters ---
+ *
+ * event-channel
+ *  Values: 
+ *
+ *  The identifier of the Xen event channel used to signal activity
+ *  in the ring buffer.
+ *
+ * page-gref
+ *  Values: 
+ *
+ *  The Xen grant reference granting permission for the backend to map
+ *  a sole page in a single page sized event ring buffer.
+ *
+ * page-ref
+ *  Values: 
+ *
+ *  OBSOLETE, not recommended for use.
+ *  PFN of the shared page.
+ */
  
  /*

- * Frontends should ignore unknown in events.
+ * EVENT CODES.
   */
  
-/* Pointer movement event */

-#define XENKBD_TYPE_MOTION  1
-/* Event type 2 currently not used */
-/* Key event (includes pointer buttons) */
-#define XENKBD_TYPE_KEY 3
+#define XENKBD_TYPE_MOTION 1
+#define XENKBD_TYPE_RESERVED   2
+#define XENKBD_TYPE_KEY3
+#define XENKBD_TYPE_POS4
+
  /*
- * Pointer position event
- * Capable backend sets feature-abs-pointer in xenstore.
- * Frontend requests ot instead of XENKBD_TYPE_MOTION by setting
- * request-abs-update in xenstore.
+ * CONSTANTS, XENSTORE FIELD AND PATH NAME STRINGS, HELPERS.
+ */
+
+#define XENKBD_DRIVER_NAME "vkbd"
+
+#define XENKBD_FIELD_FEAT_ABS_POINTER  "feature-abs-pointer"
+#define XENKBD_FIELD_REQ_ABS_POINTER   "request-abs-pointer"
+#define XENKBD_FIELD_RING_GREF "page-gref"
+#define XENKBD_FIELD_EVT_CHANNEL   "event-channel"
+#de

Re: [Xen-devel] [PATCH v1 1/2] xen/kbdif: update protocol documentation

2017-01-19 Thread Stefano Stabellini
On Thu, 19 Jan 2017, Oleksandr Andrushchenko wrote:
> From: Oleksandr Andrushchenko 
> 
> Signed-off-by: Oleksandr Andrushchenko 
> ---
>  xen/include/public/io/kbdif.h | 248 
> +-
>  1 file changed, 221 insertions(+), 27 deletions(-)
> 
> diff --git a/xen/include/public/io/kbdif.h b/xen/include/public/io/kbdif.h
> index 2d2aebdd3f28..c00faa3af5d2 100644
> --- a/xen/include/public/io/kbdif.h
> +++ b/xen/include/public/io/kbdif.h
> @@ -26,46 +26,226 @@
>  #ifndef __XEN_PUBLIC_IO_KBDIF_H__
>  #define __XEN_PUBLIC_IO_KBDIF_H__
>  
> -/* In events (backend -> frontend) */
> +/*
> + 
> *
> + * Feature and Parameter Negotiation
> + 
> *
> + *
> + * The two halves of a para-virtual driver utilize nodes within the

within "XenStore", drop "the"

Aside from this minor this:

Reviewed-by: Stefano Stabellini 


> + * XenStore to communicate capabilities and to negotiate operating 
> parameters.
> + * This section enumerates these nodes which reside in the respective front 
> and
> + * backend portions of XenStore, following XenBus convention.
> + *
> + * All data in XenStore is stored as strings.  Nodes specifying numeric
> + * values are encoded in decimal. Integer value ranges listed below are
> + * expressed as fixed sized integer types capable of storing the conversion
> + * of a properly formated node string, without loss of information.
> + *
> + 
> *
> + *Backend XenBus Nodes
> + 
> *
> + *
> + * Features supported 
> 
> + *
> + * Capable backend advertises supported features by publishing
> + * corresponding entries in XenStore and puts 1 as the value of the entry.
> + * If a feature is not supported then 0 must be set or feature entry omitted.
> + *
> + * feature-abs-pointer
> + *  Values: 
> + *
> + *  Backends, which support reporting of absolute coordinates for pointer
> + *  device should set this to 1.
> + *
> + *- Pointer Device Parameters 
> 
> + *
> + * width
> + *  Values: 
> + *
> + *  Maximum X coordinate (width) to be used by the frontend
> + *  while reporting input events, pixels, [0; UINT32_MAX].
> + *
> + * height
> + *  Values: 
> + *
> + *  Maximum Y coordinate (height) to be used by the frontend
> + *  while reporting input events, pixels, [0; UINT32_MAX].
> + *
> + 
> *
> + *Frontend XenBus Nodes
> + 
> *
> + *
> + *-- Feature request 
> -
> + *
> + * Capable frontend requests features from backend via setting corresponding
> + * entries to 1 in XenStore. Requests for features not advertised as 
> supported
> + * by the backend have no effect.
> + *
> + * request-abs-pointer
> + *  Values: 
> + *
> + *  Request backend to report absolute pointer coordinates
> + *  (XENKBD_TYPE_POS) instead of relative ones (XENKBD_TYPE_MOTION).
> + *
> + *--- Request Transport Parameters 
> ---
> + *
> + * event-channel
> + *  Values: 
> + *
> + *  The identifier of the Xen event channel used to signal activity
> + *  in the ring buffer.
> + *
> + * page-gref
> + *  Values: 
> + *
> + *  The Xen grant reference granting permission for the backend to map
> + *  a sole page in a single page sized event ring buffer.
> + *
> + * page-ref
> + *  Values: 
> + *
> + *  OBSOLETE, not recommended for use.
> + *  PFN of the shared page.
> + */
>  
>  /*
> - * Frontends should ignore unknown in events.
> + * EVENT CODES.
>   */
>  
> -/* Pointer movement event */
> -#define XENKBD_TYPE_MOTION  1
> -/* Event type 2 currently not used */
> -/* Key event (includes pointer buttons) */
> -#define XENKBD_TYPE_KEY 3
> +#define XENKBD_TYPE_MOTION 1
> +#define XENKBD_TYPE_RESERVED   2
> +#define XENKBD_TYPE_KEY3
> +#define XENKBD_TYPE_POS4
> +
>  /*
> - * Pointer position event
> - * Capable backend sets feature-abs-pointer in xenstore.
> - * Frontend requests ot instead of XENKBD_TYPE_MOTION by setting
> - * request-abs-update in xenstore.
> + * CONSTANTS, XENSTORE FIELD AND PATH NAME STRINGS, HELPERS.
> + */
> +
> +#define XENKBD_DRIVER_NAME "vkbd"
> +
> +#define XENKBD_FIELD_FEAT_ABS_POINTER  "feature-abs-pointer"
> +#define XENKBD_FIELD_REQ_ABS_POINTER   "requ