Merge pull request #12534 from bergzand/pr/usbus/cdcecm_early_exit_on_inactive
cdcecm: early exit on inactive usb interface
This commit is contained in:
commit
0bbb114ec6
@ -59,6 +59,11 @@ static int _send(netdev_t *netdev, const iolist_t *iolist)
|
|||||||
uint8_t *buf = cdcecm->ep_in->ep->buf;
|
uint8_t *buf = cdcecm->ep_in->ep->buf;
|
||||||
const iolist_t *iolist_start = iolist;
|
const iolist_t *iolist_start = iolist;
|
||||||
size_t len = iolist_size(iolist);
|
size_t len = iolist_size(iolist);
|
||||||
|
/* interface with alternative function ID 1 is the interface containing the
|
||||||
|
* data endpoints, no sense trying to transmit data if it is not active */
|
||||||
|
if (cdcecm->active_iface != 1) {
|
||||||
|
return -ENOTCONN;
|
||||||
|
}
|
||||||
DEBUG("CDC_ECM_netdev: sending %u bytes\n", len);
|
DEBUG("CDC_ECM_netdev: sending %u bytes\n", len);
|
||||||
/* load packet data into FIFO */
|
/* load packet data into FIFO */
|
||||||
size_t iol_offset = 0;
|
size_t iol_offset = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user