The devinfo stuff has been moved up into the parent bus. There's no

need to do it at all anymore.  Remove it from here.  Expand
USB_ATTACH_SETUP inline now that it is one line and we're moving away
from the compat macros.  Remove some bzero calls that turn out not be
be necessary.
This commit is contained in:
Warner Losh 2007-06-09 06:31:07 +00:00
parent df16203833
commit e591b223d8
9 changed files with 4 additions and 53 deletions

View File

@ -407,14 +407,12 @@ USB_MATCH(axe)
USB_ATTACH(axe)
{
USB_ATTACH_START(axe, sc, uaa);
char devinfo[1024];
u_char eaddr[ETHER_ADDR_LEN];
struct ifnet *ifp;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
int i;
bzero(sc, sizeof(struct axe_softc));
sc->axe_udev = uaa->device;
sc->axe_dev = self;
sc->axe_unit = device_get_unit(self);
@ -436,10 +434,6 @@ USB_ATTACH(axe)
id = usbd_get_interface_descriptor(sc->axe_iface);
usbd_devinfo(uaa->device, 0, devinfo);
device_set_desc_copy(self, devinfo);
printf("%s: %s\n", device_get_nameunit(self), devinfo);
/* Find endpoints. */
for (i = 0; i < id->bNumEndpoints; i++) {
ed = usbd_interface2endpoint_descriptor(sc->axe_iface, i);

View File

@ -146,12 +146,7 @@ USB_ATTACH(cdce)
const usb_cdc_ethernet_descriptor_t *ue;
char eaddr_str[USB_MAX_STRING_LEN];
bzero(sc, sizeof(struct cdce_softc));
sc->cdce_dev = self;
usbd_devinfo(dev, 0, sc->devinfo);
device_set_desc_copy(self, sc->devinfo);
printf("%s: %s\n", device_get_nameunit(sc->cdce_dev), sc->devinfo);
sc->cdce_udev = uaa->device;
sc->cdce_unit = device_get_unit(self);

View File

@ -66,8 +66,6 @@ struct cdce_softc {
struct mtx cdce_mtx;
struct usb_qdat q;
char devinfo[1024];
};
/* We are still under Giant */

View File

@ -431,14 +431,12 @@ USB_MATCH(cue)
USB_ATTACH(cue)
{
USB_ATTACH_START(cue, sc, uaa);
char devinfo[1024];
u_char eaddr[ETHER_ADDR_LEN];
struct ifnet *ifp;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
int i;
bzero(sc, sizeof(struct cue_softc));
sc->cue_dev = self;
sc->cue_iface = uaa->iface;
sc->cue_udev = uaa->device;
@ -452,10 +450,6 @@ USB_ATTACH(cue)
id = usbd_get_interface_descriptor(uaa->iface);
usbd_devinfo(uaa->device, 0, devinfo);
device_set_desc_copy(self, devinfo);
printf("%s: %s\n", device_get_nameunit(self), devinfo);
/* Find endpoints. */
for (i = 0; i < id->bNumEndpoints; i++) {
ed = usbd_interface2endpoint_descriptor(uaa->iface, i);

View File

@ -405,14 +405,12 @@ USB_MATCH(kue)
USB_ATTACH(kue)
{
USB_ATTACH_START(kue, sc, uaa);
char devinfo[1024];
struct ifnet *ifp;
usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
int i;
bzero(sc, sizeof(struct kue_softc));
sc->kue_dev = self;
sc->kue_iface = uaa->iface;
sc->kue_udev = uaa->device;
@ -420,10 +418,6 @@ USB_ATTACH(kue)
id = usbd_get_interface_descriptor(uaa->iface);
usbd_devinfo(uaa->device, 0, devinfo);
device_set_desc_copy(self, devinfo);
printf("%s: %s\n", device_get_nameunit(self), devinfo);
/* Find endpoints. */
for (i = 0; i < id->bNumEndpoints; i++) {
ed = usbd_interface2endpoint_descriptor(uaa->iface, i);

View File

@ -575,7 +575,6 @@ USB_MATCH(rue)
USB_ATTACH(rue)
{
USB_ATTACH_START(rue, sc, uaa);
char *devinfo;
u_char eaddr[ETHER_ADDR_LEN];
struct ifnet *ifp;
usbd_interface_handle iface;
@ -585,11 +584,6 @@ USB_ATTACH(rue)
int i;
struct rue_type *t;
devinfo = malloc(1024, M_USBDEV, M_WAITOK);
bzero(sc, sizeof (struct rue_softc));
usbd_devinfo(uaa->device, 0, devinfo);
sc->rue_dev = self;
sc->rue_udev = uaa->device;
sc->rue_unit = device_get_unit(self);
@ -621,10 +615,6 @@ USB_ATTACH(rue)
id = usbd_get_interface_descriptor(sc->rue_iface);
usbd_devinfo(uaa->device, 0, devinfo);
device_set_desc_copy(self, devinfo);
printf("%s: %s\n", device_get_nameunit(self), devinfo);
/* Find endpoints */
for (i = 0; i < id->bNumEndpoints; i++) {
ed = usbd_interface2endpoint_descriptor(iface, i);
@ -692,7 +682,6 @@ USB_ATTACH(rue)
sc->rue_dying = 0;
RUE_UNLOCK(sc);
free(devinfo, M_USBDEV);
USB_ATTACH_SUCCESS_RETURN;
error2:
@ -701,7 +690,6 @@ USB_ATTACH(rue)
RUE_UNLOCK(sc);
mtx_destroy(&sc->rue_mtx);
error:
free(devinfo, M_USBDEV);
USB_ATTACH_ERROR_RETURN;
}

View File

@ -374,14 +374,11 @@ USB_ATTACH(rum)
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
usbd_status error;
char devinfo[1024];
int i, ntries, size;
uint32_t tmp;
sc->sc_udev = uaa->device;
usbd_devinfo(sc->sc_udev, 0, devinfo);
USB_ATTACH_SETUP;
sc->sc_dev = self;
if (usbd_set_config_no(sc->sc_udev, RT2573_CONFIG_NO, 0) != 0) {
printf("%s: could not set configuration no\n",

View File

@ -284,7 +284,6 @@ USB_ATTACH(udav)
usbd_status err;
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
char devinfo[1024];
const char *devname ;
struct ifnet *ifp;
#if defined(__NetBSD__)
@ -296,13 +295,8 @@ USB_ATTACH(udav)
int s;
#endif
bzero(sc, sizeof(struct udav_softc));
usbd_devinfo(dev, 0, devinfo);
USB_ATTACH_SETUP;
devname = device_get_nameunit(sc->sc_dev);
printf("%s: %s\n", devname, devinfo);
sc->sc_dev = self;
devname = device_get_nameunit(self);
/* Move the device into the configured state. */
err = usbd_set_config_no(dev, UDAV_CONFIG_NO, 1);
if (err) {

View File

@ -357,13 +357,10 @@ USB_ATTACH(ural)
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
usbd_status error;
char devinfo[1024];
int i;
sc->sc_udev = uaa->device;
usbd_devinfo(sc->sc_udev, 0, devinfo);
USB_ATTACH_SETUP;
sc->sc_dev = self;
if (usbd_set_config_no(sc->sc_udev, RAL_CONFIG_NO, 0) != 0) {
printf("%s: could not set configuration no\n",