]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ISDN Eicon driver: remove call to trap usermode helper
authorAndrew Morton <akpm@osdl.org>
Mon, 26 Apr 2004 16:02:25 +0000 (09:02 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 26 Apr 2004 16:02:25 +0000 (09:02 -0700)
From: Armin Schindler <armin@melware.de>

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.

drivers/isdn/hardware/eicon/divasfunc.c
drivers/isdn/hardware/eicon/divasmain.c

index 4d7a0a5abefaba51333425ceadc4981c86317bfc..52385931f3a46df119cecd4faf486368fae32573 100644 (file)
@@ -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_ADAPTER];
 
 #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 card)
                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;
        }
 }
 
index 1706c06a0c4dd87c6ba3aaee8d4a5821c848866e..d3b93f855e5dc0e38102b6bfbeec8eb4c72369a0 100644 (file)
@@ -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;
 
 /* --------------------------------------------------------------------------
@@ -205,54 +203,6 @@ void divas_get_version(char *p)
                getrev(tmprev), diva_xdi_common_code_build, DIVA_BUILD, major);
 }
 
-/* --------------------------------------------------------------------------
-    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  
    -------------------------------------------------------------------------- */
@@ -574,7 +524,6 @@ int diva_os_initialize_soft_isr(diva_os_soft_isr_t * psoft_isr,
        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);