On Mon, Oct 26, 2026 at 08:39:34PM +0100, Mark Kettenis wrote:
> > Date: Mon, 19 Oct 2026 20:30:28 +0200
> > From: Mark Kettenis <[email protected]>
>
> Sorry, but I've reverted this diff for now since it breaks my main
> development machine.
Fair enough. Reading the vendor driver, I've come to the conclusion
that aq2 nics just don't generate an interrupt on link state changes,
so the driver has to poll instead.
This gets the link state right on my aq2 pcie card. Does it work on the
mac mini too? It's not setting the initial link state (yet) so it
won't fix the original problem here, but it should allow us to do that.
Index: if_aq_pci.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_aq_pci.c,v
diff -u -p -r1.40 if_aq_pci.c
--- if_aq_pci.c 26 Oct 2026 19:37:43 -0000 1.40
+++ if_aq_pci.c 26 Oct 2026 22:36:14 -0000
@@ -1020,6 +1020,8 @@ struct aq_softc {
struct ether_addr sc_enaddr;
struct mutex sc_mpi_mutex;
+
+ struct timeout sc_linkstate_poll;
};
const struct pci_matchid aq_devices[] = {
@@ -1156,6 +1158,7 @@ void aq_start(struct ifqueue *);
void aq_ifmedia_status(struct ifnet *, struct ifmediareq *);
int aq_ifmedia_change(struct ifnet *);
void aq_update_link_status(struct aq_softc *);
+void aq_linkstate_poll(void *);
int aq_get_sffpage(struct aq_softc *, struct if_sffpage *);
int aq1_fw_reboot(struct aq_softc *);
@@ -1528,6 +1531,11 @@ aq_attach(struct device *parent, struct
AQ_WRITE_REG_BIT(sc, RX_DMA_INT_DESC_WRWB_EN_REG,
RX_DMA_INT_DESC_MODERATE_EN, 1);
+ if (aqp->aq_hwtype == HWTYPE_AQ2) {
+ timeout_set(&sc->sc_linkstate_poll, aq_linkstate_poll, sc);
+ timeout_add_sec(&sc->sc_linkstate_poll, 1);
+ }
+
aq_enable_intr(sc, 1, 0);
printf("\n");
}
@@ -1545,6 +1553,8 @@ aq_detach(struct device *self, int flags
aq_enable_intr(sc, 0, 0);
+ timeout_del(&sc->sc_linkstate_poll);
+
for (i = 0; i < sc->sc_nqueues; i++) {
aq = &sc->sc_queues[i];
@@ -3841,6 +3851,14 @@ aq_update_link_status(struct aq_softc *s
if_link_state_change(ifp);
}
}
+}
+
+void
+aq_linkstate_poll(void *xsc)
+{
+ struct aq_softc *sc = xsc;
+ aq_update_link_status(sc);
+ timeout_add_sec(&sc->sc_linkstate_poll, 1);
}
int