From: Armin Schindler This patch removes the function to call a usermode helper if the hardware and its firmware has a problem. This feature is already implemented in the user utility and the driver does not need to care about it. --- 25-akpm/drivers/isdn/hardware/eicon/divasfunc.c | 7 --- 25-akpm/drivers/isdn/hardware/eicon/divasmain.c | 55 ------------------------ 2 files changed, 4 insertions(+), 58 deletions(-) diff -puN drivers/isdn/hardware/eicon/divasfunc.c~26-isdn-eicon-driver-remove-call-to-trap-usermode-helper drivers/isdn/hardware/eicon/divasfunc.c --- 25/drivers/isdn/hardware/eicon/divasfunc.c~26-isdn-eicon-driver-remove-call-to-trap-usermode-helper 2004-04-23 03:59:58.783084496 -0700 +++ 25-akpm/drivers/isdn/hardware/eicon/divasfunc.c 2004-04-23 03:59:58.816079480 -0700 @@ -1,4 +1,4 @@ -/* $Id: divasfunc.c,v 1.22 2003/09/09 06:46:29 schindler Exp $ +/* $Id: divasfunc.c,v 1.23 2004/04/08 01:17:57 armin Exp $ * * Low level driver for Eicon DIVA Server ISDN cards. * @@ -29,7 +29,6 @@ extern PISDN_ADAPTER IoAdapters[MAX_ADAP #define MAX_DESCRIPTORS 32 -extern void diva_run_trap_script(PISDN_ADAPTER IoAdapter, dword ANum); extern char *DRIVERRELEASE_DIVAS; static dword notify_handle; @@ -87,10 +86,8 @@ void diva_xdi_didd_register_adapter(int DAdapter.request((ENTITY *) & req); if (req.didd_add_adapter.e.Rc != 0xff) { DBG_ERR(("DIDD register A(%d) failed !", card)) - } else { - IoAdapters[card - 1]->os_trap_nfy_Fnc = - diva_run_trap_script; } + IoAdapters[card - 1]->os_trap_nfy_Fnc = NULL; } } diff -puN drivers/isdn/hardware/eicon/divasmain.c~26-isdn-eicon-driver-remove-call-to-trap-usermode-helper drivers/isdn/hardware/eicon/divasmain.c --- 25/drivers/isdn/hardware/eicon/divasmain.c~26-isdn-eicon-driver-remove-call-to-trap-usermode-helper 2004-04-23 03:59:58.784084344 -0700 +++ 25-akpm/drivers/isdn/hardware/eicon/divasmain.c 2004-04-23 03:59:58.817079328 -0700 @@ -1,4 +1,4 @@ -/* $Id: divasmain.c,v 1.54 2004/04/02 18:59:22 armin Exp $ +/* $Id: divasmain.c,v 1.55 2004/04/08 01:17:58 armin Exp $ * * Low level driver for Eicon DIVA Server ISDN cards. * @@ -41,7 +41,7 @@ #include "diva_dma.h" #include "diva_pci.h" -static char *main_revision = "$Revision: 1.54 $"; +static char *main_revision = "$Revision: 1.55 $"; static int major; @@ -70,9 +70,7 @@ extern void divasfunc_exit(void); typedef struct _diva_os_thread_dpc { struct tasklet_struct divas_task; - struct work_struct trap_script_task; diva_os_soft_isr_t *psoft_isr; - int card_failed; } diva_os_thread_dpc_t; /* -------------------------------------------------------------------------- @@ -206,54 +204,6 @@ void divas_get_version(char *p) } /* -------------------------------------------------------------------------- - Nonify user mode helper about card failure - -------------------------------------------------------------------------- */ -#define TRAP_PROG "/usr/sbin/divas_trap.rc" - -static void diva_adapter_trapped(void *context) -{ - diva_os_thread_dpc_t *pdpc = (diva_os_thread_dpc_t *) context; - - if (pdpc && pdpc->card_failed) { - char *envp[] = { "HOME=/", - "TERM=linux", - "PATH=/usr/sbin:/sbin:/bin:/usr/bin", 0 - }; - char *argv[] = { TRAP_PROG, "trap", 0, 0 }; - char adapter[8]; - int ret; - - sprintf(adapter, "%d", pdpc->card_failed - 1); - pdpc->card_failed = 0; - argv[2] = &adapter[0]; - - ret = call_usermodehelper(argv[0], argv, envp, 0); - - if (ret) { - printk(KERN_ERR - "%s: couldn't start trap script, errno %d\n", - DRIVERLNAME, ret); - } - } -} - -/* - * run the trap script - */ -void diva_run_trap_script(PISDN_ADAPTER IoAdapter, dword ANum) -{ - diva_os_soft_isr_t *psoft_isr = &IoAdapter->isr_soft_isr; - diva_os_thread_dpc_t *context = - (diva_os_thread_dpc_t *) psoft_isr->object; - - if (context && !context->card_failed) { - printk(KERN_ERR "%s: adapter %d trapped !\n", DRIVERLNAME, ANum + 1); - context->card_failed = ANum + 1; - schedule_work(&context->trap_script_task); - } -} - -/* -------------------------------------------------------------------------- PCI Bus services -------------------------------------------------------------------------- */ byte diva_os_get_pci_bus(void *pci_dev_handle) @@ -574,7 +524,6 @@ int diva_os_initialize_soft_isr(diva_os_ psoft_isr->callback = callback; psoft_isr->callback_context = callback_context; pdpc->psoft_isr = psoft_isr; - INIT_WORK(&pdpc->trap_script_task, diva_adapter_trapped, pdpc); tasklet_init(&pdpc->divas_task, diva_os_dpc_proc, (unsigned long)pdpc); return (0); _