Accessing the PCMCIA ATTRIBUTE MEMORY AND configuration space

friends,

As per the DDK documentation,inorder to get the Attibute Memory contents,
:-

A driver performs the following sequence of operations:

Creates and initializes a new IRP_MJ_PNP request.

The driver specifies either an IRP_MN_READ_CONFIG or an IRP_MN_WRITE_CONFIG
minor function.

Gets the next stack location.

Sets the following members of the Parameters.ReadWriteConfig structure in
the new stack location:

WhichSpace: specifies the value PCCARD_ATTRIBUTE_MEMORY.
Buffer : Pointer to a paged-memory buffer that the driver allocates
for the access. For a write operation, the buffer contains
data to write to the configuration space. For a read operation, the buffer
is a zero-filled buffer. After the request completes, this buffer holds a
copy of the attribute memory read from the device.

Offset : Specifies the byte offset from the base of the attribute memory
where the read or write operation begins.

Length : Specifies the size in bytes of the buffer that the driver
allocates for the request.

Sets a completion routine.

Sends the request down the device stack.

My Question:

1)PCCARD_ATTRIBUTE_MEMORY where can I find this Macro…??
I had found only the PCI_COMMON_CONFIG…but I couldn’t find
PCCARD_ATTRIBUTE_MEMORY.

2)In case of Pci,as we can get the data in BAR0,BAR1…by enumerating the
U.memory.start and U.memory.length…which gets registered in the RESOURCE
LIST DURING THE DRIVER LOAD TIME. But since the PCMICA is hot
swapped,should i EXPLICITLY pass any IRP or do the PNP MANAGER PASS ANY
IRP TO DETECT THE INSERTION OF THE PCMCIA CARD,AND TO ALLOCATE THE
RESOURCE…???

  1. During the Removal of card which IRP IS CALLED BY THE PNP MANAGER,or
    during removal of the card…

4)If anybody of you can let me know the complete outline structure OF THE
FLOW INVOLVED IN PCMCIA BASED WDM DRIVER FOR WINDOWS 2000…


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hello,

KB article Q308038 demonstrates (through code) how to access the
attribute memory (i.e. the CIS or the config registers) of a pcmcia
card.

The outline structure of a pcmcia WDM driver is very similar to other
WDM drivers. You might want to look at the toaster function driver in
the DDK for an excellent sample of a WDM driver (under
%DDK%\src\general\toaster\func). Of course, there will be some code
specific to your device, e.g. configuring any manufacturer-specific
registers if any or the mechanism of checking when your device
interrupts and if so clearing it, …

Regarding the i/o resource allocation for the card, you just need to
request the resources in the card’s tuples (in the CIS) or in an
override section in the inf file. PnP manager will then try to allocate
the requested resources and if successful, will pass you the allocated
resources (both raw and translated) in the IRP_MN_START_DEVICE irp
parameters.

Thanks
Khalid

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Shiva Prasad. T. S. [mailto:xxxxx@yahoo.com]
Sent: Wednesday, December 26, 2001 4:00 PM
To: NT Developers Interest List
Subject: [ntdev] Accessing the PCMCIA ATTRIBUTE MEMORY AND configuration
space

friends,

As per the DDK documentation,inorder to get the Attibute Memory
contents,
:-

A driver performs the following sequence of operations:

Creates and initializes a new IRP_MJ_PNP request.

The driver specifies either an IRP_MN_READ_CONFIG or an
IRP_MN_WRITE_CONFIG
minor function.

Gets the next stack location.

Sets the following members of the Parameters.ReadWriteConfig structure
in
the new stack location:

WhichSpace: specifies the value PCCARD_ATTRIBUTE_MEMORY.
Buffer : Pointer to a paged-memory buffer that the driver allocates
for the access. For a write operation, the buffer contains

data to write to the configuration space. For a read operation, the
buffer
is a zero-filled buffer. After the request completes, this buffer holds
a
copy of the attribute memory read from the device.

Offset : Specifies the byte offset from the base of the attribute memory

where the read or write operation begins.

Length : Specifies the size in bytes of the buffer that the driver
allocates for the request.

Sets a completion routine.

Sends the request down the device stack.

My Question:

1)PCCARD_ATTRIBUTE_MEMORY where can I find this Macro…??
I had found only the PCI_COMMON_CONFIG…but I couldn’t find
PCCARD_ATTRIBUTE_MEMORY.

2)In case of Pci,as we can get the data in BAR0,BAR1…by enumerating
the
U.memory.start and U.memory.length…which gets registered in the
RESOURCE
LIST DURING THE DRIVER LOAD TIME. But since the PCMICA is hot
swapped,should i EXPLICITLY pass any IRP or do the PNP MANAGER PASS ANY

IRP TO DETECT THE INSERTION OF THE PCMCIA CARD,AND TO ALLOCATE THE
RESOURCE…???

  1. During the Removal of card which IRP IS CALLED BY THE PNP MANAGER,or
    during removal of the card…

4)If anybody of you can let me know the complete outline structure OF
THE
FLOW INVOLVED IN PCMCIA BASED WDM DRIVER FOR WINDOWS 2000…


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com