]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/keucr/usb.c
Merge branch 'for-paul-38-rebased' of git://gitorious.org/linux-omap-dss2/linux
[~andy/linux] / drivers / staging / keucr / usb.c
index 260828ea8eaf6dc2cf5f2efb8bb07a5b489fdb17..c65b988264ccc06ccdeb2849bb204fc5182d80a4 100644 (file)
@@ -21,6 +21,8 @@ MODULE_AUTHOR("Domao");
 MODULE_DESCRIPTION("ENE USB Mass Storage driver for Linux");
 MODULE_LICENSE("GPL");
 
+static unsigned int delay_use = 1;
+
 static struct usb_device_id eucr_usb_ids [] = {
        { USB_DEVICE(0x058f, 0x6366) },
        { USB_DEVICE(0x0cf2, 0x6230) },
@@ -181,11 +183,10 @@ static int usb_stor_control_thread(void * __us)
                mutex_lock(&(us->dev_mutex));
 
                /* if the device has disconnected, we are free to exit */
-/*             if (test_bit(US_FLIDX_DISCONNECTING, &us->flags))
-               {
+               if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) {
                        mutex_unlock(&us->dev_mutex);
                        break;
-               }*/
+               }
 
                /* lock access to the state */
                scsi_lock(host);
@@ -342,7 +343,7 @@ static int get_transport(struct us_data *us)
 {
       printk("usb --- get_transport\n");
        switch (us->protocol) {
-       case US_PR_BULK:
+       case USB_PR_BULK:
                us->transport_name = "Bulk";
                us->transport = usb_stor_Bulk_transport;
                us->transport_reset = usb_stor_Bulk_reset;
@@ -366,7 +367,7 @@ static int get_protocol(struct us_data *us)
        printk("us->pusb_dev->descriptor.idVendor = %x\n", us->pusb_dev->descriptor.idVendor);
        printk("us->pusb_dev->descriptor.idProduct = %x\n", us->pusb_dev->descriptor.idProduct);
        switch (us->subclass) {
-       case US_SC_SCSI:
+       case USB_SC_SCSI:
                us->protocol_name = "Transparent SCSI";
                if( (us->pusb_dev->descriptor.idVendor == 0x0CF2) && (us->pusb_dev->descriptor.idProduct == 0x6250) )
                        us->proto_handler = ENE_stor_invoke_transport;
@@ -417,7 +418,7 @@ static int get_pipes(struct us_data *us)
                }
        }
 
-       if (!ep_in || !ep_out || (us->protocol == US_PR_CBI && !ep_int))
+       if (!ep_in || !ep_out || (us->protocol == USB_PR_CBI && !ep_int))
        {
                printk("Endpoint sanity check failed! Rejecting dev.\n");
                return -EIO;
@@ -551,21 +552,19 @@ static int usb_stor_scan_thread(void * __us)
       printk("usb --- usb_stor_scan_thread\n");
        printk("EUCR : device found at %d\n", us->pusb_dev->devnum);
 
-// Have we to add this code ?
-//     set_freezable();
-//     /* Wait for the timeout to expire or for a disconnect */
-//     if (delay_use > 0)
-//     {
-//             wait_event_freezable_timeout(us->delay_wait,
-//                             test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
-//                             delay_use * HZ);
-//     }
+       set_freezable();
+       /* Wait for the timeout to expire or for a disconnect */
+       if (delay_use > 0) {
+               wait_event_freezable_timeout(us->delay_wait,
+                               test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
+                               delay_use * HZ);
+       }
 
        /* If the device is still connected, perform the scanning */
        if (!test_bit(US_FLIDX_DONT_SCAN, &us->dflags))
        {
                /* For bulk-only devices, determine the max LUN value */
-               if (us->protocol == US_PR_BULK && !(us->fflags & US_FL_SINGLE_LUN))
+               if (us->protocol == USB_PR_BULK && !(us->fflags & US_FL_SINGLE_LUN))
                {
                        mutex_lock(&us->dev_mutex);
                        us->max_lun = usb_stor_Bulk_max_lun(us);