/****************************************************************************
NAME
ip_esrm - Exit software relocatable mode.
DESCRIPTION
ip_esrm() will wake up the PCnet-ISA II controller and initialize the
Plug and Play Registers.
First, the Plug and Play Initiation Key is used to get the controller
to exit software relocatable mode. If this attempt fails, the AMD
Initiation Key is used to get the controller to exit software
relocatable mode.
If either method successful in waking the controller, the Plug and Play
Registers are initialized.
CALLS
inport() - Gets a word or byte from a hardware port. Function in the
(Borland) run-time library.
AROME - #define AROME Iobase+0xE
RETURN
00 = PCnet-ISA II Plug and Play device awake and PnP registers initialized.
01 = Abort - Adapter not found.
****************************************************************************/
int ip_esrm(void)
{
int cc = 0;
/* Send the standard Plug and Play Initiation Key. */
ip_wake1();
/* Initialize the Plug and Play Registers. */
ip_cfg_init();
/* If the target PnP device was not awakened, then we'll have to
attempt the special AMD Initiation Key. */
if ( inport(AROME) != 0x5757 ) {
ip_wake2();
/* ...try the secret AMD handshake. */
ip_cfg_init();
/* Init Plug and Play Registers. */
/* If the PnP device is awake now, we're finished. */
if ( inport(AROME) == 0x5757 ) {
printf("ip_esrm: Info - AMD controller has been activated.\n");
}
/* Otherwise, the lights are on, but nobody's home. */
else {
cc = 1;
printf("ip_esrm: Abort - Unable to activate AMD controller.\n");
}
}
else {
printf("ip_esrm: Info - AMD controller has been activated.\n");
}
return(cc);
}
How to Perform Plug and Play Initiation Key with PCnet-ISA II
5