From owner-svn-src-head@FreeBSD.ORG Wed Jan 30 15:46:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 659A8F88; Wed, 30 Jan 2013 15:46:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49C80202; Wed, 30 Jan 2013 15:46:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0UFkUYw089223; Wed, 30 Jan 2013 15:46:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0UFkROT089198; Wed, 30 Jan 2013 15:46:27 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301301546.r0UFkROT089198@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 30 Jan 2013 15:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246123 - in head/sys/dev/usb: . controller template X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 15:46:30 -0000 Author: hselasky Date: Wed Jan 30 15:46:26 2013 New Revision: 246123 URL: http://svnweb.freebsd.org/changeset/base/246123 Log: Provide one global language string descriptor for american english instead of giving each module its own. Submitted by: Christoph Mallon Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_cdce.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_mouse.c head/sys/dev/usb/template/usb_template_msc.c head/sys/dev/usb/template/usb_template_mtp.c head/sys/dev/usb/usb.h head/sys/dev/usb/usb_core.c head/sys/dev/usb/usb_core.h Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/at91dci.c Wed Jan 30 15:46:26 2013 (r246123) @@ -1740,9 +1740,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'A', 0, 'T', 0, 'M', 0, 'E', 0, 'L', 0 @@ -1751,7 +1748,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, at91dci_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, at91dci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, at91dci_product); @@ -1953,8 +1949,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(at91dci_langtab); - ptr = (const void *)&at91dci_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/atmegadci.c Wed Jan 30 15:46:26 2013 (r246123) @@ -1565,9 +1565,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'A', 0, 'T', 0, 'M', 0, 'E', 0, 'G', 0, 'A', 0 @@ -1576,7 +1573,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, atmegadci_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, atmegadci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, atmegadci_product); @@ -1779,8 +1775,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(atmegadci_langtab); - ptr = (const void *)&atmegadci_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/avr32dci.c Wed Jan 30 15:46:26 2013 (r246123) @@ -1505,9 +1505,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'A', 0, 'V', 0, 'R', 0, '3', 0, '2', 0 @@ -1516,7 +1513,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, avr32dci_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, avr32dci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, avr32dci_product); @@ -1719,8 +1715,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(avr32dci_langtab); - ptr = (const void *)&avr32dci_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/dwc_otg.c Wed Jan 30 15:46:26 2013 (r246123) @@ -3491,9 +3491,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'D', 0, 'W', 0, 'C', 0, 'O', 0, 'T', 0, 'G', 0 @@ -3502,7 +3499,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, dwc_otg_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, dwc_otg_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, dwc_otg_product); @@ -3704,8 +3700,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(dwc_otg_langtab); - ptr = (const void *)&dwc_otg_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/musb_otg.c Wed Jan 30 15:46:26 2013 (r246123) @@ -2211,9 +2211,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'M', 0, 'e', 0, 'n', 0, 't', 0, 'o', 0, 'r', 0, ' ', 0, \ 'G', 0, 'r', 0, 'a', 0, 'p', 0, 'h', 0, 'i', 0, 'c', 0, 's', 0 @@ -2223,7 +2220,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, musbotg_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, musbotg_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, musbotg_product); @@ -2425,8 +2421,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(musbotg_langtab); - ptr = (const void *)&musbotg_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/controller/uss820dci.c Wed Jan 30 15:46:26 2013 (r246123) @@ -1808,9 +1808,6 @@ static const struct usb_hub_descriptor_m .DeviceRemovable = {0}, /* port is removable */ }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_VENDOR \ 'A', 0, 'G', 0, 'E', 0, 'R', 0, 'E', 0 @@ -1819,7 +1816,6 @@ static const struct usb_hub_descriptor_m 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \ 'U', 0, 'B', 0, -USB_MAKE_STRING_DESC(STRING_LANG, uss820dci_langtab); USB_MAKE_STRING_DESC(STRING_VENDOR, uss820dci_vendor); USB_MAKE_STRING_DESC(STRING_PRODUCT, uss820dci_product); @@ -2021,8 +2017,8 @@ tr_handle_get_descriptor: case UDESC_STRING: switch (value & 0xff) { case 0: /* Language table */ - len = sizeof(uss820dci_langtab); - ptr = (const void *)&uss820dci_langtab; + len = sizeof(usb_string_lang_en); + ptr = (const void *)&usb_string_lang_en; goto tr_valid; case 1: /* Vendor */ Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_audio.c Wed Jan 30 15:46:26 2013 (r246123) @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -66,9 +67,6 @@ enum { INDEX_AUDIO_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_AUDIO_PRODUCT \ 'A', 0, 'u', 0, 'd', 0, 'i', 0, 'o', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ @@ -89,7 +87,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_AUDIO_MIXER, string_audio_mixer); USB_MAKE_STRING_DESC(STRING_AUDIO_RECORD, string_audio_record); USB_MAKE_STRING_DESC(STRING_AUDIO_PLAYBACK, string_audio_playback); @@ -387,7 +384,7 @@ static const void * audio_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[INDEX_AUDIO_MAX] = { - [INDEX_AUDIO_LANG] = &string_lang, + [INDEX_AUDIO_LANG] = &usb_string_lang_en, [INDEX_AUDIO_MIXER] = &string_audio_mixer, [INDEX_AUDIO_RECORD] = &string_audio_record, [INDEX_AUDIO_PLAYBACK] = &string_audio_playback, @@ -395,7 +392,7 @@ audio_get_string_desc(uint16_t lang_id, }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- head/sys/dev/usb/template/usb_template_cdce.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_cdce.c Wed Jan 30 15:46:26 2013 (r246123) @@ -53,6 +53,7 @@ #include #include +#include #include #include @@ -70,9 +71,6 @@ enum { STRING_ETH_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_MAC \ '2', 0, 'A', 0, '2', 0, '3', 0, \ '4', 0, '5', 0, '6', 0, '7', 0, \ @@ -124,7 +122,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_MAC, string_mac); USB_MAKE_STRING_DESC(STRING_ETH_CONTROL, string_eth_control); USB_MAKE_STRING_DESC(STRING_ETH_DATA, string_eth_data); @@ -288,7 +285,7 @@ static const void * eth_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[STRING_ETH_MAX] = { - [STRING_LANG_INDEX] = &string_lang, + [STRING_LANG_INDEX] = &usb_string_lang_en, [STRING_MAC_INDEX] = &string_mac, [STRING_ETH_CONTROL_INDEX] = &string_eth_control, [STRING_ETH_DATA_INDEX] = &string_eth_data, @@ -299,7 +296,7 @@ eth_get_string_desc(uint16_t lang_id, ui }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_kbd.c Wed Jan 30 15:46:26 2013 (r246123) @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -64,9 +65,6 @@ enum { INDEX_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_PRODUCT \ 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ @@ -78,7 +76,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_KEYBOARD, string_keyboard); USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); @@ -208,13 +205,13 @@ static const void * keyboard_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[INDEX_MAX] = { - [INDEX_LANG] = &string_lang, + [INDEX_LANG] = &usb_string_lang_en, [INDEX_KEYBOARD] = &string_keyboard, [INDEX_PRODUCT] = &string_product, }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_modem.c Wed Jan 30 15:46:26 2013 (r246123) @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -64,9 +65,6 @@ enum { INDEX_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_PRODUCT \ 'M', 0, 'o', 0, 'd', 0, 'e', 0, 'm', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ @@ -78,7 +76,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_MODEM, string_modem); USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); @@ -236,13 +233,13 @@ static const void * modem_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[INDEX_MAX] = { - [INDEX_LANG] = &string_lang, + [INDEX_LANG] = &usb_string_lang_en, [INDEX_MODEM] = &string_modem, [INDEX_PRODUCT] = &string_product, }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mouse.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_mouse.c Wed Jan 30 15:46:26 2013 (r246123) @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -64,9 +65,6 @@ enum { INDEX_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_PRODUCT \ 'M', 0, 'o', 0, 'u', 0, 's', 0, 'e', 0, ' ', 0, \ 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ @@ -78,7 +76,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_MOUSE, string_mouse); USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); @@ -206,13 +203,13 @@ static const void * mouse_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[INDEX_MAX] = { - [INDEX_LANG] = &string_lang, + [INDEX_LANG] = &usb_string_lang_en, [INDEX_MOUSE] = &string_mouse, [INDEX_PRODUCT] = &string_product, }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_msc.c ============================================================================== --- head/sys/dev/usb/template/usb_template_msc.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_msc.c Wed Jan 30 15:46:26 2013 (r246123) @@ -53,6 +53,7 @@ #include #include +#include #include #endif /* USB_GLOBAL_INCLUDE_FILE */ @@ -67,9 +68,6 @@ enum { STRING_MSC_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_MSC_DATA \ 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ 'M', 0, 'a', 0, 's', 0, 's', 0, \ @@ -105,7 +103,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_MSC_DATA, string_msc_data); USB_MAKE_STRING_DESC(STRING_MSC_CONFIG, string_msc_config); USB_MAKE_STRING_DESC(STRING_MSC_VENDOR, string_msc_vendor); @@ -197,7 +194,7 @@ static const void * msc_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[STRING_MSC_MAX] = { - [STRING_LANG_INDEX] = &string_lang, + [STRING_LANG_INDEX] = &usb_string_lang_en, [STRING_MSC_DATA_INDEX] = &string_msc_data, [STRING_MSC_CONFIG_INDEX] = &string_msc_config, [STRING_MSC_VENDOR_INDEX] = &string_msc_vendor, @@ -206,7 +203,7 @@ msc_get_string_desc(uint16_t lang_id, ui }; if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/template/usb_template_mtp.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mtp.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/template/usb_template_mtp.c Wed Jan 30 15:46:26 2013 (r246123) @@ -60,6 +60,8 @@ #include #include +#include + #include #endif /* USB_GLOBAL_INCLUDE_FILE */ @@ -75,9 +77,6 @@ enum { STRING_MTP_MAX, }; -#define STRING_LANG \ - 0x09, 0x04, /* American English */ - #define STRING_MTP_DATA \ 'U', 0, 'S', 0, 'B', 0, ' ', 0, \ 'M', 0, 'T', 0, 'P', 0, \ @@ -109,7 +108,6 @@ enum { /* make the real string descriptors */ -USB_MAKE_STRING_DESC(STRING_LANG, string_lang); USB_MAKE_STRING_DESC(STRING_MTP_DATA, string_mtp_data); USB_MAKE_STRING_DESC(STRING_MTP_CONFIG, string_mtp_config); USB_MAKE_STRING_DESC(STRING_MTP_VENDOR, string_mtp_vendor); @@ -246,7 +244,7 @@ static const void * mtp_get_string_desc(uint16_t lang_id, uint8_t string_index) { static const void *ptr[STRING_MTP_MAX] = { - [STRING_LANG_INDEX] = &string_lang, + [STRING_LANG_INDEX] = &usb_string_lang_en, [STRING_MTP_DATA_INDEX] = &string_mtp_data, [STRING_MTP_CONFIG_INDEX] = &string_mtp_config, [STRING_MTP_VENDOR_INDEX] = &string_mtp_vendor, @@ -268,7 +266,7 @@ mtp_get_string_desc(uint16_t lang_id, ui return (dummy_desc); } if (string_index == 0) { - return (&string_lang); + return (&usb_string_lang_en); } if (lang_id != 0x0409) { return (NULL); Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/usb.h Wed Jan 30 15:46:26 2013 (r246123) @@ -577,6 +577,13 @@ static const struct name name = { \ .bData = { m }, \ } +struct usb_string_lang { + uByte bLength; + uByte bDescriptorType; + uByte bData[2]; +} __packed; +typedef struct usb_string_lang usb_string_lang_t; + struct usb_hub_descriptor { uByte bDescLength; uByte bDescriptorType; Modified: head/sys/dev/usb/usb_core.c ============================================================================== --- head/sys/dev/usb/usb_core.c Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/usb_core.c Wed Jan 30 15:46:26 2013 (r246123) @@ -56,6 +56,11 @@ #include #endif /* USB_GLOBAL_INCLUDE_FILE */ +const struct usb_string_lang usb_string_lang_en = { + sizeof(usb_string_lang_en), UDESC_STRING, + { 0x09, 0x04 } /* American English */ +}; + MALLOC_DEFINE(M_USB, "USB", "USB"); MALLOC_DEFINE(M_USBDEV, "USBdev", "USB device"); MALLOC_DEFINE(M_USBHC, "USBHC", "USB host controller"); Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Wed Jan 30 15:26:04 2013 (r246122) +++ head/sys/dev/usb/usb_core.h Wed Jan 30 15:46:26 2013 (r246123) @@ -69,6 +69,7 @@ struct usb_page; struct usb_page_cache; struct usb_xfer; struct usb_xfer_root; +struct usb_string_lang; /* typedefs */ @@ -174,6 +175,7 @@ struct usb_xfer { /* external variables */ extern struct mtx usb_ref_lock; +extern const struct usb_string_lang usb_string_lang_en; /* typedefs */