Hi Mark,
I can see what you are trying to say, basically if I register a device
interface with a symbolic link with something along the lines of
\DosDevices\Foo, I can tag a string on the end of the \DosDevices\Foo and
this would simply be passed down to IRP_MJ_CREATE, when the application
opens the device
so if my application opens \DosDevices\Foo\Channel1 my driver could process
the string “Channel1” and configure that channel accordingly.
However here’s my problem. lets say I want to read from Channel 1 and
Channel 2 simultaneously. How would IRP_MJ_READ know whether the requested
read operation was for the channel 1 or channel 2 interface? this is why I
am wondering whether it would be easier to have 4 functional devices for the
PCI card.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Roddy, Mark
Sent: 26 October 2005 14:06
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Multi Functional PCI Device Driver
No. This will not work. You are trying to implement a bus driver with
your approach and that is not the way to do it.
There are two approaches that can work for you. The simplest is to
create a namespace for your device. This is just a convention that your
applications and your driver know about. Your function driver creates a
device interface (a named device object visible to user mode), for
simplicity lets say the name for the interface is \DosDevices\Foo. Your
applications open \DosDevices\Foo\Channel1 or open
\DosDevices\Foo\Channel2 or … Your driver checks the FileObject name
used on IRP_MJ_CREATE, finds either nothing or Channel1 or Channel2 or
… and (hand waving alert) you are done.
More complicated is to push your design into the multifunction driver
model that is supplied with the OS. This will do what you were trying to
do with your ‘create four Function Devices in AddDevice’ approach, only
it will actually work :-). I suggest the first approach, but you can
search this list and the DDK for more information on the multifunction
driver approach as well.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of James Dunning
Sent: Wednesday, October 26, 2005 7:12 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Multi Functional PCI Device Driver
I might have answered my own question! but I am assuming all I need to
do is
during the PNP AddDevice routine is create four Functional
DeviceObjects,
and initialise the DeviceExtention for the I/O Interface Port.
Afterall the idea is to be able to handle up to four peripheral devices
connected to the PCI card, effectively each I/O Interface has its own
function.
Is this the approach I should take?
Regards
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@wipro.com
Sent: 26 October 2005 11:53
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Multi Functional PCI Device Driver
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of James Dunning
Sent: Wednesday, October 26, 2005 4:00 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Multi Functional PCI Device Driver
I am currently developing a PCI device driver, so far so good, since I
am
able to talk to the PCI device. however I have come across a design
issue.
This PCI Device has four I/O interfaces, each interface has its own
allocated internal buffer on the PCI card.
I/O Interface Port A
I/O Interface Port B
I/O Interface Port C
I/O Interface Port D
Are you talking about four function on same card or pci card with four
i/o > registers?
Unfortunately with the CreateFile operation you can not specify which
I/O
Interface you wish to use, unless you send a DeviceIoControl command
down to
the driver after it has opened to define which Interface the user wish
to
use.
I need the facility to be able to read from more than one I/O interface,
so
my question is this… is it possible to perhaps load a device driver
for
each I/O interface on the PCI card, effectively having 4 instances of
the
driver so that it can allocate any resources necessary to handle
subsequent
I/O requests.
It must be possible since I’ve seen PCI cards with combined USB,
Ethernet
and Firewire controllers built onto a single PCI card.
These cards have multiple functions.
or is there another way to handle this?
This email and any files attached are intended for the addressee and may
contain information of a confidential nature. If you are not the
intended
recipient, be aware that this email was sent to you in error and you
should
not disclose, distribute, print, copy or make other use of this email or
its
attachments. Such actions, in fact, may be unlawful. In compliance
with
the various Regulations and Acts, General Dynamics UK Limited reserves
the
right to monitor (and examine for viruses) all emails and email
attachments,
both inbound and outbound. Email communications and their attachments
may
not be secure or error- or virus-free and the company does not accept
liability or responsibility for such matters or the consequences
thereof.
Registered Office: 100 New Bridge Street, London EC4V 6JA. Registered
in
England and Wales No: 1911653.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@wipro.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
This email and any files attached are intended for the addressee and may
contain information of a confidential nature. If you are not the
intended
recipient, be aware that this email was sent to you in error and you
should
not disclose, distribute, print, copy or make other use of this email or
its
attachments. Such actions, in fact, may be unlawful. In compliance
with
the various Regulations and Acts, General Dynamics UK Limited reserves
the
right to monitor (and examine for viruses) all emails and email
attachments,
both inbound and outbound. Email communications and their attachments
may
not be secure or error- or virus-free and the company does not accept
liability or responsibility for such matters or the consequences
thereof.
Registered Office: 100 New Bridge Street, London EC4V 6JA. Registered
in
England and Wales No: 1911653.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stratus.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
This email and any files attached are intended for the addressee and may
contain information of a confidential nature. If you are not the intended
recipient, be aware that this email was sent to you in error and you should
not disclose, distribute, print, copy or make other use of this email or its
attachments. Such actions, in fact, may be unlawful. In compliance with
the various Regulations and Acts, General Dynamics UK Limited reserves the
right to monitor (and examine for viruses) all emails and email attachments,
both inbound and outbound. Email communications and their attachments may
not be secure or error- or virus-free and the company does not accept
liability or responsibility for such matters or the consequences thereof.
Registered Office: 100 New Bridge Street, London EC4V 6JA. Registered in
England and Wales No: 1911653.