]> rtime.felk.cvut.cz Git - lincan.git/commitdiff
Minor variable type corrections (__u8 -> u8)
authorJan Kriz <krizj1@fel.cvut.cz>
Thu, 24 Jul 2008 10:06:24 +0000 (12:06 +0200)
committerppisa <pisa@cmp.felk.cvut.cz>
Thu, 24 Jul 2008 10:06:00 +0000 (12:06 +0200)
lincan/include/usbcan.h
lincan/src/usbcan.c

index 3e79bf06ed1d2fde26d41136ee8e52341e88bf85..0f1e39cd078517110e8174c0be49e3b941ac7a54 100644 (file)
@@ -115,15 +115,6 @@ int usbcan_chip_queue_status(struct canchip_t *chip);
 
 #endif /*CONFIG_OC_LINCAN_DETAILED_ERRORS*/
 
-/* CAN message over usb */
-struct usbcan_canmsg_t{
-       __u8 chip_id;
-       __u16 flags;
-       __u8 id[4];
-       __u8 length;
-       __u8 data[8];
-};
-
 /* Structure to hold all of our device specific stuff */
 struct usbcan_usb {
        struct usb_device       *udev;                  /* the usb device for this device */
@@ -134,19 +125,17 @@ struct usbcan_usb {
        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 */
+       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              *rcv;
-/*     uchar8_t        rcv_msg[16];
-       uchar8_t        tx_msg[16];*/
-       __u8    rcv_msg[16];
-       __u8    tx_msg[16];
+       u8      rcv_msg[16];
+       u8      tx_msg[16];
        kthread_t  rcvthread;                      /* usb receive kernel thread  */
 
        struct candevice_t *candev;
index 7980cc3464bd2382246d0c17ecb6bbf9aee30192..91807f77a669db1d2e5a8e4e248255adb5ca4952 100644 (file)
@@ -48,8 +48,8 @@ int usbcan_request_io(struct candevice_t *candev)
        struct usbcan_usb *dev = (struct usbcan_usb*)candev->sysdevptr.anydev;
 
        if (!dev){
-               CANMSG("Cannot register usbcan while usb device is not present.\n");
-               CANMSG("Usbcan registers automatically on device insertion.\n");
+               CANMSG("USBCAN_REQUEST_IO: Cannot register usbcan while usb device is not present.\n");
+               CANMSG("USBCAN_REQUEST_IO: Usbcan registers automatically on device insertion.\n");
                return -ENODEV;
        }
 
@@ -275,7 +275,7 @@ int usbcan_extended_mask(struct canchip_t *chip, unsigned long code, unsigned  l
        int retval;
        struct usbcan_usb *dev=(struct usbcan_usb*)chip->hostdevice->sysdevptr.anydev;
 
-       __u8 usbbuf[16];
+       u8 usbbuf[16];
 
        *(uint32_t *)(usbbuf)=cpu_to_le32(mask);
        *(uint32_t *)(usbbuf+4)=cpu_to_le32(code);
@@ -298,7 +298,7 @@ int usbcan_extended_mask(struct canchip_t *chip, unsigned long code, unsigned  l
                &usbbuf, 16,
                10000);
 
-       if (retval==16){
+       if (retval==1){
                if(usbbuf[0]==1){
                        DEBUGMSG("Setting acceptance code to 0x%lx\n",(unsigned long)code);
                        DEBUGMSG("Setting acceptance mask to 0x%lx\n",(unsigned long)mask);
@@ -328,7 +328,7 @@ int usbcan_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw,
        int retval;
        struct usbcan_usb *dev=(struct usbcan_usb*)chip->hostdevice->sysdevptr.anydev;
 
-       __u8 usbbuf[16];
+       u8 usbbuf[16];
 
        *(int32_t *)(usbbuf)=cpu_to_le32(rate);
        *(int32_t *)(usbbuf+4)=cpu_to_le32(sjw);
@@ -353,7 +353,7 @@ int usbcan_baud_rate(struct canchip_t *chip, int rate, int clock, int sjw,
                usbbuf, 16,
                10000);
 
-       if (retval==16){
+       if (retval==1){
                if(usbbuf[0]==1)
                        return 0;
        }
@@ -397,7 +397,7 @@ int usbcan_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj,
        struct usbcan_usb *dev=(struct usbcan_usb*)chip->hostdevice->sysdevptr.anydev;
        int i=0;
        int len;
-       __u8 *ptr;
+       u8 *ptr;
 
        /* Wait until Transmit Buffer Status is released */
        while ( usbcan_chip_queue_status(chip) &&
@@ -454,7 +454,7 @@ int usbcan_send_msg(struct canchip_t *chip, struct msgobj_t *obj,
                CANMSG("URB error %d\n",retval);
                return -EIO;
        }
-       if (len!=sizeof(struct usbcan_canmsg_t)){
+       if (len!=16){
                CANMSG("CAN message not sent\n");
                return -EIO;
        }
@@ -1058,7 +1058,7 @@ void usbcan_read_kthread(kthread_t *kthread)
                                if ((dev->candev->chip[dev->rcv_msg[0]])&&
                                        (dev->candev->chip[dev->rcv_msg[0]]->flags & CHIP_CONFIGURED)
                                ){
-                                       __u8 *ptr;
+                                       u8 *ptr;
 
                                        obj=dev->candev->chip[dev->rcv_msg[0]]->msgobj[0];