WARNING: white space diff
This code reduces the number of trailing white space to be more in line w/ NetBSD. I don't regenerate usbdevs, saving that for when it really changes.
This commit is contained in:
parent
095a676739
commit
3180fe02ca
@ -250,7 +250,7 @@ ehci_pci_attach(device_t self)
|
||||
bsc = device_get_softc(nbus[0]);
|
||||
printf("ehci_pci_attach: companion %s\n",
|
||||
USBDEVNAME(bsc->bdev));
|
||||
sc->sc_comps[ncomp++] = bsc;
|
||||
sc->sc_comps[ncomp++] = bsc;
|
||||
if (ncomp >= EHCI_COMPANION_MAX)
|
||||
break;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@
|
||||
#include <sys/kernel.h>
|
||||
#endif
|
||||
#include <sys/malloc.h>
|
||||
|
||||
|
||||
#include <dev/usb/usb.h>
|
||||
#include <dev/usb/usbhid.h>
|
||||
|
||||
@ -189,7 +189,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
|
||||
printf("BAD LENGTH %d\n", bSize);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
switch (bType) {
|
||||
case 0: /* Main */
|
||||
switch (bTag) {
|
||||
@ -204,8 +204,8 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
|
||||
s->multi = 0;
|
||||
c->loc.count = 1;
|
||||
if (s->minset) {
|
||||
for (i = c->usage_minimum;
|
||||
i <= c->usage_maximum;
|
||||
for (i = c->usage_minimum;
|
||||
i <= c->usage_maximum;
|
||||
i++) {
|
||||
s->usages[s->nu] = i;
|
||||
if (s->nu < MAXUSAGE-1)
|
||||
@ -217,7 +217,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
|
||||
} else {
|
||||
*h = *c;
|
||||
h->next = 0;
|
||||
c->loc.pos +=
|
||||
c->loc.pos +=
|
||||
c->loc.size * c->loc.count;
|
||||
hid_clear_local(c);
|
||||
s->minset = 0;
|
||||
@ -307,9 +307,9 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
|
||||
case 2: /* Local */
|
||||
switch (bTag) {
|
||||
case 0:
|
||||
if (bSize == 1)
|
||||
if (bSize == 1)
|
||||
dval = c->_usage_page | (dval&0xff);
|
||||
else if (bSize == 2)
|
||||
else if (bSize == 2)
|
||||
dval = c->_usage_page | (dval&0xffff);
|
||||
c->usage = dval;
|
||||
if (s->nu < MAXUSAGE)
|
||||
@ -318,16 +318,16 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
|
||||
break;
|
||||
case 1:
|
||||
s->minset = 1;
|
||||
if (bSize == 1)
|
||||
if (bSize == 1)
|
||||
dval = c->_usage_page | (dval&0xff);
|
||||
else if (bSize == 2)
|
||||
else if (bSize == 2)
|
||||
dval = c->_usage_page | (dval&0xffff);
|
||||
c->usage_minimum = dval;
|
||||
break;
|
||||
case 2:
|
||||
if (bSize == 1)
|
||||
if (bSize == 1)
|
||||
dval = c->_usage_page | (dval&0xff);
|
||||
else if (bSize == 2)
|
||||
else if (bSize == 2)
|
||||
dval = c->_usage_page | (dval&0xffff);
|
||||
c->usage_maximum = dval;
|
||||
break;
|
||||
@ -421,7 +421,7 @@ hid_get_data(u_char *buf, struct hid_location *loc)
|
||||
return (0);
|
||||
|
||||
data = 0;
|
||||
s = hpos / 8;
|
||||
s = hpos / 8;
|
||||
for (i = hpos; i < hpos+hsize; i += 8)
|
||||
data |= buf[i / 8] << ((i / 8 - s) * 8);
|
||||
data >>= hpos % 8;
|
||||
@ -429,7 +429,7 @@ hid_get_data(u_char *buf, struct hid_location *loc)
|
||||
hsize = 32 - hsize;
|
||||
/* Sign extend */
|
||||
data = ((int32_t)data << hsize) >> hsize;
|
||||
DPRINTFN(10,("hid_get_data: loc %d/%d = %lu\n",
|
||||
DPRINTFN(10,("hid_get_data: loc %d/%d = %lu\n",
|
||||
loc->pos, loc->size, (long)data));
|
||||
return (data);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
enum hid_kind {
|
||||
enum hid_kind {
|
||||
hid_input, hid_output, hid_feature, hid_collection, hid_endcollection
|
||||
};
|
||||
|
||||
@ -84,8 +84,8 @@ struct hid_data *hid_start_parse(void *d, int len, int kindset);
|
||||
void hid_end_parse(struct hid_data *s);
|
||||
int hid_get_item(struct hid_data *s, struct hid_item *h);
|
||||
int hid_report_size(void *buf, int len, enum hid_kind k, u_int8_t *id);
|
||||
int hid_locate(void *desc, int size, u_int32_t usage,
|
||||
enum hid_kind kind, struct hid_location *loc,
|
||||
int hid_locate(void *desc, int size, u_int32_t usage,
|
||||
enum hid_kind kind, struct hid_location *loc,
|
||||
u_int32_t *flags);
|
||||
u_long hid_get_data(u_char *buf, struct hid_location *loc);
|
||||
int hid_is_collection(void *desc, int size, u_int32_t usage);
|
||||
|
@ -924,7 +924,7 @@ axe_init(void *xsc)
|
||||
/*
|
||||
* Cancel pending I/O and free all RX/TX buffers.
|
||||
*/
|
||||
|
||||
|
||||
axe_reset(sc);
|
||||
|
||||
#ifdef notdef
|
||||
|
@ -365,7 +365,7 @@ cue_setmulti(struct cue_softc *sc)
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
h = cue_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
sc->cue_mctab[h >> 3] |= 1 << (h & 0x7);
|
||||
sc->cue_mctab[h >> 3] |= 1 << (h & 0x7);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -374,7 +374,7 @@ cue_setmulti(struct cue_softc *sc)
|
||||
*/
|
||||
if (ifp->if_flags & IFF_BROADCAST) {
|
||||
h = cue_crc(ifp->if_broadcastaddr);
|
||||
sc->cue_mctab[h >> 3] |= 1 << (h & 0x7);
|
||||
sc->cue_mctab[h >> 3] |= 1 << (h & 0x7);
|
||||
}
|
||||
|
||||
cue_mem(sc, CUE_CMD_WRITESRAM, CUE_MCAST_TABLE_ADDR,
|
||||
|
@ -224,7 +224,7 @@ typedef struct {
|
||||
} ohci_itd_t;
|
||||
/* #define OHCI_ITD_SIZE 32 */
|
||||
#define OHCI_ITD_ALIGN 32
|
||||
|
||||
|
||||
|
||||
#define OHCI_CC_NO_ERROR 0
|
||||
#define OHCI_CC_CRC 1
|
||||
|
@ -340,7 +340,7 @@ ucomopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
&sc->sc_bulkin_pipe);
|
||||
if (err) {
|
||||
printf("%s: open bulk in error (addr %d): %s\n",
|
||||
USBDEVNAME(sc->sc_dev), sc->sc_bulkin_no,
|
||||
USBDEVNAME(sc->sc_dev), sc->sc_bulkin_no,
|
||||
usbd_errstr(err));
|
||||
error = EIO;
|
||||
goto fail_0;
|
||||
@ -722,7 +722,7 @@ ucom_dtr(struct ucom_softc *sc, int onoff)
|
||||
|
||||
if (sc->sc_callback->ucom_set == NULL)
|
||||
return;
|
||||
sc->sc_callback->ucom_set(sc->sc_parent, sc->sc_portno,
|
||||
sc->sc_callback->ucom_set(sc->sc_parent, sc->sc_portno,
|
||||
UCOM_SET_DTR, onoff);
|
||||
}
|
||||
|
||||
@ -733,7 +733,7 @@ ucom_rts(struct ucom_softc *sc, int onoff)
|
||||
|
||||
if (sc->sc_callback->ucom_set == NULL)
|
||||
return;
|
||||
sc->sc_callback->ucom_set(sc->sc_parent, sc->sc_portno,
|
||||
sc->sc_callback->ucom_set(sc->sc_parent, sc->sc_portno,
|
||||
UCOM_SET_RTS, onoff);
|
||||
}
|
||||
|
||||
@ -907,7 +907,7 @@ ucomstart(struct tty *tp)
|
||||
memcpy(sc->sc_obuf, data, cnt);
|
||||
|
||||
DPRINTF(("ucomstart: %d chars\n", cnt));
|
||||
usbd_setup_xfer(sc->sc_oxfer, sc->sc_bulkout_pipe,
|
||||
usbd_setup_xfer(sc->sc_oxfer, sc->sc_bulkout_pipe,
|
||||
(usbd_private_handle)sc, sc->sc_obuf, cnt,
|
||||
USBD_NO_COPY, USBD_NO_TIMEOUT, ucomwritecb);
|
||||
/* What can we do on error? */
|
||||
@ -1013,8 +1013,8 @@ ucomstartread(struct ucom_softc *sc)
|
||||
if (sc->sc_bulkin_pipe == NULL)
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
|
||||
usbd_setup_xfer(sc->sc_ixfer, sc->sc_bulkin_pipe,
|
||||
(usbd_private_handle)sc,
|
||||
usbd_setup_xfer(sc->sc_ixfer, sc->sc_bulkin_pipe,
|
||||
(usbd_private_handle)sc,
|
||||
sc->sc_ibuf, sc->sc_ibufsize,
|
||||
USBD_SHORT_XFER_OK | USBD_NO_COPY,
|
||||
USBD_NO_TIMEOUT, ucomreadcb);
|
||||
|
@ -64,9 +64,9 @@
|
||||
* It therefore doesn't make sense to use the interrupt pipe to signal
|
||||
* 'data ready' and then schedule a bulk transfer to fetch it. That would
|
||||
* incur a 2ms delay at least, without reducing bandwidth requirements.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -116,7 +116,7 @@ SYSCTL_INT(_hw_usb_udbp, OID_AUTO, debug, CTLFLAG_RW,
|
||||
#define DPRINTFN(n,x)
|
||||
#endif
|
||||
|
||||
#define MS_TO_TICKS(ms) ((ms) * hz / 1000)
|
||||
#define MS_TO_TICKS(ms) ((ms) * hz / 1000)
|
||||
|
||||
#define UDBP_TIMEOUT 2000 /* timeout on outbound transfers, in msecs */
|
||||
#define UDBP_BUFFERSIZE 2048 /* maximum number of bytes in one transfer */
|
||||
@ -243,11 +243,11 @@ USB_MATCH(udbp)
|
||||
(uaa->product == USB_PRODUCT_PROLIFIC_PL2301 ||
|
||||
uaa->product == USB_PRODUCT_PROLIFIC_PL2302)))
|
||||
return(UMATCH_VENDOR_PRODUCT);
|
||||
|
||||
|
||||
if ((uaa->vendor == USB_VENDOR_ANCHOR &&
|
||||
uaa->product == USB_PRODUCT_ANCHOR_EZLINK))
|
||||
return(UMATCH_VENDOR_PRODUCT);
|
||||
|
||||
|
||||
return (UMATCH_NONE);
|
||||
}
|
||||
|
||||
@ -354,7 +354,7 @@ USB_ATTACH(udbp)
|
||||
}
|
||||
|
||||
if (!ngudbp_done_init){
|
||||
ngudbp_done_init=1;
|
||||
ngudbp_done_init=1;
|
||||
if (ng_newtype(&ng_udbp_typestruct)) {
|
||||
printf("ngudbp install failed\n");
|
||||
goto bad;
|
||||
@ -505,7 +505,7 @@ udbp_in_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
|
||||
} else {
|
||||
|
||||
len = xfer->actlen;
|
||||
|
||||
|
||||
s = splimp(); /* block network stuff too */
|
||||
if (sc->hook) {
|
||||
/* get packet from device and send on */
|
||||
@ -513,7 +513,7 @@ udbp_in_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
|
||||
NG_SEND_DATA_ONLY(err, sc->hook, m);
|
||||
}
|
||||
splx(s);
|
||||
|
||||
|
||||
}
|
||||
/* schedule the next in transfer */
|
||||
udbp_setup_in_transfer(sc);
|
||||
@ -678,7 +678,7 @@ ng_udbp_rcvmsg(node_p node, item_p item, hook_p lasthook)
|
||||
NGI_GET_MSG(item, msg);
|
||||
/* Deal with message according to cookie and command */
|
||||
switch (msg->header.typecookie) {
|
||||
case NGM_UDBP_COOKIE:
|
||||
case NGM_UDBP_COOKIE:
|
||||
switch (msg->header.cmd) {
|
||||
case NGM_UDBP_GET_STATUS:
|
||||
{
|
||||
@ -733,7 +733,7 @@ ng_udbp_rcvdata(hook_p hook, item_p item)
|
||||
NGI_GET_M(item, m);
|
||||
NGI_GET_META(item, meta);
|
||||
NG_FREE_ITEM(item);
|
||||
/*
|
||||
/*
|
||||
* Now queue the data for when it can be sent
|
||||
*/
|
||||
if (meta && meta->priority > 0) {
|
||||
@ -778,9 +778,9 @@ ng_udbp_rmnode(node_p node)
|
||||
int err;
|
||||
|
||||
if (sc->flags & DISCONNECTED) {
|
||||
/*
|
||||
/*
|
||||
* WE are really going away.. hardware must have gone.
|
||||
* Assume that the hardware drive part will clear up the
|
||||
* Assume that the hardware drive part will clear up the
|
||||
* sc, in fact it may already have done so..
|
||||
* In which case we may have just segfaulted..XXX
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 1996-2000 Whistle Communications, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Subject to the following obligations and disclaimer of warranty, use and
|
||||
* redistribution of this software, in source or object code forms, with or
|
||||
* without modifications are expressly permitted by Whistle Communications;
|
||||
@ -12,7 +12,7 @@
|
||||
* Communications, Inc. trademarks, including the mark "WHISTLE
|
||||
* COMMUNICATIONS" on advertising, endorsements, or otherwise except as
|
||||
* such appears in the above copyright notice or in the software.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
|
||||
* TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
|
||||
* REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
|
||||
|
@ -90,9 +90,9 @@ d_ioctl_t ufmioctl;
|
||||
#define UFM_CDEV_MAJOR MAJOR_AUTO
|
||||
|
||||
Static struct cdevsw ufm_cdevsw = {
|
||||
.d_open = ufmopen,
|
||||
.d_close = ufmclose,
|
||||
.d_ioctl = ufmioctl,
|
||||
.d_open = ufmopen,
|
||||
.d_close = ufmclose,
|
||||
.d_ioctl = ufmioctl,
|
||||
.d_name = "ufm",
|
||||
.d_maj = UFM_CDEV_MAJOR,
|
||||
#if (__FreeBSD_version < 500014)
|
||||
@ -157,7 +157,7 @@ USB_ATTACH(ufm)
|
||||
usbd_status r;
|
||||
char * ermsg = "<none>";
|
||||
|
||||
DPRINTFN(10,("ufm_attach: sc=%p\n", sc));
|
||||
DPRINTFN(10,("ufm_attach: sc=%p\n", sc));
|
||||
usbd_devinfo(uaa->device, 0, devinfo);
|
||||
USB_ATTACH_SETUP;
|
||||
printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
|
||||
@ -178,12 +178,12 @@ USB_ATTACH(ufm)
|
||||
r = usbd_interface_count(udev, &niface);
|
||||
if (r) {
|
||||
ermsg = "iface";
|
||||
goto nobulk;
|
||||
goto nobulk;
|
||||
}
|
||||
r = usbd_device2interface_handle(udev, 0, &iface);
|
||||
if (r) {
|
||||
ermsg = "iface";
|
||||
goto nobulk;
|
||||
goto nobulk;
|
||||
}
|
||||
sc->sc_iface = iface;
|
||||
#endif
|
||||
@ -191,7 +191,7 @@ USB_ATTACH(ufm)
|
||||
sc->sc_refcnt = 0;
|
||||
|
||||
r = usbd_endpoint_count(iface, &epcount);
|
||||
if (r != USBD_NORMAL_COMPLETION) {
|
||||
if (r != USBD_NORMAL_COMPLETION) {
|
||||
ermsg = "endpoints";
|
||||
goto nobulk;
|
||||
}
|
||||
@ -231,7 +231,7 @@ ufmopen(dev_t dev, int flag, int mode, usb_proc_ptr td)
|
||||
int unit = UFMUNIT(dev);
|
||||
USB_GET_SC_OPEN(ufm, unit, sc);
|
||||
|
||||
DPRINTFN(5, ("ufmopen: flag=%d, mode=%d, unit=%d\n",
|
||||
DPRINTFN(5, ("ufmopen: flag=%d, mode=%d, unit=%d\n",
|
||||
flag, mode, unit));
|
||||
|
||||
if (sc->sc_opened)
|
||||
@ -255,7 +255,7 @@ ufmclose(dev_t dev, int flag, int mode, usb_proc_ptr td)
|
||||
DPRINTFN(5, ("ufmclose: flag=%d, mode=%d, unit=%d\n", flag, mode, unit));
|
||||
sc->sc_opened = 0;
|
||||
sc->sc_refcnt = 0;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -293,7 +293,7 @@ ufm_set_freq(struct ufm_softc *sc, caddr_t addr)
|
||||
* that the radio wants. This frequency is 10.7MHz above
|
||||
* the actual frequency. We then need to convert to
|
||||
* units of 12.5kHz. We add one to the IFM to make rounding
|
||||
* easier.
|
||||
* easier.
|
||||
*/
|
||||
sc->sc_freq = freq;
|
||||
freq = (freq + 10700001) / 12500;
|
||||
@ -302,7 +302,7 @@ ufm_set_freq(struct ufm_softc *sc, caddr_t addr)
|
||||
freq, 1, &ret) != 0)
|
||||
return (EIO);
|
||||
/* Not sure what this does */
|
||||
if (ufm_do_req(sc, UT_READ_VENDOR_DEVICE, FM_CMD0, 0x96, 0xb7, 1,
|
||||
if (ufm_do_req(sc, UT_READ_VENDOR_DEVICE, FM_CMD0, 0x96, 0xb7, 1,
|
||||
&ret) != 0)
|
||||
return (EIO);
|
||||
return (0);
|
||||
@ -320,8 +320,8 @@ static int
|
||||
ufm_start(struct ufm_softc *sc, caddr_t addr)
|
||||
{
|
||||
u_int8_t ret;
|
||||
|
||||
if (ufm_do_req(sc, UT_READ_VENDOR_DEVICE, FM_CMD0, 0x00, 0xc7,
|
||||
|
||||
if (ufm_do_req(sc, UT_READ_VENDOR_DEVICE, FM_CMD0, 0x00, 0xc7,
|
||||
1, &ret))
|
||||
return (EIO);
|
||||
if (ufm_do_req(sc, UT_READ_VENDOR_DEVICE, FM_CMD2, 0x01, 0x00,
|
||||
@ -336,7 +336,7 @@ static int
|
||||
ufm_stop(struct ufm_softc *sc, caddr_t addr)
|
||||
{
|
||||
u_int8_t ret;
|
||||
|
||||
|
||||
if (ufm_do_req(sc, UT_READ_VENDOR_DEVICE, FM_CMD0, 0x16, 0x1C,
|
||||
1, &ret))
|
||||
return (EIO);
|
||||
@ -350,7 +350,7 @@ static int
|
||||
ufm_get_stat(struct ufm_softc *sc, caddr_t addr)
|
||||
{
|
||||
u_int8_t ret;
|
||||
|
||||
|
||||
/*
|
||||
* Note, there's a 240ms settle time before the status
|
||||
* will be valid, so tsleep that amount. hz/4 is a good
|
||||
@ -363,7 +363,7 @@ ufm_get_stat(struct ufm_softc *sc, caddr_t addr)
|
||||
1, &ret))
|
||||
return (EIO);
|
||||
*(int *)addr = ret;
|
||||
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -465,7 +465,7 @@ USB_DETACH(ufm)
|
||||
#if defined(__FreeBSD__)
|
||||
Static int
|
||||
ufm_detach(device_t self)
|
||||
{
|
||||
{
|
||||
DPRINTF(("%s: disconnected\n", USBDEVNAME(self)));
|
||||
return 0;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debug, CTLFLAG_RW,
|
||||
|
||||
struct uftdi_softc {
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
|
||||
usbd_interface_handle sc_iface; /* interface */
|
||||
|
||||
enum uftdi_type sc_type;
|
||||
@ -210,9 +210,9 @@ USB_ATTACH(uftdi)
|
||||
default: /* Can't happen */
|
||||
goto bad;
|
||||
}
|
||||
|
||||
|
||||
ucom->sc_bulkin_no = ucom->sc_bulkout_no = -1;
|
||||
|
||||
|
||||
for (i = 0; i < id->bNumEndpoints; i++) {
|
||||
int addr, dir, attr;
|
||||
ed = usbd_interface2endpoint_descriptor(iface, i);
|
||||
@ -221,7 +221,7 @@ USB_ATTACH(uftdi)
|
||||
": %s\n", devname, usbd_errstr(err));
|
||||
goto bad;
|
||||
}
|
||||
|
||||
|
||||
addr = ed->bEndpointAddress;
|
||||
dir = UE_GET_DIR(ed->bEndpointAddress);
|
||||
attr = ed->bmAttributes & UE_XFERTYPE;
|
||||
@ -262,7 +262,7 @@ USB_ATTACH(uftdi)
|
||||
DPRINTF(("uftdi: in=0x%x out=0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no));
|
||||
ucom_attach(&sc->sc_ucom);
|
||||
free(devinfo, M_USBDEV);
|
||||
|
||||
|
||||
USB_ATTACH_SUCCESS_RETURN;
|
||||
|
||||
bad:
|
||||
@ -297,7 +297,7 @@ uftdi_activate(device_ptr_t self, enum devact act)
|
||||
USB_DETACH(uftdi)
|
||||
{
|
||||
USB_DETACH_START(uftdi, sc);
|
||||
|
||||
|
||||
int rv = 0;
|
||||
|
||||
DPRINTF(("uftdi_detach: sc=%p\n", sc));
|
||||
|
@ -152,13 +152,13 @@ Static struct cdevsw ugen_cdevsw = {
|
||||
};
|
||||
#endif
|
||||
|
||||
Static void ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr,
|
||||
Static void ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr,
|
||||
usbd_status status);
|
||||
Static void ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr,
|
||||
usbd_status status);
|
||||
Static int ugen_do_read(struct ugen_softc *, int, struct uio *, int);
|
||||
Static int ugen_do_write(struct ugen_softc *, int, struct uio *, int);
|
||||
Static int ugen_do_ioctl(struct ugen_softc *, int, u_long,
|
||||
Static int ugen_do_ioctl(struct ugen_softc *, int, u_long,
|
||||
caddr_t, int, usb_proc_ptr);
|
||||
#if defined(__FreeBSD__)
|
||||
Static void ugen_make_devnodes(struct ugen_softc *sc);
|
||||
@ -197,7 +197,7 @@ USB_ATTACH(ugen)
|
||||
char devinfo[1024];
|
||||
usbd_status err;
|
||||
int conf;
|
||||
|
||||
|
||||
usbd_devinfo(uaa->device, 0, devinfo);
|
||||
USB_ATTACH_SETUP;
|
||||
printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
|
||||
@ -209,7 +209,7 @@ USB_ATTACH(ugen)
|
||||
/* First set configuration index 0, the default one for ugen. */
|
||||
err = usbd_set_config_index(udev, 0, 0);
|
||||
if (err) {
|
||||
printf("%s: setting configuration index 0 failed\n",
|
||||
printf("%s: setting configuration index 0 failed\n",
|
||||
USBDEVNAME(sc->sc_dev));
|
||||
sc->sc_dying = 1;
|
||||
USB_ATTACH_ERROR_RETURN;
|
||||
@ -219,7 +219,7 @@ USB_ATTACH(ugen)
|
||||
/* Set up all the local state for this configuration. */
|
||||
err = ugen_set_config(sc, conf);
|
||||
if (err) {
|
||||
printf("%s: setting configuration %d failed\n",
|
||||
printf("%s: setting configuration %d failed\n",
|
||||
USBDEVNAME(sc->sc_dev), conf);
|
||||
sc->sc_dying = 1;
|
||||
USB_ATTACH_ERROR_RETURN;
|
||||
@ -346,7 +346,7 @@ ugen_set_config(struct ugen_softc *sc, int configno)
|
||||
dir = UE_GET_DIR(endpt) == UE_DIR_IN ? IN : OUT;
|
||||
sce = &sc->sc_endpoints[UE_GET_ADDR(endpt)][dir];
|
||||
DPRINTFN(1,("ugen_set_config: endptno %d, endpt=0x%02x"
|
||||
"(%d,%d), sce=%p\n",
|
||||
"(%d,%d), sce=%p\n",
|
||||
endptno, endpt, UE_GET_ADDR(endpt),
|
||||
UE_GET_DIR(endpt), sce));
|
||||
sce->sc = sc;
|
||||
@ -378,7 +378,7 @@ ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
|
||||
USB_GET_SC_OPEN(ugen, unit, sc);
|
||||
|
||||
DPRINTFN(5, ("ugenopen: flag=%d, mode=%d, unit=%d endpt=%d\n",
|
||||
DPRINTFN(5, ("ugenopen: flag=%d, mode=%d, unit=%d endpt=%d\n",
|
||||
flag, mode, unit, endpt));
|
||||
|
||||
if (sc == NULL || sc->sc_dying)
|
||||
@ -409,13 +409,13 @@ ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
sce = &sc->sc_endpoints[endpt][dir];
|
||||
sce->state = 0;
|
||||
sce->timeout = USBD_NO_TIMEOUT;
|
||||
DPRINTFN(5, ("ugenopen: sc=%p, endpt=%d, dir=%d, sce=%p\n",
|
||||
DPRINTFN(5, ("ugenopen: sc=%p, endpt=%d, dir=%d, sce=%p\n",
|
||||
sc, endpt, dir, sce));
|
||||
edesc = sce->edesc;
|
||||
switch (edesc->bmAttributes & UE_XFERTYPE) {
|
||||
case UE_INTERRUPT:
|
||||
if (dir == OUT) {
|
||||
err = usbd_open_pipe(sce->iface,
|
||||
err = usbd_open_pipe(sce->iface,
|
||||
edesc->bEndpointAddress, 0, &sce->pipeh);
|
||||
if (err)
|
||||
return (EIO);
|
||||
@ -425,13 +425,13 @@ ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
if (isize == 0) /* shouldn't happen */
|
||||
return (EINVAL);
|
||||
sce->ibuf = malloc(isize, M_USBDEV, M_WAITOK);
|
||||
DPRINTFN(5, ("ugenopen: intr endpt=%d,isize=%d\n",
|
||||
DPRINTFN(5, ("ugenopen: intr endpt=%d,isize=%d\n",
|
||||
endpt, isize));
|
||||
if (clalloc(&sce->q, UGEN_IBSIZE, 0) == -1)
|
||||
return (ENOMEM);
|
||||
err = usbd_open_pipe_intr(sce->iface,
|
||||
edesc->bEndpointAddress,
|
||||
USBD_SHORT_XFER_OK, &sce->pipeh, sce,
|
||||
err = usbd_open_pipe_intr(sce->iface,
|
||||
edesc->bEndpointAddress,
|
||||
USBD_SHORT_XFER_OK, &sce->pipeh, sce,
|
||||
sce->ibuf, isize, ugenintr,
|
||||
USBD_DEFAULT_INTERVAL);
|
||||
if (err) {
|
||||
@ -442,7 +442,7 @@ ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
DPRINTFN(5, ("ugenopen: interrupt open done\n"));
|
||||
break;
|
||||
case UE_BULK:
|
||||
err = usbd_open_pipe(sce->iface,
|
||||
err = usbd_open_pipe(sce->iface,
|
||||
edesc->bEndpointAddress, 0, &sce->pipeh);
|
||||
if (err)
|
||||
return (EIO);
|
||||
@ -457,7 +457,7 @@ ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
M_USBDEV, M_WAITOK);
|
||||
sce->cur = sce->fill = sce->ibuf;
|
||||
sce->limit = sce->ibuf + isize * UGEN_NISOFRAMES;
|
||||
DPRINTFN(5, ("ugenopen: isoc endpt=%d, isize=%d\n",
|
||||
DPRINTFN(5, ("ugenopen: isoc endpt=%d, isize=%d\n",
|
||||
endpt, isize));
|
||||
err = usbd_open_pipe(sce->iface,
|
||||
edesc->bEndpointAddress, 0, &sce->pipeh);
|
||||
@ -535,7 +535,7 @@ ugenclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
sce = &sc->sc_endpoints[endpt][dir];
|
||||
if (sce == NULL || sce->pipeh == NULL)
|
||||
continue;
|
||||
DPRINTFN(5, ("ugenclose: endpt=%d dir=%d sce=%p\n",
|
||||
DPRINTFN(5, ("ugenclose: endpt=%d dir=%d sce=%p\n",
|
||||
endpt, dir, sce));
|
||||
|
||||
usbd_abort_pipe(sce->pipeh);
|
||||
@ -644,8 +644,8 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
|
||||
tn = n;
|
||||
err = usbd_bulk_transfer(
|
||||
xfer, sce->pipeh,
|
||||
sce->state & UGEN_SHORT_OK ?
|
||||
USBD_SHORT_XFER_OK : 0,
|
||||
sce->state & UGEN_SHORT_OK ?
|
||||
USBD_SHORT_XFER_OK : 0,
|
||||
sce->timeout, buf, &tn, "ugenrb");
|
||||
if (err) {
|
||||
if (err == USBD_INTERRUPTED)
|
||||
@ -701,7 +701,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
|
||||
splx(s);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
default:
|
||||
return (ENXIO);
|
||||
}
|
||||
@ -764,7 +764,7 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
|
||||
if (error)
|
||||
break;
|
||||
DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n));
|
||||
err = usbd_bulk_transfer(xfer, sce->pipeh, 0,
|
||||
err = usbd_bulk_transfer(xfer, sce->pipeh, 0,
|
||||
sce->timeout, buf, &n,"ugenwb");
|
||||
if (err) {
|
||||
if (err == USBD_INTERRUPTED)
|
||||
@ -788,7 +788,7 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
|
||||
if (error)
|
||||
break;
|
||||
DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n));
|
||||
err = usbd_intr_transfer(xfer, sce->pipeh, 0,
|
||||
err = usbd_intr_transfer(xfer, sce->pipeh, 0,
|
||||
sce->timeout, buf, &n,"ugenwi");
|
||||
if (err) {
|
||||
if (err == USBD_INTERRUPTED)
|
||||
@ -925,13 +925,13 @@ ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
|
||||
usbd_get_xfer_status(xfer, NULL, NULL, &count, NULL);
|
||||
ibuf = sce->ibuf;
|
||||
|
||||
DPRINTFN(5, ("ugenintr: xfer=%p status=%d count=%d\n",
|
||||
DPRINTFN(5, ("ugenintr: xfer=%p status=%d count=%d\n",
|
||||
xfer, status, count));
|
||||
DPRINTFN(5, (" data = %02x %02x %02x\n",
|
||||
ibuf[0], ibuf[1], ibuf[2]));
|
||||
|
||||
(void)b_to_q(ibuf, count, &sce->q);
|
||||
|
||||
|
||||
if (sce->state & UGEN_ASLP) {
|
||||
sce->state &= ~UGEN_ASLP;
|
||||
DPRINTFN(5, ("ugen_intr: waking %p\n", sce));
|
||||
@ -941,7 +941,7 @@ ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
|
||||
}
|
||||
|
||||
Static void
|
||||
ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr,
|
||||
ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr,
|
||||
usbd_status status)
|
||||
{
|
||||
struct isoreq *req = addr;
|
||||
@ -1017,7 +1017,7 @@ ugen_set_interface(struct ugen_softc *sc, int ifaceidx, int altno)
|
||||
return (err);
|
||||
if (ifaceidx < 0 || ifaceidx >= niface)
|
||||
return (USBD_INVAL);
|
||||
|
||||
|
||||
err = usbd_device2interface_handle(sc->sc_udev, ifaceidx, &iface);
|
||||
if (err)
|
||||
return (err);
|
||||
@ -1196,7 +1196,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
|
||||
break;
|
||||
case USB_GET_ALTINTERFACE:
|
||||
ai = (struct usb_alt_interface *)addr;
|
||||
err = usbd_device2interface_handle(sc->sc_udev,
|
||||
err = usbd_device2interface_handle(sc->sc_udev,
|
||||
ai->uai_interface_index, &iface);
|
||||
if (err)
|
||||
return (EINVAL);
|
||||
@ -1209,7 +1209,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
|
||||
if (!(flag & FWRITE))
|
||||
return (EPERM);
|
||||
ai = (struct usb_alt_interface *)addr;
|
||||
err = usbd_device2interface_handle(sc->sc_udev,
|
||||
err = usbd_device2interface_handle(sc->sc_udev,
|
||||
ai->uai_interface_index, &iface);
|
||||
if (err)
|
||||
return (EINVAL);
|
||||
@ -1270,7 +1270,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
|
||||
alt = ugen_get_alt_index(sc, ed->ued_interface_index);
|
||||
else
|
||||
alt = ed->ued_alt_index;
|
||||
edesc = usbd_find_edesc(cdesc, ed->ued_interface_index,
|
||||
edesc = usbd_find_edesc(cdesc, ed->ued_interface_index,
|
||||
alt, ed->ued_endpoint_index);
|
||||
if (edesc == NULL) {
|
||||
free(cdesc, M_TEMP);
|
||||
@ -1305,7 +1305,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
|
||||
}
|
||||
case USB_GET_STRING_DESC:
|
||||
si = (struct usb_string_desc *)addr;
|
||||
err = usbd_get_string_desc(sc->sc_udev, si->usd_string_index,
|
||||
err = usbd_get_string_desc(sc->sc_udev, si->usd_string_index,
|
||||
si->usd_language_id, &si->usd_desc);
|
||||
if (err)
|
||||
return (EINVAL);
|
||||
@ -1342,7 +1342,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
|
||||
uio.uio_offset = 0;
|
||||
uio.uio_segflg = UIO_USERSPACE;
|
||||
uio.uio_rw =
|
||||
ur->ucr_request.bmRequestType & UT_READ ?
|
||||
ur->ucr_request.bmRequestType & UT_READ ?
|
||||
UIO_READ : UIO_WRITE;
|
||||
uio.uio_procp = p;
|
||||
ptr = malloc(len, M_TEMP, M_WAITOK);
|
||||
@ -1353,7 +1353,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
|
||||
}
|
||||
}
|
||||
sce = &sc->sc_endpoints[endpt][IN];
|
||||
err = usbd_do_request_flags(sc->sc_udev, &ur->ucr_request,
|
||||
err = usbd_do_request_flags(sc->sc_udev, &ur->ucr_request,
|
||||
ptr, ur->ucr_flags, &ur->ucr_actlen, sce->timeout);
|
||||
if (err) {
|
||||
error = EIO;
|
||||
@ -1443,12 +1443,12 @@ ugenpoll(dev_t dev, int events, usb_proc_ptr p)
|
||||
}
|
||||
break;
|
||||
case UE_BULK:
|
||||
/*
|
||||
/*
|
||||
* We have no easy way of determining if a read will
|
||||
* yield any data or a write will happen.
|
||||
* Pretend they will.
|
||||
*/
|
||||
revents |= events &
|
||||
revents |= events &
|
||||
(POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM);
|
||||
break;
|
||||
default:
|
||||
|
@ -1923,7 +1923,7 @@ uhci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
|
||||
std->td.td_status &= htole32(~(UHCI_TD_ACTIVE | UHCI_TD_IOC));
|
||||
splx(s);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Step 2: Wait until we know hardware has finished any possible
|
||||
* use of the xfer. Also make sure the soft interrupt routine
|
||||
* has run.
|
||||
@ -1934,12 +1934,12 @@ uhci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
|
||||
sc->sc_softwake = 1;
|
||||
#endif /* USB_USE_SOFTINTR */
|
||||
usb_schedsoftintr(&sc->sc_bus);
|
||||
#ifdef USB_USE_SOFTINTR
|
||||
#ifdef USB_USE_SOFTINTR
|
||||
DPRINTFN(1,("uhci_abort_xfer: tsleep\n"));
|
||||
tsleep(&sc->sc_softwake, PZERO, "uhciab", 0);
|
||||
#endif /* USB_USE_SOFTINTR */
|
||||
splx(s);
|
||||
|
||||
|
||||
/*
|
||||
* Step 3: Execute callback.
|
||||
*/
|
||||
@ -3372,7 +3372,7 @@ uhci_root_intr_transfer(usbd_xfer_handle xfer)
|
||||
if (err)
|
||||
return (err);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Pipe isn't running (otherwise err would be USBD_INPROG),
|
||||
* so start it first.
|
||||
*/
|
||||
|
@ -85,7 +85,6 @@
|
||||
|
||||
#define UHCI_FRNUM 0x06
|
||||
#define UHCI_FRNUM_MASK 0x03ff
|
||||
|
||||
|
||||
#define UHCI_FLBASEADDR 0x08
|
||||
|
||||
@ -122,7 +121,7 @@ typedef u_int32_t uhci_physaddr_t;
|
||||
#define UHCI_PTR_QH 0x00000002
|
||||
#define UHCI_PTR_VF 0x00000004
|
||||
|
||||
/*
|
||||
/*
|
||||
* Wait this long after a QH has been removed. This gives that HC a
|
||||
* chance to stop looking at it before it's recycled.
|
||||
*/
|
||||
|
@ -41,8 +41,8 @@
|
||||
/*
|
||||
* To avoid having 1024 TDs for each isochronous transfer we introduce
|
||||
* a virtual frame list. Every UHCI_VFRAMELIST_COUNT entries in the real
|
||||
* frame list points to a non-active TD. These, in turn, form the
|
||||
* starts of the virtual frame list. This also has the advantage that it
|
||||
* frame list points to a non-active TD. These, in turn, form the
|
||||
* starts of the virtual frame list. This also has the advantage that it
|
||||
* simplifies linking in/out of TDs/QHs in the schedule.
|
||||
* Furthermore, initially each of the inactive TDs point to an inactive
|
||||
* QH that forms the start of the interrupt traffic for that slot.
|
||||
@ -97,7 +97,7 @@ struct uhci_soft_td {
|
||||
uhci_soft_td_qh_t link; /* soft version of the td_link field */
|
||||
uhci_physaddr_t physaddr; /* TD's physical address. */
|
||||
};
|
||||
/*
|
||||
/*
|
||||
* Make the size such that it is a multiple of UHCI_TD_ALIGN. This way
|
||||
* we can pack a number of soft TD together and have the real TD well
|
||||
* aligned.
|
||||
|
@ -177,7 +177,7 @@ USB_MATCH(uhid)
|
||||
{
|
||||
USB_MATCH_START(uhid, uaa);
|
||||
usb_interface_descriptor_t *id;
|
||||
|
||||
|
||||
if (uaa->iface == NULL)
|
||||
return (UMATCH_NONE);
|
||||
id = usbd_get_interface_descriptor(uaa->iface);
|
||||
@ -198,7 +198,7 @@ USB_ATTACH(uhid)
|
||||
void *desc;
|
||||
usbd_status err;
|
||||
char devinfo[1024];
|
||||
|
||||
|
||||
sc->sc_udev = uaa->device;
|
||||
sc->sc_iface = iface;
|
||||
id = usbd_get_interface_descriptor(iface);
|
||||
@ -218,7 +218,7 @@ USB_ATTACH(uhid)
|
||||
DPRINTFN(10,("uhid_attach: bLength=%d bDescriptorType=%d "
|
||||
"bEndpointAddress=%d-%s bmAttributes=%d wMaxPacketSize=%d"
|
||||
" bInterval=%d\n",
|
||||
ed->bLength, ed->bDescriptorType,
|
||||
ed->bLength, ed->bDescriptorType,
|
||||
ed->bEndpointAddress & UE_ADDR,
|
||||
UE_GET_DIR(ed->bEndpointAddress)==UE_DIR_IN? "in" : "out",
|
||||
ed->bmAttributes & UE_XFERTYPE,
|
||||
@ -255,7 +255,7 @@ USB_ATTACH(uhid)
|
||||
sc->sc_dying = 1;
|
||||
USB_ATTACH_ERROR_RETURN;
|
||||
}
|
||||
|
||||
|
||||
(void)usbd_set_idle(iface, 0, 0);
|
||||
|
||||
sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid);
|
||||
@ -355,7 +355,7 @@ uhid_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
|
||||
#ifdef USB_DEBUG
|
||||
if (uhiddebug > 5) {
|
||||
u_int32_t cc, i;
|
||||
|
||||
|
||||
usbd_get_xfer_status(xfer, NULL, NULL, &cc, NULL);
|
||||
DPRINTF(("uhid_intr: status=%d cc=%d\n", status, cc));
|
||||
DPRINTF(("uhid_intr: data ="));
|
||||
@ -376,7 +376,7 @@ uhid_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
|
||||
}
|
||||
|
||||
(void) b_to_q(sc->sc_ibuf, sc->sc_isize, &sc->sc_q);
|
||||
|
||||
|
||||
if (sc->sc_state & UHID_ASLP) {
|
||||
sc->sc_state &= ~UHID_ASLP;
|
||||
DPRINTFN(5, ("uhid_intr: waking %p\n", &sc->sc_q));
|
||||
@ -417,8 +417,8 @@ uhidopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
sc->sc_obuf = malloc(sc->sc_osize, M_USBDEV, M_WAITOK);
|
||||
|
||||
/* Set up interrupt pipe. */
|
||||
err = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
|
||||
USBD_SHORT_XFER_OK, &sc->sc_intrpipe, sc, sc->sc_ibuf,
|
||||
err = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
|
||||
USBD_SHORT_XFER_OK, &sc->sc_intrpipe, sc, sc->sc_ibuf,
|
||||
sc->sc_isize, uhid_intr, USBD_DEFAULT_INTERVAL);
|
||||
if (err) {
|
||||
DPRINTF(("uhidopen: usbd_open_pipe_intr failed, "
|
||||
@ -478,7 +478,7 @@ uhid_do_read(struct uhid_softc *sc, struct uio *uio, int flag)
|
||||
DPRINTFN(1, ("uhidread\n"));
|
||||
if (sc->sc_state & UHID_IMMED) {
|
||||
DPRINTFN(1, ("uhidread immed\n"));
|
||||
|
||||
|
||||
err = usbd_get_report(sc->sc_iface, UHID_INPUT_REPORT,
|
||||
sc->sc_iid, buffer, sc->sc_isize);
|
||||
if (err)
|
||||
@ -551,7 +551,7 @@ uhid_do_write(struct uhid_softc *sc, struct uio *uio, int flag)
|
||||
usbd_status err;
|
||||
|
||||
DPRINTFN(1, ("uhidwrite\n"));
|
||||
|
||||
|
||||
if (sc->sc_dying)
|
||||
return (EIO);
|
||||
|
||||
|
@ -94,7 +94,7 @@ Static bus_child_detached_t uhub_child_detached;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* We need two attachment points:
|
||||
* hub to usb and hub to hub
|
||||
* Every other driver only connects to hubs
|
||||
@ -116,7 +116,7 @@ USB_DECLARE_DRIVER_INIT(uhub,
|
||||
DEVMETHOD(device_resume, bus_generic_resume),
|
||||
DEVMETHOD(device_shutdown, bus_generic_shutdown)
|
||||
);
|
||||
|
||||
|
||||
/* Create the driver instance for the hub connected to usb case. */
|
||||
devclass_t uhubroot_devclass;
|
||||
|
||||
@ -142,9 +142,9 @@ USB_MATCH(uhub)
|
||||
{
|
||||
USB_MATCH_START(uhub, uaa);
|
||||
usb_device_descriptor_t *dd = usbd_get_device_descriptor(uaa->device);
|
||||
|
||||
|
||||
DPRINTFN(5,("uhub_match, dd=%p\n", dd));
|
||||
/*
|
||||
/*
|
||||
* The subclass for hubs seems to be 0 for some and 1 for others,
|
||||
* so we just ignore the subclass.
|
||||
*/
|
||||
@ -165,7 +165,7 @@ USB_ATTACH(uhub)
|
||||
int p, port, nports, nremov, pwrdly;
|
||||
usbd_interface_handle iface;
|
||||
usb_endpoint_descriptor_t *ed;
|
||||
|
||||
|
||||
devinfo = malloc(1024, M_TEMP, M_NOWAIT);
|
||||
if (devinfo == NULL) {
|
||||
USB_ATTACH_ERROR_RETURN;
|
||||
@ -228,11 +228,11 @@ USB_ATTACH(uhub)
|
||||
dev->hub->hubsoftc = sc;
|
||||
hub->explore = uhub_explore;
|
||||
hub->hubdesc = hubdesc;
|
||||
|
||||
|
||||
DPRINTFN(1,("usbhub_init_hub: selfpowered=%d, parent=%p, "
|
||||
"parent->selfpowered=%d\n",
|
||||
dev->self_powered, dev->powersrc->parent,
|
||||
dev->powersrc->parent ?
|
||||
dev->powersrc->parent ?
|
||||
dev->powersrc->parent->self_powered : 0));
|
||||
|
||||
if (!dev->self_powered && dev->powersrc->parent != NULL &&
|
||||
@ -259,10 +259,10 @@ USB_ATTACH(uhub)
|
||||
}
|
||||
|
||||
err = usbd_open_pipe_intr(iface, ed->bEndpointAddress,
|
||||
USBD_SHORT_XFER_OK, &sc->sc_ipipe, sc, sc->sc_status,
|
||||
USBD_SHORT_XFER_OK, &sc->sc_ipipe, sc, sc->sc_status,
|
||||
sizeof(sc->sc_status), uhub_intr, UHUB_INTR_INTERVAL);
|
||||
if (err) {
|
||||
printf("%s: cannot open interrupt pipe\n",
|
||||
printf("%s: cannot open interrupt pipe\n",
|
||||
USBDEVNAME(sc->sc_dev));
|
||||
goto bad;
|
||||
}
|
||||
@ -318,7 +318,7 @@ USB_ATTACH(uhub)
|
||||
/* Turn the power on. */
|
||||
err = usbd_set_port_feature(dev, port, UHF_PORT_POWER);
|
||||
if (err)
|
||||
printf("%s: port %d power on failed, %s\n",
|
||||
printf("%s: port %d power on failed, %s\n",
|
||||
USBDEVNAME(sc->sc_dev), port,
|
||||
usbd_errstr(err));
|
||||
DPRINTF(("usb_init_port: turn on port %d power\n", port));
|
||||
@ -399,7 +399,7 @@ uhub_explore(usbd_device_handle dev)
|
||||
if (up->device != NULL && up->device->hub != NULL)
|
||||
up->device->hub->explore(up->device);
|
||||
#if 0 && defined(DIAGNOSTIC)
|
||||
if (up->device == NULL &&
|
||||
if (up->device == NULL &&
|
||||
(status & UPS_CURRENT_CONNECT_STATUS))
|
||||
printf("%s: connected, no device\n",
|
||||
USBDEVNAME(sc->sc_dev));
|
||||
@ -426,7 +426,7 @@ uhub_explore(usbd_device_handle dev)
|
||||
DPRINTF(("uhub_explore: device addr=%d disappeared "
|
||||
"on port %d\n", up->device->address, port));
|
||||
usb_disconnect_port(up, USBDEV(sc->sc_dev));
|
||||
usbd_clear_port_feature(dev, port,
|
||||
usbd_clear_port_feature(dev, port,
|
||||
UHF_C_PORT_CONNECTION);
|
||||
}
|
||||
if (!(status & UPS_CURRENT_CONNECT_STATUS)) {
|
||||
@ -477,7 +477,7 @@ uhub_explore(usbd_device_handle dev)
|
||||
else
|
||||
speed = USB_SPEED_FULL;
|
||||
/* Get device info and set its address. */
|
||||
err = usbd_new_device(USBDEV(sc->sc_dev), dev->bus,
|
||||
err = usbd_new_device(USBDEV(sc->sc_dev), dev->bus,
|
||||
dev->depth + 1, speed, port, up);
|
||||
/* XXX retry a few times? */
|
||||
if (err) {
|
||||
@ -486,7 +486,7 @@ uhub_explore(usbd_device_handle dev)
|
||||
/* Avoid addressing problems by disabling. */
|
||||
/* usbd_reset_port(dev, port, &up->status); */
|
||||
|
||||
/*
|
||||
/*
|
||||
* The unit refused to accept a new address, or had
|
||||
* some other serious problem. Since we cannot leave
|
||||
* at 0 we have to disable the port instead.
|
||||
@ -587,7 +587,7 @@ uhub_child_detached(device_t self, device_t child)
|
||||
int port;
|
||||
int i;
|
||||
|
||||
if (!devhub->hub)
|
||||
if (!devhub->hub)
|
||||
/* should never happen; children are only created after init */
|
||||
panic("hub not fully initialised, but child deleted?");
|
||||
|
||||
|
@ -270,7 +270,7 @@ Static struct {
|
||||
};
|
||||
|
||||
#define NN 0 /* no translation */
|
||||
/*
|
||||
/*
|
||||
* Translate USB keycodes to AT keyboard scancodes.
|
||||
*/
|
||||
/*
|
||||
@ -427,7 +427,7 @@ Static keymap_t default_keymap;
|
||||
Static accentmap_t default_accentmap;
|
||||
Static fkeytab_t default_fkeytab[NUM_FKEYS];
|
||||
|
||||
/*
|
||||
/*
|
||||
* The back door to the keyboard driver!
|
||||
* This function is called by the console driver, via the kbdio module,
|
||||
* to tickle keyboard drivers when the low-level console is being initialized.
|
||||
@ -568,7 +568,7 @@ ukbd_init(int unit, keyboard_t **kbdp, void *arg, int flags)
|
||||
state->ks_uaa = uaa;
|
||||
state->ks_ifstate = 0;
|
||||
callout_handle_init(&state->ks_timeout_handle);
|
||||
/*
|
||||
/*
|
||||
* FIXME: set the initial value for lock keys in ks_state
|
||||
* according to the BIOS data?
|
||||
*/
|
||||
@ -603,12 +603,12 @@ ukbd_enable_intr(keyboard_t *kbd, int on, usbd_intr_t *func)
|
||||
/* Set up interrupt pipe. */
|
||||
if (state->ks_ifstate & INTRENABLED)
|
||||
return EBUSY;
|
||||
|
||||
|
||||
state->ks_ifstate |= INTRENABLED;
|
||||
err = usbd_open_pipe_intr(state->ks_iface, state->ks_ep_addr,
|
||||
err = usbd_open_pipe_intr(state->ks_iface, state->ks_ep_addr,
|
||||
USBD_SHORT_XFER_OK,
|
||||
&state->ks_intrpipe, kbd,
|
||||
&state->ks_ndata,
|
||||
&state->ks_ndata,
|
||||
sizeof(state->ks_ndata), func,
|
||||
USBD_DEFAULT_INTERVAL);
|
||||
if (err)
|
||||
@ -726,10 +726,10 @@ ukbd_interrupt(keyboard_t *kbd, void *arg)
|
||||
omod = state->ks_odata.modifiers;
|
||||
if (mod != omod) {
|
||||
for (i = 0; i < NMOD; i++)
|
||||
if (( mod & ukbd_mods[i].mask) !=
|
||||
if (( mod & ukbd_mods[i].mask) !=
|
||||
(omod & ukbd_mods[i].mask))
|
||||
ADDKEY1(ukbd_mods[i].key |
|
||||
(mod & ukbd_mods[i].mask
|
||||
ADDKEY1(ukbd_mods[i].key |
|
||||
(mod & ukbd_mods[i].mask
|
||||
? KEY_PRESS : KEY_RELEASE));
|
||||
}
|
||||
|
||||
@ -748,7 +748,7 @@ ukbd_interrupt(keyboard_t *kbd, void *arg)
|
||||
rfound:
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
/* Check for pressed keys. */
|
||||
for (i = 0; i < NKEYCODE; i++) {
|
||||
key = ud->keycode[i];
|
||||
@ -841,7 +841,7 @@ ukbd_test_if(keyboard_t *kbd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Enable the access to the device; until this function is called,
|
||||
* the client cannot read from the keyboard.
|
||||
*/
|
||||
@ -908,13 +908,13 @@ ukbd_read(keyboard_t *kbd, int wait)
|
||||
usbcode & KEY_RELEASE);
|
||||
if (scancode & SCAN_PREFIX) {
|
||||
if (scancode & SCAN_PREFIX_CTL) {
|
||||
state->ks_buffered_char[0] =
|
||||
state->ks_buffered_char[0] =
|
||||
0x1d | (scancode & SCAN_RELEASE); /* Ctrl */
|
||||
state->ks_buffered_char[1] = scancode & ~SCAN_PREFIX;
|
||||
} else if (scancode & SCAN_PREFIX_SHIFT) {
|
||||
state->ks_buffered_char[0] =
|
||||
state->ks_buffered_char[0] =
|
||||
0x2a | (scancode & SCAN_RELEASE); /* Shift */
|
||||
state->ks_buffered_char[1] =
|
||||
state->ks_buffered_char[1] =
|
||||
scancode & ~SCAN_PREFIX_SHIFT;
|
||||
} else {
|
||||
state->ks_buffered_char[0] = scancode & ~SCAN_PREFIX;
|
||||
@ -1004,12 +1004,12 @@ ukbd_read_char(keyboard_t *kbd, int wait)
|
||||
usbcode & KEY_RELEASE);
|
||||
if (scancode & SCAN_PREFIX) {
|
||||
if (scancode & SCAN_PREFIX_CTL) {
|
||||
state->ks_buffered_char[0] =
|
||||
state->ks_buffered_char[0] =
|
||||
0x1d | (scancode & SCAN_RELEASE);
|
||||
state->ks_buffered_char[1] =
|
||||
scancode & ~SCAN_PREFIX;
|
||||
} else if (scancode & SCAN_PREFIX_SHIFT) {
|
||||
state->ks_buffered_char[0] =
|
||||
state->ks_buffered_char[0] =
|
||||
0x2a | (scancode & SCAN_RELEASE);
|
||||
state->ks_buffered_char[1] =
|
||||
scancode & ~SCAN_PREFIX_SHIFT;
|
||||
@ -1344,7 +1344,7 @@ Static int
|
||||
probe_keyboard(struct usb_attach_arg *uaa, int flags)
|
||||
{
|
||||
usb_interface_descriptor_t *id;
|
||||
|
||||
|
||||
if (!uaa->iface) /* we attach to ifaces only */
|
||||
return EINVAL;
|
||||
|
||||
@ -1364,7 +1364,7 @@ init_keyboard(ukbd_state_t *state, int *type, int flags)
|
||||
{
|
||||
usb_endpoint_descriptor_t *ed;
|
||||
usbd_status err;
|
||||
|
||||
|
||||
*type = KB_OTHER;
|
||||
|
||||
state->ks_ifstate |= DISCONNECTED;
|
||||
@ -1437,10 +1437,10 @@ Static int
|
||||
keycode2scancode(int keycode, int shift, int up)
|
||||
{
|
||||
static int scan[] = {
|
||||
0x1c, 0x1d, 0x35,
|
||||
0x1c, 0x1d, 0x35,
|
||||
0x37 | SCAN_PREFIX_SHIFT, /* PrintScreen */
|
||||
0x38, 0x47, 0x48, 0x49, 0x4b, 0x4d, 0x4f,
|
||||
0x50, 0x51, 0x52, 0x53,
|
||||
0x38, 0x47, 0x48, 0x49, 0x4b, 0x4d, 0x4f,
|
||||
0x50, 0x51, 0x52, 0x53,
|
||||
0x46, /* XXX Pause/Break */
|
||||
0x5b, 0x5c, 0x5d,
|
||||
};
|
||||
|
@ -240,7 +240,7 @@ typedef void (*transfer_cb_f) (struct umass_softc *sc, void *priv,
|
||||
|
||||
typedef void (*wire_reset_f) (struct umass_softc *sc, int status);
|
||||
typedef void (*wire_transfer_f) (struct umass_softc *sc, int lun,
|
||||
void *cmd, int cmdlen, void *data, int datalen,
|
||||
void *cmd, int cmdlen, void *data, int datalen,
|
||||
int dir, transfer_cb_f cb, void *priv);
|
||||
typedef void (*wire_state_f) (usbd_xfer_handle xfer,
|
||||
usbd_private_handle priv, usbd_status err);
|
||||
@ -318,11 +318,11 @@ Static struct umass_devdescr_t umass_devdescrs[] = {
|
||||
},
|
||||
{ USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB2IDE, RID_WILDCARD,
|
||||
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
|
||||
FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE
|
||||
FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE
|
||||
},
|
||||
{ USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB, RID_WILDCARD,
|
||||
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
|
||||
FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE
|
||||
FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE
|
||||
},
|
||||
{ USB_VENDOR_HITACHI, USB_PRODUCT_HITACHI_DVDCAM_USB, RID_WILDCARD,
|
||||
UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I,
|
||||
@ -344,7 +344,7 @@ Static struct umass_devdescr_t umass_devdescrs[] = {
|
||||
},
|
||||
{ USB_VENDOR_MELCO, USB_PRODUCT_MELCO_DUBPXXG, RID_WILDCARD,
|
||||
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
|
||||
FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE
|
||||
FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE
|
||||
},
|
||||
{ USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_DPCM, RID_WILDCARD,
|
||||
UMASS_PROTO_SCSI | UMASS_PROTO_CBI,
|
||||
@ -425,12 +425,12 @@ struct umass_softc {
|
||||
* into their derivatives, like UFI, ATAPI, and friends.
|
||||
*/
|
||||
command_transform_f transform; /* command transform */
|
||||
|
||||
|
||||
/* Bulk specific variables for transfers in progress */
|
||||
umass_bbb_cbw_t cbw; /* command block wrapper */
|
||||
umass_bbb_csw_t csw; /* command status wrapper*/
|
||||
/* CBI specific variables for transfers in progress */
|
||||
umass_cbi_cbl_t cbl; /* command block */
|
||||
umass_cbi_cbl_t cbl; /* command block */
|
||||
umass_cbi_sbl_t sbl; /* status block */
|
||||
|
||||
/* generic variables for transfers in progress */
|
||||
@ -452,7 +452,7 @@ struct umass_softc {
|
||||
# define XFER_BBB_RESET1 6
|
||||
# define XFER_BBB_RESET2 7
|
||||
# define XFER_BBB_RESET3 8
|
||||
|
||||
|
||||
# define XFER_CBI_CB 0 /* CBI */
|
||||
# define XFER_CBI_DATA 1
|
||||
# define XFER_CBI_STATUS 2
|
||||
@ -469,7 +469,7 @@ struct umass_softc {
|
||||
int transfer_dir; /* data direction */
|
||||
void *transfer_data; /* data buffer */
|
||||
int transfer_datalen; /* (maximum) length */
|
||||
int transfer_actlen; /* actual length */
|
||||
int transfer_actlen; /* actual length */
|
||||
transfer_cb_f transfer_cb; /* callback */
|
||||
void *transfer_priv; /* for callback */
|
||||
int transfer_status;
|
||||
@ -555,7 +555,7 @@ Static usbd_status umass_setup_transfer (struct umass_softc *sc,
|
||||
Static usbd_status umass_setup_ctrl_transfer (struct umass_softc *sc,
|
||||
usbd_device_handle udev,
|
||||
usb_device_request_t *req,
|
||||
void *buffer, int buflen, int flags,
|
||||
void *buffer, int buflen, int flags,
|
||||
usbd_xfer_handle xfer);
|
||||
Static void umass_clear_endpoint_stall (struct umass_softc *sc,
|
||||
u_int8_t endpt, usbd_pipe_handle pipe,
|
||||
@ -574,7 +574,7 @@ Static void umass_bbb_state (usbd_xfer_handle xfer,
|
||||
usbd_status err);
|
||||
Static int umass_bbb_get_max_lun
|
||||
(struct umass_softc *sc);
|
||||
|
||||
|
||||
/* CBI related functions */
|
||||
Static int umass_cbi_adsc (struct umass_softc *sc,
|
||||
char *buffer, int buflen,
|
||||
@ -728,7 +728,7 @@ umass_match_proto(struct umass_softc *sc, usbd_interface_handle iface,
|
||||
id = usbd_get_interface_descriptor(iface);
|
||||
if (id == NULL || id->bInterfaceClass != UICLASS_MASS)
|
||||
return(UMATCH_NONE);
|
||||
|
||||
|
||||
switch (id->bInterfaceSubClass) {
|
||||
case UISUBCLASS_SCSI:
|
||||
sc->proto |= UMASS_PROTO_SCSI;
|
||||
@ -1208,7 +1208,7 @@ umass_bbb_reset(struct umass_softc *sc, int status)
|
||||
|
||||
DPRINTF(UDMASS_BBB, ("%s: Bulk Reset\n",
|
||||
USBDEVNAME(sc->sc_dev)));
|
||||
|
||||
|
||||
sc->transfer_state = TSTATE_BBB_RESET1;
|
||||
sc->transfer_status = status;
|
||||
|
||||
@ -1241,7 +1241,7 @@ umass_bbb_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen,
|
||||
* is stored in the buffer pointed to by data.
|
||||
*
|
||||
* umass_bbb_transfer initialises the transfer and lets the state
|
||||
* machine in umass_bbb_state handle the completion. It uses the
|
||||
* machine in umass_bbb_state handle the completion. It uses the
|
||||
* following states:
|
||||
* TSTATE_BBB_COMMAND
|
||||
* -> TSTATE_BBB_DATA
|
||||
@ -1453,7 +1453,7 @@ umass_bbb_state(usbd_xfer_handle xfer, usbd_private_handle priv,
|
||||
umass_bbb_reset(sc, STATUS_WIRE_FAILED);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Status transport phase, setup transfer */
|
||||
if (sc->transfer_state == TSTATE_BBB_COMMAND ||
|
||||
sc->transfer_state == TSTATE_BBB_DATA ||
|
||||
@ -1549,7 +1549,7 @@ umass_bbb_state(usbd_xfer_handle xfer, usbd_private_handle priv,
|
||||
} else if (sc->csw.bCSWStatus == CSWSTATUS_PHASE) {
|
||||
printf("%s: Phase Error, residue = %d\n",
|
||||
USBDEVNAME(sc->sc_dev), Residue);
|
||||
|
||||
|
||||
umass_bbb_reset(sc, STATUS_WIRE_FAILED);
|
||||
return;
|
||||
|
||||
@ -1674,7 +1674,7 @@ umass_cbi_adsc(struct umass_softc *sc, char *buffer, int buflen,
|
||||
KASSERT(sc->proto & (UMASS_PROTO_CBI|UMASS_PROTO_CBI_I),
|
||||
("%s: umass_cbi_adsc: wrong sc->proto 0x%02x\n",
|
||||
USBDEVNAME(sc->sc_dev), sc->proto));
|
||||
|
||||
|
||||
usbd_interface2device_handle(sc->iface, &udev);
|
||||
|
||||
sc->request.bmRequestType = UT_WRITE_CLASS_INTERFACE;
|
||||
@ -1699,7 +1699,7 @@ umass_cbi_reset(struct umass_softc *sc, int status)
|
||||
|
||||
/*
|
||||
* Command Block Reset Protocol
|
||||
*
|
||||
*
|
||||
* First send a reset request to the device. Then clear
|
||||
* any possibly stalled bulk endpoints.
|
||||
|
||||
@ -1713,7 +1713,7 @@ umass_cbi_reset(struct umass_softc *sc, int status)
|
||||
|
||||
DPRINTF(UDMASS_CBI, ("%s: CBI Reset\n",
|
||||
USBDEVNAME(sc->sc_dev)));
|
||||
|
||||
|
||||
KASSERT(sizeof(sc->cbl) >= SEND_DIAGNOSTIC_CMDLEN,
|
||||
("%s: CBL struct is too small (%ld < %d)\n",
|
||||
USBDEVNAME(sc->sc_dev),
|
||||
@ -1753,7 +1753,7 @@ umass_cbi_transfer(struct umass_softc *sc, int lun,
|
||||
* is stored in the buffer pointed to by data.
|
||||
*
|
||||
* umass_cbi_transfer initialises the transfer and lets the state
|
||||
* machine in umass_cbi_state handle the completion. It uses the
|
||||
* machine in umass_cbi_state handle the completion. It uses the
|
||||
* following states:
|
||||
* TSTATE_CBI_COMMAND
|
||||
* -> XXX fill in
|
||||
@ -1835,7 +1835,7 @@ umass_cbi_state(usbd_xfer_handle xfer, usbd_private_handle priv,
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
sc->transfer_state = TSTATE_CBI_DATA;
|
||||
if (sc->transfer_dir == DIR_IN) {
|
||||
if (umass_setup_transfer(sc, sc->bulkin_pipe,
|
||||
@ -1940,7 +1940,7 @@ umass_cbi_state(usbd_xfer_handle xfer, usbd_private_handle priv,
|
||||
|
||||
if (sc->proto & UMASS_PROTO_UFI) {
|
||||
int status;
|
||||
|
||||
|
||||
/* Section 3.4.3.1.3 specifies that the UFI command
|
||||
* protocol returns an ASC and ASCQ in the interrupt
|
||||
* data block.
|
||||
@ -2322,7 +2322,7 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb)
|
||||
cmd = (unsigned char *) &csio->cdb_io.cdb_bytes;
|
||||
}
|
||||
cmdlen = csio->cdb_len;
|
||||
rcmd = (unsigned char *) &sc->cam_scsi_command;
|
||||
rcmd = (unsigned char *) &sc->cam_scsi_command;
|
||||
rcmdlen = sizeof(sc->cam_scsi_command);
|
||||
|
||||
/* sc->transform will convert the command to the command
|
||||
@ -2334,7 +2334,7 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb)
|
||||
*/
|
||||
|
||||
if (sc->transform(sc, cmd, cmdlen, &rcmd, &rcmdlen)) {
|
||||
/*
|
||||
/*
|
||||
* Handle EVPD inquiry for broken devices first
|
||||
* NO_INQUIRY also implies NO_INQUIRY_EVPD
|
||||
*/
|
||||
@ -2428,7 +2428,7 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb)
|
||||
ccb->ccb_h.status = CAM_REQ_INPROG;
|
||||
umass_reset(sc, umass_cam_cb, (void *) ccb);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case XPT_GET_TRAN_SETTINGS:
|
||||
{
|
||||
struct ccb_trans_settings *cts = &ccb->cts;
|
||||
|
@ -82,7 +82,7 @@ struct umct_softc {
|
||||
void *sc_swicookie;
|
||||
};
|
||||
|
||||
Static void umct_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
|
||||
Static void umct_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
|
||||
Static void umct_get_status(void *, int, u_char *, u_char *);
|
||||
Static void umct_set(void *, int, int, int);
|
||||
Static int umct_param(void *, int, struct termios *);
|
||||
@ -224,7 +224,7 @@ USB_ATTACH(umct)
|
||||
}
|
||||
|
||||
/*
|
||||
* The real bulk-in endpoint is also marked as an interrupt.
|
||||
* The real bulk-in endpoint is also marked as an interrupt.
|
||||
* The only way to differentiate it from the real interrupt
|
||||
* endpoint is to look at the wMaxPacketSize field.
|
||||
*/
|
||||
|
@ -85,7 +85,7 @@ SYSCTL_INT(_hw_usb_ums, OID_AUTO, debug, CTLFLAG_RW,
|
||||
|
||||
#define UMSUNIT(s) (minor(s)&0x1f)
|
||||
|
||||
#define MS_TO_TICKS(ms) ((ms) * hz / 1000)
|
||||
#define MS_TO_TICKS(ms) ((ms) * hz / 1000)
|
||||
|
||||
#define QUEUE_BUFSIZE 400 /* MUST be divisible by 5 _and_ 8 */
|
||||
|
||||
@ -170,7 +170,7 @@ USB_MATCH(ums)
|
||||
int size, ret;
|
||||
void *desc;
|
||||
usbd_status err;
|
||||
|
||||
|
||||
if (!uaa->iface)
|
||||
return (UMATCH_NONE);
|
||||
id = usbd_get_interface_descriptor(uaa->iface);
|
||||
@ -181,7 +181,7 @@ USB_MATCH(ums)
|
||||
if (err)
|
||||
return (UMATCH_NONE);
|
||||
|
||||
if (hid_is_collection(desc, size,
|
||||
if (hid_is_collection(desc, size,
|
||||
HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)))
|
||||
ret = UMATCH_IFACECLASS;
|
||||
else
|
||||
@ -204,7 +204,7 @@ USB_ATTACH(ums)
|
||||
u_int32_t flags;
|
||||
int i;
|
||||
struct hid_location loc_btn;
|
||||
|
||||
|
||||
sc->sc_disconnected = 1;
|
||||
sc->sc_iface = iface;
|
||||
id = usbd_get_interface_descriptor(iface);
|
||||
@ -222,7 +222,7 @@ USB_ATTACH(ums)
|
||||
DPRINTFN(10,("ums_attach: bLength=%d bDescriptorType=%d "
|
||||
"bEndpointAddress=%d-%s bmAttributes=%d wMaxPacketSize=%d"
|
||||
" bInterval=%d\n",
|
||||
ed->bLength, ed->bDescriptorType,
|
||||
ed->bLength, ed->bDescriptorType,
|
||||
UE_GET_ADDR(ed->bEndpointAddress),
|
||||
UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN ? "in":"out",
|
||||
UE_GET_XFERTYPE(ed->bmAttributes),
|
||||
@ -279,7 +279,7 @@ USB_ATTACH(ums)
|
||||
hid_input, &loc_btn, 0))
|
||||
break;
|
||||
sc->nbuttons = i - 1;
|
||||
sc->sc_loc_btn = malloc(sizeof(struct hid_location)*sc->nbuttons,
|
||||
sc->sc_loc_btn = malloc(sizeof(struct hid_location)*sc->nbuttons,
|
||||
M_USBDEV, M_NOWAIT);
|
||||
if (!sc->sc_loc_btn) {
|
||||
printf("%s: no memory\n", USBDEVNAME(sc->sc_dev));
|
||||
@ -307,12 +307,12 @@ USB_ATTACH(ums)
|
||||
|
||||
#ifdef USB_DEBUG
|
||||
DPRINTF(("ums_attach: sc=%p\n", sc));
|
||||
DPRINTF(("ums_attach: X\t%d/%d\n",
|
||||
DPRINTF(("ums_attach: X\t%d/%d\n",
|
||||
sc->sc_loc_x.pos, sc->sc_loc_x.size));
|
||||
DPRINTF(("ums_attach: Y\t%d/%d\n",
|
||||
DPRINTF(("ums_attach: Y\t%d/%d\n",
|
||||
sc->sc_loc_y.pos, sc->sc_loc_y.size));
|
||||
if (sc->flags & UMS_Z)
|
||||
DPRINTF(("ums_attach: Z\t%d/%d\n",
|
||||
DPRINTF(("ums_attach: Z\t%d/%d\n",
|
||||
sc->sc_loc_z.pos, sc->sc_loc_z.size));
|
||||
for (i = 1; i <= sc->nbuttons; i++) {
|
||||
DPRINTF(("ums_attach: B%d\t%d/%d\n",
|
||||
@ -556,8 +556,8 @@ ums_enable(v)
|
||||
callout_handle_init((struct callout_handle *)&sc->callout_handle);
|
||||
|
||||
/* Set up interrupt pipe. */
|
||||
err = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
|
||||
USBD_SHORT_XFER_OK, &sc->sc_intrpipe, sc,
|
||||
err = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
|
||||
USBD_SHORT_XFER_OK, &sc->sc_intrpipe, sc,
|
||||
sc->sc_ibuf, sc->sc_isize, ums_intr,
|
||||
USBD_DEFAULT_INTERVAL);
|
||||
if (err) {
|
||||
@ -635,7 +635,7 @@ ums_read(dev_t dev, struct uio *uio, int flag)
|
||||
splx(s);
|
||||
return EWOULDBLOCK;
|
||||
}
|
||||
|
||||
|
||||
sc->state |= UMS_ASLEEP; /* blocking I/O */
|
||||
error = tsleep(sc, PZERO | PCATCH, "umsrea", 0);
|
||||
if (error) {
|
||||
@ -708,7 +708,7 @@ ums_poll(dev_t dev, int events, usb_proc_ptr p)
|
||||
|
||||
return revents;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ums_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
|
||||
{
|
||||
|
@ -279,7 +279,7 @@ USB_ATTACH(uplcom)
|
||||
|
||||
DPRINTF(("uplcom attach: sc = %p\n", sc));
|
||||
|
||||
/* initialize endpoints */
|
||||
/* initialize endpoints */
|
||||
ucom->sc_bulkin_no = ucom->sc_bulkout_no = -1;
|
||||
sc->sc_intr_number = -1;
|
||||
sc->sc_intr_pipe = NULL;
|
||||
@ -304,7 +304,7 @@ USB_ATTACH(uplcom)
|
||||
}
|
||||
|
||||
/* get the (first/common) interface */
|
||||
err = usbd_device2interface_handle(dev, UPLCOM_IFACE_INDEX,
|
||||
err = usbd_device2interface_handle(dev, UPLCOM_IFACE_INDEX,
|
||||
&ucom->sc_iface);
|
||||
if (err) {
|
||||
printf("%s: failed to get interface: %s\n",
|
||||
@ -331,7 +331,7 @@ USB_ATTACH(uplcom)
|
||||
UE_GET_XFERTYPE(ed->bmAttributes) == UE_INTERRUPT) {
|
||||
sc->sc_intr_number = ed->bEndpointAddress;
|
||||
sc->sc_isize = UGETW(ed->wMaxPacketSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sc->sc_intr_number == -1) {
|
||||
@ -353,11 +353,11 @@ USB_ATTACH(uplcom)
|
||||
* Interrupt(0x81) | Interrupt(0x81)
|
||||
* -----------------+ BulkIN(0x02)
|
||||
* Interface 1 | BulkOUT(0x83)
|
||||
* BulkIN(0x02) |
|
||||
* BulkIN(0x02) |
|
||||
* BulkOUT(0x83) |
|
||||
*/
|
||||
if (cdesc->bNumInterface == 2) {
|
||||
err = usbd_device2interface_handle(dev,
|
||||
err = usbd_device2interface_handle(dev,
|
||||
UPLCOM_SECOND_IFACE_INDEX,
|
||||
&ucom->sc_iface);
|
||||
if (err) {
|
||||
@ -366,7 +366,7 @@ USB_ATTACH(uplcom)
|
||||
ucom->sc_dying = 1;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the bulk{in,out} endpoints */
|
||||
|
||||
@ -468,9 +468,9 @@ uplcom_reset(struct uplcom_softc *sc)
|
||||
req.bRequest = UPLCOM_SET_REQUEST;
|
||||
USETW(req.wValue, 0);
|
||||
USETW(req.wIndex, sc->sc_iface_number);
|
||||
USETW(req.wLength, 0);
|
||||
USETW(req.wLength, 0);
|
||||
|
||||
err = usbd_do_request(sc->sc_ucom.sc_udev, &req, 0);
|
||||
err = usbd_do_request(sc->sc_ucom.sc_udev, &req, 0);
|
||||
if (err) {
|
||||
printf("%s: uplcom_reset: %s\n",
|
||||
USBDEVNAME(sc->sc_ucom.sc_dev), usbd_errstr(err));
|
||||
@ -677,7 +677,7 @@ uplcom_open(void *addr, int portno)
|
||||
{
|
||||
struct uplcom_softc *sc = addr;
|
||||
int err;
|
||||
|
||||
|
||||
if (sc->sc_ucom.sc_dying)
|
||||
return (ENXIO);
|
||||
|
||||
@ -707,7 +707,7 @@ uplcom_open(void *addr, int portno)
|
||||
}
|
||||
|
||||
Static void
|
||||
uplcom_close(void *addr, int portno)
|
||||
uplcom_close(void *addr, int portno)
|
||||
{
|
||||
struct uplcom_softc *sc = addr;
|
||||
int err;
|
||||
|
@ -195,7 +195,7 @@ USB_ATTACH(urio)
|
||||
char * ermsg = "<none>";
|
||||
int i;
|
||||
|
||||
DPRINTFN(10,("urio_attach: sc=%p\n", sc));
|
||||
DPRINTFN(10,("urio_attach: sc=%p\n", sc));
|
||||
usbd_devinfo(uaa->device, 0, devinfo);
|
||||
USB_ATTACH_SETUP;
|
||||
printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
|
||||
@ -216,12 +216,12 @@ USB_ATTACH(urio)
|
||||
r = usbd_interface_count(udev, &niface);
|
||||
if (r) {
|
||||
ermsg = "iface";
|
||||
goto nobulk;
|
||||
goto nobulk;
|
||||
}
|
||||
r = usbd_device2interface_handle(udev, 0, &iface);
|
||||
if (r) {
|
||||
ermsg = "iface";
|
||||
goto nobulk;
|
||||
goto nobulk;
|
||||
}
|
||||
sc->sc_iface = iface;
|
||||
#endif
|
||||
@ -231,7 +231,7 @@ USB_ATTACH(urio)
|
||||
sc->sc_refcnt = 0;
|
||||
|
||||
r = usbd_endpoint_count(iface, &epcount);
|
||||
if (r != USBD_NORMAL_COMPLETION) {
|
||||
if (r != USBD_NORMAL_COMPLETION) {
|
||||
ermsg = "endpoints";
|
||||
goto nobulk;
|
||||
}
|
||||
@ -240,7 +240,7 @@ USB_ATTACH(urio)
|
||||
sc->sc_epaddr[RIO_IN] = 0x00;
|
||||
|
||||
for (i = 0; i < epcount; i++) {
|
||||
usb_endpoint_descriptor_t *edesc =
|
||||
usb_endpoint_descriptor_t *edesc =
|
||||
usbd_interface2endpoint_descriptor(iface, i);
|
||||
int d;
|
||||
|
||||
@ -248,7 +248,7 @@ USB_ATTACH(urio)
|
||||
ermsg = "interface endpoint";
|
||||
goto nobulk;
|
||||
}
|
||||
|
||||
|
||||
d = RIO_UE_GET_DIR(edesc->bEndpointAddress);
|
||||
if (d != RIO_NODIR)
|
||||
sc->sc_epaddr[d] = edesc->bEndpointAddress;
|
||||
@ -288,7 +288,7 @@ urioopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
int unit = URIOUNIT(dev);
|
||||
USB_GET_SC_OPEN(urio, unit, sc);
|
||||
|
||||
DPRINTFN(5, ("urioopen: flag=%d, mode=%d, unit=%d\n",
|
||||
DPRINTFN(5, ("urioopen: flag=%d, mode=%d, unit=%d\n",
|
||||
flag, mode, unit));
|
||||
|
||||
if (sc->sc_opened)
|
||||
@ -300,18 +300,18 @@ urioopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
sc->sc_opened = 1;
|
||||
sc->sc_pipeh_in = 0;
|
||||
sc->sc_pipeh_out = 0;
|
||||
if (usbd_open_pipe(sc->sc_iface,
|
||||
sc->sc_epaddr[RIO_IN], 0, &sc->sc_pipeh_in)
|
||||
if (usbd_open_pipe(sc->sc_iface,
|
||||
sc->sc_epaddr[RIO_IN], 0, &sc->sc_pipeh_in)
|
||||
!= USBD_NORMAL_COMPLETION)
|
||||
{
|
||||
sc->sc_pipeh_in = 0;
|
||||
return EIO;
|
||||
};
|
||||
if (usbd_open_pipe(sc->sc_iface,
|
||||
sc->sc_epaddr[RIO_OUT], 0, &sc->sc_pipeh_out)
|
||||
if (usbd_open_pipe(sc->sc_iface,
|
||||
sc->sc_epaddr[RIO_OUT], 0, &sc->sc_pipeh_out)
|
||||
!= USBD_NORMAL_COMPLETION)
|
||||
{
|
||||
usbd_close_pipe(sc->sc_pipeh_in);
|
||||
usbd_close_pipe(sc->sc_pipeh_in);
|
||||
sc->sc_pipeh_in = 0;
|
||||
sc->sc_pipeh_out = 0;
|
||||
return EIO;
|
||||
@ -329,17 +329,17 @@ urioclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
|
||||
USB_GET_SC(urio, unit, sc);
|
||||
|
||||
DPRINTFN(5, ("urioclose: flag=%d, mode=%d, unit=%d\n", flag, mode, unit));
|
||||
if (sc->sc_pipeh_in)
|
||||
usbd_close_pipe(sc->sc_pipeh_in);
|
||||
if (sc->sc_pipeh_in)
|
||||
usbd_close_pipe(sc->sc_pipeh_in);
|
||||
|
||||
if (sc->sc_pipeh_out)
|
||||
usbd_close_pipe(sc->sc_pipeh_out);
|
||||
if (sc->sc_pipeh_out)
|
||||
usbd_close_pipe(sc->sc_pipeh_out);
|
||||
|
||||
sc->sc_pipeh_in = 0;
|
||||
sc->sc_pipeh_out = 0;
|
||||
sc->sc_opened = 0;
|
||||
sc->sc_refcnt = 0;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
@ -512,7 +512,7 @@ urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
|
||||
len = rio_cmd->length;
|
||||
|
||||
requesttype = rio_cmd->requesttype | UT_READ_VENDOR_DEVICE;
|
||||
DPRINTFN(1,("sending command:reqtype=%0x req=%0x value=%0x index=%0x len=%0x\n",
|
||||
DPRINTFN(1,("sending command:reqtype=%0x req=%0x value=%0x index=%0x len=%0x\n",
|
||||
requesttype, rio_cmd->request, rio_cmd->value, rio_cmd->index, len));
|
||||
break;
|
||||
|
||||
@ -525,7 +525,7 @@ urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
|
||||
len = rio_cmd->length;
|
||||
|
||||
requesttype = rio_cmd->requesttype | UT_WRITE_VENDOR_DEVICE;
|
||||
DPRINTFN(1,("sending command:reqtype=%0x req=%0x value=%0x index=%0x len=%0x\n",
|
||||
DPRINTFN(1,("sending command:reqtype=%0x req=%0x value=%0x index=%0x len=%0x\n",
|
||||
requesttype, rio_cmd->request, rio_cmd->value, rio_cmd->index, len));
|
||||
break;
|
||||
|
||||
@ -552,7 +552,7 @@ urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
|
||||
uio.uio_offset = 0;
|
||||
uio.uio_segflg = UIO_USERSPACE;
|
||||
uio.uio_rw =
|
||||
req.bmRequestType & UT_READ ?
|
||||
req.bmRequestType & UT_READ ?
|
||||
UIO_READ : UIO_WRITE;
|
||||
uio.uio_procp = p;
|
||||
ptr = malloc(len, M_TEMP, M_WAITOK);
|
||||
@ -563,7 +563,7 @@ urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
|
||||
}
|
||||
}
|
||||
|
||||
r = usbd_do_request_flags(sc->sc_udev, &req,
|
||||
r = usbd_do_request_flags(sc->sc_udev, &req,
|
||||
ptr, req_flags, &req_actlen,
|
||||
USBD_DEFAULT_TIMEOUT);
|
||||
if (r == USBD_NORMAL_COMPLETION) {
|
||||
@ -637,11 +637,11 @@ USB_DETACH(urio)
|
||||
}
|
||||
splx(s);
|
||||
#else
|
||||
if (sc->sc_pipeh_in)
|
||||
usbd_abort_pipe(sc->sc_pipeh_in);
|
||||
if (sc->sc_pipeh_in)
|
||||
usbd_abort_pipe(sc->sc_pipeh_in);
|
||||
|
||||
if (sc->sc_pipeh_out)
|
||||
usbd_abort_pipe(sc->sc_pipeh_out);
|
||||
if (sc->sc_pipeh_out)
|
||||
usbd_abort_pipe(sc->sc_pipeh_out);
|
||||
|
||||
s = splusb();
|
||||
if (--sc->sc_refcnt >= 0) {
|
||||
@ -672,7 +672,7 @@ USB_DETACH(urio)
|
||||
#if defined(__FreeBSD__)
|
||||
Static int
|
||||
urio_detach(device_t self)
|
||||
{
|
||||
{
|
||||
struct urio_softc *sc = device_get_softc(self);
|
||||
|
||||
DPRINTF(("%s: disconnected\n", USBDEVNAME(self)));
|
||||
|
@ -60,7 +60,7 @@ void usb_freemem(usbd_bus_handle, usb_dma_t *);
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
|
||||
/*
|
||||
/*
|
||||
* FreeBSD does not have special functions for dma memory, so let's keep it
|
||||
* simple for now.
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* $OpenBSD: usb_port.h,v 1.18 2000/09/06 22:42:10 rahnds Exp $ */
|
||||
/* $NetBSD: usb_port.h,v 1.54 2002/03/28 21:49:19 ichiro Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -42,7 +42,7 @@
|
||||
#ifndef _USB_PORT_H
|
||||
#define _USB_PORT_H
|
||||
|
||||
/*
|
||||
/*
|
||||
* Macro's to cope with the differences between operating systems.
|
||||
*/
|
||||
|
||||
|
@ -208,7 +208,7 @@ usbd_get_string(usbd_device_handle dev, int si, char *buf)
|
||||
*s++ = c;
|
||||
else if ((c & 0x00ff) == 0 && swap)
|
||||
*s++ = c >> 8;
|
||||
else
|
||||
else
|
||||
*s++ = '?';
|
||||
}
|
||||
*s++ = 0;
|
||||
@ -259,7 +259,7 @@ usbd_devinfo_vp(usbd_device_handle dev, char *v, char *p, int usedev)
|
||||
for(kdp = usb_knowndevs;
|
||||
kdp->vendorname != NULL;
|
||||
kdp++) {
|
||||
if (kdp->vendor == UGETW(udd->idVendor) &&
|
||||
if (kdp->vendor == UGETW(udd->idVendor) &&
|
||||
(kdp->product == UGETW(udd->idProduct) ||
|
||||
(kdp->flags & USB_KNOWNDEV_NOPROD) != 0))
|
||||
break;
|
||||
@ -336,7 +336,7 @@ usbd_reset_port(usbd_device_handle dev, int port, usb_port_status_t *ps)
|
||||
usb_device_request_t req;
|
||||
usbd_status err;
|
||||
int n;
|
||||
|
||||
|
||||
req.bmRequestType = UT_WRITE_CLASS_OTHER;
|
||||
req.bRequest = UR_SET_FEATURE;
|
||||
USETW(req.wValue, UHF_PORT_RESET);
|
||||
@ -386,7 +386,7 @@ usbd_find_idesc(usb_config_descriptor_t *cd, int ifaceidx, int altidx)
|
||||
for (curidx = lastidx = -1; p < end; ) {
|
||||
d = (usb_interface_descriptor_t *)p;
|
||||
DPRINTFN(4,("usbd_find_idesc: idx=%d(%d) altidx=%d(%d) len=%d "
|
||||
"type=%d\n",
|
||||
"type=%d\n",
|
||||
ifaceidx, curidx, altidx, curaidx,
|
||||
d->bLength, d->bDescriptorType));
|
||||
if (d->bLength == 0) /* bad descriptor */
|
||||
@ -407,7 +407,7 @@ usbd_find_idesc(usb_config_descriptor_t *cd, int ifaceidx, int altidx)
|
||||
}
|
||||
|
||||
usb_endpoint_descriptor_t *
|
||||
usbd_find_edesc(usb_config_descriptor_t *cd, int ifaceidx, int altidx,
|
||||
usbd_find_edesc(usb_config_descriptor_t *cd, int ifaceidx, int altidx,
|
||||
int endptidx)
|
||||
{
|
||||
char *p = (char *)cd;
|
||||
@ -666,7 +666,7 @@ usbd_set_config_index(usbd_device_handle dev, int index, int msg)
|
||||
}
|
||||
DPRINTF(("usbd_set_config_index: (addr %d) cno=%d attr=0x%02x, "
|
||||
"selfpowered=%d, power=%d\n",
|
||||
cdp->bConfigurationValue, dev->address, cdp->bmAttributes,
|
||||
cdp->bConfigurationValue, dev->address, cdp->bmAttributes,
|
||||
selfpowered, cdp->bMaxPower * 2));
|
||||
|
||||
/* Check if we have enough power. */
|
||||
@ -683,8 +683,8 @@ usbd_set_config_index(usbd_device_handle dev, int index, int msg)
|
||||
if (msg)
|
||||
printf("%s: device addr %d (config %d) exceeds power "
|
||||
"budget, %d mA > %d mA\n",
|
||||
USBDEVNAME(dev->bus->bdev), dev->address,
|
||||
cdp->bConfigurationValue,
|
||||
USBDEVNAME(dev->bus->bdev), dev->address,
|
||||
cdp->bConfigurationValue,
|
||||
power, dev->powersrc->power);
|
||||
err = USBD_NO_POWER;
|
||||
goto bad;
|
||||
@ -705,7 +705,7 @@ usbd_set_config_index(usbd_device_handle dev, int index, int msg)
|
||||
|
||||
/* Allocate and fill interface data. */
|
||||
nifc = cdp->bNumInterface;
|
||||
dev->ifaces = malloc(nifc * sizeof(struct usbd_interface),
|
||||
dev->ifaces = malloc(nifc * sizeof(struct usbd_interface),
|
||||
M_USB, M_NOWAIT);
|
||||
if (dev->ifaces == NULL) {
|
||||
err = USBD_NOMEM;
|
||||
@ -804,7 +804,7 @@ usbd_probe_and_attach(device_ptr_t parent, usbd_device_handle dev,
|
||||
usbd_interface_handle ifaces[256]; /* 256 is the absolute max */
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
/*
|
||||
/*
|
||||
* XXX uaa is a static var. Not a problem as it _should_ be used only
|
||||
* during probe and attach. Should be changed however.
|
||||
*/
|
||||
@ -938,7 +938,7 @@ usbd_probe_and_attach(device_ptr_t parent, usbd_device_handle dev,
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* The generic attach failed, but leave the device as it is.
|
||||
* We just did not find any drivers, that's all. The device is
|
||||
* fully operational and not harming anyone.
|
||||
@ -972,7 +972,7 @@ usbd_new_device(device_ptr_t parent, usbd_bus_handle bus, int depth,
|
||||
bus, port, depth, speed));
|
||||
addr = usbd_getnewaddr(bus);
|
||||
if (addr < 0) {
|
||||
printf("%s: No free USB addresses, new device ignored.\n",
|
||||
printf("%s: No free USB addresses, new device ignored.\n",
|
||||
USBDEVNAME(bus->bdev));
|
||||
return (USBD_NO_ADDR);
|
||||
}
|
||||
@ -1046,9 +1046,9 @@ usbd_new_device(device_ptr_t parent, usbd_bus_handle bus, int depth,
|
||||
}
|
||||
|
||||
DPRINTF(("usbd_new_device: adding unit addr=%d, rev=%02x, class=%d, "
|
||||
"subclass=%d, protocol=%d, maxpacket=%d, len=%d, speed=%d\n",
|
||||
"subclass=%d, protocol=%d, maxpacket=%d, len=%d, speed=%d\n",
|
||||
addr,UGETW(dd->bcdUSB), dd->bDeviceClass, dd->bDeviceSubClass,
|
||||
dd->bDeviceProtocol, dd->bMaxPacketSize, dd->bLength,
|
||||
dd->bDeviceProtocol, dd->bMaxPacketSize, dd->bLength,
|
||||
dev->speed));
|
||||
|
||||
if (dd->bDescriptorType != UDESC_DEVICE) {
|
||||
@ -1094,7 +1094,7 @@ usbd_new_device(device_ptr_t parent, usbd_bus_handle bus, int depth,
|
||||
dev->power = USB_MIN_POWER;
|
||||
dev->self_powered = 0;
|
||||
|
||||
DPRINTF(("usbd_new_device: new dev (addr %d), dev=%p, parent=%p\n",
|
||||
DPRINTF(("usbd_new_device: new dev (addr %d), dev=%p, parent=%p\n",
|
||||
addr, dev, parent));
|
||||
|
||||
err = usbd_probe_and_attach(parent, dev, port, addr);
|
||||
@ -1104,7 +1104,7 @@ usbd_new_device(device_ptr_t parent, usbd_bus_handle bus, int depth,
|
||||
}
|
||||
|
||||
usbd_add_dev_event(USB_EVENT_DEVICE_ATTACH, dev);
|
||||
|
||||
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
}
|
||||
|
||||
@ -1134,7 +1134,7 @@ void
|
||||
usbd_remove_device(usbd_device_handle dev, struct usbd_port *up)
|
||||
{
|
||||
DPRINTF(("usbd_remove_device: %p\n", dev));
|
||||
|
||||
|
||||
if (dev->default_pipe != NULL)
|
||||
usbd_kill_pipe(dev->default_pipe);
|
||||
up->device = 0;
|
||||
@ -1164,7 +1164,7 @@ usbd_print(void *aux, const char *pnp)
|
||||
if (uaa->ifaceno != UHUB_UNK_INTERFACE)
|
||||
printf(" interface %d", uaa->ifaceno);
|
||||
#if 0
|
||||
/*
|
||||
/*
|
||||
* It gets very crowded with these locators on the attach line.
|
||||
* They are not really needed since they are printed in the clear
|
||||
* by each driver.
|
||||
@ -1274,7 +1274,7 @@ usbd_fill_deviceinfo(usbd_device_handle dev, struct usb_device_info *di,
|
||||
di->udi_devnames[i][0] = 0; /* empty */
|
||||
|
||||
if (dev->hub) {
|
||||
for (i = 0;
|
||||
for (i = 0;
|
||||
i < sizeof(di->udi_ports) / sizeof(di->udi_ports[0]) &&
|
||||
i < dev->hub->hubdesc.bNbrPorts;
|
||||
i++) {
|
||||
@ -1343,7 +1343,7 @@ usb_disconnect_port(struct usbd_port *up, device_ptr_t parent)
|
||||
const char *hubname = USBDEVPTRNAME(parent);
|
||||
int i;
|
||||
|
||||
DPRINTFN(3,("uhub_disconnect: up=%p dev=%p port=%d\n",
|
||||
DPRINTFN(3,("uhub_disconnect: up=%p dev=%p port=%d\n",
|
||||
up, dev, up->portno));
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
@ -1356,7 +1356,7 @@ usb_disconnect_port(struct usbd_port *up, device_ptr_t parent)
|
||||
if (dev->subdevs != NULL) {
|
||||
DPRINTFN(3,("usb_disconnect_port: disconnect subdevs\n"));
|
||||
for (i = 0; dev->subdevs[i]; i++) {
|
||||
printf("%s: at %s", USBDEVPTRNAME(dev->subdevs[i]),
|
||||
printf("%s: at %s", USBDEVPTRNAME(dev->subdevs[i]),
|
||||
hubname);
|
||||
if (up->portno != 0)
|
||||
printf(" port %d", up->portno);
|
||||
|
@ -253,7 +253,7 @@ vendor MCT 0x0711 MCT
|
||||
vendor DIGITALSTREAM 0x074e Digital Stream
|
||||
vendor AUREAL 0x0755 Aureal Semiconductor
|
||||
vendor MIDIMAN 0x0763 Midiman
|
||||
vendor LINKSYS2 0x077b Linksys
|
||||
vendor LINKSYS2 0x077b Linksys
|
||||
vendor GRIFFIN 0x077d Griffin Technology
|
||||
vendor SANDISK 0x0781 SanDisk Corp
|
||||
vendor BRIMAX 0x078e Brimax
|
||||
@ -819,7 +819,7 @@ product LOGITECH UN58A 0xc030 iFeel Mouse
|
||||
product LOGITECH BB13 0xc401 USB-PS/2 Trackball
|
||||
product LOGITECH WMPAD 0xc208 WingMan GamePad Extreme
|
||||
product LOGITECH WMRPAD 0xc20a WingMan RumblePad
|
||||
product LOGITECH WMJOY 0xc281 WingMan Force joystick
|
||||
product LOGITECH WMJOY 0xc281 WingMan Force joystick
|
||||
product LOGITECH RK53 0xc501 Cordless mouse
|
||||
product LOGITECH RB6 0xc503 Cordless keyboard
|
||||
product LOGITECH MX700 0xc506 Cordless optical mouse
|
||||
@ -1007,7 +1007,7 @@ product QTRONIX 980N 0x2011 Scorpion-980N keyboard
|
||||
product QUICKSHOT STRIKEPAD 0x6238 USB StrikePad
|
||||
|
||||
/* Rainbow Technologies products */
|
||||
product RAINBOW IKEY2000 0x1200 i-Key 2000
|
||||
product RAINBOW IKEY2000 0x1200 i-Key 2000
|
||||
|
||||
/* ReakTek products */
|
||||
product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet (GREEN HOUSE)
|
||||
@ -1113,7 +1113,7 @@ product DIAMOND2 RIO800USB 0x5002 Rio 800 USB
|
||||
|
||||
/* Taugagreining products */
|
||||
product TAUGA CAMERAMATE 0x0005 CameraMate (DPCM_USB)
|
||||
|
||||
|
||||
/* TDK products */
|
||||
product TDK UPA9664 0x0115 USB-PDC Adapter UPA9664
|
||||
product TDK UCA1464 0x0116 USB-cdmaOne Adapter UCA1464
|
||||
@ -1162,13 +1162,13 @@ product VISIONEER 6100 0x0231 OneTouch 6100
|
||||
product VISIONEER 6200 0x0311 OneTouch 6200
|
||||
product VISIONEER 8100 0x0321 OneTouch 8100
|
||||
product VISIONEER 8600 0x0331 OneTouch 8600
|
||||
|
||||
|
||||
/* Wacom products */
|
||||
product WACOM CT0405U 0x0000 CT-0405-U Tablet
|
||||
product WACOM GRAPHIRE 0x0010 Graphire
|
||||
product WACOM INTUOSA5 0x0021 Intuos A5
|
||||
product WACOM GD0912U 0x0022 Intuos 9x12 Graphics Tablet
|
||||
|
||||
|
||||
/* Xirlink products */
|
||||
product XIRLINK PCCAM 0x8080 IBM PC Camera
|
||||
|
||||
|
@ -76,7 +76,7 @@ extern int usbdebug;
|
||||
#endif
|
||||
|
||||
Static usbd_status usbd_ar_pipe(usbd_pipe_handle pipe);
|
||||
Static void usbd_do_request_async_cb
|
||||
Static void usbd_do_request_async_cb
|
||||
(usbd_xfer_handle, usbd_private_handle, usbd_status);
|
||||
Static void usbd_start_next(usbd_pipe_handle pipe);
|
||||
Static usbd_status usbd_open_pipe_ival
|
||||
@ -173,18 +173,18 @@ usbd_dump_pipe(usbd_pipe_handle pipe)
|
||||
}
|
||||
#endif
|
||||
|
||||
usbd_status
|
||||
usbd_status
|
||||
usbd_open_pipe(usbd_interface_handle iface, u_int8_t address,
|
||||
u_int8_t flags, usbd_pipe_handle *pipe)
|
||||
{
|
||||
return (usbd_open_pipe_ival(iface, address, flags, pipe,
|
||||
{
|
||||
return (usbd_open_pipe_ival(iface, address, flags, pipe,
|
||||
USBD_DEFAULT_INTERVAL));
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_status
|
||||
usbd_open_pipe_ival(usbd_interface_handle iface, u_int8_t address,
|
||||
u_int8_t flags, usbd_pipe_handle *pipe, int ival)
|
||||
{
|
||||
{
|
||||
usbd_pipe_handle p;
|
||||
struct usbd_endpoint *ep;
|
||||
usbd_status err;
|
||||
@ -212,7 +212,7 @@ usbd_open_pipe_ival(usbd_interface_handle iface, u_int8_t address,
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_status
|
||||
usbd_open_pipe_intr(usbd_interface_handle iface, u_int8_t address,
|
||||
u_int8_t flags, usbd_pipe_handle *pipe,
|
||||
usbd_private_handle priv, void *buffer, u_int32_t len,
|
||||
@ -225,7 +225,7 @@ usbd_open_pipe_intr(usbd_interface_handle iface, u_int8_t address,
|
||||
DPRINTFN(3,("usbd_open_pipe_intr: address=0x%x flags=0x%x len=%d\n",
|
||||
address, flags, len));
|
||||
|
||||
err = usbd_open_pipe_ival(iface, address, USBD_EXCLUSIVE_USE,
|
||||
err = usbd_open_pipe_ival(iface, address, USBD_EXCLUSIVE_USE,
|
||||
&ipipe, ival);
|
||||
if (err)
|
||||
return (err);
|
||||
@ -312,7 +312,7 @@ usbd_transfer(usbd_xfer_handle xfer)
|
||||
}
|
||||
|
||||
/* Copy data if going out. */
|
||||
if (!(xfer->flags & USBD_NO_COPY) && size != 0 &&
|
||||
if (!(xfer->flags & USBD_NO_COPY) && size != 0 &&
|
||||
!usbd_xfer_isread(xfer))
|
||||
memcpy(KERNADDR(dmap, 0), xfer->buffer, size);
|
||||
|
||||
@ -390,7 +390,7 @@ usbd_get_buffer(usbd_xfer_handle xfer)
|
||||
return (KERNADDR(&xfer->dmabuf, 0));
|
||||
}
|
||||
|
||||
usbd_xfer_handle
|
||||
usbd_xfer_handle
|
||||
usbd_alloc_xfer(usbd_device_handle dev)
|
||||
{
|
||||
usbd_xfer_handle xfer;
|
||||
@ -404,7 +404,7 @@ usbd_alloc_xfer(usbd_device_handle dev)
|
||||
return (xfer);
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_status
|
||||
usbd_free_xfer(usbd_xfer_handle xfer)
|
||||
{
|
||||
DPRINTFN(5,("usbd_free_xfer: %p\n", xfer));
|
||||
@ -531,7 +531,7 @@ usbd_interface2endpoint_descriptor(usbd_interface_handle iface, u_int8_t index)
|
||||
return (iface->endpoints[index].edesc);
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_status
|
||||
usbd_abort_pipe(usbd_pipe_handle pipe)
|
||||
{
|
||||
usbd_status err;
|
||||
@ -548,8 +548,8 @@ usbd_abort_pipe(usbd_pipe_handle pipe)
|
||||
splx(s);
|
||||
return (err);
|
||||
}
|
||||
|
||||
usbd_status
|
||||
|
||||
usbd_status
|
||||
usbd_clear_endpoint_stall(usbd_pipe_handle pipe)
|
||||
{
|
||||
usbd_device_handle dev = pipe->device;
|
||||
@ -558,7 +558,7 @@ usbd_clear_endpoint_stall(usbd_pipe_handle pipe)
|
||||
|
||||
DPRINTFN(8, ("usbd_clear_endpoint_stall\n"));
|
||||
|
||||
/*
|
||||
/*
|
||||
* Clearing en endpoint stall resets the endpoint toggle, so
|
||||
* do the same to the HC toggle.
|
||||
*/
|
||||
@ -580,7 +580,7 @@ XXX should we do this?
|
||||
return (err);
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_status
|
||||
usbd_clear_endpoint_stall_async(usbd_pipe_handle pipe)
|
||||
{
|
||||
usbd_device_handle dev = pipe->device;
|
||||
@ -604,7 +604,7 @@ usbd_clear_endpoint_toggle(usbd_pipe_handle pipe)
|
||||
pipe->methods->cleartoggle(pipe);
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_status
|
||||
usbd_endpoint_count(usbd_interface_handle iface, u_int8_t *count)
|
||||
{
|
||||
#ifdef DIAGNOSTIC
|
||||
@ -617,7 +617,7 @@ usbd_endpoint_count(usbd_interface_handle iface, u_int8_t *count)
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_status
|
||||
usbd_interface_count(usbd_device_handle dev, u_int8_t *count)
|
||||
{
|
||||
if (dev->cdesc == NULL)
|
||||
@ -633,7 +633,7 @@ usbd_interface2device_handle(usbd_interface_handle iface,
|
||||
*dev = iface->device;
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_status
|
||||
usbd_device2interface_handle(usbd_device_handle dev,
|
||||
u_int8_t ifaceno, usbd_interface_handle *iface)
|
||||
{
|
||||
@ -696,7 +696,7 @@ usbd_get_no_alts(usb_config_descriptor_t *cdesc, int ifaceno)
|
||||
|
||||
for (n = 0; p < end; p += d->bLength) {
|
||||
d = (usb_interface_descriptor_t *)p;
|
||||
if (p + d->bLength <= end &&
|
||||
if (p + d->bLength <= end &&
|
||||
d->bDescriptorType == UDESC_INTERFACE &&
|
||||
d->bInterfaceNumber == ifaceno)
|
||||
n++;
|
||||
@ -741,7 +741,7 @@ usbd_ar_pipe(usbd_pipe_handle pipe)
|
||||
pipe->repeat = 0;
|
||||
pipe->aborting = 1;
|
||||
while ((xfer = SIMPLEQ_FIRST(&pipe->queue)) != NULL) {
|
||||
DPRINTFN(2,("usbd_ar_pipe: pipe=%p xfer=%p (methods=%p)\n",
|
||||
DPRINTFN(2,("usbd_ar_pipe: pipe=%p xfer=%p (methods=%p)\n",
|
||||
pipe, xfer, pipe->methods));
|
||||
/* Make the HC abort it (and invoke the callback). */
|
||||
pipe->methods->abort(xfer);
|
||||
@ -764,7 +764,6 @@ usb_transfer_complete(usbd_xfer_handle xfer)
|
||||
|
||||
DPRINTFN(5, ("usb_transfer_complete: pipe=%p xfer=%p status=%d "
|
||||
"actlen=%d\n", pipe, xfer, xfer->status, xfer->actlen));
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (xfer->busy_free != XFER_ONQU) {
|
||||
printf("usb_transfer_complete: xfer=%p not busy 0x%08x\n",
|
||||
@ -815,7 +814,7 @@ usb_transfer_complete(usbd_xfer_handle xfer)
|
||||
#endif
|
||||
SIMPLEQ_REMOVE_HEAD(&pipe->queue, xfer, next);
|
||||
}
|
||||
DPRINTFN(5,("usb_transfer_complete: repeat=%d new head=%p\n",
|
||||
DPRINTFN(5,("usb_transfer_complete: repeat=%d new head=%p\n",
|
||||
repeat, SIMPLEQ_FIRST(&pipe->queue)));
|
||||
|
||||
/* Count completed transfers. */
|
||||
@ -863,7 +862,7 @@ usb_insert_transfer(usbd_xfer_handle xfer)
|
||||
usbd_status err;
|
||||
int s;
|
||||
|
||||
DPRINTFN(5,("usb_insert_transfer: pipe=%p running=%d timeout=%d\n",
|
||||
DPRINTFN(5,("usb_insert_transfer: pipe=%p running=%d timeout=%d\n",
|
||||
pipe, pipe->running, xfer->timeout));
|
||||
#ifdef DIAGNOSTIC
|
||||
if (xfer->busy_free != XFER_BUSY) {
|
||||
@ -967,14 +966,14 @@ usbd_do_request_flags_pipe(usbd_device_handle dev, usbd_pipe_handle pipe,
|
||||
"%02x val=%d index=%d rlen=%d length=%d actlen=%d\n",
|
||||
dev->address, xfer->request.bmRequestType,
|
||||
xfer->request.bRequest, UGETW(xfer->request.wValue),
|
||||
UGETW(xfer->request.wIndex),
|
||||
UGETW(xfer->request.wLength),
|
||||
UGETW(xfer->request.wIndex),
|
||||
UGETW(xfer->request.wLength),
|
||||
xfer->length, xfer->actlen));
|
||||
#endif
|
||||
if (actlen != NULL)
|
||||
*actlen = xfer->actlen;
|
||||
if (err == USBD_STALLED) {
|
||||
/*
|
||||
/*
|
||||
* The control endpoint has stalled. Control endpoints
|
||||
* should not halt, but some may do so anyway so clear
|
||||
* any halt condition.
|
||||
@ -1024,11 +1023,11 @@ usbd_do_request_async_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
|
||||
if (xfer->actlen > xfer->length)
|
||||
DPRINTF(("usbd_do_request: overrun addr=%d type=0x%02x req=0x"
|
||||
"%02x val=%d index=%d rlen=%d length=%d actlen=%d\n",
|
||||
xfer->pipe->device->address,
|
||||
xfer->pipe->device->address,
|
||||
xfer->request.bmRequestType,
|
||||
xfer->request.bRequest, UGETW(xfer->request.wValue),
|
||||
UGETW(xfer->request.wIndex),
|
||||
UGETW(xfer->request.wLength),
|
||||
UGETW(xfer->request.wIndex),
|
||||
UGETW(xfer->request.wLength),
|
||||
xfer->length, xfer->actlen));
|
||||
#endif
|
||||
usbd_free_xfer(xfer);
|
||||
@ -1148,7 +1147,7 @@ int
|
||||
usbd_driver_load(module_t mod, int what, void *arg)
|
||||
{
|
||||
/* XXX should implement something like a function that removes all generic devices */
|
||||
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ typedef struct usbd_pipe *usbd_pipe_handle;
|
||||
typedef struct usbd_xfer *usbd_xfer_handle;
|
||||
typedef void *usbd_private_handle;
|
||||
|
||||
typedef enum { /* keep in sync with usbd_status_msgs */
|
||||
typedef enum { /* keep in sync with usbd_status_msgs */
|
||||
USBD_NORMAL_COMPLETION = 0, /* must be 0 */
|
||||
USBD_IN_PROGRESS, /* 1 */
|
||||
/* errors */
|
||||
@ -138,7 +138,7 @@ usbd_status usbd_do_request(usbd_device_handle pipe, usb_device_request_t *req,
|
||||
usbd_status usbd_do_request_async(usbd_device_handle pipe,
|
||||
usb_device_request_t *req, void *data);
|
||||
usbd_status usbd_do_request_flags(usbd_device_handle pipe,
|
||||
usb_device_request_t *req,
|
||||
usb_device_request_t *req,
|
||||
void *data, u_int16_t flags, int*, u_int32_t);
|
||||
usbd_status usbd_do_request_flags_pipe(
|
||||
usbd_device_handle dev, usbd_pipe_handle pipe,
|
||||
@ -157,7 +157,7 @@ int usbd_get_interface_altindex(usbd_interface_handle iface);
|
||||
usb_interface_descriptor_t *usbd_find_idesc(usb_config_descriptor_t *cd,
|
||||
int iindex, int ano);
|
||||
usb_endpoint_descriptor_t *usbd_find_edesc(usb_config_descriptor_t *cd,
|
||||
int ifaceidx, int altidx,
|
||||
int ifaceidx, int altidx,
|
||||
int endptidx);
|
||||
|
||||
void usbd_dopoll(usbd_interface_handle);
|
||||
|
@ -87,7 +87,7 @@ usbd_get_config_desc(usbd_device_handle dev, int confidx,
|
||||
usbd_status err;
|
||||
|
||||
DPRINTFN(3,("usbd_get_config_desc: confidx=%d\n", confidx));
|
||||
err = usbd_get_desc(dev, UDESC_CONFIG, confidx,
|
||||
err = usbd_get_desc(dev, UDESC_CONFIG, confidx,
|
||||
USB_CONFIG_DESCRIPTOR_SIZE, d);
|
||||
if (err)
|
||||
return (err);
|
||||
@ -111,7 +111,7 @@ usbd_status
|
||||
usbd_get_device_desc(usbd_device_handle dev, usb_device_descriptor_t *d)
|
||||
{
|
||||
DPRINTFN(3,("usbd_get_device_desc:\n"));
|
||||
return (usbd_get_desc(dev, UDESC_DEVICE,
|
||||
return (usbd_get_desc(dev, UDESC_DEVICE,
|
||||
0, USB_DEVICE_DESCRIPTOR_SIZE, d));
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ usbd_get_device_status(usbd_device_handle dev, usb_status_t *st)
|
||||
USETW(req.wIndex, 0);
|
||||
USETW(req.wLength, sizeof(usb_status_t));
|
||||
return (usbd_do_request(dev, &req, st));
|
||||
}
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_get_hub_status(usbd_device_handle dev, usb_hub_status_t *st)
|
||||
@ -139,7 +139,7 @@ usbd_get_hub_status(usbd_device_handle dev, usb_hub_status_t *st)
|
||||
USETW(req.wIndex, 0);
|
||||
USETW(req.wLength, sizeof(usb_hub_status_t));
|
||||
return (usbd_do_request(dev, &req, st));
|
||||
}
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_set_address(usbd_device_handle dev, int addr)
|
||||
@ -390,7 +390,7 @@ usbd_read_report_desc(usbd_interface_handle ifc, void **descp, int *sizep,
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
}
|
||||
|
||||
usbd_status
|
||||
usbd_status
|
||||
usbd_get_config(usbd_device_handle dev, u_int8_t *conf)
|
||||
{
|
||||
usb_device_request_t req;
|
||||
@ -403,7 +403,7 @@ usbd_get_config(usbd_device_handle dev, u_int8_t *conf)
|
||||
return (usbd_do_request(dev, &req, conf));
|
||||
}
|
||||
|
||||
Static void usbd_bulk_transfer_cb(usbd_xfer_handle xfer,
|
||||
Static void usbd_bulk_transfer_cb(usbd_xfer_handle xfer,
|
||||
usbd_private_handle priv, usbd_status status);
|
||||
Static void
|
||||
usbd_bulk_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
|
||||
@ -445,7 +445,7 @@ usbd_bulk_transfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
|
||||
return (err);
|
||||
}
|
||||
|
||||
Static void usbd_intr_transfer_cb(usbd_xfer_handle xfer,
|
||||
Static void usbd_intr_transfer_cb(usbd_xfer_handle xfer,
|
||||
usbd_private_handle priv, usbd_status status);
|
||||
Static void
|
||||
usbd_intr_transfer_cb(usbd_xfer_handle xfer, usbd_private_handle priv,
|
||||
@ -495,11 +495,11 @@ usb_detach_wait(device_ptr_t dv)
|
||||
printf("usb_detach_wait: %s didn't detach\n",
|
||||
USBDEVPTRNAME(dv));
|
||||
DPRINTF(("usb_detach_wait: %s done\n", USBDEVPTRNAME(dv)));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
usb_detach_wakeup(device_ptr_t dv)
|
||||
{
|
||||
DPRINTF(("usb_detach_wakeup: for %s\n", USBDEVPTRNAME(dv)));
|
||||
wakeup(dv);
|
||||
}
|
||||
}
|
||||
|
@ -38,15 +38,15 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
usbd_status usbd_get_desc(usbd_device_handle dev, int type,
|
||||
usbd_status usbd_get_desc(usbd_device_handle dev, int type,
|
||||
int index, int len, void *desc);
|
||||
usbd_status usbd_get_config_desc(usbd_device_handle, int,
|
||||
usbd_status usbd_get_config_desc(usbd_device_handle, int,
|
||||
usb_config_descriptor_t *);
|
||||
usbd_status usbd_get_config_desc_full(usbd_device_handle, int, void *, int);
|
||||
usbd_status usbd_get_device_desc(usbd_device_handle dev,
|
||||
usb_device_descriptor_t *d);
|
||||
usbd_status usbd_set_address(usbd_device_handle dev, int addr);
|
||||
usbd_status usbd_get_port_status(usbd_device_handle,
|
||||
usbd_status usbd_get_port_status(usbd_device_handle,
|
||||
int, usb_port_status_t *);
|
||||
usbd_status usbd_set_hub_feature(usbd_device_handle dev, int);
|
||||
usbd_status usbd_clear_hub_feature(usbd_device_handle, int);
|
||||
|
@ -243,9 +243,9 @@ usbd_status usbd_setup_pipe(usbd_device_handle dev,
|
||||
usbd_interface_handle iface,
|
||||
struct usbd_endpoint *, int,
|
||||
usbd_pipe_handle *pipe);
|
||||
usbd_status usbd_new_device(device_ptr_t parent,
|
||||
usbd_status usbd_new_device(device_ptr_t parent,
|
||||
usbd_bus_handle bus, int depth,
|
||||
int lowspeed, int port,
|
||||
int lowspeed, int port,
|
||||
struct usbd_port *);
|
||||
void usbd_remove_device(usbd_device_handle, struct usbd_port *);
|
||||
int usbd_printBCD(char *cp, int bcd);
|
||||
|
@ -211,7 +211,7 @@ static const struct uvisor_type uvisor_devs[] = {
|
||||
USB_MATCH(uvisor)
|
||||
{
|
||||
USB_MATCH_START(uvisor, uaa);
|
||||
|
||||
|
||||
if (uaa->iface != NULL)
|
||||
return (UMATCH_NONE);
|
||||
|
||||
@ -285,7 +285,7 @@ USB_ATTACH(uvisor)
|
||||
": %s\n", devname, usbd_errstr(err));
|
||||
goto bad;
|
||||
}
|
||||
|
||||
|
||||
addr = ed->bEndpointAddress;
|
||||
dir = UE_GET_DIR(ed->bEndpointAddress);
|
||||
attr = ed->bmAttributes & UE_XFERTYPE;
|
||||
@ -308,7 +308,7 @@ USB_ATTACH(uvisor)
|
||||
USBDEVNAME(ucom->sc_dev));
|
||||
goto bad;
|
||||
}
|
||||
|
||||
|
||||
ucom->sc_parent = sc;
|
||||
ucom->sc_portno = UCOM_UNK_PORTNO;
|
||||
/* bulkin, bulkout set above */
|
||||
@ -423,7 +423,7 @@ uvisor_init(struct uvisor_softc *sc)
|
||||
break;
|
||||
default:
|
||||
string = "unknown";
|
||||
break;
|
||||
break;
|
||||
}
|
||||
printf("%s: port %d, is for %s\n",
|
||||
USBDEVNAME(sc->sc_ucom.sc_dev), coninfo.connections[i].port,
|
||||
|
@ -690,7 +690,7 @@ uvscom_param(void *addr, int portno, struct termios *t)
|
||||
default:
|
||||
return (EIO);
|
||||
}
|
||||
|
||||
|
||||
if (ISSET(t->c_cflag, CSTOPB))
|
||||
SET(ls, UVSCOM_STOP_BIT_2);
|
||||
else
|
||||
@ -740,7 +740,7 @@ uvscom_open(void *addr, int portno)
|
||||
struct uvscom_softc *sc = addr;
|
||||
int err;
|
||||
int i;
|
||||
|
||||
|
||||
if (sc->sc_ucom.sc_dying)
|
||||
return (ENXIO);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user