Skip to content

Commit

Permalink
fixed local_hcd::port_reset_done()
Browse files Browse the repository at this point in the history
  • Loading branch information
msinger committed Dec 2, 2009
1 parent b95ba08 commit b55dda4
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/local_hcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ namespace usb
ps.change = USB_VHCI_PORT_STAT_C_CONNECTION;
ps.index = port;
ps.flags = 0;
usb_vhci_update_port_stat(fd, ps);
if(usb_vhci_update_port_stat(fd, ps) == -1)
throw std::exception();
}

void local_hcd::port_disconnect(uint8_t port) volatile throw(std::exception)
Expand All @@ -368,7 +369,8 @@ namespace usb
ps.change = USB_VHCI_PORT_STAT_C_CONNECTION;
ps.index = port;
ps.flags = 0;
usb_vhci_update_port_stat(fd, ps);
if(usb_vhci_update_port_stat(fd, ps) == -1)
throw std::exception();
}

void local_hcd::port_disable(uint8_t port) volatile throw(std::exception)
Expand All @@ -380,7 +382,8 @@ namespace usb
ps.change = USB_VHCI_PORT_STAT_C_ENABLE;
ps.index = port;
ps.flags = 0;
usb_vhci_update_port_stat(fd, ps);
if(usb_vhci_update_port_stat(fd, ps) == -1)
throw std::exception();
}

void local_hcd::port_resumed(uint8_t port) volatile throw(std::exception)
Expand All @@ -392,7 +395,8 @@ namespace usb
ps.change = USB_VHCI_PORT_STAT_C_SUSPEND;
ps.index = port;
ps.flags = 0;
usb_vhci_update_port_stat(fd, ps);
if(usb_vhci_update_port_stat(fd, ps) == -1)
throw std::exception();
}

void local_hcd::port_overcurrent(uint8_t port, bool set) volatile throw(std::exception)
Expand All @@ -404,7 +408,8 @@ namespace usb
ps.change = USB_VHCI_PORT_STAT_C_OVERCURRENT;
ps.index = port;
ps.flags = 0;
usb_vhci_update_port_stat(fd, ps);
if(usb_vhci_update_port_stat(fd, ps) == -1)
throw std::exception();
}

void local_hcd::port_reset_done(uint8_t port, bool enable) volatile throw(std::exception)
Expand All @@ -414,10 +419,11 @@ namespace usb
usb_vhci_port_stat ps;
ps.status = enable ? USB_VHCI_PORT_STAT_ENABLE : 0;
ps.change = USB_VHCI_PORT_STAT_C_RESET;
ps.change |= enable ? USB_VHCI_PORT_STAT_C_ENABLE : 0;
ps.change |= enable ? 0 : USB_VHCI_PORT_STAT_C_ENABLE;
ps.index = port;
ps.flags = 0;
usb_vhci_update_port_stat(fd, ps);
if(usb_vhci_update_port_stat(fd, ps) == -1)
throw std::exception();
}
}
}

0 comments on commit b55dda4

Please sign in to comment.