Re: RE:Ndis Miniport Driver for a NIC card with multiple ethernet ports

For experimenting the arbitration, I just created some dummy resource
descriptor in my bus driver for the child device i created. What i observed
is the memory resource and interrupt resource are exported to my child
device(saw through device manager resource tab). If we can export the
memory like this what is preventing exporting the real memory address to
its child pdo?

NTSTATUS EvtDeviceResourcesQuery(
In WDFDEVICE Device,
In WDFCMRESLIST Resources
)
{
static unsigned char dummy_memory[4096];
CM_PARTIAL_RESOURCE_DESCRIPTOR DummyDescriptor;

DummyDescriptor.Type = CmResourceTypeMemory;
DummyDescriptor.Flags = CM_RESOURCE_MEMORY_READ_WRITE;

DummyDescriptor.u.Memory.Start.QuadPart = (LONGLONG)dummy_memory;
DummyDescriptor.u.Memory.Length = 4096;

Status = WdfCmResourceListInsertDescriptor(Resources, &DummyDescriptor, 0);
if (!NT_SUCCESS(Status))
{
return Status;
}
memset(&DummyDescriptor, 0, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
DummyDescriptor.Type = CmResourceTypeInterrupt;
DummyDescriptor.Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE;
DummyDescriptor.ShareDisposition = CmResourceShareShared;
DummyDescriptor.u.Interrupt.Level = 0x5;
DummyDescriptor.u.Interrupt.Vector = 0xF0; //taken random value
Status = WdfCmResourceListInsertDescriptor(Resources, &DummyDescriptor, 1);
if (!NT_SUCCESS(Status))
{
return Status;
}
}

On Tue, Apr 28, 2015 at 12:19 AM, Doron Holan
wrote:

> Yes, or query interface
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *Sachindranath p.v
> Sent: Monday, April 27, 2015 11:07 AM
>
> To: Windows System Software Devs Interest List
> Subject: Re: RE:[ntdev] Ndis Miniport Driver for a NIC card with
> multiple ethernet ports
>
>
>
> Is private interface route is like IOCTL Communication?
>
>
>
> On Mon, Apr 27, 2015 at 12:02 PM, Doron Holan
> wrote:
>
> No, you can’t. the interfaces to arbitrate those pci resources are not
> documented, you have to go the private interface route
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *Sachindranath p.v
> Sent: Sunday, April 26, 2015 11:28 PM
> To: Windows System Software Devs Interest List
> Subject: Re: RE:[ntdev] Ndis Miniport Driver for a NIC card with
> multiple ethernet ports
>
>
>
> Write a custom bus driver to manually do the carving yourself (for
> complex resource allocation or interdependencies), as discussed above
> (although you can get by with just 2 drivers and not necessarily 3)

>
>
>
> If we are creating child PDO from custom bus driver, Can we use
> *EvtDeviceResourcesQuery(*WDF_PDO_EVENT_CALLBACKS) calbacks to export
> resource descriptor(by creating or dividing manually) to its child devices?
>
>
>
>
>
>
>
> On Sat, Oct 12, 2013 at 1:57 AM, Jeffrey Tippet <
> xxxxx@microsoft.com> wrote:
>
> No - the “port” concept provided by NdisMAllocatePort is not meant to deal
> with hardware that has multiple physical ports. Hardware that has multiple
> physical ports should either:
>
> (a) Expose each port as a separate PCI function, so the OS automatically
> carves up the hardware into multiple independent NICs
>
> (b) Use mf.sys to explicitly carve up the hardware into independent NICs
> (assuming static resource allocation); or
>
> (c) Write a custom bus driver to manually do the carving yourself (for
> complex resource allocation or interdependencies), as discussed above
> (although you can get by with just 2 drivers and not necessarily 3)
>
>
> The “port” concept provided by NdisMAllocatePort is meant for other
> abstractions. Its usage is contextual: for a wireless NIC, a port is a way
> to select virtual MACs. Above an Ethernet NIC, ports are reserved for the
> operating system’s NIC Teaming or Bridging features.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>
>
>
>
>
> –
>
> Regards
>
> Sachindranath
>
> http:
>
>
>
>
>
> — NTDEV is sponsored by OSR Visit the list at:
> http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See
> http://www.osr.com/careers 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
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>
>
>
>
>
> –
>
> Regards
>
> Sachindranath
>
> http:
>
>
>
>
>
> — NTDEV is sponsored by OSR Visit the list at:
> http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See
> http://www.osr.com/careers 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
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>


Regards
Sachindranath
http:</http:></http:></http:>