CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2026/10/12 21:47:07
Modified files:
sys/dev/pci : if_aq_pci.c
Log message:
set ifp->if_link_state to LINK_STATE_DOWN in attach.
aq doesn't complete packet transmission if the link is down, so
aq_start uses LINK_STATE_IS_UP(ifp->if_link_state) to decide if it
should drop the queued packets or actually put them on the ring.
however, LINK_STATE_IS_UP() returns true if the link state is
LINK_STATE_UNKNOWN, which is the default value for the link state
in struct ifnet (because it's 0). this means if aq(4) is booted
without being plugged into the network, the link state handler
doesnt run and change the state to UP or DOWN, which leaves it
UNKNOWN. that's enough to confuse aq_start though.
defaulting the state to down properly represents the state of the
link, which in turn makes aq_start do the right thing with the
packets. if the network is plugged in on boot, the phy layer notices
and moves it to UP as expected.
found by Paul de Weerd on bugs@
tested by paul and jmatthew@
ok jmatthew@