X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/ca4f53cc8f5c5e7b444309afde6d265578be391d..99d090e67281ec1e9d61054afced20c9a76124b3:/lincan/src/i82527.c diff --git a/lincan/src/i82527.c b/lincan/src/i82527.c index 7834c1b..5ef9d8f 100644 --- a/lincan/src/i82527.c +++ b/lincan/src/i82527.c @@ -248,7 +248,7 @@ int i82527_clear_objects(struct canchip_t *chip) DEBUGMSG("Cleared all message objects on chip\n"); - for (i=1; i<=15; i++) { + for (i=0; imax_objects; i++) { obj=chip->msgobj[i]; canobj_write_reg(chip,obj,(INTPD_RES|RXIE_RES|TXIE_RES|MVAL_RES),iMSGCTL0); canobj_write_reg(chip,obj,(NEWD_RES|MLST_RES|TXRQ_RES|RMPD_RES), iMSGCTL1); @@ -416,6 +416,19 @@ int i82527_stop_chip(struct canchip_t *chip) return 0; } +int i82527_attach_to_chip(struct canchip_t *chip) +{ + return 0; +} + +int i82527_release_chip(struct canchip_t *chip) +{ + i82527_stop_chip(chip); + can_write_reg(chip, (iCTL_CCE|iCTL_INI), iCTL); + + return 0; +} + static inline void i82527_irq_write_handler(struct canchip_t *chip, struct msgobj_t *obj) { @@ -603,6 +616,8 @@ void i82527_irq_sync_activities(struct canchip_t *chip, struct msgobj_t *obj) } } + mb(); + can_msgobj_clear_fl(obj,TX_LOCK); if(can_msgobj_test_fl(obj,TX_REQUEST)) continue; @@ -650,7 +665,7 @@ int i82527_irq_handler(int irq, struct canchip_t *chip) if (irq_register == 0x02) object = 14; - else if(irq_register < 14) + else if(irq_register <= 13+3) object = irq_register-3; else return CANCHIP_IRQ_NONE; @@ -752,6 +767,8 @@ int i82527_register(struct chipspecops_t *chipspecops) chipspecops->enable_configuration = i82527_enable_configuration; chipspecops->disable_configuration = i82527_disable_configuration; chipspecops->set_btregs = i82527_set_btregs; + chipspecops->attach_to_chip = i82527_attach_to_chip; + chipspecops->release_chip = i82527_release_chip; chipspecops->start_chip = i82527_start_chip; chipspecops->stop_chip = i82527_stop_chip; chipspecops->irq_handler = i82527_irq_handler;