View | Details | Raw Unified | Return to bug 177184 | Differences between
and this patch

Collapse All | Expand All

(-)if_bge.c 2013-03-14 13:30:08.000000000 +0100 (-1 / +34 lines)
Lines 469-474 Link Here
469
static void bge_stop_fw(struct bge_softc *);
469
static void bge_stop_fw(struct bge_softc *);
470
static int bge_reset(struct bge_softc *);
470
static int bge_reset(struct bge_softc *);
471
static void bge_link_upd(struct bge_softc *);
471
static void bge_link_upd(struct bge_softc *);
472
static void bge_setwol(struct bge_softc *);
472
/*
473
/*
473
 * The BGE_REGISTER_DEBUG option is only for low-level debugging.  It may
474
 * The BGE_REGISTER_DEBUG option is only for low-level debugging.  It may
Lines 3335-3341 Link Here
3335
       IFQ_SET_READY(&ifp->if_snd);
3336
       IFQ_SET_READY(&ifp->if_snd);
3336
       ifp->if_hwassist = sc->bge_csum_features;
3337
       ifp->if_hwassist = sc->bge_csum_features;
3337
       ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING |
3338
       ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING |
3338
           IFCAP_VLAN_MTU;
3339
           IFCAP_VLAN_MTU | IFCAP_WOL_MAGIC;
3339
       if ((sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) != 0) {
3340
       if ((sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) != 0) {
3340
               ifp->if_hwassist |= CSUM_TSO;
3341
               ifp->if_hwassist |= CSUM_TSO;
3341
               ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO;
3342
               ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO;
Lines 5537-5542 Link Here
5537
       BGE_LOCK(sc);
5538
       BGE_LOCK(sc);
5538
       bge_stop(sc);
5539
       bge_stop(sc);
5539
       bge_reset(sc);
5540
       bge_reset(sc);
5541
       bge_setwol(sc);
5540
       BGE_UNLOCK(sc);
5542
       BGE_UNLOCK(sc);
5541
       return (0);
5543
       return (0);
Lines 6206-6208 Link Here
6206
       }
6208
       }
6207
       return (*func == NULL ? ENXIO : 0);
6209
       return (*func == NULL ? ENXIO : 0);
6208
}
6210
}
6211
6212
static void
6213
bge_setwol(struct bge_softc *sc)
6214
{
6215
       struct ifnet *ifp;
6216
       uint16_t pmstat;
6217
       int pmc;
6218
6219
       ifp = sc->bge_ifp;
6220
6221
       if ((ifp->if_capenable & IFCAP_WOL_MAGIC) == 0)
6222
           return;
6223
6224
       if (pci_find_cap(sc->bge_dev, PCIY_PMG, &pmc) != 0)
6225
           return;
6226
6227
       BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_MAGIC_PKT_ENB);
6228
6229
       BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE);
6230
       BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII);
6231
6232
       BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE);
6233
6234
       /* Request PME. */
6235
       pmstat = pci_read_config(sc->bge_dev,
6236
           pmc + PCIR_POWER_STATUS, 2);
6237
       pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE;
6238
       pci_write_config(sc->bge_dev,
6239
           pmc + PCIR_POWER_STATUS, pmstat, 2);
6240
}
6241

Return to bug 177184