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

View File

@ -14,7 +14,7 @@ BusManager::BusManager(Stack *stack)
: fInitOK(false),
fStack(stack),
fRootHub(NULL),
fUSBID((uint32)-1)
fStackIndex((uint32)-1)
{
mutex_init(&fLock, "usb busmanager lock");
@ -254,7 +254,7 @@ status_t
BusManager::Start()
{
fStack->AddBusManager(this);
fUSBID = fStack->IndexOfBusManager(this);
fStackIndex = fStack->IndexOfBusManager(this);
return B_OK;
}

View File

@ -226,9 +226,11 @@ virtual status_t NotifyPipeChange(Pipe *pipe,
Hub * GetRootHub() const { return fRootHub; }
void SetRootHub(Hub *hub) { fRootHub = hub; }
usb_id USBID() const { return fUSBID; }
virtual const char * TypeName() const = 0;
protected:
usb_id USBID() const { return fStackIndex; }
protected:
bool fInitOK;
@ -245,7 +247,7 @@ private:
Hub * fRootHub;
Object * fRootObject;
usb_id fUSBID;
usb_id fStackIndex;
};