Commit 4a99dc71 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ISDN Eicon driver: remove call to trap usermode helper

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.
parent 6d576c06
/* $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;
}
}
......
/* $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);
......
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