Re: Linux SCSI Driver for Mass Storage Device

From: David A.Lethe (davidATsantools.com)
Date: 02/20/04

  • Next message: Josef Möllers: "Re: Linux SCSI Driver for Mass Storage Device"
    Date: Fri, 20 Feb 2004 01:31:55 -0600
    
    

    On 19 Feb 2004 19:49:48 -0800, cherie_wang@hotmail.com (YCWang) wrote:

    >I wonder how to write a driver for a pci device which is a mass
    >storage device.
    >I think write a scsi low level driver is simpler than write a block
    >device driver. But I don't know which scsi commands I should implement
    >for my mass storage device. I know that my device belongs to scsi
    >disk. Is it enough if I implement all scsi commands appears in sd.c?
    >Thanks a lot& best regard
    >Cherie Wang

    You must implement all of the commands that are mandatory for that
    particular device class, according to the ANSI spec.

    You should also assume that you can't assume that application software
    would send invalid CDBs. As the ANSI spec is very specific on what
    sense info gets returned for various types of invalid CDBs, you have
    to make sure you process them correctly. The storage device should
    already report the proper sense info if it receives munged or invalid
    commands, so just pass them through.

    If your device type (disk, tape, cd, controller, etc...) is the same
    as one that is already supported by the O/S, then you would also have
    to write code to prevent the O/S from loading the built-in driver.


  • Next message: Josef Möllers: "Re: Linux SCSI Driver for Mass Storage Device"