if_xl.c (45707) | if_xl.c (45720) |
---|---|
1/* 2 * Copyright (c) 1997, 1998 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 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 * $Id: if_xl.c,v 1.30 1999/04/15 03:18:33 wpaul Exp $ | 32 * $Id: if_xl.c,v 1.31 1999/04/16 01:56:06 ghelmer Exp $ |
33 */ 34 35/* 36 * 3Com 3c90x Etherlink XL PCI NIC driver 37 * 38 * Supports the 3Com "boomerang" and "cyclone" PCI 39 * bus-master chips (3c90x cards and embedded controllers) including 40 * the following: --- 76 unchanged lines hidden (view full) --- 117#include <machine/clock.h> /* for DELAY */ 118#include <machine/bus_memio.h> 119#include <machine/bus_pio.h> 120#include <machine/bus.h> 121 122#include <pci/pcireg.h> 123#include <pci/pcivar.h> 124 | 33 */ 34 35/* 36 * 3Com 3c90x Etherlink XL PCI NIC driver 37 * 38 * Supports the 3Com "boomerang" and "cyclone" PCI 39 * bus-master chips (3c90x cards and embedded controllers) including 40 * the following: --- 76 unchanged lines hidden (view full) --- 117#include <machine/clock.h> /* for DELAY */ 118#include <machine/bus_memio.h> 119#include <machine/bus_pio.h> 120#include <machine/bus.h> 121 122#include <pci/pcireg.h> 123#include <pci/pcivar.h> 124 |
125#ifdef __alpha__ 126#undef vtophys 127#define vtophys(va) (pmap_kextract(((vm_offset_t) (va))) \ 128 + 1*1024*1024*1024) 129#endif 130 |
|
125/* 126 * The following #define causes the code to use PIO to access the 127 * chip's registers instead of memory mapped mode. The reason PIO mode 128 * is on by default is that the Etherlink XL manual seems to indicate 129 * that only the newer revision chips (3c905B) support both PIO and 130 * memory mapped access. Since we want to be compatible with the older 131 * bus master chips, we use PIO here. If you comment this out, the 132 * driver will use memory mapped I/O, which may be faster but which --- 20 unchanged lines hidden (view full) --- 153 * recompile. 154 */ 155/* #define XL_BACKGROUND_AUTONEG */ 156 157#include <pci/if_xlreg.h> 158 159#if !defined(lint) 160static const char rcsid[] = | 131/* 132 * The following #define causes the code to use PIO to access the 133 * chip's registers instead of memory mapped mode. The reason PIO mode 134 * is on by default is that the Etherlink XL manual seems to indicate 135 * that only the newer revision chips (3c905B) support both PIO and 136 * memory mapped access. Since we want to be compatible with the older 137 * bus master chips, we use PIO here. If you comment this out, the 138 * driver will use memory mapped I/O, which may be faster but which --- 20 unchanged lines hidden (view full) --- 159 * recompile. 160 */ 161/* #define XL_BACKGROUND_AUTONEG */ 162 163#include <pci/if_xlreg.h> 164 165#if !defined(lint) 166static const char rcsid[] = |
161 "$Id: if_xl.c,v 1.30 1999/04/15 03:18:33 wpaul Exp $"; | 167 "$Id: if_xl.c,v 1.31 1999/04/16 01:56:06 ghelmer Exp $"; |
162#endif 163 164/* 165 * Various supported device vendors/types and their names. 166 */ 167static struct xl_type xl_devs[] = { 168 { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT, 169 "3Com 3c900-TPO Etherlink XL" }, --- 1338 unchanged lines hidden (view full) --- 1508 M_DEVBUF, M_NOWAIT); 1509 if (sc->xl_ldata_ptr == NULL) { 1510 free(sc, M_DEVBUF); 1511 printf("xl%d: no memory for list buffers!\n", unit); 1512 goto fail; 1513 } 1514 1515 sc->xl_ldata = (struct xl_list_data *)sc->xl_ldata_ptr; | 168#endif 169 170/* 171 * Various supported device vendors/types and their names. 172 */ 173static struct xl_type xl_devs[] = { 174 { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT, 175 "3Com 3c900-TPO Etherlink XL" }, --- 1338 unchanged lines hidden (view full) --- 1514 M_DEVBUF, M_NOWAIT); 1515 if (sc->xl_ldata_ptr == NULL) { 1516 free(sc, M_DEVBUF); 1517 printf("xl%d: no memory for list buffers!\n", unit); 1518 goto fail; 1519 } 1520 1521 sc->xl_ldata = (struct xl_list_data *)sc->xl_ldata_ptr; |
1516 round = (unsigned int)sc->xl_ldata_ptr & 0xF; | 1522 round = (uintptr_t)sc->xl_ldata_ptr & 0xF; |
1517 roundptr = sc->xl_ldata_ptr; 1518 for (i = 0; i < 8; i++) { 1519 if (round % 8) { 1520 round++; 1521 roundptr++; 1522 } else 1523 break; 1524 } --- 1360 unchanged lines hidden --- | 1523 roundptr = sc->xl_ldata_ptr; 1524 for (i = 0; i < 8; i++) { 1525 if (round % 8) { 1526 round++; 1527 roundptr++; 1528 } else 1529 break; 1530 } --- 1360 unchanged lines hidden --- |