Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora User (http://www.linux-archive.org/fedora-user/)
-   -   Remove obsolete hardware code. (http://www.linux-archive.org/fedora-user/19962-remove-obsolete-hardware-code.html)

Bill Nottingham 12-15-2007 04:39 AM

Remove obsolete hardware code.
 
3 3 loader2/Makefile
0 93 loader2/firewire.c
0 7 loader2/firewire.h
0 148 loader2/pcmcia.c
0 10 loader2/pcmcia.h
0 142 loader2/usb.c
0 10 loader2/usb.h
--
1.5.3.7

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Bill Nottingham 12-15-2007 04:43 AM

Remove obsolete hardware code.
 
---
loader2/Makefile | 6 +-
loader2/firewire.c | 93 --------------------------------
loader2/firewire.h | 7 ---
loader2/pcmcia.c | 148 ----------------------------------------------------
loader2/pcmcia.h | 10 ----
loader2/usb.c | 142 -------------------------------------------------
loader2/usb.h | 10 ----
7 files changed, 3 insertions(+), 413 deletions(-)

diff --git a/loader2/Makefile b/loader2/Makefile
index 791877a..ab2f882 100644
--- a/loader2/Makefile
+++ b/loader2/Makefile
@@ -30,10 +30,10 @@ LIBS += -lresolv -lm

BINS = loader

-HWOBJS = pcmcia.o usb.o firewire.o hardware.o
+HWOBJS = hardware.o
METHOBJS = method.o cdinstall.o hdinstall.o nfsinstall.o urlinstall.o
-OBJS = copy.o log.o moduleinfo.o loadermisc.o modules.o moduledeps.o windows.o
- lang.o kbd.o modstubs.o driverdisk.o selinux.o
+OBJS = copy.o log.o moduleinfo.o loadermisc.o modules.o windows.o
+ lang.o kbd.o driverdisk.o selinux.o
mediacheck.o kickstart.o driverselect.o
getparts.o dirbrowser.o fwloader.o
$(HWOBJS) $(METHOBJS)
diff --git a/loader2/firewire.c b/loader2/firewire.c
deleted file mode 100644
index 5a59e14..0000000
--- a/loader2/firewire.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * firewire.c - firewire probing/module loading functionality
- *
- * Erik Troan <ewt@redhat.com>
- * Matt Wilson <msw@redhat.com>
- * Michael Fulbright <msf@redhat.com>
- * Jeremy Katz <katzj@redhat.com>
- *
- * Copyright 2002 Red Hat, Inc.
- *
- * This software may be freely redistributed under the terms of the GNU
- * General Public License.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <kudzu/kudzu.h>
-#include <newt.h>
-#include <unistd.h>
-
-#include "loader.h"
-#include "log.h"
-#include "modules.h"
-#include "windows.h"
-
-/* boot flags */
-extern uint64_t flags;
-
-int firewireInitialize(moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo) {
- struct device ** devices;
- int i = 0;
- int found = 0;
-
- if (FL_NOIEEE1394(flags)) return 0;
-
- devices = probeDevices(CLASS_FIREWIRE, BUS_PCI, 0);
-
- if (!devices) {
- logMessage(INFO, "no firewire controller found");
- return 0;
- }
-
- startNewt();
-
- /* JKFIXME: if we looked for all of them, we could batch this up and it
- * would be faster */
- for (i=0; devices[i]; i++) {
- if (!devices[i]->driver)
- continue;
- logMessage(INFO, "found firewire controller %s", devices[i]->driver);
-
- winStatus(40, 3, _("Loading"), _("Loading %s driver..."),
- devices[0]->driver);
-
- if (mlLoadModuleSet(devices[i]->driver, modLoaded, modDeps, modInfo)) {
- logMessage(ERROR, "failed to insert firewire module");
- } else {
- found++;
- }
- }
-
- if (found == 0) {
- newtPopWindow();
- return 1;
- }
-
- sleep(3);
-
- logMessage(INFO, "probing for firewire scsi devices");
- devices = probeDevices(CLASS_SCSI, BUS_FIREWIRE, 0);
-
- if (!devices) {
- logMessage(DEBUGLVL, "no firewire scsi devices found");
- newtPopWindow();
- return 0;
- }
-
- for (i=0;devices[i];i++) {
- if ((devices[i]->detached == 0) && (devices[i]->driver != NULL)) {
- logMessage(INFO, "found firewire device using %s",
- devices[i]->driver);
- mlLoadModuleSet(devices[i]->driver, modLoaded, modDeps, modInfo);
- }
- }
-
- newtPopWindow();
-
- return 0;
-}
-
diff --git a/loader2/firewire.h b/loader2/firewire.h
deleted file mode 100644
index 9fcdf8c..0000000
--- a/loader2/firewire.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef H_FIREWIRE
-#define H_FIREWIRE
-
-int firewireInitialize(moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo);
-
-#endif
diff --git a/loader2/pcmcia.c b/loader2/pcmcia.c
deleted file mode 100644
index ab093df..0000000
--- a/loader2/pcmcia.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * pcmcia.c - pcmcia functionality
- *
- * Erik Troan <ewt@redhat.com>
- * Matt Wilson <msw@redhat.com>
- * Michael Fulbright <msf@redhat.com>
- * Jeremy Katz <katzj@redhat.com>
- * Bill Nottingham <notting@redhat.com>
- *
- * Copyright 1999 - 2005 Red Hat, Inc.
- *
- * This software may be freely redistributed under the terms of the GNU
- * General Public License.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <kudzu/kudzu.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-
-#include "loader.h"
-#include "loadermisc.h"
-#include "log.h"
-#include "modules.h"
-
-/* boot flags */
-extern uint64_t flags;
-
-char * getPcicController() {
- struct device ** devices;
- static int probed = 0;
- static char * pcic = NULL;
-
- if (!probed) {
- probed = 1;
-
- devices = probeDevices(CLASS_SOCKET, BUS_UNSPEC, 0);
- if (devices) {
- int x;
-
- for (x = 0; devices[x]; x++) {
- if (devices[x]->driver) {
- char *tmp;
- int i;
-
- logMessage(DEBUGLVL, "found pcmcia adapter %s", devices[x]->driver);
- if (!pcic)
- tmp = strdup(devices[x]->driver);
- else {
- i = asprintf(&tmp, "%s:%s", pcic,
- devices[x]->driver);
- free(pcic);
- }
- pcic = tmp;
- }
- }
- }
-
- if (!pcic) {
- logMessage(DEBUGLVL, "no pcic controller found");
- }
- return pcic;
- } else {
- return pcic;
- }
-}
-
-int startupPcmciaControllers() {
- char *adj_io[] = {
- "0x00000100 - 0x000003af",
- "0x000003bb - 0x000004cf",
- "0x000004d8 - 0x000004ff",
- "0x00000a00 - 0x00000aff",
- "0x00000c00 - 0x00000cff",
- "0x00004000 - 0x00008fff",
- NULL
- };
- char *adj_mem[] = {
- "0x000c0000 - 0x000fffff",
- "0x60000000 - 0x60ffffff",
- "0xa0000000 - 0xa0ffffff",
- "0xc0200000 - 0xcfffffff",
- "0xe8000000 - 0xefffffff",
- NULL
- };
- char path[128];
- int x;
-
- for (x = 0; ; x++) {
- int y;
- FILE *f;
-
- sprintf(path,"/sys/class/pcmcia_socket/pcmcia_socket%d/available_resources_io", x);
- f = fopen(path, "w");
- if (!f)
- break;
- for (y = 0; adj_io[y]; y++) {
- fprintf(f, "%s
", adj_io[y]);
- }
- fclose(f);
-
- sprintf(path,"/sys/class/pcmcia_socket/pcmcia_socket%d/available_resources_mem", x);
- f = fopen(path, "w");
- if (!f)
- break;
- for (y = 0; adj_mem[y]; y++) {
- fprintf(f, "%s
", adj_mem[y]);
- }
- fclose(f);
-
- sprintf(path,"/sys/class/pcmcia_socket/pcmcia_socket%d/available_resources_setup_done", x);
- f = fopen(path,"w");
- if (!f)
- break;
- fprintf(f,"1
");
- fclose(f);
- }
- return 0;
-}
-
-int initializePcmciaController(moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo) {
- char * pcic = NULL;
- char * mods;
- int i;
-
- if (FL_NOPCMCIA(flags) || FL_TESTING(flags))
- return 0;
-
- pcic = getPcicController();
- if (!pcic)
- return 0;
-
- i = asprintf(&mods, "pcmcia_core:%s:pcmcia", pcic);
- free(pcic);
- mlLoadModuleSet(mods, modLoaded, modDeps, modInfo);
- free(mods);
-
- startupPcmciaControllers();
- return 0;
-}
diff --git a/loader2/pcmcia.h b/loader2/pcmcia.h
deleted file mode 100644
index 3953c23..0000000
--- a/loader2/pcmcia.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef H_PCMCIA
-#define H_PCMCIA
-
-#include <kudzu/kudzu.h>
-
-int initializePcmciaController(moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo);
-void startPcmciaDevices(moduleList modLoaded);
-
-#endif
diff --git a/loader2/usb.c b/loader2/usb.c
deleted file mode 100644
index dcbc5f5..0000000
--- a/loader2/usb.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * usb.c - usb probing/module loading functionality
- *
- * Erik Troan <ewt@redhat.com>
- * Matt Wilson <msw@redhat.com>
- * Michael Fulbright <msf@redhat.com>
- * Jeremy Katz <katzj@redhat.com>
- *
- * Copyright 1999 - 2003 Red Hat, Inc.
- *
- * This software may be freely redistributed under the terms of the GNU
- * General Public License.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <alloca.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <kudzu/kudzu.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "loader.h"
-#include "log.h"
-#include "modules.h"
-#include "moduledeps.h"
-
-#include "../isys/imount.h"
-
-/* boot flags */
-extern uint64_t flags;
-
-/* This forces a pause between initializing usb and trusting the /proc
- stuff */
-void sleepUntilUsbIsStable(void) {
- struct stat sb;
- time_t last = 0;
- int i, count = 0;
-
- /* sleep for a maximum of 20 seconds, minimum of 2 seconds */
- logMessage(DEBUGLVL, "waiting for usb to become stable...");
- for (i = 0; i < 20; i++) {
- stat("/proc/bus/usb/devices", &sb);
- if (last == sb.st_mtime) {
- count++;
- /* if we get the same mtime twice in a row, should be
- good enough to use now */
- if (count > 1)
- break;
- } else {
- /* if we didn't match mtimes, reset the stability counter */
- count = 0;
- }
- last = sb.st_mtime;
- sleep(1);
- }
- logMessage(DEBUGLVL, "%d seconds.", i);
-}
-
-int usbInitialize(moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo) {
- struct device ** devices;
- char * buf;
- int i;
- char * loadUsbStorage = NULL;
-
- if (FL_NOUSB(flags)) return 0;
-
- logMessage(INFO, "looking for usb controllers");
-
- devices = probeDevices(CLASS_USB, BUS_PCI | BUS_PS3 | BUS_MACIO, 0);
-
- if (!devices) {
- logMessage(DEBUGLVL, "no usb controller found");
- return 0;
- }
-
- /* JKFIXME: if we looked for all of them, we could batch this up and it
- * would be faster */
- for (i=0; devices[i]; i++) {
- if (!devices[i]->driver) continue;
- logMessage(INFO, "found USB controller %s", devices[i]->driver);
-
- if (mlLoadModuleSet(devices[i]->driver, modLoaded, modDeps, modInfo)) {
- /* dont return, just keep going. */
- /* may have USB built into kernel */
- /* return 1; */
- }
-
- }
- free(devices);
-
-
- if (FL_TESTING(flags)) return 0;
-
- if (doPwMount("/proc/bus/usb", "/proc/bus/usb", "usbfs", 0, NULL))
- logMessage(ERROR, "failed to mount device usbfs: %s", strerror(errno));
-
- /* sleep so we make sure usb devices get properly enumerated.
- that way we should block when initializing each usb driver until
- the device is ready for use */
- sleepUntilUsbIsStable();
-
- if (!FL_NOUSBSTORAGE(flags)) {
- devices = probeDevices(CLASS_HD | CLASS_FLOPPY | CLASS_CDROM,
- BUS_USB, PROBE_ALL);
- if (devices) {
- if (FL_UB(flags))
- loadUsbStorage = ":ub";
- else
- loadUsbStorage = ":usb-storage";
- free(devices);
- }
- }
-
- buf = alloca(40);
- sprintf(buf, "hid:keybdev%s", (loadUsbStorage ? loadUsbStorage : ""));
- mlLoadModuleSet(buf, modLoaded, modDeps, modInfo);
- sleep(1);
-
- return 0;
-}
-
-void usbInitializeMouse(moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo) {
- if (FL_NOUSB(flags)) return;
-
- logMessage(INFO, "looking for USB mouse...");
- if (probeDevices(CLASS_MOUSE, BUS_USB, PROBE_ALL)) {
- logMessage(INFO, "USB mouse found, loading mousedev module");
- if (mlLoadModuleSet("mousedev:appletouch", modLoaded, modDeps, modInfo)) {
- logMessage (DEBUGLVL, "failed to loading mousedev module");
- return;
- }
- }
-}
-
diff --git a/loader2/usb.h b/loader2/usb.h
deleted file mode 100644
index aa17e1e..0000000
--- a/loader2/usb.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef H_USB
-#define H_USB
-
-extern int usbInitialize(moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo);
-extern void usbInitializeMouse(moduleList modLoaded, moduleDeps modDeps,
- moduleInfoSet modInfo);
-extern void sleepUntilUsbIsStable(void);
-
-#endif
--
1.5.3.7

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 12:50 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.