Google
  Web www.spinics.net

Re: how mass storage device cope with unsupported commands?

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


On Thu, 29 Jun 2006, JackRain wrote:

> 		  the procedure is :
>           1)bulk-out endpoint occurs,read endpoint fifo to get CBW
> 		  2)decode CBW and found the unsupported command
> 		  3)how to react if the command I don't want to implement  ?
>           4)I tried as i told previously but got bus reset.
>   	
>           I want to know the right way:) 

> 		  Shall the endpoint muct be stalled?? 

There are two ways to report that you don't support a command.

The first way:

	If dCBWDataTransferLength > 0 and the Direction bit in
	bmCBWFlags is 0 (Out), stall the bulk-out endpoint.  If
	either of those conditions is false, stall the bulk-in
	endpoint.

	After the host clears the endpoint's halt feature, prepare
	to send a CSW with bCSWStatus = 1 and dCSWResidue = the
	value of dCBWDataTransferLength.

	If the next CBWCB from the host is a REQUEST SENSE command,
	send back key=0x05, ASC=0x24, ASCQ=0x00.

The second way:

	If dCBWDataTransferLength > 0 and the Direction bit in
	bmCWFlags is 0 (Out), receive dCBWDataTransferLength bytes
	on the bulk-out endpoint and ignore their values.  If
	dCBWDataTransferLength > 0 and the Direction bit in bmCBWFlags
	is 1 (In), transmit dCBWDataTransferLength bytes containing
	0x00 on the bulk-in endpoint.  If dCBWDataTransferLength = 0,
	go directly to the next step.

	Send a CSW with bCSWStatus = 1 and dCSWResidue = the value
	of dCBWDataTransferLength.

	If the next CBWCB from the host is a REQUEST SENSE command,
	send back key=0x05, ASC=0x24, ASCQ=0x00.

I don't know if Windows will work properly with the second way.

Alan Stern


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Linux-usb-users@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

[Linux USB]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Video Projectors]     [PDAs]     [Free Online Dating]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [16.7MP]

Powered by Linux