
5.1.9 Handling First-Time Probe Operations
If the device has not already been probed, the el_probe( ) routine performs the following tasks:
•Reads the EEPROM and saves it to a temporary data structure
•Reads and saves the device’s physical address
•Starts the autosense thread to determine the media type
The following code shows how the el_probe( ) routine performs these tasks:
if
1
if (multi_func_flag) {
2
bzero((caddr_t)&tuple_data, sizeof(struct tuple_data_info)); tuple_data_infop = &tuple_data;
tuple_infop = (struct tuple_info *)&tuple_data;
status = GetFirstTuple(tuple_infop);
if (status == SUCCESS) {
if (status == SUCCESS) {
ee = (unsigned char
for (i = 0; i < (sizeof(struct w3_eeprom)); i++) { *ee =
ee++;
}
} else {
printf("el%d: Can’t read multifunction card’s eeprom.\n", unit);
if
CARD_REMOVAL_EVENT, (caddr_t)el_card_remove);
}
} else {
printf("el%d: Can’t read multifunction card’s eeprom.\n", unit);
if
CARD_REMOVAL_EVENT, (caddr_t)el_card_remove);
}
} else {
3
ed = (unsigned short