Skip to content

Commit 9e30ec4

Browse files
committed
Hub: Retry port status transfer if failed
1 parent 688a3a0 commit 9e30ec4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/host/hub.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ bool hub_port_get_status(uint8_t hub_addr, uint8_t hub_port, void* resp,
169169
};
170170

171171
TU_LOG2("HUB Get Port Status: addr = %u port = %u\r\n", hub_addr, hub_port);
172-
TU_ASSERT( tuh_control_xfer(&xfer) );
172+
TU_VERIFY( tuh_control_xfer(&xfer) );
173173
return true;
174174
}
175175

@@ -332,7 +332,11 @@ bool hub_xfer_cb(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t result, uint32
332332
{
333333
if ( tu_bit_test(p_hub->status_change, port) )
334334
{
335-
hub_port_get_status(dev_addr, port, &p_hub->port_status, connection_get_status_complete, 0);
335+
if (hub_port_get_status(dev_addr, port, &p_hub->port_status, connection_get_status_complete, 0) == false)
336+
{
337+
//Hub status control transfer failed, retry
338+
hub_edpt_status_xfer(dev_addr);
339+
}
336340
break;
337341
}
338342
}

0 commit comments

Comments
 (0)