USB: Store device descriptor on enumeration

We now store the device descriptor obtained from the device
during enumeration in the device's object in memory instead
of exposing all of the different members contained within it.
This commit is contained in:
Jesse Buhagiar 2021-06-08 22:31:32 +10:00 committed by Ali Mohammad Pur
parent 7b42146f33
commit 71c9572e74
Notes: sideshowbarker 2024-07-18 12:05:41 +09:00
2 changed files with 3 additions and 1 deletions

View file

@ -94,6 +94,7 @@ KResult Device::enumerate()
VERIFY(transfer_length > 0);
m_address = s_next_usb_address++;
memcpy(&m_device_descriptor, &dev_descriptor, sizeof(USBDeviceDescriptor));
return KSuccess;
}

View file

@ -42,7 +42,8 @@ public:
u8 address() const { return m_address; }
private:
const USBDeviceDescriptor& device_descriptor() const { return m_device_descriptor; }
private:
PortNumber m_device_port; // What port is this device attached to
DeviceSpeed m_device_speed; // What speed is this device running at