1 /* 2 * Copyright 2006-2020, 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_private.h" 10 11 12 Object::Object(Stack *stack, BusManager *bus) 13 : fParent(NULL), 14 fBusManager(bus), 15 fStack(stack), 16 fUSBID(fStack->GetUSBID(this)) 17 { 18 } 19 20 21 Object::Object(Object *parent) 22 : fParent(parent), 23 fBusManager(parent->GetBusManager()), 24 fStack(parent->GetStack()), 25 fUSBID(fStack->GetUSBID(this)) 26 { 27 } 28 29 30 Object::~Object() 31 { 32 PutUSBID(); 33 } 34 35 36 void 37 Object::PutUSBID() 38 { 39 if (fUSBID != UINT32_MAX) 40 fStack->PutUSBID(this); 41 fUSBID = UINT32_MAX; 42 } 43 44 45 status_t 46 Object::SetFeature(uint16 selector) 47 { 48 // to be implemented in subclasses 49 TRACE_ERROR("set feature called\n"); 50 return B_ERROR; 51 } 52 53 54 status_t 55 Object::ClearFeature(uint16 selector) 56 { 57 // to be implemented in subclasses 58 TRACE_ERROR("clear feature called\n"); 59 return B_ERROR; 60 } 61 62 63 status_t 64 Object::GetStatus(uint16 *status) 65 { 66 // to be implemented in subclasses 67 TRACE_ERROR("get status called\n"); 68 return B_ERROR; 69 } 70