PCI Configuration Space
2-8
r.x.di = addr;
int86(PCI_INT, &r, &r); /* PCI_INT 0x1A */
return (r.x.cx & 0xFF);
}
Normally, the constants in this routine (the values assigned to ah, al, and the
opcode for the int86 call) are assigned in the header file for the C code. Their
values are inserted as comments to enable the reader to resolve the actual val-
ues that are used. The device ID, devid, is known to the driver and is used with
another PCI O/S call to find the base addresses needed for this call.
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––
// PciRdWord() – PCI read config word
//
// Parameters:
// devid WORD pci device number
// addr WORD address to read
//
// Return val:
// WORD value read
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––
WORD PciRdWord(WORD devid, WORD addr)
{
union REGS r;
r.h.ah = PCI_FUNCTION_ID;
r.h.al = READ_CONFIG_WORD;
r.x.bx = devid;
r.x.di = addr;
int86(PCI_INT, &r, &r);
return(r.x.cx);
}
This code passes an address >10 if the driver regards the host registers as
memory locations (ThunderLAN’s first base address register is hardwired as
a memory base register), or >14 if the driver treated the host registers as an
I/O block (ThunderLAN’s second base register is hardwired as an I/O base
register). For the I/O port, the following C instruction could be used to put a val-
ue into the DIO_ADR host register:
outpw(baOFF_DIO_ADDR,value);
OFF_DIO_ADDR is a constant for the header file. A memory transfer instruc-
tion is used if memory space is used instead of I/O space.
Summary of Contents for ThunderLAN TNETE100A
Page 2: ...Printed in U S A October 1996 L411001 9761 revisionA SPWU013A ...
Page 3: ......
Page 17: ...xiv ...
Page 23: ...1 6 ...
Page 67: ...3 10 ...
Page 81: ...4 14 ...
Page 113: ...7 10 ...
Page 165: ...A 52 ...
Page 179: ...C 2 ...