From f891e74eeedcfc3e05f9d488b26180ae990901b8 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Mon, 22 Jan 2007 15:19:01 +0000 Subject: [PATCH] Fixed wrong usage of object types in OHCI. The types are bitmasks, not values. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19900 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/busses/usb/ohci.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/add-ons/kernel/busses/usb/ohci.cpp b/src/add-ons/kernel/busses/usb/ohci.cpp index cd59d52a44..cd36808a9e 100644 --- a/src/add-ons/kernel/busses/usb/ohci.cpp +++ b/src/add-ons/kernel/busses/usb/ohci.cpp @@ -617,23 +617,19 @@ OHCI::InsertEndpointForPipe(Pipe *p) //Check which list we need to add the endpoint in Endpoint *listhead; - switch (p->Type()) { - case USB_OBJECT_CONTROL_PIPE: + if (p->Type() & USB_OBJECT_CONTROL_PIPE) listhead = fDummyControl; - break; - case USB_OBJECT_BULK_PIPE: + else if (p->Type() & USB_OBJECT_BULK_PIPE) listhead = fDummyBulk; - break; - case USB_OBJECT_ISO_PIPE: + else if (p->Type() & USB_OBJECT_ISO_PIPE) listhead = fDummyIsochronous; - break; - default: + else { FreeEndpoint(endpoint); return B_ERROR; } //Add the endpoint to the queues - if (p->Type() != USB_OBJECT_ISO_PIPE) { + if ((p->Type() & USB_OBJECT_ISO_PIPE) == 0) { //Link the endpoint into the head of the list endpoint->SetNext(listhead->next); listhead->SetNext(endpoint);