Compaq Tru64 UNIX Installation Manual page 69

Writing network device drivers
Table of Contents

Advertisement

for (i=0; i<(sizeof(struct w3_eeprom)/2); i++) {
WRITE_ECR(sc, ECR_READ+i);
DELAY(1000);
*ed = READ_EDR(sc);
ed++;
}
}
for (i=0; i<3; i++) {
j = sc->eeprom.addr[i];
sc->is_addr[(i*2)] = (j>>8) & 0xff;
sc->is_addr[(i*2)+1] = (j) & 0xff;
}
sc->lm_media_mode = LAN_MODE_AUTOSENSE;
sc->lm_media_state = LAN_MEDIA_STATE_SENSING;
sc->lm_media = LAN_MEDIA_UTP;
sc->autosense_thread = kernel_thread_w_arg(first_task,
if (sc->autosense_thread == NULL) {
printf("el%d: Can't create autosense thread.\n", unit);
if (sc->ispcmcia)
pcmcia_unregister_event_callback(card_infop->socket_vnum,
if_dealloc(sc->is_ed);
lan_ehm_free(&sc->ehm);
FREE(sc, M_DEVBUF);
return(0);
14
}
Determines whether the device has already been probed, which
1
indicates that the device is operating on a PCMCIA bus and that the
user has put the card back into the slot. In this case, the driver does
not need to redo much of the initial probe work and will skip to the code
shown in Section 5.1.10.
If this is a multifunction card, reads the EEPROM data and saves it in
2
sc->eeprom. If this is a multifunction PC card, the EEPROM data is
located in the card information data structure.
If this is not a multifunction PC card, the EEPROM data is read directly
3
from the card and saved in the el_softc data structure.
Saves the 48-bit physical address of the device into the is_addr
4
member of the el_softc data structure for this 3Com 3C5x9 device.
Sets the media mode to the constant LAN_MODE_AUTOSENSE. This
5
constant indicates that the driver hardware determines the media
automatically.
Sets the media state to the constant LAN_MEDIA_STATE_SENSING. This
6
constant indicates that the media is currently in the autosensing state.
Sets the currently set media to the constant LAN_MEDIA_UTP.
7
This constant indicates that the mode for the media is unshielded
twisted-pair cable.
Implementing the Autoconfiguration Support Section (probe) 5–11
4
5
6
7
el_autosense_thread,
(void *)sc);
9
10
CARD_REMOVAL_EVENT,
(caddr_t)el_card_remove);
11
12
13
8

Advertisement

Table of Contents
loading

Table of Contents