Question about SCSI commands: mode sense

While my scsi miniport driver receives “mode sense” command, some info about “mode page” should be returned to scsi port driver. Now I am puzzled what “mode page” is. Is “mode page” info stored in hardware firmware, or stored in my scsi miniport driver? Can I finish the “mode sense” command just in my scsi miniport driver, or should my driver wait for the hardware firmware’s interrupt?
My manager told me that my scsi HBA has not firmware in it. So I think I should form “mode page” info just all in my driver, am I right?

It is either stored on the hardware or emulated by the miniport or hba or a
combination of these.

“My manager told me that my scsi HBA has not firmware in it.” Beware the
pointy haired boss.

A real SCSI device on a real SCSI bus, for example a disk, produces mode
pages when requested by an HBA initiator. That is the model that your
hardware/firmware/driver have to support.

On Fri, Feb 29, 2008 at 7:06 AM, wrote:

> While my scsi miniport driver receives “mode sense” command, some info
> about “mode page” should be returned to scsi port driver. Now I am puzzled
> what “mode page” is. Is “mode page” info stored in hardware firmware, or
> stored in my scsi miniport driver? Can I finish the “mode sense” command
> just in my scsi miniport driver, or should my driver wait for the hardware
> firmware’s interrupt?
> My manager told me that my scsi HBA has not firmware in it. So I think I
> should form “mode page” info just all in my driver, am I right?
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy

> While my scsi miniport driver receives “mode sense” command, some info about

“mode page” should be returned to scsi port driver. Now I am puzzled what
“mode
page” is.

Kinda a property group.

SCSI is very old, 1980ies, mode pages invented that time, even before OA and
the similar technologies which use “properties” and “methods”, thus the names
“mode”, “sense” and “select”.

MODE SENSE is kinda “get property” (more exactly - property group).

MODE SELECT is “set property”.

Is “mode page” info stored in hardware firmware,

Some “properties” are stored there and cannot be changed, they are read-only.

For some other, the defaults are in the firmware, but the host can override
them.

Some even other are volatile runtime values (like some stats).

My manager told me that my scsi HBA has not firmware in it.

Nearly all MODE commands must be delivered to the LUN, they belong to the LUN,
not to the HBA. I have doubts that HBA’s mode pages ever existed.

So, the HBA and your driver must just provide the mean of transport of the MODE
command to the LUN.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Anything you get through an SRB_FUNCTION_EXECUTE_SCSI SRB is expected to be sent to the LUN for processing.

So whether you are right depends on your driver and your hardware. If you’re writing a miniport for a SCSI adapter then you’re wrong. You should send the command to the LUN rather than making up some data.

If your HBA is simulating a SCSI LUN then your HBA should provide the mode data.

If your driver is simulating a SCSI LUN (say you’re talking to something that?s not SCSI at all like an IDE device) then your driver should provide the mode data.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of zoranzi021@163.com
Sent: Friday, February 29, 2008 4:06 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Question about SCSI commands: mode sense

While my scsi miniport driver receives “mode sense” command, some info about “mode page” should be returned to scsi port driver. Now I am puzzled what “mode page” is. Is “mode page” info stored in hardware firmware, or stored in my scsi miniport driver? Can I finish the “mode sense” command just in my scsi miniport driver, or should my driver wait for the hardware firmware’s interrupt?
My manager told me that my scsi HBA has not firmware in it. So I think I should form “mode page” info just all in my driver, am I right?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

This is a good resource for expectations of miniport drivers: http://www.microsoft.com/whdc/device/storage/RAID_design.mspx

Most of the provisions apply to any scsi/stor miniport.

From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Friday, February 29, 2008 6:32 AM
Subject: Re: Question about SCSI commands: mode sense

It is either stored on the hardware or emulated by the miniport or hba or a combination of these.

“My manager told me that my scsi HBA has not firmware in it.” Beware the pointy haired boss.

A real SCSI device on a real SCSI bus, for example a disk, produces mode pages when requested by an HBA initiator. That is the model that your hardware/firmware/driver have to support.

On Fri, Feb 29, 2008 at 7:06 AM, > wrote:
While my scsi miniport driver receives “mode sense” command, some info about “mode page” should be returned to scsi port driver. Now I am puzzled what “mode page” is. Is “mode page” info stored in hardware firmware, or stored in my scsi miniport driver? Can I finish the “mode sense” command just in my scsi miniport driver, or should my driver wait for the hardware firmware’s interrupt?
My manager told me that my scsi HBA has not firmware in it. So I think I should form “mode page” info just all in my driver, am I right?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Mark Roddy

Thank all for your answers.Let me summarize.
1.Now I know “mode sense” is kinda “get property” and “mode select” is kinda “set property”. Some “properties” are stored firmware and read-only. some can be overridden. Some even are volatile runtime values (like some stats).
2.Normally, these 2 commands should be supported by hardware/firmware/driver.Nearly all MODE commands must be delivered to the LUN. So, the HBA and your driver must just provide the mean of transport of the MODE command to the LUN.
3.If your HBA is simulating a SCSI LUN then your HBA should provide the mode data. If your driver is simulating a SCSI LUN , then your driver should provide the mode data.