if_stge.c (243857) | if_stge.c (254263) |
---|---|
1/* $NetBSD: if_stge.c,v 1.32 2005/12/11 12:22:49 christos Exp $ */ 2 3/*- 4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Jason R. Thorpe. --- 21 unchanged lines hidden (view full) --- 30 */ 31 32/* 33 * Device driver for the Sundance Tech. TC9021 10/100/1000 34 * Ethernet controller. 35 */ 36 37#include <sys/cdefs.h> | 1/* $NetBSD: if_stge.c,v 1.32 2005/12/11 12:22:49 christos Exp $ */ 2 3/*- 4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Jason R. Thorpe. --- 21 unchanged lines hidden (view full) --- 30 */ 31 32/* 33 * Device driver for the Sundance Tech. TC9021 10/100/1000 34 * Ethernet controller. 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/dev/stge/if_stge.c 243857 2012-12-04 09:32:43Z glebius $"); | 38__FBSDID("$FreeBSD: head/sys/dev/stge/if_stge.c 254263 2013-08-12 23:30:01Z scottl $"); |
39 40#ifdef HAVE_KERNEL_OPTION_HEADERS 41#include "opt_device_polling.h" 42#endif 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/endian.h> --- 401 unchanged lines hidden (view full) --- 448 TASK_INIT(&sc->sc_link_task, 0, stge_link_task, sc); 449 450 /* 451 * Map the device. 452 */ 453 pci_enable_busmaster(dev); 454 cmd = pci_read_config(dev, PCIR_COMMAND, 2); 455 val = pci_read_config(dev, PCIR_BAR(1), 4); | 39 40#ifdef HAVE_KERNEL_OPTION_HEADERS 41#include "opt_device_polling.h" 42#endif 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/endian.h> --- 401 unchanged lines hidden (view full) --- 448 TASK_INIT(&sc->sc_link_task, 0, stge_link_task, sc); 449 450 /* 451 * Map the device. 452 */ 453 pci_enable_busmaster(dev); 454 cmd = pci_read_config(dev, PCIR_COMMAND, 2); 455 val = pci_read_config(dev, PCIR_BAR(1), 4); |
456 if ((val & 0x01) != 0) | 456 if (PCI_BAR_IO(val)) |
457 sc->sc_spec = stge_res_spec_mem; 458 else { 459 val = pci_read_config(dev, PCIR_BAR(0), 4); | 457 sc->sc_spec = stge_res_spec_mem; 458 else { 459 val = pci_read_config(dev, PCIR_BAR(0), 4); |
460 if ((val & 0x01) == 0) { | 460 if (!PCI_BAR_IO(val)) { |
461 device_printf(sc->sc_dev, "couldn't locate IO BAR\n"); 462 error = ENXIO; 463 goto fail; 464 } 465 sc->sc_spec = stge_res_spec_io; 466 } 467 error = bus_alloc_resources(dev, sc->sc_spec, sc->sc_res); 468 if (error != 0) { --- 2138 unchanged lines hidden --- | 461 device_printf(sc->sc_dev, "couldn't locate IO BAR\n"); 462 error = ENXIO; 463 goto fail; 464 } 465 sc->sc_spec = stge_res_spec_io; 466 } 467 error = bus_alloc_resources(dev, sc->sc_spec, sc->sc_res); 468 if (error != 0) { --- 2138 unchanged lines hidden --- |