summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uhcivar.h
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>1999-08-27 09:00:31 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>1999-08-27 09:00:31 +0000
commitc6d969a5ffa607045a4b07b03b1fe4f278f5a5c2 (patch)
treed8ef2fc89f8ed5df12c8b5113f1ed266a160dc56 /sys/dev/usb/uhcivar.h
parentc79e6b116f4cd7baa14086e6fcda5e8b1f733082 (diff)
Sync with NetBSD;
Make sure not to call tsleep() from suspend/resume routine. Move more of the transfer completion processing to HC independent code. Fix some problems with transfer abort & timeout. Merge the soft_{td,qh} with the real {td,qh}. This saves time and space.
Diffstat (limited to 'sys/dev/usb/uhcivar.h')
-rw-r--r--sys/dev/usb/uhcivar.h46
1 files changed, 26 insertions, 20 deletions
diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h
index d81af2589af..6e3215ba2e3 100644
--- a/sys/dev/usb/uhcivar.h
+++ b/sys/dev/usb/uhcivar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uhcivar.h,v 1.2 1999/08/16 22:08:49 fgsch Exp $ */
-/* $NetBSD: uhcivar.h,v 1.7 1999/06/26 08:30:18 augustss Exp $ */
+/* $OpenBSD: uhcivar.h,v 1.3 1999/08/27 09:00:29 fgsch Exp $ */
+/* $NetBSD: uhcivar.h,v 1.12 1999/08/22 23:41:00 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -56,6 +56,11 @@
typedef struct uhci_soft_qh uhci_soft_qh_t;
typedef struct uhci_soft_td uhci_soft_td_t;
+typedef union {
+ struct uhci_soft_qh *sqh;
+ struct uhci_soft_td *std;
+} uhci_soft_td_qh_t;
+
/*
* An interrupt info struct contains the information needed to
* execute a requested routine when the controller generates an
@@ -81,28 +86,34 @@ typedef struct uhci_intr_info {
* Extra information that we need for a TD.
*/
struct uhci_soft_td {
- uhci_td_t *td; /* The real TD */
- uhci_physaddr_t physaddr; /* and its physical address. */
+ uhci_td_t td; /* The real TD, must be first */
+ uhci_soft_td_qh_t link; /* soft version of the td_link field */
+ uhci_physaddr_t physaddr; /* TD's physical address. */
};
-#define UHCI_TD_CHUNK 128 /*(PAGE_SIZE / UHCI_TD_SIZE)*/
+/*
+ * 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 TS well
+ * aligned.
+ * NOTE: Minimum size is 32 bytes.
+ */
+#define UHCI_STD_SIZE ((sizeof (struct uhci_soft_td) + UHCI_TD_ALIGN - 1) / UHCI_TD_ALIGN * UHCI_TD_ALIGN)
+#define UHCI_STD_CHUNK 128 /*(PAGE_SIZE / UHCI_TD_SIZE)*/
/*
* Extra information that we need for a QH.
*/
struct uhci_soft_qh {
- uhci_qh_t *qh; /* The real QH */
- uhci_physaddr_t physaddr; /* and its physical address. */
+ uhci_qh_t qh; /* The real QH, must be first */
+ uhci_soft_qh_t *hlink; /* soft version of qh_hlink */
+ uhci_soft_td_t *elink; /* soft version of qh_elink */
+ uhci_physaddr_t physaddr; /* QH's physical address. */
int pos; /* Timeslot position */
uhci_intr_info_t *intr_info; /* Who to call on completion. */
+/* XXX should try to shrink with 4 bytes to fit into 32 bytes */
};
-#define UHCI_QH_CHUNK 128 /*(PAGE_SIZE / UHCI_QH_SIZE)*/
-
-/* Only used for buffer free list. */
-struct uhci_buffer {
- struct uhci_buffer *next;
-};
-#define UHCI_BUFFER_SIZE 64
-#define UHCI_BUFFER_CHUNK 64 /*(PAGE_SIZE / UHCI_BUFFER_SIZE)*/
+/* See comment about UHCI_STD_SIZE. */
+#define UHCI_SQH_SIZE ((sizeof (struct uhci_soft_qh) + UHCI_QH_ALIGN - 1) / UHCI_QH_ALIGN * UHCI_QH_ALIGN)
+#define UHCI_SQH_CHUNK 128 /*(PAGE_SIZE / UHCI_QH_SIZE)*/
/*
* Information about an entry in the virtial frame list.
@@ -137,7 +148,6 @@ typedef struct uhci_softc {
uhci_soft_td_t *sc_freetds;
uhci_soft_qh_t *sc_freeqhs;
- struct uhci_buffer *sc_freebuffers;
u_int8_t sc_addr; /* device address */
u_int8_t sc_conf; /* device configuration */
@@ -157,10 +167,6 @@ typedef struct uhci_softc {
#define UHCI_HAS_LOCK 1
#define UHCI_WANT_LOCK 2
-#if defined(__NetBSD__) || defined(__OpenBSD__)
- usb_dma_t *sc_mallocs;
-#endif
-
char sc_vendor[16];
int sc_id_vendor;
} uhci_softc_t;