Move some code around.

Minor whitespace changes.
This commit is contained in:
Matthew N. Dodd 2002-06-07 01:55:42 +00:00
parent e8e649cc5d
commit 33b04e2fcb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97982
4 changed files with 18 additions and 16 deletions

View File

@ -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
*/

View File

@ -198,8 +198,8 @@ hea_pci_attach (dev)
}
return (0);
fail:
fail:
hea_detach(dev);
return (error);

View File

@ -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);
/*

View File

@ -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");