fix bug: adjust all bulk queue head from ehci_data.device

This commit is contained in:
hathach
2013-03-22 21:21:00 +07:00
parent f6acca6664
commit 397d62db10
7 changed files with 70 additions and 51 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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)

View File

@@ -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)

View File

@@ -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);

View File

@@ -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
}