diff options
author | Yunhong Jiang <yunhong.jiang@intel.com> | 2015-08-04 12:17:53 -0700 |
---|---|---|
committer | Yunhong Jiang <yunhong.jiang@intel.com> | 2015-08-04 15:44:42 -0700 |
commit | 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (patch) | |
tree | 1c9cafbcd35f783a87880a10f85d1a060db1a563 /kernel/drivers/isdn/hardware/eicon/diddfunc.c | |
parent | 98260f3884f4a202f9ca5eabed40b1354c489b29 (diff) |
Add the rt linux 4.1.3-rt3 as base
Import the rt linux 4.1.3-rt3 as OPNFV kvm base.
It's from git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt and
the base is:
commit 0917f823c59692d751951bf5ea699a2d1e2f26a2
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Sat Jul 25 12:13:34 2015 +0200
Prepare v4.1.3-rt3
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
We lose all the git history this way and it's not good. We
should apply another opnfv project repo in future.
Change-Id: I87543d81c9df70d99c5001fbdf646b202c19f423
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Diffstat (limited to 'kernel/drivers/isdn/hardware/eicon/diddfunc.c')
-rw-r--r-- | kernel/drivers/isdn/hardware/eicon/diddfunc.c | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/kernel/drivers/isdn/hardware/eicon/diddfunc.c b/kernel/drivers/isdn/hardware/eicon/diddfunc.c new file mode 100644 index 000000000..b0b23ed8b --- /dev/null +++ b/kernel/drivers/isdn/hardware/eicon/diddfunc.c @@ -0,0 +1,115 @@ +/* $Id: diddfunc.c,v 1.14.6.2 2004/08/28 20:03:53 armin Exp $ + * + * DIDD Interface module for Eicon active cards. + * + * Functions are in dadapter.c + * + * Copyright 2002-2003 by Armin Schindler (mac@melware.de) + * Copyright 2002-2003 Cytronics & Melware (info@melware.de) + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. + */ + +#include "platform.h" +#include "di_defs.h" +#include "dadapter.h" +#include "divasync.h" + +#define DBG_MINIMUM (DL_LOG + DL_FTL + DL_ERR) +#define DBG_DEFAULT (DBG_MINIMUM + DL_XLOG + DL_REG) + + +extern void DIVA_DIDD_Read(void *, int); +extern char *DRIVERRELEASE_DIDD; +static dword notify_handle; +static DESCRIPTOR _DAdapter; + +/* + * didd callback function + */ +static void *didd_callback(void *context, DESCRIPTOR *adapter, + int removal) +{ + if (adapter->type == IDI_DADAPTER) { + DBG_ERR(("Notification about IDI_DADAPTER change ! Oops.")) + return (NULL); + } else if (adapter->type == IDI_DIMAINT) { + if (removal) { + DbgDeregister(); + } else { + DbgRegister("DIDD", DRIVERRELEASE_DIDD, DBG_DEFAULT); + } + } + return (NULL); +} + +/* + * connect to didd + */ +static int __init connect_didd(void) +{ + int x = 0; + int dadapter = 0; + IDI_SYNC_REQ req; + DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS]; + + DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table)); + + for (x = 0; x < MAX_DESCRIPTORS; x++) { + if (DIDD_Table[x].type == IDI_DADAPTER) { /* DADAPTER found */ + dadapter = 1; + memcpy(&_DAdapter, &DIDD_Table[x], sizeof(_DAdapter)); + req.didd_notify.e.Req = 0; + req.didd_notify.e.Rc = + IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; + req.didd_notify.info.callback = (void *)didd_callback; + req.didd_notify.info.context = NULL; + _DAdapter.request((ENTITY *)&req); + if (req.didd_notify.e.Rc != 0xff) + return (0); + notify_handle = req.didd_notify.info.handle; + } else if (DIDD_Table[x].type == IDI_DIMAINT) { /* MAINT found */ + DbgRegister("DIDD", DRIVERRELEASE_DIDD, DBG_DEFAULT); + } + } + return (dadapter); +} + +/* + * disconnect from didd + */ +static void __exit disconnect_didd(void) +{ + IDI_SYNC_REQ req; + + req.didd_notify.e.Req = 0; + req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY; + req.didd_notify.info.handle = notify_handle; + _DAdapter.request((ENTITY *)&req); +} + +/* + * init + */ +int __init diddfunc_init(void) +{ + diva_didd_load_time_init(); + + if (!connect_didd()) { + DBG_ERR(("init: failed to connect to DIDD.")) + diva_didd_load_time_finit(); + return (0); + } + return (1); +} + +/* + * finit + */ +void __exit diddfunc_finit(void) +{ + DbgDeregister(); + disconnect_didd(); + diva_didd_load_time_finit(); +} |