Call if_link_state_change() when link status changes.

PR:		kern/76890
Reviewed by:	rwatson, sam
This commit is contained in:
Gleb Smirnoff 2005-02-04 18:36:04 +00:00
parent b21154f677
commit e5d73ca252

View File

@ -1654,6 +1654,8 @@ em_local_timer(void *arg)
static void
em_print_link_status(struct adapter * adapter)
{
struct ifnet *ifp = &adapter->interface_data.ac_if;
if (E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU) {
if (adapter->link_active == 0) {
em_get_speed_and_duplex(&adapter->hw,
@ -1667,6 +1669,7 @@ em_print_link_status(struct adapter * adapter)
"Full Duplex" : "Half Duplex"));
adapter->link_active = 1;
adapter->smartspeed = 0;
if_link_state_change(ifp, LINK_STATE_UP);
}
} else {
if (adapter->link_active == 1) {
@ -1675,6 +1678,7 @@ em_print_link_status(struct adapter * adapter)
if (bootverbose)
printf("em%d: Link is Down\n", adapter->unit);
adapter->link_active = 0;
if_link_state_change(ifp, LINK_STATE_DOWN);
}
}