Commit d0fd3199 authored by Armin Schindler's avatar Armin Schindler Committed by Linus Torvalds

[PATCH] eicon ISDN driver: capi code fix

Fix application memory allocation, module locking,
building in-kernel, use new internal debug api.
parent c6a2a080
This diff is collapsed.
/* $Id: capifunc.h,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $
/* $Id: capifunc.h,v 1.10 2003/08/25 10:06:37 schindler Exp $
*
* ISDN interface module for Eicon active cards DIVA.
* CAPI Interface common functions
*
* Copyright 2000-2002 by Armin Schindler (mac@melware.de)
* Copyright 2000-2002 Cytronics & Melware (info@melware.de)
* Copyright 2000-2003 by Armin Schindler (mac@melware.de)
* Copyright 2000-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.
......@@ -21,7 +21,7 @@
#define M_COMPANY "Eicon Networks"
extern char DRIVERRELEASE[];
extern char DRIVERRELEASE_CAPI[];
typedef struct _diva_card {
int Id;
......
/* $Id: capimain.c,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $
/* $Id: capimain.c,v 1.24 2003/09/09 06:51:05 schindler Exp $
*
* ISDN interface module for Eicon active cards DIVA.
* CAPI Interface
*
* Copyright 2000-2002 by Armin Schindler (mac@melware.de)
* Copyright 2000-2002 Cytronics & Melware (info@melware.de)
* Copyright 2000-2003 by Armin Schindler (mac@melware.de)
* Copyright 2000-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.
......@@ -15,10 +15,7 @@
#include <linux/init.h>
#include <asm/uaccess.h>
#include <linux/smp_lock.h>
#include <linux/vmalloc.h>
#include <linux/sched.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include "os_capi.h"
......@@ -29,7 +26,7 @@
#include "cp_vers.h"
#include "capifunc.h"
static char *main_revision = "$Revision: 1.1.2.11 $";
static char *main_revision = "$Revision: 1.24 $";
static char *DRIVERNAME =
"Eicon DIVA - CAPI Interface driver (http://www.melware.net)";
static char *DRIVERLNAME = "divacapi";
......@@ -56,47 +53,6 @@ static char *getrev(const char *revision)
}
/*
* sleep for some milliseconds
*/
void diva_os_sleep(dword mSec)
{
unsigned long timeout = HZ * mSec / 1000 + 1;
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(timeout);
}
/*
* wait for some milliseconds
*/
void diva_os_wait(dword mSec)
{
mdelay(mSec);
}
/*
* alloc memory
*/
void *diva_os_malloc(unsigned long flags, unsigned long size)
{
void *ret = NULL;
if (size) {
ret = (void *) vmalloc((unsigned int) size);
}
return (ret);
}
/*
* free memory
*/
void diva_os_free(unsigned long unused, void *ptr)
{
if (ptr) {
vfree(ptr);
}
}
/*
* alloc a message buffer
*/
......@@ -160,11 +116,11 @@ static int DIVA_INIT_FUNCTION divacapi_init(void)
char tmprev[32];
int ret = 0;
sprintf(DRIVERRELEASE, "%d.%d%s", DRRELMAJOR, DRRELMINOR,
sprintf(DRIVERRELEASE_CAPI, "%d.%d%s", DRRELMAJOR, DRRELMINOR,
DRRELEXTRA);
printk(KERN_INFO "%s\n", DRIVERNAME);
printk(KERN_INFO "%s: Rel:%s Rev:", DRIVERLNAME, DRIVERRELEASE);
printk(KERN_INFO "%s: Rel:%s Rev:", DRIVERLNAME, DRIVERRELEASE_CAPI);
strcpy(tmprev, main_revision);
printk("%s Build: %s(%s)\n", getrev(tmprev),
diva_capi_common_code_build, DIVA_BUILD);
......
......@@ -3590,7 +3590,7 @@ byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * p
{
if (plci->channels)
{
for (ncci = 1; ncci < MAX_NCCI+1; i++)
for (ncci = 1; ncci < MAX_NCCI+1; ncci++)
{
if ((a->ncci_plci[ncci] == plci->Id) && (a->ncci_state[ncci] == CONNECTED))
{
......
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