Opened 12 years ago

Last modified 3 years ago

#1106 assigned enhancement

Port USB mass storage driver to new SCSI module API

Reported by: axeld Owned by: nobody
Priority: normal Milestone: R1
Component: Drivers/USB Version: R1/pre-alpha1
Keywords: Cc: siarzhuk
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Our USB mass storage module currently only supports the R5 SCSI bus layer. Since we are not compatible with this one, it doesn't work on Haiku yet. Port the USB driver to use the new SCSI module API, and therefore, to use the new driver API as well. The disks should be published somewhere under /dev/disk/usb/ when done.

Change History (13)

comment:1 Changed 12 years ago by siarzhuk

Cc: siarzhuk added

comment:2 Changed 12 years ago by mmlr

Owner: changed from mmlr to siarzhuk

Reassigning this task to Siarzhuk Zharski as he is the author of the usb_scsi module and started looking into this already.

comment:3 Changed 11 years ago by jackburton

What's the status of this ? Is there some code available already ?

comment:4 Changed 11 years ago by siarzhuk

I'm working on it. Hope to commit something in a week or two. I'm sorry for delay.

comment:5 in reply to:  4 Changed 11 years ago by jackburton

Replying to siarzhuk:

I'm working on it. Hope to commit something in a week or two. I'm sorry for delay.

No need to be sorry, I just wanted to know if someone was still working on it :)

comment:6 Changed 11 years ago by diver

Any news, Siarzhuk?

comment:7 in reply to:  6 Changed 11 years ago by siarzhuk

Replying to diver:

Any news, Siarzhuk?

Hm. Is it a bug tracker or message board? :-) I'm making now a vacations in Minsk. Before the final attack to usb_scsi code. ;-)

comment:8 Changed 11 years ago by emitrax

Any news about the porting? :)

comment:9 in reply to:  8 ; Changed 11 years ago by siarzhuk

Replying to emitrax:

Any news about the porting? :)

Only troubles at the moment: http://www.freelists.org/archives/haiku-development/12-2007/msg00044.html Sorry :-(

comment:10 in reply to:  9 Changed 11 years ago by siarzhuk

comment:11 Changed 11 years ago by diver

Does the fact that the new driver architecture is somewhat completed should change anything in porting issues? Also mmlr wrote usb_disk module, what is the difference between it and the subject driver?

comment:12 Changed 11 years ago by mmlr

The difference is that usb_disk does the minimal SCSI that is required itself and directly publishes a block device to the system. The usb_scsi on the other hand is a bridge between the SCSI subsystem and the USB device. It takes SCSI commands from the SCSI subsystem and pushes them to the USB driver and back. So usb_scsi does not publish the drive itself, it gets published by the SCSI subsystem (or rather scsi_disk / scsi_cd) and then looks like a normal SCSI device to the rest of the system. This approach has a more of an overhead and generally is more complexity, but essentially reduces the amount of work usb_scsi has to do (as it is more like a pass through - not counting having to work around device bugs and translating incompatible protocols). The advantage of it being that for example a USB CD writer could be supported by the existing SCSI system and transparently through scsi_cd. When not using usb_scsi you would have to write an individual usb_cd driver that would then be publishing the CD drive and export this functionality.

On the subject of the new driver architecture. That it is in place does not change much directly. First the USB stack has also to be ported to it (while leaving the existing API intact). This alone poses a few, not yet solved, problems though. It is not yet clear to me what the best way to publish devices through the new architecture is, as there is no real model on how multi function devices are supposed to be presented.

When the USB stack is available through the new driver architecture this does still not mean that usb_scsi is available. It only solves the problem of when it gets loaded and by whom. The real work is still, as would be right now, porting the usb_scsi driver to the new SCSI interface. Incidentally moving to the new driver architecture makes it more work, as also the USB part has to be ported (the USB interface would have been the same with the old model, avoiding the need to port).

Since usb_disk works good enough for now (and in fact, as other protocols are not too common in newer devices anymore because they are discouraged by Microsoft for example, it should be pretty future proof), I don't think that this task is highly urgent. Eventually it will make sense to port it for the aforementioned advantages it brings though.

comment:13 Changed 3 years ago by siarzhuk

Owner: changed from siarzhuk to nobody
Status: newassigned
Note: See TracTickets for help on using tickets.