It’s good to hear your suggestion about 3 device object. It seems a good
solution to us.
But how it’s going on a remove from the device? Who will get the message
first? When we share data, where is it safe to free that memory. Maybe a
own made refcount and on zero the memory can be free’d, or are there
better (offical) ways?
Why we don’t use the standard solution? De device we have connected is
very pasive. The resources on the device is separated between the two
sub functionalities. When one is taking more, the other has less. This
we need to organize central. But in de device there is not enough power
to do that.
And the driver works already fine. But we want let it look like
separated devices. In the driver it’s already well separated. There is a
settings array written by userside and the hardwareside reads it and put
it to the hardware. So I think that array is a the part the device
obecjets will share.
About the definision of my question: We are orientating what how we can
change our driver to what we want. I think it’s a design issue, but we
need to know also of we can realize it with programming…
Tnx
Marten Lootsma
Peter Viscarola (OSR) wrote:
>
> Now (in the current driver) we stored information, like settings of
> the hardware, in DEVICE_EXTENSION. The hardware settings are depending
> on both functionalities from the device. So even when we have two
> different DEVICE_OBJECT we would like to have the hardware settings
> central, se we can send this information from one place to the device.
>
So, this is now a programming question and not a design issue, is that
right?
Personally, what I’d suggest is that you create 3 device objects: One
that desscribes the overall state of your hardware, and the other two
that represent functions X and Y on your device.
This keeps the hardware state and user interface state where it should be.
Speaking of which, what you SHOULD have are two separate USB INTERFACES,
right? This would allow TWO separate drivers to load, and you wouldn’t
have this problem. Why not change the device’s USB descriptor and fix
this the right way?
Peter
OSR