mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cdc_ecm: Update max supported transfer size after reset
This commit is contained in:
parent
8b41443913
commit
8044e578b5
@ -336,6 +336,12 @@ static void _handle_reset(usbus_t *usbus, usbus_handler_t *handler)
|
|||||||
{
|
{
|
||||||
usbus_cdcecm_device_t *cdcecm = (usbus_cdcecm_device_t *)handler;
|
usbus_cdcecm_device_t *cdcecm = (usbus_cdcecm_device_t *)handler;
|
||||||
|
|
||||||
|
/* Set the max packet size advertised to the host to something compatible with the enumerated
|
||||||
|
* size */
|
||||||
|
size_t maxpacketsize = usbus_max_bulk_endpoint_size(usbus);
|
||||||
|
cdcecm->ep_in->maxpacketsize = maxpacketsize;
|
||||||
|
cdcecm->ep_out->maxpacketsize = maxpacketsize;
|
||||||
|
|
||||||
DEBUG("CDC ECM: Reset\n");
|
DEBUG("CDC ECM: Reset\n");
|
||||||
_handle_in_complete(usbus, handler);
|
_handle_in_complete(usbus, handler);
|
||||||
cdcecm->notif = USBUS_CDCECM_NOTIF_NONE;
|
cdcecm->notif = USBUS_CDCECM_NOTIF_NONE;
|
||||||
|
@ -71,7 +71,7 @@ static int _send(netdev_t *netdev, const iolist_t *iolist)
|
|||||||
/* load packet data into FIFO */
|
/* load packet data into FIFO */
|
||||||
size_t iol_offset = 0;
|
size_t iol_offset = 0;
|
||||||
size_t usb_offset = 0;
|
size_t usb_offset = 0;
|
||||||
size_t usb_remain = cdcecm->ep_in->ep->len;
|
size_t usb_remain = cdcecm->ep_in->maxpacketsize;
|
||||||
DEBUG("CDC_ECM_netdev: cur iol: %d\n", iolist->iol_len);
|
DEBUG("CDC_ECM_netdev: cur iol: %d\n", iolist->iol_len);
|
||||||
while (len) {
|
while (len) {
|
||||||
mutex_lock(&cdcecm->out_lock);
|
mutex_lock(&cdcecm->out_lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user