summaryrefslogtreecommitdiff
path: root/tests/test/support
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-03-23 17:31:51 +0700
committerhathach <[email protected]>2013-03-23 17:31:51 +0700
commit44e09cc397df4e7fc47c37a4d967fe17a3d82e16 (patch)
treef8f1459fc355d174df4f1724d9dbb7f08bb137d7 /tests/test/support
parent4adfc6a6d8a77ca9526ec04e62c83ea88ffdddd7 (diff)
enhance some tests
add test for usbh_isr error invoke fix bug if device unplugged before is set to new address - clean up & close control addr0 in usbh_device_unplugged_isr
Diffstat (limited to 'tests/test/support')
-rw-r--r--tests/test/support/ehci_controller.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test/support/ehci_controller.c b/tests/test/support/ehci_controller.c
index 4c3ab33ff..911a075d2 100644
--- a/tests/test/support/ehci_controller.c
+++ b/tests/test/support/ehci_controller.c
@@ -77,6 +77,34 @@ void ehci_controller_run(uint8_t hostid)
//------------- Period List -------------//
regs->usb_sts = EHCI_INT_MASK_NXP_ASYNC;
+ hcd_isr(hostid);
+}
+
+void ehci_controller_run_error(uint8_t hostid)
+{
+ //------------- Async List -------------//
+ ehci_registers_t* const regs = get_operational_register(hostid);
+
+ ehci_qhd_t *p_qhd = (ehci_qhd_t*) regs->async_list_base;
+ do
+ {
+ if ( !p_qhd->qtd_overlay.halted )
+ {
+ if(!p_qhd->qtd_overlay.next.terminate)
+ {
+ ehci_qtd_t* p_qtd = (ehci_qtd_t*) align32(p_qhd->qtd_overlay.next.address);
+ p_qtd->active = 0;
+ p_qtd->babble_err = p_qtd->buffer_err = p_qtd->xact_err = 1;
+ p_qhd->qtd_overlay = *p_qtd;
+ }
+ }
+ p_qhd = (ehci_qhd_t*) align32(p_qhd->next.address);
+ }while(p_qhd != get_async_head(hostid)); // stop if loop around
+ //------------- Period List -------------//
+
+ regs->usb_sts = EHCI_INT_MASK_ERROR;
+
+ hcd_isr(hostid);
}
void ehci_controller_device_plug(uint8_t hostid, tusb_speed_t speed)