X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/c9f75ae1adefa54612bef6203f2459e337076572..88bf95b4a4434bafd1cd82b646d4ba902ce16086:/lincan/src/usbcan.c diff --git a/lincan/src/usbcan.c b/lincan/src/usbcan.c index 7980cc3..91807f7 100644 --- a/lincan/src/usbcan.c +++ b/lincan/src/usbcan.c @@ -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];