From ce9505f94bf87d40caeed0b0452e39f95ed521b1 Mon Sep 17 00:00:00 2001 From: ppisa Date: Thu, 3 Feb 2005 15:38:46 +0000 Subject: [PATCH] Added CAN chip specific irq_accept routine for fast interrupt acknowledge. Required to prepare space for solution of problem with multiple VME Unican cards used with RT-Linux enabled LinCAN driver. --- lincan/include/can_queue.h | 4 ++-- lincan/include/main.h | 2 ++ lincan/src/c_can.c | 1 + lincan/src/i82527.c | 1 + lincan/src/setup.c | 10 ++++++++++ lincan/src/sja1000.c | 1 + lincan/src/sja1000p.c | 6 ++---- lincan/src/unican.c | 1 + lincan/src/unican_vme.c | 2 +- lincan/src/virtual.c | 1 + 10 files changed, 22 insertions(+), 7 deletions(-) diff --git a/lincan/include/can_queue.h b/lincan/include/can_queue.h index 8593346..42eeef4 100644 --- a/lincan/include/can_queue.h +++ b/lincan/include/can_queue.h @@ -545,7 +545,7 @@ void canque_edge_do_dead(struct canque_edge_t *edge); /** * canque_edge_incref - increments edge reference count - * @qedg: pointer to the edge structure + * @edge: pointer to the edge structure */ static inline void canque_edge_incref(struct canque_edge_t *edge) @@ -599,7 +599,7 @@ void __canque_edge_decref_body(struct canque_edge_t *edge) #ifndef CAN_HAVE_ARCH_CMPXCHG /** * canque_edge_decref - decrements edge reference count - * @qedg: pointer to the edge structure + * @edge: pointer to the edge structure * * This function has to be called without lock held for both ends of edge. * If reference count drops to 0, function canque_edge_do_dead() diff --git a/lincan/include/main.h b/lincan/include/main.h index 0a12ffe..be2534b 100644 --- a/lincan/include/main.h +++ b/lincan/include/main.h @@ -323,6 +323,7 @@ struct hwspecops_t { * @start_chip: starts chip message processing * @stop_chip: stops chip message processing * @irq_handler: interrupt service routine + * @irq_accept: optional fast irq accept routine responsible for blocking further interrupts */ struct chipspecops_t { int (*chip_config)(struct canchip_t *chip); @@ -352,6 +353,7 @@ struct chipspecops_t { int (*start_chip)(struct canchip_t *chip); int (*stop_chip)(struct canchip_t *chip); int (*irq_handler)(int irq, struct canchip_t *chip); + int (*irq_accept)(int irq, struct canchip_t *chip); }; struct mem_addr { diff --git a/lincan/src/c_can.c b/lincan/src/c_can.c index 94456bb..0efc91f 100644 --- a/lincan/src/c_can.c +++ b/lincan/src/c_can.c @@ -909,6 +909,7 @@ int c_can_register(struct chipspecops_t *chipspecops) chipspecops->start_chip=c_can_start_chip; chipspecops->stop_chip=c_can_stop_chip; chipspecops->irq_handler=c_can_irq_handler; + chipspecops->irq_accept = NULL; return 0; } diff --git a/lincan/src/i82527.c b/lincan/src/i82527.c index 66bdc55..7834c1b 100644 --- a/lincan/src/i82527.c +++ b/lincan/src/i82527.c @@ -755,6 +755,7 @@ int i82527_register(struct chipspecops_t *chipspecops) chipspecops->start_chip = i82527_start_chip; chipspecops->stop_chip = i82527_stop_chip; chipspecops->irq_handler = i82527_irq_handler; + chipspecops->irq_accept = NULL; return 0; } diff --git a/lincan/src/setup.c b/lincan/src/setup.c index 9c4af76..167ec2b 100644 --- a/lincan/src/setup.c +++ b/lincan/src/setup.c @@ -568,6 +568,16 @@ int init_hwspecops(struct candevice_t *candev, int *irqnum_p) #ifndef CAN_WITH_RTL +/** + * can_default_irq_dispatch - the first level interrupt dispatch handler + * @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 + * + * File: src/setup.c + */ can_irqreturn_t can_default_irq_dispatch(int irq, void *dev_id, struct pt_regs *regs) { int retval; diff --git a/lincan/src/sja1000.c b/lincan/src/sja1000.c index 127c453..d43de2f 100644 --- a/lincan/src/sja1000.c +++ b/lincan/src/sja1000.c @@ -500,6 +500,7 @@ int sja1000_register(struct chipspecops_t *chipspecops) chipspecops->start_chip = sja1000_start_chip; chipspecops->stop_chip = sja1000_stop_chip; chipspecops->irq_handler = sja1000_irq_handler; + chipspecops->irq_handler = NULL; return 0; } diff --git a/lincan/src/sja1000p.c b/lincan/src/sja1000p.c index 5deedc6..70a99c4 100644 --- a/lincan/src/sja1000p.c +++ b/lincan/src/sja1000p.c @@ -599,10 +599,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 @@ -753,6 +750,7 @@ int sja1000p_register(struct chipspecops_t *chipspecops) chipspecops->start_chip=sja1000p_start_chip; chipspecops->stop_chip=sja1000p_stop_chip; chipspecops->irq_handler=sja1000p_irq_handler; + chipspecops->irq_accept=NULL; return 0; } diff --git a/lincan/src/unican.c b/lincan/src/unican.c index d93063a..4efabc8 100644 --- a/lincan/src/unican.c +++ b/lincan/src/unican.c @@ -797,6 +797,7 @@ int unican_init_chip_data(struct candevice_t *candev, int chipnr) chip->chipspecops->start_chip=unican_start_chip; chip->chipspecops->stop_chip=unican_stop_chip; chip->chipspecops->irq_handler=unican_irq_handler; + chip->chipspecops->irq_accept=NULL; return 0; } diff --git a/lincan/src/unican_vme.c b/lincan/src/unican_vme.c index a4f9c05..e69694c 100644 --- a/lincan/src/unican_vme.c +++ b/lincan/src/unican_vme.c @@ -46,7 +46,7 @@ int unican_vme_init_chip_data(struct candevice_t *candev, int chipnr) unican_init_chip_data(candev, chipnr); chip->flags |= CHIP_IRQ_VME; - chip->chipspecops->irq_handler=unican_irq_handler; + /*chip->chipspecops->irq_handler=unican_irq_handler;*/ return 0; } diff --git a/lincan/src/virtual.c b/lincan/src/virtual.c index 1281885..3b300a9 100644 --- a/lincan/src/virtual.c +++ b/lincan/src/virtual.c @@ -477,6 +477,7 @@ int virtual_init_chip_data(struct candevice_t *candev, int chipnr) chip->chipspecops->start_chip=virtual_start_chip; chip->chipspecops->stop_chip=virtual_stop_chip; chip->chipspecops->irq_handler=NULL; + chip->chipspecops->irq_accept=NULL; return 0; } -- 2.39.2