]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/include/usbcan.h
Added vendor functions to embedded application, data transferred by usb channel seria...
[lincan.git] / lincan / include / usbcan.h
index 80566cdd8faefe97e74ccc727b030a0e83270fff..2d580fb3424ddde470f5f62edd6ff2df1a6be672 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/usb.h>
 #include <linux/mutex.h>
 
 #include <linux/usb.h>
 #include <linux/mutex.h>
 
+#include "../include/kthread.h"
+
 /* 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
 /* 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
@@ -61,13 +63,11 @@ int usbcan_send_msg(struct canchip_t *chip, struct msgobj_t *obj,
 int usbcan_fill_chipspecops(struct canchip_t *chip);
 int usbcan_irq_handler(int irq, struct canchip_t *chip);
 
 int usbcan_fill_chipspecops(struct canchip_t *chip);
 int usbcan_irq_handler(int irq, struct canchip_t *chip);
 
-void usbcan_read_kthread(kthread_t *kthread);
-int usbcan_chip_queue_status(struct canchip_t *chip);
-
 int usbcan_init(void);
 void usbcan_exit(void);
 int usbcan_init(void);
 void usbcan_exit(void);
-static int usbcan_probe(struct usb_interface *interface, const struct usb_device_id *id);
-static void usbcan_disconnect(struct usb_interface *interface);
+
+void usbcan_read_kthread(kthread_t *kthread);
+int usbcan_chip_queue_status(struct canchip_t *chip);
 
 #ifdef CONFIG_OC_LINCAN_DETAILED_ERRORS
 
 
 #ifdef CONFIG_OC_LINCAN_DETAILED_ERRORS
 
@@ -124,12 +124,6 @@ struct usbcan_canmsg_t{
        __u8 data[8];
 };
 
        __u8 data[8];
 };
 
-/* CAN extended mask */
-struct usbcan_mask_t{
-       __u32 code;
-       __u32 mask;
-};
-
 /* Structure to hold all of our device specific stuff */
 struct usbcan_usb {
        struct usb_device       *udev;                  /* the usb device for this device */
 /* Structure to hold all of our device specific stuff */
 struct usbcan_usb {
        struct usb_device       *udev;                  /* the usb device for this device */
@@ -149,8 +143,10 @@ struct usbcan_usb {
        spinlock_t              err_lock;               /* lock for errors */
        struct mutex            io_mutex;               /* synchronize I/O with disconnect */
        struct urb              *rcv;
        spinlock_t              err_lock;               /* lock for errors */
        struct mutex            io_mutex;               /* synchronize I/O with disconnect */
        struct urb              *rcv;
-       struct usbcan_canmsg_t rcv_msg;
-       struct usbcan_canmsg_t tx_msg;
+/*     uchar8_t        rcv_msg[16];
+       uchar8_t        tx_msg[16];*/
+       __u8    rcv_msg[16];
+       __u8    tx_msg[16];
        kthread_t  rcvthread;                      /* usb receive kernel thread  */
 
        struct candevice_t *candev;
        kthread_t  rcvthread;                      /* usb receive kernel thread  */
 
        struct candevice_t *candev;
@@ -168,21 +164,8 @@ struct usbcan_usb {
 #define USBCAN_VENDOR_CHECK_TX_STAT    (4)
 #define USBCAN_VENDOR_START_CHIP       (5)
 #define USBCAN_VENDOR_STOP_CHIP        (6)
 #define USBCAN_VENDOR_CHECK_TX_STAT    (4)
 #define USBCAN_VENDOR_START_CHIP       (5)
 #define USBCAN_VENDOR_STOP_CHIP        (6)
-
-/* table of devices that work with this driver */
-static struct usb_device_id usbcan_table [] = {
-       { USB_DEVICE(USBCAN_VENDOR_ID, USBCAN_PRODUCT_ID) },
-       { }                                     /* Terminating entry */
-};
-MODULE_DEVICE_TABLE(usb, usbcan_table);
-
-static struct usb_driver usbcan_driver = {
-       .name =         "usbcan",
-       .id_table = usbcan_table,
-       .probe =        usbcan_probe,
-       .disconnect =   usbcan_disconnect,
-};
-
+#define USBCAN_VENDOR_EXT_MASK_SET     (7)
+#define USBCAN_VENDOR_EXT_MASK_STATUS  (8)
 
 
 #endif /*USBCAN_H*/
 
 
 #endif /*USBCAN_H*/