USB_DeviceDetach
This commit is contained in:
parent
7bb0ebddd5
commit
b24e15a09c
|
@ -548,7 +548,7 @@ void Hub::UsbHub_HandleData(XboxDeviceState* dev, USBPacket* p)
|
|||
void Hub::UsbHub_HandleDestroy()
|
||||
{
|
||||
// Inform upstream that the hub is detached and gone
|
||||
m_HubState->dev.Port->Operations->detach(m_HubState->dev.Port);
|
||||
m_UsbDev->USB_DeviceDetach(&m_HubState->dev);
|
||||
m_UsbDev->m_FreePorts.push_back(m_HubState->dev.Port);
|
||||
|
||||
for (int i = 0; i < NUM_PORTS; i++) {
|
||||
|
|
|
@ -665,6 +665,17 @@ void USBDevice::USB_DeviceAttach(XboxDeviceState* dev)
|
|||
USB_Attach(port);
|
||||
}
|
||||
|
||||
void USBDevice::USB_DeviceDetach(XboxDeviceState* dev)
|
||||
{
|
||||
USBPort* port = dev->Port;
|
||||
|
||||
assert(port != nullptr);
|
||||
assert(dev->Attached);
|
||||
|
||||
USB_Detach(port);
|
||||
dev->Attached--;
|
||||
}
|
||||
|
||||
void USBDevice::USB_EpInit(XboxDeviceState* dev)
|
||||
{
|
||||
USB_EpReset(dev);
|
||||
|
|
|
@ -79,6 +79,8 @@ class USBDevice : public PCIDevice {
|
|||
void USB_PortReset(USBPort* Port);
|
||||
// update device status during an attach
|
||||
void USB_DeviceAttach(XboxDeviceState* dev);
|
||||
// update device status during an detach
|
||||
void USB_DeviceDetach(XboxDeviceState* dev);
|
||||
// update port status when a device is attached
|
||||
void USB_Attach(USBPort* Port);
|
||||
// update port status when a device is detached
|
||||
|
|
|
@ -330,7 +330,6 @@ struct USBEndpoint {
|
|||
struct XboxDeviceState {
|
||||
USBPort* Port; // usb port struct of this device
|
||||
int PortPath; // port index to which this device is attached to
|
||||
char* Serial;
|
||||
USBDeviceClass* klass; // usb class struct of this device
|
||||
|
||||
int Speed; // actual speed of the connected device
|
||||
|
|
Loading…
Reference in New Issue