isa.c revision a734c64bff58bda2fa48c2795453e092167b0ff7
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
/*
* isa.c implements a "classical" port-scanning method of ISA device
* detection. The driver must provide a list of probe addresses
* (probe_addrs), together with a function (probe_addr) that can be
* used to test for the physical presence of a device at any given
* address.
*
* Note that this should probably be considered the "last resort" for
* device probing. If the card supports ISAPnP or EISA, use that
* instead. Some cards (e.g. the 3c509) implement a proprietary
* ISAPnP-like mechanism.
*
* The ISA probe address list can be overridden by config.h; if the
* user specifies ISA_PROBE_ADDRS then that list will be used first.
* (If ISA_PROBE_ONLY is defined, the driver's own list will never be
* used).
*/
/*
* User-supplied probe address list
*
*/
static isa_probe_addr_t isa_extra_probe_addrs[] = {
#ifdef ISA_PROBE_ADDRS
#endif
};
#define ISA_EXTRA_PROBE_ADDR_COUNT \
( sizeof ( isa_extra_probe_addrs ) / sizeof ( isa_extra_probe_addrs[0] ) )
#ifdef ISA_PROBE_ONLY
#else
#endif
( ( (ioidx) < 0 ) ? \
/**
* Probe an ISA device
*
* @v isa ISA device
* @ret rc Return status code
*/
int rc;
DBG ( "Trying ISA driver %s at I/O %04x\n",
DBG ( "...probe failed\n" );
return rc;
}
DBG ( "...device found\n" );
return 0;
}
/**
* Remove an ISA device
*
* @v isa ISA device
*/
}
/**
* Probe ISA root bus
*
* @v rootdev ISA bus root device
*
* Scans the ISA bus for devices and registers all devices it can
* find.
*/
struct isa_driver *driver;
int ioidx;
int rc;
/* Allocate struct isa_device */
if ( ! isa )
if ( ! isa ) {
goto err;
}
/* Add to device hierarchy */
/* Try probing at this I/O address */
/* isadev registered, we can drop our ref */
} else {
/* Not registered; re-use struct */
}
}
}
return 0;
err:
isabus_remove ( rootdev );
return rc;
}
/**
* Remove ISA root bus
*
* @v rootdev ISA bus root device
*/
struct isa_device *isa;
struct isa_device *tmp;
isa_remove ( isa );
}
}
/** ISA bus root device driver */
static struct root_driver isa_root_driver = {
.probe = isabus_probe,
.remove = isabus_remove,
};
/** ISA bus root device */
.driver = &isa_root_driver,
};