Managing multiple LUNs in a SCSI miniport driver

Hi,

I am writing a SCSI miniport driver. As of now my driver supports only one
LUN per HBA. Now I want to support multiple LUNs but not aware of some
concepts.

If I set MaximumNumberOfTargets to say 5, I'll be able to support 5 LUNs.
But is it possible to dynamically add or remove or disable or enable LUNs?
If yes how?
What will be the ShutDown process for the LUNs?
If I implement the code for shut down of LUN in SRB_FUNCTION_SHUTDOWN, the
problem is I have seen the SHUTDOWN SRBs coming multiple times for the same
LUN. And even other CBDs following the first SHUTDOWN srb. So what to for
following CDBs and SHUTDOWN srb? Shall I just set error status for the
SHUTDOWN srbs same for rest of the CBDs?

How are these things done in good scsi miniports?

In my current code which supports only one LUN per HBA i just set
SRB_STATUS_SUCCESS for SHUTDOWN srbs and shutdown/unload the adapters in
DriverUnload.

Thanks and Regards,

Charansing D Deore
Sr. Software Developer,
CalSoft Pvt Ltd.
Baner Road, Pune-411045
Office: +91 20 40792900 Ext: 3052
Cell: +91 9850960550

ScsiPortNotification type BusChangeDetected will convince the port driver to
re-enumerate your miniport’s virtual scsi bus. Report new devices when the
inquiry commands start coming, and don’t report devices that you are
removing. You can also just start failing requests with
STATUS_SELECTION_TIMEOUT to simulate a device that a user has abruptly
removed from the system.
ENABLE/DISABLE devices is not really a supported concept for miniports.

SHUTDOWN and FLUSH function as documented in the WDK. You can get any number
of them and your only responsibilities are to make sure that you have no
cached data IN YOUR MINIPORT for the specified device when you complete the
request.

Mark Roddy

On Fri, Jan 9, 2009 at 1:36 AM, Charansing Rajput wrote:

> Hi,
>
> I am writing a SCSI miniport driver. As of now my driver supports only one
> LUN per HBA. Now I want to support multiple LUNs but not aware of some
> concepts.
>
> If I set MaximumNumberOfTargets to say 5, I’ll be able to support 5 LUNs.
> But is it possible to dynamically add or remove or disable or enable LUNs?
> If yes how?
> What will be the ShutDown process for the LUNs?
> If I implement the code for shut down of LUN in SRB_FUNCTION_SHUTDOWN, the
> problem is I have seen the SHUTDOWN SRBs coming multiple times for the same
> LUN. And even other CBDs following the first SHUTDOWN srb. So what to for
> following CDBs and SHUTDOWN srb? Shall I just set error status for the
> SHUTDOWN srbs same for rest of the CBDs?
>
> How are these things done in good scsi miniports?
>
> In my current code which supports only one LUN per HBA i just set
> SRB_STATUS_SUCCESS for SHUTDOWN srbs and shutdown/unload the adapters in
> DriverUnload.
>
> Thanks and Regards,
> ----------------------------------------------------------------
> Charansing D Deore
> Sr. Software Developer,
> CalSoft Pvt Ltd.
> Baner Road, Pune-411045
> Office: +91 20 40792900 Ext: 3052
> Cell: +91 9850960550
> — 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