svn commit: r292865 - head/sys/dev/usb

Hans Petter Selasky hselasky at FreeBSD.org
Tue Dec 29 11:53:15 UTC 2015


Author: hselasky
Date: Tue Dec 29 11:53:13 2015
New Revision: 292865
URL: https://svnweb.freebsd.org/changeset/base/292865

Log:
  Update metadata for "tools/tools/bus_autoconf" after r292080. Use
  BYTE_ORDER instead of _BYTE_ORDER due to 3rd party USB software for
  now.

Modified:
  head/sys/dev/usb/usb_lookup.c
  head/sys/dev/usb/usbdi.h

Modified: head/sys/dev/usb/usb_lookup.c
==============================================================================
--- head/sys/dev/usb/usb_lookup.c	Tue Dec 29 11:24:41 2015	(r292864)
+++ head/sys/dev/usb/usb_lookup.c	Tue Dec 29 11:53:13 2015	(r292865)
@@ -154,28 +154,10 @@ usbd_lookup_id_by_uaa(const struct usb_d
 /*------------------------------------------------------------------------*
  *	Export the USB device ID format we use to userspace tools.
  *------------------------------------------------------------------------*/
-#if BYTE_ORDER == BIG_ENDIAN
-#define	U16_XOR "8"
-#define	U32_XOR "12"
-#define	U64_XOR "56"
-#define	U8_BITFIELD_XOR "7"
-#define	U16_BITFIELD_XOR "15"
-#define	U32_BITFIELD_XOR "31"
-#define	U64_BITFIELD_XOR "63"
-#else
+#if BYTE_ORDER == LITTLE_ENDIAN
 #define	U16_XOR "0"
-#define	U32_XOR "0"
-#define	U64_XOR "0"
-#define	U8_BITFIELD_XOR "0"
-#define	U16_BITFIELD_XOR "0"
-#define	U32_BITFIELD_XOR "0"
-#define	U64_BITFIELD_XOR "0"
-#endif
-
-#if USB_HAVE_COMPAT_LINUX
-#define	MFL_SIZE "1"
 #else
-#define	MFL_SIZE "0"
+#define	U16_XOR "8"
 #endif
 
 #if defined(KLD_MODULE) && (USB_HAVE_ID_SECTION != 0)
@@ -189,20 +171,19 @@ static const char __section("bus_autocon
 
 	/* List size of fields in the usb_device_id structure */
 
-#if ULONG_MAX >= 0xFFFFFFFFUL
-	"unused{0,8}"
-	"unused{0,8}"
-	"unused{0,8}"
-	"unused{0,8}"
-#if ULONG_MAX >= 0xFFFFFFFFFFFFFFFFULL
-	"unused{0,8}"
-	"unused{0,8}"
-	"unused{0,8}"
-	"unused{0,8}"
-#endif
-#else
-#error "Please update code."
-#endif
+	"mf_vendor{" U16_XOR ",1}"
+	"mf_product{" U16_XOR ",1}"
+	"mf_dev_lo{" U16_XOR ",1}"
+	"mf_dev_hi{" U16_XOR ",1}"
+
+	"mf_dev_class{" U16_XOR ",1}"
+	"mf_dev_subclass{" U16_XOR ",1}"
+	"mf_dev_protocol{" U16_XOR ",1}"
+	"mf_int_class{" U16_XOR ",1}"
+
+	"mf_int_subclass{" U16_XOR ",1}"
+	"mf_int_protocol{" U16_XOR ",1}"
+	"unused{" U16_XOR ",6}"
 
 	"idVendor[0]{" U16_XOR ",8}"
 	"idVendor[1]{" U16_XOR ",8}"
@@ -220,38 +201,20 @@ static const char __section("bus_autocon
 	"bInterfaceSubClass{0,8}"
 	"bInterfaceProtocol{0,8}"
 
-	"mf_vendor{" U8_BITFIELD_XOR ",1}"
-	"mf_product{" U8_BITFIELD_XOR ",1}"
-	"mf_dev_lo{" U8_BITFIELD_XOR ",1}"
-	"mf_dev_hi{" U8_BITFIELD_XOR ",1}"
-
-	"mf_dev_class{" U8_BITFIELD_XOR ",1}"
-	"mf_dev_subclass{" U8_BITFIELD_XOR ",1}"
-	"mf_dev_protocol{" U8_BITFIELD_XOR ",1}"
-	"mf_int_class{" U8_BITFIELD_XOR ",1}"
-
-	"mf_int_subclass{" U8_BITFIELD_XOR ",1}"
-	"mf_int_protocol{" U8_BITFIELD_XOR ",1}"
-	"unused{" U8_BITFIELD_XOR ",6}"
-
-	"mfl_vendor{" U16_XOR "," MFL_SIZE "}"
-	"mfl_product{" U16_XOR "," MFL_SIZE "}"
-	"mfl_dev_lo{" U16_XOR "," MFL_SIZE "}"
-	"mfl_dev_hi{" U16_XOR "," MFL_SIZE "}"
-
-	"mfl_dev_class{" U16_XOR "," MFL_SIZE "}"
-	"mfl_dev_subclass{" U16_XOR "," MFL_SIZE "}"
-	"mfl_dev_protocol{" U16_XOR "," MFL_SIZE "}"
-	"mfl_int_class{" U16_XOR "," MFL_SIZE "}"
-
-	"mfl_int_subclass{" U16_XOR "," MFL_SIZE "}"
-	"mfl_int_protocol{" U16_XOR "," MFL_SIZE "}"
-	"unused{" U16_XOR "," MFL_SIZE "}"
-	"unused{" U16_XOR "," MFL_SIZE "}"
-
-	"unused{" U16_XOR "," MFL_SIZE "}"
-	"unused{" U16_XOR "," MFL_SIZE "}"
-	"unused{" U16_XOR "," MFL_SIZE "}"
-	"unused{" U16_XOR "," MFL_SIZE "}"
+#if USB_HAVE_COMPAT_LINUX
+	"mfl_vendor{" U16_XOR ",1}"
+	"mfl_product{" U16_XOR ",1}"
+	"mfl_dev_lo{" U16_XOR ",1}"
+	"mfl_dev_hi{" U16_XOR ",1}"
+
+	"mfl_dev_class{" U16_XOR ",1}"
+	"mfl_dev_subclass{" U16_XOR ",1}"
+	"mfl_dev_protocol{" U16_XOR ",1}"
+	"mfl_int_class{" U16_XOR ",1}"
+
+	"mfl_int_subclass{" U16_XOR ",1}"
+	"mfl_int_protocol{" U16_XOR ",1}"
+	"unused{" U16_XOR ",6}"
+#endif
 };
 #endif

Modified: head/sys/dev/usb/usbdi.h
==============================================================================
--- head/sys/dev/usb/usbdi.h	Tue Dec 29 11:24:41 2015	(r292864)
+++ head/sys/dev/usb/usbdi.h	Tue Dec 29 11:53:13 2015	(r292865)
@@ -267,7 +267,7 @@ struct usb_config {
 struct usb_device_id {
 
 	/* Select which fields to match against */
-#if _BYTE_ORDER == _LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
 	uint16_t
 		match_flag_vendor:1,
 		match_flag_product:1,
@@ -315,13 +315,6 @@ struct usb_device_id {
 	uint8_t	bInterfaceSubClass;
 	uint8_t	bInterfaceProtocol;
 
-	/* Hook for driver specific information */
-	unsigned long driver_info;
-
-/*
- * XXX can't currently participate in auto driver loading
- * XXX making it a union with the match_flag_* above messes up init
- */
 #if USB_HAVE_COMPAT_LINUX
 	/* which fields to match against */
 	uint16_t match_flags;
@@ -336,6 +329,9 @@ struct usb_device_id {
 #define	USB_DEVICE_ID_MATCH_INT_SUBCLASS	0x0100
 #define	USB_DEVICE_ID_MATCH_INT_PROTOCOL	0x0200
 #endif
+
+	/* Hook for driver specific information */
+	unsigned long driver_info;
 } __aligned(32);
 
 #define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:product;G16:product;" \


More information about the svn-src-head mailing list