synchronization between different drivers

Hi Experts,

I have a network driver which is based on NDIS. My system have 4 NIC’s with different VID and PID are connected as a result 4 network driver’s will be loaded.There is a scenerio where all of these NIC’s tries to access same HW resource.Hence i need a mechanism to synchronize the accessing of HW resource among these drivers.

Please let me know is there any mechanism to synchronize the resource between the multiple drivers.

Thanks,
Sachin

xxxxx@gmail.com wrote:

I have a network driver which is based on NDIS. My system have 4 NIC’s with different VID and PID are connected as a result 4 network driver’s will be loaded.There is a scenerio where all of these NIC’s tries to access same HW resource.Hence i need a mechanism to synchronize the accessing of HW resource among these drivers.

Please let me know is there any mechanism to synchronize the resource between the multiple drivers.

There are many such methods. One way is IoCreateSynchronizationEvent.
As long as you use the same event name in your drivers, they’ll all
share a single instance. Create the event in a “signalled” state. When
you want the resource, you use KeWaitForSingleObject. When you’re
through, you use KeSetEvent. So, the signalled state basically means
“the resource is available”.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Well, depending on the situation (namely, on IRQL constraints, as well as on how long you plan to own a locked section) you may use either a spinlock or a dispatcher-level construct.

The latter may be synch event (which, in actuality is just a binary semaphore), mutex or fast mutex.
The difference between the latter two is that, unlike a “regular” mutex, FAST_ MUTEX cannot be acquired recursively.

Therefore, everything depends on the particular situation…

Anton Bassov

Assuming you are writing all the drivers, consider creating a 5th driver for
just the shared HW resource, then provide some support routines for
accessing it. You can expose the support routines through a device
interface or through an IOCTL mechanism.

Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Tuesday, February 28, 2017 7:58 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] synchronization between different drivers

Hi Experts,

I have a network driver which is based on NDIS. My system have 4 NIC’s with
different VID and PID are connected as a result 4 network driver’s will be
loaded.There is a scenerio where all of these NIC’s tries to access same HW
resource.Hence i need a mechanism to synchronize the accessing of HW
resource among these drivers.

Please let me know is there any mechanism to synchronize the resource
between the multiple drivers.

Thanks,
Sachin


NTDEV is sponsored by OSR

Visit the list online at:
http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software
drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at
http:</http:></http:></http:>