Control and bulk list processing
This commit is contained in:
parent
95bb9becdd
commit
b486095e97
|
@ -226,7 +226,7 @@ void OHCI::OHCI_FrameBoundaryWorker()
|
|||
OHCI_StopEndpoints();
|
||||
}
|
||||
m_OldHcControl = m_Registers.HcControl;
|
||||
ohci_process_lists(ohci, 0);
|
||||
OHCI_ProcessLists(0);
|
||||
|
||||
// Stop if UnrecoverableError happened or OHCI_SOF will crash
|
||||
if (m_Registers.HcInterruptStatus & OHCI_INTR_UE) {
|
||||
|
@ -1396,3 +1396,26 @@ void OHCI::OHCI_AsyncCancelDevice(XboxDevice* dev)
|
|||
m_AsyncTD = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void OHCI::OHCI_ProcessLists(int completion)
|
||||
{
|
||||
// Only process the control list if it is enabled (HcControl) and has available TD's (HcCommandStatus)
|
||||
if ((m_Registers.HcControl & OHCI_CTL_CLE) && (m_Registers.HcCommandStatus & OHCI_STATUS_CLF)) {
|
||||
if (m_Registers.HcControlCurrentED && m_Registers.HcControlCurrentED != m_Registers.HcControlHeadED) {
|
||||
DbgPrintf("Ohci: head 0x%X, current 0x%X\n",
|
||||
m_Registers.HcControlHeadED, m_Registers.HcControlCurrentED);
|
||||
}
|
||||
if (!OHCI_ServiceEDlist(m_Registers.HcControlHeadED, completion)) {
|
||||
m_Registers.HcControlCurrentED = 0;
|
||||
m_Registers.HcCommandStatus &= ~OHCI_STATUS_CLF;
|
||||
}
|
||||
}
|
||||
|
||||
// Only process the bulk list if it is enabled (HcControl) and has available TD's (HcCommandStatus)
|
||||
if ((m_Registers.HcControl & OHCI_CTL_BLE) && (m_Registers.HcCommandStatus & OHCI_STATUS_BLF)) {
|
||||
if (!OHCI_ServiceEDlist(m_Registers.HcBulkHeadED, completion)) {
|
||||
m_Registers.HcBulkCurrentED = 0;
|
||||
m_Registers.HcCommandStatus &= ~OHCI_STATUS_BLF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ class OHCI
|
|||
bool OHCI_GetDwords(xbaddr Paddr, uint32_t* Buffer, int Number);
|
||||
// write an array of DWORDs in memory
|
||||
bool OHCI_WriteDwords(xbaddr Paddr, uint32_t* Buffer, int Number);
|
||||
// process an ED list
|
||||
// process an ED list. Returns nonzero if active TD was found
|
||||
int OHCI_ServiceEDlist(xbaddr Head, int Completion);
|
||||
// process a TD. Returns nonzero to terminate processing of this endpoint
|
||||
int OHCI_ServiceTD(OHCI_ED* Ed);
|
||||
|
@ -258,6 +258,8 @@ class OHCI
|
|||
XboxDevice* OHCI::OHCI_FindDevice(uint8_t Addr);
|
||||
// cancel a packet when a device is removed
|
||||
void OHCI_AsyncCancelDevice(XboxDevice* dev);
|
||||
// Process Control and Bulk lists
|
||||
void OHCI_ProcessLists(int completion);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -181,7 +181,7 @@ USBCombinedPacket;
|
|||
struct _USBPacket
|
||||
{
|
||||
int Pid; // Packet ID (used to identify the type of packet that is being sent)
|
||||
uint32_t Id; // Paddr of the TD for this packet
|
||||
uint32_t Id; // Paddr of the TD for this packet
|
||||
USBEndpoint* Endpoint; // endpoint this packet is transferred to
|
||||
unsigned int Stream;
|
||||
IOVector IoVec; // used to perform vectored I/O
|
||||
|
|
Loading…
Reference in New Issue