Texas Instruments TNETE110A Network Card User Manual


 
PCI Configuration Space
2-7
ThunderLAN Registers
r.h.ah = PCI_FUNCTION_ID;
r.h.al = FIND_PCI_DEVICE;
r.x.cx = DeviceID;
r.x.dx = VendorID;
r.x.si = Index;
int86(PCI_INT, &r, &r);
*pDev = (WORD)r.x.bx;
return (int)r.h.ah;
}
This code returns the function ID that is used to request reads and writes to
the ThunderLAN PCI configuration space; this varies from installation to instal-
lation, based on hardware implementation and slot. This ID is necessary to de-
termine where ThunderLAN is. The device ID indicates a networking card, and
the vendor ID is the manufacturer code. These values can be overlaid in the
configuration space with values from the EEPROM during the autoconfigura-
tion. These should be available to the driver software either in the BIOS ROM
or on machine-readable media supplied with the network board(s).
The following example reads a byte of a PCI register:
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––
// PciRdByte() – Read a byte from PCI configuration space
//
// Parameters:
// devid WORD pci device identifier
// addr WORD config address
//
// Return val:
// BYTE value read
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––
BYTE PciRdByte(WORD devid, WORD addr)
{
union REGS r;
r.h.ah = PCI_FUNCTION_ID; /* PCI_FUNCTION_ID
0xB1 */
r.h.al = READ_CONFIG_BYTE; /* READ_CONFIG_WORD
0x09 */
r.x.bx = devid;