diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-12-23 00:02:52 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-12-23 00:02:52 +0000 |
commit | ff45de4da6bbaed02b03a68652646400304f0d2d (patch) | |
tree | 9178b5603257b4ffafce2636c7f56ab5f07965f5 /isys/vio.c | |
parent | 7fc30b4dc19ec8da21e4cae8e9aa4bdf923388be (diff) | |
download | anaconda-ff45de4da6bbaed02b03a68652646400304f0d2d.tar.gz anaconda-ff45de4da6bbaed02b03a68652646400304f0d2d.tar.xz anaconda-ff45de4da6bbaed02b03a68652646400304f0d2d.zip |
nuke probe code. move dasd bits that are still needed into their own file
Diffstat (limited to 'isys/vio.c')
-rw-r--r-- | isys/vio.c | 154 |
1 files changed, 0 insertions, 154 deletions
diff --git a/isys/vio.c b/isys/vio.c index 8917c455f..c03896acd 100644 --- a/isys/vio.c +++ b/isys/vio.c @@ -16,160 +16,6 @@ #include <unistd.h> #include <kudzu/kudzu.h> -#include "probe.h" - -int vioGetCdDevs(struct knownDevices * devices) { -#if !defined(__powerpc__) - return 0; -#else - int fd, i; - char * buf, * start, * end, * chptr, * next, * model, * ptr; - int ctlNum = 0; - char ctl[64]; - struct kddevice newDevice; - - if (access("/proc/iSeries/viocd", R_OK)) - return 0; - - /* Read from /proc/iSeries/viocd */ - fd = open("/proc/iSeries/viocd", O_RDONLY); - if (fd < 0) { - fprintf(stderr, "failed to open /proc/iSeries/viocd!\n"); - return 1; - } - - i = readFD(fd, &buf); - if (i < 1) { - close(fd); - fprintf(stderr, "error reading /proc/iSeries/viocd!\n"); - return 1; - } - close(fd); - buf[i] = '\0'; - - start = buf; - end = start + strlen(start); - while (*start && start < end) { - /* parse till end of line and store the start of next line. */ - chptr = start; - while (*chptr != '\n') chptr++; - *chptr = '\0'; - next = chptr + 1; - - /* get rid of anything which is not alpha */ - while (!(isalpha(*start))) start++; - - model = NULL; - if (!strncmp("viocd", start, 5)) - model = "IBM Virtual CDROM"; - - if (model) { - start += 13; - ptr = strchr(start, ' '); - *ptr++ = '\0'; - - ctlNum = atoi(start); - - chptr = strstr(ptr, "type ") + 5; - ptr = strchr(chptr, ','); - *ptr = '\0'; - - model = alloca((20 + strlen(chptr)) * sizeof(char *)); - sprintf(model, "IBM Virtual CD-ROM Model %s", chptr); - snprintf(ctl, 63, "iseries/vcd%c", ctlNum + 'a'); - - if (!deviceKnown(devices, ctl)) { - newDevice.name = strdup(ctl); - newDevice.model = strdup(model); - newDevice.class = CLASS_CDROM; - addDevice(devices, newDevice); - } - // printf("model is %s, ctl is %s\n", model, ctl); - } - - start = next; - end = start + strlen(start); - } /* end of while */ - - free (buf); - return 0; -#endif -} - -int vioGetDasdDevs(struct knownDevices * devices) { -#if !defined(__powerpc__) - return 0; -#else - int fd, i; - char * buf, * start, * end, * chptr, * next, * model, * ptr; - int ctlNum = 0; - char ctl[64]; - struct kddevice newDevice; - - if (access("/proc/iSeries/viodasd", R_OK)) - return 0; - - /* Read from /proc/iSeries/viodasd */ - fd = open("/proc/iSeries/viodasd", O_RDONLY); - if (fd < 0) { - fprintf(stderr, "failed to open /proc/iSeries/viodasd!\n"); - return 1; - } - - i = readFD(fd, &buf); - if (i < 1) { - close(fd); - fprintf(stderr, "error reading /proc/iSeries/viodasd!\n"); - return 1; - } - close(fd); - buf[i] = '\0'; - - start = buf; - end = start + strlen(start); - while (*start && start < end) { - /* parse till end of line and store the start of next line. */ - chptr = start; - while (*chptr != '\n') chptr++; - *chptr = '\0'; - next = chptr + 1; - - /* get rid of anything which is not alpha */ - while (!(isalpha(*start))) start++; - - model = NULL; - if (!strncmp("DISK ", start, 5)) - model = "IBM Virtual DASD"; - - if (model) { - chptr = start += 5; - ptr = strchr(chptr, ' '); - *ptr = '\0'; - ctlNum = atoi(chptr); - - if (ctlNum <= 26) { - snprintf(ctl, 63, "iseries/vd%c", 'a' + ctlNum); - } else { - snprintf(ctl, 63, "iseries/vda%c", 'a' + ctlNum - 26); - } - - if (!deviceKnown(devices, ctl)) { - newDevice.name = strdup(ctl); - newDevice.model = strdup(model); - newDevice.class = CLASS_HD; - addDevice(devices, newDevice); - } - // printf("model is %s, ctl is %s\n", model, ctl); - } - - start = next; - end = start + strlen(start); - } /* end of while */ - - free (buf); - return 0; -#endif -} int isVioConsole(void) { #if !defined(__powerpc__) |