Doron,
We implemented this, and it almost works flawlessly. The issue is that this
is a legacy Edge-Triggered (Latched) interrupt line, but the Framework (or
maybe the kernel) appears to be triggering on the trailing edge of the
pulse. You might ask "so what, how long is the pulse, anyway?" Well, it
turns out that it appears to really be a level-high triggered interrupt
(WdfInterruptActiveHigh / InterruptActiveHigh), even though we've specified
that it's latched, so we're not getting the proper behavior. If we specify
Latched, we don't get an ISR, and if we specify LevelSensitive, we get an
ISR storm when we aren't interrupting. Seems like we might be able to
resolve it if we could set the Polarity to InterruptActiveHigh, we might be
able to make it work, but that appears to be a read-only property available
only through WdfInterruptGetInfo().
Here's the relevant snippet:
#define PRIMARY_VECTOR (14)
IO_RESOURCE_DESCRIPTOR descriptor;
RtlZeroMemory(&descriptor, sizeof(descriptor));
descriptor.Option = 0;
descriptor.Type = CmResourceTypeInterrupt;
descriptor.ShareDisposition = CmResourceShareDeviceExclusive;
descriptor.Flags = CM_RESOURCE_INTERRUPT_LATCHED;
descriptor.u.Interrupt.MinimumVector = PRIMARY_VECTOR;
descriptor.u.Interrupt.MaximumVector = PRIMARY_VECTOR;
descriptor.u.Interrupt.AffinityPolicy = IrqPolicyMachineDefault;
descriptor.u.Interrupt.PriorityPolicy = IrqPriorityNormal;
descriptor.u.Interrupt.TargetedProcessors = KeQueryActiveProcessors();
status = WdfIoResourceListAppendDescriptor(pciIdeConfig, &descriptor);
(I think) We've tried all the possible combinations of Shared/Exclusive and
Level/Latched, and nothing has worked. Any suggestions for places to look
for places we've made a mistake in setting stuff up?
Thanks,
Phil
Philip D. Barila
Seagate Technology LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.
"Doron Holan" wrote in message
news:xxxxx@ntdev...
You can use EvtDeviceFilterAddResourceRequirements to add resources to
the resource requirements list(s). If you add resources, you will need
to remove them in EvtDeviceRemoveAddedResources so that PCI.sys does not
see them and get confused by the extra resources it did not assign to
you. You do not want to use IoReportResourceForDection, bad mojo in a
pnp driver.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Philip D. Barila
Sent: Monday, June 04, 2007 3:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Mixed Legacy/PnP resources (was: Is it possible to
assign multiple interrupts to the same WDFDEVICE?)
OK, we did that, and it worked, in as much as we got the IO addresses
and
the interrupts that we forced in the inf in the resource list passed
into
EvtDevicePrepareHardware. The trouble we're seeing now is that the BAR
for
the Bus Master registers, which is programmed by the OS before the call,
isn't part of that resource list.
So the generic question is, how can I handle mixed PnP/Lgacy resources
without stepping outside of the KMDF model? If I were to dive into WDM,
I'd
just allow the OS to pass me the single BAR for the BM registers, then
claim
the IO ranges using IoReportResourceForDetection, and attach to the
interrupts using IoConnectInterrupt for vectors 14 and 15.
Is there a way to approximate the same process in KMDF? Is it a valid
pattern for a driver that isn't technically a bus driver (we don't
expose
any child devices to the OS, each HBA is one monolithic dev to the OS)
to
use the EvtDeviceResourceYYY routines to accomplish this? Is there a
callback that has the existing resources (the BM BAR) to which I can add
the
additional legacy IO ranges and interrupts that I'm currently specifying
in
the inf?
Thanks,
Phil
--
Philip D. Barila
Seagate Technology LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.
"Doron Holan" wrote in message
news:xxxxx@ntdev...
You create a WDFINTERRUPT per hw interrupt you will be assigned. On the
start device irp processing (before EvtDevicePrepareHardware is called),
KMDF walks the list of assigned resources (the cm resource list) and
pairs up each created WDFINTERRUPT to a hw interrupt in the list. This
will automatically assign vector, etc based on the assigned resources.
KMDF doesn't care how the hw resources were assigned, if you forced them
through an INF, so be it.
d
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@seagate.com
Sent: Monday, May 14, 2007 12:33 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Is it possible to assign multiple interrupts to the
same WDFDEVICE?
We're doing a test/diag driver for legacy PCI-IDE hardware, which uses
the well known legacy IDE IO ranges and interrupts. Those of you
familiar with those animals know that they use IRQ 14 for the primary
IDE channel, and IRQ 15 for the secondary, even though they are one PCI
function.
I see that the WdfInterruptCreate() doc says that I should call it twice
for this hardware, I'm not sure I understand how that's going to get
hooked up to the interrupts I want, since I can't actually indicate
which interrupt vectors I want to grab. Is this the part that the PnP
manager just does automagically because I've put the required resources
in the INF?
Thanks,
Phil
Philip D. Barila
Seagate Technology LLC
(720) 684-1842
---
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
ListServer/Forum