How to store some state after ScsiStopAdapter for scsi miniport driver

Hi folks,

After scsi miniport driver HwScsiAdapterControl routine get ScsiStopAdapter control type, from WDK document I get that:

‘‘After HwScsiAdapterControl returns from stopping the HBA, any data structures allocated on behalf of the miniport driver for the HBA should be considered invalid until the miniport driver is asked to restart.’’

First of all, I just want to confirm that does the doc means that after return from ScsiStopAdapter, DeviceExtension data structure is also invalid? If so, my driver still have some routine running. I need to use some state flags to let these routine just return without any further process when these routine are called. Where can I store these state flags?

Thanks
Wayne

IIRC after a ScsiStopAdapter you could be unloaded, so you can’t really leave any “routine running”. After this point you have no more interrupts from your device and no new calls to any of your miniport’s Hw exports. What are the routines you still have running in this case?

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@oracle.com
Sent: Tuesday, January 13, 2009 8:36 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to store some state after ScsiStopAdapter for scsi miniport driver

Hi folks,

After scsi miniport driver HwScsiAdapterControl routine get ScsiStopAdapter control type, from WDK document I get that:

‘‘After HwScsiAdapterControl returns from stopping the HBA, any data structures allocated on behalf of the miniport driver for the HBA should be considered invalid until the miniport driver is asked to restart.’’

First of all, I just want to confirm that does the doc means that after return from ScsiStopAdapter, DeviceExtension data structure is also invalid? If so, my driver still have some routine running. I need to use some state flags to let these routine just return without any further process when these routine are called. Where can I store these state flags?

Thanks
Wayne


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

HI There,
You simple cannot have any routines running after StopAdapter. If you had some timer or anything else you will need to stop and cleanup everything. The device extension is not valid after ScsiStopAdapter. If there is a need for anything to run after ScsiStopAdapter then the design is not correct.

– Aj

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@oracle.com
Sent: Tuesday, January 13, 2009 8:36 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to store some state after ScsiStopAdapter for scsi miniport driver

Hi folks,

After scsi miniport driver HwScsiAdapterControl routine get ScsiStopAdapter control type, from WDK document I get that:

‘‘After HwScsiAdapterControl returns from stopping the HBA, any data structures allocated on behalf of the miniport driver for the HBA should be considered invalid until the miniport driver is asked to restart.’’

First of all, I just want to confirm that does the doc means that after return from ScsiStopAdapter, DeviceExtension data structure is also invalid? If so, my driver still have some routine running. I need to use some state flags to let these routine just return without any further process when these routine are called. Where can I store these state flags?

Thanks
Wayne


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

Yes, that is what it means. Your driver should not return from
ScsiStopAdapter until it does not have any routines running. Stop means
stop.
The state transitions from ScsiStopAdapter are either ScsiRestartAdapter,
which restores your previous configuration, or
HwScsiFindAdapter/HwScsiInitializeAdapter, which results in a new
configuration. The first transition is a power management transition while
the second is a result of resource rebalancing.

Mark Roddy

On Tue, Jan 13, 2009 at 11:36 AM, wrote:

> Hi folks,
>
> After scsi miniport driver HwScsiAdapterControl routine get ScsiStopAdapter
> control type, from WDK document I get that:
>
> ‘‘After HwScsiAdapterControl returns from stopping the HBA, any data
> structures allocated on behalf of the miniport driver for the HBA should be
> considered invalid until the miniport driver is asked to restart.’’
>
> First of all, I just want to confirm that does the doc means that after
> return from ScsiStopAdapter, DeviceExtension data structure is also invalid?
> If so, my driver still have some routine running. I need to use some state
> flags to let these routine just return without any further process when
> these routine are called. Where can I store these state flags?
>
> Thanks
> Wayne
>
> —
> 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
>

Thanks for all of you to remained me. I will check the design to cut
this case.

Thanks
Wayne