Re: Pertaining to USB endpoints..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 6 Nov 2009, Nicholas Van Orton wrote:

> Hello,
> 
> This is with regards to the USB protocol with respect to Endpoints.
> The general sequence of events followed would be
> 
> 1)Host sends data packet that ends up in the EP1 OUT
> 2)Device then returns data that ends up in EP1 IN
> 3)Host sends a IN packet requesting the data at EP1 IN
> 
> The question relates to the 3rd step above, where does the IN packet
> sent by the host
> end up? Will it end up in EP1 OUT or EP1 IN?

Your use of the word "in" is very peculiar.  The packets don't end up
"in" endpoints -- they end up at the device.  When the device receives
a packet, it looks at the contents to decide which endpoint the packet
refers to.  In particular, IN packets always refer to IN endpoints and 
OUT packets always refer to OUT endpoints.

> Since this is from the host
> logically it should end up at EP1 OUT. Is this correct?

No.  The packet ends up at the device.  The device looks at the
packet's contents and realizes that the host is asking for data from
EP1 IN, because it is an IN packet.

> Hope some one can explain my doubt.
> Thanks and Regards,
> Nicholas
> 
> 
> PS: This is with regards to the book "USB in a Nutshell", wrt Endpoints,
> as is described on page 11.
> 
> My confusion stems from the lines "As the data is flowing out from the
> host it will end up in the EP1 OUT". Later on in the paragraph there is
> the line "... until such time when the host sends a IN packet to *that*
> endpoint requesting data". Some how the two statements seem to
> contradict themselves. By "that endpoint" does he mean EP1 IN?

The statements are not contradictory.  Data _sent_ from the host goes
to EP1 OUT.  But the IN packet doesn't indicate that the host is going
to _send_ data; it indicates that the host is asking to _receive_ data.  
Thus it is meant for EP1 IN.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux