linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Guido Kiener <guido@kiener-muenchen.de>
Cc: linux-usb@vger.kernel.org, guido.kiener@rohde-schwarz.com,
	pankaj.adhikari@ni.com, steve_bayless@keysight.com,
	dpenkler@gmail.com
Subject: [v6,01/22] usb: usbtmc: Add ioctl for generic requests on control
Date: Thu, 20 Sep 2018 13:00:35 +0200	[thread overview]
Message-ID: <20180920110035.GA14796@kroah.com> (raw)

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@suse.de>
>   * Copyright (C) 2015 Dave Penkler <dpenkler@gmail.com>
> + * 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

             reply	other threads:[~2018-09-20 11:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 11:00 Greg Kroah-Hartman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-20 11:03 [v6,01/22] usb: usbtmc: Add ioctl for generic requests on control Greg Kroah-Hartman
2018-09-12  8:50 Guido Kiener

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=20180920110035.GA14796@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dpenkler@gmail.com \
    --cc=guido.kiener@rohde-schwarz.com \
    --cc=guido@kiener-muenchen.de \
    --cc=linux-usb@vger.kernel.org \
    --cc=pankaj.adhikari@ni.com \
    --cc=steve_bayless@keysight.com \
    /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).