USB: Clarify that BusManagers do not really have usb_ids.

Instead their IDs are indexes into the stack, and are used primarily
for TRACE*() printing, so move the getter function into a "protected"
block and rename the variable appropriately.
This commit is contained in:
Augustin Cavalier
2021-09-15 19:01:39 -04:00
parent 3a71862e99
commit decd5b8ff5
2 changed files with 6 additions and 4 deletions
@@ -14,7 +14,7 @@ BusManager::BusManager(Stack *stack)
: fInitOK(false), : fInitOK(false),
fStack(stack), fStack(stack),
fRootHub(NULL), fRootHub(NULL),
fUSBID((uint32)-1) fStackIndex((uint32)-1)
{ {
mutex_init(&fLock, "usb busmanager lock"); mutex_init(&fLock, "usb busmanager lock");
@@ -254,7 +254,7 @@ status_t
BusManager::Start() BusManager::Start()
{ {
fStack->AddBusManager(this); fStack->AddBusManager(this);
fUSBID = fStack->IndexOfBusManager(this); fStackIndex = fStack->IndexOfBusManager(this);
return B_OK; return B_OK;
} }
@@ -226,9 +226,11 @@ virtual status_t NotifyPipeChange(Pipe *pipe,
Hub * GetRootHub() const { return fRootHub; } Hub * GetRootHub() const { return fRootHub; }
void SetRootHub(Hub *hub) { fRootHub = hub; } void SetRootHub(Hub *hub) { fRootHub = hub; }
usb_id USBID() const { return fUSBID; }
virtual const char * TypeName() const = 0; virtual const char * TypeName() const = 0;
protected:
usb_id USBID() const { return fStackIndex; }
protected: protected:
bool fInitOK; bool fInitOK;
@@ -245,7 +247,7 @@ private:
Hub * fRootHub; Hub * fRootHub;
Object * fRootObject; Object * fRootObject;
usb_id fUSBID; usb_id fStackIndex;
}; };