Deleted Added
full compact
if_ed_novell.c (147256) if_ed_novell.c (149558)
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

--- 15 unchanged lines hidden (view full) ---

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
31#include <sys/cdefs.h>
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

--- 15 unchanged lines hidden (view full) ---

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
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/ed/if_ed_novell.c 147256 2005-06-10 16:49:24Z brooks $");
32__FBSDID("$FreeBSD: head/sys/dev/ed/if_ed_novell.c 149558 2005-08-28 23:56:25Z imp $");
33
34#include "opt_ed.h"
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/sockio.h>
39#include <sys/mbuf.h>
40#include <sys/kernel.h>

--- 123 unchanged lines hidden (view full) ---

164 sc->chip_type = ED_CHIP_TYPE_DP8390;
165
166 /* 8k of memory plus an additional 8k if 16bit */
167 memsize = 8192 + sc->isa16bit * 8192;
168 sc->mem_size = memsize;
169
170 /* NIC memory doesn't start at zero on an NE board */
171 /* The start address is tied to the bus width */
33
34#include "opt_ed.h"
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/sockio.h>
39#include <sys/mbuf.h>
40#include <sys/kernel.h>

--- 123 unchanged lines hidden (view full) ---

164 sc->chip_type = ED_CHIP_TYPE_DP8390;
165
166 /* 8k of memory plus an additional 8k if 16bit */
167 memsize = 8192 + sc->isa16bit * 8192;
168 sc->mem_size = memsize;
169
170 /* NIC memory doesn't start at zero on an NE board */
171 /* The start address is tied to the bus width */
172 sc->mem_start = (char *) 8192 + sc->isa16bit * 8192;
172 sc->mem_start = 8192 + sc->isa16bit * 8192;
173 sc->mem_end = sc->mem_start + memsize;
174 sc->tx_page_start = memsize / ED_PAGE_SIZE;
175
176 if (ED_FLAGS_GETTYPE(flags) == ED_FLAGS_GWETHER) {
177 error = ed_probe_gwether(dev);
178 if (error)
179 return (error);
180 }

--- 32 unchanged lines hidden (view full) ---

213
214 return ed_probe_Novell_generic(dev, flags);
215}
216
217static int
218ed_probe_gwether(device_t dev)
219{
220 int x, i, msize = 0;
173 sc->mem_end = sc->mem_start + memsize;
174 sc->tx_page_start = memsize / ED_PAGE_SIZE;
175
176 if (ED_FLAGS_GETTYPE(flags) == ED_FLAGS_GWETHER) {
177 error = ed_probe_gwether(dev);
178 if (error)
179 return (error);
180 }

--- 32 unchanged lines hidden (view full) ---

213
214 return ed_probe_Novell_generic(dev, flags);
215}
216
217static int
218ed_probe_gwether(device_t dev)
219{
220 int x, i, msize = 0;
221 long mstart = 0;
221 bus_size_t mstart = 0;
222 char pbuf0[ED_PAGE_SIZE], pbuf[ED_PAGE_SIZE], tbuf[ED_PAGE_SIZE];
223 struct ed_softc *sc = device_get_softc(dev);
224
225 for (i = 0; i < ED_PAGE_SIZE; i++)
226 pbuf0[i] = 0;
227
228 /* Clear all the memory. */
229 for (x = 1; x < 256; x++)

--- 34 unchanged lines hidden (view full) ---

264 }
265 } else {
266 break;
267 }
268 }
269
270 if (msize == 0) {
271 device_printf(dev,
222 char pbuf0[ED_PAGE_SIZE], pbuf[ED_PAGE_SIZE], tbuf[ED_PAGE_SIZE];
223 struct ed_softc *sc = device_get_softc(dev);
224
225 for (i = 0; i < ED_PAGE_SIZE; i++)
226 pbuf0[i] = 0;
227
228 /* Clear all the memory. */
229 for (x = 1; x < 256; x++)

--- 34 unchanged lines hidden (view full) ---

264 }
265 } else {
266 break;
267 }
268 }
269
270 if (msize == 0) {
271 device_printf(dev,
272 "Cannot find any RAM, start : %ld, x = %d.\n", mstart, x);
272 "Cannot find any RAM, start : %d, x = %d.\n",
273 (int)mstart, x);
273 return (ENXIO);
274 }
274 return (ENXIO);
275 }
275 device_printf(dev, "RAM start at %ld, size : %d.\n", mstart, msize);
276 if (bootverbose)
277 device_printf(dev,
278 "RAM start at %d, size : %d.\n", (int)mstart, msize);
276
277 sc->mem_size = msize;
279
280 sc->mem_size = msize;
278 sc->mem_start = (caddr_t)(uintptr_t) mstart;
279 sc->mem_end = (caddr_t)(uintptr_t) (msize + mstart);
281 sc->mem_start = mstart;
282 sc->mem_end = msize + mstart;
280 sc->tx_page_start = mstart / ED_PAGE_SIZE;
281 return 0;
282}
283
284void
285ed_Novell_read_mac(struct ed_softc *sc)
286{
287 int n;
288 uint8_t romdata[16];
289
290 /*
291 * Pull the MAC address out of the roms that are on the isa
292 * version of these cards.
293 */
294 ed_pio_readmem(sc, 0, romdata, 16);
295 for (n = 0; n < ETHER_ADDR_LEN; n++)
296 sc->enaddr[n] = romdata[n * (sc->isa16bit + 1)];
297}
283 sc->tx_page_start = mstart / ED_PAGE_SIZE;
284 return 0;
285}
286
287void
288ed_Novell_read_mac(struct ed_softc *sc)
289{
290 int n;
291 uint8_t romdata[16];
292
293 /*
294 * Pull the MAC address out of the roms that are on the isa
295 * version of these cards.
296 */
297 ed_pio_readmem(sc, 0, romdata, 16);
298 for (n = 0; n < ETHER_ADDR_LEN; n++)
299 sc->enaddr[n] = romdata[n * (sc->isa16bit + 1)];
300}