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

Re: [usb] usb clarifications




Hi Ravi,

   If you look at the USB Spec Revision 2.0, (page 225) under Control
   Transfer, there is a detailed info. on ocntrol transfers. All the Set
   and Get commands fall under this category.

   For control Xfer's, there are 2/3 stages, being setup stage, data 
   stage (may or may not be present) and status stage. Each stage 
   in turn has 3 token phases, being Setup/Out/In token, Data token 
   and Handshake token. The sequence is as shown below.

   1. Setup Stage
           Host sends setup token indicating to device the type of 
           transfer is control xfer.
           Host then sends the actual command (Set or get command) in
           the Data0 token. This command is 8 bytes in length. The actual
           values for the 8 bytes can be found in the USB Spec. Each
           command has specific value.  If the data token goes thru 
           succesfully, device will send a ACK.
   2. Data Stage
           For "Set Address" command there is no Data Stage. Other
           commands may have this stage. 
   3. Status Stage
           The direction of Status Stage is always opposite to that of the
           previous data phase. For "Set Address" command, the previous
           transaction was data token sent by host containing the 
           command. The host sends an "In" token to device. 
           The device responds with a zero length data pkt if the command
           was ok or sends a STALL or NAK handshake depending on data 
           pkt error or if the device was busy.
           The host finally sends an "ACK" Handshake to complete the
           transaction.

   Hope this helps.

   Govind



----- Original Message ----- 
From: Ravi Kumar <ravikumar_vlsi@y... > 
To: usb@o...  
Date: Tue, 25 Jun 2002 15:39:00 +0100 (BST) 
Subject: Re: [usb] usb clarifications 

> 
> 
> hi govind thanks fr ur reply 
> 
> pls clarify the folowing 
> 
> 1) 
> where is the set_addrerss command that is  specified 
> by the host to device , how can the  device know that 
> am sending a addres to device. 
> 
> 2) 
> u have specified in the previous mail about the status 
> stage 
> """""  Device sends "Data1" pkt with zero data 
>  length """""" 
> 
> what is the intention of sending this packet 
> pls clarify 
> 
> regards 
> Ravikumar 
> 
>  --- govindsrajan@h...  wrote: > Hi Ravi, 
> > 
> >    Here's are the steps to assign an address to a 
> > device. 
> > 
> >    0. Send USB reset for few bit times. 
> > 
> >    1. Setup Stage 
> >           Host sends "setup" token  (addr==0, 
> > endp==0) ===> default pipe 
> >           Host sends "data0" token  (wVal contains 
> > the address of device) 
> >           Device sends "Ack" if the data was 
> > received without any errors 
> >           like crc error, pid error. 
> > 
> >    2. Status Stage 
> >           Host sends "In" token 
> >           Device sends "Data1" pkt with zero data 
> > length 
> >           Host sends "Ack" if there was no error in 
> > the received data pkt. 
> > 
> >     The data stage is not present for "Set_Address" 
> > command but may 
> >     be present for other commands. 
> > 
> >     Hope this helps. 
> > 
> >     Thanks 
> >     Govind 
> > 
> > 
> > ----- Original Message ----- 
> > From: Ravi Kumar <ravikumar_vlsi@y... > 
> > To: usb@o... 
> > Date: Wed, 19 Jun 2002 15:15:38 +0100 (BST) 
> > Subject: Re: [usb] usb clarifications 
> > 
> > > 
> > > 
> > > hi all 
> > > I have a clarification on usb. 
> > > Would some tell me 
> > > 
> > > 1)what is the packet structure 
> > > for assigning an address to the device. 
> > > 
> > > is the command is 
> > > set_addres 
> > > followed by a data phase for  the address to be 
> > > assigned to device. 
> > > 
> > > 
> > > 2) 
> > > do we assign a unique address to an endpoint of 
> > the 
> > > device or what ? 
> > > 
> > > 
> > > regards 
> > > Ravikumar 
> > > 
> > > 
> > >  --- Vikas T Rao  <vikasraot@m... > wrote: > 
> > > ** Proprietary ** 
> > > > 
> > > > hi ravi, 
> > > > 
> > > > hub should recognise the device attachment and 
> > > > detachment. this will be indicated to the host 
> > by 
> > > > the status change endpoint mechanism if it is a 
> > hub, 
> > > > if hub acts as root hub then it will be reported 
> > in 
> > > > the port control and status register. i suggest 
> > you 
> > > > to go through the chapter-->11 refer 11.12 hub 
> > > > controller. 
> > > > 
> > > > ...vikas 
> > > > 
> > > > 
> > > > >>> ravikumar_vlsi@y...  06/17/02 09:45PM 
> > > >>> 
> > > > hi all, 
> > > > I understand that usb host polls devices in 
> > frequent 
> > > > intervals for periodic kind of transfers (namely 
> > 
> > > > Isochronous & Interupt Transfer type) , but with 
> > 
> > > > what 
> > > > frequency that it polls the Hub's Status 
> > endpoint 
> > > > for 
> > > > detecting the attachment & Detachement of usb 
> > > > devices. 
> > > > 
> > > > I beleive the frequency that it polls the Hubs 
> > > > status 
> > > > Descriptor is relatively higher -- Would u pls 
> > > > clarify 
> > > > whether i have understood correctly 
> > > > 
> > > > Regards 
> > > > Ravikumar 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >  --- senthil  nadesan 
> > > > <senthilnadesan@r... > 
> > > > wrote: > 
> > > > > Hello ravi, 
> > > > >   Gothrough the lines within codes,it is taken 
> > 
> > > > from 
> > > > > the usb 
> > > > > specification 1.1 in the page 231. 
> > > > > 
> > > > >          "In the downstream direction, hubs 
> > > > operate 
> > > > > in a broadcast 
> > > > > mode. When a hub detects an SOP on its 
> > > > > upstream port, it establishes connectivity to 
> > all 
> > > > > enabled 
> > > > > downstream ports. If a port is not enabled, it 
> > 
> > > > does 
> > > > > not propagate packet signaling downstream." 
> > > > > 
> > > > > With regards 
> > > > > Senthil 
> > > > > 
> > > > > 
> > > > > On Fri, 14 Jun 2002 Ravi Kumar wrote : 
> > > > > >hi all, 
> > > > > >In USB . 
> > > > > >Consider the OUT transaction , 
> > > > > >will the host controller 
> > > > > >sends the data to all the devices in 
> > broadcast or 
> > > > > >will it  select particular hub where the 
> > devices 
> > > > is 
> > > > > >anchored & send the data to that 
> particular 
> > hub . 
> > > > > > 
> > > > > >Pls reply 
> > > > > >Regards 
> > > > > >Ravikumar 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >  --- govindsrajan@h...  wrote: > Hi, 
> > > > > > > 
> > > > > > >    During an enumeration process, 
> what 
> > should 
> > > > be 
> > > > > the 
> > > > > > > address value in 
> > > > > > >    the Setup Token. Is it always 
> "zero" or 
> > the 
> > > > > > > address value of the device 
> > > > > > >    which is being sent in "Set 
> Address" 
> > > > command 
> > > > > in 
> > > > > > > the data phase? 
> > > > > > > 
> > > > > > >    SetUp Token 
> > (Sync,Pid,Addr,Endp,crc5,Eop) ; 
> > > > > Addr 
> > > > > > > = 0 /  [1-128] ? 
> > > > > > >    Data 
> > (Sync,Pid,Data0,crc16,Eop); 
> > > > 
> > > > > // 
> > > > > > > Data0 has the command 
> > > > > > > 
> > > > > > >    If I change the address of a 
> device, 
> > what 
> > > > is 
> > > > > the 
> > > > > > > address value in the 
> > > > > > >    Setup Token. Is it zero or the old 
> > value? 
> > > > > > > 
> > > > > > >    A quick reply is appreciated. 
> > > > > > > 
> > > > > > >    Thanks 
> > > > > > >    Govind 
> > > > > > > -- 
> > > > > > > To unsubscribe from usb mailing list 
> > please 
> > > > > visit 
> > > > > >http://www.opencores.org/mailinglists.shtml 
> > 
> === message truncated === 
> 
> 
> 
_____________________________________________________________
___________ 
> Want to sell your car? advertise on Yahoo Autos Classifieds. It's 
> Free!! 
>        visit http://in.autos.yahoo.com 
> 
--
To unsubscribe from usb mailing list please visit http://www.opencores.org/mailinglists.shtml