Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[host] abort all pending transfer when SET_CONFIGURATION is complete #2503

Merged
merged 3 commits into from
Mar 4, 2024

Conversation

hathach
Copy link
Owner

@hathach hathach commented Mar 4, 2024

Describe the PR

  • abort all pending transfer when SET_CONFIGURATION is complete
  • usbh enumeration: move _parse_configuration_descriptor after SET_CONFIGURATION is successful
  • use tu_edpt_release in tuh_edpt_abort_xfer instead of usbh_edpt_release
  • rename _xfer_complete -> _control_xfer_complete
  • most changes are due to code reformat

fix an issue with circuitpython adafruit/circuitpython#8885

hathach added 3 commits March 4, 2024 16:14
…NFIGURATION is successful

- usbh: abort all pending xfer when SET_CONFIGURATION is complete
- use tu_edpt_release in tuh_edpt_abort_xfer instead of usbh_edpt_release
- rename _xfer_complete -> _control_xfer_complete
case CONTROL_STAGE_ACK:
_xfer_complete(dev_addr, result);
break;
case CONTROL_STAGE_ACK: {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abort all pending transfer when SET_CONFIGURATION is complete

@@ -741,7 +743,7 @@ bool tuh_edpt_abort_xfer(uint8_t daddr, uint8_t ep_addr) {
TU_VERIFY(hcd_edpt_abort_xfer(dev->rhport, daddr, ep_addr));
// mark as ready and release endpoint if transfer is aborted
dev->ep_status[epnum][dir].busy = false;
usbh_edpt_release(daddr, ep_addr);
tu_edpt_release(&dev->ep_status[epnum][dir], _usbh_mutex);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tu_edpt_release() is lighter version


dev->configured = 1;

// Parse configuration & set up drivers
// driver_open() must not make any usb transfer
TU_ASSERT(_parse_configuration_descriptor(daddr, (tusb_desc_configuration_t*) _usbh_ctrl_buf),);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move _parse_configuration_descriptor() from pre to post SET_CONNFIGURATION

@hathach hathach merged commit a0e5626 into master Mar 4, 2024
94 checks passed
@hathach hathach deleted the tuh-set-config-abort-all-ep branch March 4, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant