From 10b06464222e1b41e95bcd0c8476b8677aa91a23 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Wed, 21 Nov 2007 19:21:21 +0000 Subject: [PATCH] Implemented split transactions for control and bulk pipes in EHCI. With this it is possible to use low/fullspeed (USB 1.1) devices below USB 2.0 Hubs. Note though that you cannot yet use mice or keyboards attached to USB 2.0 Hubs as split transactions for interrupt pipes are still missing. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22973 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/busses/usb/ehci.cpp | 16 +++++++++------- src/add-ons/kernel/busses/usb/ehci_hardware.h | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/add-ons/kernel/busses/usb/ehci.cpp b/src/add-ons/kernel/busses/usb/ehci.cpp index 3b4296f7bf..89da0570a3 100644 --- a/src/add-ons/kernel/busses/usb/ehci.cpp +++ b/src/add-ons/kernel/busses/usb/ehci.cpp @@ -522,7 +522,6 @@ EHCI::AddTo(Stack *stack) } for (int32 i = 0; sPCIModule->get_nth_pci_info(i, item) >= B_OK; i++) { - if (item->class_base == PCI_serial_bus && item->class_sub == PCI_usb && item->class_api == PCI_usb_ehci) { if (item->u.h0.interrupt_line == 0 @@ -1205,21 +1204,24 @@ EHCI::InitQueueHead(ehci_qh *queueHead, Pipe *pipe) return B_ERROR; } - if (pipe->Type() & USB_OBJECT_CONTROL_PIPE) { - queueHead->endpoint_chars |= - (pipe->Speed() != USB_SPEED_HIGHSPEED ? EHCI_QH_CHARS_CONTROL : 0); - } - queueHead->endpoint_chars |= (3 << EHCI_QH_CHARS_RL_SHIFT) | (pipe->MaxPacketSize() << EHCI_QH_CHARS_MPL_SHIFT) | (pipe->EndpointAddress() << EHCI_QH_CHARS_EPT_SHIFT) | (pipe->DeviceAddress() << EHCI_QH_CHARS_DEV_SHIFT) | EHCI_QH_CHARS_TOGGLE; - queueHead->endpoint_caps = (1 << EHCI_QH_CAPS_MULT_SHIFT); + queueHead->endpoint_caps = (1 << EHCI_QH_CAPS_MULT_SHIFT); if (pipe->Type() & USB_OBJECT_INTERRUPT_PIPE) queueHead->endpoint_caps |= (0xff << EHCI_QH_CAPS_ISM_SHIFT); + if (pipe->Speed() != USB_SPEED_HIGHSPEED) { + if (pipe->Type() & USB_OBJECT_CONTROL_PIPE) + queueHead->endpoint_chars |= EHCI_QH_CHARS_CONTROL; + + queueHead->endpoint_caps |= (pipe->HubPort() << EHCI_QH_CAPS_PORT_SHIFT) + | (pipe->HubAddress() << EHCI_QH_CAPS_HUB_SHIFT); + } + return B_OK; } diff --git a/src/add-ons/kernel/busses/usb/ehci_hardware.h b/src/add-ons/kernel/busses/usb/ehci_hardware.h index 29731bace1..112bea8f32 100644 --- a/src/add-ons/kernel/busses/usb/ehci_hardware.h +++ b/src/add-ons/kernel/busses/usb/ehci_hardware.h @@ -224,9 +224,9 @@ typedef struct { // Applies to ehci_qh.endpoint_caps #define EHCI_QH_CAPS_MULT_SHIFT 30 // Transactions per Micro-Frame #define EHCI_QH_CAPS_MULT_MASK 0x03 -#define EHCI_QH_CAPS_PORT_SHIFT 23 // Port Number +#define EHCI_QH_CAPS_PORT_SHIFT 23 // Hub Port (Split-Transaction) #define EHCI_QH_CAPS_PORT_MASK 0x7f -#define EHCI_QH_CAPS_HUB_SHIFT 16 // Hub Address +#define EHCI_QH_CAPS_HUB_SHIFT 16 // Hub Address (Split-Transaction) #define EHCI_QH_CAPS_HUB_MASK 0x7f #define EHCI_QH_CAPS_SCM_SHIFT 8 // Split Completion Mask #define EHCI_QH_CAPS_SCM_MASK 0xff