[PATCH v2 1/3] include/public: add possible status values to usbif.h

Juergen Gross posted 3 patches 3 years, 2 months ago
[PATCH v2 1/3] include/public: add possible status values to usbif.h
Posted by Juergen Gross 3 years, 2 months ago
The interface definition of PV USB devices is lacking the specification
of possible values of the status field in a response. Those are
negative errno values as used in Linux, so they might differ in other
OS's. Specify them via appropriate defines.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- add parentheses to macro values (Jan Beulich)
---
 xen/include/public/io/usbif.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/include/public/io/usbif.h b/xen/include/public/io/usbif.h
index c6a58639d6..96b9fb661d 100644
--- a/xen/include/public/io/usbif.h
+++ b/xen/include/public/io/usbif.h
@@ -221,6 +221,13 @@ struct usbif_urb_response {
 	uint16_t id; /* request id */
 	uint16_t start_frame;  /* start frame (ISO) */
 	int32_t status; /* status (non-ISO) */
+#define USBIF_STATUS_OK		0
+#define USBIF_STATUS_NODEV	(-19)
+#define USBIF_STATUS_INVAL	(-22)
+#define USBIF_STATUS_STALL	(-32)
+#define USBIF_STATUS_IOERROR	(-71)
+#define USBIF_STATUS_BABBLE	(-75)
+#define USBIF_STATUS_SHUTDOWN	(-108)
 	int32_t actual_length; /* actual transfer length */
 	int32_t error_count; /* number of ISO errors */
 };
-- 
2.26.2


Re: [PATCH v2 1/3] include/public: add possible status values to usbif.h
Posted by Luca Fancellu 3 years, 2 months ago

> On 29 Sep 2021, at 08:46, Juergen Gross <jgross@suse.com> wrote:
> 
> The interface definition of PV USB devices is lacking the specification
> of possible values of the status field in a response. Those are
> negative errno values as used in Linux, so they might differ in other
> OS's. Specify them via appropriate defines.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

> ---
> V2:
> - add parentheses to macro values (Jan Beulich)
> ---
> xen/include/public/io/usbif.h | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/xen/include/public/io/usbif.h b/xen/include/public/io/usbif.h
> index c6a58639d6..96b9fb661d 100644
> --- a/xen/include/public/io/usbif.h
> +++ b/xen/include/public/io/usbif.h
> @@ -221,6 +221,13 @@ struct usbif_urb_response {
> 	uint16_t id; /* request id */
> 	uint16_t start_frame;  /* start frame (ISO) */
> 	int32_t status; /* status (non-ISO) */
> +#define USBIF_STATUS_OK		0
> +#define USBIF_STATUS_NODEV	(-19)
> +#define USBIF_STATUS_INVAL	(-22)
> +#define USBIF_STATUS_STALL	(-32)
> +#define USBIF_STATUS_IOERROR	(-71)
> +#define USBIF_STATUS_BABBLE	(-75)
> +#define USBIF_STATUS_SHUTDOWN	(-108)
> 	int32_t actual_length; /* actual transfer length */
> 	int32_t error_count; /* number of ISO errors */
> };
> -- 
> 2.26.2
> 
>