1/*- 2 * Copyright (c) 2005, M. Warner Losh 3 * All rights reserved. 4 * Copyright (c) 1995, David Greenman 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/ed/if_ed_sic.c 149558 2005-08-28 23:56:25Z imp $"); |
32 33#include "opt_ed.h" 34 35#ifdef ED_SIC 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/sockio.h> 39#include <sys/mbuf.h> --- 40 unchanged lines hidden (view full) --- 80 sc->nic_offset = ED_SIC_NIC_OFFSET; 81 82 memsize = 16384; 83 /* XXX Needs to allow different msize */ 84 error = ed_alloc_memory(dev, 0, memsize); 85 if (error) 86 return (error); 87 |
88 sc->mem_start = 0; |
89 sc->mem_size = memsize; 90 91 pmem = rman_get_start(sc->mem_res); 92 error = ed_isa_mem_ok(dev, pmem, memsize); 93 if (error) 94 return (error); 95 96 /* Reset card to force it into a known state. */ 97 ed_asic_outb(sc, 0, 0x00); 98 DELAY(100); 99 100 /* 101 * Here we check the card ROM, if the checksum passes, and the 102 * type code and ethernet address check out, then we know we have 103 * an SIC card. 104 */ 105 ed_asic_outb(sc, 0, 0x81); 106 DELAY(100); 107 |
108 sum = bus_space_read_1(sc->mem_bst, sc->mem_bsh, 6); |
109 for (i = 0; i < ETHER_ADDR_LEN; i++) |
110 sum ^= (sc->enaddr[i] = 111 bus_space_read_1(sc->mem_bst, sc->mem_bsh, i)); |
112#ifdef ED_DEBUG 113 device_printf(dev, "ed_probe_sic: got address %6D\n", 114 sc->enaddr, ":"); 115#endif 116 if (sum != 0) 117 return (ENXIO); 118 if ((sc->enaddr[0] | sc->enaddr[1] | sc->enaddr[2]) == 0) 119 return (ENXIO); --- 37 unchanged lines hidden --- |