How can I write SCSI miniport driver with KMDF?

Hi, all

I’m fixing a bug in my SCSI miniport driver now. Well, my driver was written with DDK, there was a bug with it, it didn’t work after system standby or hibernate. I searched all post here about that and then I determine to re-write my driver with the KMDF. I hope the framework can handle the power and pnp management to resolve my problem.

MS KMDF provides only one sample code about miniport driver, that is NDIS miniport driver(\src\kmdf\ndisedge). After read it I found that KMDF miniport driver need invoke WdfDeviceMiniPortCreate instead of WdfDeviceCreate. The WdfDeviceMiniPortCreate need three spcific parameters, the PDO, FDO and next lower device stack pointer of the miniport. The problem is NDIS driver can get them by invoke WdfDeviceMiniPortCreate easily, but how can other non-NDIS driver get these parameters? I’v got the PDO by invoke WdfFdoInitWdmGetPhysicalDevice, but I don’t know how can I get the other 2 parameters, the FDO and the next lower device stack pointer. Can someone help me? Any reply is appreciated. Thanks.

Regards

Felix

KMDF is not appropriate for writing a scsi miniport. The value it adds
is almost zero in a scs miniport environment b/c SCSIport does all the
things that KMDF does (pnp, pwr, i/o queueing, etc).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
cracker_prince@163.com
Sent: Tuesday, August 29, 2006 8:15 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How can I write SCSI miniport driver with KMDF?

Hi, all

I’m fixing a bug in my SCSI miniport driver now. Well, my driver was
written with DDK, there was a bug with it, it didn’t work after system
standby or hibernate. I searched all post here about that and then I
determine to re-write my driver with the KMDF. I hope the framework can
handle the power and pnp management to resolve my problem.

MS KMDF provides only one sample code about miniport driver, that is
NDIS miniport driver(\src\kmdf\ndisedge). After read it I found that
KMDF miniport driver need invoke WdfDeviceMiniPortCreate instead of
WdfDeviceCreate. The WdfDeviceMiniPortCreate need three spcific
parameters, the PDO, FDO and next lower device stack pointer of the
miniport. The problem is NDIS driver can get them by invoke
WdfDeviceMiniPortCreate easily, but how can other non-NDIS driver get
these parameters? I’v got the PDO by invoke
WdfFdoInitWdmGetPhysicalDevice, but I don’t know how can I get the other
2 parameters, the FDO and the next lower device stack pointer. Can
someone help me? Any reply is appreciated. Thanks.

Regards

Felix


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

Thanks for reply, Doron. If KMDF can not solve my problem, what can I do next? Can you give me the directions to fix the bug?

Regards

Felix

I am not sure what the bug is. You said you had issues w/return from low power. I have not been following this thread (if there has been one at all), perhaps you can restate the problem and the folks who are more familiar w/scsiport can help you out

d

Okay, thanks in a million. I’ll post a new thread to represent the issue I have. Thank you very much!

I don’t think KMDF has anything to do with SCSI miniports. The thing is
that KMDF is a wrapper around the kernel, and SCSIPORT is a wrapper too :slight_smile: so,
it plays the same role KMDF plays to, say, USD drivers.

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

----- Original Message -----
From: <cracker_prince>
To: “Windows System Software Devs Interest List”
Sent: Wednesday, August 30, 2006 7:15 AM
Subject: [ntdev] How can I write SCSI miniport driver with KMDF?

> Hi, all
>
> I’m fixing a bug in my SCSI miniport driver now. Well, my driver was written
with DDK, there was a bug with it, it didn’t work after system standby or
hibernate. I searched all post here about that and then I determine to re-write
my driver with the KMDF. I hope the framework can handle the power and pnp
management to resolve my problem.
>
> MS KMDF provides only one sample code about miniport driver, that is NDIS
miniport driver(\src\kmdf\ndisedge). After read it I found that KMDF miniport
driver need invoke WdfDeviceMiniPortCreate instead of WdfDeviceCreate. The
WdfDeviceMiniPortCreate need three spcific parameters, the PDO, FDO and next
lower device stack pointer of the miniport. The problem is NDIS driver can get
them by invoke WdfDeviceMiniPortCreate easily, but how can other non-NDIS
driver get these parameters? I’v got the PDO by invoke
WdfFdoInitWdmGetPhysicalDevice, but I don’t know how can I get the other 2
parameters, the FDO and the next lower device stack pointer. Can someone help
me? Any reply is appreciated. Thanks.
>
> Regards
>
> Felix
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</cracker_prince>

Okay, thank Maxim for the reply, I got it, thank you.