Skip to contentSkip to conversation

usb: usbtmc: Add ioctl for generic requests on control

PATCH New Greg Kroah-Hartman 1 participant 1 message Sep 20, 2018 USB

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH v6 1/22 usb: usbtmc: Add ioctl for generic requests on control

Quoted 26 lines · Greg KH
Quoted 11 lines · Guido Kiener
include/uapi/linux/usb/tmc.h +1 -0
@@ -4,6 +4,7 @@
  * Copyright (C) 2008 Novell, Inc.
  * Copyright (C) 2008 Greg Kroah-Hartman <[email protected]>
  * Copyright (C) 2015 Dave Penkler <[email protected]>
+ * 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

include/uapi/linux/usb/tmc.h line 50

Quoted 10 lines
include/uapi/linux/usb/tmc.h +7 -0
@@ -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?

Quoted 4 lines

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.

Ah, nevermind, you are passing this to the hardware properly. This should be just fine, I'll take it as-is, sorry for the noise.

greg k-h