1 /* 2 * Copyright 2004-2006, Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Michael Lotz <mmlr@mlotz.ch> 7 */ 8 9 #include "usb_p.h" 10 11 12 Interface::Interface(Device *device) 13 : ControlPipe(device, 14 device->LowSpeed() ? Pipe::LowSpeed : Pipe::NormalSpeed, 0, 8) 15 { 16 } 17 18 19 status_t 20 Interface::SetFeature(uint16 selector) 21 { 22 return SendRequest( 23 USB_REQTYPE_STANDARD | USB_REQTYPE_INTERFACE_OUT, 24 USB_REQUEST_SET_FEATURE, 25 selector, 26 0, 27 0, 28 NULL, 29 0, 30 NULL); 31 } 32 33 34 status_t 35 Interface::ClearFeature(uint16 selector) 36 { 37 return SendRequest( 38 USB_REQTYPE_STANDARD | USB_REQTYPE_INTERFACE_OUT, 39 USB_REQUEST_CLEAR_FEATURE, 40 selector, 41 0, 42 0, 43 NULL, 44 0, 45 NULL); 46 } 47 48 49 status_t 50 Interface::GetStatus(uint16 *status) 51 { 52 return SendRequest( 53 USB_REQTYPE_STANDARD | USB_REQTYPE_INTERFACE_IN, 54 USB_REQUEST_GET_STATUS, 55 0, 56 0, 57 2, 58 (void *)status, 59 2, 60 NULL); 61 } 62