Index: Config.in
===================================================================
RCS file: /home/cvs/linux/drivers/usb/Attic/Config.in,v
retrieving revision 1.41.2.5
diff -c -r1.41.2.5 Config.in
*** Config.in	26 Feb 2003 00:53:50 -0000	1.41.2.5
--- Config.in	28 Jul 2003 09:03:06 -0000
***************
*** 27,32 ****
--- 27,33 ----
        define_bool CONFIG_USB_UHCI_ALT n
     fi
     dep_tristate '  OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support' CONFIG_USB_OHCI $CONFIG_USB
+    dep_tristate 'SL811HS   support' CONFIG_USB_SL811HS $CONFIG_USB
  
     comment 'USB Device Class drivers'
     dep_tristate '  USB Audio support' CONFIG_USB_AUDIO $CONFIG_USB $CONFIG_SOUND
Index: Makefile
===================================================================
RCS file: /home/cvs/linux/drivers/usb/Makefile,v
retrieving revision 1.33.2.6
diff -c -r1.33.2.6 Makefile
*** Makefile	26 Feb 2003 00:53:50 -0000	1.33.2.6
--- Makefile	28 Jul 2003 09:03:06 -0000
***************
*** 53,58 ****
--- 53,59 ----
  obj-$(CONFIG_USB_UHCI)		+= usb-uhci.o
  obj-$(CONFIG_USB_UHCI_ALT)	+= uhci.o
  obj-$(CONFIG_USB_OHCI)		+= usb-ohci.o
+ obj-$(CONFIG_USB_SL811HS)	+= hc_sl811.o
  
  ifneq ($(CONFIG_USB_EHCI_HCD),n)
  	usbcore-objs		+= hcd.o
Index: hc_simple.h
===================================================================
RCS file: /home/cvs/linux/drivers/usb/Attic/hc_simple.h,v
retrieving revision 1.1.2.1
diff -c -r1.1.2.1 hc_simple.h
*** hc_simple.h	11 Sep 2002 12:45:17 -0000	1.1.2.1
--- hc_simple.h	28 Jul 2003 09:03:06 -0000
***************
*** 209,216 ****
  		usb_pipeout (pipe) ? 'O' : 'I',
  		usb_pipetype (pipe) < 2 ? (usb_pipeint (pipe) ? "INTR" : "ISOC")
  		: (usb_pipecontrol (pipe) ? "CTRL" : "BULK"), urb->transfer_flags,
! 		urb->actual_length, urb->transfer_buffer_length, urb->status,
! 		urb->status);
  	if (!small) {
  		if (usb_pipecontrol (pipe)) {
  			printk (__FILE__ ": cmd(8):");
--- 209,216 ----
  		usb_pipeout (pipe) ? 'O' : 'I',
  		usb_pipetype (pipe) < 2 ? (usb_pipeint (pipe) ? "INTR" : "ISOC")
  		: (usb_pipecontrol (pipe) ? "CTRL" : "BULK"), urb->transfer_flags,
! 		urb->actual_length, urb->transfer_buffer_length, (__u8)urb->status,
! 		(__u8)urb->status);
  	if (!small) {
  		if (usb_pipecontrol (pipe)) {
  			printk (__FILE__ ": cmd(8):");
***************
*** 224,231 ****
  			len = usb_pipeout (pipe) ? urb-> transfer_buffer_length : urb->actual_length;
  			for (i = 0; i < 2096 && i < len; i++)
  				printk (" %02x", ((__u8 *) urb->transfer_buffer)[i]);
! 			printk ("%s stat:%d\n", i < len ? "..." : "",
! 				urb->status);
  		}
  	}
  }
--- 224,231 ----
  			len = usb_pipeout (pipe) ? urb-> transfer_buffer_length : urb->actual_length;
  			for (i = 0; i < 2096 && i < len; i++)
  				printk (" %02x", ((__u8 *) urb->transfer_buffer)[i]);
! 			printk ("%s stat:%02x\n", i < len ? "..." : "",
! 				(__u8)urb->status);
  		}
  	}
  }
Index: hc_sl811.c
===================================================================
RCS file: /home/cvs/linux/drivers/usb/Attic/hc_sl811.c,v
retrieving revision 1.1.2.3
diff -c -r1.1.2.3 hc_sl811.c
*** hc_sl811.c	25 Feb 2003 22:03:10 -0000	1.1.2.3
--- hc_sl811.c	28 Jul 2003 09:03:08 -0000
***************
*** 38,44 ****
  #include <asm/irq.h>
  
  #include <linux/usb.h>
! #include "../core/hcd.h"
  
  #undef HC_URB_TIMEOUT
  #undef HC_SWITCH_INT
--- 38,44 ----
  #include <asm/irq.h>
  
  #include <linux/usb.h>
! #include "hcd.h"
  
  #undef HC_URB_TIMEOUT
  #undef HC_SWITCH_INT
***************
*** 95,103 ****
   * NOTE: values need to modify for different development boards 
   */
  
! static int base_addr = 0xd3800000;
! static int data_reg_addr = 0xd3810000;
! static int irq = 34;
  
  /* forware declaration */
  
--- 95,105 ----
   * NOTE: values need to modify for different development boards 
   */
  
! #include <asm/vr41xx/vr41xx.h>
! 
! static int base_addr     = 0xaa0000c0;
! static int data_reg_addr = 0xaa0000c2;
! static int irq = GIU_IRQ(2);
  
  /* forware declaration */
  
***************
*** 116,121 ****
--- 118,125 ----
  MODULE_PARM (irq, "i");
  MODULE_PARM_DESC (irq, "IRQ 34 (default)");
  
+ static int workaround_e4_miss_packet = 0;
+ 
  static int hc_reset (hci_t * hci);
  
  /***************************************************************************
***************
*** 128,134 ****
   *
   * Return: data 
   **************************************************************************/
! char SL811Read (hci_t * hci, char offset)
  {
  	hcipriv_t *hp = &hci->hp;
  	char data;
--- 132,138 ----
   *
   * Return: data 
   **************************************************************************/
! unsigned char SL811Read (hci_t * hci, char offset)
  {
  	hcipriv_t *hp = &hci->hp;
  	char data;
***************
*** 570,575 ****
--- 574,580 ----
  	int mask =
  	    SL11H_INTMASK_XFERDONE | SL11H_INTMASK_SOFINTR |
  	    SL11H_INTMASK_INSRMV | SL11H_INTMASK_USBRESET;
+ 	/*	printk("hc_start_int: (%s:%d)\n",__FILE__,__LINE__); */
  	SL811Write (hci, IntEna, mask);
  #endif
  }
***************
*** 701,708 ****
  	setup_data[3] = addr & 0x7F;
  
  	SL811BufWrite (hci, SL11H_BUFADDRREG, (__u8 *) & setup_data[0], 4);
! 
! 	SL811Write (hci, SL11H_HOSTCTLREG, cmd);
  
  #if 0
  	/* The SL811 has a hardware flaw when hub devices sends out
--- 706,726 ----
  	setup_data[3] = addr & 0x7F;
  
  	SL811BufWrite (hci, SL11H_BUFADDRREG, (__u8 *) & setup_data[0], 4);
! 	if(workaround_e4_miss_packet){
! 	  __u8 sofc;
! 	  sofc = SL811Read(hci, SL11H_SOFTMRREG);
! 	  printk("sofc=%d\n",sofc); 
! 	  if(sofc > 20)
! 	    SL811Write(hci, SL11H_HOSTCTLREG, cmd);
! 	  else if(sofc > 2)
! 	    SL811Write(hci, SL11H_HOSTCTLREG, cmd|0x20);
! 	  else {
! 	    while(sofc < 2)
! 	      sofc = SL811Read(hci, SL11H_SOFTMRREG);
! 	    SL811Write(hci, SL11H_HOSTCTLREG, cmd|0x20);
! 	  }
! 	}
! 	else SL811Write (hci, SL11H_HOSTCTLREG, cmd);
  
  #if 0
  	/* The SL811 has a hardware flaw when hub devices sends out
***************
*** 1195,1201 ****
--- 1213,1221 ----
  		kfree (hp->tl);
  
  	if (hp->hcport > 0) {
+ #if 0
  		release_region (hp->hcport, 2);
+ #endif
  		hp->hcport = 0;
  	}
  
***************
*** 1227,1234 ****
--- 1247,1260 ----
   *****************************************************************/
  void init_irq (void)
  {
+ #if 0                          /* for only Humblesoft VR4131 DIMM Board */
  	GPDR &= ~(1 << 13);
  	set_GPIO_IRQ_edge (1 << 13, GPIO_RISING_EDGE);
+ #else
+ 	/* vr41xx_set_irq_trigger(2, TRIGGER_EDGE, SIGNAL_HOLD); */
+ 	vr41xx_set_irq_trigger(2, TRIGGER_EDGE, SIGNAL_THROUGH);
+ 	/* vr41xx_set_irq_level(2, LEVEL_HIGH); */
+ #endif
  }
  
  /*****************************************************************
***************
*** 1258,1279 ****
  
  	init_irq ();
  	hp = &hci->hp;
! 
  	if (!request_region (addr, 256, "SL811 USB HOST")) {
  		DBGERR ("request address %d failed", addr);
  		hc_release_hci (hci);
  		return -EBUSY;
  	}
  	hp->hcport = addr;
  	if (!hp->hcport) {
  		DBGERR ("Error mapping SL811 Memory 0x%x", hp->hcport);
  	}
! 
  	if (!request_region (addr2, 256, "SL811 USB HOST")) {
  		DBGERR ("request address %d failed", addr2);
  		hc_release_hci (hci);
  		return -EBUSY;
  	}
  	hp->hcport2 = addr2;
  	if (!hp->hcport2) {
  		DBGERR ("Error mapping SL811 Memory 0x%x", hp->hcport2);
--- 1284,1307 ----
  
  	init_irq ();
  	hp = &hci->hp;
! #if 0
  	if (!request_region (addr, 256, "SL811 USB HOST")) {
  		DBGERR ("request address %d failed", addr);
  		hc_release_hci (hci);
  		return -EBUSY;
  	}
+ #endif
  	hp->hcport = addr;
  	if (!hp->hcport) {
  		DBGERR ("Error mapping SL811 Memory 0x%x", hp->hcport);
  	}
! #if 0
  	if (!request_region (addr2, 256, "SL811 USB HOST")) {
  		DBGERR ("request address %d failed", addr2);
  		hc_release_hci (hci);
  		return -EBUSY;
  	}
+ #endif
  	hp->hcport2 = addr2;
  	if (!hp->hcport2) {
  		DBGERR ("Error mapping SL811 Memory 0x%x", hp->hcport2);
***************
*** 1285,1296 ****
  	}
  
  	usb_register_bus (hci->bus);
! 
  	if (request_irq (irq, hc_interrupt, 0, "SL811", hci) != 0) {
! 		DBGERR ("request interrupt %d failed", irq);
  		hc_release_hci (hci);
  		return -EBUSY;
  	}
  	hp->irq = irq;
  
  	printk (KERN_INFO __FILE__ ": USB SL811 at %x, addr2 = %x, IRQ %d\n",
--- 1313,1328 ----
  	}
  
  	usb_register_bus (hci->bus);
! #if 0
  	if (request_irq (irq, hc_interrupt, 0, "SL811", hci) != 0) {
! #else
! 	if (request_irq (irq, hc_interrupt, SA_INTERRUPT, "SL811", hci) != 0) {
! #endif
! 	        DBGERR ("request interrupt %d failed", irq);
  		hc_release_hci (hci);
  		return -EBUSY;
  	}
+ 	
  	hp->irq = irq;
  
  	printk (KERN_INFO __FILE__ ": USB SL811 at %x, addr2 = %x, IRQ %d\n",
Index: hc_sl811_rh.c
===================================================================
RCS file: /home/cvs/linux/drivers/usb/Attic/hc_sl811_rh.c,v
retrieving revision 1.1.2.1
diff -c -r1.1.2.1 hc_sl811_rh.c
*** hc_sl811_rh.c	11 Sep 2002 12:45:17 -0000	1.1.2.1
--- hc_sl811_rh.c	28 Jul 2003 09:03:08 -0000
***************
*** 153,160 ****
  	}
  	len = i / 8 + 1;
  
  	if (ret > 0) {
! 		memcpy (rh_data, data, min (len, min (rh_len, (int)sizeof (data))));
  		return len;
  	}
  	return 0;
--- 153,165 ----
  	}
  	len = i / 8 + 1;
  
+ #ifdef min
+ #undef min
+ #endif
+ #define min(x,y) ((x)<(y) ?(x):(y))
+ 	
  	if (ret > 0) {
! 		memcpy (rh_data, data, min(len, min(rh_len, (int)sizeof(data))));
  		return len;
  	}
  	return 0;
***************
*** 484,490 ****
  		hci->rh.urb = NULL;
  
  		urb->hcpriv = NULL;
! 		usb_put_dev (urb->dev);
  		urb->dev = NULL;
  		if (urb->transfer_flags & USB_ASYNC_UNLINK) {
  			urb->status = -ECONNRESET;
--- 489,496 ----
  		hci->rh.urb = NULL;
  
  		urb->hcpriv = NULL;
! 		/* usb_put_dev (urb->dev); */
! 		usb_free_dev (urb->dev); 
  		urb->dev = NULL;
  		if (urb->transfer_flags & USB_ASYNC_UNLINK) {
  			urb->status = -ECONNRESET;
Index: hub.c
===================================================================
RCS file: /home/cvs/linux/drivers/usb/Attic/hub.c,v
retrieving revision 1.33.2.3
diff -c -r1.33.2.3 hub.c
*** hub.c	11 Jan 2003 17:53:16 -0000	1.33.2.3
--- hub.c	28 Jul 2003 09:03:11 -0000
***************
*** 903,908 ****
--- 903,909 ----
  
  static int usb_hub_thread(void *__hub)
  {
+         printk("%s: (%s:%d)\n",__FUNCTION__,__FILE__,__LINE__);
  	lock_kernel();
  
  	/*
***************
*** 925,930 ****
--- 926,932 ----
  	dbg("usb_hub_thread exiting");
  
  	unlock_kernel();
+         printk("%s: (%s:%d)\n",__FUNCTION__,__FILE__,__LINE__);
  	complete_and_exit(&khubd_exited, 0);
  }
  
Index: usb.c
===================================================================
RCS file: /home/cvs/linux/drivers/usb/Attic/usb.c,v
retrieving revision 1.49.2.5
diff -c -r1.49.2.5 usb.c
*** usb.c	25 Feb 2003 22:03:10 -0000	1.49.2.5
--- usb.c	28 Jul 2003 09:03:13 -0000
***************
*** 1,4 ****
! /*
   * drivers/usb/usb.c
   *
   * (C) Copyright Linus Torvalds 1999
--- 1,4 ----
! /* 
   * drivers/usb/usb.c
   *
   * (C) Copyright Linus Torvalds 1999
***************
*** 31,37 ****
  #include <linux/devfs_fs_kernel.h>
  #include <linux/spinlock.h>
  
! #ifdef CONFIG_USB_DEBUG
  	#define DEBUG
  #else
  	#undef DEBUG
--- 31,37 ----
  #include <linux/devfs_fs_kernel.h>
  #include <linux/spinlock.h>
  
! #ifdef CONFIG_USB_DEBUG 
  	#define DEBUG
  #else
  	#undef DEBUG
