diff options
Diffstat (limited to 'sys/dev/usb/if_rum.c')
-rw-r--r-- | sys/dev/usb/if_rum.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index c15595738f1..90832819911 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rum.c,v 1.56 2007/05/21 06:10:43 jsg Exp $ */ +/* $OpenBSD: if_rum.c,v 1.57 2007/05/27 04:00:24 jsg Exp $ */ /*- * Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini@free.fr> @@ -219,9 +219,10 @@ static const struct rfprog { USB_DECLARE_DRIVER_CLASS(rum, DV_IFNET); -USB_MATCH(rum) +int +rum_match(struct device *parent, void *match, void *aux) { - USB_MATCH_START(rum, uaa); + struct usb_attach_arg *uaa = aux; if (uaa->iface != NULL) return UMATCH_NONE; @@ -253,9 +254,11 @@ rum_attachhook(void *xsc) free(ucode, M_DEVBUF); } -USB_ATTACH(rum) +void +rum_attach(struct device *parent, struct device *self, void *aux) { - USB_ATTACH_START(rum, sc, uaa); + struct rum_softc *sc = (struct rum_softc *)self; + struct usb_attach_arg *uaa = aux; struct ieee80211com *ic = &sc->sc_ic; struct ifnet *ifp = &ic->ic_if; usb_interface_descriptor_t *id; @@ -268,14 +271,13 @@ USB_ATTACH(rum) sc->sc_udev = uaa->device; devinfop = usbd_devinfo_alloc(uaa->device, 0); - USB_ATTACH_SETUP; - printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfop); + printf("\n%s: %s\n", USBDEVNAME(sc->sc_dev), devinfop); usbd_devinfo_free(devinfop); if (usbd_set_config_no(sc->sc_udev, RT2573_CONFIG_NO, 0) != 0) { printf("%s: could not set configuration no\n", USBDEVNAME(sc->sc_dev)); - USB_ATTACH_ERROR_RETURN; + return; } /* get the first interface handle */ @@ -284,7 +286,7 @@ USB_ATTACH(rum) if (error != 0) { printf("%s: could not get interface handle\n", USBDEVNAME(sc->sc_dev)); - USB_ATTACH_ERROR_RETURN; + return; } /* @@ -298,7 +300,7 @@ USB_ATTACH(rum) if (ed == NULL) { printf("%s: no endpoint descriptor for iface %d\n", USBDEVNAME(sc->sc_dev), i); - USB_ATTACH_ERROR_RETURN; + return; } if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && @@ -310,7 +312,7 @@ USB_ATTACH(rum) } if (sc->sc_rx_no == -1 || sc->sc_tx_no == -1) { printf("%s: missing endpoint\n", USBDEVNAME(sc->sc_dev)); - USB_ATTACH_ERROR_RETURN; + return; } usb_init_task(&sc->sc_task, rum_task, sc); @@ -329,7 +331,7 @@ USB_ATTACH(rum) if (ntries == 1000) { printf("%s: timeout waiting for chip to settle\n", USBDEVNAME(sc->sc_dev)); - USB_ATTACH_ERROR_RETURN; + return; } /* retrieve MAC address and various other things from EEPROM */ @@ -432,13 +434,12 @@ USB_ATTACH(rum) usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, USBDEV(sc->sc_dev)); - - USB_ATTACH_SUCCESS_RETURN; } -USB_DETACH(rum) +int +rum_detach(struct device *self, int flags) { - USB_DETACH_START(rum, sc); + struct rum_softc *sc = (struct rum_softc *)self; struct ifnet *ifp = &sc->sc_ic.ic_if; int s; |