X-Git-Url: https://rtime.felk.cvut.cz/gitweb/can-usb1.git/blobdiff_plain/dd6261f83efe50b2d7213a6575cf9281a47dc8c7..9dccf25bf3f46fb1d14aec61f46a569d8fe1c5d7:/lincan-0.3.3/src/main.c diff --git a/lincan-0.3.3/src/main.c b/lincan-0.3.3/src/main.c index f69009b..94d269a 100644 --- a/lincan-0.3.3/src/main.c +++ b/lincan-0.3.3/src/main.c @@ -413,7 +413,7 @@ int init_module(void) -struct candevice_t* register_usbdev(const char *hwname,void *anydev){ +struct candevice_t* register_usbdev(const char *hwname,void *devdata,void (*chipdataregfnc)(struct canchip_t *ch,void *data)){ int i=0, j, board=0; struct candevice_t *candev; struct canchip_t *chip; @@ -446,7 +446,7 @@ struct candevice_t* register_usbdev(const char *hwname,void *anydev){ candev=hardware_p->candevice[board]; /* Adding link to usb device structure into can device */ - candev->sysdevptr.anydev=anydev; + candev->sysdevptr.anydev=devdata; if (candev->hwspecops->request_io(candev)) goto request_io_error; @@ -459,6 +459,8 @@ struct candevice_t* register_usbdev(const char *hwname,void *anydev){ if((chip=candev->chip[j])==NULL) continue; + chipdataregfnc(chip,devdata); + if(chip->chipspecops->attach_to_chip(chip)<0) { CANMSG("Initial attach to the chip HW failed\n"); goto interrupt_error;