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 | |
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
-rw-r--r-- | loader2/hardware.c | 4 | ||||
-rw-r--r-- | loader2/loader.c | 2 | ||||
-rw-r--r-- | loader2/pcmcia.c | 56 | ||||
-rw-r--r-- | loader2/pcmcia.h | 4 |
4 files changed, 60 insertions, 6 deletions
diff --git a/loader2/hardware.c b/loader2/hardware.c index cdf4374fc..b45132a2d 100644 --- a/loader2/hardware.c +++ b/loader2/hardware.c @@ -150,6 +150,10 @@ int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps, char ** modList; char modules[1024]; + /* we always want to try to find out about pcmcia controllers even + * if using noprobe */ + cardbusControllerInitialize(modLoaded, modDeps, modInfo, flags); + if (FL_NOPROBE(flags)) return 0; if (!access("/proc/bus/pci/devices", R_OK) || diff --git a/loader2/loader.c b/loader2/loader.c index 3a1d45593..b98bf965d 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -908,7 +908,7 @@ int main(int argc, char ** argv) { /* JKFIXME: this is kind of a different way to handle pcmcia... I think * it's more correct, although it will require a little bit of kudzu * hacking */ - pcmciaInitialize(modLoaded, modDeps, modInfo, flags); + /*pcmciaInitialize(modLoaded, modDeps, modInfo, flags);*/ kdFindIdeList(&kd, 0); kdFindScsiList(&kd, 0); 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; } diff --git a/loader2/pcmcia.h b/loader2/pcmcia.h index fffa362e5..932d364ae 100644 --- a/loader2/pcmcia.h +++ b/loader2/pcmcia.h @@ -1,7 +1,7 @@ #ifndef H_PCMCIA #define H_PCMCIA -int pcmciaInitialize(moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags); +int cardbusControllerInitialize(moduleList modLoaded, moduleDeps modDeps, + moduleInfoSet modInfo, int flags); #endif |