host_communication: Send zero-length-packet on wMaxPacketSize

We need to send zero-length packets on bulk endpoints whenever the
transfer size is exactly a multiple of the wMaxPacketSize.

See USB 2.0 Specification Section 5.8.3 titled "Bulk Transfer Packet
Size constraints."

Change-Id: Ice3842399d5a5c4a18383860f81074497c6e7c9b
Closes: OS#4331
This commit is contained in:
Harald Welte
2019-12-15 23:55:15 +01:00
parent 81f4ef7750
commit 5b136021d8
3 changed files with 18 additions and 0 deletions

View File

@@ -214,6 +214,8 @@ typedef void (*MblTransferCallback)(void *pArg,
* Exported functions
*------------------------------------------------------------------------------*/
extern uint16_t USBD_GetEndpointSize(uint8_t bEndpoint);
//extern void USBD_IrqHandler(void);
extern void USBD_Init(void);