Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/nick-nhusb]: src/sys Use designated initialisers for usb_device_descript...



details:   https://anonhg.NetBSD.org/src/rev/f3ea1e0a9a7b
branches:  nick-nhusb
changeset: 804206:f3ea1e0a9a7b
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Dec 03 13:08:59 2014 +0000

description:
Use designated initialisers for usb_device_descriptor_t structs.

diffstat:

 sys/arch/mips/adm5120/dev/ahci.c |  36 +++++++++++++++++++-----------------
 sys/dev/ic/sl811hs.c             |  36 +++++++++++++++++++-----------------
 sys/dev/usb/ehci.c               |  28 ++++++++++++++++------------
 sys/dev/usb/ohci.c               |  28 ++++++++++++++++------------
 sys/dev/usb/uhci.c               |  28 ++++++++++++++++------------
 sys/dev/usb/xhci.c               |  28 ++++++++++++++++------------
 6 files changed, 102 insertions(+), 82 deletions(-)

diffs (truncated from 310 to 300 lines):

diff -r 525b8b96fa78 -r f3ea1e0a9a7b sys/arch/mips/adm5120/dev/ahci.c
--- a/sys/arch/mips/adm5120/dev/ahci.c  Wed Dec 03 12:52:04 2014 +0000
+++ b/sys/arch/mips/adm5120/dev/ahci.c  Wed Dec 03 13:08:59 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahci.c,v 1.12.6.5 2014/12/03 12:52:05 skrll Exp $      */
+/*     $NetBSD: ahci.c,v 1.12.6.6 2014/12/03 13:08:59 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.5 2014/12/03 12:52:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.12.6.6 2014/12/03 13:08:59 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -532,21 +532,23 @@
  * Data structures and routines to emulate the root hub.
  */
 usb_device_descriptor_t ahci_devd = {
-       USB_DEVICE_DESCRIPTOR_SIZE,
-       UDESC_DEVICE,           /* type */
-       {0x01, 0x01},                   /* USB version */
-       UDCLASS_HUB,            /* class */
-       UDSUBCLASS_HUB,         /* subclass */
-       0,                      /* protocol */
-       64,                     /* max packet */
-       {USB_VENDOR_SCANLOGIC & 0xff,   /* vendor ID (low)  */
-        USB_VENDOR_SCANLOGIC >> 8  },  /* vendor ID (high) */
-       {0} /* ? */,            /* product ID */
-       {0},                    /* device */
-       1,                      /* index to manufacturer */
-       2,                      /* index to product */
-       0,                      /* index to serial number */
-       1                       /* number of configurations */
+       .bLength = USB_DEVICE_DESCRIPTOR_SIZE,
+       .bDescriptorType = UDESC_DEVICE,
+       .bcdUSB = {0x01, 0x01},
+       .bDeviceClass = UDCLASS_HUB,
+       .bDeviceSubClass = UDSUBCLASS_HUB,
+       .bDeviceProtocol = 0,
+       .bMaxPacketSize = 64,
+       .idVendor = {
+               USB_VENDOR_SCANLOGIC & 0xff,    /* vendor ID (low)  */
+               USB_VENDOR_SCANLOGIC >> 8
+       },
+       .idProduct = {0},
+       .bcdDevice = {0},
+       .iManufacturer = 1,
+       .iProduct = 2,
+       .iSerialNumber = 0,
+       .bNumConfigurations = 1
 };
 
 usb_config_descriptor_t ahci_confd = {
diff -r 525b8b96fa78 -r f3ea1e0a9a7b sys/dev/ic/sl811hs.c
--- a/sys/dev/ic/sl811hs.c      Wed Dec 03 12:52:04 2014 +0000
+++ b/sys/dev/ic/sl811hs.c      Wed Dec 03 13:08:59 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sl811hs.c,v 1.47.6.4 2014/12/03 12:52:06 skrll Exp $   */
+/*     $NetBSD: sl811hs.c,v 1.47.6.5 2014/12/03 13:09:00 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.4 2014/12/03 12:52:06 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.47.6.5 2014/12/03 13:09:00 skrll Exp $");
 
 #include "opt_slhci.h"
 
@@ -2930,21 +2930,23 @@
  * Data structures and routines to emulate the root hub.
  */
 static const usb_device_descriptor_t slhci_devd = {
-       USB_DEVICE_DESCRIPTOR_SIZE,
-       UDESC_DEVICE,           /* type */
-       {0x01, 0x01},           /* USB version */
-       UDCLASS_HUB,            /* class */
-       UDSUBCLASS_HUB,         /* subclass */
-       0,                      /* protocol */
-       64,                     /* max packet */
-       {USB_VENDOR_SCANLOGIC & 0xff,   /* vendor ID (low)  */
-        USB_VENDOR_SCANLOGIC >> 8  },  /* vendor ID (high) */
-       {0} /* ? */,            /* product ID */
-       {0},                    /* device */
-       1,                      /* index to manufacturer */
-       2,                      /* index to product */
-       0,                      /* index to serial number */
-       1                       /* number of configurations */
+       .bLength = USB_DEVICE_DESCRIPTOR_SIZE,
+       .bDescriptorType = UDESC_DEVICE,
+       .bcdUSB = {0x01, 0x01},
+       .bDeviceClass = UDCLASS_HUB,
+       .bDeviceSubClass = UDSUBCLASS_HUB,
+       .bDeviceProtocol = 0,
+       .bMaxPacketSize = 64,
+       .idVendor = {
+               USB_VENDOR_SCANLOGIC & 0xff,    /* vendor ID (low)  */
+               USB_VENDOR_SCANLOGIC >> 8
+       },
+       .idProduct = {0},
+       .bcdDevice = {0},
+       .iManufacturer = 1,
+       .iProduct = 2,
+       .iSerialNumber = 0,
+       .bNumConfigurations = 1
 };
 
 static const struct slhci_confd_t {
diff -r 525b8b96fa78 -r f3ea1e0a9a7b sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Wed Dec 03 12:52:04 2014 +0000
+++ b/sys/dev/usb/ehci.c        Wed Dec 03 13:08:59 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.234.2.8 2014/12/03 12:52:07 skrll Exp $ */
+/*     $NetBSD: ehci.c,v 1.234.2.9 2014/12/03 13:09:00 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.8 2014/12/03 12:52:07 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.9 2014/12/03 13:09:00 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2255,16 +2255,20 @@
  * Data structures and routines to emulate the root hub.
  */
 Static usb_device_descriptor_t ehci_devd = {
-       USB_DEVICE_DESCRIPTOR_SIZE,
-       UDESC_DEVICE,           /* type */
-       {0x00, 0x02},           /* USB version */
-       UDCLASS_HUB,            /* class */
-       UDSUBCLASS_HUB,         /* subclass */
-       UDPROTO_HSHUBSTT,       /* protocol */
-       64,                     /* max packet */
-       {0},{0},{0x00,0x01},    /* device id */
-       1,2,0,                  /* string indicies */
-       1                       /* # of configurations */
+       .bLength = USB_DEVICE_DESCRIPTOR_SIZE,
+       .bDescriptorType = UDESC_DEVICE,
+       .bcdUSB = {0x00, 0x02},
+       .bDeviceClass = UDCLASS_HUB,
+       .bDeviceSubClass = UDSUBCLASS_HUB,
+       .bDeviceProtocol = UDPROTO_HSHUBSTT,
+       .bMaxPacketSize = 64,
+       .idVendor = {0},
+       .idProduct = {0},
+       .bcdDevice = {0x00,0x01},
+       .iManufacturer = 1,
+       .iProduct = 2,
+       .iSerialNumber = 0,
+       .bNumConfigurations = 1
 };
 
 Static const usb_device_qualifier_t ehci_odevd = {
diff -r 525b8b96fa78 -r f3ea1e0a9a7b sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Wed Dec 03 12:52:04 2014 +0000
+++ b/sys/dev/usb/ohci.c        Wed Dec 03 13:08:59 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.254.2.7 2014/12/03 12:52:07 skrll Exp $     */
+/*     $NetBSD: ohci.c,v 1.254.2.8 2014/12/03 13:09:00 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.7 2014/12/03 12:52:07 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.8 2014/12/03 13:09:00 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2395,16 +2395,20 @@
  * Data structures and routines to emulate the root hub.
  */
 Static usb_device_descriptor_t ohci_devd = {
-       USB_DEVICE_DESCRIPTOR_SIZE,
-       UDESC_DEVICE,           /* type */
-       {0x00, 0x01},           /* USB version */
-       UDCLASS_HUB,            /* class */
-       UDSUBCLASS_HUB,         /* subclass */
-       UDPROTO_FSHUB,          /* protocol */
-       64,                     /* max packet */
-       {0},{0},{0x00,0x01},    /* device id */
-       1,2,0,                  /* string indicies */
-       1                       /* # of configurations */
+       .bLength = USB_DEVICE_DESCRIPTOR_SIZE,
+       .bDescriptorType = UDESC_DEVICE,
+       .bcdUSB = {0x00, 0x01},
+       .bDeviceClass = UDCLASS_HUB,
+       .bDeviceSubClass = UDSUBCLASS_HUB,
+       .bDeviceProtocol = UDPROTO_FSHUB,
+       .bMaxPacketSize = 64,
+       .idVendor = {0},
+       .idProduct = {0},
+       .bcdDevice = {0x00,0x01},
+       .iManufacturer = 1,
+       .iProduct = 2,
+       .iSerialNumber = 0,
+       .bNumConfigurations = 1
 };
 
 Static const usb_config_descriptor_t ohci_confd = {
diff -r 525b8b96fa78 -r f3ea1e0a9a7b sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Wed Dec 03 12:52:04 2014 +0000
+++ b/sys/dev/usb/uhci.c        Wed Dec 03 13:08:59 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.264.4.7 2014/12/03 12:52:07 skrll Exp $     */
+/*     $NetBSD: uhci.c,v 1.264.4.8 2014/12/03 13:09:00 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.7 2014/12/03 12:52:07 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.4.8 2014/12/03 13:09:00 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3327,16 +3327,20 @@
  * Data structures and routines to emulate the root hub.
  */
 usb_device_descriptor_t uhci_devd = {
-       USB_DEVICE_DESCRIPTOR_SIZE,
-       UDESC_DEVICE,           /* type */
-       {0x00, 0x01},           /* USB version */
-       UDCLASS_HUB,            /* class */
-       UDSUBCLASS_HUB,         /* subclass */
-       UDPROTO_FSHUB,          /* protocol */
-       64,                     /* max packet */
-       {0},{0},{0x00,0x01},    /* device id */
-       1,2,0,                  /* string indicies */
-       1                       /* # of configurations */
+       .bLength = USB_DEVICE_DESCRIPTOR_SIZE,
+       .bDescriptorType = UDESC_DEVICE,
+       .bcdUSB = {0x00, 0x01},
+       .bDeviceClass = UDCLASS_HUB,
+       .bDeviceSubClass = UDSUBCLASS_HUB,
+       .bDeviceProtocol = UDPROTO_FSHUB,
+       .bMaxPacketSize = 64,
+       .idVendor = {0},
+       .idProduct = {0},
+       .bcdDevice = {0x00,0x01},
+       .iManufacturer = 1,
+       .iProduct = 2,
+       .iSerialNumber = 0,
+       .bNumConfigurations = 1
 };
 
 const usb_config_descriptor_t uhci_confd = {
diff -r 525b8b96fa78 -r f3ea1e0a9a7b sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Wed Dec 03 12:52:04 2014 +0000
+++ b/sys/dev/usb/xhci.c        Wed Dec 03 13:08:59 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.28.2.5 2014/12/03 12:52:07 skrll Exp $      */
+/*     $NetBSD: xhci.c,v 1.28.2.6 2014/12/03 13:09:00 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.5 2014/12/03 12:52:07 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.28.2.6 2014/12/03 13:09:00 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -2001,16 +2001,20 @@
 /* root hub descriptors */
 
 static const usb_device_descriptor_t xhci_devd = {
-       USB_DEVICE_DESCRIPTOR_SIZE,
-       UDESC_DEVICE,           /* type */
-       {0x00, 0x02},           /* USB version */
-       UDCLASS_HUB,            /* class */
-       UDSUBCLASS_HUB,         /* subclass */
-       UDPROTO_HSHUBSTT,       /* protocol */
-       64,                     /* max packet */
-       {0},{0},{0x00,0x01},    /* device id */
-       1,2,0,                  /* string indexes */
-       1                       /* # of configurations */
+       .bLength = USB_DEVICE_DESCRIPTOR_SIZE,
+       .bDescriptorType = UDESC_DEVICE,
+       .bcdUSB = {0x00, 0x02},
+       .bDeviceClass = UDCLASS_HUB,
+       .bDeviceSubClass = UDSUBCLASS_HUB,
+       .bDeviceProtocol = UDPROTO_HSHUBSTT,
+       .bMaxPacketSize = 64,



Home | Main Index | Thread Index | Old Index