forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

usb_mass patch for old and small usb keys

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
spooo



Joined: 15 Jul 2004
Posts: 10

PostPosted: Fri Sep 10, 2004 9:38 am    Post subject: usb_mass patch for old and small usb keys Reply with quote

Hi,

I have a one line patch to make my old 32MB usb key working with the usb_mass iop driver.

For recent usb memory keys, it seems that the interface subclass is 6 but for my small key, it's 5.

I transformed the following line in cvs usb_mass/iop/mass_stor.c :
Code:

        if(     (intf->bInterfaceClass          != USB_CLASS_MASS_STORAGE) ||
!               (intf->bInterfaceSubClass       != USB_SUBCLASS_MASS_SCSI) ||
                (intf->bInterfaceProtocol       != USB_PROTOCOL_MASS_BULK_ONLY) ||

by this
Code:

        if(     (intf->bInterfaceClass          != USB_CLASS_MASS_STORAGE) ||
!               (intf->bInterfaceSubClass       != USB_SUBCLASS_MASS_SCSI &&
!                intf->bInterfaceSubClass       != USB_SUBCLASS_MASS_SFF_8070I) ||
                (intf->bInterfaceProtocol       != USB_PROTOCOL_MASS_BULK_ONLY) ||


I've tested only with the mass_example.c test but at least it displays the root directory correctly.

Also I had problem to compile the latest cvs usb_mass using the latest cvs ps2sdk.
Some irx filename.h are defined twice (namely sifcmd.h) and I had to add a symbolic link sifcmdx.h->sifcmd.h (in ps2sdk/iop/kernel//include) and include this file, otherwise it is ps2sdk/common/include/sifcmd.h which is included.
I could not do better, and I don't know where is the good place to talk about that.

cheers

--
spooo - who would love to build a basic graphical to choose and launch elves directly from usb key
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Fri Sep 10, 2004 10:28 am    Post subject: Reply with quote

Hmm... interesting.
Usually subclass 5 is for Floppy drives IIRC, and often uses a different command set for talking to the device... I'd be careful blindly trying to use any subclass 5 device using the subclass 6 stuff personally.

But then again, I'm not an expert on all of this.
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
ole



Joined: 08 May 2004
Posts: 92
Location: Czech Republic

PostPosted: Tue Sep 14, 2004 5:50 am    Post subject: Reply with quote

Very interesting :)
I checked the doc for 8070i protocol (found here: ftp://ftp.seagate.com/sff/INF-8070.PDF) and to my surprise it's sort of ATAPI protocol, which is compatible (at least to some level) to SCSI command set. I roughly compared the commands and they seem to be identical!
Thanks spooo for noticing/testing, I will add the patch to cvs.
Back to top
View user's profile Send private message
MisterJP



Joined: 17 Mar 2005
Posts: 5

PostPosted: Thu Mar 17, 2005 8:53 pm    Post subject: Reply with quote

Hello,

First, be kind if waht i say is non-sense cause it's my first day in the ps2 dev scene :-)
Second, I am french, so excuse me for my english.

I didnt manage to make any of my usb stick to work. Apparently the usb_mass driver freeze.
It seems to freeze in mass_stor_warmup when checking the CSW after the INQUIRY or the START_STOP command. I cannot experiment much cause i am still waiting for my naplink cable, however here is my guess on what happen :
I think the device issue a CHECK_CONDITION tag after these commands : IMO, this is due, either to a timing issue or (for the START_STOP command) a non-supported command.
But as this tag is not what is expected, the code treated it as a phase error and perform a bulk reset. Instead it should issue a REQUEST_SENSE command to get the error code and take apropriate action to recover.

Has anyone looked in that direction ? Does this even make sense for you ?
Anyway, i will make some more experiment next week when i will receive my cable.

Regards,
JP.
Back to top
View user's profile Send private message
ole



Joined: 08 May 2004
Posts: 92
Location: Czech Republic

PostPosted: Fri Mar 18, 2005 8:08 am    Post subject: Reply with quote

Quote:
It seems to freeze in mass_stor_warmup

Exactly - the warmup causes the freeze on some devices. Unfortunately none of my devices freeze this way so I can't test the suggested solution. All I can do is to implement the CHECK_CONDITION command and then let others to test it. If you are willing to help please pm me.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group