Date: Wed, 19 Dec 2007 01:40:12 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 131194 for review Message-ID: <200712190140.lBJ1eCmY006789@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131194 Change 131194 by hselasky@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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712190140.lBJ1eCmY006789>