Fix USB initialization.

After USB RESET, all endpoints registers are being reset.  So,
there is no need to let each endpoint stall (it's disabled).
Actually, it's wrong to call usb_lld_stall_rx or usb_lld_stall_tx
before usb_lld_setup_endpoint, because other fields of endpoint
register are not specified after RESET.
This commit is contained in:
NIIBE Yutaka 2018-04-26 21:08:30 +09:00
parent 93a2bac94b
commit 4550458806
4 changed files with 2 additions and 10 deletions

View File

@ -1,6 +1,6 @@
2018-04-26 NIIBE Yutaka <gniibe@fsij.org>
* src/usb-ccid.c (usb_event_handle): Ignore sprious "done".
* src/usb_ctrl.c (usb_device_reset): Don't stop the endpoints.
* src/configure (MHZ, def_mhz): New.

@ -1 +1 @@
Subproject commit 32d0b8200d2d6eadc00ddfb1e1c2113e148d325a
Subproject commit f781ac9e6a09d4bf160a21c96a6f1ce96fdacb36

View File

@ -1579,10 +1579,6 @@ usb_event_handle (struct usb_dev *dev)
/* Transfer to endpoint (not control endpoint) */
if (ep_num != 0)
{
/* Ignore sprious "Correct Transfer" */
if (bDeviceState != USB_DEVICE_STATE_CONFIGURED)
return 0;
if (USB_EVENT_TXRX (e))
usb_tx_done (ep_num, USB_EVENT_LEN (e));
else

View File

@ -214,10 +214,6 @@ usb_device_reset (struct usb_dev *dev)
64);
#endif
/* Stop the interface */
for (i = 0; i < NUM_INTERFACES; i++)
gnuk_setup_endpoints_for_interface (dev, i, 1);
bDeviceState = USB_DEVICE_STATE_DEFAULT;
}