diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-12-12 05:35:03 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-12-12 05:35:03 +0000 |
commit | 25d994668a532de29dbc5f3b5a5cc01489cf13d3 (patch) | |
tree | 91fe46e36d37aade832f297c11b5556af22ec2ca /loader2/pcmcia.c | |
parent | f22d489e4a5461c1f447d303aa5eb246a28d5388 (diff) | |
download | anaconda-25d994668a532de29dbc5f3b5a5cc01489cf13d3.tar.gz anaconda-25d994668a532de29dbc5f3b5a5cc01489cf13d3.tar.xz anaconda-25d994668a532de29dbc5f3b5a5cc01489cf13d3.zip |
this should get cardbus working. works in test mode, but I need to
double-check the various cases of it in the morning
Diffstat (limited to 'loader2/pcmcia.c')
-rw-r--r-- | loader2/pcmcia.c | 56 |
1 files changed, 53 insertions, 3 deletions
diff --git a/loader2/pcmcia.c b/loader2/pcmcia.c index a44d852d6..69e87e040 100644 --- a/loader2/pcmcia.c +++ b/loader2/pcmcia.c @@ -16,14 +16,64 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <kudzu/kudzu.h> +#include <stdlib.h> +#include <string.h> + #include "loader.h" +#include "loadermisc.h" +#include "log.h" #include "modules.h" -int pcmciaInitialize(moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags) { +char * getPcicController() { + struct device ** devices; + static int probed = 0; + static char * pcic = NULL; + + if (!probed) { + probed = 1; + + devices = probeDevices(CLASS_SOCKET, BUS_PCI, PROBE_ALL); + if (devices) { + logMessage("found cardbus pci adapter"); + pcic = "yenta_socket"; + } + + /* JKFIXME: need to probe for non-cardbus adapters */ + + if (!pcic) { + logMessage("no pcic controller found"); + } + return pcic; + } else { + return pcic; + } +} + +int cardbusControllerInitialize(moduleList modLoaded, moduleDeps modDeps, + moduleInfoSet modInfo, int flags) { + char * pcic = NULL; + char * mods; + int i; + if (FL_NOPCMCIA(flags)) return 0; + + pcic = getPcicController(); + if (!pcic) + return 0; + + for (i = 0; i < modInfo->numModules ; i++) { + if (strcmp(pcic, modInfo->moduleList[i].moduleName)) { + mods = sdupprintf("pcmcia_core:%s:ds", pcic); + logMessage("going to insert %s", mods); + /* JKFIXME: this depends on a hack until pcmcia has module-info */ + mlLoadModuleSetLocation(mods, modLoaded, modDeps, modInfo, + flags, modInfo->moduleList[i].locationID); + free(mods); + break; + } + } - /* JKFIXME: obviously we need real code here... */ return 0; } |