if_xl.c (69490) | if_xl.c (69583) |
---|---|
1/* 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.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 --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.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 --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/pci/if_xl.c 69490 2000-12-01 19:41:14Z imp $ | 32 * $FreeBSD: head/sys/pci/if_xl.c 69583 2000-12-04 22:46:50Z wpaul $ |
33 */ 34 35/* 36 * 3Com 3c90x Etherlink XL PCI NIC driver 37 * 38 * Supports the 3Com "boomerang", "cyclone" and "hurricane" PCI 39 * bus-master chips (3c90x cards and embedded controllers) including 40 * the following: --- 104 unchanged lines hidden (view full) --- 145 * might not work on some devices. 146 */ 147#define XL_USEIOSPACE 148 149#include <pci/if_xlreg.h> 150 151#if !defined(lint) 152static const char rcsid[] = | 33 */ 34 35/* 36 * 3Com 3c90x Etherlink XL PCI NIC driver 37 * 38 * Supports the 3Com "boomerang", "cyclone" and "hurricane" PCI 39 * bus-master chips (3c90x cards and embedded controllers) including 40 * the following: --- 104 unchanged lines hidden (view full) --- 145 * might not work on some devices. 146 */ 147#define XL_USEIOSPACE 148 149#include <pci/if_xlreg.h> 150 151#if !defined(lint) 152static const char rcsid[] = |
153 "$FreeBSD: head/sys/pci/if_xl.c 69490 2000-12-01 19:41:14Z imp $"; | 153 "$FreeBSD: head/sys/pci/if_xl.c 69583 2000-12-04 22:46:50Z wpaul $"; |
154#endif 155 156/* 157 * Various supported device vendors/types and their names. 158 */ 159static struct xl_type xl_devs[] = { 160 { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT, 161 "3Com 3c900-TPO Etherlink XL" }, --- 1072 unchanged lines hidden (view full) --- 1234 struct xl_softc *sc; 1235 struct ifnet *ifp; 1236 int media = IFM_ETHER|IFM_100_TX|IFM_FDX; 1237 int unit, error = 0, rid; 1238 1239 sc = device_get_softc(dev); 1240 unit = device_get_unit(dev); 1241 | 154#endif 155 156/* 157 * Various supported device vendors/types and their names. 158 */ 159static struct xl_type xl_devs[] = { 160 { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT, 161 "3Com 3c900-TPO Etherlink XL" }, --- 1072 unchanged lines hidden (view full) --- 1234 struct xl_softc *sc; 1235 struct ifnet *ifp; 1236 int media = IFM_ETHER|IFM_100_TX|IFM_FDX; 1237 int unit, error = 0, rid; 1238 1239 sc = device_get_softc(dev); 1240 unit = device_get_unit(dev); 1241 |
1242 mtx_init(&sc->xl_mtx, device_get_nameunit(dev), MTX_DEF); 1243 XL_LOCK(sc); 1244 |
|
1242 sc->xl_flags = 0; 1243 if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_556 || 1244 pci_get_device(dev) == TC_DEVICEID_HURRICANE_556B) 1245 sc->xl_flags |= XL_FLAG_FUNCREG | XL_FLAG_PHYOK | 1246 XL_FLAG_EEPROM_OFFSET_30 | XL_FLAG_WEIRDRESET | 1247 XL_FLAG_INVERT_LED_PWR | XL_FLAG_INVERT_MII_PWR; 1248 if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_556) 1249 sc->xl_flags |= XL_FLAG_8BITROM; --- 127 unchanged lines hidden (view full) --- 1377 if (sc->xl_fres != NULL) 1378 bus_release_resource(dev, SYS_RES_MEMORY, 1379 XL_PCI_FUNCMEM, sc->xl_fres); 1380 bus_release_resource(dev, XL_RES, XL_RID, sc->xl_res); 1381 printf("xl%d: couldn't set up irq\n", unit); 1382 goto fail; 1383 } 1384 | 1245 sc->xl_flags = 0; 1246 if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_556 || 1247 pci_get_device(dev) == TC_DEVICEID_HURRICANE_556B) 1248 sc->xl_flags |= XL_FLAG_FUNCREG | XL_FLAG_PHYOK | 1249 XL_FLAG_EEPROM_OFFSET_30 | XL_FLAG_WEIRDRESET | 1250 XL_FLAG_INVERT_LED_PWR | XL_FLAG_INVERT_MII_PWR; 1251 if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_556) 1252 sc->xl_flags |= XL_FLAG_8BITROM; --- 127 unchanged lines hidden (view full) --- 1380 if (sc->xl_fres != NULL) 1381 bus_release_resource(dev, SYS_RES_MEMORY, 1382 XL_PCI_FUNCMEM, sc->xl_fres); 1383 bus_release_resource(dev, XL_RES, XL_RID, sc->xl_res); 1384 printf("xl%d: couldn't set up irq\n", unit); 1385 goto fail; 1386 } 1387 |
1385 mtx_init(&sc->xl_mtx, device_get_nameunit(dev), MTX_DEF); 1386 XL_LOCK(sc); 1387 | |
1388 /* Reset the adapter. */ 1389 xl_reset(sc); 1390 1391 /* 1392 * Get station address from the EEPROM. 1393 */ 1394 if (xl_read_eeprom(sc, (caddr_t)&eaddr, XL_EE_OEM_ADR0, 3, 1)) { 1395 printf("xl%d: failed to read station address\n", sc->xl_unit); --- 1609 unchanged lines hidden --- | 1388 /* Reset the adapter. */ 1389 xl_reset(sc); 1390 1391 /* 1392 * Get station address from the EEPROM. 1393 */ 1394 if (xl_read_eeprom(sc, (caddr_t)&eaddr, XL_EE_OEM_ADR0, 3, 1)) { 1395 printf("xl%d: failed to read station address\n", sc->xl_unit); --- 1609 unchanged lines hidden --- |