-
-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OHCI: Fixed a bug in the OHCI implementation from QEMU #1531
base: master
Are you sure you want to change the base?
Changes from all commits
ff79cd5
a3d61ca
b5de99f
28119cf
7e0734c
d3e4b0e
114d994
fe10357
51a0a4e
d265219
adb0eb3
98aa18b
950519a
3b15f6a
9f0e17f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,21 @@ typedef struct OHCIPort { | |
uint32_t ctrl; | ||
} OHCIPort; | ||
|
||
typedef struct OHCIState { | ||
typedef struct USBActivePacket USBActivePacket; | ||
typedef struct OHCIState OHCIState; | ||
|
||
struct USBActivePacket { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is basically 1:1 with endpoints, does it makes sense to just move the async tracking into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. USBEndpoint is shared between OHCI, EHCI, UHCI, and XHCI. Moving the async tracking into USBEndpoint would make sense from the perspective of OHCI, but wouldn't be used by EHCI, UHCI, or XHCI |
||
USBEndpoint *ep; | ||
USBPacket usb_packet; | ||
uint8_t usb_buf[8192]; | ||
uint32_t async_td; | ||
bool async_complete; | ||
OHCIState *ohci; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's used in ohci_async_complete_packet when calling ohci_process_lists. This is the only place it is used. We get USBActivePacket by using container_of on the USBPacket argument. It might be possible to use container_of to get the OHCI pointer we need here if we can use one of the QTAILQ macros to get to the head of the list. |
||
|
||
QTAILQ_ENTRY(USBActivePacket) next; | ||
}; | ||
|
||
struct OHCIState { | ||
USBBus bus; | ||
qemu_irq irq; | ||
MemoryRegion mem; | ||
|
@@ -84,13 +98,13 @@ typedef struct OHCIState { | |
|
||
/* Active packets. */ | ||
uint32_t old_ctl; | ||
USBPacket usb_packet; | ||
uint8_t usb_buf[8192]; | ||
uint32_t async_td; | ||
bool async_complete; | ||
QTAILQ_HEAD(, USBActivePacket) active_packets; | ||
|
||
void (*ohci_die)(struct OHCIState *ohci); | ||
} OHCIState; | ||
}; | ||
|
||
#define TYPE_SYSBUS_OHCI "sysbus-ohci" | ||
OBJECT_DECLARE_SIMPLE_TYPE(OHCISysBusState, SYSBUS_OHCI) | ||
|
@@ -117,5 +131,6 @@ void ohci_bus_stop(OHCIState *ohci); | |
void ohci_stop_endpoints(OHCIState *ohci); | ||
void ohci_hard_reset(OHCIState *ohci); | ||
void ohci_sysbus_die(struct OHCIState *ohci); | ||
void ohci_clear_active_packets(struct OHCIState *ohci); | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
clear
and notcancel
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clear because this function makes the list empty. I am not opposed to changing it to cancel