Patchwork Remove old USB driver from FILO

login
register
about
Submitter Patrick Georgi
Date 2010-08-24 10:18:01
Message ID <4C739C59.7010600@georgi-clan.de>
Download mbox | patch
Permalink /patch/1789/
State Accepted
Headers show

Comments

Patrick Georgi - 2010-08-24 10:18:01
Hi,

attached patch removes the old USB driver from FILO and renames the "usb
new" driver to just usb (so we don't end up with awkward situations in
the future like with our old 'newconfig').

Given that the usb driver is only one file, I also dropped the
drivers/usb/ directory.

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>

Patch

Index: include/fs.h

===================================================================
--- include/fs.h	(Revision 136)

+++ include/fs.h	(Arbeitskopie)

@@ -40,14 +40,9 @@ 

 
 #ifdef CONFIG_USB_DISK
 int usb_probe(int drive);
-int usb_read(int drive, sector_t sector, void *buffer);
+int usb_read(const int drive, const sector_t sector, const int size, void *buffer);
 #endif
 
-#ifdef CONFIG_USB_NEW_DISK
-int usb_new_probe(int drive);
-int usb_new_read(const int drive, const sector_t sector, const int size, void *buffer);
-#endif
-
 #ifdef CONFIG_FLASH_DISK
 int flash_probe(int drive);
 int flash_read(int drive, sector_t sector, void *buffer);
@@ -58,7 +53,6 @@ 

 #define DISK_MEM 2
 #define DISK_USB 3
 #define DISK_FLASH 4
-#define DISK_NEW_USB 5
 
 int devopen(const char *name, int *reopen);
 void devclose(void);
Index: main/filo.c

===================================================================
--- main/filo.c	(Revision 136)

+++ main/filo.c	(Arbeitskopie)

@@ -73,9 +73,6 @@ 

     relocate();
 
 #if defined(CONFIG_USB_DISK)
-    usb_initialize();
-#endif
-#if defined(CONFIG_USB_NEW_DISK)
 #if defined(CONFIG_USB)
     /* libpayload USB stack is there */
     usb_initialize();
Index: configs/defconfig

===================================================================
--- configs/defconfig	(Revision 136)

+++ configs/defconfig	(Arbeitskopie)

@@ -20,7 +20,7 @@ 

 #
 # CONFIG_IDE_DISK is not set
 CONFIG_IDE_NEW_DISK=y
-CONFIG_USB_NEW_DISK=y
+CONFIG_USB_DISK=y
 # CONFIG_FLASH_DISK is not set
 CONFIG_SUPPORT_PCI=y
 # CONFIG_PCI_BRUTE_SCAN is not set
Index: fs/blockdev.c

===================================================================
--- fs/blockdev.c	(Revision 136)

+++ fs/blockdev.c	(Arbeitskopie)

@@ -166,7 +166,7 @@ 

 		*drive = *name - 'a';
 		name++;
 	} else if (memcmp(name, "ud", 2) == 0) {
-		*type = DISK_NEW_USB;
+		*type = DISK_USB;
 		name += 2;
 		if (*name < 'a' || *name > 'z') {
 			printf("Invalid drive\n");
@@ -256,16 +256,6 @@ 

 		disk_size = (uint32_t) - 1;	/* FIXME */
 		break;
 #endif
-#if defined(CONFIG_USB_NEW_DISK) && defined(CONFIG_USB)
-	case DISK_NEW_USB:
-		if (usb_new_probe(drive) != 0) {
-			debug("Failed to open USB.\n");
-			return 0;
-		}
-		disk_size = (uint32_t) - 1;	/* FIXME */
-		break;
-#endif
-
 #ifdef CONFIG_USB_DISK
 	case DISK_USB:
 		if (usb_probe(drive) != 0) {
@@ -406,11 +396,11 @@ 

 			break;
 		}
 #endif
-#if defined(CONFIG_USB_NEW_DISK) && defined(CONFIG_USB)
-		case DISK_NEW_USB:
+#ifdef CONFIG_USB_DISK
+		case DISK_USB:
 		{
 			int count = (NUM_CACHE-hash>8)?8:(NUM_CACHE-hash);
-			if (usb_new_read(dev_drive, sector, count, buf) != 0)
+			if (usb_read(dev_drive, sector, count, buf) != 0)
 				goto readerr;
 			while (--count>0) {
 				cache_sect[hash+count] = sector + count;
@@ -418,12 +408,6 @@ 

 			break;
 		}
 #endif
-#ifdef CONFIG_USB_DISK
-		case DISK_USB:
-			if (usb_read(dev_drive, sector, buf) != 0)
-				goto readerr;
-			break;
-#endif
 
 #ifdef CONFIG_FLASH_DISK
 		case DISK_FLASH:
Index: Config.in

===================================================================
--- Config.in	(Revision 136)

+++ Config.in	(Arbeitskopie)

@@ -129,19 +129,12 @@ 

 	help
 	  Jens Axboe's fine IDE driver
 
-config USB_NEW_DISK
+config USB_DISK
 	bool "USB Stack"
 	default y
 	help
 	  Driver for USB Storage
 
-config USB_DISK
-	bool "Old USB Stack (obsolete?)"
-	default n
-	depends on !USB_NEW_DISK
-	help
-	  Driver for USB Storage
-
 config FLASH_DISK
 	bool "NAND Flash support"
 	default n
Index: Makefile

===================================================================
--- Makefile	(Revision 136)

+++ Makefile	(Arbeitskopie)

@@ -72,7 +72,7 @@ 

 
 BUILD-y := main/Makefile.inc main/grub/Makefile.inc fs/Makefile.inc 
 BUILD-y += drivers/Makefile.inc
-BUILD-y += drivers/usb/Makefile.inc drivers/newusb/Makefile.inc drivers/flash/Makefile.inc
+BUILD-y += drivers/flash/Makefile.inc
 
 include $(PLATFORM-y) $(BUILD-y)
 
@@ -151,7 +151,7 @@ 

 
 prepare:
 	$(Q)mkdir -p $(obj)/util/kconfig/lxdialog
-	$(Q)mkdir -p $(obj)/i386 $(obj)/fs $(obj)/drivers/flash $(obj)/drivers/usb $(obj)/drivers/newusb
+	$(Q)mkdir -p $(obj)/i386 $(obj)/fs $(obj)/drivers/flash
 	$(Q)mkdir -p $(obj)/main/grub
 
 clean:
Index: drivers/newusb/Makefile.inc (deleted)

===================================================================
Index: drivers/newusb/usb.c (deleted)

===================================================================
Index: drivers/Makefile.inc

===================================================================
--- drivers/Makefile.inc	(Revision 136)

+++ drivers/Makefile.inc	(Arbeitskopie)

@@ -19,5 +19,6 @@ 

 TARGETS-$(CONFIG_IDE_DISK) += drivers/ide.o
 TARGETS-$(CONFIG_IDE_NEW_DISK) += drivers/ide_new.o
 TARGETS-$(CONFIG_VIA_SOUND) += drivers/via-sound.o
+TARGETS-$(CONFIG_USB_DISK) += drivers/usb.o
 TARGETS-y += drivers/intel.o
 
Index: drivers/usb/usb.h (deleted)

===================================================================
Index: drivers/usb/usb_scsi_low.h (deleted)

===================================================================
Index: drivers/usb/Makefile.inc (deleted)

===================================================================
Index: drivers/usb/scsi.h (deleted)

===================================================================
Index: drivers/usb/scsi_cmds.c (deleted)

===================================================================
Index: drivers/usb/scsi_cmds.h (deleted)

===================================================================
Index: drivers/usb/debug_x.c (deleted)

===================================================================
Index: drivers/usb/usb_x.c (deleted)

===================================================================
Index: drivers/usb/debug_x.h (deleted)

===================================================================
Index: drivers/usb/ohci.c (deleted)

===================================================================
Index: drivers/usb/ohci.h (deleted)

===================================================================
Index: drivers/usb/uhci.c (deleted)

===================================================================
Index: drivers/usb/usb.c (deleted)

===================================================================
Index: drivers/usb/usb_scsi_low.c (deleted)

===================================================================
Index: drivers/usb/uhci.h (deleted)

===================================================================
Index: drivers/usb.c

===================================================================
--- drivers/usb.c	(Revision 136)

+++ drivers/usb.c	(Arbeitskopie)

@@ -54,7 +54,7 @@ 

 	}
 }
 
-int usb_new_probe(int drive)
+int usb_probe(int drive)
 {
 	/* FIXME: need a place to periodically poll usb_poll().
 	   or at least at sensible times.
@@ -66,7 +66,7 @@ 

 	return -1;
 }
 
-int usb_new_read(const int drive, const sector_t sector, const int size, void *buffer)
+int usb_read(const int drive, const sector_t sector, const int size, void *buffer)
 {
 	if (count < drive) return -1;
 	int result = -readwrite_blocks_512(devs[drive], sector, size, cbw_direction_data_in, buffer);