if_fe_cbus.c (82791) | if_fe_cbus.c (90183) |
---|---|
1/* 2 * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 3 * 4 * This software may be used, modified, copied, distributed, and sold, in 5 * both source and binary form provided that the above copyright, these 6 * terms and the following disclaimer are retained. The name of the author 7 * and/or the contributor may not be used to endorse or promote products 8 * derived from this software without specific prior written permission. --- 5 unchanged lines hidden (view full) --- 14 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 15 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 16 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION. 17 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 18 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 19 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20 * SUCH DAMAGE. 21 * | 1/* 2 * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 3 * 4 * This software may be used, modified, copied, distributed, and sold, in 5 * both source and binary form provided that the above copyright, these 6 * terms and the following disclaimer are retained. The name of the author 7 * and/or the contributor may not be used to endorse or promote products 8 * derived from this software without specific prior written permission. --- 5 unchanged lines hidden (view full) --- 14 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 15 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 16 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION. 17 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 18 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 19 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20 * SUCH DAMAGE. 21 * |
22 * $FreeBSD: head/sys/dev/fe/if_fe_cbus.c 82791 2001-09-02 13:05:00Z shiba $ | 22 * $FreeBSD: head/sys/dev/fe/if_fe_cbus.c 90183 2002-02-04 14:01:27Z nyan $ |
23 */ 24 25#include <sys/param.h> 26#include <sys/systm.h> 27#include <sys/kernel.h> 28#include <sys/socket.h> 29#include <sys/module.h> 30 --- 17 unchanged lines hidden (view full) --- 48#include <isa/isavar.h> 49 50/* 51 * Cbus specific code. 52 */ 53static int fe_isa_probe(device_t); 54static int fe_isa_attach(device_t); 55 | 23 */ 24 25#include <sys/param.h> 26#include <sys/systm.h> 27#include <sys/kernel.h> 28#include <sys/socket.h> 29#include <sys/module.h> 30 --- 17 unchanged lines hidden (view full) --- 48#include <isa/isavar.h> 49 50/* 51 * Cbus specific code. 52 */ 53static int fe_isa_probe(device_t); 54static int fe_isa_attach(device_t); 55 |
56static struct isa_pnp_id fe_ids[] = { 57 { 0x101ee0d, NULL }, /* CON0101 - Contec C-NET(98)P2-T */ 58 { 0, NULL } 59}; 60 |
|
56static device_method_t fe_isa_methods[] = { 57 /* Device interface */ 58 DEVMETHOD(device_probe, fe_isa_probe), 59 DEVMETHOD(device_attach, fe_isa_attach), 60 61 { 0, 0 } 62}; 63 --- 16 unchanged lines hidden (view full) --- 80static int fe_probe_lnx(device_t); 81static int fe_probe_gwy(device_t); 82static int fe_probe_ubn(device_t); 83 84/* 85 * Determine if the device is present at a specified I/O address. The 86 * main entry to the driver. 87 */ | 61static device_method_t fe_isa_methods[] = { 62 /* Device interface */ 63 DEVMETHOD(device_probe, fe_isa_probe), 64 DEVMETHOD(device_attach, fe_isa_attach), 65 66 { 0, 0 } 67}; 68 --- 16 unchanged lines hidden (view full) --- 85static int fe_probe_lnx(device_t); 86static int fe_probe_gwy(device_t); 87static int fe_probe_ubn(device_t); 88 89/* 90 * Determine if the device is present at a specified I/O address. The 91 * main entry to the driver. 92 */ |
88 | |
89static int 90fe_isa_probe(device_t dev) 91{ | 93static int 94fe_isa_probe(device_t dev) 95{ |
92 struct fe_softc * sc; | 96 struct fe_softc *sc; |
93 int error; 94 | 97 int error; 98 |
95 /* Check isapnp ids */ 96 if (isa_get_vendorid(dev)) 97 return (ENXIO); 98 | |
99 /* Prepare for the softc struct. */ 100 sc = device_get_softc(dev); 101 sc->sc_unit = device_get_unit(dev); 102 | 99 /* Prepare for the softc struct. */ 100 sc = device_get_softc(dev); 101 sc->sc_unit = device_get_unit(dev); 102 |
103 /* Check isapnp ids */ 104 error = ISA_PNP_PROBE(device_get_parent(dev), dev, fe_ids); 105 106 /* If the card had a PnP ID that didn't match any we know about */ 107 if (error == ENXIO) 108 goto end; 109 110 /* If we had some other problem. */ 111 if (!(error == 0 || error == ENOENT)) 112 goto end; 113 |
|
103 /* Probe for supported boards. */ | 114 /* Probe for supported boards. */ |
104#ifdef PC98 | |
105 if ((error = fe_probe_re1000(dev)) == 0) 106 goto end; 107 fe_release_resource(dev); 108 109 if ((error = fe_probe_cnet9ne(dev)) == 0) 110 goto end; 111 fe_release_resource(dev); 112 113 if ((error = fe_probe_rex(dev)) == 0) 114 goto end; 115 fe_release_resource(dev); | 115 if ((error = fe_probe_re1000(dev)) == 0) 116 goto end; 117 fe_release_resource(dev); 118 119 if ((error = fe_probe_cnet9ne(dev)) == 0) 120 goto end; 121 fe_release_resource(dev); 122 123 if ((error = fe_probe_rex(dev)) == 0) 124 goto end; 125 fe_release_resource(dev); |
116#endif | |
117 118 if ((error = fe_probe_ssi(dev)) == 0) 119 goto end; 120 fe_release_resource(dev); 121 122 if ((error = fe_probe_jli(dev)) == 0) 123 goto end; 124 fe_release_resource(dev); --- 496 unchanged lines hidden (view full) --- 621 /* Make sure the Ethernet (MAC) station address is of Contec's. */ 622 if (!valid_Ether_p(eeprom + FE_SSI_EEP_ADDR, 0x00804C)) 623 return ENXIO; 624 bcopy(eeprom + FE_SSI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN); 625 626 /* Setup the board type. */ 627 sc->typestr = "C-NET(98)P2"; 628 | 126 127 if ((error = fe_probe_ssi(dev)) == 0) 128 goto end; 129 fe_release_resource(dev); 130 131 if ((error = fe_probe_jli(dev)) == 0) 132 goto end; 133 fe_release_resource(dev); --- 496 unchanged lines hidden (view full) --- 630 /* Make sure the Ethernet (MAC) station address is of Contec's. */ 631 if (!valid_Ether_p(eeprom + FE_SSI_EEP_ADDR, 0x00804C)) 632 return ENXIO; 633 bcopy(eeprom + FE_SSI_EEP_ADDR, sc->sc_enaddr, ETHER_ADDR_LEN); 634 635 /* Setup the board type. */ 636 sc->typestr = "C-NET(98)P2"; 637 |
629 /* Get IRQ configuration from EEPROM. */ 630 irq = irqmap[eeprom[FE_SSI_EEP_IRQ]]; 631 if (irq == NO_IRQ) { 632 fe_irq_failure(sc->typestr, sc->sc_unit, irq, 633 "3/5/6/9/10/12/13"); 634 return ENXIO; | 638 /* Non-PnP mode, set static resource from eeprom. */ 639 if (!isa_get_vendorid(dev)) { 640 /* Get IRQ configuration from EEPROM. */ 641 irq = irqmap[eeprom[FE_SSI_EEP_IRQ]]; 642 if (irq == NO_IRQ) { 643 fe_irq_failure(sc->typestr, sc->sc_unit, irq, 644 "3/5/6/9/10/12/13"); 645 return ENXIO; 646 } 647 bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1); |
635 } | 648 } |
636 bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1); | |
637 638 /* Get Duplex-mode configuration from EEPROM. */ 639 sc->proto_dlcr4 |= (eeprom[FE_SSI_EEP_DUPLEX] & FE_D4_DSC); 640 641 /* Fill softc struct accordingly. */ 642 sc->mbitmap = MB_HT; 643 sc->defmedia = MB_HT; 644 --- 354 unchanged lines hidden --- | 649 650 /* Get Duplex-mode configuration from EEPROM. */ 651 sc->proto_dlcr4 |= (eeprom[FE_SSI_EEP_DUPLEX] & FE_D4_DSC); 652 653 /* Fill softc struct accordingly. */ 654 sc->mbitmap = MB_HT; 655 sc->defmedia = MB_HT; 656 --- 354 unchanged lines hidden --- |