Re: WDF - how to share interrupt between two driver those are in the same stack?



The chip has a radio function and that radio function can be shared
between different protocols.
So I may have child driver A and child driver B above that radio
function.

There is one BAR for radio control, one BAR for function A and the
other BAR for function B.
Each BAR has it's own interrupt enable/disable register, but there are
all in one chip.

So I need a bus driver for radion control, and may create one or two
child driver above that bus driver.
Thanks for your relpy. Thanks. ^_^

On 2月20日, 下午10時24分, "Don Burn" <b...@xxxxxxxxxxxxxxxxxxxx> wrote:
Why do you want a bus driver here in the first place? Also, if you are
having one you should not have used an IOCTL but instead used the bus driver
model to start and stop the device giving it different resources? In
general please describe what your architecture is, since this sounds like a
design problem not an implementation question.

--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website:http://www.windrvr.com
Blog:http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

"?????" <ZivHu...@xxxxxxxxx> wrote in message

news:cd6eec86-218b-4fac-999f-211ff514c11a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



Hi all,

I have a PCI card and I need to create a KMDF bus driver and create a
static KMDF child driver above that bus driver.

The bus driver can get hardware resources and the WDF automatically
connects and disconnects interrupts for the driver .

In the WDM, I can create a IOCTL to get interrupt resource from bus
driver and connect/disconnect the interrupt in the child driver.

I have no idea how to do that in WDF, because WDF will do that
automatically. My KMDF child driver never get any hardware resouces
when loaded.

I try this method below, but it can't work. The child report there is
no available resources and fail to load the driver.

May you hlep me? Thanks. ^_^

Step1:
Copy the CM_PARTIAL_RESOURCE_DESCRIPTOR about interrupt into the bus
driver's device extension.

Step2:
//----------------------------------------------------------------------
// When the bus driver create PDO for that child
//----------------------------------------------------------------------
WDF_PDO_EVENT_CALLBACKS_INIT(&pdoCallbacks);
pdoCallbacks.EvtDeviceResourceRequirementsQuery =
BusPdo_EvtDeviceResourceRequirementsQuery;
WdfPdoInitSetEventCallbacks(pDeviceInit, &pdoCallbacks);

Step3

In the BusPdo_EvtDeviceResourceRequirementsQuery function,
I try to copy the interrupt resource from step 2. Like this

//-----------------------------------------------------------------------
NTSTATUS status = STATUS_SUCCESS;
WDFIORESLIST logConfig;
IO_RESOURCE_DESCRIPTOR descriptor;

status = WdfIoResourceListCreate(
IoResourceRequirementsList,
WDF_NO_OBJECT_ATTRIBUTES,
&logConfig
);
if(!NT_SUCCESS(status)){
return status;
}

RtlZeroMemory(&descriptor, sizeof(descriptor));

descriptor.Option = 0;
descriptor.Type = CmResourceTypeInterrupt;
descriptor.ShareDisposition = CmResourceShareShared
descriptor.Flags= RESOURCE_INTERRUPT_LEVEL_SENSITIVE
descriptor.u.Interrupt.MinimumVector =
fdoData->InterruptDescriptor.u.Interrupt.Vector;

descriptor.u.Interrupt.MaximumVector =
fdoData->InterruptDescriptor.u.Interrupt.Vector;

descriptor.u.Interrupt.TargetedProcessors=
fdoData->InterruptDescriptor.u.Interrupt.Affinity;

descriptor.u.Interrupt.AffinityPolicy= IrqPolicyMachineDefault;
descriptor.u.Interrupt.PriorityPolicy = IrqPriorityUndefined;

status = WdfIoResourceListAppendDescriptor(logConfig, &descriptor);
if(!NT_SUCCESS(status)){
return status;
}

status = WdfIoResourceRequirementsListAppendIoResList(

IoResourceRequirementsList,
logConfig
);

status = WdfIoResourceListAppendDescriptor(logConfig, &descriptor);
if(!NT_SUCCESS(status)){
return status;
}

return status;- 隱藏被引用文字 -

- 顯示被引用文字 -

.



Relevant Pages

  • Re: WDF - how to share interrupt between two driver those are in the same stack?
    ... Why do you want a bus driver here in the first place? ... I can create a IOCTL to get interrupt resource from bus ... driver and connect/disconnect the interrupt in the child driver. ...
    (microsoft.public.development.device.drivers)
  • Re: newbus questions
    ... And maybe you could get some clue looking at bktr driver, ... Okay, now I have got the bus device, the child device. ... You should only add the saa_bus_if.h to the child driver.. ...
    (freebsd-hackers)
  • Re: newbus questions
    ... that I want bus driver to provide some methods to child drivers. ... undefined symbols at module load time, I found that you need to add a ... MODULE_VERSION in a bus driver and MODULE_DEPEND in a child driver. ...
    (freebsd-hackers)
  • WDF - how to share interrupt between two driver those are in the same stack?
    ... static KMDF child driver above that bus driver. ... I can create a IOCTL to get interrupt resource from bus ... driver and connect/disconnect the interrupt in the child driver. ...
    (microsoft.public.development.device.drivers)
  • Dont want the Found New HardWare Wizard
    ... enumerates a child driver. ... When I install the driver (I ... I want to install all drivers without any pop-ups. ...
    (microsoft.public.development.device.drivers)