Device side of canqueue, compilation successful
[lincan.git] / embedded / app / usbcan / ul_usb1.c
index b777b14..0b3e388 100644 (file)
@@ -24,7 +24,7 @@
 #include "./can/main.h"
 #include "./can/devcommon.h"
 #include "./can/setup.h"
-#include "./can/finish.h"
+// #include "./can/finish.h"
 #include "./can/i82527.h"
 //#include "../include/sja1000.h"
 #include "./can/sja1000p.h"
@@ -39,7 +39,7 @@
 #define CAN_OP_WRITE 0x00
 
 
-/* our private defines. if this grows any larger, use your own .h file */
+       /* our private defines. if this grows any larger, use your own .h file */
 #define MAX_TRANSFER           (PAGE_SIZE - 512)
 /* MAX_TRANSFER is chosen so that the VM is not stressed by
    allocations > PAGE_SIZE and the number of packets in a page
 // };
 // MODULE_DEVICE_TABLE(usb, ul_usb1_table);
 
-extern struct file_operations can_fops;
+// extern struct file_operations can_fops;
 
-struct ul_usb1_combo {
-       struct usb_ul_usb1 * dev;
-       struct urb * urb;
-};
+// struct ul_usb1_combo {
+//     struct usb_ul_usb1 * dev;
+//     struct urb * urb;
+// };
 
 /*
  * IO_RANGE is the io-memory range that gets reserved, please adjust according
@@ -73,28 +73,28 @@ struct ul_usb1_combo {
 #define IO_RANGE 0x100
 
 /* Structure to hold all of our device specific stuff */
-struct usb_ul_usb1 {
-       struct usb_device       *udev;                  /* the usb device for this device */
-       struct usb_interface    *interface;             /* the interface for this device */
-       struct semaphore        limit_sem;              /* limiting the number of writes in progress */
-       struct usb_anchor       submitted;              /* in case we need to retract our submissions */
-       unsigned char           *bulk_in_buffer;        /* the buffer to receive data */
-       size_t                  bulk_in_size;           /* the size of the receive buffer */
-       unsigned char           *int_in_buffer; /* the buffer to receive data */
-       size_t                  int_in_size;            /* the size of the receive buffer */
-       __u8                    bulk_in_endpointAddr;   /* the address of the bulk in endpoint */
-       __u8                    bulk_out_endpointAddr;  /* the address of the bulk out endpoint */
-       __u8                    int_in_endpointAddr;    /* the address of the interrupt in endpoint */
-       int                             int_in_interval;
-       int                     errors;                 /* the last request tanked */
-       int                     open_count;             /* count the number of openers */
-       spinlock_t              err_lock;               /* lock for errors */
-       struct mutex            io_mutex;               /* synchronize I/O with disconnect */
-       struct urb              *irq;
-       struct candevice_t              *candev;
-};
-
-static struct usb_driver ul_usb1_driver;
+// struct usb_ul_usb1 {
+//     struct usb_device       *udev;                  /* the usb device for this device */
+//     struct usb_interface    *interface;             /* the interface for this device */
+//     struct semaphore        limit_sem;              /* limiting the number of writes in progress */
+//     struct usb_anchor       submitted;              /* in case we need to retract our submissions */
+//     unsigned char           *bulk_in_buffer;        /* the buffer to receive data */
+//     size_t                  bulk_in_size;           /* the size of the receive buffer */
+//     unsigned char           *int_in_buffer; /* the buffer to receive data */
+//     size_t                  int_in_size;            /* the size of the receive buffer */
+//     __u8                    bulk_in_endpointAddr;   /* the address of the bulk in endpoint */
+//     __u8                    bulk_out_endpointAddr;  /* the address of the bulk out endpoint */
+//     __u8                    int_in_endpointAddr;    /* the address of the interrupt in endpoint */
+//     int                             int_in_interval;
+//     int                     errors;                 /* the last request tanked */
+//     int                     open_count;             /* count the number of openers */
+//     spinlock_t              err_lock;               /* lock for errors */
+//     struct mutex            io_mutex;               /* synchronize I/O with disconnect */
+//     struct urb              *irq;
+//     struct candevice_t              *candev;
+// };
+//
+// static struct usb_driver ul_usb1_driver;
 
 /** ul_usb1_request_io
  * ul_usb1_request_io: - reserve io or memory range for can board
@@ -112,7 +112,7 @@ static struct usb_driver ul_usb1_driver;
  */
 int ul_usb1_request_io(struct candevice_t *candev)
 {
-       ((struct usb_ul_usb1*)candev->sysdevptr.anydev)->candev=candev;
+//     ((struct usb_ul_usb1*)candev->sysdevptr.anydev)->candev=candev;
        return 0;
 }
 
@@ -130,7 +130,7 @@ int ul_usb1_request_io(struct candevice_t *candev)
  */
 int ul_usb1_release_io(struct candevice_t *candev)
 {
-       struct usb_ul_usb1 *dev;
+/*     struct usb_ul_usb1 *dev;
        if (candev->sysdevptr.anydev){
                dev=(struct usb_ul_usb1*) candev->sysdevptr.anydev;
                usb_put_dev(dev->udev);
@@ -143,7 +143,7 @@ int ul_usb1_release_io(struct candevice_t *candev)
                        //cleanup_usbdev(dev->candev);
                }
                kfree(dev);
-       }
+       }*/
        return 0;
 }
 
@@ -306,20 +306,20 @@ void ul_usb1_write_register(struct candevice_t *candev,unsigned data, unsigned l
 
        dev = (struct usb_ul_usb1 *)candev->sysdevptr.anydev;
 
-       mutex_lock(&dev->io_mutex);
-       if (!dev) {             /* disconnect() was called */
-               CANMSG("Sending %lu:%X : ERR No device\n",address,(uint8_t)data);
-               retval = -ENODEV;
-               goto exit;
-       }
-       if (!dev->interface) {          /* disconnect() was called */
-               CANMSG("Sending %lu:%X : ERR No interface\n",address,(uint8_t)data);
-               retval = -ENODEV;
-               goto exit;
-       }
+//     mutex_lock(&dev->io_mutex);
+//     if (!dev) {             /* disconnect() was called */
+//             CANMSG("Sending %lu:%X : ERR No device\n",address,(uint8_t)data);
+//             retval = -ENODEV;
+//             goto exit;
+//     }
+//     if (!dev->interface) {          /* disconnect() was called */
+//             CANMSG("Sending %lu:%X : ERR No interface\n",address,(uint8_t)data);
+//             retval = -ENODEV;
+//             goto exit;
+//     }
 
        /* do a blocking bulk write to send data to the device */
-       retval = usb_bulk_msg(dev->udev,
+/*     retval = usb_bulk_msg(dev->udev,
                              usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr),
                              buffer,
                              2,
@@ -327,7 +327,7 @@ void ul_usb1_write_register(struct candevice_t *candev,unsigned data, unsigned l
        CANMSG("Sending %lu:%X : retval %d, transferred %d bytes\n",address,(uint8_t)data,retval,bytes_transferred);
 
 exit:
-       mutex_unlock(&dev->io_mutex);
+       mutex_unlock(&dev->io_mutex);*/
 }
 
 /** ul_usb1_read_register
@@ -351,18 +351,18 @@ unsigned ul_usb1_read_register(struct candevice_t *candev,unsigned long address)
 
        dev = (struct usb_ul_usb1 *)candev->sysdevptr.anydev;
 
-       mutex_lock(&dev->io_mutex);
-       if (!dev) {             /* disconnect() was called */
-               retval = -ENODEV;
-               goto exit;
-       }
-       if (!dev->interface) {          /* disconnect() was called */
-               retval = -ENODEV;
-               goto exit;
-       }
+//     mutex_lock(&dev->io_mutex);
+//     if (!dev) {             /* disconnect() was called */
+//             retval = -ENODEV;
+//             goto exit;
+//     }
+//     if (!dev->interface) {          /* disconnect() was called */
+//             retval = -ENODEV;
+//             goto exit;
+//     }
 
        /* do a blocking bulk write to send data to the device */
-       retval = usb_bulk_msg(dev->udev,
+/*     retval = usb_bulk_msg(dev->udev,
                              usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr),
                              buffer,
                              2,
@@ -373,16 +373,16 @@ unsigned ul_usb1_read_register(struct candevice_t *candev,unsigned long address)
                retval = -EFAULT;
                goto exit;
        }
-
+*/
        /* do a blocking bulk read to get data from the device */
-       retval = usb_bulk_msg(dev->udev,
-                             usb_rcvbulkpipe(dev->udev, dev->bulk_in_endpointAddr),
-                             dev->bulk_in_buffer,
-                             dev->bulk_in_size,
-                             &bytes_transferred, 10000);
+//     retval = usb_bulk_msg(dev->udev,
+//                           usb_rcvbulkpipe(dev->udev, dev->bulk_in_endpointAddr),
+//                           dev->bulk_in_buffer,
+//                           dev->bulk_in_size,
+//                           &bytes_transferred, 10000);
 
        /* if the read was successful, copy the data to userspace */
-       CANMSG("Received %d bytes : %u:%X\n",bytes_transferred,(dev->bulk_in_buffer[0] & 0x7F),dev->bulk_in_buffer[1]);
+/*     CANMSG("Received %d bytes : %u:%X\n",bytes_transferred,(dev->bulk_in_buffer[0] & 0x7F),dev->bulk_in_buffer[1]);
        if (!retval) {
                if (bytes_transferred!=2)
                        retval = -EFAULT;
@@ -392,7 +392,7 @@ unsigned ul_usb1_read_register(struct candevice_t *candev,unsigned long address)
 
 exit:
        mutex_unlock(&dev->io_mutex);
-       return retval;
+       return retval;*/
 }
 
 /* !!! Don't change this function !!! */
@@ -416,209 +416,209 @@ int ul_usb1_register(struct hwspecops_t *hwspecops)
 /* --------------------------------------------------------------------------------------------------- */
 
 
-static void ul_usb1_irq(struct urb *urb)
-{
-       struct usb_ul_usb1 *dev = urb->context;
-       struct ul_usb1_combo devc;
-       int retval;
-
-       CANMSG("Interrupt poll\n");
-
-       switch (urb->status) {
-       case 0:
-               /* success */
-               break;
-       case -ECONNRESET:
-       case -ENOENT:
-       case -ESHUTDOWN:
-               /* this urb is terminated, clean up */
-               CANMSG("%s - urb shutting down with status: %d\n", __FUNCTION__, urb->status);
-               return;
-       default:
-               CANMSG("%s - nonzero urb status received: %d\n", __FUNCTION__, urb->status);
-               goto exit;
-       }
-
-       devc.dev = dev;
-       devc.urb = urb;
-
-       dev->candev->chip[0]->chipspecops->irq_handler(0,dev->candev->chip[0]);
-       CANMSG("Interrupt caught\n");
-
- exit:
-       retval = usb_submit_urb (urb, GFP_ATOMIC);
-       if (retval)
-               CANMSG("%s - usb_submit_urb failed with result %d\n",
-                    __FUNCTION__, retval);
-}
-
-static void ul_usb1_delete(struct usb_ul_usb1 *dev)
-{
-       usb_put_dev(dev->udev);
-       usb_kill_urb(dev->irq);
-       usb_free_urb(dev->irq);
-       kfree(dev->bulk_in_buffer);
-       kfree(dev->int_in_buffer);
-       if (dev->candev){
-               dev->candev->sysdevptr.anydev=NULL;
-               cleanup_usbdev(dev->candev);
-       }
-       kfree(dev);
-}
-
-static int ul_usb1_probe(struct usb_interface *interface, const struct usb_device_id *id)
-{
-       struct usb_ul_usb1 *dev;
-       struct usb_host_interface *iface_desc;
-       struct usb_endpoint_descriptor *endpoint;
-       struct candevice_t *candev;
-       size_t buffer_size;
-       int i;
-       int retval = -ENOMEM;
-
-       /* allocate memory for our device state and initialize it */
-       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
-       if (!dev) {
-               err("Out of memory");
-               goto error;
-       }
-       sema_init(&dev->limit_sem, WRITES_IN_FLIGHT);
-       mutex_init(&dev->io_mutex);
-       spin_lock_init(&dev->err_lock);
-       init_usb_anchor(&dev->submitted);
-
-//     dev->udev = usb_get_dev(interface_to_usbdev(interface));
-       dev->udev = interface_to_usbdev(interface);
-       dev->interface = interface;
-
-       /* set up the endpoint information */
-       /* use only the first bulk-in and bulk-out endpoints */
-       iface_desc = interface->cur_altsetting;
-       for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
-               endpoint = &iface_desc->endpoint[i].desc;
-
-               if (!dev->bulk_in_endpointAddr &&
-                   usb_endpoint_is_bulk_in(endpoint)) {
-                       /* we found a bulk in endpoint */
-                       buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
-                       dev->bulk_in_size = buffer_size;
-                       dev->bulk_in_endpointAddr = endpoint->bEndpointAddress;
-                       dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
-                       if (!dev->bulk_in_buffer) {
-                               err("Could not allocate bulk_in_buffer");
-                               goto error;
-                       }
-               }
-
-               if (!dev->bulk_out_endpointAddr &&
-                   usb_endpoint_is_bulk_out(endpoint)) {
-                       /* we found a bulk out endpoint */
-                               dev->bulk_out_endpointAddr = endpoint->bEndpointAddress;
-               }
-
-               if (!dev->int_in_endpointAddr &&
-                   usb_endpoint_is_int_in(endpoint)) {
-                       /* we found an interrupt in endpoint */
-                       buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
-                       dev->int_in_size = buffer_size;
-                       dev->int_in_endpointAddr = endpoint->bEndpointAddress;
-                       dev->int_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
-                       dev->int_in_interval = endpoint->bInterval;
-                       if (!dev->int_in_buffer) {
-                               err("Could not allocate int_in_buffer");
-                               goto error;
-                       }
-               }
-       }
-       if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr && dev->int_in_endpointAddr)) {
-               err("Could not find all bulk-in, bulk-out and interrupt endpoints");
-               goto error;
-       }
-
-       /* save our data pointer in this interface device */
-       usb_set_intfdata(interface, dev);
-
-       if (main_init_done==1)
-               register_usbdev("ul_usb1",(void *) dev);
-       else {
-               mutex_lock(&usbdev_reg_mutex);
-               if (main_init_done==1)
-                       register_usbdev("ul_usb1",(void *) dev);
-               else {
-                       for (i=0;i<MAX_HW_CARDS;i++){
-                               if (usbregq[i]==NULL){
-                                       usbregq[i]=(struct usbdev_reg_query *)can_checked_malloc(sizeof(struct usbdev_reg_query));
-                                       if (!usbregq[i]){
-                                               CANMSG("Error allocating usbdev_reg_query");
-                                               mutex_unlock(&usbdev_reg_mutex);
-                                               goto error;
-                                       }
-                                       sprintf (usbregq[i]->hwname,"ul_usb1");
-                                       usbregq[i]->anydev=(void *) dev;
-                                       break;
-                               }
-                       }
-                       if (i==MAX_HW_CARDS){
-                               CANMSG("No free space to register new card");
-                               mutex_unlock(&usbdev_reg_mutex);
-                               goto error;
-                       }
-               }
-               mutex_unlock(&usbdev_reg_mutex);
-       }
-
-       dev->irq = usb_alloc_urb(0, GFP_KERNEL);
-       if (!dev->irq){
-               CANMSG("Error allocating usb urb\n");
-               goto error;
-       }
-       dev->irq->dev = dev->udev;
-       usb_fill_int_urb(dev->irq, dev->udev,
-                        usb_rcvintpipe(dev->udev, dev->int_in_endpointAddr),
-                        dev->int_in_buffer, dev->int_in_size,
-                        ul_usb1_irq, dev, dev->int_in_interval);
-/*     usb_fill_bulk_urb(dev->irq, dev->udev,
-                        usb_rcvbulkpipe(dev->udev, dev->bulk_in_endpointAddr),
-                        dev->int_in_buffer, dev->int_in_size,
-                        ul_usb1_irq, dev);*/
-
-/*     dev->irq->transfer_dma = wacom->data_dma;
-       dev->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;*/
-       retval=usb_submit_urb(dev->irq, GFP_KERNEL);
-       if (retval){
-               CANMSG("INT URB %d\n",retval);
-               return -EIO;
-       }else
-               CANMSG("INT URB SUCCCESS\n");
-
-       /* let the user know what node this device is now attached to */
-       info("USB Skeleton device now attached");
-       return 0;
-
-error:
-               ul_usb1_delete(dev);
-       return retval;
-}
-
-static void ul_usb1_disconnect(struct usb_interface *interface)
-{
-       struct usb_ul_usb1 *dev;
-       int minor = interface->minor;
-
-       dev = usb_get_intfdata(interface);
-       usb_set_intfdata(interface, NULL);
-
-       /* prevent more I/O from starting */
-       mutex_lock(&dev->io_mutex);
-       dev->interface = NULL;
-       mutex_unlock(&dev->io_mutex);
+// static void ul_usb1_irq(struct urb *urb)
+// {
+//     struct usb_ul_usb1 *dev = urb->context;
+//     struct ul_usb1_combo devc;
+//     int retval;
+//
+//     CANMSG("Interrupt poll\n");
+//
+//     switch (urb->status) {
+//     case 0:
+//             /* success */
+//             break;
+//     case -ECONNRESET:
+//     case -ENOENT:
+//     case -ESHUTDOWN:
+//             /* this urb is terminated, clean up */
+//             CANMSG("%s - urb shutting down with status: %d\n", __FUNCTION__, urb->status);
+//             return;
+//     default:
+//             CANMSG("%s - nonzero urb status received: %d\n", __FUNCTION__, urb->status);
+//             goto exit;
+//     }
+//
+//     devc.dev = dev;
+//     devc.urb = urb;
+//
+//     dev->candev->chip[0]->chipspecops->irq_handler(0,dev->candev->chip[0]);
+//     CANMSG("Interrupt caught\n");
+//
+//  exit:
+//     retval = usb_submit_urb (urb, GFP_ATOMIC);
+//     if (retval)
+//             CANMSG("%s - usb_submit_urb failed with result %d\n",
+//                  __FUNCTION__, retval);
+// }
 
-       //usb_kill_anchored_urbs(&dev->submitted);
+// static void ul_usb1_delete(struct usb_ul_usb1 *dev)
+// {
+//     usb_put_dev(dev->udev);
+//     usb_kill_urb(dev->irq);
+//     usb_free_urb(dev->irq);
+//     kfree(dev->bulk_in_buffer);
+//     kfree(dev->int_in_buffer);
+//     if (dev->candev){
+//             dev->candev->sysdevptr.anydev=NULL;
+//             cleanup_usbdev(dev->candev);
+//     }
+//     kfree(dev);
+// }
 
-       ul_usb1_delete(dev);
+// static int ul_usb1_probe(struct usb_interface *interface, const struct usb_device_id *id)
+// {
+//     struct usb_ul_usb1 *dev;
+//     struct usb_host_interface *iface_desc;
+//     struct usb_endpoint_descriptor *endpoint;
+//     struct candevice_t *candev;
+//     size_t buffer_size;
+//     int i;
+//     int retval = -ENOMEM;
+//
+//     /* allocate memory for our device state and initialize it */
+//     dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+//     if (!dev) {
+//             err("Out of memory");
+//             goto error;
+//     }
+//     sema_init(&dev->limit_sem, WRITES_IN_FLIGHT);
+//     mutex_init(&dev->io_mutex);
+//     spin_lock_init(&dev->err_lock);
+//     init_usb_anchor(&dev->submitted);
+//
+// //  dev->udev = usb_get_dev(interface_to_usbdev(interface));
+//     dev->udev = interface_to_usbdev(interface);
+//     dev->interface = interface;
+//
+//     /* set up the endpoint information */
+//     /* use only the first bulk-in and bulk-out endpoints */
+//     iface_desc = interface->cur_altsetting;
+//     for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
+//             endpoint = &iface_desc->endpoint[i].desc;
+//
+//             if (!dev->bulk_in_endpointAddr &&
+//                 usb_endpoint_is_bulk_in(endpoint)) {
+//                     /* we found a bulk in endpoint */
+//                     buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+//                     dev->bulk_in_size = buffer_size;
+//                     dev->bulk_in_endpointAddr = endpoint->bEndpointAddress;
+//                     dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
+//                     if (!dev->bulk_in_buffer) {
+//                             err("Could not allocate bulk_in_buffer");
+//                             goto error;
+//                     }
+//             }
+//
+//             if (!dev->bulk_out_endpointAddr &&
+//                 usb_endpoint_is_bulk_out(endpoint)) {
+//                     /* we found a bulk out endpoint */
+//                             dev->bulk_out_endpointAddr = endpoint->bEndpointAddress;
+//             }
+//
+//             if (!dev->int_in_endpointAddr &&
+//                 usb_endpoint_is_int_in(endpoint)) {
+//                     /* we found an interrupt in endpoint */
+//                     buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+//                     dev->int_in_size = buffer_size;
+//                     dev->int_in_endpointAddr = endpoint->bEndpointAddress;
+//                     dev->int_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
+//                     dev->int_in_interval = endpoint->bInterval;
+//                     if (!dev->int_in_buffer) {
+//                             err("Could not allocate int_in_buffer");
+//                             goto error;
+//                     }
+//             }
+//     }
+//     if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr && dev->int_in_endpointAddr)) {
+//             err("Could not find all bulk-in, bulk-out and interrupt endpoints");
+//             goto error;
+//     }
+//
+//     /* save our data pointer in this interface device */
+//     usb_set_intfdata(interface, dev);
+//
+//     if (main_init_done==1)
+//             register_usbdev("ul_usb1",(void *) dev);
+//     else {
+//             mutex_lock(&usbdev_reg_mutex);
+//             if (main_init_done==1)
+//                     register_usbdev("ul_usb1",(void *) dev);
+//             else {
+//                     for (i=0;i<MAX_HW_CARDS;i++){
+//                             if (usbregq[i]==NULL){
+//                                     usbregq[i]=(struct usbdev_reg_query *)can_checked_malloc(sizeof(struct usbdev_reg_query));
+//                                     if (!usbregq[i]){
+//                                             CANMSG("Error allocating usbdev_reg_query");
+//                                             mutex_unlock(&usbdev_reg_mutex);
+//                                             goto error;
+//                                     }
+//                                     sprintf (usbregq[i]->hwname,"ul_usb1");
+//                                     usbregq[i]->anydev=(void *) dev;
+//                                     break;
+//                             }
+//                     }
+//                     if (i==MAX_HW_CARDS){
+//                             CANMSG("No free space to register new card");
+//                             mutex_unlock(&usbdev_reg_mutex);
+//                             goto error;
+//                     }
+//             }
+//             mutex_unlock(&usbdev_reg_mutex);
+//     }
+//
+//     dev->irq = usb_alloc_urb(0, GFP_KERNEL);
+//     if (!dev->irq){
+//             CANMSG("Error allocating usb urb\n");
+//             goto error;
+//     }
+//     dev->irq->dev = dev->udev;
+//     usb_fill_int_urb(dev->irq, dev->udev,
+//                      usb_rcvintpipe(dev->udev, dev->int_in_endpointAddr),
+//                      dev->int_in_buffer, dev->int_in_size,
+//                      ul_usb1_irq, dev, dev->int_in_interval);
+// /*  usb_fill_bulk_urb(dev->irq, dev->udev,
+//                      usb_rcvbulkpipe(dev->udev, dev->bulk_in_endpointAddr),
+//                      dev->int_in_buffer, dev->int_in_size,
+//                      ul_usb1_irq, dev);*/
+//
+// /*  dev->irq->transfer_dma = wacom->data_dma;
+//     dev->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;*/
+//     retval=usb_submit_urb(dev->irq, GFP_KERNEL);
+//     if (retval){
+//             CANMSG("INT URB %d\n",retval);
+//             return -EIO;
+//     }else
+//             CANMSG("INT URB SUCCCESS\n");
+//
+//     /* let the user know what node this device is now attached to */
+//     info("USB Skeleton device now attached");
+//     return 0;
+//
+// error:
+//             ul_usb1_delete(dev);
+//     return retval;
+// }
 
-       info("USB Skeleton now disconnected");
-}
+// static void ul_usb1_disconnect(struct usb_interface *interface)
+// {
+//     struct usb_ul_usb1 *dev;
+//     int minor = interface->minor;
+//
+//     dev = usb_get_intfdata(interface);
+//     usb_set_intfdata(interface, NULL);
+//
+//     /* prevent more I/O from starting */
+//     mutex_lock(&dev->io_mutex);
+//     dev->interface = NULL;
+//     mutex_unlock(&dev->io_mutex);
+//
+//     //usb_kill_anchored_urbs(&dev->submitted);
+//
+//     ul_usb1_delete(dev);
+//
+//     info("USB Skeleton now disconnected");
+// }
 
 // static struct usb_driver ul_usb1_driver = {
 //     .name =         "ul_usb1-can",