case BUS_ISA: 8

if (get_config(ctlr, RES_PORT, NULL, &port_sel, 0) >= 0) { reg = port_sel.base_address; 10

} else { 11

printf("el%d: Can’t get assigned IOBASE\n",unit); return(0);

}

9

if (get_config(ctlr, RES_IRQ, NULL, &irq_sel, 0) < 0) { 12 printf("el%d: Can’t get assigned IRQ\n", unit); return(0);

}

if (el_isa_reset++ == 0) 13 el_isa_reset_all(reg, &isatag, ctlr);

if (el_isa_activate(reg, &isatag, ctlr)) { 14

printf("el%d: 3C509 not present or not responding at 0x%x\n", unit, reg);

return(0);

}

break;

default: 15

printf("el%d: Unrecognized bus type\n", unit); return(0);

break;

}

1

Determines which bus the if_el driver operates on by examining the constant that the bus configuration code has stored in the bus_type member. The el_probe( ) routine references this value through the controller data structure pointer’s bus_hd member. This pointer is the data structure that is associated with this 3Com 3C5x9 device.

2Performs tasks related to the PCMCIA bus if bus_type evaluates to the constant BUS_PCMCIA.

3Adds the I/O handle to the base address of the card and stores it in the reg variable. The reg variable becomes an argument in subsequent calls to the read and write macros.

4Determines whether the card is a multifunction card or a single-function card.

5Calls the READ_BUS_D16 macro to read a word (16 bits) from a device register that is located in the bus I/O address space. This read operation verifies that the EtherLink III card is attached.

If the data that READ_BUS_D16 returns is not equal to 0x6d50, calls the WRITE_BUS_D16 and DELAY macros. The WRITE_BUS_D16 macro writes a word (16 bits) to a device register that is located in the bus I/O address space. This specific write operation resets the card. The DELAY macro spins, waiting the specified number of microseconds before continuing execution.

Implementing the Autoconfiguration Support Section (probe) 5–5

Page 63
Image 63
Compaq AA-RNG2A-TE manual Implementing the Autoconfiguration Support Section probe