Skip to content

Commit

Permalink
UHCI: Fix frame number wrapping behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Dec 15, 2024
1 parent bf6d98f commit c097cbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/usb/usb_uhci_bochs.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const char *usb_speed[4] = {
"high", // USB_SPEED_HIGH = 2
"super" // USB_SPEED_SUPER = 3
};
#define ENABLE_UHCI_LOG 1

#ifdef ENABLE_UHCI_LOG
int uhci_do_log = ENABLE_UHCI_LOG;

Expand Down Expand Up @@ -548,7 +548,7 @@ usb_uhci_timer(void *priv)

// The Frame Number Register is incremented every 1ms
hub->usb_frame_num.frame_num++;
hub->usb_frame_num.frame_num &= (1024 - 1);
hub->usb_frame_num.frame_num &= (2048 - 1);

// The status.interrupt bit should be set regardless of the enable bits if a IOC or SPD is found
if (interrupt || shortpacket) {
Expand Down

0 comments on commit c097cbb

Please sign in to comment.