Re: [RFC 1/9] xHCI 1.0: Setup Stage TRB Transfer Type flag

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

 



On Thu, May 05, 2011 at 11:33:02AM -0700, Sarah Sharp wrote:
> Andiry,
> 
> This doesn't cover the case where there is no data stage, like in the
> case of a Set Interface control transfer.

Ok, I looked more closely at the patch and saw you only set the TX type
if the URB's buffer length is greater than zero.  The field would be
left as zero if the length was zero, and there would be no data stage,
which is fine since the "No Data Stage" Transfer Type is defined as
zero.  So this patch should be correct.

Sarah Sharp

> On Thu, May 05, 2011 at 06:13:56PM +0800, Andiry Xu wrote:
> > Setup Stage Transfer Type field is added to indicate the presence and the
> > direction of the Data Stage TD, and determines the direction of the Status
> > Stage TD so the wLength length field should be ignored by the xHC.
> > 
> > Signed-off-by: Andiry Xu <andiry.xu@xxxxxxx>
> > ---
> >  drivers/usb/host/xhci-ring.c |   11 +++++++++++
> >  drivers/usb/host/xhci.h      |    3 +++
> >  2 files changed, 14 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
> > index 396f8d2..3e759af 100644
> > --- a/drivers/usb/host/xhci-ring.c
> > +++ b/drivers/usb/host/xhci-ring.c
> > @@ -3053,6 +3053,17 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
> >  	field |= TRB_IDT | TRB_TYPE(TRB_SETUP);
> >  	if (start_cycle == 0)
> >  		field |= 0x1;
> > +
> > +	/* xHCI 1.0 6.4.1.2.1: Transfer Type field */
> > +	if (xhci->hci_version == 0x100) {
> > +		if (urb->transfer_buffer_length > 0) {
> > +			if (setup->bRequestType & USB_DIR_IN)
> > +				field |= TRB_TX_TYPE(TRB_DATA_IN);
> > +			else
> > +				field |= TRB_TX_TYPE(TRB_DATA_OUT);
> > +		}
> > +	}
> > +
> >  	queue_trb(xhci, ep_ring, false, true,
> >  		  setup->bRequestType | setup->bRequest << 8 | le16_to_cpu(setup->wValue) << 16,
> >  		  le16_to_cpu(setup->wIndex) | le16_to_cpu(setup->wLength) << 16,
> > diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> > index db66154..af8b66f 100644
> > --- a/drivers/usb/host/xhci.h
> > +++ b/drivers/usb/host/xhci.h
> > @@ -967,6 +967,9 @@ struct xhci_event_cmd {
> >  
> >  /* Control transfer TRB specific fields */
> >  #define TRB_DIR_IN		(1<<16)
> > +#define	TRB_TX_TYPE(p)		((p) << 16)
> > +#define	TRB_DATA_OUT		2
> > +#define	TRB_DATA_IN		3
> >  
> >  /* Isochronous TRB specific fields */
> >  #define TRB_SIA			(1<<31)
> > -- 
> > 1.7.1
> > 
> > 
> > 
> --
> 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
--
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