diff options
author | mdodd <mdodd@FreeBSD.org> | 2002-06-07 01:55:42 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2002-06-07 01:55:42 +0000 |
commit | d148b5fbbdbc1f7658828164ab1793803d3105bb (patch) | |
tree | 9d76e163bb0058a08e70dc6744a67099c8ff08b6 | |
parent | ecd7ab07f9b036f07250624d60b7ad0d969886cf (diff) | |
download | FreeBSD-src-d148b5fbbdbc1f7658828164ab1793803d3105bb.zip FreeBSD-src-d148b5fbbdbc1f7658828164ab1793803d3105bb.tar.gz |
Move some code around.
Minor whitespace changes.
-rw-r--r-- | sys/dev/hea/hea_freebsd.c | 8 | ||||
-rw-r--r-- | sys/dev/hea/hea_pci.c | 2 | ||||
-rw-r--r-- | sys/dev/hfa/hfa_freebsd.c | 1 | ||||
-rw-r--r-- | sys/dev/hfa/hfa_pci.c | 23 |
4 files changed, 18 insertions, 16 deletions
diff --git a/sys/dev/hea/hea_freebsd.c b/sys/dev/hea/hea_freebsd.c index c8b0f83..b723c8c 100644 --- a/sys/dev/hea/hea_freebsd.c +++ b/sys/dev/hea/hea_freebsd.c @@ -163,14 +163,15 @@ hea_attach (device_t dev) */ eup->eu_unit = device_get_unit(dev); eup->eu_mtu = ENI_IFF_MTU; - eup->eu_pcitag = dev; + eup->eu_vcc_pool = &eni_vcc_pool; + eup->eu_nif_pool = &eni_nif_pool; eup->eu_ioctl = eni_atm_ioctl; eup->eu_instvcc = eni_instvcc; eup->eu_openvcc = eni_openvcc; eup->eu_closevcc = eni_closevcc; eup->eu_output = eni_output; - eup->eu_vcc_pool = &eni_vcc_pool; - eup->eu_nif_pool = &eni_nif_pool; + + eup->eu_pcitag = dev; /* * Map memory structures into adapter space @@ -206,6 +207,7 @@ hea_attach (device_t dev) * Read the contents of the SEEPROM */ eni_read_seeprom(eup); + /* * Copy MAC address to PIF and config structures */ diff --git a/sys/dev/hea/hea_pci.c b/sys/dev/hea/hea_pci.c index 391db8b..d6b5e34 100644 --- a/sys/dev/hea/hea_pci.c +++ b/sys/dev/hea/hea_pci.c @@ -198,8 +198,8 @@ hea_pci_attach (dev) } return (0); -fail: +fail: hea_detach(dev); return (error); diff --git a/sys/dev/hfa/hfa_freebsd.c b/sys/dev/hfa/hfa_freebsd.c index 271c5b4..377dbbb 100644 --- a/sys/dev/hfa/hfa_freebsd.c +++ b/sys/dev/hfa/hfa_freebsd.c @@ -176,6 +176,7 @@ hfa_attach (device_t dev) fup->fu_openvcc = fore_openvcc; fup->fu_closevcc = fore_closevcc; fup->fu_output = fore_output; + callout_handle_init(&fup->fu_thandle); /* diff --git a/sys/dev/hfa/hfa_pci.c b/sys/dev/hfa/hfa_pci.c index 6a12f0f..c5c9bd4 100644 --- a/sys/dev/hfa/hfa_pci.c +++ b/sys/dev/hfa/hfa_pci.c @@ -128,25 +128,15 @@ hfa_pci_attach (dev) fup = &sc->fup; error = 0; - switch (pci_get_device(dev)) { - case FORE_PCA200EPC_ID: - fup->fu_config.ac_device = DEV_FORE_PCA200E; - break; - default: - fup->fu_config.ac_device = DEV_UNKNOWN; - break; - } - pci_enable_busmaster(dev); + pci_enable_io(dev, SYS_RES_MEMORY); + command = pci_read_config(dev, PCIR_COMMAND, 2); if ((command & PCIM_CMD_BUSMASTEREN) == 0) { device_printf(dev, "Unable to enable PCI busmastering.\n"); error = ENXIO; goto fail; } - - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 2); if ((command & PCIM_CMD_MEMEN) == 0) { device_printf(dev, "Unable to enable PCI memory resources.\n"); error = ENXIO; @@ -192,6 +182,15 @@ hfa_pci_attach (dev) fup->fu_config.ac_bustype = BUS_PCI; fup->fu_config.ac_busslot = (pci_get_bus(dev) << 8)| pci_get_slot(dev); + switch (pci_get_device(dev)) { + case FORE_PCA200EPC_ID: + fup->fu_config.ac_device = DEV_FORE_PCA200E; + break; + default: + fup->fu_config.ac_device = DEV_UNKNOWN; + break; + } + error = hfa_attach(dev); if (error) { device_printf(dev, "hfa_attach() failed.\n"); |