UDC Driver Querry
"Ajay Jain" <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I have these questions regarding the peripheral controller driver.
1. When the gadget driver queues a request for the EP0, how does one
get to know whether it is an "IN" request or an "OUT" request. I was
looking at a few implementations and I came across the following code:
if (ep_is_in(ep)) {
dev->ep0state = DATA_STATE_XMIT;
lh7a40x_ep0_in(dev, csr);
} else {
dev->ep0state = DATA_STATE_RECV;
lh7a40x_ep0_out(dev, csr);
}
where, #define ep_is_in(EP) (((EP)->bEndpointAddress&USB_DIR_IN)==USB_DIR_IN)
For the EP0, (which is bidirectional), this condition would always
evaluate to a single value. In my opinion this piece of code is wrong.
Am I missing something here.
2. How does the gadget driver know about the endpoint functions?
I understand that the peripheral driver submits all the eps to the
gadget's queue. But the only parameters that we fill in are the
maxpacketsize, name and the ep functions. Suppose that the upper layer
wants to queue the packets to a particular ep. So how does it identify
that end point. Does it iterate through the whole list, and is it the
responsibility of peripheral driver to choose the right EP ?
I may have 'n' endpoints in my hardware, of which not all can be
configured as the desired one. So who will ensure this ? If the
peripheral controller driver rejects such an "enable" request, will
the gadget driver try and enable this on some other endpoint ?
Thanks & Regards.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel