thread_halt_self();
}
1
Enters a loop for transmitting a packet and determining if it succeeds. A packet must go out twice successfully for media selection to succeed. This algorithm probably will not work in all cases.
5.3.6 Saving Counters Prior to the Transmit Operation
The following code shows how the el_autosense_thread( ) routine saves counters prior to the transmit operation:
prev_tint=
prev_err =
5.3.7 Allocating Memory for a Test Packet
The following code shows how the el_autosense_thread( ) routine allocates memory for a test packet:
MGETHDR(m, M_WAIT, MT_DATA);
if ((passes++ > EL_AUTOSENSE_PASSES) (m == NULL)) { if (m) {
m_freem(m);
printf("el%d: Autosense thread cannot determine media\n",
printf("el%d: Use lan_config to configure if necessary\n",
} else {
printf("el%d: Autosense thread cannot get xmit buffer\n",
}
5.3.8 Using the Default from the ROM
The following code shows how the el_autosense_thread( ) routine uses the default media setting from ROM. This code sequence signifies a last resort if the driver is unable to determine the media.
switch
if
break; case ACR_10B2:
if
break; case ACR_10BT: default:
if
break;
}
printf("el%d: Used %s setting from eeprom\n",