drivers: usb_dc_native_posix: do not use IN callback without reason
Call the IN callback only if data in usb_dc_ep_write() is actually written to the intermediate buffer and sent. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
parent
16cd3be690
commit
77c2c1230b
1 changed files with 8 additions and 2 deletions
|
@ -577,8 +577,14 @@ int handle_usb_data(struct usbip_header *hdr)
|
|||
|
||||
LOG_HEXDUMP_DBG(ep_ctrl->buf, ep_ctrl->buf_len, ">");
|
||||
|
||||
/* Indicate data sent */
|
||||
ep_ctrl->cb(ep, USB_DC_EP_DATA_IN);
|
||||
/*
|
||||
* Call the callback only if data in usb_dc_ep_write()
|
||||
* is actually written to the intermediate buffer and sent.
|
||||
*/
|
||||
if (ep_ctrl->buf_len != 0) {
|
||||
ep_ctrl->cb(ep, USB_DC_EP_DATA_IN);
|
||||
usbip_ctrl.in_ep_ctrl[ep_idx].buf_len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue