Re: [PATCH v6 01/22] usb: usbtmc: Add ioctl for generic requests on control

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

 



On Wed, Sep 12, 2018 at 10:50:51AM +0200, Guido Kiener wrote:
> --- a/include/uapi/linux/usb/tmc.h
> +++ b/include/uapi/linux/usb/tmc.h
> @@ -4,6 +4,7 @@
>   * Copyright (C) 2008 Novell, Inc.
>   * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@xxxxxxx>
>   * Copyright (C) 2015 Dave Penkler <dpenkler@xxxxxxxxx>
> + * Copyright (C) 2018 IVI Foundation, Inc.
>   *
>   * This file holds USB constants defined by the USB Device Class
>   * and USB488 Subclass Definitions for Test and Measurement devices
> @@ -40,6 +41,19 @@
>  #define USBTMC488_REQUEST_GOTO_LOCAL			161
>  #define USBTMC488_REQUEST_LOCAL_LOCKOUT			162
>  
> +struct usbtmc_request {
> +	__u8 bRequestType;
> +	__u8 bRequest;
> +	__u16 wValue;
> +	__u16 wIndex;
> +	__u16 wLength;
> +} __attribute__ ((packed));

This really is just 'struct usb_ctrlrequest', right?  That's already
defined in our uapi files.  Why not use that?

Bonus is, if you use that, you get the proper endian notation, which you
don't have here, which means this is broken on big endian machines :(

Try doing that, and fix up the endian issue.

thanks,

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux