nvd:
It is stated that the, after enumeration Host immediately starts to poll Bulk IN EP for Data and Interrupt IN EP for status. This is what happens (windows).
As you pointed out this creates lots of NAKs on the bus.
"Polling IN transactions" is common implementation of PC class drivers, for asynchronous bulk/interrupt IN transfers on all USB classes until USB3.0. Also it's an easy way for PC class drivers, because host controller automatically issues polling IN transactions, just by keeping TD (Transaction Descriptor) on the queue.
If you don't like this behavior, you have to write your custom COM port driver to cancel it, not just to implement your custom protocol over the Interrupt IN EP.
WDK has examples of a COM port driver and a KMDF WinUSB driver. You may establish your custom USB-COM port driver upon combination of these examples.
C:\WINDDK\7600.16385.1\src\serial\VirtualSerial
C:\WINDDK\7600.16385.1\src\usb\osrusbfx2\kmdf
But, is it really worth to pay such an effort?
"Polling IN transactions" don't hurt bus performance so much.
- Interrupt and Isochronous transfers have priority over bulk transfers. "Polling IN transactions" doesn't disturb these types of transfers at all.
- Control transfer is assigned greater priority in some extent on the bus scheduling of host controller.
- Bulk transfers share equal chance to occur. "Polling IN transactions" reduces performance on other bulk endpoints. But IN-NAK transaction occupies just short time on bus, the performance reduction is trivial.
For example of CDC bulk IN/OUT endpoints,
"Polling IN transactions" occur at the bulk IN endpoint, while a transfer runs on the bulk OUT endpoint. A bus analyzer counts 16-17 bulk OUT transactions per frame, and the same number of IN-NAKs on the bulk IN. If it were without IN-NAKs, bulk OUT could get one more transaction per frame. That is, performance loss is just around 6%.
This is the reason why I ask you, is it really worth?
Tsuneo