Alan Stern,您好!
======= 2006-06-29 11:15:21 您在来信中写道:======= >Alan Stern,您好! > > thanks for your reply! > >======= 2006-06-29 00:32:58 您在来信中写道:======= > >>On Wed, 28 Jun 2006, JackRain wrote: >> >>> linux-usb-users,您好! >>> >>> hi,glad to see you again:) >>> >>> i would like to ask a question about : how does mass storage >>> device cope with unsupported commands,such as 0x23 etc? >> >>Many mass storage devices do support that command. It is documented in >>the UFI specification. > I mean unsupported command is the command which device > received from pc host but the device doesn't implement. > so,i want to know the device how to response this situation. > >>> my way is : refering to mass bulk-only spec.(usbmassbulk_10 >>> 6.6.4 command failure), >>> >>> The device shall report this condition by returning a Command >>> Failed status (bCSWStatus = 01h). >>> >>> so,i now try : >>> >>> 1) return with sense_data 6th,12th,13th: >>> 0x5,0x24,0x00. >> >>You can't return sense data to the host unless the command was REQUEST >>SENSE. > I think i was wrong. >>> 2) return CSW with status (0x01) fail. >>> >>> but it seems from bus hound that ,the USB commnication halt a >>> long time then reset. >> >>What mass storage device are you talking about? Do you have any logs you >>can post? because I write the device usb firmware by myself,i print less message only for the software flow chart. now: 1)when device get READ_FORMAT_CAPCITY(0x23) command ,stall the bulk-in endpoint. 2)waitting for ep0setup interrupt,and get the clear_feature request \ unstall the endpoint and toggle the DATA pid by disable then enable the bulk-in endpoint (isp1582) 3)bulk-in endpoint send a ACK signal to PC; 4)then send the CSW to PC to reflect the command status of this unsupported command 5)EP0TX send a ACK signal to PC 6) bus reset. 7)bulk-out endpoint interrypt occurs,read CBW if command unsupported ,do the same thing 1~5; again bus reset. if command supported ,it's normal and go on processing SCSI protocol. and I can't see the disk tray icon on windows. but because bus reset ,the device still won't work. > 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:) > >>> another method i have tried is to stall the bulk-in endpoint >>> then wait host __set feature__ and unstall endpoint. >>> >>> this failed again~ >>> >>> could anyone tell me the correct way ?? thank you very much~ >> >>According to the specification, you are supposed to stall the bulk-in >>endpoint (if the Direction bit was set in bmCBWFlags; otherwise you should >>stall the bulk-out endpoint) and then return CSW status = 1. When the >>host then sends a REQUEST SENSE command, you should reply with key = 0x5, >>ASC = 0x24, ASCQ = 0x00. > > Shall the endpoint muct be stalled?? > > thanks you! >>Alan Stern >> > >= = = = = = = = = = = = = = = = = = = = > > > 致 >礼! > > > JackRain >[EMAIL PROTECTED] > 2006-06-29 > = = = = = = = = = = = = = = = = = = = = 致 礼! JackRain [EMAIL PROTECTED] 2006-06-29
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@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users