Finding the right card (was PCI-to-Cardbus question)

Just wanted to say thanks again for the ntdev forum’s help getting me pointed in the right direction on the PCMCIA driver. I have it working now.

My next thing is reconfiguring my old NT 4.0 calling applications because they connect to devices via a symbolic link name instead of using GUID’s as in WDM.

Here’s my new problem: If I am running two of the same PC card, and both cards have the same GUID, I have to find the correct card to send the connection request to. It appears this choice piece of information is not made available to a PCMCIA card behind a CardBus. So here’s what I do:

  1. My app queries the card’s parent bus driver for the information. It’s contained in the Location Information String, which can only be acquired after a series of laborious and tedious function calls that require me to get a class GUID for all connected devices, acquire a context structure for each enumerated device for that GUID class, and fill out a DeviceInformationSet for each device.
  2. Using this, the Parent DeviceInformationSet is acquired, initialized, and finally filled out by the parent bus driver. At this point, I parse the string and only then so I know which slot I’m talking to! Then, if it’s the correct device, I send a connection request; otherwise, I repeat the process until I either find the desired device, or run out of devices to query (or patience!)

Am I doing this right, or can anyone tell me an easier, less convoluted manner of doing this? I miss the good ol’ symbolic link name days!

Jeremy R.

----- Original Message -----
From: Susaant
To: Windows System Software Devs Interest List
Sent: Wednesday, January 28, 2004 9:15 AM
Subject: Re: [ntdev] PCI-to-Cardbus question

Hi Jeremy,

I have written driver for both PCMCIA and Cardbus cards for custom requirement, both of which were tested and verified through their insertion in TI1420 pci-cardbus converter. The catch though is that I faced some problem with interrupt in win2k but in XP it worked perfectly well.

Coming to your problem, there is no need to access the 1420’s registers for your card initialization. When the card is inserted the Host should see that a PCMCIA card is inserted and would allocate IO space for that PCMCIA/Cardbus card as requested in your configuration registers in hardware. You will get a handle to this IO space when you query on this resource and you can use that to access your registers. The 1420 is completely transparent this whole process.

Like I said, I too faced problems with 1420 in win2K environment, but I could access the registers on my hardware correctly and could read and write into them even in 2K environment. Only when my card is raising interrupt the host is not able to recognize that interrupt correctly.

Again, in XP (I use professional), I faced no problems with this controller and things worked fine with me. I suggest to give XP a try.

Regards,
Susaant.

No that sounds about right. Consider writing your SetupApi code such that it
is more or less re-usable, as that will cut down on the tedium factor.

=====================
Mark Roddy


From: Jeremy Rasmussen [mailto:xxxxx@msn.com]
Sent: Monday, February 09, 2004 1:46 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Finding the right card (was PCI-to-Cardbus question)

Just wanted to say thanks again for the ntdev forum’s help getting me
pointed in the right direction on the PCMCIA driver. I have it working now.

My next thing is reconfiguring my old NT 4.0 calling applications because
they connect to devices via a symbolic link name instead of using GUID’s as
in WDM.

Here’s my new problem: If I am running two of the same PC card, and both
cards have the same GUID, I have to find the correct card to send the
connection request to. It appears this choice piece of information is not
made available to a PCMCIA card behind a CardBus. So here’s what I do:

  1. My app queries the card’s parent bus driver for the information. It’s
    contained in the Location Information String, which can only be acquired
    after a series of laborious and tedious function calls that require me to
    get a class GUID for all connected devices, acquire a context structure for
    each enumerated device for that GUID class, and fill out a
    DeviceInformationSet for each device.
  2. Using this, the Parent DeviceInformationSet is acquired, initialized, and
    finally filled out by the parent bus driver. At this point, I parse the
    string and only then so I know which slot I’m talking to! Then, if it’s the
    correct device, I send a connection request; otherwise, I repeat the process
    until I either find the desired device, or run out of devices to query (or
    patience!)

Am I doing this right, or can anyone tell me an easier, less convoluted
manner of doing this? I miss the good ol’ symbolic link name days!

Jeremy R.

----- Original Message -----
From: Susaant mailto:xxxxx
To: Windows System Software Devs Interest mailto:xxxxx List

Sent: Wednesday, January 28, 2004 9:15 AM
Subject: Re: [ntdev] PCI-to-Cardbus question

Hi Jeremy,

I have written driver for both PCMCIA and Cardbus cards for custom
requirement, both of which were tested and verified through their insertion
in TI1420 pci-cardbus converter. The catch though is that I faced some
problem with interrupt in win2k but in XP it worked perfectly well.

Coming to your problem, there is no need to access the 1420’s registers for
your card initialization. When the card is inserted the Host should see that
a PCMCIA card is inserted and would allocate IO space for that
PCMCIA/Cardbus card as requested in your configuration registers in
hardware. You will get a handle to this IO space when you query on this
resource and you can use that to access your registers. The 1420 is
completely transparent this whole process.

Like I said, I too faced problems with 1420 in win2K environment, but I
could access the registers on my hardware correctly and could read and write
into them even in 2K environment. Only when my card is raising interrupt the
host is not able to recognize that interrupt correctly.

Again, in XP (I use professional), I faced no problems with this controller
and things worked fine with me. I suggest to give XP a try.

Regards,
Susaant.


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</mailto:xxxxx></mailto:xxxxx>

Hello Jeremy

I had similar situation - two of the same Cardbus cards inserted in laptop.
In driver’s StartDevice I sent IRP_MN_QUERY_CAPABILITIES to the PCMCIA to
get the slot ID for card (but it did not work on some versions of the
Windows).
Than application enumerated the cards using SetupDiGetDeviceInterfaceDetail
and gets the attached slot number, using DeviceIOControl
Is it that you need?

Nikolay

“Jeremy Rasmussen” wrote in message news:xxxxx@ntdev…
Just wanted to say thanks again for the ntdev forum’s help getting me
pointed in the right direction on the PCMCIA driver. I have it working now.

My next thing is reconfiguring my old NT 4.0 calling applications because
they connect to devices via a symbolic link name instead of using GUID’s as
in WDM.

Here’s my new problem: If I am running two of the same PC card, and both
cards have the same GUID, I have to find the correct card to send the
connection request to. It appears this choice piece of information is not
made available to a PCMCIA card behind a CardBus. So here’s what I do:
1) My app queries the card’s parent bus driver for the information. It’s
contained in the Location Information String, which can only be acquired
after a series of laborious and tedious function calls that require me to
get a class GUID for all connected devices, acquire a context structure for
each enumerated device for that GUID class, and fill out a
DeviceInformationSet for each device.
2) Using this, the Parent DeviceInformationSet is acquired, initialized, and
finally filled out by the parent bus driver. At this point, I parse the
string and only then so I know which slot I’m talking to! Then, if it’s the
correct device, I send a connection request; otherwise, I repeat the process
until I either find the desired device, or run out of devices to query (or
patience!)

Am I doing this right, or can anyone tell me an easier, less convoluted
manner of doing this? I miss the good ol’ symbolic link name days!

Jeremy R.

----- Original Message -----
From: Susaant
To: Windows System Software Devs Interest List
Sent: Wednesday, January 28, 2004 9:15 AM
Subject: Re: [ntdev] PCI-to-Cardbus question

Hi Jeremy,

I have written driver for both PCMCIA and Cardbus cards for custom
requirement, both of which were tested and verified through their insertion
in TI1420 pci-cardbus converter. The catch though is that I faced some
problem with interrupt in win2k but in XP it worked perfectly well.

Coming to your problem, there is no need to access the 1420’s registers for
your card initialization. When the card is inserted the Host should see that
a PCMCIA card is inserted and would allocate IO space for that
PCMCIA/Cardbus card as requested in your configuration registers in
hardware. You will get a handle to this IO space when you query on this
resource and you can use that to access your registers. The 1420 is
completely transparent this whole process.

Like I said, I too faced problems with 1420 in win2K environment, but I
could access the registers on my hardware correctly and could read and write
into them even in 2K environment. Only when my card is raising interrupt the
host is not able to recognize that interrupt correctly.

Again, in XP (I use professional), I faced no problems with this controller
and things worked fine with me. I suggest to give XP a try.

Regards,
Susaant.