beautypg.com

Compaq TRU64 AA-RNG2A-TE User Manual

Page 71

background image

if (status == SUCCESS) {

ee = (unsigned char *)&ee_copy;
for (i = 0; i < (sizeof(struct w3_eeprom)); i++) {

*ee = tuple_data_infop->TupleData[i];

ee++;

}

} else {

printf("el%d: Can’t read multifunction card’s eeprom.\n",

unit);

if (sc->ispcmcia)

pcmcia_unregister_event_callback(card_infop->socket_vnum,

CARD_REMOVAL_EVENT,

(caddr_t)el_card_remove);

return(0);

}

} else {

printf("el%d: Can’t read multifunction card’s eeprom.\n",

unit);

if (sc->ispcmcia)

pcmcia_unregister_event_callback(card_infop->socket_vnum,

CARD_REMOVAL_EVENT,

(caddr_t)el_card_remove);

return(0);

}

} else {

2

ed = (unsigned short *)&ee_copy;

for (i=0; i<(sizeof(struct w3_eeprom)/2); i++) {

WRITE_ECR(sc, ECR_READ+i);

DELAY(1000);

*ed = READ_EDR(sc);

ed++;

}

}

if (bcmp(sc->eeprom.addr, ee_copy.addr, 6)) {

3

for (i=0; i<3; i++) {

4

j = sc->eeprom.addr[i];

tmp_addr[(i*2)] = (j>>8) & 0xff;
tmp_addr[(i*2)+1] = (j) & 0xff;

}

if (bcmp(tmp_addr, sc->is_addr, 6) == 0) {

5

for (i=0; i<3; i++) {

6

j = ee_copy.addr[i];

tmp_addr[(i*2)] = (j>>8) & 0xff;
tmp_addr[(i*2)+1] = (j) & 0xff;

}

bzero(&ifr, sizeof(struct ifreq));

bcopy(tmp_addr, ifr.ifr_addr.sa_data, 6);

bcopy(tmp_addr, sc->is_addr, 6);

7

if (((struct arpcom *)ifp)->ac_flag & AC_IPUP) {

8

rearpwhohas((struct arpcom *)ifp);

}

if_sphyaddr(ifp, &ifr);

9

pfilt_newaddress(sc->is_ed.ess_enetunit, sc->is_addr);

10

}

Implementing the Autoconfiguration Support Section (probe) 5–13