summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/ukbd.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-11-17 22:33:51 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-11-17 22:33:51 +0000
commitaeb2d2626b24c89dbb68adb9caebd10bbe02dd43 (patch)
tree4ffabed555c86f3e004db50f4d745f46d25b77c9 /sys/dev/usb/ukbd.c
parenta586d3a066b64caa068a9a83440201f39e4d6677 (diff)
downloadFreeBSD-src-aeb2d2626b24c89dbb68adb9caebd10bbe02dd43.zip
FreeBSD-src-aeb2d2626b24c89dbb68adb9caebd10bbe02dd43.tar.gz
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.
Diffstat (limited to 'sys/dev/usb/ukbd.c')
-rw-r--r--sys/dev/usb/ukbd.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index 5ff4af6..2870031 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -1,4 +1,3 @@
-/* $NetBSD: ukbd.c,v 1.22 1999/01/09 12:10:36 drochner Exp $ */
/* $FreeBSD$ */
/*
@@ -112,7 +111,7 @@ typedef struct ukbd_softc {
#define UKBD_CHUNK 128 /* chunk size for read */
#define UKBD_BSIZE 1020 /* buffer size */
-typedef void usbd_intr_t(usbd_request_handle, usbd_private_handle, usbd_status);
+typedef void usbd_intr_t(usbd_xfer_handle, usbd_private_handle, usbd_status);
typedef void usbd_disco_t(void *);
static usbd_intr_t ukbd_intr;
@@ -209,7 +208,7 @@ ukbd_detach(device_t self)
}
void
-ukbd_intr(usbd_request_handle reqh, usbd_private_handle addr, usbd_status status)
+ukbd_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
{
keyboard_t *kbd = (keyboard_t *)addr;
@@ -582,7 +581,7 @@ static int
ukbd_enable_intr(keyboard_t *kbd, int on, usbd_intr_t *func)
{
ukbd_state_t *state = (ukbd_state_t *)kbd->kb_data;
- usbd_status r;
+ usbd_status err;
if (on) {
/* Set up interrupt pipe. */
@@ -590,12 +589,12 @@ ukbd_enable_intr(keyboard_t *kbd, int on, usbd_intr_t *func)
return EBUSY;
state->ks_ifstate |= INTRENABLED;
- r = 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,
sizeof(state->ks_ndata), func);
- if (r != USBD_NORMAL_COMPLETION)
+ if (err)
return (EIO);
} else {
/* Disable interrupts. */
@@ -1333,7 +1332,7 @@ static int
init_keyboard(ukbd_state_t *state, int *type, int flags)
{
usb_endpoint_descriptor_t *ed;
- usbd_status r;
+ usbd_status err;
*type = KB_OTHER;
@@ -1360,9 +1359,9 @@ bLength=%d bDescriptorType=%d bEndpointAddress=%d-%s bmAttributes=%d wMaxPacketS
}
if ((usbd_get_quirks(state->ks_uaa->device)->uq_flags & UQ_NO_SET_PROTO) == 0) {
- r = usbd_set_protocol(state->ks_iface, 0);
+ err = usbd_set_protocol(state->ks_iface, 0);
DPRINTFN(5, ("ukbd:init_keyboard: protocol set\n"));
- if (r != USBD_NORMAL_COMPLETION) {
+ if (err) {
printf("ukbd: set protocol failed\n");
return EIO;
}
OpenPOWER on IntegriCloud