Index: D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/Kconfig
===================================================================
--- D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/Kconfig	(revision 26)
+++ D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/Kconfig	(revision 27)
@@ -15,3 +15,4 @@
 
 source "drivers/usb/pehcd/device/mscd/Kconfig"
 
+source "drivers/usb/pehcd/device/wolfdev/Kconfig"
Index: D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/pdc_bus.c
===================================================================
--- D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/pdc_bus.c	(revision 26)
+++ D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/pdc_bus.c	(revision 27)
@@ -68,7 +68,7 @@
 #ifdef CONFIG_USB_ISP1761_MSCD
 #include "usb_desc_mscd.c"
 #endif
-#ifdef CONFIG_USB_ISP1761_WOLFDEV
+#if defined(CONFIG_USB_ISP1761_WOLFDEV) || defined(CONFIG_USB_ISP1761_WOLFDEV_MODULE)
 #include "usb_desc_wolfdev.c"
 #endif
 
@@ -115,7 +115,6 @@
  */
 int pdc_register_class_drv( struct pdc_class_drv *drv)
 {
-    int i;
     dev_print("++ pdc_register_class_drv(%p)\n",drv);
 
     /* 
@@ -123,12 +122,8 @@
      */
     list_add(&drv->driver_list, &pdc_class_drv_list);
 
-    printk(KERN_INFO "Registered Device Class Driver \n",drv->name);
+    dev_print(KERN_INFO "ISP1761 Registered Device Class Driver \n",drv->name);
 
-/*    printk("Register-Dump\n");      // für den Dump muss pdc_read32 das static __inline__ kommentiert werden und die externen Prototyp definiert
-    for(i=0;i<0x400;i+=4)
-      printk("0x%03x: 0x%08x\n",i,pdc_read32(i)); */
-
     /* TODO if the device is active, call the probe function */
 
 
@@ -203,7 +198,7 @@
     ep_desc->attributes = PDC_EP_BULK;                  /* Transfer type*/
     ep_desc->max_pkt_size = 64;                                 /* Maximum packet size */
 #endif
-#if defined(CONFIG_USB_ISP1761_WOLFDEV)
+#if defined(CONFIG_USB_ISP1761_WOLFDEV) || defined(CONFIG_USB_ISP1761_WOLFDEV_MODULE)
 printk("EP_WOLFDEV\n");
     ep_desc++;
     ep_desc->ep_num = 3;                                                /* Bulk out end point */
@@ -788,6 +783,7 @@
     pdc_fill_non_iso_urb(urb, bus_dev->ctrl_pipe, PDC_PIPE_CONTROL, PDC_OPR_READ, buff, len, ((void(*)(struct pdc_urb *))callback),NULL);
     return pdc_submit_urb(urb);
 } /* End of pdc_nofif_read_control_pipe() */
+
 void pdc_bus_stall_control_pipe(void)
 {
 
@@ -808,7 +804,6 @@
     __u8        reply[2];
     struct list_head *tmp;
     __u8        address;
-    int i;
 
     if(notif_type == PDC_SETUP_COMMAND) {
         /* SETUP Command from the control pipe */
@@ -928,8 +923,6 @@
                 while (tmp != &pdc_class_drv_list) {
                     struct pdc_class_drv *cd = list_entry(tmp,struct pdc_class_drv, driver_list);
 
-                    for(i=0;i<strlen(cmd);i++)
-                      printk("cmd[%2d]:0x%02x\n",i,cmd[i]);
                     tmp = tmp->next;
                     if(cd->class_vendor) {
                         /* Currently done for only one class driver */
@@ -964,10 +957,6 @@
 } /* End of pdc_bus_ctrl_pipe_notifacaion() */
 
 
-int get_bus_state(){
-    return bus_dev->state;
-}
-
 /*-----------------------------------------------------------------*
  *                     External OTG interface functions            *
  *-----------------------------------------------------------------*/
Index: D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/usb_pdc.c
===================================================================
--- D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/usb_pdc.c	(revision 26)
+++ D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/usb_pdc.c	(revision 27)
@@ -83,6 +83,7 @@
 #include "../hal/hal_intf.h"    
 #include "../hal/isp1761.h"     
 
+extern void pio_debug_write(int iValue);
 
 /*--------------------------------------------------------------*
  *               external functions
@@ -146,7 +147,7 @@
  *--------------------------------------------------------------*/
 /* static __inline__ */__u16    pdc_read16(__u16 reg)
 {
-    __u16       data;
+    __u16       data=0;
 
     data = isp1761_reg_read16(isp1761_dc_dev, reg, data);
 
@@ -277,7 +278,7 @@
     __u16       ep_config = 0;
     __u8        handle;
     struct pdc_pipe     *pipe;
-    __u16       mps;
+    __u16       mps=0;
     __u32       int_en;
     __u16   ep_cnt;
 
@@ -537,8 +538,6 @@
 
     dev_print("++ tx_data(handle=%x, kick=%x)\n", handle, kick);
 
-//    printk("kick:%d tbl:%d tb:%d\n",kick,ep_urb->transfer_buffer_length,(__u8*)ep_urb->transfer_buffer);
-
     if (kick == 2) {
 
 
@@ -613,13 +612,13 @@
 
     /* Bug fix for zero length packets */
     if (!ep_urb->transfer_buffer_length && ((__u8*)ep_urb->transfer_buffer) == NULL)
-	{	   
-		pdc_write32(ENDPT_INDEX_REGISTER, handle);
-		pdc_write32(DATAPORT_REGISTER, 0);
-		pdc_write16(BUFFER_LGTH_REGISTER, 0);
+	  {	   
+		  pdc_write32(ENDPT_INDEX_REGISTER, handle);
+		  pdc_write32(DATAPORT_REGISTER, 0);
+		  pdc_write16(BUFFER_LGTH_REGISTER, 0);
     }	
-	else
-	{
+	  else
+	  {
 	    /* The problem with this for BOT protocol is in the IN data stage
 	     * after sending the data, host expects status (IN) data and we are
     	 * sending a NULL packet which is causing whole device to re-enumerate
@@ -627,64 +626,81 @@
 	     * So only if tx_used is there then send the data */
 	     
     	/* While we can send stuff... (this will fill both FIFOs) */        
-//	    printk("epu:%d tf:%d al:%d tbl:%d\n",ep_urb, tofill, ep_urb->actual_length, ep_urb->transfer_buffer_length);
 	    if((kick==1)&&ep_urb->picdata)   // Call from pdc_submit_urb -> start pic transfer
       {
-        printk("Start Pic Transfer!\n");
+//        printk("Start Pic Transfer!\n");
         pdc_write32(0x40000,ep_urb->buffer_start_address+ep_urb->actual_length);      // Neu 0x40000 und 0x40004  // Alt 0x800 und 0x804
-
 //        tofill=1;
       }
-	    tofill=1;
-	    while( (ep_urb) && (tofill>0) && 
-    	        ep_urb->actual_length != ep_urb->transfer_buffer_length) 
-	    {
-    	    /* Fill local packet buffer from TX buffer: if there's nothing
-        	   to send (there might be: we need to be able to send zero
-	           length packets to terminate a transfer of an exact multiple
-	           of the buffer size), then we'll be sending a 0 byte
-	           packet */    
+	    if(pipe->ep_desc->max_pkt_size==64)   //!!!DK: Bei USB1.1 kein Doublebuffering, funktioniert irgendwie nicht!
+	      tofill=1;
+	    
+	    if(ep_urb->picdata)
+      {
+        usb_txsize = ep_urb->transfer_buffer_length - ep_urb->actual_length;
 
-    	    usb_txsize = ep_urb->transfer_buffer_length - ep_urb->actual_length;
+        pdc_write32(ENDPT_INDEX_REGISTER, handle);        
+        switch(tofill)
+        {
+          case 2:
+            if(usb_txsize >= 2 * pipe->ep_desc->max_pkt_size)
+              usb_txsize = 2 * pipe->ep_desc->max_pkt_size;
+            else if((usb_txsize >= 1 * pipe->ep_desc->max_pkt_size) && (usb_txsize < 2 * pipe->ep_desc->max_pkt_size))
+              usb_txsize = 1 * pipe->ep_desc->max_pkt_size;
+            else
+              pdc_write16(BUFFER_LGTH_REGISTER, usb_txsize);
+            break;      
+          case 1:
+            if(usb_txsize >= 1 * pipe->ep_desc->max_pkt_size)
+              usb_txsize = 1 * pipe->ep_desc->max_pkt_size;
+            else
+              pdc_write16(BUFFER_LGTH_REGISTER, usb_txsize);
+            break;
+          case 0:
+            printk("No free buffer!\n");
+            usb_txsize = 0;
+            return;
+//            break;
+        }
+//        printk("tf:%d sz:%d ",tofill,usb_txsize);
+        if(usb_txsize==2 * pipe->ep_desc->max_pkt_size)
+        {
+          pdc_write32(0x40004,usb_txsize/8);
+          udelay(1);
+          pdc_write32(0x40004,usb_txsize/8);
+        }
+        else
+          pdc_write32(0x40004,usb_txsize/4);
+	      ep_urb->actual_length += usb_txsize;
+    	  /* Not idle anymore */
+	      pipe->txrx_idle=0;
+      }
+      else
+      {
+	      while( (ep_urb) && (tofill>0) && 
+    	          ep_urb->actual_length != ep_urb->transfer_buffer_length) 
+	      {
+    	      /* Fill local packet buffer from TX buffer: if there's nothing
+        	     to send (there might be: we need to be able to send zero
+	             length packets to terminate a transfer of an exact multiple
+	             of the buffer size), then we'll be sending a 0 byte
+	             packet */    
 
-        	if ((usb_txsize)> pipe->ep_desc->max_pkt_size) usb_txsize=pipe->ep_desc->max_pkt_size;
+    	      usb_txsize = ep_urb->transfer_buffer_length - ep_urb->actual_length;
+
+        	  if ((usb_txsize)> pipe->ep_desc->max_pkt_size) usb_txsize=pipe->ep_desc->max_pkt_size;
           
-          if(!ep_urb->picdata)    // Keine Bildaten -> normal mit writeendpoint
-          {
             writeendpoint(handle, (((__u8*)ep_urb->transfer_buffer)+ep_urb->actual_length), usb_txsize);
-          }
-          else
-          {
-//            printk("SU\n");
-            /* write endpoint index */
-//            pdc_write32(DMA_EP_INDX_REGISTER, 5);
-            pdc_write32(ENDPT_INDEX_REGISTER, handle);        
-            /* write buffer length to validate the buffer */
-            pdc_write16(BUFFER_LGTH_REGISTER, usb_txsize);
 
-//            pdc_write32(0x800,ep_urb->buffer_start_address+ep_urb->actual_length);
-            pdc_write32(0x40004,usb_txsize/4);
-          }           
-/*
-//DK!!!	        
-	        if(Flags.WE)
-            writeendpoint(handle, (((__u8*)ep_urb->transfer_buffer)+ep_urb->actual_length), usb_txsize);
-          else
-          {
-            //auf Adresse 0x800 DDR Start Adresse (Page + Offset) angeben (Angabe in 96 Bytes Blocks)
-            //auf Adresse 0x804 Count Anzahl Bytes dividiert durch 4 (Hier wird die Übertragung gestartet -> Startadresse muss bereits gesetzt sein)
-            
-          }  */
-//          writeendpoint(handle, (((__u8*)ep_urb->transfer_buffer)+ep_urb->actual_length), usb_txsize);
-	        ep_urb->actual_length += usb_txsize;
+	          ep_urb->actual_length += usb_txsize;
 
-    	    /* Not idle anymore */
-	        pipe->txrx_idle=0;
+    	      /* Not idle anymore */
+	          pipe->txrx_idle=0;
 
-	        /* Filled another buffer */
-	        tofill--;
-
-    	}
+	          /* Filled another buffer */
+	          tofill--;
+    	  }
+      }
 	}
 
 } /* End of tx_data() */
@@ -874,6 +890,7 @@
     while(1) {
         /* Read IRQ status, masking with possible valid IRQs */
 
+//        pio_debug_write(3);
         evnt= dev->int_reg& (IE_EP0SETUP|IE_EP0RX|IE_EP0TX|IE_NON_CTRL_EP_MASK|IE_RST|IE_SUSP|IE_VBUS|IE_HS_STA|IE_RESM|IE_DMA);
 
         temp_data = pdc_read32(INT_ENABLE_REGISTER);
@@ -883,13 +900,14 @@
         if (evnt==0) {
             return;
         }
-//        printk("DIRQ:0x%08x\n",evnt);
+#if 1
         non_ctrl_ep_event = evnt & IE_NON_CTRL_EP_MASK;
 
-        handle = EP1RX;
+        handle = EP2RX;
 
         while(non_ctrl_ep_event) {
 
+//        pio_debug_write(7);
             ep_event = IE_EP0RX << handle;
 
             if( non_ctrl_ep_event & ep_event) {
@@ -902,7 +920,9 @@
 #ifdef DEBUG_IRQ
 printk("IN_Pipe\n");
 #endif
+//        pio_debug_write(15);
                         tx_data(pdc, handle, 0);        /* Data trasmission on In pipe */
+//        pio_debug_write(7);
 
                     } else {
                         /* Out pipe */
@@ -923,8 +943,32 @@
             }
 
             handle++;
+//        pio_debug_write(3);
         }
 
+#endif
+#if 0        
+        
+        if(evnt&IE_EP1RX)
+        {
+          rx_data(pdc, 2);           /* Data reception on OUT pipe */
+        }
+        if(evnt&IE_EP1TX)
+        {
+          tx_data(pdc, 3, 0);        /* Data trasmission on In pipe */
+        }
+        if(evnt&IE_EP2RX)
+        {
+          rx_data(pdc, 4);           /* Data reception on OUT pipe */
+        }
+        if(evnt&IE_EP2TX)
+        {
+//        pio_debug_write(7);
+          tx_data(pdc, 5, 0);        /* Data trasmission on In pipe */
+//        pio_debug_write(3);
+        }
+#endif
+        
         if (evnt&IE_EP0SETUP) {
 #ifdef DEBUG_IRQ
 printk("EP0STP\n");
@@ -956,7 +1000,6 @@
 #ifdef DEBUG_IRQ
 printk("RST\n");
 #endif
-printk("RST: bus:%d notif:%d\n",bus, bus->notif);
             /* Inform the configuration driver 
                Initialize the controller and connect to the bus */
 
@@ -992,7 +1035,6 @@
             pdc_write32(MODE_REGISTER, tmpdata1);
         }
 
-SKIP_SUSP_RES:
         if (evnt&IE_RESM) {
             /* Inform the configuration driver  */
             if(bus && bus->notif)       bus->notif(bus->context, PDC_RESUME);
@@ -1000,6 +1042,7 @@
 
 
         if (evnt&IE_VBUS) {
+            printk("USB Device connected\n");
             intr_src =pdc_read32(INTERRUPT_REGISTER);
             intr_src &= IE_VBUS;
             if(intr_src)
@@ -1035,6 +1078,7 @@
         dev->int_reg =pdc_read32(INTERRUPT_REGISTER);
         if(dev->int_reg) pdc_write32(INTERRUPT_REGISTER, dev->int_reg);
     }
+//        pio_debug_write(1);
 
 } /* End of pdc_isr */
 
@@ -1593,8 +1637,10 @@
     dev_info("pdc_init, chip id = 0x%08X \n", (pdc_read32(CHIPID_REGISTER)));
     pdc_write16(SCRATCH_REGISTER, 0xa5a5);
     temp1 = pdc_read16(SCRATCH_REGISTER);
+/*    dev_info("pdc_init, scratch 0xa5a5 = 0x%08X \n", temp1);
+    isp1761_reg_write16(isp1761_dc_dev,SCRATCH_REGISTER,0xc7c7);
+    temp1 = pdc_read16(SCRATCH_REGISTER);    */
     dev_info("pdc_init, scratch 0xa5a5 = 0x%08X \n", temp1);
-printk("pdc_init, scratch 0xa5a5 = 0x%08X \n", temp1);
     return;
 } /* End of pdc_init */
 
@@ -1603,7 +1649,6 @@
 /* Actually connect to the bus */
 void pdc_connect(void)
 {
-    u32 temp;
     /* Set device address & enable */
     pdc_write32(ADDRESS_REGISTER,ADDRESS_DEVEN|0);
 
@@ -1613,9 +1658,7 @@
     pdc_write32(0x374,0x00160000);
 #endif
     /* Connect to the bus */
-//    printk("GlobalIE\n");
     pdc_write32(MODE_REGISTER, MODE_WKUPCS|MODE_CLKAON|MODE_GLINTENA);
-//    printk("GlobalIE2\n");
 
     /*Default is set to 1us (0x1E). minimum pulse is 33.3ns */
     pdc_write32(INT_PULSE_SIZE_REG,DEFAULT_INT_PULSE_SIZE);
@@ -1649,7 +1692,44 @@
 
 } /* End of pdc_connect */
 
+/* Disconnect bus */
+void pdc_disconnect(void)
+{
+    int reg,temp;
+    /* Reset device address & enable */
+    pdc_write32(ADDRESS_REGISTER,0);
 
+    /* Disable interrupts */
+    pdc_write32(INT_ENABLE_REGISTER, 0); 
+
+    /* Disconnect bus */
+    reg=pdc_read32(MODE_REGISTER);
+    reg|=0x10;
+    pdc_write32(MODE_REGISTER, reg);
+    reg&=~0x18;
+    pdc_write32(MODE_REGISTER, reg);
+    
+    /*Turn off soft connect */
+    pdc_write32(0x374,0x00010000);
+
+/*    temp=pdc_read32(ADDRESS_REGISTER);
+    printk("pdc_disconnect: ADDRESS_REGISTER : 0x%x\n",temp);
+    temp=pdc_read32(MODE_REGISTER);
+    printk("pdc_disconnect: MODE_REGISTER : 0x%x\n",temp);
+
+    temp=pdc_read32(INT_CONFIG_REGISTER);
+    printk("pdc_disconnect: INT_CONFIG_REGISTER : 0x%x\n",temp);
+    temp=pdc_read32(INT_ENABLE_REGISTER);
+    printk("pdc_disconnect: INT_ENABLE_REGISTER : 0x%x\n",temp);
+    temp=pdc_read32(HC_HW_MODE_REG);
+    printk("pdc_disconnect: HC_MODECONTROL : 0x%x\n",temp);  */
+    return;
+
+} /* End of pdc_disconnect */
+
+EXPORT_SYMBOL(pdc_disconnect);
+
+
 /*---------------------------------------------------------------------*
  *                   ISP1761 HOSAL interface functions                 *
  *---------------------------------------------------------------------*/
@@ -1675,24 +1755,23 @@
 {
     struct pdc_dev *pdc=usb_devices;
     int result, i;
-    int reg;
     struct pdc_pipe     *pipe;
 
     dev_print("++ pdc_probe(dev=%p)\n",dev);
     isp1761_dc_dev = dev;   
     /*for device only  */
 #ifndef CONFIG_USB_OTG
-    pdc_write32(0x374,0x00060400);
-//    pdc_write32(0x374,0x00000081);
-//    pdc_write32(0x374,0x00160000);
+//    pdc_write32(0x374,0x00060400);
+    pdc_write32(0x374,0x00000081);
+    pdc_write32(0x374,0x00160000);
 
-//    pdc_write32(0x374,0xFFFF0000); /* clear all otg interrupt */
-//    pdc_write32(0x374,0x00000481);
+    pdc_write32(0x374,0xFFFF0000); /* clear all otg interrupt */
+    pdc_write32(0x374,0x00000481);
 #endif
     pdc_write32(UNLOCK_DEVICE_REG, 0xaa37);
 
     pdc_write32(MODE_REGISTER, MODE_SFRESET);
-    mdelay(10);
+    mdelay(1);
     pdc_write32(MODE_REGISTER, 0);
     mdelay(5);
 
@@ -1739,9 +1818,9 @@
     pdc_init(dev);
 
     /* Claim USB IRQ */
-    printk("MODE1:0x%08x\n",pdc_read32(MODE_REGISTER));
+//    printk("MODE1:0x%08x\n",pdc_read32(MODE_REGISTER));
     result=isp1761_request_irq(pdc_isr,dev,pdc);
-    printk("MODE2:0x%08x\n",pdc_read32(MODE_REGISTER));
+//    printk("MODE2:0x%08x\n",pdc_read32(MODE_REGISTER));
 
     /* Got it ok? */
     if (result < 0) {
@@ -1753,7 +1832,6 @@
     /* If there are pending IRQs, process them as we can only  detect edges */
 
 #ifndef CONFIG_USB_OTG
-    printk("Connect\n");
     pdc_connect();
 #endif 
     dev->driver_data = pdc;
@@ -1763,7 +1841,7 @@
 } /* End of pdc_probe */
 
 
-void pdc_remove (struct isp1761_dev     *dev) 
+void pdc_remove (struct isp1761_dev     *dev)  
 {
     struct pdc_dev *pdc=(struct pdc_dev*)dev->driver_data;
 
@@ -1803,7 +1881,7 @@
 
     int result;
 
-    printk("++ pdc_module_init(void)\n");
+    dev_print("++ pdc_module_init(void)\n");
 
     pdc->dev = NULL;
     pdc->ep_pipes = pdc_eps;
@@ -1812,7 +1890,7 @@
     result = isp1761_register_driver(&pdc_driver);
 
     if(result == 0) {
-        printk(KERN_INFO "Device Initialization Success \n");
+        printk("ISP1761 PDC Device Initialization Success\n");
     } else {
         printk(KERN_INFO "Device Iinitialization Failed (error = %d)\n",result);
     }
Index: D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/mscd/devmscd.c
===================================================================
--- D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/mscd/devmscd.c	(revision 26)
+++ D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/mscd/devmscd.c	(revision 27)
@@ -82,11 +82,11 @@
     __u8                                        *cmd;                   /* mass storage command */
 
     wait_queue_head_t           read_wq;                /* read wait queue */
-    __u8                                        read_lock;              /* read lock */
+    volatile __u8                                        read_lock;              /* read lock */
     __u32                                       read_bytes;             /* read response (from device) bytes */
 
     wait_queue_head_t           write_wq;               /* Write wait queue (TODO) */
-    __u8                                        write_lock;             /* Write lock */
+    volatile __u8                                        write_lock;             /* Write lock */
     __u32                                       write_bytes;    /* Write response bytes */
 
     __u8                                        errorflag;             /* Write lock */
@@ -493,7 +493,6 @@
     struct devmscd_device       *dev = (struct devmscd_device *)__dev;
 
     mscd_print("++ devmscd_configure(dev:%p, cfg:%d)\n",dev,cfg);
-    printk("++ devmscd_configure(dev:%p, cfg:%d)\n",dev,cfg);
     if(dev) {
 
         if(cfg == 1) {
Index: D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/mscd/msbridge.c
===================================================================
--- D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/mscd/msbridge.c	(revision 26)
+++ D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/mscd/msbridge.c	(revision 27)
@@ -70,11 +70,11 @@
     __u8                                        *cmd;                   /* mass storage command */
 
     wait_queue_head_t           read_wq;                /* read wait queue */
-    __u8                                        read_lock;              /* read lock */
+    volatile __u8                                        read_lock;              /* read lock */
     __u32                                       read_bytes;             /* read response (from device) bytes */
 
     wait_queue_head_t           write_wq;               /* Write wait queue (TODO) */
-    __u8                                        write_lock;             /* Write lock */
+    volatile __u8                                        write_lock;             /* Write lock */
     __u32                                       write_bytes;    /* Write response bytes */
 
     __u8                                        errorflag;             /* Write lock */
@@ -139,7 +139,6 @@
  */
 ssize_t devmscd_intf_read(struct file *fp, char *dest, size_t count, loff_t *ppos) {
     devmscd_intf_info_t *intf = (devmscd_intf_info_t*)fp->private_data;
-//    printk("devmscd_intf_read\n");
     intf->read_lock = 1;
     intf->errorflag = 0;
     mscd_fill_req((&mscd_read_req), MSCD_READ, 
@@ -148,7 +147,7 @@
     devmscd_submit_req(&mscd_read_req);
 
     while(intf->read_lock) {
-        interruptible_sleep_on(&intf->read_wq);
+        interruptible_sleep_on_timeout(&intf->read_wq,1);
         //if (signal_pending(current))
         if(intf->errorflag)
         {
@@ -169,7 +168,6 @@
 ssize_t devmscd_intf_write(struct file *fp, const char *buf, size_t count, loff_t *ppos)
 {
     devmscd_intf_info_t *intf = (devmscd_intf_info_t*)fp->private_data;
-//    printk("devmscd_intf_write\n");
     memcpy(send_data,buf, count);
 
     intf->write_lock = 1;
@@ -178,9 +176,8 @@
             send_data, count, 
             devmscd_disk_read, NULL);
     devmscd_submit_req(&mscd_write_req);
-//    printk("Write\n");
     while(intf->write_lock) {
-        interruptible_sleep_on(&intf->write_wq);
+        interruptible_sleep_on_timeout(&intf->write_wq,1);
         //if (signal_pending(current))
         if(intf->errorflag)
         {
@@ -198,7 +195,6 @@
 int     devmscd_intf_open( struct inode *inode, struct file *fp) 
 {
 
-//    printk("devmscd_intf_open\n");
     fp->private_data = devmscd_intf;    /* set the OTG controller data in file */
 
     init_waitqueue_head(&devmscd_intf->read_wq);
@@ -237,7 +233,6 @@
 
     if(result >= 0 && intf->notif_pending) {
         if(intf->fasync_q) {
-            printk("KF2\n");
             kill_fasync( &intf->fasync_q, SIGIO, POLL_IN);
             intf->notif_pending = 0;
         }
@@ -348,7 +343,6 @@
             devmscd_intf->notif = req->req_type;
 
             if(devmscd_intf->fasync_q) {
-                printk("KF1\n");
                 kill_fasync( &devmscd_intf->fasync_q, SIGIO, POLL_IN);
             } else {
                 devmscd_intf->notif_pending = 1;
Index: D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/pdc_intf.h
===================================================================
--- D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/pdc_intf.h	(revision 26)
+++ D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/pdc_intf.h	(revision 27)
@@ -163,6 +163,8 @@
 extern  int pdc_submit_urb(struct pdc_urb *urb_req);
 extern  int pdc_cancel_urb(struct pdc_urb *urb_req);
 
+extern void pdc_disconnect(void);
+
 extern  unsigned long   pdc_get_frame_number(struct pdc_class_drv *cd);
 extern  int pdc_set_device_address(unsigned long context,unsigned short address);
 extern  int pdc_configure_device(struct pdc_config_dev *config);
Index: D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/Makefile
===================================================================
--- D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/Makefile	(revision 26)
+++ D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/device/Makefile	(revision 27)
@@ -7,3 +7,4 @@
 
 obj-$(CONFIG_USB_ISP1761_MSCD)		+= mscd/
 
+obj-$(CONFIG_USB_ISP1761_WOLFDEV)	+= wolfdev/
Index: D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/hal/hal_x86.h
===================================================================
--- D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/hal/hal_x86.h	(revision 26)
+++ D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/hal/hal_x86.h	(revision 27)
@@ -1,5 +1,5 @@
 /************************************************************
- * NXP ISP176x Hiardware Access Interface header file
+ * NXP ISP176x Hardware Access Interface header file
  *
  * (c) 2006 NXP B.V., All rights reserved. <usb.linux@nxp.com>
  *
Index: D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/hal/hal_x86.c
===================================================================
--- D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/hal/hal_x86.c	(revision 26)
+++ D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/hal/hal_x86.c	(revision 27)
@@ -79,7 +79,7 @@
 /*--------------------------------------------------------------*
  *               Local # Definitions
  *--------------------------------------------------------------*/
-#define         isp1761_driver_name     "1761-m6"
+#define         isp1761_driver_name     "hal_isp1761"
 #define         ISP1761_IO_EXTENT ((1 << 16)-1) // 17 address bits used. //!!! 16 bits
 #define         ISP1761_REGSET_LEN   0xffff
 
@@ -91,6 +91,7 @@
 
 static void __devexit isp1761_remove (struct platform_device *pdev);
 static int __devinit isp1761_probe (struct platform_device *pdev);
+static void isp1761_chip_reset(struct isp1761_dev *dev);
 #if CONFIG_PM
 static int isp1761_pci_suspend (struct pci_dev *dev, __u32 state);
 static int isp1761_pci_resume (struct pci_dev *dev);
@@ -112,7 +113,7 @@
 //    return;
 
     struct isp1761_dev  *dev;
-    u32 hw_mode_buff;
+    u32 hw_mode_buff=0;
     
     // Process the Host Controller Driver 
     dev = &isp1761_loc_dev[ISP1761_HC];
@@ -132,7 +133,7 @@
 //    return;
 
     struct isp1761_dev  *dev;
-    u32 hw_mode_buff;
+    u32 hw_mode_buff=0;
     
     // Process the Host Controller Driver 
     dev = &isp1761_loc_dev[ISP1761_HC];
@@ -159,7 +160,6 @@
 
     hal_entry("%s: Entered\n",__FUNCTION__);
     /*not ready yet*/
-    printk("&");
     if(dev->active == 0)
     {
         printk("isp1761_pci_dc_isr: dev->active is NULL \n");
@@ -175,7 +175,6 @@
 
     isp1761_reg_write32(dev, DEV_UNLOCK_REGISTER, 0xaa37);
     dev->int_reg = isp1761_reg_read32(dev, DEV_INTERRUPT_REGISTER, dev->int_reg);
-//    printk("INTREG:0x%x\n",dev->int_reg);
     hal_int("isp1761_pci_dc_isr:INTERRUPT_REGISTER 0x%x\n",dev->int_reg);
     /*clear the interrupt source*/
     isp1761_reg_write32(dev, 0x218, dev->int_reg);
@@ -200,7 +199,6 @@
 
     hal_entry("%s: Entered\n",__FUNCTION__);
     /*not ready yet*/
-//    printk("§");
     if(hdev->active == 0)
     {
         printk("isp1761_isr: hdev->active is NULL \n");
@@ -217,7 +215,6 @@
       /*unblock the device interrupt*/
       isp1761_reg_write32(ddev, DEV_UNLOCK_REGISTER, 0xaa37);
       ddev->int_reg = isp1761_reg_read32(ddev, DEV_INTERRUPT_REGISTER, ddev->int_reg);
-  //    printk("INTREG:0x%x\n",dev->int_reg);
       hal_int("isp1761_pci_dc_isr:INTERRUPT_REGISTER 0x%x\n",ddev->int_reg);
       /*clear the interrupt source*/
       isp1761_reg_write32(ddev, 0x218, ddev->int_reg);
@@ -454,7 +451,6 @@
 {
     u8 *temp_base_mem = 0;
     int a = length;
-    u8 *temp = (u8*)buffer;
     u8 one      =(u8 )(*buffer);
     u16 two     =(u16 )(*buffer);       
     temp_base_mem = (dev->baseaddress + start_add);
@@ -708,27 +704,21 @@
     struct isp1761_dev  *ddev;
     int result;
     isp1761_id *id;
-    int idreg,sr;
 
     hal_entry("%s: Entered\n",__FUNCTION__);
-    info("isp1761_register_driver(drv=%p) \n",drv);
+//    hal_init("isp1761_register_driver(drv=%p) \n",drv);
 
     if(!drv) return -EINVAL;
     dev = &isp1761_loc_dev[drv->index];
     hdev= &isp1761_loc_dev[ISP1761_HC];
     ddev= &isp1761_loc_dev[ISP1761_DC];
-    printk("isp1761_reg_drv:probe:0x%08lx\n",drv->probe);
-    idreg = isp1761_reg_read32(dev, 0x270,idreg);
-    sr = isp1761_reg_read16(dev, HC_SCRATCH_REG,sr);
-    printk("index:%d id:0x%08x SR:0x%x\n",drv->index,idreg,sr);
-    idreg = isp1761_reg_read32(hdev, 0x270,idreg);
-    sr = isp1761_reg_read16(hdev, HC_SCRATCH_REG,sr);
-    printk("HC_ID:0x%08x SR:0x%x\n",idreg,sr);
-    idreg = isp1761_reg_read32(ddev, 0x270,idreg);
-    sr = isp1761_reg_read16(ddev, HC_SCRATCH_REG,sr);
-    printk("DC_ID:0x%08x SR:0x%x\n",idreg,sr);
-    if(drv->index == ISP1761_DC){/*FIX for device*/
-        result = drv->probe(dev,drv->id);
+
+    if(drv->index == ISP1761_DC)
+    {/*FIX for device*/
+        if(dev->active)
+          result = drv->probe(dev,drv->id);
+        else
+          result = -ENODEV;
     }else{              
         id = drv->id;
         if(dev->active) result = drv->probe(dev,id);
@@ -736,8 +726,7 @@
     }
 
     if(result >= 0 ) {
-        printk(KERN_INFO __FILE__ ": Registered Driver %s\n",
-                drv->name);
+        hal_entry("ISP1761 Registered Driver %s\n", drv->name);
         dev->driver = drv;
     }
     hal_entry("%s: Exit\n",__FUNCTION__);
@@ -815,10 +804,19 @@
 
     memset(isp1761_loc_dev,0,sizeof(isp1761_loc_dev));
 
-    printk("++ isp1761_module_init\n");
+    hal_entry("++ isp1761_module_init\n");
     result = platform_driver_register(&isp1761_platform_driver);
 
-    printk("drv:0x%lx\n",&isp1761_platform_driver);
+/*    s_pdev = platform_device_register_simple("isp1761-hcd",-1,NULL,0);
+
+    if(IS_ERR(s_pdev))
+    {
+      printk("Error platform_device_register_simple\n");
+      result=PTR_ERR(s_pdev);
+      platform_driver_unregister(&isp1761_loc_dev);
+    }     */
+        
+    printk("Register hal_x86\n");
     hal_entry("%s: Exit:%d\n",__FUNCTION__,result);
     return result;
 }
@@ -841,7 +839,6 @@
 
 static void __exit isp1761_module_cleanup (void) 
 {
-    printk("Hal Module Cleanup\n");
     platform_driver_unregister(&isp1761_platform_driver);
     memset(isp1761_loc_dev,0,sizeof(isp1761_loc_dev));
 } 
@@ -872,24 +869,26 @@
     static int __devinit
 isp1761_probe (struct platform_device *pdev)
 {
-    u8 latency, limit;
     __u32       reg_data = 0;
-    int retry_count;
     struct isp1761_dev  *loc_dev;
     struct resource *res;
     void *address = 0;
     int length = ISP1761_IO_EXTENT;
     int status = 0;
-    hal_entry("%s: Entered\n",__FUNCTION__);
+    hal_entry("%s: Entered (pdev:%x)\n",__FUNCTION__,pdev);
+    printk("%s: Entered (pdev:%x)\n",__FUNCTION__,pdev);
     res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "isp1761-hcd");
+    printk("res1:%d\n",res);
     if (!res)
+    {
 	    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+      printk("res2:%d\n",res);
+
+    }
     if (!res)
 	    return -ENODEV;
 
     isp1761_base = res->start;
-//    isp1761_base = 0x80000;
-//    printk("base:0x%x len:0x%x\n",isp1761_base,length);
     hal_init(("isp1761 pci base address = %x\n", isp1761_base));
 
     /* Get the Host Controller IO and INT resources
@@ -922,9 +921,8 @@
     } 
 
     loc_dev->baseaddress = (u8*)address;
-//U    loc_dev->dmabase = (u8*)iobase;
 
-    printk("isp1761 HC MEM Base= %p irq = %d\n",loc_dev->baseaddress,loc_dev->irq);
+    printk("ISP1761 HC MEM Base= %p irq = %d\n",loc_dev->baseaddress,loc_dev->irq);
 #ifdef ISP1761_DEVICE   
 
     /*initialize device controller framework*/  
@@ -941,28 +939,8 @@
     memcpy(loc_dev->name,"isp1761_dev",11);
     loc_dev->name[12] = '\0';
 
-
-    {
-        u32 chipid = 0;
-//debug pio
-//        np_pio *pio=(np_pio*)(na_nios_to_uC);
-//        printk("address:0x%x\n",address);
-
-//        outl(-1,&pio->np_piodirection);
-//        outl(0,&pio->np_piodata);
-        
-//        outl(0x80,&pio->np_piodata);
-
-        chipid = readl(address + 0x270);
-        info("pid %04x, vid %04x", (chipid & 0xffff), (chipid >> 16));
-//        outl(0x40,&pio->np_piodata);
-        chipid = readl(address + 0x304);
-        info("HCChipID:0x%x", chipid);
-    }   
-    printk("isp1761 DC MEM Base= %lx irq = %d\n",loc_dev->io_base,loc_dev->irq);
-    /* Get the OTG Controller IO and INT resources
-     * OTG controller resources are same as Host Controller resources
-     */
+    printk("ISP1761 DC MEM Base= %lx irq = %d\n",loc_dev->io_base,loc_dev->irq);
+    
     loc_dev = &(isp1761_loc_dev[ISP1761_OTG]);
     loc_dev->dev = &pdev->dev;
     loc_dev->irq = platform_get_irq(pdev, 0);
@@ -976,7 +954,7 @@
     memcpy(loc_dev->name,"isp1761_otg",11);
     loc_dev->name[12] = '\0';
 
-    printk("isp1761 OTG MEM Base= %lx irq = %x\n", loc_dev->io_base,loc_dev->irq);
+    printk("ISP1761 OTG MEM Base= %lx irq = %x\n", loc_dev->io_base,loc_dev->irq);
 
 #endif
 
@@ -988,19 +966,52 @@
     /* Host Controller presence is detected by writing to scratch register
      * and reading back and checking the contents are same or not
      */
-    printk("Scratch register:%x\n",reg_data);
+    printk("ISP1761 Host scratch register:0x%x\n",reg_data);
     if(reg_data != 0xFACE) {
-        err("%s scratch register mismatch %x",
+        err("%s scratch register mismatch 0x%x",
                 isp1761_driver_name,reg_data);
         status = -ENODEV;
         goto clean;
     }
+    
+    isp1761_reg_write16(loc_dev, 0x278, 0xDEAD);
+    udelay(100);
+    reg_data = isp1761_reg_read16(loc_dev, 0x278,reg_data);
 
+    /* Device Controller presence is detected by writing to scratch register
+     * and reading back and checking the contents are same or not
+     */
+    printk("ISP1761 Device scratch register:0x%x\n",reg_data);
+    if(reg_data != 0xDEAD) {
+        err("%s scratch register mismatch 0x%x",
+                isp1761_driver_name,reg_data);
+        status = -ENODEV;
+        goto clean;
+    }
+
+    isp1761_chip_reset(loc_dev);
+
+    reg_data = isp1761_reg_read16(loc_dev, 0x308,reg_data);
+    if(reg_data != 0) {
+        err("%s host scratch register not 0 after reset:0x%x",
+                isp1761_driver_name,reg_data);
+        status = -ENODEV;
+        goto clean;
+    }
+
+    reg_data = isp1761_reg_read16(loc_dev, 0x278,reg_data);
+    if(reg_data != 0) {
+        err("%s device scratch register not 0 after reset:0x%x",
+                isp1761_driver_name,reg_data);
+        status = -ENODEV;
+        goto clean;
+    }
+    
     memcpy(loc_dev->name, isp1761_driver_name, sizeof(isp1761_driver_name));
     loc_dev->name[sizeof(isp1761_driver_name)] = 0;
     loc_dev->active = 1;
 
-    info("controller address %p\n", &pdev->dev);
+//    info("controller address %p\n", &pdev->dev);
 
     s_pdev = pdev;
     hal_data.irq_usage = 0;
@@ -1015,6 +1026,41 @@
 } /* End of isp1761_pci_probe */
 
 
+static void isp1761_chip_reset(struct isp1761_dev *dev)
+{
+  int reg;
+  int i;
+
+//  printk("Register-Dump vor RST\n");       
+//  for(i=0;i<0x400;i+=4)
+//    printk("0x%03x: 0x%08x\n",i,isp1761_reg_read32(dev,i,reg));
+
+  /* reset the device controller */
+  isp1761_reg_write32(dev, DEV_UNLOCK_REGISTER, 0xaa37);
+
+  reg=isp1761_reg_read32(dev,0x20c,reg);      //Mode (SW Reset) DC
+  reg|=0x10;
+  isp1761_reg_write32(dev,0x20c,reg);
+  reg&=~0x10;
+  isp1761_reg_write32(dev,0x20c,reg);
+
+  udelay(100);
+
+  /*reset the host controller */
+  reg &= 0;
+  reg |= 1;
+  isp1761_reg_write32(dev,0x30c, reg);
+  /*reset the ehci controller registers*/
+  reg = 0;
+  reg |= (1<<1);
+  isp1761_reg_write32(dev,0x30c, reg);
+
+//  printk("Register-Dump nach RST\n");      // für den Dump muss pdc_read32 das static __inline__ kommentiert werden und die externen Prototyp definiert
+//  for(i=0;i<0x400;i+=4)
+//    printk("0x%03x: 0x%08x\n",i,isp1761_reg_read32(dev,i,reg));
+}
+
+
 /*--------------------------------------------------------------*
  *
  *  Module dtatils: isp1761_remove
@@ -1040,9 +1086,11 @@
 isp1761_remove (struct platform_device *pdev)
 {
     struct isp1761_dev  *loc_dev;
-    hal_init(("isp1761_remove(dev=%p)\n",pdev));
+    hal_init("isp1761_remove(dev=%p)\n",pdev);
     /*Lets handle the host first*/
     loc_dev  = &isp1761_loc_dev[ISP1761_HC];
+    
+    isp1761_chip_reset(loc_dev);
     /*free the memory occupied by host*/
     release_mem_region(loc_dev->io_base, loc_dev->io_len);      
     /*unmap the occupied memory resources*/
@@ -1143,11 +1191,14 @@
 EXPORT_SYMBOL(isp1761_reg_read32);
 EXPORT_SYMBOL(isp1761_reg_write32);
 EXPORT_SYMBOL(isp1761_request_irq);
+EXPORT_SYMBOL(isp1761_isr);
+EXPORT_SYMBOL(isp1761_register_isr);
 EXPORT_SYMBOL(isp1761_mem_read);
 EXPORT_SYMBOL(isp1761_mem_write);
 EXPORT_SYMBOL(isp1761_free_irq);
 EXPORT_SYMBOL(isp1761_register_driver);
 EXPORT_SYMBOL(isp1761_unregister_driver);
+EXPORT_SYMBOL(isp1761_chip_reset);
 
 MODULE_AUTHOR (DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
Index: D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/host/pehci.c
===================================================================
--- D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/host/pehci.c	(revision 26)
+++ D:/cx/prj/doc/linuxtutorial/computer/linux/2623/isp1761/pehcd/host/pehci.c	(revision 27)
@@ -108,7 +108,7 @@
 /* used when updating hcd data */
 static spinlock_t hcd_data_lock = SPIN_LOCK_UNLOCKED;
 
-static const char       hcd_name [] = "ISP1761HCD";
+static const char       hcd_name [] = "pehci";
 static td_ptd_map_buff_t td_ptd_map_buff[TD_PTD_TOTAL_BUFF_TYPES];      /* td-ptd map buffer for all 1362 buffers */
 
 static __u8             td_ptd_pipe_x_buff_type[TD_PTD_TOTAL_BUFF_TYPES] = {    
@@ -169,9 +169,7 @@
 pehci_hcd_handshake (phci_hcd *hcd,u32 ptr,u32 mask,u32 done,int usec)
 {
     u32 result = 0;
-//    printk("Handshake:mask:%d, done:%d, usec:%d\n",mask, done, usec);
     do {
-//        printk("#");
         result = isp1761_reg_read32(hcd->dev,ptr,result);
         if (result == ~(u32)0)          /* card removed */
             return -ENODEV;
@@ -2182,20 +2180,12 @@
     int retval = 0;
     pehci_entry("++ %s: Entered\n",__FUNCTION__);
     /*initialize the host controller*/
-//    printk("TEST\n");
     command |= CMD_RUN;
-//    printk("Write:%d\n",command);
     isp1761_reg_write32(hcd->dev,hcd->regs.command,command);
 
     command &=0;
     command  =  isp1761_reg_read32(hcd->dev,hcd->regs.command,command);
     /*should be in operation in 1000 usecs*/
-//    printk(";");
-//    printk("Commandcommandcommandcommandcommandcommandcommandcommandcommand:%d\n",command);
-//    printk("Cmd2:%d\n",command);
-//    printk("Cmd3:%d\n",command);
-//    printk("Cmd4:%d\n",command);
-//    printk("Cmd5:%d\n",command);
 #ifdef LINUX_269    
     if((retval = pehci_hcd_handshake(hcd,hcd->regs.command, CMD_RUN, CMD_RUN,1000))){
 #else
@@ -2205,13 +2195,11 @@
         return retval;
     }
 
-//    printk("HSC3\n");
     /*put the host controller to ehci mode*/
     command &=0;
     command |= 1;
     isp1761_reg_write32(hcd->dev,hcd->regs.configflag, command);
     /*check if ehci mode switching is correct or not*/
-//    printk("HSC4\n");
     if((retval = pehci_hcd_handshake(hcd, hcd->regs.configflag,1,1,100))){
         err("Host is not into ehci mode in 100 usecs\n");
         return retval;
@@ -2409,7 +2397,6 @@
     u32 intr = 0;
     __u32   irq_mask = 0;
     struct usb_hcd *usb_hcd = (struct usb_hcd *)__irq_data;
-//printk("$");
     if(!(usb_hcd->state & USB_STATE_READY)){
         info("interrupt handler state not ready yet\n");
         return IRQ_NONE;
@@ -2473,21 +2460,20 @@
 {
     u32         command = 0;
     u32         temp = 0;
+    int reg;
     phci_hcd *hcd = usb_hcd_to_pehci_hcd(usb_hcd);
+    
     /*reset the host controller */
     temp &= 0;
     temp |= 1;
     isp1761_reg_write32(hcd->dev,hcd->regs.reset, temp);
-
     /*reset the ehci controller registers*/
     temp = 0;
     temp |= (1<<1);
     isp1761_reg_write32(hcd->dev,hcd->regs.reset, temp);
 
-
     /*read the command register */
     command = isp1761_reg_read32(hcd->dev,hcd->regs.command,command);
-
     command |= CMD_RESET;
     /*write back and wait for, 250 msec */
     isp1761_reg_write32(hcd->dev,hcd->regs.command,command);
@@ -2574,7 +2560,6 @@
     pehci_hcd->state = HC_STATE_RUNNING;
 #endif
 
-    printk("HIA6\n");
     /*initialize root hub timer*/
     init_timer(&pehci_hcd->rh_timer);
     /*initialize watchdog*/
@@ -3410,9 +3395,7 @@
         return -EINVAL;
     usb_hcd = driver->hcd_alloc ();
 #else
-    printk("usd_create_hcd\n");
     usb_hcd = usb_create_hcd(&pehci_driver, dev, "platform");
-//    printk("usd_create_hcd:usb_hcd:0x%x\n",usb_hcd);
 #endif
 
     if (usb_hcd == NULL){
@@ -3427,9 +3410,7 @@
     pehci_hcd->iolength = tmp_1761_dev->length;
     pehci_hcd->plxiobase = (u8*)tmp_1761_dev->dmabase;
     pehci_hcd->plxiolength = tmp_1761_dev->length;
-//    printk("iobase:0x%x irq:%d\n",pehci_hcd->iobase,tmp_1761_dev->irq);
 
-
     /*lets keep our host here*/
     tmp_1761_dev->driver_data = usb_hcd;
 
@@ -3457,6 +3438,7 @@
         goto clean;
     }
 #else
+//    pehci_hcd_reset(usb_hcd);
     isp1761_register_isr(pehci_hcd_irq,tmp_1761_dev,usb_hcd);
 #endif
 
@@ -3493,9 +3475,7 @@
         goto clean;
     }
 #else
-//	printk("usb_add_hcd\n");
 	status = usb_add_hcd(usb_hcd, tmp_1761_dev->irq, SA_SHIRQ);
-//	printk("usb_add_hcd: status:%d\n",status);
 #endif
 
     pehci_entry("-- %s: Exit\n",__FUNCTION__);
@@ -3611,12 +3591,12 @@
     phci_hcd_mem_init();
 
     /*register driver*/
-    printk("++ pehci_module_init\n");
+    pehci_entry("++ pehci_module_init\n");
     result = isp1761_register_driver(&pehci_hcd_pci_driver);
     if(!result)
-        info("Host Driver has been Registered");
+        printk("ISP1761 Host Driver Initialization Success\n");
     else
-        err("Host Driver has not been Registered with errors : %d",result);
+        err("ISP1761 Host Driver has not been Registered with errors : %d",result);
 //    mdelay(1000);
     return result;
 
