Just so that I can be on all sides of this issue, he can also implement the
other suggestion: multiple interfaces for a single functional device object.
I thought from his post that there was some technical obstacle that
prevented him from implementing two logical NT device interfaces (not to be
confused with USB interfaces) for his single USB device. On re-reading it, I
don’t see what the obstacle is and think that perhaps the easiest approach
is to use the multiple interface single device approach. Heck, he doesn’t
actually even have to have two distinct interfaces, he could use one
interface and then open it with a path name that identifies which logical
function he wants to communicate with. All of which is perhaps simpler than
implementing a bus driver and multiple function drivers.
=====================
Mark Roddy
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Monday, January 24, 2005 12:19 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] One driver for different functions (interfaces)
You want to create a bus driver. Each of the children will be your distinct
function. This way you see both functions as separate entities in device
manager.
As for the threads, that seems heavy handed to me and doesn’t scale well
when you have multiple instances of your device. Usually you can do the
synchronizawtion with some circular ring buffers and w/out waiting by doing
processing in a DPC routine with some simple state machine logic.
But, I don’t have to maintain the code, you do :)…so you should do what
you think is the easiest to maintain and debug over time.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Marten Lootsma
Sent: Monday, January 24, 2005 8:12 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] One driver for different functions (interfaces)
Hi all,
This post is a continue from “Central driver with different interfaces”
what I post 4 January.
I get a lot of reactions and I thought it would be enough. But I can’t find
a good solution for our device.
We have a electronical measurement device on usb (with oscilosscope and
functiongenerator). Because we can’t support different interfaces in the
device it self we want to split the functionality in the driver. Just create
another interface with IoRegisterDeviceInterface is not enough.
We want to ‘see’ the driver in the Device Manager *in different classes*. So
the application can search for scope devices Or functiongenarator devices.
I want to build one driver who talks with the measuerement device. And
create two interfaces, one for the Scope and one for a FunctionGenerator.
Who will be called when device is connected. On AddDevice I want to create a
main device object and the two different device objects who representate the
two functionalities of the device.
But strange enough IoRegisterDeviceInterface only accept the
PhysicalDeviceObject (as I understud). That’s why my first question is:
*Is it possible to create (and enable) an interface for own created device
objects?*
*Can I make one sys to handle all, fdo and the irp’s from the two
interfaces?*
If yes I want to setup a system like you can see in this picture.
http://www.mlcs.nl/driver.jpg
When a device is connected (AddDevice) I want to create also 3 threads.
Also one for the intrument and two for the interfaces. The comunicate
through Events. For example, the scope, the interface would contain the
settings for the next measurement for the scope. When the settings tell that
we need to measure, the central part will start a measure in the device.
When it’s ready the data will come into the interface and availble for the
applications.
Is that a good idea or is it totally wrong?
Thanks in advance
Marten Lootsma
(Student)
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com