Commit b11523f3 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-isdn.bkbits.net/linux-2.5.isdn

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 7fda910b 27bd1b5e
...@@ -41,7 +41,9 @@ config ISDN ...@@ -41,7 +41,9 @@ config ISDN
Therefore the old ISDN4Linux layer is becoming obsolete. It is Therefore the old ISDN4Linux layer is becoming obsolete. It is
still usable, though, if you select this option. still usable, though, if you select this option.
if ISDN
source "drivers/isdn/i4l/Kconfig" source "drivers/isdn/i4l/Kconfig"
endif
endmenu endmenu
......
...@@ -12,7 +12,7 @@ config CAPI_AVM ...@@ -12,7 +12,7 @@ config CAPI_AVM
config ISDN_DRV_AVMB1_B1ISA config ISDN_DRV_AVMB1_B1ISA
tristate "AVM B1 ISA support" tristate "AVM B1 ISA support"
depends on CAPI_AVM && ISDN_CAPI && SA depends on CAPI_AVM && ISDN_CAPI && ISA
help help
Enable support for the ISA version of the AVM B1 card. Enable support for the ISA version of the AVM B1 card.
......
...@@ -15,4 +15,3 @@ typedef struct _diva_um_idi_adapter { ...@@ -15,4 +15,3 @@ typedef struct _diva_um_idi_adapter {
#endif #endif
This diff is collapsed.
...@@ -31,20 +31,20 @@ ...@@ -31,20 +31,20 @@
EXPORT_NO_SYMBOLS; EXPORT_NO_SYMBOLS;
static char *main_revision = "$Revision: 1.1.2.2 $"; static char *main_revision = "$Revision: 1.1.2.11 $";
static char *DRIVERNAME = "Eicon DIVA - CAPI Interface driver (http://www.melware.net)"; static char *DRIVERNAME =
"Eicon DIVA - CAPI Interface driver (http://www.melware.net)";
static char *DRIVERLNAME = "divacapi"; static char *DRIVERLNAME = "divacapi";
MODULE_DESCRIPTION( "CAPI driver for Eicon DIVA cards"); MODULE_DESCRIPTION("CAPI driver for Eicon DIVA cards");
MODULE_AUTHOR( "Cytronics & Melware, Eicon Networks"); MODULE_AUTHOR("Cytronics & Melware, Eicon Networks");
MODULE_SUPPORTED_DEVICE( "CAPI and DIVA card drivers"); MODULE_SUPPORTED_DEVICE("CAPI and DIVA card drivers");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /*
* get revision number from revision string * get revision number from revision string
*/ */
static char * static char *getrev(const char *revision)
getrev(const char *revision)
{ {
char *rev; char *rev;
char *p; char *p;
...@@ -52,7 +52,8 @@ getrev(const char *revision) ...@@ -52,7 +52,8 @@ getrev(const char *revision)
rev = p + 2; rev = p + 2;
p = strchr(rev, '$'); p = strchr(rev, '$');
*--p = 0; *--p = 0;
} else rev = "1.0"; } else
rev = "1.0";
return rev; return rev;
} }
...@@ -60,8 +61,7 @@ getrev(const char *revision) ...@@ -60,8 +61,7 @@ getrev(const char *revision)
/* /*
* sleep for some milliseconds * sleep for some milliseconds
*/ */
void void diva_os_sleep(dword mSec)
diva_os_sleep (dword mSec)
{ {
unsigned long timeout = HZ * mSec / 1000 + 1; unsigned long timeout = HZ * mSec / 1000 + 1;
...@@ -72,28 +72,27 @@ diva_os_sleep (dword mSec) ...@@ -72,28 +72,27 @@ diva_os_sleep (dword mSec)
/* /*
* wait for some milliseconds * wait for some milliseconds
*/ */
void void diva_os_wait(dword mSec)
diva_os_wait (dword mSec)
{ {
mdelay (mSec); mdelay(mSec);
} }
/* /*
* alloc memory * alloc memory
*/ */
void* diva_os_malloc (unsigned long flags, unsigned long size) void *diva_os_malloc(unsigned long flags, unsigned long size)
{ {
void* ret = NULL; void *ret = NULL;
if (size) { if (size) {
ret = (void *)vmalloc((unsigned int)size); ret = (void *) vmalloc((unsigned int) size);
} }
return(ret); return (ret);
} }
/* /*
* free memory * free memory
*/ */
void diva_os_free(unsigned long unused, void* ptr) void diva_os_free(unsigned long unused, void *ptr)
{ {
if (ptr) { if (ptr) {
vfree(ptr); vfree(ptr);
...@@ -103,20 +102,20 @@ void diva_os_free(unsigned long unused, void* ptr) ...@@ -103,20 +102,20 @@ void diva_os_free(unsigned long unused, void* ptr)
/* /*
* alloc a message buffer * alloc a message buffer
*/ */
diva_os_message_buffer_s * diva_os_message_buffer_s *diva_os_alloc_message_buffer(unsigned long size,
diva_os_alloc_message_buffer(unsigned long size, void **data_buf) void **data_buf)
{ {
diva_os_message_buffer_s *dmb = alloc_skb(size, GFP_ATOMIC); diva_os_message_buffer_s *dmb = alloc_skb(size, GFP_ATOMIC);
if (dmb) { if (dmb) {
*data_buf = skb_put(dmb, size); *data_buf = skb_put(dmb, size);
} }
return(dmb); return (dmb);
} }
/* /*
* free a message buffer * free a message buffer
*/ */
void diva_os_free_message_buffer(diva_os_message_buffer_s *dmb) void diva_os_free_message_buffer(diva_os_message_buffer_s * dmb)
{ {
kfree_skb(dmb); kfree_skb(dmb);
} }
...@@ -124,22 +123,23 @@ void diva_os_free_message_buffer(diva_os_message_buffer_s *dmb) ...@@ -124,22 +123,23 @@ void diva_os_free_message_buffer(diva_os_message_buffer_s *dmb)
/* /*
* proc function for controller info * proc function for controller info
*/ */
static int diva_ctl_read_proc(char *page, char **start, off_t off,int count, int *eof, struct capi_ctr *ctrl) static int diva_ctl_read_proc(char *page, char **start, off_t off,
int count, int *eof, struct capi_ctr *ctrl)
{ {
diva_card *card = (diva_card *)ctrl->driverdata; diva_card *card = (diva_card *) ctrl->driverdata;
int len = 0; int len = 0;
len += sprintf(page+len, "%s\n", ctrl->name); len += sprintf(page + len, "%s\n", ctrl->name);
len += sprintf(page+len, "Serial No. : %s\n", ctrl->serial); len += sprintf(page + len, "Serial No. : %s\n", ctrl->serial);
len += sprintf(page+len, "Id : %d\n", card->Id); len += sprintf(page + len, "Id : %d\n", card->Id);
len += sprintf(page+len, "Channels : %d\n", card->d.channels); len += sprintf(page + len, "Channels : %d\n", card->d.channels);
if (off + count >= len) if (off + count >= len)
*eof = 1; *eof = 1;
if (len < off) if (len < off)
return 0; return 0;
*start = page + off; *start = page + off;
return((count < len-off) ? count : len-off); return ((count < len - off) ? count : len - off);
} }
/* /*
...@@ -157,15 +157,15 @@ void diva_os_set_controller_struct(struct capi_ctr *ctrl) ...@@ -157,15 +157,15 @@ void diva_os_set_controller_struct(struct capi_ctr *ctrl)
/* /*
* module init * module init
*/ */
static int DIVA_INIT_FUNCTION static int DIVA_INIT_FUNCTION divacapi_init(void)
divacapi_init(void)
{ {
char tmprev[32]; char tmprev[32];
int ret = 0; int ret = 0;
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
sprintf(DRIVERRELEASE, "%d.%d%s", DRRELMAJOR, DRRELMINOR, DRRELEXTRA); sprintf(DRIVERRELEASE, "%d.%d%s", DRRELMAJOR, DRRELMINOR,
DRRELEXTRA);
printk(KERN_INFO "%s\n", DRIVERNAME); printk(KERN_INFO "%s\n", DRIVERNAME);
printk(KERN_INFO "%s: Rel:%s Rev:", DRIVERLNAME, DRIVERRELEASE); printk(KERN_INFO "%s: Rel:%s Rev:", DRIVERLNAME, DRIVERRELEASE);
...@@ -173,9 +173,9 @@ divacapi_init(void) ...@@ -173,9 +173,9 @@ divacapi_init(void)
printk("%s Build: %s(%s)\n", getrev(tmprev), printk("%s Build: %s(%s)\n", getrev(tmprev),
diva_capi_common_code_build, DIVA_BUILD); diva_capi_common_code_build, DIVA_BUILD);
if (!(init_capifunc())) if (!(init_capifunc())) {
{ printk(KERN_ERR "%s: failed init capi_driver.\n",
printk(KERN_ERR "%s: failed init capi_driver.\n", DRIVERLNAME); DRIVERLNAME);
ret = -EIO; ret = -EIO;
} }
...@@ -186,8 +186,7 @@ divacapi_init(void) ...@@ -186,8 +186,7 @@ divacapi_init(void)
/* /*
* module exit * module exit
*/ */
static void DIVA_EXIT_FUNCTION static void DIVA_EXIT_FUNCTION divacapi_exit(void)
divacapi_exit(void)
{ {
finit_capifunc(); finit_capifunc();
printk(KERN_INFO "%s: module unloaded.\n", DRIVERLNAME); printk(KERN_INFO "%s: module unloaded.\n", DRIVERLNAME);
...@@ -195,4 +194,3 @@ divacapi_exit(void) ...@@ -195,4 +194,3 @@ divacapi_exit(void)
module_init(divacapi_init); module_init(divacapi_init);
module_exit(divacapi_exit); module_exit(divacapi_exit);
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define DBG_DEFAULT (DBG_MINIMUM + DL_XLOG + DL_REG) #define DBG_DEFAULT (DBG_MINIMUM + DL_XLOG + DL_REG)
extern void DIVA_DIDD_Read (void *, int); extern void DIVA_DIDD_Read(void *, int);
extern char *DRIVERRELEASE; extern char *DRIVERRELEASE;
static dword notify_handle; static dword notify_handle;
static DESCRIPTOR _DAdapter; static DESCRIPTOR _DAdapter;
...@@ -30,30 +30,26 @@ static DESCRIPTOR _DAdapter; ...@@ -30,30 +30,26 @@ static DESCRIPTOR _DAdapter;
/* /*
* didd callback function * didd callback function
*/ */
static void * static void *didd_callback(void *context, DESCRIPTOR * adapter,
didd_callback(void *context, DESCRIPTOR* adapter, int removal) int removal)
{ {
if (adapter->type == IDI_DADAPTER) if (adapter->type == IDI_DADAPTER) {
{
DBG_ERR(("Notification about IDI_DADAPTER change ! Oops.")) DBG_ERR(("Notification about IDI_DADAPTER change ! Oops."))
return(NULL); return (NULL);
} } else if (adapter->type == IDI_DIMAINT) {
else if (adapter->type == IDI_DIMAINT)
{
if (removal) { if (removal) {
DbgDeregister(); DbgDeregister();
} else { } else {
DbgRegister("DIDD", DRIVERRELEASE, DBG_DEFAULT); DbgRegister("DIDD", DRIVERRELEASE, DBG_DEFAULT);
} }
} }
return(NULL); return (NULL);
} }
/* /*
* connect to didd * connect to didd
*/ */
static int DIVA_INIT_FUNCTION static int DIVA_INIT_FUNCTION connect_didd(void)
connect_didd(void)
{ {
int x = 0; int x = 0;
int dadapter = 0; int dadapter = 0;
...@@ -62,41 +58,37 @@ connect_didd(void) ...@@ -62,41 +58,37 @@ connect_didd(void)
DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table)); DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
for (x = 0; x < MAX_DESCRIPTORS; x++) for (x = 0; x < MAX_DESCRIPTORS; x++) {
{ if (DIDD_Table[x].type == IDI_DADAPTER) { /* DADAPTER found */
if (DIDD_Table[x].type == IDI_DADAPTER)
{ /* DADAPTER found */
dadapter = 1; dadapter = 1;
memcpy(&_DAdapter, &DIDD_Table[x], sizeof(_DAdapter)); memcpy(&_DAdapter, &DIDD_Table[x], sizeof(_DAdapter));
req.didd_notify.e.Req = 0; req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
req.didd_notify.info.callback = didd_callback; req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = 0; req.didd_notify.info.context = 0;
_DAdapter.request((ENTITY *)&req); _DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff) if (req.didd_notify.e.Rc != 0xff)
return(0); return (0);
notify_handle = req.didd_notify.info.handle; notify_handle = req.didd_notify.info.handle;
} } else if (DIDD_Table[x].type == IDI_DIMAINT) { /* MAINT found */
else if (DIDD_Table[x].type == IDI_DIMAINT)
{ /* MAINT found */
DbgRegister("DIDD", DRIVERRELEASE, DBG_DEFAULT); DbgRegister("DIDD", DRIVERRELEASE, DBG_DEFAULT);
} }
} }
return(dadapter); return (dadapter);
} }
/* /*
* disconnect from didd * disconnect from didd
*/ */
static void DIVA_EXIT_FUNCTION static void DIVA_EXIT_FUNCTION disconnect_didd(void)
disconnect_didd(void)
{ {
IDI_SYNC_REQ req; IDI_SYNC_REQ req;
req.didd_notify.e.Req = 0; req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY; req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY;
req.didd_notify.info.handle = notify_handle; req.didd_notify.info.handle = notify_handle;
_DAdapter.request((ENTITY *)&req); _DAdapter.request((ENTITY *) & req);
} }
/* /*
...@@ -106,12 +98,12 @@ int DIVA_INIT_FUNCTION diddfunc_init(void) ...@@ -106,12 +98,12 @@ int DIVA_INIT_FUNCTION diddfunc_init(void)
{ {
diva_didd_load_time_init(); diva_didd_load_time_init();
if(!connect_didd()) { if (!connect_didd()) {
DBG_ERR(("init: failed to connect to DIDD.")) DBG_ERR(("init: failed to connect to DIDD."))
diva_didd_load_time_finit(); diva_didd_load_time_finit();
return(0); return (0);
} }
return(1); return (1);
} }
/* /*
...@@ -123,4 +115,3 @@ void DIVA_EXIT_FUNCTION diddfunc_finit(void) ...@@ -123,4 +115,3 @@ void DIVA_EXIT_FUNCTION diddfunc_finit(void)
disconnect_didd(); disconnect_didd();
diva_didd_load_time_finit(); diva_didd_load_time_finit();
} }
This diff is collapsed.
/* $Id: diva.h,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $ */ /* $Id: diva.h,v 1.1.2.2 2001/02/08 12:25:43 armin Exp $ */
#ifndef __DIVA_XDI_OS_PART_H__ #ifndef __DIVA_XDI_OS_PART_H__
#define __DIVA_XDI_OS_PART_H__ #define __DIVA_XDI_OS_PART_H__
int divasa_xdi_driver_entry (void); int divasa_xdi_driver_entry(void);
void divasa_xdi_driver_unload (void); void divasa_xdi_driver_unload(void);
void* diva_driver_add_card (void* pdev, unsigned long CardOrdinal); void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal);
void diva_driver_remove_card (void* pdiva); void diva_driver_remove_card(void *pdiva);
typedef int (*divas_xdi_copy_to_user_fn_t)(void* os_handle, void* dst, typedef int (*divas_xdi_copy_to_user_fn_t) (void *os_handle, void *dst,
const void* src, int length); const void *src, int length);
typedef int (*divas_xdi_copy_from_user_fn_t)(void* os_handle, void* dst, typedef int (*divas_xdi_copy_from_user_fn_t) (void *os_handle, void *dst,
const void* src, int length); const void *src, int length);
int diva_xdi_read (void* adapter, void* os_handle, void* dst, int diva_xdi_read(void *adapter, void *os_handle, void *dst,
int max_length, divas_xdi_copy_to_user_fn_t cp_fn); int max_length, divas_xdi_copy_to_user_fn_t cp_fn);
int diva_xdi_write (void* adapter, void* os_handle, const void* src, int diva_xdi_write(void *adapter, void *os_handle, const void *src,
int length, divas_xdi_copy_from_user_fn_t cp_fn); int length, divas_xdi_copy_from_user_fn_t cp_fn);
void* diva_xdi_open_adapter (void* os_handle, const void* src, void *diva_xdi_open_adapter(void *os_handle, const void *src,
int length, divas_xdi_copy_from_user_fn_t cp_fn); int length,
divas_xdi_copy_from_user_fn_t cp_fn);
void diva_xdi_close_adapter (void* adapter, void* os_handle); void diva_xdi_close_adapter(void *adapter, void *os_handle);
#endif #endif
/* $Id: diva_didd.c,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $ /* $Id: diva_didd.c,v 1.1.2.6 2001/05/01 15:48:05 armin Exp $
* *
* DIDD Interface module for Eicon active cards. * DIDD Interface module for Eicon active cards.
* *
...@@ -23,18 +23,19 @@ ...@@ -23,18 +23,19 @@
#include "divasync.h" #include "divasync.h"
#include "did_vers.h" #include "did_vers.h"
static char *main_revision = "$Revision: 1.1.2.2 $"; static char *main_revision = "$Revision: 1.1.2.6 $";
static char *DRIVERNAME = "Eicon DIVA - DIDD table (http://www.melware.net)"; static char *DRIVERNAME =
"Eicon DIVA - DIDD table (http://www.melware.net)";
static char *DRIVERLNAME = "divadidd"; static char *DRIVERLNAME = "divadidd";
char *DRIVERRELEASE = "2.0"; char *DRIVERRELEASE = "2.0";
static char *dir_in_proc_net = "isdn"; static char *dir_in_proc_net = "isdn";
static char *main_proc_dir = "eicon"; static char *main_proc_dir = "eicon";
MODULE_DESCRIPTION( "DIDD table driver for diva drivers"); MODULE_DESCRIPTION("DIDD table driver for diva drivers");
MODULE_AUTHOR( "Cytronics & Melware, Eicon Networks"); MODULE_AUTHOR("Cytronics & Melware, Eicon Networks");
MODULE_SUPPORTED_DEVICE( "Eicon diva drivers"); MODULE_SUPPORTED_DEVICE("Eicon diva drivers");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#define MAX_DESCRIPTORS 32 #define MAX_DESCRIPTORS 32
...@@ -45,7 +46,7 @@ MODULE_LICENSE("GPL"); ...@@ -45,7 +46,7 @@ MODULE_LICENSE("GPL");
extern int diddfunc_init(void); extern int diddfunc_init(void);
extern void diddfunc_finit(void); extern void diddfunc_finit(void);
extern void DIVA_DIDD_Read (void *, int); extern void DIVA_DIDD_Read(void *, int);
static struct proc_dir_entry *proc_net_isdn; static struct proc_dir_entry *proc_net_isdn;
static struct proc_dir_entry *proc_didd; static struct proc_dir_entry *proc_didd;
...@@ -54,8 +55,7 @@ struct proc_dir_entry *proc_net_isdn_eicon = NULL; ...@@ -54,8 +55,7 @@ struct proc_dir_entry *proc_net_isdn_eicon = NULL;
EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Read); EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Read);
EXPORT_SYMBOL_NOVERS(proc_net_isdn_eicon); EXPORT_SYMBOL_NOVERS(proc_net_isdn_eicon);
static char * static char *getrev(const char *revision)
getrev(const char *revision)
{ {
char *rev; char *rev;
char *p; char *p;
...@@ -63,30 +63,32 @@ getrev(const char *revision) ...@@ -63,30 +63,32 @@ getrev(const char *revision)
rev = p + 2; rev = p + 2;
p = strchr(rev, '$'); p = strchr(rev, '$');
*--p = 0; *--p = 0;
} else rev = "1.0"; } else
rev = "1.0";
return rev; return rev;
} }
static int static int
proc_read(char *page, char **start, off_t off, int count, int *eof, void *data) proc_read(char *page, char **start, off_t off, int count, int *eof,
void *data)
{ {
int len = 0; int len = 0;
char tmprev[32]; char tmprev[32];
strcpy(tmprev, main_revision); strcpy(tmprev, main_revision);
len += sprintf(page+len, "%s\n", DRIVERNAME); len += sprintf(page + len, "%s\n", DRIVERNAME);
len += sprintf(page+len, "name : %s\n", DRIVERLNAME); len += sprintf(page + len, "name : %s\n", DRIVERLNAME);
len += sprintf(page+len, "release : %s\n", DRIVERRELEASE); len += sprintf(page + len, "release : %s\n", DRIVERRELEASE);
len += sprintf(page+len, "build : %s(%s)\n", len += sprintf(page + len, "build : %s(%s)\n",
diva_didd_common_code_build, DIVA_BUILD); diva_didd_common_code_build, DIVA_BUILD);
len += sprintf(page+len, "revision : %s\n", getrev(tmprev)); len += sprintf(page + len, "revision : %s\n", getrev(tmprev));
if (off + count >= len) if (off + count >= len)
*eof = 1; *eof = 1;
if (len < off) if (len < off)
return 0; return 0;
*start = page + off; *start = page + off;
return((count < len-off) ? count : len-off); return ((count < len - off) ? count : len - off);
} }
static int DIVA_INIT_FUNCTION create_proc(void) static int DIVA_INIT_FUNCTION create_proc(void)
...@@ -100,17 +102,22 @@ static int DIVA_INIT_FUNCTION create_proc(void) ...@@ -100,17 +102,22 @@ static int DIVA_INIT_FUNCTION create_proc(void)
} }
} }
if (!proc_net_isdn) { if (!proc_net_isdn) {
proc_net_isdn = create_proc_entry(dir_in_proc_net, S_IFDIR, proc_net); proc_net_isdn =
create_proc_entry(dir_in_proc_net, S_IFDIR, proc_net);
} }
proc_net_isdn_eicon = create_proc_entry(main_proc_dir, S_IFDIR, proc_net_isdn); proc_net_isdn_eicon =
create_proc_entry(main_proc_dir, S_IFDIR, proc_net_isdn);
if(proc_net_isdn_eicon) {
if((proc_didd = create_proc_entry(DRIVERLNAME, S_IFREG | S_IRUGO, proc_net_isdn_eicon))) { if (proc_net_isdn_eicon) {
if (
(proc_didd =
create_proc_entry(DRIVERLNAME, S_IFREG | S_IRUGO,
proc_net_isdn_eicon))) {
proc_didd->read_proc = proc_read; proc_didd->read_proc = proc_read;
} }
return(1); return (1);
} }
return(0); return (0);
} }
static void DIVA_EXIT_FUNCTION remove_proc(void) static void DIVA_EXIT_FUNCTION remove_proc(void)
...@@ -118,13 +125,12 @@ static void DIVA_EXIT_FUNCTION remove_proc(void) ...@@ -118,13 +125,12 @@ static void DIVA_EXIT_FUNCTION remove_proc(void)
remove_proc_entry(DRIVERLNAME, proc_net_isdn_eicon); remove_proc_entry(DRIVERLNAME, proc_net_isdn_eicon);
remove_proc_entry(main_proc_dir, proc_net_isdn); remove_proc_entry(main_proc_dir, proc_net_isdn);
if ((proc_net_isdn) && (!proc_net_isdn->subdir)){ if ((proc_net_isdn) && (!proc_net_isdn->subdir)) {
remove_proc_entry(dir_in_proc_net, proc_net); remove_proc_entry(dir_in_proc_net, proc_net);
} }
} }
static int DIVA_INIT_FUNCTION static int DIVA_INIT_FUNCTION divadidd_init(void)
divadidd_init(void)
{ {
char tmprev[32]; char tmprev[32];
int ret = 0; int ret = 0;
...@@ -138,25 +144,26 @@ divadidd_init(void) ...@@ -138,25 +144,26 @@ divadidd_init(void)
diva_didd_common_code_build, DIVA_BUILD); diva_didd_common_code_build, DIVA_BUILD);
if (!create_proc()) { if (!create_proc()) {
printk(KERN_ERR "%s: could not create proc entry\n", DRIVERLNAME); printk(KERN_ERR "%s: could not create proc entry\n",
DRIVERLNAME);
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
if(!diddfunc_init()) { if (!diddfunc_init()) {
printk(KERN_ERR "%s: failed to connect to DIDD.\n", DRIVERLNAME); printk(KERN_ERR "%s: failed to connect to DIDD.\n",
DRIVERLNAME);
remove_proc(); remove_proc();
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
out: out:
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
return (ret); return (ret);
} }
void DIVA_EXIT_FUNCTION void DIVA_EXIT_FUNCTION divadidd_exit(void)
divadidd_exit(void)
{ {
diddfunc_finit(); diddfunc_finit();
remove_proc(); remove_proc();
...@@ -165,4 +172,3 @@ divadidd_exit(void) ...@@ -165,4 +172,3 @@ divadidd_exit(void)
module_init(divadidd_init); module_init(divadidd_init);
module_exit(divadidd_exit); module_exit(divadidd_exit);
/* $Id: diva_pci.h,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $ */ /* $Id: diva_pci.h,v 1.1.2.2 2001/02/12 20:23:46 armin Exp $ */
#ifndef __DIVA_PCI_INTERFACE_H__ #ifndef __DIVA_PCI_INTERFACE_H__
#define __DIVA_PCI_INTERFACE_H__ #define __DIVA_PCI_INTERFACE_H__
void* divasa_remap_pci_bar (unsigned long bar, void *divasa_remap_pci_bar(unsigned long bar, unsigned long area_length);
unsigned long area_length); void divasa_unmap_pci_bar(void *bar);
void divasa_unmap_pci_bar (void* bar); unsigned long divasa_get_pci_irq(unsigned char bus,
unsigned long divasa_get_pci_irq (unsigned char bus, unsigned char func, void *pci_dev_handle);
unsigned long divasa_get_pci_bar(unsigned char bus,
unsigned char func, unsigned char func,
void* pci_dev_handle); int bar, void *pci_dev_handle);
unsigned long divasa_get_pci_bar (unsigned char bus, byte diva_os_get_pci_bus(void *pci_dev_handle);
unsigned char func, byte diva_os_get_pci_func(void *pci_dev_handle);
int bar,
void* pci_dev_handle);
byte diva_os_get_pci_bus (void* pci_dev_handle);
byte diva_os_get_pci_func (void* pci_dev_handle);
#endif #endif
This diff is collapsed.
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
#define DBG_MINIMUM (DL_LOG + DL_FTL + DL_ERR) #define DBG_MINIMUM (DL_LOG + DL_FTL + DL_ERR)
#define DBG_DEFAULT (DBG_MINIMUM + DL_XLOG + DL_REG) #define DBG_DEFAULT (DBG_MINIMUM + DL_XLOG + DL_REG)
extern void DIVA_DIDD_Read (void *, int); extern void DIVA_DIDD_Read(void *, int);
extern PISDN_ADAPTER IoAdapters[MAX_ADAPTER]; extern PISDN_ADAPTER IoAdapters[MAX_ADAPTER];
#define MAX_DESCRIPTORS 32 #define MAX_DESCRIPTORS 32
extern void diva_run_trap_script (PISDN_ADAPTER IoAdapter, dword ANum); extern void diva_run_trap_script(PISDN_ADAPTER IoAdapter, dword ANum);
extern char *DRIVERRELEASE; extern char *DRIVERRELEASE;
static dword notify_handle; static dword notify_handle;
...@@ -37,10 +37,11 @@ static DESCRIPTOR MAdapter; ...@@ -37,10 +37,11 @@ static DESCRIPTOR MAdapter;
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
MAINT driver connector section MAINT driver connector section
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void no_printf (unsigned char * x ,...) static void no_printf(unsigned char *x, ...)
{ {
/* dummy debug function */ /* dummy debug function */
} }
DIVA_DI_PRINTF dprintf = no_printf; DIVA_DI_PRINTF dprintf = no_printf;
#include "debuglib.c" #include "debuglib.c"
...@@ -48,18 +49,14 @@ DIVA_DI_PRINTF dprintf = no_printf; ...@@ -48,18 +49,14 @@ DIVA_DI_PRINTF dprintf = no_printf;
/* /*
* get the adapters serial number * get the adapters serial number
*/ */
void void diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf)
diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf)
{ {
int contr = 0; int contr = 0;
if ((contr = ((IoAdapter->serialNo & 0xff000000) >> 24))) if ((contr = ((IoAdapter->serialNo & 0xff000000) >> 24))) {
{
sprintf(buf, "%d-%d", sprintf(buf, "%d-%d",
IoAdapter->serialNo & 0x00ffffff, contr + 1); IoAdapter->serialNo & 0x00ffffff, contr + 1);
} } else {
else
{
sprintf(buf, "%d", IoAdapter->serialNo); sprintf(buf, "%d", IoAdapter->serialNo);
} }
} }
...@@ -67,29 +64,38 @@ diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf) ...@@ -67,29 +64,38 @@ diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf)
/* /*
* register a new adapter * register a new adapter
*/ */
void diva_xdi_didd_register_adapter (int card) void diva_xdi_didd_register_adapter(int card)
{ {
DESCRIPTOR d; DESCRIPTOR d;
IDI_SYNC_REQ req; IDI_SYNC_REQ req;
if (card && ((card-1) < MAX_ADAPTER) && if (card && ((card - 1) < MAX_ADAPTER) &&
IoAdapters[card-1] && Requests[card-1]) { IoAdapters[card - 1] && Requests[card - 1]) {
d.type = IoAdapters[card-1]->Properties.DescType; d.type = IoAdapters[card - 1]->Properties.DescType;
d.request = Requests[card-1]; d.request = Requests[card - 1];
d.channels = IoAdapters[card-1]->Properties.Channels; d.channels = IoAdapters[card - 1]->Properties.Channels;
d.features = IoAdapters[card-1]->Properties.Features; d.features = IoAdapters[card - 1]->Properties.Features;
DBG_TRC(("DIDD register A(%d) channels=%d", card, d.channels)) DBG_TRC(("DIDD register A(%d) channels=%d", card,
d.channels))
/* workaround for different Name in structure */ /* workaround for different Name in structure */
strncpy(IoAdapters[card-1]->Name, IoAdapters[card-1]->Properties.Name, strncpy(IoAdapters[card - 1]->Name,
MIN(30, strlen(IoAdapters[card-1]->Properties.Name))); IoAdapters[card - 1]->Properties.Name, MIN(30,
strlen
(IoAdapters
[card
-
1]->
Properties.
Name)));
req.didd_remove_adapter.e.Req = 0; req.didd_remove_adapter.e.Req = 0;
req.didd_add_adapter.e.Rc = IDI_SYNC_REQ_DIDD_ADD_ADAPTER; req.didd_add_adapter.e.Rc = IDI_SYNC_REQ_DIDD_ADD_ADAPTER;
req.didd_add_adapter.info.descriptor = (void *)&d; req.didd_add_adapter.info.descriptor = (void *) &d;
DAdapter.request((ENTITY *)&req); DAdapter.request((ENTITY *) & req);
if (req.didd_add_adapter.e.Rc != 0xff) { if (req.didd_add_adapter.e.Rc != 0xff) {
DBG_ERR(("DIDD register A(%d) failed !", card)) DBG_ERR(("DIDD register A(%d) failed !", card))
} else { } else {
IoAdapters[card-1]->os_trap_nfy_Fnc = diva_run_trap_script; IoAdapters[card - 1]->os_trap_nfy_Fnc =
diva_run_trap_script;
} }
} }
} }
...@@ -97,17 +103,18 @@ void diva_xdi_didd_register_adapter (int card) ...@@ -97,17 +103,18 @@ void diva_xdi_didd_register_adapter (int card)
/* /*
* remove an adapter * remove an adapter
*/ */
void diva_xdi_didd_remove_adapter (int card) void diva_xdi_didd_remove_adapter(int card)
{ {
IDI_SYNC_REQ req; IDI_SYNC_REQ req;
ADAPTER *a = &IoAdapters[card-1]->a; ADAPTER *a = &IoAdapters[card - 1]->a;
IoAdapters[card-1]->os_trap_nfy_Fnc = NULL; IoAdapters[card - 1]->os_trap_nfy_Fnc = NULL;
DBG_TRC(("DIDD de-register A(%d)", card)) DBG_TRC(("DIDD de-register A(%d)", card))
req.didd_remove_adapter.e.Req = 0; req.didd_remove_adapter.e.Req = 0;
req.didd_remove_adapter.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER; req.didd_remove_adapter.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER;
req.didd_remove_adapter.info.p_request = (IDI_CALL)Requests[card-1]; req.didd_remove_adapter.info.p_request =
DAdapter.request((ENTITY *)&req); (IDI_CALL) Requests[card - 1];
DAdapter.request((ENTITY *) & req);
memset(&(a->IdTable), 0x00, 256); memset(&(a->IdTable), 0x00, 256);
} }
...@@ -118,8 +125,8 @@ static void start_dbg(void) ...@@ -118,8 +125,8 @@ static void start_dbg(void)
{ {
DbgRegister("DIVAS", DRIVERRELEASE, DBG_DEFAULT); DbgRegister("DIVAS", DRIVERRELEASE, DBG_DEFAULT);
DBG_LOG(("DIVA ISDNXDI BUILD (%s[%s]-%s-%s)", DBG_LOG(("DIVA ISDNXDI BUILD (%s[%s]-%s-%s)",
DIVA_BUILD, diva_xdi_common_code_build, __DATE__, __TIME__)) DIVA_BUILD, diva_xdi_common_code_build, __DATE__,
} __TIME__))}
/* /*
* stop debug * stop debug
...@@ -134,27 +141,24 @@ static void stop_dbg(void) ...@@ -134,27 +141,24 @@ static void stop_dbg(void)
/* /*
* didd callback function * didd callback function
*/ */
static void * didd_callback(void *context, DESCRIPTOR* adapter, int removal) static void *didd_callback(void *context, DESCRIPTOR * adapter,
int removal)
{ {
if (adapter->type == IDI_DADAPTER) if (adapter->type == IDI_DADAPTER) {
{
DBG_ERR(("Notification about IDI_DADAPTER change ! Oops.")); DBG_ERR(("Notification about IDI_DADAPTER change ! Oops."));
return(NULL); return (NULL);
} }
if (adapter->type == IDI_DIMAINT) if (adapter->type == IDI_DIMAINT) {
{ if (removal) {
if (removal)
{
stop_dbg(); stop_dbg();
} } else {
else
{
memcpy(&MAdapter, adapter, sizeof(MAdapter)); memcpy(&MAdapter, adapter, sizeof(MAdapter));
dprintf = (DIVA_DI_PRINTF)MAdapter.request; dprintf = (DIVA_DI_PRINTF) MAdapter.request;
start_dbg(); start_dbg();
} }
} return(NULL); }
return (NULL);
} }
/* /*
...@@ -169,38 +173,33 @@ static int DIVA_INIT_FUNCTION connect_didd(void) ...@@ -169,38 +173,33 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table)); DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
for (x = 0; x < MAX_DESCRIPTORS; x++) for (x = 0; x < MAX_DESCRIPTORS; x++) {
{ if (DIDD_Table[x].type == IDI_DADAPTER) { /* DADAPTER found */
if (DIDD_Table[x].type == IDI_DADAPTER)
{ /* DADAPTER found */
dadapter = 1; dadapter = 1;
memcpy(&DAdapter, &DIDD_Table[x], sizeof(DAdapter)); memcpy(&DAdapter, &DIDD_Table[x], sizeof(DAdapter));
req.didd_notify.e.Req = 0; req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
req.didd_notify.info.callback = didd_callback; req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = 0; req.didd_notify.info.context = 0;
DAdapter.request((ENTITY *)&req); DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff) if (req.didd_notify.e.Rc != 0xff) {
{
stop_dbg(); stop_dbg();
return(0); return (0);
} }
notify_handle = req.didd_notify.info.handle; notify_handle = req.didd_notify.info.handle;
} } else if (DIDD_Table[x].type == IDI_DIMAINT) { /* MAINT found */
else if (DIDD_Table[x].type == IDI_DIMAINT)
{ /* MAINT found */
memcpy(&MAdapter, &DIDD_Table[x], sizeof(DAdapter)); memcpy(&MAdapter, &DIDD_Table[x], sizeof(DAdapter));
dprintf = (DIVA_DI_PRINTF)MAdapter.request; dprintf = (DIVA_DI_PRINTF) MAdapter.request;
start_dbg(); start_dbg();
} }
} }
if (!dadapter) if (!dadapter) {
{
stop_dbg(); stop_dbg();
} }
return(dadapter); return (dadapter);
} }
/* /*
...@@ -215,7 +214,7 @@ static void DIVA_EXIT_FUNCTION disconnect_didd(void) ...@@ -215,7 +214,7 @@ static void DIVA_EXIT_FUNCTION disconnect_didd(void)
req.didd_notify.e.Req = 0; req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY; req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY;
req.didd_notify.info.handle = notify_handle; req.didd_notify.info.handle = notify_handle;
DAdapter.request((ENTITY *)&req); DAdapter.request((ENTITY *) & req);
} }
/* /*
...@@ -223,14 +222,14 @@ static void DIVA_EXIT_FUNCTION disconnect_didd(void) ...@@ -223,14 +222,14 @@ static void DIVA_EXIT_FUNCTION disconnect_didd(void)
*/ */
int DIVA_INIT_FUNCTION divasfunc_init(void) int DIVA_INIT_FUNCTION divasfunc_init(void)
{ {
if(!connect_didd()) { if (!connect_didd()) {
DBG_ERR(("divasfunc: failed to connect to DIDD.")) DBG_ERR(("divasfunc: failed to connect to DIDD."))
return(0); return (0);
} }
divasa_xdi_driver_entry (); divasa_xdi_driver_entry();
return(1); return (1);
} }
/* /*
...@@ -238,7 +237,6 @@ int DIVA_INIT_FUNCTION divasfunc_init(void) ...@@ -238,7 +237,6 @@ int DIVA_INIT_FUNCTION divasfunc_init(void)
*/ */
void DIVA_EXIT_FUNCTION divasfunc_exit(void) void DIVA_EXIT_FUNCTION divasfunc_exit(void)
{ {
divasa_xdi_driver_unload (); divasa_xdi_driver_unload();
disconnect_didd (); disconnect_didd();
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* $Id: dlist.c,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $ */ /* $Id: dlist.c,v 1.1.2.2 2001/02/11 14:40:41 armin Exp $ */
#include "platform.h" #include "platform.h"
#include "dlist.h" #include "dlist.h"
...@@ -7,19 +7,17 @@ ...@@ -7,19 +7,17 @@
** Initialize linked list ** Initialize linked list
*/ */
void void diva_q_init(diva_entity_queue_t * q)
diva_q_init (diva_entity_queue_t* q)
{ {
memset (q, 0x00, sizeof(*q)); memset(q, 0x00, sizeof(*q));
} }
/* /*
** Remove element from linked list ** Remove element from linked list
*/ */
void void diva_q_remove(diva_entity_queue_t * q, diva_entity_link_t * what)
diva_q_remove (diva_entity_queue_t* q, diva_entity_link_t* what)
{ {
if(!what->prev) { if (!what->prev) {
if ((q->head = what->next)) { if ((q->head = what->next)) {
q->head->prev = 0; q->head->prev = 0;
} else { } else {
...@@ -38,8 +36,7 @@ diva_q_remove (diva_entity_queue_t* q, diva_entity_link_t* what) ...@@ -38,8 +36,7 @@ diva_q_remove (diva_entity_queue_t* q, diva_entity_link_t* what)
/* /*
** Add element to the tail of linked list ** Add element to the tail of linked list
*/ */
void void diva_q_add_tail(diva_entity_queue_t * q, diva_entity_link_t * what)
diva_q_add_tail (diva_entity_queue_t* q, diva_entity_link_t* what)
{ {
what->next = 0; what->next = 0;
if (!q->head) { if (!q->head) {
...@@ -52,14 +49,13 @@ diva_q_add_tail (diva_entity_queue_t* q, diva_entity_link_t* what) ...@@ -52,14 +49,13 @@ diva_q_add_tail (diva_entity_queue_t* q, diva_entity_link_t* what)
} }
} }
diva_entity_link_t* diva_entity_link_t *diva_q_find(const diva_entity_queue_t * q,
diva_q_find (const diva_entity_queue_t* q, const void* what, const void *what, diva_q_cmp_fn_t cmp_fn)
diva_q_cmp_fn_t cmp_fn)
{ {
diva_entity_link_t* diva_current = q->head; diva_entity_link_t *diva_current = q->head;
while (diva_current) { while (diva_current) {
if (!(*cmp_fn)(what, diva_current)) { if (!(*cmp_fn) (what, diva_current)) {
break; break;
} }
diva_current = diva_current->next; diva_current = diva_current->next;
...@@ -68,35 +64,30 @@ diva_q_find (const diva_entity_queue_t* q, const void* what, ...@@ -68,35 +64,30 @@ diva_q_find (const diva_entity_queue_t* q, const void* what,
return (diva_current); return (diva_current);
} }
diva_entity_link_t* diva_entity_link_t *diva_q_get_head(diva_entity_queue_t * q)
diva_q_get_head (diva_entity_queue_t* q)
{ {
return (q->head); return (q->head);
} }
diva_entity_link_t* diva_entity_link_t *diva_q_get_tail(diva_entity_queue_t * q)
diva_q_get_tail (diva_entity_queue_t* q)
{ {
return (q->tail); return (q->tail);
} }
diva_entity_link_t* diva_entity_link_t *diva_q_get_next(diva_entity_link_t * what)
diva_q_get_next (diva_entity_link_t* what)
{ {
return ((what) ? what->next : 0); return ((what) ? what->next : 0);
} }
diva_entity_link_t* diva_entity_link_t *diva_q_get_prev(diva_entity_link_t * what)
diva_q_get_prev (diva_entity_link_t* what)
{ {
return ((what) ? what->prev : 0); return ((what) ? what->prev : 0);
} }
int int diva_q_get_nr_of_entries(const diva_entity_queue_t * q)
diva_q_get_nr_of_entries (const diva_entity_queue_t* q)
{ {
int i = 0; int i = 0;
const diva_entity_link_t* diva_current = q->head; const diva_entity_link_t *diva_current = q->head;
while (diva_current) { while (diva_current) {
i++; i++;
...@@ -105,4 +96,3 @@ diva_q_get_nr_of_entries (const diva_entity_queue_t* q) ...@@ -105,4 +96,3 @@ diva_q_get_nr_of_entries (const diva_entity_queue_t* q)
return (i); return (i);
} }
/* $Id: dlist.h,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $ */ /* $Id: dlist.h,v 1.1.2.2 2001/02/08 12:25:43 armin Exp $ */
#ifndef __DIVA_LINK_H__ #ifndef __DIVA_LINK_H__
#define __DIVA_LINK_H__ #define __DIVA_LINK_H__
struct _diva_entity_link; struct _diva_entity_link;
typedef struct _diva_entity_link { typedef struct _diva_entity_link {
struct _diva_entity_link* prev; struct _diva_entity_link *prev;
struct _diva_entity_link* next; struct _diva_entity_link *next;
} diva_entity_link_t; } diva_entity_link_t;
typedef struct _diva_entity_queue { typedef struct _diva_entity_queue {
diva_entity_link_t* head; diva_entity_link_t *head;
diva_entity_link_t* tail; diva_entity_link_t *tail;
} diva_entity_queue_t; } diva_entity_queue_t;
typedef int (*diva_q_cmp_fn_t)(const void* what, typedef int (*diva_q_cmp_fn_t) (const void *what,
const diva_entity_link_t*); const diva_entity_link_t *);
void diva_q_remove (diva_entity_queue_t* q, diva_entity_link_t* what); void diva_q_remove(diva_entity_queue_t * q, diva_entity_link_t * what);
void diva_q_add_tail (diva_entity_queue_t* q, diva_entity_link_t* what); void diva_q_add_tail(diva_entity_queue_t * q, diva_entity_link_t * what);
diva_entity_link_t* diva_q_find (const diva_entity_queue_t* q, diva_entity_link_t *diva_q_find(const diva_entity_queue_t * q,
const void* what, diva_q_cmp_fn_t cmp_fn); const void *what, diva_q_cmp_fn_t cmp_fn);
diva_entity_link_t* diva_q_get_head (diva_entity_queue_t* q); diva_entity_link_t *diva_q_get_head(diva_entity_queue_t * q);
diva_entity_link_t* diva_q_get_tail (diva_entity_queue_t* q); diva_entity_link_t *diva_q_get_tail(diva_entity_queue_t * q);
diva_entity_link_t* diva_q_get_next (diva_entity_link_t* what); diva_entity_link_t *diva_q_get_next(diva_entity_link_t * what);
diva_entity_link_t* diva_q_get_prev (diva_entity_link_t* what); diva_entity_link_t *diva_q_get_prev(diva_entity_link_t * what);
int diva_q_get_nr_of_entries (const diva_entity_queue_t* q); int diva_q_get_nr_of_entries(const diva_entity_queue_t * q);
void diva_q_init (diva_entity_queue_t* q); void diva_q_init(diva_entity_queue_t * q);
#endif #endif
/* $Id: dqueue.c,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $ /* $Id: dqueue.c,v 1.1.2.2 2001/02/11 14:40:41 armin Exp $
* *
* Driver for Eicon DIVA Server ISDN cards. * Driver for Eicon DIVA Server ISDN cards.
* User Mode IDI Interface * User Mode IDI Interface
...@@ -14,9 +14,8 @@ ...@@ -14,9 +14,8 @@
#include "dqueue.h" #include "dqueue.h"
int int
diva_data_q_init(diva_um_idi_data_queue_t* q, diva_data_q_init(diva_um_idi_data_queue_t * q,
int max_length, int max_length, int max_segments)
int max_segments)
{ {
int i; int i;
...@@ -30,8 +29,8 @@ diva_data_q_init(diva_um_idi_data_queue_t* q, ...@@ -30,8 +29,8 @@ diva_data_q_init(diva_um_idi_data_queue_t* q,
q->read = q->write = q->count = q->segment_pending = 0; q->read = q->write = q->count = q->segment_pending = 0;
for (i = 0; i < q->segments; i++) { for (i = 0; i < q->segments; i++) {
if (!(q->data[i] = diva_os_malloc (0, q->max_length))) { if (!(q->data[i] = diva_os_malloc(0, q->max_length))) {
diva_data_q_finit (q); diva_data_q_finit(q);
return (-1); return (-1);
} }
} }
...@@ -39,14 +38,13 @@ diva_data_q_init(diva_um_idi_data_queue_t* q, ...@@ -39,14 +38,13 @@ diva_data_q_init(diva_um_idi_data_queue_t* q,
return (0); return (0);
} }
int int diva_data_q_finit(diva_um_idi_data_queue_t * q)
diva_data_q_finit(diva_um_idi_data_queue_t* q)
{ {
int i; int i;
for (i = 0; i < q->segments; i++) { for (i = 0; i < q->segments; i++) {
if (q->data[i]) { if (q->data[i]) {
diva_os_free (0, q->data[i]); diva_os_free(0, q->data[i]);
} }
q->data[i] = 0; q->data[i] = 0;
q->length[i] = 0; q->length[i] = 0;
...@@ -56,14 +54,12 @@ diva_data_q_finit(diva_um_idi_data_queue_t* q) ...@@ -56,14 +54,12 @@ diva_data_q_finit(diva_um_idi_data_queue_t* q)
return (0); return (0);
} }
int int diva_data_q_get_max_length(const diva_um_idi_data_queue_t * q)
diva_data_q_get_max_length(const diva_um_idi_data_queue_t* q)
{ {
return (q->max_length); return (q->max_length);
} }
void* void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t * q)
diva_data_q_get_segment4write(diva_um_idi_data_queue_t* q)
{ {
if ((!q->segment_pending) && (q->count < q->segments)) { if ((!q->segment_pending) && (q->count < q->segments)) {
q->segment_pending = 1; q->segment_pending = 1;
...@@ -74,7 +70,7 @@ diva_data_q_get_segment4write(diva_um_idi_data_queue_t* q) ...@@ -74,7 +70,7 @@ diva_data_q_get_segment4write(diva_um_idi_data_queue_t* q)
} }
void void
diva_data_q_ack_segment4write(diva_um_idi_data_queue_t* q, int length) diva_data_q_ack_segment4write(diva_um_idi_data_queue_t * q, int length)
{ {
if (q->segment_pending) { if (q->segment_pending) {
q->length[q->write] = length; q->length[q->write] = length;
...@@ -87,8 +83,8 @@ diva_data_q_ack_segment4write(diva_um_idi_data_queue_t* q, int length) ...@@ -87,8 +83,8 @@ diva_data_q_ack_segment4write(diva_um_idi_data_queue_t* q, int length)
} }
} }
const void* const void *diva_data_q_get_segment4read(const diva_um_idi_data_queue_t *
diva_data_q_get_segment4read(const diva_um_idi_data_queue_t* q) q)
{ {
if (q->count) { if (q->count) {
return (q->data[q->read]); return (q->data[q->read]);
...@@ -96,14 +92,12 @@ diva_data_q_get_segment4read(const diva_um_idi_data_queue_t* q) ...@@ -96,14 +92,12 @@ diva_data_q_get_segment4read(const diva_um_idi_data_queue_t* q)
return (0); return (0);
} }
int int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t * q)
diva_data_q_get_segment_length(const diva_um_idi_data_queue_t* q)
{ {
return (q->length[q->read]); return (q->length[q->read]);
} }
void void diva_data_q_ack_segment4read(diva_um_idi_data_queue_t * q)
diva_data_q_ack_segment4read(diva_um_idi_data_queue_t* q)
{ {
if (q->count) { if (q->count) {
q->length[q->read] = 0; q->length[q->read] = 0;
...@@ -114,4 +108,3 @@ diva_data_q_ack_segment4read(diva_um_idi_data_queue_t* q) ...@@ -114,4 +108,3 @@ diva_data_q_ack_segment4read(diva_um_idi_data_queue_t* q)
} }
} }
} }
/* $Id: dqueue.h,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $ */ /* $Id: dqueue.h,v 1.1.2.2 2001/02/08 12:25:43 armin Exp $ */
#ifndef _DIVA_USER_MODE_IDI_DATA_QUEUE_H__ #ifndef _DIVA_USER_MODE_IDI_DATA_QUEUE_H__
#define _DIVA_USER_MODE_IDI_DATA_QUEUE_H__ #define _DIVA_USER_MODE_IDI_DATA_QUEUE_H__
...@@ -12,20 +12,20 @@ typedef struct _diva_um_idi_data_queue { ...@@ -12,20 +12,20 @@ typedef struct _diva_um_idi_data_queue {
int write; int write;
int count; int count;
int segment_pending; int segment_pending;
void* data[DIVA_UM_IDI_MAX_MSGS]; void *data[DIVA_UM_IDI_MAX_MSGS];
int length[DIVA_UM_IDI_MAX_MSGS]; int length[DIVA_UM_IDI_MAX_MSGS];
} diva_um_idi_data_queue_t; } diva_um_idi_data_queue_t;
int diva_data_q_init(diva_um_idi_data_queue_t* q, int diva_data_q_init(diva_um_idi_data_queue_t * q,
int max_length, int max_length, int max_segments);
int max_segments); int diva_data_q_finit(diva_um_idi_data_queue_t * q);
int diva_data_q_finit(diva_um_idi_data_queue_t* q); int diva_data_q_get_max_length(const diva_um_idi_data_queue_t * q);
int diva_data_q_get_max_length (const diva_um_idi_data_queue_t* q); void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t * q);
void* diva_data_q_get_segment4write (diva_um_idi_data_queue_t* q); void diva_data_q_ack_segment4write(diva_um_idi_data_queue_t * q,
void diva_data_q_ack_segment4write (diva_um_idi_data_queue_t* q, int length); int length);
const void* diva_data_q_get_segment4read (const diva_um_idi_data_queue_t* q); const void *diva_data_q_get_segment4read(const diva_um_idi_data_queue_t *
int diva_data_q_get_segment_length (const diva_um_idi_data_queue_t* q); q);
void diva_data_q_ack_segment4read (diva_um_idi_data_queue_t* q); int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t * q);
void diva_data_q_ack_segment4read(diva_um_idi_data_queue_t * q);
#endif #endif
/* $Id: dsp_tst.h,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $ */ /* $Id: dsp_tst.h,v 1.1.2.2 2001/02/08 12:25:43 armin Exp $ */
#ifndef __DIVA_PRI_HOST_TEST_DSPS_H__ #ifndef __DIVA_PRI_HOST_TEST_DSPS_H__
#define __DIVA_PRI_HOST_TEST_DSPS_H__ #define __DIVA_PRI_HOST_TEST_DSPS_H__
......
/* $Id: entity.h,v 1.1.2.2 2002/10/02 14:38:37 armin Exp $ */ /* $Id: entity.h,v 1.1.2.1 2001/02/08 12:25:43 armin Exp $ */
#ifndef __DIVAS_USER_MODE_IDI_ENTITY__ #ifndef __DIVAS_USER_MODE_IDI_ENTITY__
#define __DIVAS_USER_MODE_IDI_ENTITY__ #define __DIVAS_USER_MODE_IDI_ENTITY__
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* $Id: os_4bri.h,v 1.1.2.2 2002/10/02 14:38:38 armin Exp $ */ /* $Id: os_4bri.h,v 1.1.2.2 2001/02/08 12:25:44 armin Exp $ */
#ifndef __DIVA_OS_4_BRI_H__ #ifndef __DIVA_OS_4_BRI_H__
#define __DIVA_OS_4_BRI_H__ #define __DIVA_OS_4_BRI_H__
int diva_4bri_init_card (diva_os_xdi_adapter_t* a); int diva_4bri_init_card(diva_os_xdi_adapter_t * a);
#endif #endif
This diff is collapsed.
/* $Id: os_bri.h,v 1.1.2.2 2002/10/02 14:38:38 armin Exp $ */ /* $Id: os_bri.h,v 1.1.2.2 2001/02/08 12:25:44 armin Exp $ */
#ifndef __DIVA_OS_BRI_REV_1_H__ #ifndef __DIVA_OS_BRI_REV_1_H__
#define __DIVA_OS_BRI_REV_1_H__ #define __DIVA_OS_BRI_REV_1_H__
int diva_bri_init_card (diva_os_xdi_adapter_t* a); int diva_bri_init_card(diva_os_xdi_adapter_t * a);
#endif #endif
This diff is collapsed.
/* $Id: os_pri.h,v 1.1.2.2 2002/10/02 14:38:38 armin Exp $ */ /* $Id: os_pri.h,v 1.1.2.2 2001/02/08 12:25:44 armin Exp $ */
#ifndef __DIVA_OS_PRI_REV_1_H__ #ifndef __DIVA_OS_PRI_REV_1_H__
#define __DIVA_OS_PRI_REV_1_H__ #define __DIVA_OS_PRI_REV_1_H__
int diva_pri_init_card (diva_os_xdi_adapter_t* a); int diva_pri_init_card(diva_os_xdi_adapter_t * a);
#endif #endif
/* $Id: platform.h,v 1.1.2.2 2002/10/02 14:38:38 armin Exp $ /* $Id: platform.h,v 1.1.2.6 2001/05/01 15:48:05 armin Exp $
* *
* platform.h * platform.h
* *
......
...@@ -249,12 +249,12 @@ static byte * qBri_check_FPGAsrc (PISDN_ADAPTER IoAdapter, char *FileName, ...@@ -249,12 +249,12 @@ static byte * qBri_check_FPGAsrc (PISDN_ADAPTER IoAdapter, char *FileName,
/******************************************************************************/ /******************************************************************************/
#define FPGA_PROG 0x0001 // PROG enable low #define FPGA_PROG 0x0001 /* PROG enable low */
#define FPGA_BUSY 0x0002 // BUSY high, DONE low #define FPGA_BUSY 0x0002 /* BUSY high, DONE low */
#define FPGA_CS 0x000C // Enable I/O pins #define FPGA_CS 0x000C /* Enable I/O pins */
#define FPGA_CCLK 0x0100 #define FPGA_CCLK 0x0100
#define FPGA_DOUT 0x0400 #define FPGA_DOUT 0x0400
#define FPGA_DIN FPGA_DOUT // bidirectional I/O #define FPGA_DIN FPGA_DOUT /* bidirectional I/O */
int qBri_FPGA_download (PISDN_ADAPTER IoAdapter) { int qBri_FPGA_download (PISDN_ADAPTER IoAdapter) {
int bit ; int bit ;
...@@ -296,9 +296,9 @@ int qBri_FPGA_download (PISDN_ADAPTER IoAdapter) { ...@@ -296,9 +296,9 @@ int qBri_FPGA_download (PISDN_ADAPTER IoAdapter) {
/* /*
* prepare download, pulse PROGRAM pin down. * prepare download, pulse PROGRAM pin down.
*/ */
WRITE_WORD(addr, baseval & ~FPGA_PROG) ; // PROGRAM low pulse WRITE_WORD(addr, baseval & ~FPGA_PROG) ; /* PROGRAM low pulse */
WRITE_WORD(addr, baseval) ; // release WRITE_WORD(addr, baseval) ; /* release */
diva_os_wait (50) ; // wait until FPGA finished internal memory clear diva_os_wait (50) ; /* wait until FPGA finished internal memory clear */
/* /*
* check done pin, must be low * check done pin, must be low
*/ */
...@@ -315,14 +315,14 @@ int qBri_FPGA_download (PISDN_ADAPTER IoAdapter) { ...@@ -315,14 +315,14 @@ int qBri_FPGA_download (PISDN_ADAPTER IoAdapter) {
{ {
val = ((word)File[code++]) << 3 ; val = ((word)File[code++]) << 3 ;
for ( bit = 8 ; bit-- > 0 ; val <<= 1 ) // put byte onto FPGA for ( bit = 8 ; bit-- > 0 ; val <<= 1 ) /* put byte onto FPGA */
{ {
baseval &= ~FPGA_DOUT ; // clr data bit baseval &= ~FPGA_DOUT ; /* clr data bit */
baseval |= (val & FPGA_DOUT) ; // copy data bit baseval |= (val & FPGA_DOUT) ; /* copy data bit */
WRITE_WORD(addr, baseval) ; WRITE_WORD(addr, baseval) ;
WRITE_WORD(addr, baseval | FPGA_CCLK) ; // set CCLK hi WRITE_WORD(addr, baseval | FPGA_CCLK) ; /* set CCLK hi */
WRITE_WORD(addr, baseval | FPGA_CCLK) ; // set CCLK hi WRITE_WORD(addr, baseval | FPGA_CCLK) ; /* set CCLK hi */
WRITE_WORD(addr, baseval) ; // set CCLK lo WRITE_WORD(addr, baseval) ; /* set CCLK lo */
} }
} }
xdiFreeFile (File) ; xdiFreeFile (File) ;
...@@ -868,7 +868,7 @@ static void disable_qBri_interrupt (PISDN_ADAPTER IoAdapter) { ...@@ -868,7 +868,7 @@ static void disable_qBri_interrupt (PISDN_ADAPTER IoAdapter) {
/* /*
* clear interrupt line (reset Local Interrupt Test Register) * clear interrupt line (reset Local Interrupt Test Register)
*/ */
IoAdapter->reset[PLX9054_INTCSR] = 0x00 ; // disable PCI interrupts IoAdapter->reset[PLX9054_INTCSR] = 0x00 ; /* disable PCI interrupts */
WRITE_DWORD(qBriIrq, MQ_IRQ_REQ_OFF) ; WRITE_DWORD(qBriIrq, MQ_IRQ_REQ_OFF) ;
} }
......
...@@ -459,9 +459,9 @@ static int bri_ISR (struct _ISDN_ADAPTER* IoAdapter) { ...@@ -459,9 +459,9 @@ static int bri_ISR (struct _ISDN_ADAPTER* IoAdapter) {
static void disable_bri_interrupt (PISDN_ADAPTER IoAdapter) { static void disable_bri_interrupt (PISDN_ADAPTER IoAdapter) {
if ( IoAdapter->reset ) if ( IoAdapter->reset )
{ {
outpp (IoAdapter->reset, 0x00) ; // disable interrupts ! outpp (IoAdapter->reset, 0x00) ; /* disable interrupts ! */
} }
outpp (IoAdapter->ctlReg, 0x00) ; // clear int, halt cpu outpp (IoAdapter->ctlReg, 0x00) ; /* clear int, halt cpu */
} }
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Fill card entry points Fill card entry points
......
...@@ -228,7 +228,7 @@ dsp_check_presence (volatile byte* addr, volatile byte* data, int dsp) ...@@ -228,7 +228,7 @@ dsp_check_presence (volatile byte* addr, volatile byte* data, int dsp)
static dword static dword
diva_pri_detect_dsps (PISDN_ADAPTER IoAdapter) diva_pri_detect_dsps (PISDN_ADAPTER IoAdapter)
{ {
// byte* base = a->resources.pci.addr[2]; /* byte* base = a->resources.pci.addr[2]; */
byte* base = IoAdapter->reset - MP_RESET ; byte* base = IoAdapter->reset - MP_RESET ;
dword ret = 0, DspCount = 0 ; dword ret = 0, DspCount = 0 ;
dword row_offset[] = { dword row_offset[] = {
...@@ -242,12 +242,12 @@ diva_pri_detect_dsps (PISDN_ADAPTER IoAdapter) ...@@ -242,12 +242,12 @@ diva_pri_detect_dsps (PISDN_ADAPTER IoAdapter)
byte *dsp_addr_port, *dsp_data_port, row_state; byte *dsp_addr_port, *dsp_data_port, row_state;
int dsp_row = 0, dsp_index, dsp_num; int dsp_row = 0, dsp_index, dsp_num;
IoAdapter->InitialDspInfo &= 0xffff ; IoAdapter->InitialDspInfo &= 0xffff ;
// if (!base || !a->xdi_adapter.reset) /* if (!base || !a->xdi_adapter.reset) */
if (!base || !IoAdapter->reset) if (!base || !IoAdapter->reset)
{ {
return (0); return (0);
} }
// *(volatile byte*)(a->xdi_adapter.reset) = _MP_RISC_RESET | _MP_DSP_RESET; /* *(volatile byte*)(a->xdi_adapter.reset) = _MP_RISC_RESET | _MP_DSP_RESET; */
*(volatile byte*)(IoAdapter->reset) = _MP_RISC_RESET | _MP_DSP_RESET; *(volatile byte*)(IoAdapter->reset) = _MP_RISC_RESET | _MP_DSP_RESET;
diva_os_wait (5) ; diva_os_wait (5) ;
for (dsp_num = 0; dsp_num < 30; dsp_num++) { for (dsp_num = 0; dsp_num < 30; dsp_num++) {
...@@ -264,7 +264,7 @@ diva_pri_detect_dsps (PISDN_ADAPTER IoAdapter) ...@@ -264,7 +264,7 @@ diva_pri_detect_dsps (PISDN_ADAPTER IoAdapter)
DspCount++ ; DspCount++ ;
} }
} }
// *(volatile byte*)(a->xdi_adapter.reset) = _MP_RISC_RESET | _MP_LED1 | _MP_LED2; /* *(volatile byte*)(a->xdi_adapter.reset) = _MP_RISC_RESET | _MP_LED1 | _MP_LED2; */
*(volatile byte*)(IoAdapter->reset) = _MP_RISC_RESET | _MP_LED1 | _MP_LED2; *(volatile byte*)(IoAdapter->reset) = _MP_RISC_RESET | _MP_LED1 | _MP_LED2;
diva_os_wait (50) ; diva_os_wait (50) ;
/* /*
......
This diff is collapsed.
...@@ -7,40 +7,38 @@ ...@@ -7,40 +7,38 @@
/* /*
interface between UM IDI core and OS dependent part interface between UM IDI core and OS dependent part
*/ */
int diva_user_mode_idi_init (void); int diva_user_mode_idi_init(void);
void diva_user_mode_idi_finit (void); void diva_user_mode_idi_finit(void);
int diva_um_idi_nr_of_adapters (void); int diva_um_idi_nr_of_adapters(void);
void* divas_um_idi_create_entity (dword adapter_nr, void* file); void *divas_um_idi_create_entity(dword adapter_nr, void *file);
int divas_um_idi_delete_entity (int adapter_nr, void* entity); int divas_um_idi_delete_entity(int adapter_nr, void *entity);
typedef int (*divas_um_idi_copy_to_user_fn_t)(void* os_handle, typedef int (*divas_um_idi_copy_to_user_fn_t) (void *os_handle,
void* dst, void *dst,
const void* src, const void *src,
int length); int length);
typedef int (*divas_um_idi_copy_from_user_fn_t)(void* os_handle, typedef int (*divas_um_idi_copy_from_user_fn_t) (void *os_handle,
void* dst, void *dst,
const void* src, const void *src,
int length); int length);
int diva_um_idi_read (void* entity, int diva_um_idi_read(void *entity,
void* os_handle, void *os_handle,
void* dst, void *dst,
int max_length, int max_length, divas_um_idi_copy_to_user_fn_t cp_fn);
divas_um_idi_copy_to_user_fn_t cp_fn);
int diva_um_idi_write(void *entity,
int diva_um_idi_write (void* entity, void *os_handle,
void* os_handle, const void *src,
const void* src, int length, divas_um_idi_copy_from_user_fn_t cp_fn);
int length,
divas_um_idi_copy_from_user_fn_t cp_fn); int diva_user_mode_idi_ind_ready(void *entity, void *os_handle);
void *diva_um_id_get_os_context(void *entity);
int diva_user_mode_idi_ind_ready (void* entity, void* os_handle); int diva_os_get_context_size(void);
void* diva_um_id_get_os_context (void* entity); int divas_um_idi_entity_assigned(void *entity);
int diva_os_get_context_size (void); int divas_um_idi_entity_start_remove(void *entity);
int divas_um_idi_entity_assigned (void* entity);
int divas_um_idi_entity_start_remove (void* entity); void diva_um_idi_start_wdog(void *entity);
void diva_um_idi_stop_wdog(void *entity);
void diva_um_idi_start_wdog (void* entity);
void diva_um_idi_stop_wdog (void* entity);
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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