Hello,
I have created a driver for a PCI card. Currently, it works for the one
card, but I need to provide support for more than one card OF THE SAME
TYPE. Can anyone tell me how I can manage it ? I had posted this
question earlier but it was with other questions that I ran into issues
with. Please do reply.
Regards,
Sunil Jigyasu.
Hi Sunil,
See look in to the NDIS miniport driver sample in the DDK, which are made for the multiple Network physical adapter. It Will help u a lot to handle ur purpose.
Good Luck,
From: “Sunil Jigyasu”
>Reply-To: “NT Developers Interest List”
>To: “NT Developers Interest List”
>Subject: [ntdev] Reposting : Please help
>Date: Tue, 6 May 2003 00:03:12 -0400
>
>Hello,
>I have created a driver for a PCI card. Currently, it works for the one
>card, but I need to provide support for more than one card OF THE SAME
>TYPE. Can anyone tell me how I can manage it ? I had posted this
>question earlier but it was with other questions that I ran into issues
>with. Please do reply.
>Regards,
>Sunil Jigyasu.
>
>—
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
IIFA Awards. Vote now. Celebrate Indian cinema.
WDM drivers and NDIS miniports will provide this support by default.
Max
----- Original Message -----
From: “Sunil Jigyasu”
To: “NT Developers Interest List”
Sent: Tuesday, May 06, 2003 8:03 AM
Subject: [ntdev] Reposting : Please help
> Hello,
> I have created a driver for a PCI card. Currently, it works for the
one
> card, but I need to provide support for more than one card OF THE
SAME
> TYPE. Can anyone tell me how I can manage it ? I had posted this
> question earlier but it was with other questions that I ran into
issues
> with. Please do reply.
> Regards,
> Sunil Jigyasu.
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
> -----Original Message-----
From: Sunil Jigyasu [mailto:xxxxx@vigorsoft.com]
Sent: Tuesday, May 06, 2003 12:03 AM
To: NT Developers Interest List
Subject: [ntdev] Reposting : Please helpHello,
I have created a driver for a PCI card. Currently, it works
for the one card, but I need to provide support for more than
one card OF THE SAME TYPE. Can anyone tell me how I can
manage it ? I had posted this question earlier but it was
with other questions that I ran into issues with. Please do
reply. Regards, Sunil Jigyasu.
PnP will happily call your driver at your AddDevice routine for each PCI
device the PCI bus driver enumerates that has the appropriate
VID/DID/SubVendorId. Pnp will later send START_DEVICE requests providing the
resource information for these devices. Your driver, if it is written
correctly, should not care if it is managing 1 or 1000 devices. Avoid global
data. Instead you should use the deviceExtension field of the DeviceObject
for each of your managed devices to keep all per-instance state information
for these devices.
Thanks for replying, Yatindra, Maxim and Mark. The problem now narrows
down to naming the devices inside the driver. The devices will have to be
named differently by the same driver. Where do I store this information ?
As global ? And append counters for new names ?
Secondly, I understand that it would be necessary for all the cards -
though of same type – to have different DeviceIds, for driver loading.
Correct me.
Hope I’m not being overly humble, but this is my first driver and would
appreciate your patience at my ignorance.
Regards,
Sunil Jigyasu.
>
Thanks for replying, Yatindra, Maxim and Mark. The problem
now narrows down to naming the devices inside the driver.
The devices will have to be named differently by the same
driver. Where do I store this information ? As global ? And
append counters for new names ?
If this is a Pnp driver you should instead let Pnp deal with device object
names and symbolic links. You should instead create ‘interfaces’ for your
device objects. Your application(s) can then enumerate these ‘interfaces’
using the hideously named and cumbersome to use SetupDiXXXXX functions in
the SDK. (Do yourself a favor and write that enumeration code once as a
generic template and reuse it as needed.) See IoRegisterDeviceInterface in
the DDK for information about how to create device interfaces. See the
platform SDK for information about using the SetupDi functions. I think the
toaster samples in the ddk illustrate both ends of this.
Secondly, I understand that it would be necessary for all the
cards - though of same type – to have different DeviceIds,
for driver loading.
Correct me.
Absolutely not. If you mean the PCI VendorId/DeviceId/SubvendorID, then this
identifies a specific type of hardware, not an instance of a specific type
of hardware. Pnp will create a PDO device object for each instance of an
enumerated VendorId/DeviceId/SubvendorID and invoke the appropriate function
driver for that instance.