Deleted Added
full compact
35c35
< __FBSDID("$FreeBSD: head/sys/dev/bge/if_bge.c 155170 2006-02-01 10:11:24Z ru $");
---
> __FBSDID("$FreeBSD: head/sys/dev/bge/if_bge.c 155180 2006-02-01 14:26:35Z oleg $");
2789a2790,2792
> bus_dmamap_sync(sc->bge_cdata.bge_status_tag,
> sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD);
>
2801c2804
< statusword & BGE_STATFLAG_LINKSTATE_CHANGED)
---
> statusword & BGE_STATFLAG_LINKSTATE_CHANGED || sc->bge_link_evt)
2829d2831
< struct ifnet *ifp;
2833,2834d2834
< ifp = sc->bge_ifp;
<
2843a2844,2857
> } else {
> /*
> * Since in TBI mode auto-polling can't be used we should poll
> * link status manually. Here we register pending link event
> * and trigger interrupt.
> */
> #ifdef DEVICE_POLLING
> /* In polling mode we poll link state in bge_poll_locked() */
> if (!(sc->bge_ifp->if_capenable & IFCAP_POLLING))
> #endif
> {
> sc->bge_link_evt++;
> BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_SET);
> }
3727a3742,3744
> /* Clear 'pending link event' flag */
> sc->bge_link_evt = 0;
>
3776,3787d3792
< /*
< * Sometimes PCS encoding errors are detected in
< * TBI mode (on fiber NICs), and for some reason
< * the chip will signal them as link changes.
< * If we get a link change event, but the 'PCS
< * encoding error' bit in the MAC status register
< * is set, don't bother doing a link check.
< * This avoids spurious "link UP" messages
< * that sometimes appear on fiber NICs during
< * periods of heavy traffic. (There should be no
< * effect on copper NICs.)
< */
3789,3792c3794,3795
< if (!(status & (BGE_MACSTAT_PORT_DECODE_ERROR|
< BGE_MACSTAT_MI_COMPLETE))) {
< if (!sc->bge_link &&
< (status & BGE_MACSTAT_TBI_PCS_SYNCHED)) {
---
> if (status & BGE_MACSTAT_TBI_PCS_SYNCHED) {
> if (!sc->bge_link) {
3800,3803c3803
< } else if (sc->bge_link) {
< sc->bge_link = 0;
< if (bootverbose)
< if_printf(sc->bge_ifp, "link DOWN\n");
---
> if_link_state_change(sc->bge_ifp, LINK_STATE_UP);
3804a3805,3809
> } else if (sc->bge_link) {
> sc->bge_link = 0;
> if (bootverbose)
> if_printf(sc->bge_ifp, "link DOWN\n");
> if_link_state_change(sc->bge_ifp, LINK_STATE_DOWN);