summaryrefslogtreecommitdiff
path: root/recipes/linux/unslung-kernel/linux-kernel-R29_to_R63.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/linux/unslung-kernel/linux-kernel-R29_to_R63.patch')
-rw-r--r--recipes/linux/unslung-kernel/linux-kernel-R29_to_R63.patch6441
1 files changed, 0 insertions, 6441 deletions
diff --git a/recipes/linux/unslung-kernel/linux-kernel-R29_to_R63.patch b/recipes/linux/unslung-kernel/linux-kernel-R29_to_R63.patch
deleted file mode 100644
index 6882b335f3..0000000000
--- a/recipes/linux/unslung-kernel/linux-kernel-R29_to_R63.patch
+++ /dev/null
@@ -1,6441 +0,0 @@
---- linux-2.4.22-r29/drivers/ixp400/Makefile 2005-11-27 21:09:09.000000000 +0100
-+++ linux-2.4.22/drivers/ixp400/Makefile 2005-11-27 21:25:15.000000000 +0100
-@@ -80,9 +80,9 @@
- # -- End Intel/GPL Copyright Notice --
- #
-
- ifdef CONFIG_IXP425_CSR
--include $(ROOTDIR)/IXP400lib/ixp400_xscale_sw/buildUtils/environment.linux
-+# include $(ROOTDIR)/IXP400lib/ixp400_xscale_sw/buildUtils/environment.linux
- # IX_XSCALE_SW=$(ROOTDIR)/IXP400lib/ixp400_xscale_sw/
- # The kernel makefiles override the value of CFLAGS on the make
- # commandline. Because the xscale_sw makefile is supposed to be
- # stand-alone, we don't want this. So we reset the special variable
-@@ -136,15 +136,15 @@
- # This rule builds the modules.
- # The dependency on modversions.h is needed here so it'll be built for
- # us in a 'make modules'.
- build_ixp400_modules: force $(TOPDIR)/include/linux/modversions.h
-- cd $(IX_XSCALE_SW); $(MAKE) IX_NOSYM=1 $(REAL_IXP400_MODULES:$(IX_XSCALE_SW)/%=%)
-+# cd $(IX_XSCALE_SW); $(MAKE) IX_NOSYM=1 $(REAL_IXP400_MODULES:$(IX_XSCALE_SW)/%=%)
-
- # After building the modules, we copy them to this directory as that's
- # where the kernel makefiles expect to find them. We can't use
- # symlinks, as Jungo's 'make ramdisk' rule would just copy the links.
- $(IXP400_MODULES): $(REAL_IXP400_MODULES)
-- cp $(IX_XSCALE_SW)/lib/linuxbe/$@ $@
-+# cp $(IX_XSCALE_SW)/lib/linuxbe/$@ $@
-
- # This macro is the interface to the rules in $(TOPDIR)/Rules.make. It
- # contains the names of all module files that can be built in this
- # directory. Note that they must be filenames in this directory - the
---- R29/drivers/Makefile 2004-03-24 19:55:04.000000000 +0000
-+++ R63/drivers/Makefile 2005-08-30 06:06:00.000000000 +0100
-@@ -48,9 +48,4 @@
- subdir-$(CONFIG_PCF8594C2) += i2c/pcf8594c-2
-
- subdir-$(CONFIG_BLUEZ) += bluetooth
--
--ifdef CONFIG_ARCH_IXP425
--subdir-$(CONFIG_IXP425_CSR) += ixp400
--endif
--
- include $(TOPDIR)/Rules.make
---- R29/drivers/net/Makefile 2004-03-24 19:55:20.000000000 +0000
-+++ R63/drivers/net/Makefile 2005-08-23 06:20:03.000000000 +0100
-@@ -28,10 +28,7 @@
- obj-$(CONFIG_OCP_NET) += ibm_emac/ocp.o
-
- ifdef CONFIG_IXP425_CSR
--include $(ROOTDIR)/IXP400lib/ixp400_xscale_sw/buildUtils/environment.linux
--CFLAGS_ixp425_eth.o = -I$(IX_XSCALE_SW)/src/linux \
-- -I$(IX_XSCALE_SW)/src/include
--obj-m += ixp425_eth.o
-+#obj-m += ixp425_eth.o
- endif
-
- ifeq ($(CONFIG_E1000),y)
---- R29/drivers/scsi/hosts.c 2004-03-24 19:55:43.000000000 +0000
-+++ R63/drivers/scsi/hosts.c 2005-04-05 02:40:53.000000000 +0100
-@@ -36,12 +36,15 @@
- #define __KERNEL_SYSCALLS__
-
- #include <linux/unistd.h>
--
-+//pete
-+#include <linux/sched.h>
-+#include <linux/completion.h>
-+//
- #include "scsi.h"
- #include "hosts.h"
-
- /*
--static const char RCSid[] = "$Header: /home/cvsroot/NSLU2/linux-2.4.x/drivers/scsi/hosts.c,v 1.1.1.1 2004/03/24 19:55:43 sure Exp $";
-+static const char RCSid[] = "$Header: /home/nas-cvsroot/NSLU2_V2/linux-2.4.x/drivers/scsi/hosts.c,v 1.2 2005/04/05 01:40:53 shearer Exp $";
- */
-
- /*
-@@ -84,6 +87,12 @@
- int max_scsi_hosts; /* host_no for next new host */
- int next_scsi_host; /* count of registered scsi hosts */
-
-+//pete
-+extern pid_t sd_mc_thread_pid;
-+//extern DECLARE_COMPLETION(scsi_mc_thread_exited);
-+extern struct completion sd_mc_thread_exited;
-+//
-+
- void
- scsi_unregister(struct Scsi_Host * sh){
- struct Scsi_Host * shpnt;
-@@ -110,6 +119,15 @@
-
- next_scsi_host--;
-
-+ //pete
-+ //printk("+++++ scsi_unregister:next_scsi_host:%d\n", next_scsi_host);
-+ if( next_scsi_host == 0){
-+ /* Send a signal to exit the thread. */
-+ kill_proc(sd_mc_thread_pid, SIGTERM, 1);
-+ /* If no scsi host left, we wait the thread to exit. */
-+ wait_for_completion(&sd_mc_thread_exited);
-+ }
-+ //
- kfree((char *) sh);
- }
-
---- R29/drivers/scsi/scsi.c 2004-03-24 19:55:45.000000000 +0000
-+++ R63/drivers/scsi/scsi.c 2005-05-31 10:38:52.000000000 +0100
-@@ -84,7 +84,7 @@
- #endif
-
- /*
-- static const char RCSid[] = "$Header: /home/cvsroot/NSLU2/linux-2.4.x/drivers/scsi/scsi.c,v 1.1.1.1 2004/03/24 19:55:45 sure Exp $";
-+ static const char RCSid[] = "$Header: /home/nas-cvsroot/NSLU2_V2/linux-2.4.x/drivers/scsi/scsi.c,v 1.2 2005/05/31 09:38:52 shearer Exp $";
- */
-
- /*
-@@ -1991,9 +1991,10 @@
- for (shpnt = scsi_hostlist; shpnt; shpnt = shpnt->next) {
- for (SDpnt = shpnt->host_queue; SDpnt; SDpnt = SDpnt->next)
- if (SDpnt->host->hostt == tpnt) {
-- for (sdtpnt = scsi_devicelist; sdtpnt; sdtpnt = sdtpnt->next)
-- if (sdtpnt->attach)
-- (*sdtpnt->attach) (SDpnt);
-+ for (sdtpnt = scsi_devicelist; sdtpnt; sdtpnt = sdtpnt->next)
-+ if (sdtpnt->attach){
-+ (*sdtpnt->attach) (SDpnt);
-+ }
- if (SDpnt->attached) {
- scsi_build_commandblocks(SDpnt);
- if (0 == SDpnt->has_cmdblocks)
-@@ -2049,7 +2050,7 @@
- char name[10]; /* host_no>=10^9? I don't think so. */
-
- /* get the big kernel lock, so we don't race with open() */
-- lock_kernel();
-+ lock_kernel();
-
- /*
- * First verify that this host adapter is completely free with no pending
---- R29/drivers/scsi/scsi.h 2004-07-07 09:01:24.000000000 +0100
-+++ R63/drivers/scsi/scsi.h 2005-03-31 05:58:07.000000000 +0100
-@@ -575,6 +575,9 @@
- char type;
- char scsi_level;
- char vendor[8], model[16], rev[4];
-+ //pete
-+ char node[6];
-+ //
- unsigned char current_tag; /* current tag */
- unsigned char sync_min_period; /* Not less than this period */
- unsigned char sync_max_offset; /* Not greater than this offset */
---- R29/drivers/scsi/scsi_proc.c 2004-03-24 19:55:45.000000000 +0000
-+++ R63/drivers/scsi/scsi_proc.c 2004-10-28 09:54:56.000000000 +0100
-@@ -263,8 +263,8 @@
- extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
-
- y = sprintf(buffer + len,
-- "Host: scsi%d Channel: %02d Id: %02d Lun: %02d\n Vendor: ",
-- scd->host->host_no, scd->channel, scd->id, scd->lun);
-+ "Host: scsi%d-%s Channel: %02d Id: %02d Lun: %02d\n Vendor: ",
-+ scd->host->host_no, /*pete*/scd->node, scd->channel, scd->id, scd->lun);
- for (x = 0; x < 8; x++) {
- if (scd->vendor[x] >= 0x20)
- y += sprintf(buffer + len + y, "%c", scd->vendor[x]);
---- linux-2.4.22-r29/drivers/scsi/sd.c 2005-11-27 21:08:49.000000000 +0100
-+++ linux-2.4.22/drivers/scsi/sd.c 2005-11-27 21:15:45.000000000 +0100
-@@ -61,6 +61,10 @@
-
- #include <linux/genhd.h>
-
-+//pete
-+#include <linux/completion.h>
-+//
-+
- /*
- * static const char RCSid[] = "$Header:";
- */
-@@ -81,6 +85,9 @@
- #define N_USED_SD_MAJORS (N_USED_SCSI_DISKS / SCSI_DISKS_PER_MAJOR)
-
- #define MAX_RETRIES 5
-+//pete
-+#define SCSI_SEND_CMND_INTERVAL 5*HZ
-+//
-
- /*
- * Time out in seconds for disks and Magneto-opticals (which are slower).
-@@ -89,11 +96,16 @@
- #define SD_TIMEOUT (30 * HZ)
- #define SD_MOD_TIMEOUT (75 * HZ)
-
-+//
- /* grant */
- //#define GUID_EQUAL(x,y) (x[0]==y[0] && x[1]==y[1] && x[2]==y[2])
-
-+//pete
-+static int port2_attached;
-+pid_t sd_mc_thread_pid;
-+DECLARE_COMPLETION(sd_mc_thread_exited);
-+//
- static Scsi_Disk *rscsi_disks;
--//static Scsi_Disk *rscsi_disks;
- static struct gendisk *sd_gendisks;
- static int *sd_sizes;
- static int *sd_blocksizes;
-@@ -104,7 +116,9 @@
- static int fop_revalidate_scsidisk(kdev_t);
-
- static int sd_init_onedisk(int);
--
-+//pete
-+static int sd_send_cmnd_one(int);
-+//
-
- static int sd_init(void);
- static void sd_finish(void);
-@@ -113,6 +127,7 @@
- static void sd_detach(Scsi_Device *);
- static int sd_init_command(Scsi_Cmnd *);
-
-+
- static struct Scsi_Device_Template sd_template = {
- name:"disk",
- tag:"sd",
-@@ -783,6 +798,11 @@
- unsigned int the_result;
- int sector_size;
- Scsi_Request *SRpnt;
-+
-+ //pete
-+ char flash[12]="flash_";
-+ char hdd[10]="hdd_";
-+ //
-
- /*
- * Get the name of the disk, in case we need to log it somewhere.
-@@ -1053,6 +1073,7 @@
- "%u %d-byte hdwr sectors (%u MB)\n",
- nbuff, rscsi_disks[i].capacity,
- hard_sector, (sz - sz/625 + 974)/1950);
-+
- }
-
- /* Rescale capacity to 512-byte units */
-@@ -1065,6 +1086,55 @@
- if (sector_size == 256)
- rscsi_disks[i].capacity >>= 1;
- }
-+ // add by super, moified by pete
-+ if (rscsi_disks[i].device->removable){
-+ if(0x32 == rscsi_disks[i].device->host->hostt->port){
-+ printk("is removable disk \n");
-+ *IXP425_GPIO_GPOUTR &= 0xfffb;
-+ //port2_attached |= 1<<(i-1);
-+ remove_proc_entry("flash_sda",NULL);
-+ create_proc_read_entry("flash_sda",
-+ 0,
-+ NULL,
-+ NULL,
-+ NULL
-+ );
-+ }else{
-+ strcat(flash,nbuff);
-+ printk("is removable disk \n");
-+ *IXP425_GPIO_GPOUTR &= 0xfff7;
-+ port2_attached |= 1<<(i-1);
-+ remove_proc_entry(flash,NULL);
-+ create_proc_read_entry(flash,
-+ 0,
-+ NULL,
-+ NULL,
-+ NULL
-+ );
-+ }
-+ }else {
-+ printk("%x port connect!!!!!\n",rscsi_disks[i].device->host->hostt->port);
-+ if(0x32 == rscsi_disks[i].device->host->hostt->port){
-+ *IXP425_GPIO_GPOUTR &= 0xfffb;
-+ create_proc_read_entry("hdd_sda",
-+ 0,
-+ NULL,
-+ NULL,
-+ NULL
-+ );
-+ }else{
-+ *IXP425_GPIO_GPOUTR &= 0xfff7;
-+ port2_attached |= 1<<(i-1);
-+ strcat(hdd,nbuff);
-+ create_proc_read_entry(hdd,
-+ 0,
-+ NULL,
-+ NULL,
-+ NULL
-+ );
-+ }
-+ }
-+ //end
-
-
- /*
-@@ -1124,6 +1194,140 @@
- return i;
- }
-
-+//pete
-+static int sd_send_cmnd_one(int i)
-+{
-+ unsigned char cmd[10];
-+ char nbuff[6];
-+ unsigned char *buffer;
-+ unsigned int the_result;
-+ Scsi_Request *SRpnt;
-+
-+ char media[24];
-+ /*
-+ * Get the name of the disk, in case we need to log it somewhere.
-+ */
-+ sd_devname(i, nbuff);
-+
-+ /*
-+ * If the device is offline, don't try and read capacity or any
-+ * of the other niceties.
-+ */
-+ if (rscsi_disks[i].device->online == FALSE)
-+ return i;
-+
-+ /*
-+ * We need to retry the READ_CAPACITY because a UNIT_ATTENTION is
-+ * considered a fatal error, and many devices report such an error
-+ * just after a scsi bus reset.
-+ */
-+
-+ SRpnt = scsi_allocate_request(rscsi_disks[i].device);
-+ if (!SRpnt) {
-+ printk(KERN_WARNING "(sd_init_onedisk:) Request allocation failure.\n");
-+ return i;
-+ }
-+
-+ buffer = (unsigned char *) scsi_malloc(512);
-+ if (!buffer) {
-+ printk(KERN_WARNING "(sd_init_onedisk:) Memory allocation failure.\n");
-+ scsi_release_request(SRpnt);
-+ return i;
-+ }
-+
-+ cmd[0] = TEST_UNIT_READY; /* use this command to test media change */
-+ cmd[1] = (rscsi_disks[i].device->scsi_level <= SCSI_2) ?
-+ ((rscsi_disks[i].device->lun << 5) & 0xe0) : 0;
-+ memset((void *) &cmd[2], 0, 8);
-+ SRpnt->sr_cmd_len = 0;
-+ SRpnt->sr_sense_buffer[0] = 0;
-+ SRpnt->sr_sense_buffer[2] = 0;
-+ SRpnt->sr_data_direction = SCSI_DATA_NONE;
-+
-+ scsi_wait_req (SRpnt, (void *) cmd, (void *) buffer,
-+ 0/*512*/, SD_TIMEOUT, MAX_RETRIES);
-+
-+ the_result = SRpnt->sr_result;
-+
-+ sprintf(media, "sd%c_media_not_present", 'a' + i);
-+
-+ /* -- code: 0x70, key: 0x2, ASC: 0x3a, ASCQ: 0x0
-+ this indicates Unit not ready: media not present */
-+ if( the_result != 0
-+ && ((driver_byte(the_result) & DRIVER_SENSE) != 0)
-+ && SRpnt->sr_sense_buffer[0] == 0x70
-+ && (SRpnt->sr_sense_buffer[2]& 0xf) == NOT_READY
-+ && SRpnt->sr_sense_buffer[12] == 0x3A
-+ && SRpnt->sr_sense_buffer[13] == 0x0 ) {
-+ //printk("sd%c media not present!\n", 'a' + i);
-+ remove_proc_entry(media, NULL);
-+ create_proc_read_entry(media,
-+ 0,
-+ NULL,
-+ NULL,
-+ NULL
-+ );
-+ }else if(the_result == 0){ /* need more conditions? */
-+ remove_proc_entry(media, NULL);
-+ }
-+
-+ scsi_release_request(SRpnt);
-+ SRpnt = NULL;
-+
-+ scsi_free(buffer, 512);
-+ return i;
-+}
-+
-+static int sd_send_cmnd_thread(void)
-+{
-+ int i;
-+
-+ siginitsetinv(&current->blocked, 0);
-+
-+ //lock_kernel();
-+
-+ /*
-+ * This thread doesn't need any user-level access,
-+ * so get rid of all our resources..
-+ */
-+ exit_files(current);
-+ current->files = init_task.files;
-+ atomic_inc(&current->files->count);
-+ daemonize();
-+ reparent_to_init();
-+
-+ /* avoid getting signals */
-+ spin_lock_irq(&current->sigmask_lock);
-+ flush_signals(current);
-+ sigfillset(&current->blocked);
-+ recalc_sigpending(current);
-+ spin_unlock_irq(&current->sigmask_lock);
-+
-+ /* set our name for identification purposes */
-+ sprintf(current->comm, "sd-mc-thread");
-+
-+ //unlock_kernel();
-+
-+ do{
-+ /* If all scsi disks are removed, there will be no scsi host, so we should exit this thread. */
-+ if(next_scsi_host == 0)
-+ break;
-+
-+ for (i = 0; i < sd_template.dev_max; ++i)
-+ if ( rscsi_disks[i].device) {
-+ sd_send_cmnd_one(i);
-+ }
-+
-+ /* Now sleep for 5 seconds */
-+ current->state = TASK_INTERRUPTIBLE;
-+ schedule_timeout(SCSI_SEND_CMND_INTERVAL);
-+ }while(!signal_pending(current));
-+
-+ complete_and_exit(&sd_mc_thread_exited, 0);
-+ return 0;
-+}
-+//
-+
- /*
- * The sd_init() function looks at all SCSI drives present, determines
- * their size, and reads partition table entries for them.
-@@ -1298,6 +1502,15 @@
- : 4; /* 4 sector read-ahead */
- }
-
-+ //pete
-+ //printk("-------------------in sd_finish------------------\n");
-+ if(next_scsi_host == 1){
-+ /* We just need *ONE* thread */
-+ sd_mc_thread_pid = kernel_thread(sd_send_cmnd_thread, NULL, CLONE_VM);
-+ if(sd_mc_thread_pid < 0)
-+ printk("Unable to start sd send command thread\n");
-+ }
-+ //
- return;
- }
-
-@@ -1323,9 +1536,26 @@
- SDp->attached--;
- return 1;
- }
-- for (dpnt = rscsi_disks, i = 0; i < sd_template.dev_max; i++, dpnt++)
-- if ( SDp == dpnt->device || !dpnt->device) /* grant */
-- break;
-+
-+ //Pete
-+ if(SDp->host->host_no == 0){
-+ dpnt = rscsi_disks;
-+ if(dpnt->device){
-+ SDp->attached--;
-+ return 1;
-+ }
-+ i = 0;
-+ }
-+ else{
-+ //start from rscsi_disk[1].
-+ dpnt = rscsi_disks;
-+ dpnt++;
-+ i = 1;
-+ for (; i < sd_template.dev_max; i++, dpnt++)
-+ if (SDp == dpnt->device||!dpnt->device){
-+ break;
-+ }
-+ }
-
- if (i >= sd_template.dev_max) {
- printk(KERN_WARNING "scsi_devices corrupt (sd),"
-@@ -1334,18 +1564,7 @@
- SDp->attached--;
- return 1;
- }
-- /* check different disks by grant */
-- // i = SDp->removable;//super modify
-- printk("the host no is %d\n",SDp->host->host_no);
-- i = 1 - SDp->host->host_no;
-- if ( rscsi_disks[i].device )//&&
-- // !GUID_EQUAL( (struct us_data *)rscsi_disks[i].device->host->hostt->proc_dir->guid,
-- // (struct us_data *)SDp->host->hostt->proc_dir->guid) )
-- {
-- sd_detach( rscsi_disks[i].device );
-- printk("* sd_detach\n");
-- }
-- printk("* sd_attach:%d\n",i);
-+
- rscsi_disks[i].device = SDp;
- rscsi_disks[i].has_part_table = 0;
- sd_template.nr_dev++;
-@@ -1355,6 +1574,9 @@
- if (SDp->removable)
- SD_GENDISK(i).flags[devnum] |= GENHD_FL_REMOVABLE;
- sd_devname(i, nbuff);
-+ //pete
-+ strcpy(SDp->node, nbuff);
-+ //
- printk("Attached scsi %sdisk %s at scsi%d, channel %d, id %d, lun %d\n",
- SDp->removable ? "removable " : "",
- nbuff, SDp->host->host_no, SDp->channel, SDp->id, SDp->lun);
-@@ -1434,29 +1656,65 @@
- int i, j;
- int max_p;
- int start;
-+ //pete
-+ char flash[12];
-+ char hdd[10];
-+ char media[26];
-+ //
-
- if (rscsi_disks == NULL)
- return;
-
-+
- for (dpnt = rscsi_disks, i = 0; i < sd_template.dev_max; i++, dpnt++)
- if (dpnt->device == SDp) {
-+
-+ #if 1
-+ //pete
-+ sprintf(media, "sd%c_media_not_present", 'a' + i);
-+
-+ switch(SDp->host->hostt->port){
-+ case 0x31:
-+ port2_attached ^= 1<<(i-1);
-+ if(port2_attached < 0)
-+ port2_attached = 0;
-+ if(port2_attached == 0)
-+ *IXP425_GPIO_GPOUTR |= 0x8;
-+ if(SDp->removable == 1){
-+ sprintf(flash, "flash_sd%c", 'a' + i);
-+ remove_proc_entry(flash, NULL);
-+ remove_proc_entry(media, NULL);
-+ }else{
-+ sprintf(hdd, "hdd_sd%c", 'a' + i);
-+ remove_proc_entry(hdd,NULL);
-+ remove_proc_entry(media, NULL);
-+ }
-+ break;
-+ case 0x32:
-+ *IXP425_GPIO_GPOUTR |= 0x4;
-+ if(SDp->removable == 1){
-+ remove_proc_entry("flash_sda",NULL);
-+ }
-+ else
-+ remove_proc_entry("hdd_sda",NULL);
-+ break;
-+ default:
-+ break;
-+ }
-+ #endif
-+ //
-
- /* If we are disconnecting a disk driver, sync and invalidate
- * everything */
- sdgd = &SD_GENDISK(i);
- max_p = sd_gendisk.max_p;
- start = i << sd_gendisk.minor_shift;
--printk("max_p is %d ;start is %d\n",max_p,start);
--
- for (j = max_p - 1; j >= 0; j--) {
- int index = start + j;
-- // printk("invalidate_device index = %d\n",index);
-- invalidate_device(MKDEV_SD_PARTITION(index), 1);
-+ invalidate_device(MKDEV_SD_PARTITION(index), 0);
- sdgd->part[SD_MINOR_NUMBER(index)].start_sect = 0;
- sdgd->part[SD_MINOR_NUMBER(index)].nr_sects = 0;
- sd_sizes[index] = 0;
-- // printk("MKDEV_SD_PARTITION ok\n");
--
- }
- devfs_register_partitions (sdgd,
- SD_MINOR_NUMBER (start), 1);
---- R29/drivers/usb/host/ehci-q.c 2004-07-07 08:31:43.000000000 +0100
-+++ R63/drivers/usb/host/ehci-q.c 2005-02-03 04:59:48.000000000 +0000
-@@ -39,6 +39,22 @@
- */
-
- /*-------------------------------------------------------------------------*/
-+
-+//pete
-+void ehci_urb_dma_sync(struct usb_hcd *hcd, struct urb *urb)
-+{
-+ if (urb->setup_dma)
-+ pci_dma_sync_single(hcd->pdev, urb->setup_dma,
-+ sizeof(struct usb_ctrlrequest),
-+ PCI_DMA_TODEVICE);
-+ if (urb->transfer_buffer_length != 0)
-+ pci_dma_sync_single(hcd->pdev, urb->transfer_dma,
-+ urb->transfer_buffer_length,
-+ usb_pipein(urb->pipe)
-+ ? PCI_DMA_FROMDEVICE
-+ : PCI_DMA_TODEVICE);
-+}
-+//
-
- /* fill a qtd, returning how much of the buffer we were able to queue up */
-
-@@ -205,7 +221,16 @@
- qh_put (ehci, qh);
- }
-
-+
-+
- spin_lock (&urb->lock);
-+
-+//pete: This fix the 2.0hub + 1.1 udisks bug
-+ /* only control transfer makes trouble */
-+ if (usb_pipecontrol (urb->pipe)){
-+ ehci_urb_dma_sync(&ehci->hcd, urb);
-+ }
-+
- urb->hcpriv = 0;
- switch (urb->status) {
- case -EINPROGRESS: /* success */
-@@ -799,6 +824,10 @@
- {
- struct ehci_qh *qh = 0;
-
-+ //pete
-+ //printk("in qh_append_tds\n");
-+ //show_bytes((unsigned char *)&urb->dev->descriptor, 18);
-+
- qh = (struct ehci_qh *) *ptr;
- if (unlikely (qh == 0)) {
- /* can't sleep here, we have ehci->lock... */
-@@ -903,6 +932,9 @@
- dummy->hw_token = token;
-
- urb->hcpriv = qh_get (qh);
-+ //pete
-+ //show_bytes((unsigned char *)&urb->dev->descriptor, 18);
-+ //show_bytes((unsigned char *)&dma, 18);
- }
- }
- return qh;
---- R29/drivers/usb/host/usb-uhci.c 2004-03-24 20:42:22.000000000 +0000
-+++ R63/drivers/usb/host/usb-uhci.c 2004-11-11 09:38:55.000000000 +0000
-@@ -16,7 +16,7 @@
- * (C) Copyright 1999 Randy Dunlap
- * (C) Copyright 1999 Gregory P. Smith
- *
-- * $Id: usb-uhci.c,v 1.1 2004/03/24 20:42:22 sure Exp $
-+ * $Id: usb-uhci.c,v 1.3 2004/10/19 03:36:08 pete Exp $
- */
-
- #include <linux/config.h>
-@@ -53,7 +53,7 @@
- /* This enables an extra UHCI slab for memory debugging */
- #define DEBUG_SLAB
-
--#define VERSTR "$Revision: 1.1 $ time " __TIME__ " " __DATE__
-+#define VERSTR "$Revision: 1.3 $ time " __TIME__ " " __DATE__
-
- #include <linux/usb.h>
- #include "usb-uhci.h"
-@@ -2330,6 +2330,10 @@
- status stage is completed
- */
-
-+ //Pete
-+ //uhci_urb_dma_sync(s, urb, urb->hcpriv);
-+ //
-+
- if (urb_priv->flags &&
- ((qh->hw.qh.element == cpu_to_le32(UHCI_PTR_TERM)) || !is_td_active(desc)))
- goto transfer_finished;
-@@ -2364,6 +2368,10 @@
- else if ((le32_to_cpu(desc->hw.td.info) & 0xff) != USB_PID_SETUP)
- urb->actual_length += actual_length;
-
-+ //Pete
-+ uhci_urb_dma_sync(s, urb, urb->hcpriv);
-+ //
-+
- // got less data than requested
- if ( (actual_length < maxlength)) {
- if (urb->transfer_flags & USB_DISABLE_SPD) {
---- R29/drivers/usb/hub.c 2004-03-24 19:55:48.000000000 +0000
-+++ R63/drivers/usb/hub.c 2005-06-02 07:31:32.000000000 +0100
-@@ -726,7 +726,6 @@
- break;
- }
-
-- hub->children[port] = dev;
-
- /* Reset the device */
- if (usb_hub_port_reset(hub, port, dev, delay)) {
-@@ -776,8 +775,11 @@
- }
-
- /* Run it through the hoops (find a driver, etc) */
-- if (!usb_new_device(dev))
-+ if (!usb_new_device(dev)){
-+ //pete
-+ hub->children[port] = dev;
- goto done;
-+ }
-
- /* Free the configuration if there was an error */
- usb_free_dev(dev);
-@@ -896,9 +898,9 @@
- usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);
- }
- // if (portchange&&(!list_empty(&hub_event_list.next))){
-- if (portchange){
-- break;//super
-- }
-+// if (portchange){
-+// break;//super
-+// }
- } /* end for i */
-
- /* deal with hub status changes */
---- linux-2.4.22-r29/drivers/usb/storage/transport.c 2005-11-27 21:09:04.000000000 +0100
-+++ linux-2.4.22/drivers/usb/storage/transport.c 2005-11-28 15:56:40.000000000 +0100
-@@ -1,6 +1,6 @@
- /* Driver for USB Mass Storage compliant devices
- *
-- * $Id: transport.c,v 1.1 2004/03/24 20:43:17 sure Exp $
-+ * $Id: transport.c,v 1.2 2004/09/29 03:56:50 super Exp $
- *
- * Current development and maintenance by:
- * (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
-@@ -1244,6 +1244,8 @@
- goto out;
- }
-
-+ udelay(100); /* For GL811E Chip */
-+
- /* if the command transfered well, then we go to the data stage */
- if (result == 0) {
-
---- linux-2.4.22-r29/drivers/usb/storage/usb.c 2005-11-27 21:09:04.000000000 +0100
-+++ linux-2.4.22/drivers/usb/storage/usb.c 2005-11-28 16:10:25.000000000 +0100
-@@ -1,6 +1,6 @@
- /* Driver for USB Mass Storage compliant devices
- *
-- * $Id: usb.c,v 1.2 2004/08/30 06:54:48 sure Exp $
-+ * $Id: usb.c,v 1.2 2004/10/08 03:41:34 pete Exp $
- *
- * Current development and maintenance by:
- * (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
-@@ -561,7 +561,7 @@
- GUID(guid); /* Global Unique Identifier */
- unsigned int flags;
- struct us_unusual_dev *unusual_dev;
-- struct us_data *ss = NULL, *pre_ss, *tmp /* grant */;
-+ struct us_data *ss = NULL; /* grant */;
- #ifdef CONFIG_USB_STORAGE_SDDR09
- int result;
- #endif
-@@ -705,23 +705,11 @@
- */
- ss = us_list;
- /* modified to free unusable node by grant */
-- pre_ss = us_list;
-+
- while ((ss != NULL) &&
- ((ss->pusb_dev) || !GUID_EQUAL(guid, ss->guid)))
-- {
-- pre_ss = ss;
- ss = ss->next;
-- }
-- /* end mod */
--//super add
--#if 0
-- if (ss != NULL){
-- scsi_unregister_module(MODULE_SCSI_HA, &(ss->htmplt));
-- free_us_data( pre_ss, ss );
-- usb_dec_dev_use(dev);
-- }
--#endif
--//
-+
- if (ss != NULL) {
- /* Existing device -- re-connect */
- US_DEBUGP("Found existing GUID " GUID_FORMAT "\n",
-@@ -747,93 +735,6 @@
- USB_ENDPOINT_NUMBER_MASK;
- ss->ep_int = ep_int;
-
-- /* grant 01/30 */
--#if 0
-- if ( 0x32 != dev->bus->bus_name[6] )
-- {
-- dev->devpath[0] = dev->bus->bus_name[6] + 1;
-- }
-- /* restrict device on certain port */
-- if ( ss->htmplt.removable ^ (USB_DEVPATH_2 == dev->devpath[0]) )
-- {
-- printk("* (old)%s disk not allowed on port:%s\n", ss->htmplt.removable ? "flash" : "hard", dev->devpath);
-- usb_dec_dev_use(dev);
-- scsi_unregister_module(MODULE_SCSI_HA, &(ss->htmplt));
-- free_us_data( pre_ss, ss );
-- return NULL;
-- }
-- if (ss->htmplt.removable){
-- // add by super
-- remove_proc_entry("usb_conn",NULL);
-- *IXP425_GPIO_GPOUTR &= 0xfffb;
-- create_proc_read_entry("usb_conn",
-- 0,
-- NULL,
-- NULL,
-- NULL
-- );
-- }else{
-- remove_proc_entry("hd_conn",NULL);
-- *IXP425_GPIO_GPOUTR &= 0xfff7;
-- create_proc_read_entry("hd_conn",
-- 0,
-- NULL,
-- NULL,
-- NULL
-- );
-- }
-- printk("rscsi_disk capacity is %d@@@@@@@@@@@@@@@@\n",ss->host->host_queue->sector_size);
-- if(ss->host->host_queue->sector_size<40000000){
-- ss->htmplt.removable = 1;
-- }
--#endif
-- /* restrict device on certain port */
-- if ( ss->htmplt.removable && (USB_DEVPATH_1 == dev->devpath[0]))
-- if ( ss->htmplt.removable ^ (USB_DEVPATH_2 == dev->devpath[0]) )
-- {
-- create_proc_read_entry("usb_err",
-- 0,
-- NULL,
-- NULL,
-- NULL
-- );
-- printk("* (old)%s disk not allowed on port:%s\n", ss->htmplt.removable ? "flash" : "hard", dev->devpath);
-- usb_dec_dev_use(dev);
-- scsi_unregister_module(MODULE_SCSI_HA, &(ss->htmplt));
-- free_us_data( pre_ss, ss );
-- return NULL;
-- }
-- if (ss->htmplt.removable){
-- printk("is removable disk \n");
-- *IXP425_GPIO_GPOUTR &= 0xfffb;
-- create_proc_read_entry("usb_conn",
-- 0,
-- NULL,
-- NULL,
-- NULL
-- );
-- }else {
-- printk("%x port connect\n",dev->devpath[0]);
-- if(0x31 == dev->devpath[0]){
-- *IXP425_GPIO_GPOUTR &= 0xfff7;
-- create_proc_read_entry("hd_conn",
-- 0,
-- NULL,
-- NULL,
-- NULL
-- );
-- }else{
-- *IXP425_GPIO_GPOUTR &= 0xfffb;
-- create_proc_read_entry("hd2_conn",
-- 0,
-- NULL,
-- NULL,
-- NULL
-- );
-- }
-- }
-- //end
--
- /* allocate an IRQ callback if one is needed */
- if ((ss->protocol == US_PR_CBI) && usb_stor_allocate_irq(ss)) {
- usb_dec_dev_use(dev);
-@@ -857,6 +756,23 @@
- up(&(ss->dev_semaphore));
-
- } else {
-+#if 0
-+ //grant,pete
-+ if ( ss->htmplt.removable ^ (USB_DEVPATH_2 == dev->devpath[0]) )
-+ {
-+ create_proc_read_entry("usb_err",
-+ 0,
-+ NULL,
-+ NULL,
-+ NULL
-+ );
-+ printk("* (old)%s disk not allowed on port:%s\n", ss->htmplt.removable ? "flash" : "hard", dev->devpath);
-+ usb_dec_dev_use(dev);
-+ scsi_unregister_module(MODULE_SCSI_HA, &(ss->htmplt));
-+ return NULL;
-+ }
-+ //
-+#endif
- /* New device -- allocate memory and initialize */
- US_DEBUGP("New GUID " GUID_FORMAT "\n", GUID_ARGS(guid));
-
-@@ -1103,11 +1019,7 @@
- sizeof(usb_stor_host_template));
-
- /* Grab the next host number */
-- //ss->host_number = my_host_number++;
--
-- /* fix device name & host number by grant */
--// ss->host_number = dev->devpath[0] - USB_DEVPATH_1 ;
-- ss->host_number = USB_DEVPATH_2 - dev->devpath[0];
-+ ss->host_number = my_host_number++;
-
- /* We abuse this pointer so we can pass the ss pointer to
- * the host controller thread in us_detect. But how else are
-@@ -1128,7 +1040,6 @@
- * the device if it needs initialization */
- if (unusual_dev && unusual_dev->initFunction)
- unusual_dev->initFunction(ss);
-- printk("before kernel thread \n");
- /* start up our control thread */
- ss->pid = kernel_thread(usb_stor_control_thread, ss,
- CLONE_VM);
-@@ -1146,60 +1057,11 @@
-
- /* now register - our detect function will be called */
- ss->htmplt.module = THIS_MODULE;
-- /*debug by grant*/
--// printk("!! 1\n");
-
-- /* grant 01/30 */
-- // printk ("* bus = %c\n", dev->bus->bus_name[6]);
-- #if 0
-- if ( 0x32 != dev->bus->bus_name[6] )
-- {
-- dev->devpath[0] = dev->bus->bus_name[6] + 1;
-- // dev->devpath[0] = 0x32;
-- }
--// printk("devpath = %c\n",dev->devpath[0]);
--#endif
- ss->htmplt.port = dev->devpath[0];
-
-- tmp = us_list;
-- pre_ss = tmp;
-- while ( NULL != tmp )
-- {
-- /* free old device node by grant */
-- if( (tmp->htmplt.port == ss->htmplt.port) && (!GUID_EQUAL(tmp->guid, ss->guid)) )
-- {
-- scsi_unregister_module(MODULE_SCSI_HA, &(tmp->htmplt));
--// printk("* (2)scsi_unregister_module\n");
-- free_us_data( pre_ss, tmp );
-- break;
-- }
-- pre_ss = tmp;
-- tmp = tmp->next;
-- }
--
- scsi_register_module(MODULE_SCSI_HA, &(ss->htmplt));
-
-- /* check device port grant */
-- if ( 1 == ss->host->porttype )
-- {
--// printk("* (usb)scsi_unregister_module\n");
-- scsi_unregister_module(MODULE_SCSI_HA, &(ss->htmplt));
-- kfree(ss->current_urb);
-- kfree(ss);
-- usb_dec_dev_use(dev);
-- return NULL;
-- }
--
-- /* debug grant */
-- i = 0;
-- tmp = us_list;
-- while ( NULL != tmp )
-- {
-- i ++;
-- tmp = tmp->next;
-- }
--// printk("* (usb)scsi_register_module okay! us_data:%d\n", i );
--
- /* lock access to the data structures */
- down(&us_list_semaphore);
-
-@@ -1248,34 +1110,18 @@
- }
-
-
--
- /* Handle a disconnect event from the USB core */
- static void storage_disconnect(struct usb_device *dev, void *ptr)
- {
- struct us_data *ss = ptr;
--// struct us_data *pre_ss;
-+ struct us_data *tmp,*pre_ss;
- int result;
--//super add
-- char serial[USB_STOR_STRING_LEN]; /* serial number */
--// GUID(guid); /* Global Unique Identifier */
--//super modify
-- switch(dev->devpath[0]){
-- case 0x31:
-- *IXP425_GPIO_GPOUTR |= 0x8;
-- remove_proc_entry("hd_conn",NULL);
-- break;
-- case 0x32:
-- *IXP425_GPIO_GPOUTR |= 0x4;
-- remove_proc_entry("usb_conn",NULL);
-- remove_proc_entry("hd2_conn",NULL);
-- break;
-- default:
-- break;
-- }
--//end
-+ //Pete
-+ int i;
-+ //
-+
- US_DEBUGP("storage_disconnect() called\n");
-
-- memset(serial,0,USB_STOR_STRING_LEN);
- /* this is the odd case -- we disconnected but weren't using it */
- if (!ss) {
- US_DEBUGP("-- device was not in use\n");
-@@ -1285,6 +1131,35 @@
- /* lock access to the device data structure */
- down(&(ss->dev_semaphore));
-
-+ tmp = us_list;
-+ pre_ss = tmp;
-+ i = 0;
-+
-+ while ( tmp != NULL )
-+ {
-+ if( (tmp->htmplt.port == ss->htmplt.port) && (GUID_EQUAL(tmp->guid, ss->guid)) )
-+ {
-+ scsi_unregister_module(MODULE_SCSI_HA, &(tmp->htmplt));
-+ if( ss == us_list )
-+ {
-+ us_list = ss->next;
-+ }
-+ else if( ss->next == NULL )
-+ {
-+ pre_ss->next = NULL;
-+ }
-+ else
-+ {
-+ pre_ss->next = ss->next;
-+ }
-+
-+ break;
-+ }
-+ i++;
-+ pre_ss = tmp;
-+ tmp = tmp->next;
-+ }
-+
- if(ss->extra && ss->extra_destructor){
- ss->extra_destructor(ss->extra);
- }
---- R29/drivers/usb/usb.c 2004-07-07 08:31:44.000000000 +0100
-+++ R63/drivers/usb/usb.c 2005-06-29 06:26:23.000000000 +0100
-@@ -30,6 +30,7 @@
- #include <linux/init.h>
- #include <linux/devfs_fs_kernel.h>
- #include <linux/spinlock.h>
-+#include <linux/proc_fs.h>
-
- #include <asm/hardware.h>
- #ifdef CONFIG_USB_DEBUG
-@@ -1014,12 +1015,11 @@
- if (atomic_dec_and_test(&dev->refcnt)) {
- dev->bus->op->deallocate(dev);
- usb_destroy_configuration(dev);
--
- usb_bus_put(dev->bus);
--
--
-+
- if(dev)
- kfree(dev);
-+ dev = NULL;
- }
- }
-
-@@ -1749,6 +1749,7 @@
- /*
- * Something got disconnected. Get rid of it, and all of its children.
- */
-+static int dev_num=0;
- void usb_disconnect(struct usb_device **pdev)
- {
- struct usb_device * dev = *pdev;
-@@ -1758,35 +1759,9 @@
- return;
-
- *pdev = NULL;