summaryrefslogtreecommitdiff
path: root/tests/test
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-03-22 21:21:00 +0700
committerhathach <[email protected]>2013-03-22 21:21:00 +0700
commit397d62db10f11c2ee49950f51d28b2e2156ac5c8 (patch)
tree31cc2bb736169f5f0efc0311446fbbcadd92552c /tests/test
parentf6acca666421cddb4e25842ad1215e951f898ecb (diff)
fix bug: adjust all bulk queue head from ehci_data.device
Diffstat (limited to 'tests/test')
-rw-r--r--tests/test/host/ehci/test_ehci_usbh_hcd_integration.c4
-rw-r--r--tests/test/host/ehci/test_pipe_bulk_open.c4
-rw-r--r--tests/test/host/ehci/test_pipe_bulk_xfer.c2
-rw-r--r--tests/test/host/ehci/test_pipe_control_xfer.c6
-rw-r--r--tests/test/host/ehci/test_pipe_interrupt_open.c4
-rw-r--r--tests/test/support/ehci_controller.h10
6 files changed, 16 insertions, 14 deletions
diff --git a/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c b/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c
index db44746d3..fbfdea6fd 100644
--- a/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c
+++ b/tests/test/host/ehci/test_ehci_usbh_hcd_integration.c
@@ -127,7 +127,7 @@ void test_isr_disconnect_then_async_advance_control_pipe(void)
.wValue = 3 },
NULL);
- ehci_qhd_t *p_qhd = &ehci_data.device[dev_addr].control.qhd;
+ ehci_qhd_t *p_qhd = get_control_qhd(dev_addr);
ehci_qtd_t *p_qtd_head = p_qhd->p_qtd_list_head;
ehci_qtd_t *p_qtd_tail = p_qhd->p_qtd_list_tail;
@@ -162,7 +162,7 @@ void test_bulk_pipe_close(void)
hcd_pipe_xfer(pipe_hdl, xfer_data, sizeof(xfer_data), 100);
hcd_pipe_xfer(pipe_hdl, xfer_data, sizeof(xfer_data), 50);
- ehci_qhd_t *p_qhd = &ehci_data.device[dev_addr].qhd[pipe_hdl.index];
+ ehci_qhd_t *p_qhd = &ehci_data.device[dev_addr-1].qhd[pipe_hdl.index];
ehci_qtd_t *p_qtd_head = p_qhd->p_qtd_list_head;
ehci_qtd_t *p_qtd_tail = p_qhd->p_qtd_list_tail;
diff --git a/tests/test/host/ehci/test_pipe_bulk_open.c b/tests/test/host/ehci/test_pipe_bulk_open.c
index b6c11d76e..03c7d0b85 100644
--- a/tests/test/host/ehci/test_pipe_bulk_open.c
+++ b/tests/test/host/ehci/test_pipe_bulk_open.c
@@ -153,7 +153,7 @@ void test_open_bulk_qhd_data(void)
TEST_ASSERT_EQUAL(dev_addr, pipe_hdl.dev_addr);
TEST_ASSERT_EQUAL(TUSB_XFER_BULK, pipe_hdl.xfer_type);
- p_qhd = &ehci_data.device[ pipe_hdl.dev_addr ].qhd[ pipe_hdl.index ];
+ p_qhd = &ehci_data.device[ pipe_hdl.dev_addr-1 ].qhd[ pipe_hdl.index ];
verify_bulk_open_qhd(p_qhd, desc_endpoint, TUSB_CLASS_MSC);
//------------- async list check -------------//
@@ -169,7 +169,7 @@ void test_bulk_close(void)
{
tusb_descriptor_endpoint_t const * desc_endpoint = &desc_ept_bulk_in;
pipe_handle_t pipe_hdl = hcd_pipe_open(dev_addr, desc_endpoint, TUSB_CLASS_MSC);
- ehci_qhd_t *p_qhd = &ehci_data.device[ pipe_hdl.dev_addr ].qhd[ pipe_hdl.index ];
+ ehci_qhd_t *p_qhd = &ehci_data.device[ pipe_hdl.dev_addr-1].qhd[ pipe_hdl.index ];
//------------- Code Under TEST -------------//
hcd_pipe_close(pipe_hdl);
diff --git a/tests/test/host/ehci/test_pipe_bulk_xfer.c b/tests/test/host/ehci/test_pipe_bulk_xfer.c
index 327dbdfc4..ac9be3727 100644
--- a/tests/test/host/ehci/test_pipe_bulk_xfer.c
+++ b/tests/test/host/ehci/test_pipe_bulk_xfer.c
@@ -101,7 +101,7 @@ void setUp(void)
TEST_ASSERT_EQUAL(dev_addr, pipe_hdl_bulk.dev_addr);
TEST_ASSERT_EQUAL(TUSB_XFER_BULK, pipe_hdl_bulk.xfer_type);
- p_qhd_bulk = &ehci_data.device[ dev_addr ].qhd[ pipe_hdl_bulk.index ];
+ p_qhd_bulk = &ehci_data.device[ dev_addr -1].qhd[ pipe_hdl_bulk.index ];
}
void tearDown(void)
diff --git a/tests/test/host/ehci/test_pipe_control_xfer.c b/tests/test/host/ehci/test_pipe_control_xfer.c
index 583a6d313..754db1295 100644
--- a/tests/test/host/ehci/test_pipe_control_xfer.c
+++ b/tests/test/host/ehci/test_pipe_control_xfer.c
@@ -98,9 +98,9 @@ void setUp(void)
async_head = get_async_head( hostid );
- p_setup = &ehci_data.device[dev_addr].control.qtd[0];
- p_data = &ehci_data.device[dev_addr].control.qtd[1];
- p_status = &ehci_data.device[dev_addr].control.qtd[2];
+ p_setup = &ehci_data.device[dev_addr-1].control.qtd[0];
+ p_data = &ehci_data.device[dev_addr-1].control.qtd[1];
+ p_status = &ehci_data.device[dev_addr-1].control.qtd[2];
}
void tearDown(void)
diff --git a/tests/test/host/ehci/test_pipe_interrupt_open.c b/tests/test/host/ehci/test_pipe_interrupt_open.c
index 62da7d7b3..0ae65b2ab 100644
--- a/tests/test/host/ehci/test_pipe_interrupt_open.c
+++ b/tests/test/host/ehci/test_pipe_interrupt_open.c
@@ -148,7 +148,7 @@ void test_open_interrupt_qhd_hs(void)
TEST_ASSERT_EQUAL(dev_addr, pipe_hdl.dev_addr);
TEST_ASSERT_EQUAL(TUSB_XFER_INTERRUPT, pipe_hdl.xfer_type);
- p_qhd = &ehci_data.device[ pipe_hdl.dev_addr ].qhd[ pipe_hdl.index ];
+ p_qhd = &ehci_data.device[ pipe_hdl.dev_addr-1].qhd[ pipe_hdl.index ];
verify_int_qhd(p_qhd, &desc_ept_interrupt_out, TUSB_CLASS_HID);
@@ -169,7 +169,7 @@ void test_open_interrupt_qhd_non_hs(void)
TEST_ASSERT_EQUAL(dev_addr, pipe_hdl.dev_addr);
TEST_ASSERT_EQUAL(TUSB_XFER_INTERRUPT, pipe_hdl.xfer_type);
- p_qhd = &ehci_data.device[ pipe_hdl.dev_addr ].qhd[ pipe_hdl.index ];
+ p_qhd = &ehci_data.device[ pipe_hdl.dev_addr-1].qhd[ pipe_hdl.index ];
verify_int_qhd(p_qhd, &desc_ept_interrupt_out, TUSB_CLASS_HID);
diff --git a/tests/test/support/ehci_controller.h b/tests/test/support/ehci_controller.h
index 7191b1294..ee3acfa56 100644
--- a/tests/test/support/ehci_controller.h
+++ b/tests/test/support/ehci_controller.h
@@ -61,10 +61,12 @@ void ehci_controller_run(uint8_t hostid);
void ehci_controller_device_plug(uint8_t hostid, tusb_speed_t speed);
void ehci_controller_device_unplug(uint8_t hostid);
-ehci_registers_t* const get_operational_register(uint8_t hostid);
-ehci_link_t* const get_period_frame_list(uint8_t list_idx);
-ehci_qhd_t* const get_async_head(uint8_t hostid);
-ehci_qhd_t* const get_period_head(uint8_t hostid);
+ehci_registers_t* get_operational_register(uint8_t hostid);
+ehci_link_t* get_period_frame_list(uint8_t list_idx);
+ehci_qhd_t* get_async_head(uint8_t hostid);
+ehci_qhd_t* get_period_head(uint8_t hostid);
+ehci_qhd_t* get_control_qhd(uint8_t dev_addr);
+ehci_qtd_t* get_control_qtds(uint8_t dev_addr);
#ifdef __cplusplus
}