From 8be9a75c4ef3f87893f08c0a668917e6903eef9a Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 12 Aug 2006 12:50:53 +0000 Subject: [PATCH] Forgot this in my last commit. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18497 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/bus_managers/usb/Interface.cpp | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/add-ons/kernel/bus_managers/usb/Interface.cpp diff --git a/src/add-ons/kernel/bus_managers/usb/Interface.cpp b/src/add-ons/kernel/bus_managers/usb/Interface.cpp new file mode 100644 index 0000000000..0c6571bce4 --- /dev/null +++ b/src/add-ons/kernel/bus_managers/usb/Interface.cpp @@ -0,0 +1,61 @@ +/* + * Copyright 2004-2006, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Michael Lotz + */ + +#include "usb_p.h" + + +Interface::Interface(Device *device) + : ControlPipe(device, + device->LowSpeed() ? Pipe::LowSpeed : Pipe::NormalSpeed, 0, 8) +{ +} + + +status_t +Interface::SetFeature(uint16 selector) +{ + return SendRequest( + USB_REQTYPE_STANDARD | USB_REQTYPE_INTERFACE_OUT, + USB_REQUEST_SET_FEATURE, + selector, + 0, + 0, + NULL, + 0, + NULL); +} + + +status_t +Interface::ClearFeature(uint16 selector) +{ + return SendRequest( + USB_REQTYPE_STANDARD | USB_REQTYPE_INTERFACE_OUT, + USB_REQUEST_CLEAR_FEATURE, + selector, + 0, + 0, + NULL, + 0, + NULL); +} + + +status_t +Interface::GetStatus(uint16 *status) +{ + return SendRequest( + USB_REQTYPE_STANDARD | USB_REQTYPE_INTERFACE_IN, + USB_REQUEST_GET_STATUS, + 0, + 0, + 2, + (void *)status, + 2, + NULL); +}