Module Name:    src
Committed By:   skrll
Date:           Wed Dec  3 13:19:38 UTC 2014

Modified Files:
        src/sys/arch/mips/adm5120/dev [nick-nhusb]: ahci.c
        src/sys/dev/ic [nick-nhusb]: sl811hs.c
        src/sys/dev/usb [nick-nhusb]: ehci.c ohci.c uhci.c xhci.c

Log Message:
Use designated initializers for more descriptors.


To generate a diff of this commit:
cvs rdiff -u -r1.12.6.6 -r1.12.6.7 src/sys/arch/mips/adm5120/dev/ahci.c
cvs rdiff -u -r1.47.6.5 -r1.47.6.6 src/sys/dev/ic/sl811hs.c
cvs rdiff -u -r1.234.2.9 -r1.234.2.10 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.254.2.8 -r1.254.2.9 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.264.4.8 -r1.264.4.9 src/sys/dev/usb/uhci.c
cvs rdiff -u -r1.28.2.6 -r1.28.2.7 src/sys/dev/usb/xhci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/adm5120/dev/ahci.c
diff -u src/sys/arch/mips/adm5120/dev/ahci.c:1.12.6.6 src/sys/arch/mips/adm5120/dev/ahci.c:1.12.6.7
--- src/sys/arch/mips/adm5120/dev/ahci.c:1.12.6.6	Wed Dec  3 13:08:59 2014
+++ src/sys/arch/mips/adm5120/dev/ahci.c	Wed Dec  3 13:19:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahci.c,v 1.12.6.6 2014/12/03 13:08:59 skrll Exp $	*/
+/*	$NetBSD: ahci.c,v 1.12.6.7 2014/12/03 13:19:38 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.12.6.6 2014/12/03 13:08:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.12.6.7 2014/12/03 13:19:38 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -540,7 +540,7 @@ usb_device_descriptor_t ahci_devd = {
 	.bDeviceProtocol = 0,
 	.bMaxPacketSize = 64,
 	.idVendor = {
-		USB_VENDOR_SCANLOGIC & 0xff,	/* vendor ID (low)  */
+		USB_VENDOR_SCANLOGIC & 0xff,
 		USB_VENDOR_SCANLOGIC >> 8
 	},
 	.idProduct = {0},
@@ -552,48 +552,50 @@ usb_device_descriptor_t ahci_devd = {
 };
 
 usb_config_descriptor_t ahci_confd = {
-	USB_CONFIG_DESCRIPTOR_SIZE,
-	UDESC_CONFIG,
-	{USB_CONFIG_DESCRIPTOR_SIZE +
-	 USB_INTERFACE_DESCRIPTOR_SIZE +
-	 USB_ENDPOINT_DESCRIPTOR_SIZE},
-	1,			/* number of interfaces */
-	1,			/* configuration value */
-	0,			/* index to configuration */
-	UC_SELF_POWERED,	/* attributes */
-	250			/* max current is 500mA... */
+	.bLength = USB_CONFIG_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_CONFIG,
+	.wTotalLength = {
+		USB_CONFIG_DESCRIPTOR_SIZE +
+		USB_INTERFACE_DESCRIPTOR_SIZE +
+		USB_ENDPOINT_DESCRIPTOR_SIZE,
+	},
+	.bNumInterface = 1,
+	.bConfigurationValue = 1,
+	.iConfiguration = 0,
+	.bmAttributes = UC_SELF_POWERED,
+	.bMaxPower = 250
 };
 
 usb_interface_descriptor_t ahci_ifcd = {
-	USB_INTERFACE_DESCRIPTOR_SIZE,
-	UDESC_INTERFACE,
-	0,			/* interface number */
-	0,			/* alternate setting */
-	1,			/* number of endpoint */
-	UICLASS_HUB,		/* class */
-	UISUBCLASS_HUB,		/* subclass */
-	0,			/* protocol */
-	0			/* index to interface */
+	.bLength = USB_INTERFACE_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_INTERFACE,
+	.bInterfaceNumber = 0,
+	.bAlternateSetting = 0,
+	.bNumEndpoints = 1,
+	.bInterfaceClass = UICLASS_HUB,
+	.bInterfaceSubClass = UISUBCLASS_HUB,
+	.bInterfaceProtocol = 0,
+	.iInterface = 0
 };
 
 usb_endpoint_descriptor_t ahci_endpd = {
-	USB_ENDPOINT_DESCRIPTOR_SIZE,
-	UDESC_ENDPOINT,
-	UE_DIR_IN | AHCI_INTR_ENDPT,	/* endpoint address */
-	UE_INTERRUPT,		/* attributes */
-	{8},			/* max packet size */
-	255			/* interval */
+	.bLength = USB_ENDPOINT_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_ENDPOINT,
+	.bEndpointAddress = UE_DIR_IN | AHCI_INTR_ENDPT,
+	.bmAttributes = UE_INTERRUPT,
+	.wMaxPacketSize = {8},
+	.bInterval = 255
 };
 
 usb_hub_descriptor_t ahci_hubd = {
-	USB_HUB_DESCRIPTOR_SIZE,
-	UDESC_HUB,
-	2,			/* number of ports */
-	{ 0, 0},    		/* hub characteristics */
-	0,			/* 5:power on to power good */
-	0,			/* 6:maximum current */
-	{ 0x00 },		/* both ports are removable */
-	{ 0x00 }		/* port power control mask */
+	.bDescLength = USB_HUB_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_HUB,
+	.bNbrPorts = 2,
+	.wHubCharacteristics = { 0, 0 },
+	.bPwrOn2PwrGood = 0,
+	.bHubContrCurrent = 0,
+	.DeviceRemovable = { 0x00 },
+	.PortPowerCtrlMask = { 0x00 }
 };
 
 static int

Index: src/sys/dev/ic/sl811hs.c
diff -u src/sys/dev/ic/sl811hs.c:1.47.6.5 src/sys/dev/ic/sl811hs.c:1.47.6.6
--- src/sys/dev/ic/sl811hs.c:1.47.6.5	Wed Dec  3 13:09:00 2014
+++ src/sys/dev/ic/sl811hs.c	Wed Dec  3 13:19:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sl811hs.c,v 1.47.6.5 2014/12/03 13:09:00 skrll Exp $	*/
+/*	$NetBSD: sl811hs.c,v 1.47.6.6 2014/12/03 13:19:38 skrll Exp $	*/
 
 /*
  * Not (c) 2007 Matthew Orgass
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.47.6.5 2014/12/03 13:09:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.47.6.6 2014/12/03 13:19:38 skrll Exp $");
 
 #include "opt_slhci.h"
 
@@ -2954,46 +2954,53 @@ static const struct slhci_confd_t {
 	const usb_interface_descriptor_t ifcd;
 	const usb_endpoint_descriptor_t endpd;
 } UPACKED slhci_confd = {
-	{ /* Configuration */
-		USB_CONFIG_DESCRIPTOR_SIZE,
-		UDESC_CONFIG,
-		{USB_CONFIG_DESCRIPTOR_SIZE +
-		 USB_INTERFACE_DESCRIPTOR_SIZE +
-		 USB_ENDPOINT_DESCRIPTOR_SIZE},
-		1,			/* number of interfaces */
-		1,			/* configuration value */
-		0,			/* index to configuration */
-		UC_SELF_POWERED,	/* attributes */
-		0			/* max current, filled in later */
-	}, { /* Interface */
-		USB_INTERFACE_DESCRIPTOR_SIZE,
-		UDESC_INTERFACE,
-		0,			/* interface number */
-		0,			/* alternate setting */
-		1,			/* number of endpoint */
-		UICLASS_HUB,		/* class */
-		UISUBCLASS_HUB,		/* subclass */
-		0,			/* protocol */
-		0			/* index to interface */
-	}, { /* Endpoint */
-		USB_ENDPOINT_DESCRIPTOR_SIZE,
-		UDESC_ENDPOINT,
-		UE_DIR_IN | ROOT_INTR_ENDPT,	/* endpoint address */
-		UE_INTERRUPT,			/* attributes */
-		{240, 0},			/* max packet size */
-		255				/* interval */
+	.confd = {
+		.bLength = USB_CONFIG_DESCRIPTOR_SIZE,
+		.bDescriptorType = UDESC_CONFIG,
+		.wTotalLength = {
+			USB_CONFIG_DESCRIPTOR_SIZE +
+			USB_INTERFACE_DESCRIPTOR_SIZE +
+			USB_ENDPOINT_DESCRIPTOR_SIZE
+		},
+		.bNumInterface = 1,
+		.bConfigurationValue = 1,
+		.iConfiguration = 0,
+		.bmAttributes = UC_SELF_POWERED,
+		.bMaxPower = 0
+	},
+	.ifcd = {
+		.bLength = USB_INTERFACE_DESCRIPTOR_SIZE,
+		.bDescriptorType = UDESC_INTERFACE,
+		.bInterfaceNumber = 0,
+		.bAlternateSetting = 0,
+		.bNumEndpoints = 1,
+		.bInterfaceClass = UICLASS_HUB,	
+		.bInterfaceSubClass = UISUBCLASS_HUB,
+		.bInterfaceProtocol = 0,
+		.iInterface = 0
+	},
+	.endpd = {
+		.bLength = USB_ENDPOINT_DESCRIPTOR_SIZE,
+		.bDescriptorType = UDESC_ENDPOINT,
+		.bEndpointAddress = UE_DIR_IN | ROOT_INTR_ENDPT,
+		.bmAttributes = UE_INTERRUPT,
+		.wMaxPacketSize = {240, 0},
+		.bInterval = 255
 	}
 };
 
 static const usb_hub_descriptor_t slhci_hubd = {
-	USB_HUB_DESCRIPTOR_SIZE,
-	UDESC_HUB,
-	1,			/* number of ports */
-	{UHD_PWR_INDIVIDUAL | UHD_OC_NONE, 0},	/* hub characteristics */
-	50,			/* 5:power on to power good, units of 2ms */
-	0,			/* 6:maximum current, filled in later */
-	{ 0x00 },		/* port is removable */
-	{ 0x00 }		/* port power control mask */
+	.bDescLength = USB_HUB_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_HUB,
+	.bNbrPorts = 1,
+	.wHubCharacteristics = {
+		UHD_PWR_INDIVIDUAL | UHD_OC_NONE,
+		0
+	},
+	.bPwrOn2PwrGood = 50,
+	.bHubContrCurrent = 0,
+	.DeviceRemovable = { 0x00 },
+	.PortPowerCtrlMask = { 0x00 }
 };
 
 static usbd_status

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.9 src/sys/dev/usb/ehci.c:1.234.2.10
--- src/sys/dev/usb/ehci.c:1.234.2.9	Wed Dec  3 13:09:00 2014
+++ src/sys/dev/usb/ehci.c	Wed Dec  3 13:19:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.9 2014/12/03 13:09:00 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.10 2014/12/03 13:19:38 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.9 2014/12/03 13:09:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.10 2014/12/03 13:19:38 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2272,60 +2272,62 @@ Static usb_device_descriptor_t ehci_devd
 };
 
 Static const usb_device_qualifier_t ehci_odevd = {
-	USB_DEVICE_DESCRIPTOR_SIZE,
-	UDESC_DEVICE_QUALIFIER,	/* type */
-	{0x00, 0x02},		/* USB version */
-	UDCLASS_HUB,		/* class */
-	UDSUBCLASS_HUB,		/* subclass */
-	UDPROTO_FSHUB,		/* protocol */
-	64,			/* max packet */
-	1,			/* # of configurations */
+	.bLength = USB_DEVICE_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_DEVICE_QUALIFIER,
+	.bcdUSB = {0x00, 0x02},
+	.bDeviceClass = UDCLASS_HUB,
+	.bDeviceSubClass = UDSUBCLASS_HUB,
+	.bDeviceProtocol = UDPROTO_FSHUB,
+	.bMaxPacketSize0 = 64,
+	.bNumConfigurations = 1,
 	0
 };
 
 Static const usb_config_descriptor_t ehci_confd = {
-	USB_CONFIG_DESCRIPTOR_SIZE,
-	UDESC_CONFIG,
-	{USB_CONFIG_DESCRIPTOR_SIZE +
-	 USB_INTERFACE_DESCRIPTOR_SIZE +
-	 USB_ENDPOINT_DESCRIPTOR_SIZE},
-	1,
-	1,
-	0,
-	UC_ATTR_MBO | UC_SELF_POWERED,
-	0			/* max power */
+	.bLength = USB_CONFIG_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_CONFIG,
+	.wTotalLength = {
+		USB_CONFIG_DESCRIPTOR_SIZE +
+		USB_INTERFACE_DESCRIPTOR_SIZE +
+		USB_ENDPOINT_DESCRIPTOR_SIZE
+	},
+	.bNumInterface = 1,
+	.bConfigurationValue = 1,
+	.iConfiguration = 0,
+	.bmAttributes = UC_ATTR_MBO | UC_SELF_POWERED,
+	.bMaxPower = 0
 };
 
 Static const usb_interface_descriptor_t ehci_ifcd = {
-	USB_INTERFACE_DESCRIPTOR_SIZE,
-	UDESC_INTERFACE,
-	0,
-	0,
-	1,
-	UICLASS_HUB,
-	UISUBCLASS_HUB,
-	UIPROTO_HSHUBSTT,
-	0
+	.bLength = USB_INTERFACE_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_INTERFACE,
+	.bInterfaceNumber = 0,
+	.bAlternateSetting = 0,
+	.bNumEndpoints = 1,
+	.bInterfaceClass = UICLASS_HUB,
+	.bInterfaceSubClass = UISUBCLASS_HUB,
+	.bInterfaceProtocol = UIPROTO_HSHUBSTT,
+	.iInterface = 0
 };
 
 Static const usb_endpoint_descriptor_t ehci_endpd = {
-	USB_ENDPOINT_DESCRIPTOR_SIZE,
-	UDESC_ENDPOINT,
-	UE_DIR_IN | EHCI_INTR_ENDPT,
-	UE_INTERRUPT,
-	{8, 0},			/* max packet */
-	12
+	.bLength = USB_ENDPOINT_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_ENDPOINT,
+	.bEndpointAddress = UE_DIR_IN | EHCI_INTR_ENDPT,
+	.bmAttributes = UE_INTERRUPT,
+	.wMaxPacketSize = {8, 0},
+	.bInterval = 12
 };
 
 Static const usb_hub_descriptor_t ehci_hubd = {
-	USB_HUB_DESCRIPTOR_SIZE,
-	UDESC_HUB,
-	0,
-	{0,0},
-	0,
-	0,
-	{""},
-	{""},
+	.bDescLength = USB_HUB_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_HUB,
+	.bNbrPorts = 0,
+	.wHubCharacteristics = {0,0},
+	.bPwrOn2PwrGood = 0,
+	.bHubContrCurrent = 0,
+	.DeviceRemovable = {""},
+	.PortPowerCtrlMask = {""},
 };
 
 /*

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.254.2.8 src/sys/dev/usb/ohci.c:1.254.2.9
--- src/sys/dev/usb/ohci.c:1.254.2.8	Wed Dec  3 13:09:00 2014
+++ src/sys/dev/usb/ohci.c	Wed Dec  3 13:19:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.254.2.8 2014/12/03 13:09:00 skrll Exp $	*/
+/*	$NetBSD: ohci.c,v 1.254.2.9 2014/12/03 13:19:38 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.8 2014/12/03 13:09:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.9 2014/12/03 13:19:38 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2412,28 +2412,30 @@ Static usb_device_descriptor_t ohci_devd
 };
 
 Static const usb_config_descriptor_t ohci_confd = {
-	USB_CONFIG_DESCRIPTOR_SIZE,
-	UDESC_CONFIG,
-	{USB_CONFIG_DESCRIPTOR_SIZE +
-	 USB_INTERFACE_DESCRIPTOR_SIZE +
-	 USB_ENDPOINT_DESCRIPTOR_SIZE},
-	1,
-	1,
-	0,
-	UC_ATTR_MBO | UC_SELF_POWERED,
-	0			/* max power */
+	.bLength = USB_CONFIG_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_CONFIG,
+	.wTotalLength = {
+		USB_CONFIG_DESCRIPTOR_SIZE +
+		USB_INTERFACE_DESCRIPTOR_SIZE +
+		USB_ENDPOINT_DESCRIPTOR_SIZE
+	},
+	.bNumInterface = 1,
+	.bConfigurationValue = 1,
+	.iConfiguration = 0,
+	.bmAttributes = UC_ATTR_MBO | UC_SELF_POWERED,
+	.bMaxPower = 0
 };
 
 Static const usb_interface_descriptor_t ohci_ifcd = {
-	USB_INTERFACE_DESCRIPTOR_SIZE,
-	UDESC_INTERFACE,
-	0,
-	0,
-	1,
-	UICLASS_HUB,
-	UISUBCLASS_HUB,
-	UIPROTO_FSHUB,
-	0
+	.bLength = USB_INTERFACE_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_INTERFACE,
+	.bInterfaceNumber = 0,
+	.bAlternateSetting = 0,
+	.bNumEndpoints = 1,
+	.bInterfaceClass = UICLASS_HUB,
+	.bInterfaceSubClass = UISUBCLASS_HUB,
+	.bInterfaceProtocol = UIPROTO_FSHUB,
+	.iInterface = 0
 };
 
 Static const usb_endpoint_descriptor_t ohci_endpd = {
@@ -2441,7 +2443,7 @@ Static const usb_endpoint_descriptor_t o
 	.bDescriptorType = UDESC_ENDPOINT,
 	.bEndpointAddress = UE_DIR_IN | OHCI_INTR_ENDPT,
 	.bmAttributes = UE_INTERRUPT,
-	.wMaxPacketSize = {8, 0},			/* max packet */
+	.wMaxPacketSize = {8, 0},
 	.bInterval = 255,
 };
 

Index: src/sys/dev/usb/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.264.4.8 src/sys/dev/usb/uhci.c:1.264.4.9
--- src/sys/dev/usb/uhci.c:1.264.4.8	Wed Dec  3 13:09:00 2014
+++ src/sys/dev/usb/uhci.c	Wed Dec  3 13:19:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.264.4.8 2014/12/03 13:09:00 skrll Exp $	*/
+/*	$NetBSD: uhci.c,v 1.264.4.9 2014/12/03 13:19:38 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.4.8 2014/12/03 13:09:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.4.9 2014/12/03 13:19:38 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3344,48 +3344,53 @@ usb_device_descriptor_t uhci_devd = {
 };
 
 const usb_config_descriptor_t uhci_confd = {
-	USB_CONFIG_DESCRIPTOR_SIZE,
-	UDESC_CONFIG,
-	{USB_CONFIG_DESCRIPTOR_SIZE +
-	 USB_INTERFACE_DESCRIPTOR_SIZE +
-	 USB_ENDPOINT_DESCRIPTOR_SIZE},
-	1,
-	1,
-	0,
-	UC_ATTR_MBO | UC_SELF_POWERED,
-	0			/* max power */
+	.bLength = USB_CONFIG_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_CONFIG,
+	.wTotalLength = {
+		USB_CONFIG_DESCRIPTOR_SIZE +
+		USB_INTERFACE_DESCRIPTOR_SIZE +
+		USB_ENDPOINT_DESCRIPTOR_SIZE
+	},
+	.bNumInterface = 1,
+	.bConfigurationValue = 1,
+	.iConfiguration = 0,
+	.bmAttributes = UC_ATTR_MBO | UC_SELF_POWERED,
+	.bMaxPower = 0
 };
 
 const usb_interface_descriptor_t uhci_ifcd = {
-	USB_INTERFACE_DESCRIPTOR_SIZE,
-	UDESC_INTERFACE,
-	0,
-	0,
-	1,
-	UICLASS_HUB,
-	UISUBCLASS_HUB,
-	UIPROTO_FSHUB,
-	0
+	.bLength = USB_INTERFACE_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_INTERFACE,
+	.bInterfaceNumber = 0,
+	.bAlternateSetting = 0,
+	.bNumEndpoints = 1,
+	.bInterfaceClass = UICLASS_HUB,
+	.bInterfaceSubClass = UISUBCLASS_HUB,
+	.bInterfaceProtocol = UIPROTO_FSHUB,
+	.iInterface = 0
 };
 
 const usb_endpoint_descriptor_t uhci_endpd = {
-	USB_ENDPOINT_DESCRIPTOR_SIZE,
-	UDESC_ENDPOINT,
-	UE_DIR_IN | UHCI_INTR_ENDPT,
-	UE_INTERRUPT,
-	{8},
-	255
+	.bLength = USB_ENDPOINT_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_ENDPOINT,
+	.bEndpointAddress = UE_DIR_IN | UHCI_INTR_ENDPT,
+	.bmAttributes = UE_INTERRUPT,
+	.wMaxPacketSize = {8},
+	.bInterval = 255
 };
 
 const usb_hub_descriptor_t uhci_hubd_piix = {
-	USB_HUB_DESCRIPTOR_SIZE,
-	UDESC_HUB,
-	2,
-	{ UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL, 0 },
-	50,			/* power on to power good */
-	0,
-	{ 0x00 },		/* both ports are removable */
-	{ 0 },
+	.bDescLength = USB_HUB_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_HUB,
+	.bNbrPorts = 2,
+	.wHubCharacteristics = {
+		UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL,
+		0
+	},
+	.bPwrOn2PwrGood = 50,
+	.bHubContrCurrent = 0,
+	.DeviceRemovable = { 0x00 },
+	.PortPowerCtrlMask = { 0 },
 };
 
 /*

Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.28.2.6 src/sys/dev/usb/xhci.c:1.28.2.7
--- src/sys/dev/usb/xhci.c:1.28.2.6	Wed Dec  3 13:09:00 2014
+++ src/sys/dev/usb/xhci.c	Wed Dec  3 13:19:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.28.2.6 2014/12/03 13:09:00 skrll Exp $	*/
+/*	$NetBSD: xhci.c,v 1.28.2.7 2014/12/03 13:19:38 skrll Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.28.2.6 2014/12/03 13:09:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.28.2.7 2014/12/03 13:19:38 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -2018,60 +2018,61 @@ static const usb_device_descriptor_t xhc
 };
 
 static const usb_device_qualifier_t xhci_odevd = {
-	USB_DEVICE_DESCRIPTOR_SIZE,
-	UDESC_DEVICE_QUALIFIER,	/* type */
-	{0x00, 0x02},		/* USB version */
-	UDCLASS_HUB,		/* class */
-	UDSUBCLASS_HUB,		/* subclass */
-	UDPROTO_FSHUB,		/* protocol */
-	64,                     /* max packet */
-	1,                      /* # of configurations */
-	0
+	.bLength = USB_DEVICE_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_DEVICE_QUALIFIER,
+	.bcdUSB = {0x00, 0x02},
+	.bDeviceClass = UDCLASS_HUB,
+	.bDeviceSubClass = UDSUBCLASS_HUB,
+	.bDeviceProtocol = UDPROTO_FSHUB,
+	.bMaxPacketSize0 = 64,
+	.bNumConfigurations = 1,
 };
 
 static const usb_config_descriptor_t xhci_confd = {
-	USB_CONFIG_DESCRIPTOR_SIZE,
-	UDESC_CONFIG,
-	{USB_CONFIG_DESCRIPTOR_SIZE +
-	 USB_INTERFACE_DESCRIPTOR_SIZE +
-	 USB_ENDPOINT_DESCRIPTOR_SIZE},
-	1,
-	1,
-	0,
-	UC_ATTR_MBO | UC_SELF_POWERED,
-	0                      /* max power */
+	.bLength = USB_CONFIG_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_CONFIG,
+	.wTotalLength = {
+		USB_CONFIG_DESCRIPTOR_SIZE +
+		USB_INTERFACE_DESCRIPTOR_SIZE +
+		USB_ENDPOINT_DESCRIPTOR_SIZE
+	},
+	.bNumInterface = 1,
+	.bConfigurationValue = 1,
+	.iConfiguration = 0,
+	.bmAttributes = UC_ATTR_MBO | UC_SELF_POWERED,
+	.bMaxPower = 0
 };
 
 static const usb_interface_descriptor_t xhci_ifcd = {
-	USB_INTERFACE_DESCRIPTOR_SIZE,
-	UDESC_INTERFACE,
-	0,
-	0,
-	1,
-	UICLASS_HUB,
-	UISUBCLASS_HUB,
-	UIPROTO_HSHUBSTT,
-	0
+	.bLength = USB_INTERFACE_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_INTERFACE,
+	.bInterfaceNumber = 0,
+	.bAlternateSetting = 0,
+	.bNumEndpoints = 1,
+	.bInterfaceClass = UICLASS_HUB,
+	.bInterfaceSubClass = UISUBCLASS_HUB,
+	.bInterfaceProtocol = UIPROTO_HSHUBSTT,
+	.iInterface = 0
 };
 
 static const usb_endpoint_descriptor_t xhci_endpd = {
-	USB_ENDPOINT_DESCRIPTOR_SIZE,
-	UDESC_ENDPOINT,
-	UE_DIR_IN | XHCI_INTR_ENDPT,
-	UE_INTERRUPT,
-	{8, 0},                 /* max packet */
-	12
+	.bLength = USB_ENDPOINT_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_ENDPOINT,
+	.bEndpointAddress = UE_DIR_IN | XHCI_INTR_ENDPT,
+	.bmAttributes = UE_INTERRUPT,
+	.wMaxPacketSize = {8, 0},
+	.bInterval = 12
 };
 
 static const usb_hub_descriptor_t xhci_hubd = {
-	USB_HUB_DESCRIPTOR_SIZE,
-	UDESC_HUB,
-	0,
-	{0,0},
-	0,
-	0,
-	{""},
-	{""},
+	.bDescLength = USB_HUB_DESCRIPTOR_SIZE,
+	.bDescriptorType = UDESC_HUB,
+	.bNbrPorts = 0,
+	.wHubCharacteristics = {0,0},
+	.bPwrOn2PwrGood = 0,
+	.bHubContrCurrent = 0,
+	.DeviceRemovable = {""},
+	.PortPowerCtrlMask = {""},
 };
 
 /* root hub control */

Reply via email to