]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/include/usbcan.h
Each (future) canchip associated to different usb endpoint, instead of whole device...
[lincan.git] / lincan / include / usbcan.h
index b01a6275d0d6a953a9b3f7049462f55efa4d135b..5ddbb12c8d86f24451b32c1914eb8efb42c6c1d5 100644 (file)
@@ -119,7 +119,7 @@ struct usbcan_message {
        struct urb      *u;
        u8      msg[16];
        spinlock_t              acc;            /* access lock */
-       long    flags;
+       volatile long   flags;
 };
 
 #define USBCAN_MESSAGE_FREE (1)
@@ -136,19 +136,10 @@ struct usbcan_message {
 struct usbcan_usb {
        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 */
-       unsigned char           *ctl_in_buffer; /* the buffer to receive data */
        size_t                  bulk_in_size;           /* the size of the receive buffer */
-       size_t                  ctl_in_size;            /* the size of the receive buffer */
-       u8                      ctl_in_endpointAddr;    /* the address of the bulk in endpoint */
-       u8                      ctl_out_endpointAddr;   /* the address of the bulk in endpoint */
        u8                      bulk_in_endpointAddr;   /* the address of the bulk in endpoint */
        u8                      bulk_out_endpointAddr;  /* the address of the bulk out endpoint */
-       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              *rx;
        struct urb              *tx;
@@ -157,15 +148,15 @@ struct usbcan_usb {
 
        struct task_struct *comthread;                      /* usb communication kernel thread  */
 
-
-       struct candevice_t *candev;
-       long flags;
+       struct canchip_t *chip;
+       volatile long flags;
 };
 
-#define USBCAN_DATA_READ               (1)
-#define USBCAN_TERMINATE               (2)
-#define USBCAN_ERROR                           (3)
-#define USBCAN_TX_PENDING              (4)
+#define USBCAN_DATA_READ                       (1)
+#define USBCAN_TERMINATE                       (2)
+#define USBCAN_ERROR                                   (3)
+#define USBCAN_TX_PENDING                      (4)
+#define USBCAN_THREAD_RUNNING  (5)
 
 #define USBCAN_VENDOR_BAUD_RATE_SET    (1)
 #define USBCAN_VENDOR_BAUD_RATE_STATUS (2)
@@ -176,5 +167,11 @@ struct usbcan_usb {
 #define USBCAN_VENDOR_EXT_MASK_SET     (7)
 #define USBCAN_VENDOR_EXT_MASK_STATUS  (8)
 
+struct usbcan_devs {
+       struct usbcan_usb **devs;
+       int     count;
+       struct candevice_t *candev;
+};
+
 
 #endif /*USBCAN_H*/