PERFORCE change 131194 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Tue Dec 18 17:40:13 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=131194
Change 131194 by hselasky at hselasky_laptop001 on 2007/12/19 01:40:07
Add new macro that can be used to build up USB strings.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/usb.h#26 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/usb.h#26 (text+ko) ====
@@ -287,6 +287,18 @@
uByte bUnused;
} __packed usb_string_descriptor_t;
+#define USB_MAKE_STRING_DESC(m,name) \
+struct name { \
+ uByte bLength; \
+ uByte bDescriptorType; \
+ uByte bData[sizeof((uint8_t []){m})]; \
+} __packed; \
+static const struct name name = { \
+ .bLength = sizeof(struct name), \
+ .bDescriptorType = UDESC_STRING, \
+ .bData = { m }, \
+}
+
#define USB_STRING_DESC_LEN(len) ((2*(len)) + 2)
#define USB_LANGUAGE_TABLE 0 /* # of the string language id table */
More information about the p4-projects
mailing list