Commit 7ee49b42 authored by Armin Schindler's avatar Armin Schindler Committed by Linus Torvalds

[PATCH] ISDN Eicon driver: move workqueue to tasklet for divas dpc

Use tasklet instead of workqueue for the divas main dpc.
parent c561747e
/* $Id: divasmain.c,v 1.48 2004/02/24 17:46:28 armin Exp $ /* $Id: divasmain.c,v 1.51 2004/03/20 20:47:08 armin Exp $
* *
* Low level driver for Eicon DIVA Server ISDN cards. * Low level driver for Eicon DIVA Server ISDN cards.
* *
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "diva_dma.h" #include "diva_dma.h"
#include "diva_pci.h" #include "diva_pci.h"
static char *main_revision = "$Revision: 1.48 $"; static char *main_revision = "$Revision: 1.51 $";
static int major; static int major;
...@@ -69,7 +69,7 @@ extern int divasfunc_init(int dbgmask); ...@@ -69,7 +69,7 @@ extern int divasfunc_init(int dbgmask);
extern void divasfunc_exit(void); extern void divasfunc_exit(void);
typedef struct _diva_os_thread_dpc { typedef struct _diva_os_thread_dpc {
struct work_struct divas_task; struct tasklet_struct divas_task;
struct work_struct trap_script_task; struct work_struct trap_script_task;
diva_os_soft_isr_t *psoft_isr; diva_os_soft_isr_t *psoft_isr;
int card_failed; int card_failed;
...@@ -552,7 +552,7 @@ void diva_os_remove_irq(void *context, byte irq) ...@@ -552,7 +552,7 @@ void diva_os_remove_irq(void *context, byte irq)
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
DPC framework implementation DPC framework implementation
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void diva_os_dpc_proc(void *context) static void diva_os_dpc_proc(unsigned long context)
{ {
diva_os_thread_dpc_t *psoft_isr = (diva_os_thread_dpc_t *) context; diva_os_thread_dpc_t *psoft_isr = (diva_os_thread_dpc_t *) context;
diva_os_soft_isr_t *pisr = psoft_isr->psoft_isr; diva_os_soft_isr_t *pisr = psoft_isr->psoft_isr;
...@@ -575,7 +575,7 @@ int diva_os_initialize_soft_isr(diva_os_soft_isr_t * psoft_isr, ...@@ -575,7 +575,7 @@ int diva_os_initialize_soft_isr(diva_os_soft_isr_t * psoft_isr,
psoft_isr->callback_context = callback_context; psoft_isr->callback_context = callback_context;
pdpc->psoft_isr = psoft_isr; pdpc->psoft_isr = psoft_isr;
INIT_WORK(&pdpc->trap_script_task, diva_adapter_trapped, pdpc); INIT_WORK(&pdpc->trap_script_task, diva_adapter_trapped, pdpc);
INIT_WORK(&pdpc->divas_task, diva_os_dpc_proc, pdpc); tasklet_init(&pdpc->divas_task, diva_os_dpc_proc, (unsigned long)pdpc);
return (0); return (0);
} }
...@@ -586,7 +586,7 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr) ...@@ -586,7 +586,7 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr)
diva_os_thread_dpc_t *pdpc = diva_os_thread_dpc_t *pdpc =
(diva_os_thread_dpc_t *) psoft_isr->object; (diva_os_thread_dpc_t *) psoft_isr->object;
schedule_work(&pdpc->divas_task); tasklet_schedule(&pdpc->divas_task);
} }
return (1); return (1);
...@@ -594,14 +594,22 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr) ...@@ -594,14 +594,22 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr)
int diva_os_cancel_soft_isr(diva_os_soft_isr_t * psoft_isr) int diva_os_cancel_soft_isr(diva_os_soft_isr_t * psoft_isr)
{ {
if (psoft_isr && psoft_isr->object) {
diva_os_thread_dpc_t *pdpc =
(diva_os_thread_dpc_t *) psoft_isr->object;
tasklet_kill(&pdpc->divas_task);
}
return (0); return (0);
} }
void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr) void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr)
{ {
if (psoft_isr && psoft_isr->object) { if (psoft_isr && psoft_isr->object) {
diva_os_thread_dpc_t *pdpc =
(diva_os_thread_dpc_t *) psoft_isr->object;
void *mem; void *mem;
tasklet_kill(&pdpc->divas_task);
flush_scheduled_work(); flush_scheduled_work();
mem = psoft_isr->object; mem = psoft_isr->object;
psoft_isr->object = 0; psoft_isr->object = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment