Expand USB_ATTACH_{ERROR,SUCCESS}_RETURN inline and eliminate from
usb_port.h. They aren't needed, and are a legacy of this code's past.
This commit is contained in:
parent
e141ee255d
commit
645016c0e4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170612
@ -130,7 +130,7 @@ USB_ATTACH(ndisusb)
|
|||||||
sc = (struct ndis_softc *)dummy;
|
sc = (struct ndis_softc *)dummy;
|
||||||
|
|
||||||
if (uaa->device == NULL)
|
if (uaa->device == NULL)
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
|
|
||||||
sc->ndis_dev = self;
|
sc->ndis_dev = self;
|
||||||
|
|
||||||
@ -140,9 +140,9 @@ USB_ATTACH(ndisusb)
|
|||||||
windrv_create_pdo(drv, self);
|
windrv_create_pdo(drv, self);
|
||||||
|
|
||||||
if (ndis_attach(self) != 0)
|
if (ndis_attach(self) != 0)
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct resource_list *
|
static struct resource_list *
|
||||||
|
@ -552,14 +552,14 @@ USB_ATTACH(uaudio)
|
|||||||
if (cdesc == NULL) {
|
if (cdesc == NULL) {
|
||||||
printf("%s: failed to get configuration descriptor\n",
|
printf("%s: failed to get configuration descriptor\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = uaudio_identify(sc, cdesc);
|
err = uaudio_identify(sc, cdesc);
|
||||||
if (err) {
|
if (err) {
|
||||||
printf("%s: audio descriptors make no sense, error=%d\n",
|
printf("%s: audio descriptors make no sense, error=%d\n",
|
||||||
device_get_nameunit(sc->sc_dev), err);
|
device_get_nameunit(sc->sc_dev), err);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->sc_ac_ifaceh = uaa->iface;
|
sc->sc_ac_ifaceh = uaa->iface;
|
||||||
@ -586,7 +586,7 @@ USB_ATTACH(uaudio)
|
|||||||
if (sc->sc_alts[j].ifaceh == NULL) {
|
if (sc->sc_alts[j].ifaceh == NULL) {
|
||||||
printf("%s: alt %d missing AS interface(s)\n",
|
printf("%s: alt %d missing AS interface(s)\n",
|
||||||
device_get_nameunit(sc->sc_dev), j);
|
device_get_nameunit(sc->sc_dev), j);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -620,7 +620,7 @@ USB_ATTACH(uaudio)
|
|||||||
sc->sc_dying = 0;
|
sc->sc_dying = 0;
|
||||||
if (audio_attach_mi(sc->sc_dev)) {
|
if (audio_attach_mi(sc->sc_dev)) {
|
||||||
printf("audio_attach_mi failed\n");
|
printf("audio_attach_mi failed\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -630,8 +630,7 @@ USB_ATTACH(uaudio)
|
|||||||
OID_AUTO, "async", CTLFLAG_RW, &sc->async, 0,
|
OID_AUTO, "async", CTLFLAG_RW, &sc->async, 0,
|
||||||
"Asynchronous USB request");
|
"Asynchronous USB request");
|
||||||
#endif
|
#endif
|
||||||
|
return 0;
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
|
@ -644,13 +644,13 @@ USB_ATTACH(aue)
|
|||||||
|
|
||||||
if (usbd_set_config_no(sc->aue_udev, AUE_CONFIG_NO, 0)) {
|
if (usbd_set_config_no(sc->aue_udev, AUE_CONFIG_NO, 0)) {
|
||||||
device_printf(self, "getting interface handle failed\n");
|
device_printf(self, "getting interface handle failed\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = usbd_device2interface_handle(uaa->device, AUE_IFACE_IDX, &iface);
|
err = usbd_device2interface_handle(uaa->device, AUE_IFACE_IDX, &iface);
|
||||||
if (err) {
|
if (err) {
|
||||||
device_printf(self, "getting interface handle failed\n");
|
device_printf(self, "getting interface handle failed\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->aue_iface = iface;
|
sc->aue_iface = iface;
|
||||||
@ -666,7 +666,7 @@ USB_ATTACH(aue)
|
|||||||
ed = usbd_interface2endpoint_descriptor(iface, i);
|
ed = usbd_interface2endpoint_descriptor(iface, i);
|
||||||
if (ed == NULL) {
|
if (ed == NULL) {
|
||||||
device_printf(self, "couldn't get ep %d\n", i);
|
device_printf(self, "couldn't get ep %d\n", i);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
||||||
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
||||||
@ -702,7 +702,7 @@ USB_ATTACH(aue)
|
|||||||
mtx_destroy(&sc->aue_mtx);
|
mtx_destroy(&sc->aue_mtx);
|
||||||
sx_destroy(&sc->aue_sx);
|
sx_destroy(&sc->aue_sx);
|
||||||
usb_ether_task_destroy(&sc->aue_taskqueue);
|
usb_ether_task_destroy(&sc->aue_taskqueue);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
ifp->if_softc = sc;
|
ifp->if_softc = sc;
|
||||||
if_initname(ifp, "aue", sc->aue_unit);
|
if_initname(ifp, "aue", sc->aue_unit);
|
||||||
@ -736,7 +736,7 @@ USB_ATTACH(aue)
|
|||||||
mtx_destroy(&sc->aue_mtx);
|
mtx_destroy(&sc->aue_mtx);
|
||||||
sx_destroy(&sc->aue_sx);
|
sx_destroy(&sc->aue_sx);
|
||||||
usb_ether_task_destroy(&sc->aue_taskqueue);
|
usb_ether_task_destroy(&sc->aue_taskqueue);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->aue_qdat.ifp = ifp;
|
sc->aue_qdat.ifp = ifp;
|
||||||
@ -751,7 +751,7 @@ USB_ATTACH(aue)
|
|||||||
sc->aue_link = 1;
|
sc->aue_link = 1;
|
||||||
|
|
||||||
AUE_SXUNLOCK(sc);
|
AUE_SXUNLOCK(sc);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -417,7 +417,7 @@ USB_ATTACH(axe)
|
|||||||
|
|
||||||
if (usbd_set_config_no(sc->axe_udev, AXE_CONFIG_NO, 1)) {
|
if (usbd_set_config_no(sc->axe_udev, AXE_CONFIG_NO, 1)) {
|
||||||
device_printf(sc->axe_dev, "getting interface handle failed\n");
|
device_printf(sc->axe_dev, "getting interface handle failed\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
usb_init_task(&sc->axe_tick_task, axe_tick_task, sc);
|
usb_init_task(&sc->axe_tick_task, axe_tick_task, sc);
|
||||||
@ -425,7 +425,7 @@ USB_ATTACH(axe)
|
|||||||
if (usbd_device2interface_handle(uaa->device,
|
if (usbd_device2interface_handle(uaa->device,
|
||||||
AXE_IFACE_IDX, &sc->axe_iface)) {
|
AXE_IFACE_IDX, &sc->axe_iface)) {
|
||||||
device_printf(sc->axe_dev, "getting interface handle failed\n");
|
device_printf(sc->axe_dev, "getting interface handle failed\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
id = usbd_get_interface_descriptor(sc->axe_iface);
|
id = usbd_get_interface_descriptor(sc->axe_iface);
|
||||||
@ -435,7 +435,7 @@ USB_ATTACH(axe)
|
|||||||
ed = usbd_interface2endpoint_descriptor(sc->axe_iface, i);
|
ed = usbd_interface2endpoint_descriptor(sc->axe_iface, i);
|
||||||
if (!ed) {
|
if (!ed) {
|
||||||
device_printf(sc->axe_dev, "couldn't get ep %d\n", i);
|
device_printf(sc->axe_dev, "couldn't get ep %d\n", i);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
||||||
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
||||||
@ -479,7 +479,7 @@ USB_ATTACH(axe)
|
|||||||
AXE_SLEEPUNLOCK(sc);
|
AXE_SLEEPUNLOCK(sc);
|
||||||
sx_destroy(&sc->axe_sleeplock);
|
sx_destroy(&sc->axe_sleeplock);
|
||||||
mtx_destroy(&sc->axe_mtx);
|
mtx_destroy(&sc->axe_mtx);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
ifp->if_softc = sc;
|
ifp->if_softc = sc;
|
||||||
if_initname(ifp, "axe", device_get_unit(sc->axe_dev));
|
if_initname(ifp, "axe", device_get_unit(sc->axe_dev));
|
||||||
@ -505,7 +505,7 @@ USB_ATTACH(axe)
|
|||||||
AXE_SLEEPUNLOCK(sc);
|
AXE_SLEEPUNLOCK(sc);
|
||||||
sx_destroy(&sc->axe_sleeplock);
|
sx_destroy(&sc->axe_sleeplock);
|
||||||
mtx_destroy(&sc->axe_mtx);
|
mtx_destroy(&sc->axe_mtx);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -521,7 +521,7 @@ USB_ATTACH(axe)
|
|||||||
AXE_UNLOCK(sc);
|
AXE_UNLOCK(sc);
|
||||||
AXE_SLEEPUNLOCK(sc);
|
AXE_SLEEPUNLOCK(sc);
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -160,7 +160,7 @@ USB_ATTACH(cdce)
|
|||||||
UDESC_CS_INTERFACE, UDESCSUB_CDC_UNION);
|
UDESC_CS_INTERFACE, UDESCSUB_CDC_UNION);
|
||||||
if (ud == NULL) {
|
if (ud == NULL) {
|
||||||
device_printf(sc->cdce_dev, "no union descriptor\n");
|
device_printf(sc->cdce_dev, "no union descriptor\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
data_ifcno = ud->bSlaveInterface[0];
|
data_ifcno = ud->bSlaveInterface[0];
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ USB_ATTACH(cdce)
|
|||||||
|
|
||||||
if (sc->cdce_data_iface == NULL) {
|
if (sc->cdce_data_iface == NULL) {
|
||||||
device_printf(sc->cdce_dev, "no data interface\n");
|
device_printf(sc->cdce_dev, "no data interface\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -208,7 +208,7 @@ USB_ATTACH(cdce)
|
|||||||
if (usbd_set_interface(sc->cdce_data_iface, j)) {
|
if (usbd_set_interface(sc->cdce_data_iface, j)) {
|
||||||
device_printf(sc->cdce_dev,
|
device_printf(sc->cdce_dev,
|
||||||
"setting alternate interface failed\n");
|
"setting alternate interface failed\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
/* Find endpoints. */
|
/* Find endpoints. */
|
||||||
id = usbd_get_interface_descriptor(sc->cdce_data_iface);
|
id = usbd_get_interface_descriptor(sc->cdce_data_iface);
|
||||||
@ -218,7 +218,7 @@ USB_ATTACH(cdce)
|
|||||||
if (!ed) {
|
if (!ed) {
|
||||||
device_printf(sc->cdce_dev,
|
device_printf(sc->cdce_dev,
|
||||||
"could not read endpoint descriptor\n");
|
"could not read endpoint descriptor\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
||||||
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
||||||
@ -242,11 +242,11 @@ USB_ATTACH(cdce)
|
|||||||
|
|
||||||
if (sc->cdce_bulkin_no == -1) {
|
if (sc->cdce_bulkin_no == -1) {
|
||||||
device_printf(sc->cdce_dev, "could not find data bulk in\n");
|
device_printf(sc->cdce_dev, "could not find data bulk in\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if (sc->cdce_bulkout_no == -1 ) {
|
if (sc->cdce_bulkout_no == -1 ) {
|
||||||
device_printf(sc->cdce_dev, "could not find data bulk out\n");
|
device_printf(sc->cdce_dev, "could not find data bulk out\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
mtx_init(&sc->cdce_mtx, device_get_nameunit(sc->cdce_dev), MTX_NETWORK_LOCK,
|
mtx_init(&sc->cdce_mtx, device_get_nameunit(sc->cdce_dev), MTX_NETWORK_LOCK,
|
||||||
@ -285,7 +285,7 @@ USB_ATTACH(cdce)
|
|||||||
device_printf(sc->cdce_dev, "can not if_alloc()\n");
|
device_printf(sc->cdce_dev, "can not if_alloc()\n");
|
||||||
CDCE_UNLOCK(sc);
|
CDCE_UNLOCK(sc);
|
||||||
mtx_destroy(&sc->cdce_mtx);
|
mtx_destroy(&sc->cdce_mtx);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
ifp->if_softc = sc;
|
ifp->if_softc = sc;
|
||||||
if_initname(ifp, "cdce", device_get_unit(sc->cdce_dev));
|
if_initname(ifp, "cdce", device_get_unit(sc->cdce_dev));
|
||||||
@ -314,7 +314,7 @@ USB_ATTACH(cdce)
|
|||||||
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->cdce_udev,
|
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->cdce_udev,
|
||||||
USBDEV(sc->cdce_dev));
|
USBDEV(sc->cdce_dev));
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_DETACH(cdce)
|
USB_DETACH(cdce)
|
||||||
|
@ -443,7 +443,7 @@ USB_ATTACH(cue)
|
|||||||
|
|
||||||
if (usbd_set_config_no(sc->cue_udev, CUE_CONFIG_NO, 0)) {
|
if (usbd_set_config_no(sc->cue_udev, CUE_CONFIG_NO, 0)) {
|
||||||
device_printf(sc->cue_dev, "getting interface handle failed\n");
|
device_printf(sc->cue_dev, "getting interface handle failed\n");
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
id = usbd_get_interface_descriptor(uaa->iface);
|
id = usbd_get_interface_descriptor(uaa->iface);
|
||||||
@ -453,7 +453,7 @@ USB_ATTACH(cue)
|
|||||||
ed = usbd_interface2endpoint_descriptor(uaa->iface, i);
|
ed = usbd_interface2endpoint_descriptor(uaa->iface, i);
|
||||||
if (!ed) {
|
if (!ed) {
|
||||||
device_printf(sc->cue_dev, "couldn't get ep %d\n", i);
|
device_printf(sc->cue_dev, "couldn't get ep %d\n", i);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
||||||
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
||||||
@ -485,7 +485,7 @@ USB_ATTACH(cue)
|
|||||||
device_printf(sc->cue_dev, "can not if_alloc()\n");
|
device_printf(sc->cue_dev, "can not if_alloc()\n");
|
||||||
CUE_UNLOCK(sc);
|
CUE_UNLOCK(sc);
|
||||||
mtx_destroy(&sc->cue_mtx);
|
mtx_destroy(&sc->cue_mtx);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
ifp->if_softc = sc;
|
ifp->if_softc = sc;
|
||||||
if_initname(ifp, "cue", device_get_unit(sc->cue_dev));
|
if_initname(ifp, "cue", device_get_unit(sc->cue_dev));
|
||||||
@ -511,7 +511,7 @@ USB_ATTACH(cue)
|
|||||||
sc->cue_dying = 0;
|
sc->cue_dying = 0;
|
||||||
|
|
||||||
CUE_UNLOCK(sc);
|
CUE_UNLOCK(sc);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -421,7 +421,7 @@ USB_ATTACH(kue)
|
|||||||
ed = usbd_interface2endpoint_descriptor(uaa->iface, i);
|
ed = usbd_interface2endpoint_descriptor(uaa->iface, i);
|
||||||
if (!ed) {
|
if (!ed) {
|
||||||
device_printf(sc->kue_dev, "couldn't get ep %d\n", i);
|
device_printf(sc->kue_dev, "couldn't get ep %d\n", i);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
||||||
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
||||||
@ -443,7 +443,7 @@ USB_ATTACH(kue)
|
|||||||
if (kue_load_fw(sc)) {
|
if (kue_load_fw(sc)) {
|
||||||
KUE_UNLOCK(sc);
|
KUE_UNLOCK(sc);
|
||||||
mtx_destroy(&sc->kue_mtx);
|
mtx_destroy(&sc->kue_mtx);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset the adapter. */
|
/* Reset the adapter. */
|
||||||
@ -461,7 +461,7 @@ USB_ATTACH(kue)
|
|||||||
device_printf(sc->kue_dev, "can not if_alloc()\n");
|
device_printf(sc->kue_dev, "can not if_alloc()\n");
|
||||||
KUE_UNLOCK(sc);
|
KUE_UNLOCK(sc);
|
||||||
mtx_destroy(&sc->kue_mtx);
|
mtx_destroy(&sc->kue_mtx);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
ifp->if_softc = sc;
|
ifp->if_softc = sc;
|
||||||
if_initname(ifp, "kue", device_get_unit(sc->kue_dev));
|
if_initname(ifp, "kue", device_get_unit(sc->kue_dev));
|
||||||
@ -487,7 +487,7 @@ USB_ATTACH(kue)
|
|||||||
|
|
||||||
KUE_UNLOCK(sc);
|
KUE_UNLOCK(sc);
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -679,7 +679,7 @@ USB_ATTACH(rue)
|
|||||||
sc->rue_dying = 0;
|
sc->rue_dying = 0;
|
||||||
|
|
||||||
RUE_UNLOCK(sc);
|
RUE_UNLOCK(sc);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
error2:
|
error2:
|
||||||
if_free(ifp);
|
if_free(ifp);
|
||||||
@ -687,7 +687,7 @@ USB_ATTACH(rue)
|
|||||||
RUE_UNLOCK(sc);
|
RUE_UNLOCK(sc);
|
||||||
mtx_destroy(&sc->rue_mtx);
|
mtx_destroy(&sc->rue_mtx);
|
||||||
error:
|
error:
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -388,7 +388,7 @@ USB_ATTACH(rum)
|
|||||||
if (usbd_set_config_no(sc->sc_udev, RT2573_CONFIG_NO, 0) != 0) {
|
if (usbd_set_config_no(sc->sc_udev, RT2573_CONFIG_NO, 0) != 0) {
|
||||||
printf("%s: could not set configuration no\n",
|
printf("%s: could not set configuration no\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the first interface handle */
|
/* get the first interface handle */
|
||||||
@ -397,7 +397,7 @@ USB_ATTACH(rum)
|
|||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
printf("%s: could not get interface handle\n",
|
printf("%s: could not get interface handle\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -411,7 +411,7 @@ USB_ATTACH(rum)
|
|||||||
if (ed == NULL) {
|
if (ed == NULL) {
|
||||||
printf("%s: no endpoint descriptor for iface %d\n",
|
printf("%s: no endpoint descriptor for iface %d\n",
|
||||||
device_get_nameunit(sc->sc_dev), i);
|
device_get_nameunit(sc->sc_dev), i);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
||||||
@ -424,7 +424,7 @@ USB_ATTACH(rum)
|
|||||||
if (sc->sc_rx_no == -1 || sc->sc_tx_no == -1) {
|
if (sc->sc_rx_no == -1 || sc->sc_tx_no == -1) {
|
||||||
printf("%s: missing endpoint\n",
|
printf("%s: missing endpoint\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK,
|
mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK,
|
||||||
@ -444,7 +444,7 @@ USB_ATTACH(rum)
|
|||||||
if (ntries == 1000) {
|
if (ntries == 1000) {
|
||||||
printf("%s: timeout waiting for chip to settle\n",
|
printf("%s: timeout waiting for chip to settle\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* retrieve MAC address and various other things from EEPROM */
|
/* retrieve MAC address and various other things from EEPROM */
|
||||||
@ -459,7 +459,7 @@ USB_ATTACH(rum)
|
|||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
device_printf(sc->sc_dev, "could not load 8051 microcode\n");
|
device_printf(sc->sc_dev, "could not load 8051 microcode\n");
|
||||||
mtx_destroy(&sc->sc_mtx);
|
mtx_destroy(&sc->sc_mtx);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
ifp = sc->sc_ifp = if_alloc(IFT_ETHER);
|
ifp = sc->sc_ifp = if_alloc(IFT_ETHER);
|
||||||
@ -467,7 +467,7 @@ USB_ATTACH(rum)
|
|||||||
printf("%s: can not if_alloc()\n",
|
printf("%s: can not if_alloc()\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
mtx_destroy(&sc->sc_mtx);
|
mtx_destroy(&sc->sc_mtx);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
ifp->if_softc = sc;
|
ifp->if_softc = sc;
|
||||||
@ -565,7 +565,7 @@ USB_ATTACH(rum)
|
|||||||
if (bootverbose)
|
if (bootverbose)
|
||||||
ieee80211_announce(ic);
|
ieee80211_announce(ic);
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_DETACH(rum)
|
USB_DETACH(rum)
|
||||||
|
@ -442,7 +442,7 @@ USB_ATTACH(udav)
|
|||||||
if_free(ifp);
|
if_free(ifp);
|
||||||
UDAV_UNLOCK(sc);
|
UDAV_UNLOCK(sc);
|
||||||
mtx_destroy(&sc->sc_mtx);
|
mtx_destroy(&sc->sc_mtx);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->sc_qdat.ifp = ifp;
|
sc->sc_qdat.ifp = ifp;
|
||||||
@ -472,11 +472,11 @@ USB_ATTACH(udav)
|
|||||||
|
|
||||||
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, USBDEV(sc->sc_dev));
|
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, USBDEV(sc->sc_dev));
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
sc->sc_dying = 1;
|
sc->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* detach */
|
/* detach */
|
||||||
|
@ -373,7 +373,7 @@ USB_ATTACH(ural)
|
|||||||
if (usbd_set_config_no(sc->sc_udev, RAL_CONFIG_NO, 0) != 0) {
|
if (usbd_set_config_no(sc->sc_udev, RAL_CONFIG_NO, 0) != 0) {
|
||||||
printf("%s: could not set configuration no\n",
|
printf("%s: could not set configuration no\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the first interface handle */
|
/* get the first interface handle */
|
||||||
@ -382,7 +382,7 @@ USB_ATTACH(ural)
|
|||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
printf("%s: could not get interface handle\n",
|
printf("%s: could not get interface handle\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -396,7 +396,7 @@ USB_ATTACH(ural)
|
|||||||
if (ed == NULL) {
|
if (ed == NULL) {
|
||||||
printf("%s: no endpoint descriptor for %d\n",
|
printf("%s: no endpoint descriptor for %d\n",
|
||||||
device_get_nameunit(sc->sc_dev), i);
|
device_get_nameunit(sc->sc_dev), i);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
||||||
@ -409,7 +409,7 @@ USB_ATTACH(ural)
|
|||||||
if (sc->sc_rx_no == -1 || sc->sc_tx_no == -1) {
|
if (sc->sc_rx_no == -1 || sc->sc_tx_no == -1) {
|
||||||
printf("%s: missing endpoint\n",
|
printf("%s: missing endpoint\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK,
|
mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK,
|
||||||
@ -434,7 +434,7 @@ USB_ATTACH(ural)
|
|||||||
if (ifp == NULL) {
|
if (ifp == NULL) {
|
||||||
printf("%s: can not if_alloc()\n",
|
printf("%s: can not if_alloc()\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
ifp->if_softc = sc;
|
ifp->if_softc = sc;
|
||||||
@ -504,7 +504,7 @@ USB_ATTACH(ural)
|
|||||||
if (bootverbose)
|
if (bootverbose)
|
||||||
ieee80211_announce(ic);
|
ieee80211_announce(ic);
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_DETACH(ural)
|
USB_DETACH(ural)
|
||||||
|
@ -189,12 +189,12 @@ USB_ATTACH(uark)
|
|||||||
|
|
||||||
DPRINTF(("uark: in=0x%x out=0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no));
|
DPRINTF(("uark: in=0x%x out=0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no));
|
||||||
ucom_attach(&sc->sc_ucom);
|
ucom_attach(&sc->sc_ucom);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
DPRINTF(("uftdi_attach: ATTACH ERROR\n"));
|
DPRINTF(("uftdi_attach: ATTACH ERROR\n"));
|
||||||
ucom->sc_dying = 1;
|
ucom->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_DETACH(uark)
|
USB_DETACH(uark)
|
||||||
|
@ -398,10 +398,10 @@ USB_ATTACH(ubsa)
|
|||||||
|
|
||||||
TASK_INIT(&sc->sc_task, 0, ubsa_notify, sc);
|
TASK_INIT(&sc->sc_task, 0, ubsa_notify, sc);
|
||||||
ucom_attach(ucom);
|
ucom_attach(ucom);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_DETACH(ubsa)
|
USB_DETACH(ubsa)
|
||||||
|
@ -283,7 +283,7 @@ USB_ATTACH(ubser)
|
|||||||
if (ed == NULL) {
|
if (ed == NULL) {
|
||||||
printf("%s: couldn't get ep %d\n",
|
printf("%s: couldn't get ep %d\n",
|
||||||
device_get_nameunit(sc->sc_dev), i);
|
device_get_nameunit(sc->sc_dev), i);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
||||||
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
||||||
@ -373,7 +373,7 @@ USB_ATTACH(ubser)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ubserstartread(sc);
|
ubserstartread(sc);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
fail_4:
|
fail_4:
|
||||||
for (i = 0; i < sc->sc_numser; i++) {
|
for (i = 0; i < sc->sc_numser; i++) {
|
||||||
@ -408,7 +408,7 @@ USB_ATTACH(ubser)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DPRINTF(("ubser_attach: ATTACH ERROR\n"));
|
DPRINTF(("ubser_attach: ATTACH ERROR\n"));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_DETACH(ubser)
|
USB_DETACH(ubser)
|
||||||
|
@ -270,7 +270,7 @@ USB_ATTACH(udbp)
|
|||||||
if (!ed) {
|
if (!ed) {
|
||||||
printf("%s: could not read endpoint descriptor\n",
|
printf("%s: could not read endpoint descriptor\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN
|
||||||
@ -289,7 +289,7 @@ USB_ATTACH(udbp)
|
|||||||
if (ed_bulkin == NULL || ed_bulkout == NULL) {
|
if (ed_bulkin == NULL || ed_bulkout == NULL) {
|
||||||
printf("%s: bulk-in and/or bulk-out endpoint not found\n",
|
printf("%s: bulk-in and/or bulk-out endpoint not found\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ed_bulkin->wMaxPacketSize[0] != ed_bulkout->wMaxPacketSize[0] ||
|
if (ed_bulkin->wMaxPacketSize[0] != ed_bulkout->wMaxPacketSize[0] ||
|
||||||
@ -300,7 +300,7 @@ USB_ATTACH(udbp)
|
|||||||
ed_bulkout->wMaxPacketSize[0],
|
ed_bulkout->wMaxPacketSize[0],
|
||||||
ed_bulkin->wMaxPacketSize[1],
|
ed_bulkin->wMaxPacketSize[1],
|
||||||
ed_bulkout->wMaxPacketSize[1]);
|
ed_bulkout->wMaxPacketSize[1]);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->sc_bulkin = ed_bulkin->bEndpointAddress;
|
sc->sc_bulkin = ed_bulkin->bEndpointAddress;
|
||||||
@ -383,7 +383,7 @@ USB_ATTACH(udbp)
|
|||||||
if (err) {
|
if (err) {
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
bad:
|
bad:
|
||||||
#if 0 /* probably done in udbp_detach() */
|
#if 0 /* probably done in udbp_detach() */
|
||||||
if (sc->sc_bulkout_buffer) {
|
if (sc->sc_bulkout_buffer) {
|
||||||
@ -400,7 +400,7 @@ USB_ATTACH(udbp)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
udbp_detach(self);
|
udbp_detach(self);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,11 +160,11 @@ USB_ATTACH(ufm)
|
|||||||
UID_ROOT, GID_OPERATOR,
|
UID_ROOT, GID_OPERATOR,
|
||||||
0644, "ufm%d", device_get_unit(self));
|
0644, "ufm%d", device_get_unit(self));
|
||||||
DPRINTFN(10, ("ufm_attach: %p\n", sc->sc_udev));
|
DPRINTFN(10, ("ufm_attach: %p\n", sc->sc_udev));
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
nobulk:
|
nobulk:
|
||||||
device_printf(sc->sc_dev, "could not find %s\n", ermsg);
|
device_printf(sc->sc_dev, "could not find %s\n", ermsg);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -357,12 +357,12 @@ USB_ATTACH(uftdi)
|
|||||||
#endif
|
#endif
|
||||||
DPRINTF(("uftdi: in=0x%x out=0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no));
|
DPRINTF(("uftdi: in=0x%x out=0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no));
|
||||||
ucom_attach(&sc->sc_ucom);
|
ucom_attach(&sc->sc_ucom);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
DPRINTF(("uftdi_attach: ATTACH ERROR\n"));
|
DPRINTF(("uftdi_attach: ATTACH ERROR\n"));
|
||||||
ucom->sc_dying = 1;
|
ucom->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
int
|
int
|
||||||
|
@ -225,7 +225,7 @@ USB_ATTACH(uhid)
|
|||||||
printf("%s: could not read endpoint descriptor\n",
|
printf("%s: could not read endpoint descriptor\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
sc->sc_dying = 1;
|
sc->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTFN(10,("uhid_attach: bLength=%d bDescriptorType=%d "
|
DPRINTFN(10,("uhid_attach: bLength=%d bDescriptorType=%d "
|
||||||
@ -241,7 +241,7 @@ USB_ATTACH(uhid)
|
|||||||
(ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
|
(ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
|
||||||
printf("%s: unexpected endpoint\n", device_get_nameunit(sc->sc_dev));
|
printf("%s: unexpected endpoint\n", device_get_nameunit(sc->sc_dev));
|
||||||
sc->sc_dying = 1;
|
sc->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->sc_ep_addr = ed->bEndpointAddress;
|
sc->sc_ep_addr = ed->bEndpointAddress;
|
||||||
@ -296,7 +296,7 @@ USB_ATTACH(uhid)
|
|||||||
if (err) {
|
if (err) {
|
||||||
printf("%s: no report descriptor\n", device_get_nameunit(sc->sc_dev));
|
printf("%s: no report descriptor\n", device_get_nameunit(sc->sc_dev));
|
||||||
sc->sc_dying = 1;
|
sc->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)usbd_set_idle(iface, 0, 0);
|
(void)usbd_set_idle(iface, 0, 0);
|
||||||
@ -314,7 +314,7 @@ USB_ATTACH(uhid)
|
|||||||
0644, "uhid%d", device_get_unit(self));
|
0644, "uhid%d", device_get_unit(self));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
|
@ -163,7 +163,7 @@ USB_ATTACH(ukbd)
|
|||||||
sc->sc_dev = self;
|
sc->sc_dev = self;
|
||||||
sw = kbd_get_switch(DRIVER_NAME);
|
sw = kbd_get_switch(DRIVER_NAME);
|
||||||
if (sw == NULL)
|
if (sw == NULL)
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
|
|
||||||
id = usbd_get_interface_descriptor(iface);
|
id = usbd_get_interface_descriptor(iface);
|
||||||
|
|
||||||
@ -171,19 +171,19 @@ USB_ATTACH(ukbd)
|
|||||||
arg[1] = (void *)ukbd_intr;
|
arg[1] = (void *)ukbd_intr;
|
||||||
kbd = NULL;
|
kbd = NULL;
|
||||||
if ((*sw->probe)(unit, (void *)arg, 0))
|
if ((*sw->probe)(unit, (void *)arg, 0))
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
if ((*sw->init)(unit, &kbd, (void *)arg, 0))
|
if ((*sw->init)(unit, &kbd, (void *)arg, 0))
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
(*sw->enable)(kbd);
|
(*sw->enable)(kbd);
|
||||||
|
|
||||||
#ifdef KBD_INSTALL_CDEV
|
#ifdef KBD_INSTALL_CDEV
|
||||||
if (kbd_attach(kbd))
|
if (kbd_attach(kbd))
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
#endif
|
#endif
|
||||||
if (bootverbose)
|
if (bootverbose)
|
||||||
(*sw->diag)(kbd, bootverbose);
|
(*sw->diag)(kbd, bootverbose);
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -209,7 +209,7 @@ USB_ATTACH(ulpt)
|
|||||||
if (cdesc == NULL) {
|
if (cdesc == NULL) {
|
||||||
printf("%s: failed to get configuration descriptor\n",
|
printf("%s: failed to get configuration descriptor\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
iend = (usb_interface_descriptor_t *)
|
iend = (usb_interface_descriptor_t *)
|
||||||
((char *)cdesc + UGETW(cdesc->wTotalLength));
|
((char *)cdesc + UGETW(cdesc->wTotalLength));
|
||||||
@ -242,7 +242,7 @@ USB_ATTACH(ulpt)
|
|||||||
printf("%s: setting alternate interface failed\n",
|
printf("%s: setting alternate interface failed\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
sc->sc_dying = 1;
|
sc->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ USB_ATTACH(ulpt)
|
|||||||
if (ed == NULL) {
|
if (ed == NULL) {
|
||||||
printf("%s: couldn't get ep %d\n",
|
printf("%s: couldn't get ep %d\n",
|
||||||
device_get_nameunit(sc->sc_dev), i);
|
device_get_nameunit(sc->sc_dev), i);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
|
||||||
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
|
||||||
@ -270,7 +270,7 @@ USB_ATTACH(ulpt)
|
|||||||
printf("%s: could not find bulk out endpoint\n",
|
printf("%s: could not find bulk out endpoint\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
sc->sc_dying = 1;
|
sc->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usbd_get_quirks(dev)->uq_flags & UQ_BROKEN_BIDIR) {
|
if (usbd_get_quirks(dev)->uq_flags & UQ_BROKEN_BIDIR) {
|
||||||
@ -332,7 +332,7 @@ USB_ATTACH(ulpt)
|
|||||||
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
|
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
|
||||||
USBDEV(sc->sc_dev));
|
USBDEV(sc->sc_dev));
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -995,7 +995,7 @@ USB_ATTACH(umass)
|
|||||||
"Alt Interface %d\n",
|
"Alt Interface %d\n",
|
||||||
device_get_nameunit(sc->sc_dev), 1));
|
device_get_nameunit(sc->sc_dev), 1));
|
||||||
umass_detach(self);
|
umass_detach(self);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1015,7 +1015,7 @@ USB_ATTACH(umass)
|
|||||||
if (!ed) {
|
if (!ed) {
|
||||||
printf("%s: could not read endpoint descriptor\n",
|
printf("%s: could not read endpoint descriptor\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN
|
||||||
&& (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) {
|
&& (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) {
|
||||||
@ -1044,7 +1044,7 @@ USB_ATTACH(umass)
|
|||||||
device_get_nameunit(sc->sc_dev),
|
device_get_nameunit(sc->sc_dev),
|
||||||
sc->bulkin, sc->bulkout, sc->intrin));
|
sc->bulkin, sc->bulkout, sc->intrin));
|
||||||
umass_detach(self);
|
umass_detach(self);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open the bulk-in and -out pipe */
|
/* Open the bulk-in and -out pipe */
|
||||||
@ -1054,7 +1054,7 @@ USB_ATTACH(umass)
|
|||||||
DPRINTF(UDMASS_USB, ("%s: cannot open %d-out pipe (bulk)\n",
|
DPRINTF(UDMASS_USB, ("%s: cannot open %d-out pipe (bulk)\n",
|
||||||
device_get_nameunit(sc->sc_dev), sc->bulkout));
|
device_get_nameunit(sc->sc_dev), sc->bulkout));
|
||||||
umass_detach(self);
|
umass_detach(self);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
err = usbd_open_pipe(sc->iface, sc->bulkin,
|
err = usbd_open_pipe(sc->iface, sc->bulkin,
|
||||||
USBD_EXCLUSIVE_USE, &sc->bulkin_pipe);
|
USBD_EXCLUSIVE_USE, &sc->bulkin_pipe);
|
||||||
@ -1062,7 +1062,7 @@ USB_ATTACH(umass)
|
|||||||
DPRINTF(UDMASS_USB, ("%s: could not open %d-in pipe (bulk)\n",
|
DPRINTF(UDMASS_USB, ("%s: could not open %d-in pipe (bulk)\n",
|
||||||
device_get_nameunit(sc->sc_dev), sc->bulkin));
|
device_get_nameunit(sc->sc_dev), sc->bulkin));
|
||||||
umass_detach(self);
|
umass_detach(self);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
/* Open the intr-in pipe if the protocol is CBI with CCI.
|
/* Open the intr-in pipe if the protocol is CBI with CCI.
|
||||||
* Note: early versions of the Zip drive do have an interrupt pipe, but
|
* Note: early versions of the Zip drive do have an interrupt pipe, but
|
||||||
@ -1082,7 +1082,7 @@ USB_ATTACH(umass)
|
|||||||
DPRINTF(UDMASS_USB, ("%s: couldn't open %d-in (intr)\n",
|
DPRINTF(UDMASS_USB, ("%s: couldn't open %d-in (intr)\n",
|
||||||
device_get_nameunit(sc->sc_dev), sc->intrin));
|
device_get_nameunit(sc->sc_dev), sc->intrin));
|
||||||
umass_detach(self);
|
umass_detach(self);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1096,7 +1096,7 @@ USB_ATTACH(umass)
|
|||||||
DPRINTF(UDMASS_USB, ("%s: Out of memory\n",
|
DPRINTF(UDMASS_USB, ("%s: Out of memory\n",
|
||||||
device_get_nameunit(sc->sc_dev)));
|
device_get_nameunit(sc->sc_dev)));
|
||||||
umass_detach(self);
|
umass_detach(self);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1155,14 +1155,14 @@ USB_ATTACH(umass)
|
|||||||
err = umass_cam_attach_sim(sc);
|
err = umass_cam_attach_sim(sc);
|
||||||
if (err) {
|
if (err) {
|
||||||
umass_detach(self);
|
umass_detach(self);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
/* scan the new sim */
|
/* scan the new sim */
|
||||||
err = umass_cam_attach(sc);
|
err = umass_cam_attach(sc);
|
||||||
if (err) {
|
if (err) {
|
||||||
umass_cam_detach_sim(sc);
|
umass_cam_detach_sim(sc);
|
||||||
umass_detach(self);
|
umass_detach(self);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
panic("%s:%d: Unknown proto 0x%02x",
|
panic("%s:%d: Unknown proto 0x%02x",
|
||||||
@ -1172,7 +1172,7 @@ USB_ATTACH(umass)
|
|||||||
sc->transfer_state = TSTATE_IDLE;
|
sc->transfer_state = TSTATE_IDLE;
|
||||||
DPRINTF(UDMASS_GEN, ("%s: Attach finished\n", device_get_nameunit(sc->sc_dev)));
|
DPRINTF(UDMASS_GEN, ("%s: Attach finished\n", device_get_nameunit(sc->sc_dev)));
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_DETACH(umass)
|
USB_DETACH(umass)
|
||||||
|
@ -267,10 +267,10 @@ USB_ATTACH(umct)
|
|||||||
ucom->sc_callback = &umct_callback;
|
ucom->sc_callback = &umct_callback;
|
||||||
ucom_attach(ucom);
|
ucom_attach(ucom);
|
||||||
TASK_INIT(&sc->sc_task, 0, umct_notify, sc);
|
TASK_INIT(&sc->sc_task, 0, umct_notify, sc);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_DETACH(umct)
|
USB_DETACH(umct)
|
||||||
|
@ -406,11 +406,11 @@ USB_ATTACH(umodem)
|
|||||||
|
|
||||||
TASK_INIT(&sc->sc_task, 0, umodem_notify, sc);
|
TASK_INIT(&sc->sc_task, 0, umodem_notify, sc);
|
||||||
ucom_attach(&sc->sc_ucom);
|
ucom_attach(&sc->sc_ucom);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
ucom->sc_dying = 1;
|
ucom->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -208,7 +208,7 @@ USB_ATTACH(ums)
|
|||||||
if (!ed) {
|
if (!ed) {
|
||||||
printf("%s: could not read endpoint descriptor\n",
|
printf("%s: could not read endpoint descriptor\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTFN(10,("ums_attach: bLength=%d bDescriptorType=%d "
|
DPRINTFN(10,("ums_attach: bLength=%d bDescriptorType=%d "
|
||||||
@ -224,33 +224,33 @@ USB_ATTACH(ums)
|
|||||||
UE_GET_XFERTYPE(ed->bmAttributes) != UE_INTERRUPT) {
|
UE_GET_XFERTYPE(ed->bmAttributes) != UE_INTERRUPT) {
|
||||||
printf("%s: unexpected endpoint\n",
|
printf("%s: unexpected endpoint\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = usbd_read_report_desc(uaa->iface, &desc, &size, M_TEMP);
|
err = usbd_read_report_desc(uaa->iface, &desc, &size, M_TEMP);
|
||||||
if (err)
|
if (err)
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
|
|
||||||
if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
|
if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
|
||||||
hid_input, &sc->sc_loc_x, &flags)) {
|
hid_input, &sc->sc_loc_x, &flags)) {
|
||||||
printf("%s: mouse has no X report\n", device_get_nameunit(sc->sc_dev));
|
printf("%s: mouse has no X report\n", device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
|
if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
|
||||||
printf("%s: X report 0x%04x not supported\n",
|
printf("%s: X report 0x%04x not supported\n",
|
||||||
device_get_nameunit(sc->sc_dev), flags);
|
device_get_nameunit(sc->sc_dev), flags);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
|
if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
|
||||||
hid_input, &sc->sc_loc_y, &flags)) {
|
hid_input, &sc->sc_loc_y, &flags)) {
|
||||||
printf("%s: mouse has no Y report\n", device_get_nameunit(sc->sc_dev));
|
printf("%s: mouse has no Y report\n", device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
|
if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
|
||||||
printf("%s: Y report 0x%04x not supported\n",
|
printf("%s: Y report 0x%04x not supported\n",
|
||||||
device_get_nameunit(sc->sc_dev), flags);
|
device_get_nameunit(sc->sc_dev), flags);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* try to guess the Z activator: first check Z, then WHEEL */
|
/* try to guess the Z activator: first check Z, then WHEEL */
|
||||||
@ -288,7 +288,7 @@ USB_ATTACH(ums)
|
|||||||
M_USBDEV, M_NOWAIT);
|
M_USBDEV, M_NOWAIT);
|
||||||
if (!sc->sc_loc_btn) {
|
if (!sc->sc_loc_btn) {
|
||||||
printf("%s: no memory\n", device_get_nameunit(sc->sc_dev));
|
printf("%s: no memory\n", device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s: %d buttons%s%s.\n", device_get_nameunit(sc->sc_dev),
|
printf("%s: %d buttons%s%s.\n", device_get_nameunit(sc->sc_dev),
|
||||||
@ -304,7 +304,7 @@ USB_ATTACH(ums)
|
|||||||
if (!sc->sc_ibuf) {
|
if (!sc->sc_ibuf) {
|
||||||
printf("%s: no memory\n", device_get_nameunit(sc->sc_dev));
|
printf("%s: no memory\n", device_get_nameunit(sc->sc_dev));
|
||||||
free(sc->sc_loc_btn, M_USB);
|
free(sc->sc_loc_btn, M_USB);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->sc_ep_addr = ed->bEndpointAddress;
|
sc->sc_ep_addr = ed->bEndpointAddress;
|
||||||
@ -364,7 +364,7 @@ USB_ATTACH(ums)
|
|||||||
sc->flags |= UMS_SPUR_BUT_UP;
|
sc->flags |= UMS_SPUR_BUT_UP;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -538,10 +538,10 @@ USB_ATTACH(uplcom)
|
|||||||
|
|
||||||
TASK_INIT(&sc->sc_task, 0, uplcom_notify, sc);
|
TASK_INIT(&sc->sc_task, 0, uplcom_notify, sc);
|
||||||
ucom_attach(&sc->sc_ucom);
|
ucom_attach(&sc->sc_ucom);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_DETACH(uplcom)
|
USB_DETACH(uplcom)
|
||||||
|
@ -262,11 +262,11 @@ USB_ATTACH(urio)
|
|||||||
|
|
||||||
DPRINTFN(10, ("urio_attach: %p\n", sc->sc_udev));
|
DPRINTFN(10, ("urio_attach: %p\n", sc->sc_udev));
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
nobulk:
|
nobulk:
|
||||||
printf("%s: could not find %s\n", device_get_nameunit(sc->sc_dev),ermsg);
|
printf("%s: could not find %s\n", device_get_nameunit(sc->sc_dev),ermsg);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ USB_ATTACH(usb)
|
|||||||
default:
|
default:
|
||||||
printf(", not supported\n");
|
printf(", not supported\n");
|
||||||
sc->sc_dying = 1;
|
sc->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
@ -272,7 +272,7 @@ USB_ATTACH(usb)
|
|||||||
if (sc->sc_bus->soft == NULL) {
|
if (sc->sc_bus->soft == NULL) {
|
||||||
printf("%s: can't register softintr\n", device_get_nameunit(sc->sc_dev));
|
printf("%s: can't register softintr\n", device_get_nameunit(sc->sc_dev));
|
||||||
sc->sc_dying = 1;
|
sc->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
usb_callout_init(sc->sc_bus->softi);
|
usb_callout_init(sc->sc_bus->softi);
|
||||||
@ -287,7 +287,7 @@ USB_ATTACH(usb)
|
|||||||
sc->sc_dying = 1;
|
sc->sc_dying = 1;
|
||||||
printf("%s: root device is not a hub\n",
|
printf("%s: root device is not a hub\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
sc->sc_bus->root_hub = dev;
|
sc->sc_bus->root_hub = dev;
|
||||||
#if 1
|
#if 1
|
||||||
@ -336,7 +336,7 @@ USB_ATTACH(usb)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *taskq_names[] = USB_TASKQ_NAMES;
|
static const char *taskq_names[] = USB_TASKQ_NAMES;
|
||||||
|
@ -148,10 +148,6 @@ __CONCAT(dname,_attach)(device_t self)
|
|||||||
struct __CONCAT(dname,_softc) *sc = device_get_softc(self); \
|
struct __CONCAT(dname,_softc) *sc = device_get_softc(self); \
|
||||||
struct usb_attach_arg *uaa = device_get_ivars(self)
|
struct usb_attach_arg *uaa = device_get_ivars(self)
|
||||||
|
|
||||||
/* Returns from attach */
|
|
||||||
#define USB_ATTACH_ERROR_RETURN return ENXIO
|
|
||||||
#define USB_ATTACH_SUCCESS_RETURN return 0
|
|
||||||
|
|
||||||
#define USB_DETACH(dname) \
|
#define USB_DETACH(dname) \
|
||||||
static int \
|
static int \
|
||||||
__CONCAT(dname,_detach)(device_t self)
|
__CONCAT(dname,_detach)(device_t self)
|
||||||
|
@ -327,7 +327,7 @@ USB_ATTACH(uscanner)
|
|||||||
if (err) {
|
if (err) {
|
||||||
printf("%s: setting config no failed\n",
|
printf("%s: setting config no failed\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX We only check the first interface */
|
/* XXX We only check the first interface */
|
||||||
@ -337,7 +337,7 @@ USB_ATTACH(uscanner)
|
|||||||
if (err || id == 0) {
|
if (err || id == 0) {
|
||||||
printf("%s: could not get interface descriptor, err=%d,id=%p\n",
|
printf("%s: could not get interface descriptor, err=%d,id=%p\n",
|
||||||
device_get_nameunit(sc->sc_dev), err, id);
|
device_get_nameunit(sc->sc_dev), err, id);
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the two first bulk endpoints */
|
/* Find the two first bulk endpoints */
|
||||||
@ -346,7 +346,7 @@ USB_ATTACH(uscanner)
|
|||||||
if (ed == 0) {
|
if (ed == 0) {
|
||||||
printf("%s: could not read endpoint descriptor\n",
|
printf("%s: could not read endpoint descriptor\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN
|
if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN
|
||||||
@ -365,7 +365,7 @@ USB_ATTACH(uscanner)
|
|||||||
if (ed_bulkin == NULL || ed_bulkout == NULL) {
|
if (ed_bulkin == NULL || ed_bulkout == NULL) {
|
||||||
printf("%s: bulk-in and/or bulk-out endpoint not found\n",
|
printf("%s: bulk-in and/or bulk-out endpoint not found\n",
|
||||||
device_get_nameunit(sc->sc_dev));
|
device_get_nameunit(sc->sc_dev));
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->sc_bulkin = ed_bulkin->bEndpointAddress;
|
sc->sc_bulkin = ed_bulkin->bEndpointAddress;
|
||||||
@ -380,7 +380,7 @@ USB_ATTACH(uscanner)
|
|||||||
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
|
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
|
||||||
USBDEV(sc->sc_dev));
|
USBDEV(sc->sc_dev));
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -367,12 +367,12 @@ USB_ATTACH(uvisor)
|
|||||||
DPRINTF(("uvisor: in=0x%x out=0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no));
|
DPRINTF(("uvisor: in=0x%x out=0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no));
|
||||||
ucom_attach(&sc->sc_ucom);
|
ucom_attach(&sc->sc_ucom);
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
DPRINTF(("uvisor_attach: ATTACH ERROR\n"));
|
DPRINTF(("uvisor_attach: ATTACH ERROR\n"));
|
||||||
ucom->sc_dying = 1;
|
ucom->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -428,11 +428,11 @@ USB_ATTACH(uvscom)
|
|||||||
|
|
||||||
TASK_INIT(&sc->sc_task, 0, uvscom_notify, sc);
|
TASK_INIT(&sc->sc_task, 0, uvscom_notify, sc);
|
||||||
ucom_attach(&sc->sc_ucom);
|
ucom_attach(&sc->sc_ucom);
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
ucom->sc_dying = 1;
|
ucom->sc_dying = 1;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
USB_DETACH(uvscom)
|
USB_DETACH(uvscom)
|
||||||
|
@ -750,11 +750,11 @@ USB_ATTACH(ubt)
|
|||||||
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
|
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
|
||||||
USBDEV(sc->sc_dev));
|
USBDEV(sc->sc_dev));
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
bad:
|
bad:
|
||||||
ubt_detach(self);
|
ubt_detach(self);
|
||||||
|
|
||||||
USB_ATTACH_ERROR_RETURN;
|
return ENXIO;
|
||||||
} /* USB_ATTACH(ubt) */
|
} /* USB_ATTACH(ubt) */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -207,11 +207,10 @@ USB_ATTACH(ubtbcmfw)
|
|||||||
UID_ROOT, GID_OPERATOR, 0644,
|
UID_ROOT, GID_OPERATOR, 0644,
|
||||||
"%s.%d", USBDEVNAME(sc->sc_dev), UBTBCMFW_BULK_OUT);
|
"%s.%d", USBDEVNAME(sc->sc_dev), UBTBCMFW_BULK_OUT);
|
||||||
|
|
||||||
USB_ATTACH_SUCCESS_RETURN;
|
return 0;
|
||||||
bad:
|
bad:
|
||||||
ubtbcmfw_detach(self);
|
ubtbcmfw_detach(self);
|
||||||
|
return ENXIO;
|
||||||
USB_ATTACH_ERROR_RETURN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -556,4 +555,3 @@ ubtbcmfw_poll(struct cdev *dev, int events, usb_proc_ptr p)
|
|||||||
|
|
||||||
return (revents);
|
return (revents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user