I need your help about PCI Device driver

Dear All,
I am making PCI card, and writing device driver for
it. I don’t know where is the configuration of PCI
device is stored; I think may be that is some
registers of each PCI slot. After that, I need to get
this configuration. I also do not know what is PCI
IDs.
I need your help.
Thanks and regards
Nguyen Hoang Viet


Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.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

Read any PCI book.

Config registers of the PCI card is the third address space from the hardware point of view - 3rd type of hardware bus
transactions, the first 2 are memory and IO (CPU’s IN/OUT opcodes).
Also config spaces are geographically addressed, not like memory and IO spaces. The slot numbering is established by coupling the
slot’s IDSEL wire to one of the AD31, AD30, AD29 etc wires - electrically on the motherboard.
The north bridge provides a way (in fact, 2 ways - legacy and modern) for a CPU to access the config spaces by using IN/OUT from
some ports.

In NT4, this is buried inside HAL, and the driver can access the PCI config space only by
HalGetBusData/HalSetBusData/HalAssignSlotResources.

In w2k, use PnP for this. Send IRP_MN_READ_CONFIG down to the PDO for config space read.

Also note - having the operational registers in the config space is a mauvetone, and MS’s recommendations advice against this. The
reason is that config space accesses are slow.

Max

----- Original Message -----
From: “Viet Nguyen”
To: “NT Developers Interest List”
Sent: Thursday, November 22, 2001 6:38 AM
Subject: [ntdev] I need your help about PCI Device driver

> Dear All,
> I am making PCI card, and writing device driver for
> it. I don’t know where is the configuration of PCI
> device is stored; I think may be that is some
> registers of each PCI slot. After that, I need to get
> this configuration. I also do not know what is PCI
> IDs.
> I need your help.
> Thanks and regards
> Nguyen Hoang Viet
>
>
> __________________________________________________
> Do You Yahoo!?
> Find the one for you at Yahoo! Personals
> http://personals.yahoo.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.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

>“The reason is that config space accesses are slow.”
Also, they can’t be accessed from DIRL in an ISR

Paul Lever
----- Original Message -----
From: “Maxim S. Shatskih”
To: “NT Developers Interest List”
Sent: Thursday, November 22, 2001 3:51 AM
Subject: [ntdev] Re: I need your help about PCI Device driver

> Read any PCI book.
>
> Config registers of the PCI card is the third address space from the
hardware point of view - 3rd type of hardware bus
> transactions, the first 2 are memory and IO (CPU’s IN/OUT opcodes).
> Also config spaces are geographically addressed, not like memory and IO
spaces. The slot numbering is established by coupling the
> slot’s IDSEL wire to one of the AD31, AD30, AD29 etc wires - electrically
on the motherboard.
> The north bridge provides a way (in fact, 2 ways - legacy and modern) for
a CPU to access the config spaces by using IN/OUT from
> some ports.
>
> In NT4, this is buried inside HAL, and the driver can access the PCI
config space only by
> HalGetBusData/HalSetBusData/HalAssignSlotResources.
>
> In w2k, use PnP for this. Send IRP_MN_READ_CONFIG down to the PDO for
config space read.
>
> Also note - having the operational registers in the config space is a
mauvetone, and MS’s recommendations advice against this. The
> reason is that config space accesses are slow.
>
> Max
>
> ----- Original Message -----
> From: “Viet Nguyen”
> To: “NT Developers Interest List”
> Sent: Thursday, November 22, 2001 6:38 AM
> Subject: [ntdev] I need your help about PCI Device driver
>
>
> > Dear All,
> > I am making PCI card, and writing device driver for
> > it. I don’t know where is the configuration of PCI
> > device is stored; I think may be that is some
> > registers of each PCI slot. After that, I need to get
> > this configuration. I also do not know what is PCI
> > IDs.
> > I need your help.
> > Thanks and regards
> > Nguyen Hoang Viet
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Find the one for you at Yahoo! Personals
> > http://personals.yahoo.com
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@home.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

> -----Original Message-----

From: Viet Nguyen [mailto:xxxxx@yahoo.com]
Sent: Wednesday, November 21, 2001 7:39 PM

Dear All,
I am making PCI card, and writing device driver for
it. I don’t know where is the configuration of PCI
device is stored; I think may be that is some
registers of each PCI slot. After that, I need to get
this configuration. I also do not know what is PCI
IDs.

The configuration for a pci device is stored in the 256 byte “pci
configuration space”; this space resides on the card itself. Pci slots
themselves have no “registers”.

See the structure “PCI_COMMON_CONFIG”, which defines standard PCI
configuration information returned by HalGetBusData or
HalGetBusDataByOffset.

Hmm. O.k., for “PCI IDs” you must mean one of the following:

VendorID–Identifies the manufacturer of the device. This must be a value
allocated by the PCI SIG.
DeviceID–Identifies the particular device. This value is assigned by the
manufacturer.

The above are a part of the pci configuration space.

Harmony,

Christine


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