if_txp.c (217323) | if_txp.c (219902) |
---|---|
1/* $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */ 2 3/*- 4 * Copyright (c) 2001 5 * Jason L. Wright <jason@thought.net>, Theo de Raadt, and 6 * Aaron Campbell <aaron@monkey.org>. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 21 unchanged lines hidden (view full) --- 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 34 * THE POSSIBILITY OF SUCH DAMAGE. 35 */ 36 37#include <sys/cdefs.h> | 1/* $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */ 2 3/*- 4 * Copyright (c) 2001 5 * Jason L. Wright <jason@thought.net>, Theo de Raadt, and 6 * Aaron Campbell <aaron@monkey.org>. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 21 unchanged lines hidden (view full) --- 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 34 * THE POSSIBILITY OF SUCH DAMAGE. 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/dev/txp/if_txp.c 217323 2011-01-12 19:53:56Z mdf $"); | 38__FBSDID("$FreeBSD: head/sys/dev/txp/if_txp.c 219902 2011-03-23 13:10:15Z jhb $"); |
39 40/* 41 * Driver for 3c990 (Typhoon) Ethernet ASIC 42 */ 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/bus.h> 46#include <sys/endian.h> --- 371 unchanged lines hidden (view full) --- 418 /* 419 * It's possible to read firmware's offload capability but 420 * we have not downloaded the firmware yet so announce 421 * working capability here. We're not interested in IPSec 422 * capability and due to the lots of firmware bug we can't 423 * advertise the whole capability anyway. 424 */ 425 ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM; | 39 40/* 41 * Driver for 3c990 (Typhoon) Ethernet ASIC 42 */ 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/bus.h> 46#include <sys/endian.h> --- 371 unchanged lines hidden (view full) --- 418 /* 419 * It's possible to read firmware's offload capability but 420 * we have not downloaded the firmware yet so announce 421 * working capability here. We're not interested in IPSec 422 * capability and due to the lots of firmware bug we can't 423 * advertise the whole capability anyway. 424 */ 425 ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM; |
426 if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0) | 426 if (pci_find_cap(dev, PCIY_PMG, &pmc) == 0) |
427 ifp->if_capabilities |= IFCAP_WOL_MAGIC; 428 /* Enable all capabilities. */ 429 ifp->if_capenable = ifp->if_capabilities; 430 431 ether_ifattach(ifp, eaddr); 432 433 /* VLAN capability setup. */ 434 ifp->if_capabilities |= IFCAP_VLAN_MTU; --- 713 unchanged lines hidden (view full) --- 1148 ((uint8_t *)&p2)[0] = eaddr[5]; 1149 p2 = le32toh(p2); 1150 txp_command(sc, TXP_CMD_STATION_ADDRESS_WRITE, p1, p2, 0, NULL, NULL, 1151 NULL, TXP_CMD_WAIT); 1152 txp_set_filter(sc); 1153 WRITE_REG(sc, TXP_IER, TXP_INTR_NONE); 1154 WRITE_REG(sc, TXP_IMR, TXP_INTR_ALL); 1155 txp_sleep(sc, sc->sc_ifp->if_capenable); | 427 ifp->if_capabilities |= IFCAP_WOL_MAGIC; 428 /* Enable all capabilities. */ 429 ifp->if_capenable = ifp->if_capabilities; 430 431 ether_ifattach(ifp, eaddr); 432 433 /* VLAN capability setup. */ 434 ifp->if_capabilities |= IFCAP_VLAN_MTU; --- 713 unchanged lines hidden (view full) --- 1148 ((uint8_t *)&p2)[0] = eaddr[5]; 1149 p2 = le32toh(p2); 1150 txp_command(sc, TXP_CMD_STATION_ADDRESS_WRITE, p1, p2, 0, NULL, NULL, 1151 NULL, TXP_CMD_WAIT); 1152 txp_set_filter(sc); 1153 WRITE_REG(sc, TXP_IER, TXP_INTR_NONE); 1154 WRITE_REG(sc, TXP_IMR, TXP_INTR_ALL); 1155 txp_sleep(sc, sc->sc_ifp->if_capenable); |
1156 if (pci_find_extcap(sc->sc_dev, PCIY_PMG, &pmc) == 0) { | 1156 if (pci_find_cap(sc->sc_dev, PCIY_PMG, &pmc) == 0) { |
1157 /* Request PME. */ 1158 pmstat = pci_read_config(sc->sc_dev, 1159 pmc + PCIR_POWER_STATUS, 2); 1160 pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); 1161 if ((ifp->if_capenable & IFCAP_WOL) != 0) 1162 pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; 1163 pci_write_config(sc->sc_dev, 1164 pmc + PCIR_POWER_STATUS, pmstat, 2); --- 8 unchanged lines hidden (view full) --- 1173{ 1174 struct txp_softc *sc; 1175 int pmc; 1176 uint16_t pmstat; 1177 1178 sc = device_get_softc(dev); 1179 1180 TXP_LOCK(sc); | 1157 /* Request PME. */ 1158 pmstat = pci_read_config(sc->sc_dev, 1159 pmc + PCIR_POWER_STATUS, 2); 1160 pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); 1161 if ((ifp->if_capenable & IFCAP_WOL) != 0) 1162 pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; 1163 pci_write_config(sc->sc_dev, 1164 pmc + PCIR_POWER_STATUS, pmstat, 2); --- 8 unchanged lines hidden (view full) --- 1173{ 1174 struct txp_softc *sc; 1175 int pmc; 1176 uint16_t pmstat; 1177 1178 sc = device_get_softc(dev); 1179 1180 TXP_LOCK(sc); |
1181 if (pci_find_extcap(sc->sc_dev, PCIY_PMG, &pmc) == 0) { | 1181 if (pci_find_cap(sc->sc_dev, PCIY_PMG, &pmc) == 0) { |
1182 /* Disable PME and clear PME status. */ 1183 pmstat = pci_read_config(sc->sc_dev, 1184 pmc + PCIR_POWER_STATUS, 2); 1185 if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { 1186 pmstat &= ~PCIM_PSTAT_PMEENABLE; 1187 pci_write_config(sc->sc_dev, 1188 pmc + PCIR_POWER_STATUS, pmstat, 2); 1189 } --- 1799 unchanged lines hidden --- | 1182 /* Disable PME and clear PME status. */ 1183 pmstat = pci_read_config(sc->sc_dev, 1184 pmc + PCIR_POWER_STATUS, 2); 1185 if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { 1186 pmstat &= ~PCIM_PSTAT_PMEENABLE; 1187 pci_write_config(sc->sc_dev, 1188 pmc + PCIR_POWER_STATUS, pmstat, 2); 1189 } --- 1799 unchanged lines hidden --- |