summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/ehcivar.h
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2004-08-01 18:47:42 +0000
committeriedowse <iedowse@FreeBSD.org>2004-08-01 18:47:42 +0000
commitdd6baeae21e40c4ea5d22744f1b41c51570092d5 (patch)
tree15fea320111adaab51158840c3306ba00eb24766 /sys/dev/usb/ehcivar.h
parent1a5b1bba74b02553b25e928fb7ee6688dc88927f (diff)
downloadFreeBSD-src-dd6baeae21e40c4ea5d22744f1b41c51570092d5.zip
FreeBSD-src-dd6baeae21e40c4ea5d22744f1b41c51570092d5.tar.gz
Implement basic support for EHCI interrupt pipes. This is unlikely
to be particularly correct or optimal, but it seems to be enough to allow the attachment of USB2 hubs and USB2 devices connected via USB2 hubs. None of the split transaction support is implemented in our USB stack, so USB1 peripherals will definitely not work when connected via USB2 hubs.
Diffstat (limited to 'sys/dev/usb/ehcivar.h')
-rw-r--r--sys/dev/usb/ehcivar.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/dev/usb/ehcivar.h b/sys/dev/usb/ehcivar.h
index c743d93..046c329 100644
--- a/sys/dev/usb/ehcivar.h
+++ b/sys/dev/usb/ehcivar.h
@@ -53,6 +53,7 @@ typedef struct ehci_soft_qh {
struct ehci_soft_qh *next;
struct ehci_soft_qtd *sqtd;
ehci_physaddr_t physaddr;
+ int islot; /* Interrupt list slot. */
} ehci_soft_qh_t;
#define EHCI_SQH_SIZE ((sizeof (struct ehci_soft_qh) + EHCI_QH_ALIGN - 1) / EHCI_QH_ALIGN * EHCI_QH_ALIGN)
#define EHCI_SQH_CHUNK (EHCI_PAGE_SIZE / EHCI_SQH_SIZE)
@@ -69,6 +70,19 @@ struct ehci_xfer {
};
#define EXFER(xfer) ((struct ehci_xfer *)(xfer))
+/*
+ * Information about an entry in the interrupt list.
+ */
+struct ehci_soft_islot {
+ ehci_soft_qh_t *sqh; /* Queue Head. */
+};
+
+#define EHCI_FRAMELIST_MAXCOUNT 1024
+#define EHCI_IPOLLRATES 8 /* Poll rates (1ms, 2, 4, 8 ... 128) */
+#define EHCI_INTRQHS ((1 << EHCI_IPOLLRATES) - 1)
+#define EHCI_IQHIDX(lev, pos) \
+ ((((pos) & ((1 << (lev)) - 1)) | (1 << (lev))) - 1)
+#define EHCI_ILEV_IVAL(lev) (1 << (lev))
#define EHCI_HASH_SIZE 128
#define EHCI_COMPANION_MAX 8
@@ -99,8 +113,11 @@ typedef struct ehci_softc {
struct usbd_bus *sc_comps[EHCI_COMPANION_MAX];
usb_dma_t sc_fldma;
+ ehci_link_t *sc_flist;
u_int sc_flsize;
+ struct ehci_soft_islot sc_islots[EHCI_INTRQHS];
+
LIST_HEAD(, ehci_xfer) sc_intrhead;
ehci_soft_qh_t *sc_freeqhs;
OpenPOWER on IntegriCloud