questions about SDIO/NDIS driver on Windows XP

Hi,
If implementing NDIS WDM lower edge driver, is it necessary to write another SDIO miniport driver ? Will windows XP build up the driver stack like “NDIS->my WDM->SD bus driver” directly? Or else how to combine them?

Best Regards,

George

If some bus driver enumerates your device (because a card is stuck in an
SDIO slot) and creates a PDO for it with a Device ID that can be matched to
your driver (through your INF) then the answer is “yes”, Windows (more
precisely the bus driver) will build up a stack for your device. The only
thing you need to do is to install yourself as the FDO driver and then
(presumably) communicate via some mechanism to the
PDO/BusDriver/SDIO-Facility to exchange messages with your function
endpoint.

So what happens now when you stick your WiFi SDIO card (or whatever it is)
into a slot on your system now? Does the system complain it cannot find a
driver for your card or does it just see the memory function on it (if it
has one)?

In other words, what is getting enumerated into device stacks?

Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com.tw
Sent: Tuesday, January 13, 2009 8:38 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] questions about SDIO/NDIS driver on Windows XP

Hi,
If implementing NDIS WDM lower edge driver, is it necessary to write
another SDIO miniport driver ? Will windows XP build up the driver stack
like “NDIS->my WDM->SD bus driver” directly? Or else how to combine them?

Best Regards,

George


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 David,
Just planning to develop a new driver for all new device, and the card is not ready(still hardware work ).
And I wonder if there is covenient way to pass/get Tx/Rx with SDIO packet command and handle interrupt such as some SDIO callback. It means if the NDSWDM low edge driver is enough to bridge upcoming NDIS request and pass down to SDIO host driver then my card. Or I need to
other stuff, such as SDIO miniport to act as callbacks and communicate with NDISWDM.

Best Regards,

George

SDIO and SDBUS operations are not something I am all that familiar with in
detail. As best I know (and that is not much) using SDBUS.LIB does not
really force you into a ‘miniport’ model but is instead a layered model over
the SDBUS generated PDO.

Instead of calling SdBusOpenInterface() from AddDevice() you would call it
from MiniportInitialize() after having retrieved the PDO and Lower DO from
NDIS (see NDISEDGE for the KMDF version or NDISWDM for the WDM version).

If you find that you must deal with SDBUS from a pure WDM environment you
can always build a lower filter that talks to SDBUS and exposes a private
device interface which you then fetch during the MiniportInitialize() of an
NDIS Miniport (NDISWDM or NDISEDGE style). Building an NDIS driver for a
WDM bus with a lower filter to communicate to the bus is a perfectly
reasonable thing to do. However, I don’t’ think it is necessary with SD
(just like it is not necessary with USB).

Once you have the SDBUS_INTERFACE_STANDARD you should be good to go. A
deserialized NDIS Miniport can take callbacks at DISPATCH_LEVEL and does not
need to have SDBUS dispatch the psuedo-interrupts and callbacks at
PASSIVE_LEVEL (CallbackAtDpcLevel = FALSE). Just remember you cannot rely
on the callback being DISPATCH_LEVEL so spinlocks must be acquired assuming
IRQL <= DISPATCH_LEVEL.

Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development

wrote in message news:xxxxx@ntdev…
> Hi David,
> Just planning to develop a new driver for all new device, and the
> card is not ready(still hardware work ).
> And I wonder if there is covenient way to pass/get Tx/Rx with SDIO
> packet command and handle interrupt such as some SDIO callback. It means
> if the NDSWDM low edge driver is enough to bridge upcoming NDIS request
> and pass down to SDIO host driver then my card. Or I need to
> other stuff, such as SDIO miniport to act as callbacks and communicate
> with NDISWDM.
>
> Best Regards,
>
> George
>

George,

I can confirm that one is capable of developing a single NDIS driver over an SDIO function. Just note that if you plan on obtaining the WHQL certification for that driver, it must be NDIS/WDF rather than NDIS/WDM.

Hope it helps,

Ilya Faenson
Rockvile, MD USA

Hi,
Thanks for the information.
Both of PDO and Lower DeviceObject seem to be “PnP Manager”, so the SdBusOpenInterface
fails at initialization callback. Since DDK states SD bus is like USB, is it possible pnp manager help to translate IRP to SRP since the inf specifies sd\vid_xxxx&pid_xxxx. Or something else wrong?

George

Hi Ilya,

Just note that if you plan on obtaining the WHQL certification for that driver, it must be NDIS/WDF
rather than NDIS/WDM.
Why is that?

S.

What is the output of !devstack (your PDO) ? Does it start with ROOT or SD? How did you install your driver? Through the add new hw wizard or did you choose update driver in device manager?

My guess is that you did not install your driver on the sd bus enumerated stack. The pnp manager does not know about SRPs, it does not know about any bus specific request packet.

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@yahoo.com.tw
Sent: Wednesday, February 04, 2009 8:47 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] questions about SDIO/NDIS driver on Windows XP

Hi,
Thanks for the information.
Both of PDO and Lower DeviceObject seem to be “PnP Manager”, so the SdBusOpenInterface
fails at initialization callback. Since DDK states SD bus is like USB, is it possible pnp manager help to translate IRP to SRP since the inf specifies sd\vid_xxxx&pid_xxxx. Or something else wrong?

George


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 Doron,

Is it possible my SD card has something wrong such as connection fail with host controller, and the sd host controller is replaced with “pnp manager”? I had seen “NdisMQueryAdapterResources” fails.

George

Here’s a relevant quote from the BUSPORT-0011 Windows Hardware Logo Program Requirement:

“The SDIO device drivermust bewritten using the WDF Kernel Mode Driver Framework for its implementation.”

Note that that the WDK SDIO sample is in fact WDF.

Regards,

Ilya Faenson
Rockville, MD USA

-----Original Message-----
From: xxxxx@gmail.com
Sent: Thursday, February 05, 2009 2:50 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] questions about SDIO/NDIS driver on Windows XP

Hi Ilya,

> Just note that if you plan on obtaining the WHQL certification for that
driver, it must be NDIS/WDF
> rather than NDIS/WDM.
Why is that?

S.

Nothing magical like this happens. Please answer my previous questions, if you do not have a kernel debugger attached, open device manager and finf your device, open the properties dialog, goto the details tab and find the “device instance id” property. Send this string in your response

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@yahoo.com.tw
Sent: Thursday, February 05, 2009 1:15 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] questions about SDIO/NDIS driver on Windows XP

Hi Doron,

Is it possible my SD card has something wrong such as connection fail with host controller, and the sd host controller is replaced with “pnp manager”? I had seen “NdisMQueryAdapterResources” fails.

George


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,

After fixing sd card firmware issue, the driver can call SdBusOpenInterface successfully. The “device instanace id” is “sd\VID_XXXX&PID_XXXX” and the device_name of PDO is “\driver\sdbus”.

Regards,

George

Hi,
After calling InitializeInterface, it fails at “SDP_FUNCTION_NUMBER”. The retuen status is STATUS_PENDING_DELETE(0xC0000056). What’s wrong is it?

The code is as following,

NTSTATUS
SDProperty(
IN PMP_ADAPTER Adapter,
IN SD_REQUEST_FUNCTION direction,
IN SDBUS_PROPERTY property,
IN OUT ULONG *value )
{
PSDBUS_REQUEST_PACKET sdrp;
NTSTATUS status;

sdrp = ExAllocatePool(NonPagedPool, sizeof(SDBUS_REQUEST_PACKET));
if (!sdrp)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
RtlZeroMemory(sdrp, sizeof(SDBUS_REQUEST_PACKET));
sdrp->RequestFunction = direction; //SDRF_GET_PROPERTY;
sdrp->Parameters.GetSetProperty.Property = property; //SDP_FUNCTION_NUMBER;
sdrp->Parameters.GetSetProperty.Buffer = value;
sdrp->Parameters.GetSetProperty.Length = sizeof(ULONG);
status = SdBusSubmitRequest (Adapter->SDBusInterface.Context, sdrp);
ExFreePool(sdrp);
return status;
}

Status = SDProperty(Adapter, SDRF_GET_PROPERTY, SDP_FUNCTION_NUMBER, &Adapter->SDFunctionNumer);

Hi,
After tracing “SdBusSubmitRequest”, the library seems to check “SDBUS_INTERFACE_STANDARD->Context”. The first field is “SDIC” but the second field is (ULONG)0 and the library exits with 0xc0000056.
The windows is XP SP3 and DDK is Server 2003 (3790.1830). Should I change DDK version or OS?

Regards,

George