X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/ab35b42013ae4cd2ee79531e2466664a2b30068e..dfdc60b200ea4395b79c02964f6aa0f043c1f372:/lincan/src/main.c diff --git a/lincan/src/main.c b/lincan/src/main.c index dbedd0f..b8edf46 100644 --- a/lincan/src/main.c +++ b/lincan/src/main.c @@ -417,7 +417,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; @@ -450,7 +450,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; @@ -463,6 +463,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;