diff options
author | Nick Hibma <n_hibma@FreeBSD.org> | 1999-11-17 22:33:51 +0000 |
---|---|---|
committer | Nick Hibma <n_hibma@FreeBSD.org> | 1999-11-17 22:33:51 +0000 |
commit | 3241be755096a340cd6ba126b6d88e362ad03b71 (patch) | |
tree | 4ffabed555c86f3e004db50f4d745f46d25b77c9 /sys/dev/usb/ohcivar.h | |
parent | 6a54425c861042fa638f888c26d8520c095b889f (diff) | |
download | src-3241be755096a340cd6ba126b6d88e362ad03b71.tar.gz src-3241be755096a340cd6ba126b6d88e362ad03b71.zip |
Synchronisation with NetBSD as of 1999/11/16:
Cleaning up the code:
- Declare many functions static
- Change variable names to make them more self explanatory
- Change usbd_request_handle -> usbd_xfer_handle
- Syntactical changes
- Remove some unused code
- Other KNF changes
Interrupt context handling
- Change delay to usbd_delay_ms were possible (takes polling mode into
account)
- Change detection mechanism for interrupt context
Add support for pre-allocation DMA-able memory by device driver
Add preliminary support for isochronous to the UHCI driver (not for OHCI
yet).
usb.c, uhci.c, ohci.c
- Initial attempt at detachable USB host controllers
- Handle the use_polling flag with a lttle more care and only set it if
we are cold booting.
usb.c, uhci.c ohci.c, usbdi.c usbdi_util.c usb_subr.c
- Make sure an aborted pipe is marked as not running.
- Start queued request in the right order.
- Insert some more DIAGNOSTIC sanity checks.
- Remove (almost) unused definitions USBD_XFER_OUT and USBD_XFER_IN.
usb.c, usb_subr.c
- Add an event mechanism so that a userland process can watch devices
come and go.
ohci.c
- Handle the case when a USB transfer is so long that it crosses two
page (4K) boundaries. OHCI cannot do that with a single TD so we make
a chain.
ulpt.c
- Use a bigger buffer when transferring data.
- Pre-allocate the DMA buffer. This makes the driver slightly more
efficient.
- Comment out the GET_DEVICE_ID code, because for some unknown reason it
causes printing to fail sometimes.
usb.h
- Add a macro to extract the isoc type.
- Add a macro to check whether the routine has been entered after splusb
and if not, complain.
usbdi.c
- Fix a glitch in dequeueing and aborting requests on interrupt pipes.
- Add a flag in the request to determine if the data copying is done by
the driver or the usbdi layer.
Notes
Notes:
svn path=/head/; revision=53313
Diffstat (limited to 'sys/dev/usb/ohcivar.h')
-rw-r--r-- | sys/dev/usb/ohcivar.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h index b0abd151de74..cd61ee6fd397 100644 --- a/sys/dev/usb/ohcivar.h +++ b/sys/dev/usb/ohcivar.h @@ -1,5 +1,5 @@ -/* $NetBSD: ohcivar.h,v 1.8 1999/08/22 23:41:00 augustss Exp $ */ -/* $FreeBSD$ */ +/* $NetBSD: ohcivar.h,v 1.13 1999/10/13 08:10:55 augustss Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -52,11 +52,11 @@ typedef struct ohci_soft_td { struct ohci_soft_td *dnext; /* next in done list */ ohci_physaddr_t physaddr; LIST_ENTRY(ohci_soft_td) hnext; - usbd_request_handle reqh; + usbd_xfer_handle xfer; u_int16_t len; u_int16_t flags; #define OHCI_CALL_DONE 0x0001 -#define OHCI_SET_LEN 0x0002 +#define OHCI_ADD_LEN 0x0002 } ohci_soft_td_t; #define OHCI_STD_SIZE ((sizeof (struct ohci_soft_td) + OHCI_TD_ALIGN - 1) / OHCI_TD_ALIGN * OHCI_TD_ALIGN) #define OHCI_STD_CHUNK 128 @@ -69,12 +69,6 @@ typedef struct ohci_softc { struct usbd_bus sc_bus; /* base device */ bus_space_tag_t iot; bus_space_handle_t ioh; -#if defined(__NetBSD__) || defined(__OpenBSD__) - void *sc_ih; /* interrupt vectoring */ - - bus_dma_tag_t sc_dmatag; /* DMA tag */ - /* XXX should keep track of all DMA memory */ -#endif /* __NetBSD__ || defined(__OpenBSD__) */ usb_dma_t sc_hccadma; struct ohci_hcca *sc_hcca; @@ -94,15 +88,20 @@ typedef struct ohci_softc { ohci_soft_ed_t *sc_freeeds; ohci_soft_td_t *sc_freetds; - usbd_request_handle sc_intrreqh; - - int sc_intrs; + usbd_xfer_handle sc_intrxfer; char sc_vendor[16]; int sc_id_vendor; + + void *sc_powerhook; + device_ptr_t sc_child; } ohci_softc_t; usbd_status ohci_init __P((ohci_softc_t *)); int ohci_intr __P((void *)); +#if defined(__NetBSD__) || defined(__OpenBSD__) +int ohci_detach __P((ohci_softc_t *, int)); +int ohci_activate __P((device_ptr_t, enum devact)); +#endif #define MS_TO_TICKS(ms) ((ms) * hz / 1000) |