X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/4dc78b4651f006bf0404c8ec7db85651bcee7c2e..04ac67cc3cac14cd601daacd0592121ec0b84012:/lincan/src/virtual.c diff --git a/lincan/src/virtual.c b/lincan/src/virtual.c index de6c6f5..eb8043f 100644 --- a/lincan/src/virtual.c +++ b/lincan/src/virtual.c @@ -138,7 +138,7 @@ int virtual_pre_read_config(struct canchip_t *chip, struct msgobj_t *obj) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, +int virtual_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { return 0; @@ -155,7 +155,7 @@ int virtual_pre_write_config(struct canchip_t *chip, struct msgobj_t *obj, * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_send_msg(struct canchip_t *chip, struct msgobj_t *obj, +int virtual_send_msg(struct canchip_t *chip, struct msgobj_t *obj, struct canmsg_t *msg) { return 0; @@ -184,7 +184,7 @@ int virtual_check_tx_stat(struct canchip_t *chip) * Return Value: negative value reports error. * File: src/virtual.c */ -int virtual_set_btregs(struct canchip_t *chip, unsigned short btr0, +int virtual_set_btregs(struct canchip_t *chip, unsigned short btr0, unsigned short btr1) { return 0; @@ -321,7 +321,7 @@ void virtual_irq_write_handler(struct canchip_t *chip, struct msgobj_t *obj) * The CAN driver uses this pointer to store relationship of interrupt * to chip state structure - @struct canchip_t * @regs: system dependent value pointing to registers stored in exception frame - * + * * Interrupt handler is activated when state of CAN controller chip changes, * there is message to be read or there is more space for new messages or * error occurs. The receive events results in reading of the message from @@ -342,20 +342,20 @@ void virtual_schedule_next(struct msgobj_t *obj) can_preempt_disable(); can_msgobj_set_fl(obj,TX_REQUEST); - + while(!can_msgobj_test_and_set_fl(obj,TX_LOCK)){ can_msgobj_clear_fl(obj,TX_REQUEST); - + cmd=canque_test_outslot(obj->qends, &obj->tx_qedge, &obj->tx_slot); if(cmd>=0) { mod_timer(&obj->tx_timeout, jiffies+virtual_bus_latency(obj)); DEBUGMSG("virtual: scheduled delivery\n"); - } else + } else can_msgobj_clear_fl(obj,TX_LOCK); - + if(!can_msgobj_test_fl(obj,TX_REQUEST)) break; DEBUGMSG("TX looping in virtual_schedule_next\n"); } @@ -367,7 +367,7 @@ void virtual_schedule_next(struct msgobj_t *obj) void virtual_do_tx_timeout(unsigned long data) { struct msgobj_t *obj=(struct msgobj_t *)data; - + if(obj->tx_slot) { /* fill CAN message timestamp */ can_filltimestamp(&obj->tx_slot->msg.timestamp); @@ -398,7 +398,7 @@ void virtual_do_tx_timeout(unsigned long data) int virtual_wakeup_tx(struct canchip_t *chip, struct msgobj_t *obj) { /* can_msgobj_set_fl(obj,TX_REQUEST); */ - + struct canque_edge_t *qedge; struct canque_slot_t *slot; int cmd; @@ -413,7 +413,7 @@ int virtual_wakeup_tx(struct canchip_t *chip, struct msgobj_t *obj) if(cmd==0) { /* fill CAN message timestamp */ can_filltimestamp(&slot->msg.timestamp); - + canque_filter_msg2edges(obj->qends, &slot->msg); DEBUGMSG("virtual: direct delivery\n"); } @@ -475,7 +475,7 @@ int virtual_reset(struct candevice_t *candev) * Return Value: The function always returns zero * File: src/virtual.c */ -int virtual_init_hw_data(struct candevice_t *candev) +int virtual_init_hw_data(struct candevice_t *candev) { candev->res_addr=0; candev->nr_82527_chips=0;