if_dc.c (116024) | if_dc.c (117208) |
---|---|
1/* 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 75 unchanged lines hidden (view full) --- 84 * All of the workalike chips use some form of MII transceiver support 85 * with the exception of the Macronix chips, which also have a SYM port. 86 * The ASIX AX88140A is also documented to have a SYM port, but all 87 * the cards I've seen use an MII transceiver, probably because the 88 * AX88140A doesn't support internal NWAY. 89 */ 90 91#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 75 unchanged lines hidden (view full) --- 84 * All of the workalike chips use some form of MII transceiver support 85 * with the exception of the Macronix chips, which also have a SYM port. 86 * The ASIX AX88140A is also documented to have a SYM port, but all 87 * the cards I've seen use an MII transceiver, probably because the 88 * AX88140A doesn't support internal NWAY. 89 */ 90 91#include <sys/cdefs.h> |
92__FBSDID("$FreeBSD: head/sys/dev/dc/if_dc.c 116024 2003-06-08 10:11:55Z mbr $"); | 92__FBSDID("$FreeBSD: head/sys/dev/dc/if_dc.c 117208 2003-07-03 21:39:53Z imp $"); |
93 94#include <sys/param.h> 95#include <sys/systm.h> 96#include <sys/sockio.h> 97#include <sys/mbuf.h> 98#include <sys/malloc.h> 99#include <sys/kernel.h> 100#include <sys/socket.h> --- 105 unchanged lines hidden (view full) --- 206 { 0, 0, NULL } 207}; 208 209static int dc_probe (device_t); 210static int dc_attach (device_t); 211static int dc_detach (device_t); 212static int dc_suspend (device_t); 213static int dc_resume (device_t); | 93 94#include <sys/param.h> 95#include <sys/systm.h> 96#include <sys/sockio.h> 97#include <sys/mbuf.h> 98#include <sys/malloc.h> 99#include <sys/kernel.h> 100#include <sys/socket.h> --- 105 unchanged lines hidden (view full) --- 206 { 0, 0, NULL } 207}; 208 209static int dc_probe (device_t); 210static int dc_attach (device_t); 211static int dc_detach (device_t); 212static int dc_suspend (device_t); 213static int dc_resume (device_t); |
214#ifndef BURN_BRIDGES |
|
214static void dc_acpi (device_t); | 215static void dc_acpi (device_t); |
216#endif |
|
215static struct dc_type *dc_devtype (device_t); 216static int dc_newbuf (struct dc_softc *, int, struct mbuf *); 217static int dc_encap (struct dc_softc *, struct mbuf *, u_int32_t *); 218static void dc_pnic_rx_bug_war (struct dc_softc *, int); 219static int dc_rx_resync (struct dc_softc *); 220static void dc_rxeof (struct dc_softc *); 221static void dc_txeof (struct dc_softc *); 222static void dc_tick (void *); --- 1385 unchanged lines hidden (view full) --- 1608 if (t != NULL) { 1609 device_set_desc(dev, t->dc_name); 1610 return (0); 1611 } 1612 1613 return (ENXIO); 1614} 1615 | 217static struct dc_type *dc_devtype (device_t); 218static int dc_newbuf (struct dc_softc *, int, struct mbuf *); 219static int dc_encap (struct dc_softc *, struct mbuf *, u_int32_t *); 220static void dc_pnic_rx_bug_war (struct dc_softc *, int); 221static int dc_rx_resync (struct dc_softc *); 222static void dc_rxeof (struct dc_softc *); 223static void dc_txeof (struct dc_softc *); 224static void dc_tick (void *); --- 1385 unchanged lines hidden (view full) --- 1610 if (t != NULL) { 1611 device_set_desc(dev, t->dc_name); 1612 return (0); 1613 } 1614 1615 return (ENXIO); 1616} 1617 |
1618#ifndef BURN_BRIDGES |
|
1616static void 1617dc_acpi(device_t dev) 1618{ 1619 int unit; 1620 u_int32_t iobase, membase, irq; 1621 1622 unit = device_get_unit(dev); 1623 --- 10 unchanged lines hidden (view full) --- 1634 pci_set_powerstate(dev, PCI_POWERSTATE_D0); 1635 1636 /* Restore PCI config data. */ 1637 pci_write_config(dev, DC_PCI_CFBIO, iobase, 4); 1638 pci_write_config(dev, DC_PCI_CFBMA, membase, 4); 1639 pci_write_config(dev, DC_PCI_CFIT, irq, 4); 1640 } 1641} | 1619static void 1620dc_acpi(device_t dev) 1621{ 1622 int unit; 1623 u_int32_t iobase, membase, irq; 1624 1625 unit = device_get_unit(dev); 1626 --- 10 unchanged lines hidden (view full) --- 1637 pci_set_powerstate(dev, PCI_POWERSTATE_D0); 1638 1639 /* Restore PCI config data. */ 1640 pci_write_config(dev, DC_PCI_CFBIO, iobase, 4); 1641 pci_write_config(dev, DC_PCI_CFBMA, membase, 4); 1642 pci_write_config(dev, DC_PCI_CFIT, irq, 4); 1643 } 1644} |
1645#endif |
|
1642 1643static void 1644dc_apply_fixup(struct dc_softc *sc, int media) 1645{ 1646 struct dc_mediainfo *m; 1647 u_int8_t *p; 1648 int i; 1649 u_int32_t reg; --- 174 unchanged lines hidden (view full) --- 1824 int unit, error = 0, rid, mac_offset; 1825 u_int8_t *mac; 1826 1827 sc = device_get_softc(dev); 1828 unit = device_get_unit(dev); 1829 1830 mtx_init(&sc->dc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, 1831 MTX_DEF | MTX_RECURSE); | 1646 1647static void 1648dc_apply_fixup(struct dc_softc *sc, int media) 1649{ 1650 struct dc_mediainfo *m; 1651 u_int8_t *p; 1652 int i; 1653 u_int32_t reg; --- 174 unchanged lines hidden (view full) --- 1828 int unit, error = 0, rid, mac_offset; 1829 u_int8_t *mac; 1830 1831 sc = device_get_softc(dev); 1832 unit = device_get_unit(dev); 1833 1834 mtx_init(&sc->dc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, 1835 MTX_DEF | MTX_RECURSE); |
1832 | 1836#ifndef BURN_BRIDGES |
1833 /* 1834 * Handle power management nonsense. 1835 */ 1836 dc_acpi(dev); | 1837 /* 1838 * Handle power management nonsense. 1839 */ 1840 dc_acpi(dev); |
1837 | 1841#endif |
1838 /* 1839 * Map control/status registers. 1840 */ 1841 pci_enable_busmaster(dev); 1842 1843 rid = DC_RID; 1844 sc->dc_res = bus_alloc_resource(dev, DC_RES, &rid, 1845 0, ~0, 1, RF_ACTIVE); --- 1735 unchanged lines hidden (view full) --- 3581 struct dc_softc *sc; 3582 struct ifnet *ifp; 3583 int i, s; 3584 3585 s = splimp(); 3586 3587 sc = device_get_softc(dev); 3588 ifp = &sc->arpcom.ac_if; | 1842 /* 1843 * Map control/status registers. 1844 */ 1845 pci_enable_busmaster(dev); 1846 1847 rid = DC_RID; 1848 sc->dc_res = bus_alloc_resource(dev, DC_RES, &rid, 1849 0, ~0, 1, RF_ACTIVE); --- 1735 unchanged lines hidden (view full) --- 3585 struct dc_softc *sc; 3586 struct ifnet *ifp; 3587 int i, s; 3588 3589 s = splimp(); 3590 3591 sc = device_get_softc(dev); 3592 ifp = &sc->arpcom.ac_if; |
3589 | 3593#ifndef BURN_BRIDGES |
3590 dc_acpi(dev); | 3594 dc_acpi(dev); |
3591 | 3595#endif |
3592 /* better way to do this? */ 3593 for (i = 0; i < 5; i++) 3594 pci_write_config(dev, PCIR_MAPS + i * 4, sc->saved_maps[i], 4); 3595 pci_write_config(dev, PCIR_BIOS, sc->saved_biosaddr, 4); 3596 pci_write_config(dev, PCIR_INTLINE, sc->saved_intline, 1); 3597 pci_write_config(dev, PCIR_CACHELNSZ, sc->saved_cachelnsz, 1); 3598 pci_write_config(dev, PCIR_LATTIMER, sc->saved_lattimer, 1); 3599 --- 27 unchanged lines hidden --- | 3596 /* better way to do this? */ 3597 for (i = 0; i < 5; i++) 3598 pci_write_config(dev, PCIR_MAPS + i * 4, sc->saved_maps[i], 4); 3599 pci_write_config(dev, PCIR_BIOS, sc->saved_biosaddr, 4); 3600 pci_write_config(dev, PCIR_INTLINE, sc->saved_intline, 1); 3601 pci_write_config(dev, PCIR_CACHELNSZ, sc->saved_cachelnsz, 1); 3602 pci_write_config(dev, PCIR_LATTIMER, sc->saved_lattimer, 1); 3603 --- 27 unchanged lines hidden --- |