]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/sja1000p.c
Added attach_to_chip() and release_chip() functions for each chip.
[lincan.git] / lincan / src / sja1000p.c
index 5deedc617d048edea6fa4edf754464ff908397c3..216a9b904b8f755c8a5c4a91795c1489c3f1629d 100644 (file)
@@ -486,6 +486,32 @@ int sja1000p_stop_chip(struct canchip_t *chip)
        return 0;
 }
 
+/**
+ * sja1000p_attach_to_chip: - attaches to the chip, setups registers and state
+ * @chip: pointer to chip state structure
+ *
+ * Return Value: negative value reports error.
+ * File: src/sja1000p.c
+ */
+int sja1000p_attach_to_chip(struct canchip_t *chip)
+{
+       return 0;
+}
+
+/**
+ * sja1000p_release_chip: - called before chip structure removal if %CHIP_ATTACHED is set
+ * @chip: pointer to chip state structure
+ *
+ * Return Value: negative value reports error.
+ * File: src/sja1000p.c
+ */
+int sja1000p_release_chip(struct canchip_t *chip)
+{
+       sja1000p_stop_chip(chip);
+       can_write_reg(chip, sjaDISABLE_INTERRUPTS, SJAIER);
+
+       return 0;
+}
 
 /**
  * sja1000p_remote_request: - configures message object and asks for RTR message
@@ -599,10 +625,7 @@ void sja1000p_irq_write_handler(struct canchip_t *chip, struct msgobj_t *obj)
 /**
  * sja1000p_irq_handler: - interrupt service routine
  * @irq: interrupt vector number, this value is system specific
- * @dev_id: driver private pointer registered at time of request_irq() call.
- *     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
+ * @chip: pointer to chip state structure
  * 
  * 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
@@ -749,10 +772,13 @@ int sja1000p_register(struct chipspecops_t *chipspecops)
        chipspecops->remote_request=sja1000p_remote_request;
        chipspecops->enable_configuration=sja1000p_enable_configuration;
        chipspecops->disable_configuration=sja1000p_disable_configuration;
+       chipspecops->attach_to_chip=sja1000p_attach_to_chip;
+       chipspecops->release_chip=sja1000p_release_chip;
        chipspecops->set_btregs=sja1000p_set_btregs;
        chipspecops->start_chip=sja1000p_start_chip;
        chipspecops->stop_chip=sja1000p_stop_chip;
        chipspecops->irq_handler=sja1000p_irq_handler;
+       chipspecops->irq_accept=NULL;
        return 0;
 }