summaryrefslogtreecommitdiffstats
path: root/loader2/pcmcia.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-02-20 04:59:25 +0000
committerJeremy Katz <katzj@redhat.com>2003-02-20 04:59:25 +0000
commit53476b599da07679b803e005ab889588a62f94f9 (patch)
treed20791fd8d2f8302384bed7ce05a598a33e6e111 /loader2/pcmcia.c
parent0db07bdbac5a9ee9e16659771ee09bc90648dd04 (diff)
downloadanaconda-53476b599da07679b803e005ab889588a62f94f9.tar.gz
anaconda-53476b599da07679b803e005ab889588a62f94f9.tar.xz
anaconda-53476b599da07679b803e005ab889588a62f94f9.zip
more credit. make sure that we successfully loaded the pcmcia device
Diffstat (limited to 'loader2/pcmcia.c')
-rw-r--r--loader2/pcmcia.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/loader2/pcmcia.c b/loader2/pcmcia.c
index a43aacdd2..b36852bb0 100644
--- a/loader2/pcmcia.c
+++ b/loader2/pcmcia.c
@@ -6,7 +6,9 @@
* Michael Fulbright <msf@redhat.com>
* Jeremy Katz <katzj@redhat.com>
*
- * Copyright 1999 - 2002 Red Hat, Inc.
+ * Copyright 1999 - 2003 Red Hat, Inc.
+ * Portions of this code from pcmcia-cs, copyright David A. Hinds
+ * <dahinds@users.sourceforge.net>
*
* This software may be freely redistributed under the terms of the GNU
* General Public License.
@@ -64,7 +66,6 @@ int initializePcmciaController(moduleList modLoaded, moduleDeps modDeps,
moduleInfoSet modInfo, int flags) {
char * pcic = NULL;
char * mods;
- int i;
if (FL_NOPCMCIA(flags) || FL_TESTING(flags))
return 0;
@@ -141,9 +142,11 @@ struct bind_info_t {
#define DS_BIND_REQUEST _IOWR('d', 60, struct bind_info_t)
+#define DS_GET_DEVICE_INFO _IOWR('d', 61, struct bind_info_t)
int activate_pcmcia_device(struct pcmciaDevice *pdev) {
int fd;
struct bind_info_t * bind;
+ int j, ret;
if (has_pcmcia() <= 0) {
logMessage("pcmcia not loaded, can't activate module");
@@ -163,6 +166,19 @@ int activate_pcmcia_device(struct pcmciaDevice *pdev) {
logMessage("failed to activate pcmcia device");
return LOADER_ERROR;
}
+
+ for (ret = j = 0; j < 10; j++) {
+ ret = ioctl(fd, DS_GET_DEVICE_INFO, bind);
+ if ((ret == 0) || (errno != EAGAIN))
+ break;
+ usleep(100000);
+ }
+
+ if (j >= 10) {
+ logMessage("activated, but unable to get device info");
+ return LOADER_ERROR;
+ }
+
return LOADER_OK;
}
@@ -194,3 +210,4 @@ void startPcmciaDevices(moduleList modLoaded, int flags) {
activate_pcmcia_device((struct pcmciaDevice *)devices[i]);
}
}
+