[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 27 Sep 2021 10:13:57 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1odbPXqDZnzI/wEIq/o1a4C0cKDMDP/eIYH7Bq3N3EU=; b=JVAzSlzTj0gKFoQdnP+WjqGzJZExXGYIdOeGLyD+0T+33/1hRSKb0M35O5GebWJCi/L8ViRuANCJgMmvMegmJMxxSvwFJCen/rheairnOJ5TOh4rYxSI8rJNQSZUIFzrXxf2vfiSavHVee2Fj35EnP8z8UmQCzHIZ/WPY0IXKiWmDktkhjDYExmZiD+6DLZKaF5DOIJ72XyaAU6NzDQosYnHy1nj3nPNNSTnmDV6RIJotK7so0EU8l9EdB6utXX4h4X39Y91ULT/v1ahDjAVOuGR3vR5/lV8TpGvqZQJB1K5Y19IIRsX7Y4Z0DlKGSyV9ciDETRlFGpwmRjzrS5Umw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n4hd4tJoc0eb0YxE9QCEmXr9BMiMLybjWIymb6wKQJOPcEXxDZWqd63CyO8ifau6Or8Jcn3+YdzoCUgeRS+o0AqgfJru1RVKCjXRwXQgV47e3m/hccNN9cDPTU/fwR4QCRf8OU9gJ6RXuhqaIrZtygicyrboZVqSGo6u5J0IzWu+UiyJVfu1sLHoAldd6EPYyQ2lNVLJTc+7/C7Ag1meb4yf1nqjRJDL/lf87+dydHXtOnkvX5RzZtH+WPtELsLv/Facmi2suqN0udJ+/K5BEWxaZCThCoxK2twFuekXjF4aex7VWfEJvpgxwtFM4eIyC5ua9gQu+r8FtFuccNR24Q==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 27 Sep 2021 08:14:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.09.2021 17:04, Juergen Gross wrote:
> The interface definition of PV USB devices is lacking the specification
> of possible values of the status filed in a response. Those are

Nit: "field"?

> negative errno values as used in Linux, so they might differ in other
> OS's. Specify them via appropriate defines.

What if new errno values got used by the driver? Would we alter the
public header every time? Or is the likelihood of further values ever
getting used vanishingly small? In how far would it be possible to tie
these to Xen's public/errno.h instead?

> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> ---
>  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..fbd6f953f8 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

Nit: While probably benign for all practical uses, these negative
values nevertheless would better be parenthesized.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.