Commit 9a276d67 authored by Armin Schindler's avatar Armin Schindler Committed by Linus Torvalds

[PATCH] ISDN Eicon driver: maint/trace fix and update

Fix of the debug/trace driver and removal of irq locks.

 - Only spinlocks[bh] are used now.
 - Removed obsolete direct debug /proc interface.
 - Update of internal trace features and its API.
 - Use common definition of MAX_DESCRIPTORS.
parent 4a435afe
/* $Id: capifunc.h,v 1.11 2004/03/20 17:19:58 armin Exp $
/* $Id: capifunc.h,v 1.11.4.1 2004/08/28 20:03:53 armin Exp $
*
* ISDN interface module for Eicon active cards DIVA.
* CAPI Interface common functions
......@@ -13,8 +13,6 @@
#ifndef __CAPIFUNC_H__
#define __CAPIFUNC_H__
#define MAX_DESCRIPTORS 32
#define DRRELMAJOR 2
#define DRRELMINOR 0
#define DRRELEXTRA ""
......
This diff is collapsed.
......@@ -57,12 +57,18 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d);
void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d);
int diva_mnt_shutdown_xdi_adapters (void);
#define DIVA_MAX_SELECTIVE_FILTER_LENGTH 127
int diva_set_trace_filter (int filter_length, const char* filter);
int diva_get_trace_filter (int max_length, char* filter);
#define DITRACE_CMD_GET_DRIVER_INFO 1
#define DITRACE_READ_DRIVER_DBG_MASK 2
#define DITRACE_WRITE_DRIVER_DBG_MASK 3
#define DITRACE_READ_TRACE_ENTRY 4
#define DITRACE_READ_TRACE_ENTRYS 5
#define DITRACE_WRITE_SELECTIVE_TRACE_FILTER 6
#define DITRACE_READ_SELECTIVE_TRACE_FILTER 7
/*
Trace lavels for debug via management interface
......
......@@ -232,7 +232,7 @@ typedef struct _DbgHandle_ *pDbgHandle ;
typedef void ( * DbgEnd) (pDbgHandle) ;
typedef void ( * DbgLog) (unsigned short, int, char *, va_list) ;
typedef void ( * DbgOld) (unsigned short, char *, va_list) ;
typedef void ( * DbgEv) (unsigned short, unsigned int, va_list) ;
typedef void ( * DbgEv) (unsigned short, unsigned long, va_list) ;
typedef void ( * DbgIrq) (unsigned short, int, char *, va_list) ;
typedef struct _DbgHandle_
{ char Registered ; /* driver successfull registered */
......@@ -259,7 +259,7 @@ typedef struct _DbgHandle_
void *pReserved3 ;
} _DbgHandle_ ;
extern _DbgHandle_ myDriverDebugHandle ;
typedef struct
typedef struct _OldDbgHandle_
{ struct _OldDbgHandle_ *next ;
void *pIrp ;
long regTime[2] ;
......@@ -310,7 +310,7 @@ typedef struct
unsigned long B_ChannelMask;
unsigned long LogBufferSize;
} CardTrace;
} u1;
}Data;
} _DbgExtendedInfo_;
#ifndef DIVA_NO_DEBUGLIB
/* -------------------------------------------------------------
......
/* $Id: diddfunc.c,v 1.14 2003/08/25 10:06:37 schindler Exp $
/* $Id: diddfunc.c,v 1.14.6.2 2004/08/28 20:03:53 armin Exp $
*
* DIDD Interface module for Eicon active cards.
*
......@@ -16,8 +16,6 @@
#include "dadapter.h"
#include "divasync.h"
#define MAX_DESCRIPTORS 32
#define DBG_MINIMUM (DL_LOG + DL_FTL + DL_ERR)
#define DBG_DEFAULT (DBG_MINIMUM + DL_XLOG + DL_REG)
......
/* $Id: diva_didd.c,v 1.13 2003/08/27 10:11:21 schindler Exp $
/* $Id: diva_didd.c,v 1.13.6.1 2004/08/28 20:03:53 armin Exp $
*
* DIDD Interface module for Eicon active cards.
*
......@@ -23,7 +23,7 @@
#include "divasync.h"
#include "did_vers.h"
static char *main_revision = "$Revision: 1.13 $";
static char *main_revision = "$Revision: 1.13.6.1 $";
static char *DRIVERNAME =
"Eicon DIVA - DIDD table (http://www.melware.net)";
......@@ -37,8 +37,6 @@ MODULE_AUTHOR("Cytronics & Melware, Eicon Networks");
MODULE_SUPPORTED_DEVICE("Eicon diva drivers");
MODULE_LICENSE("GPL");
#define MAX_DESCRIPTORS 32
#define DBG_MINIMUM (DL_LOG + DL_FTL + DL_ERR)
#define DBG_DEFAULT (DBG_MINIMUM + DL_XLOG + DL_REG)
......
/* $Id: divamnt.c,v 1.32 2004/01/15 09:48:13 armin Exp $
/* $Id: divamnt.c,v 1.32.6.5 2004/08/28 20:03:53 armin Exp $
*
* Driver for Eicon DIVA Server ISDN cards.
* Maint module
......@@ -17,8 +17,6 @@
#include <linux/sched.h>
#include <linux/smp_lock.h>
#include <linux/poll.h>
#include <linux/proc_fs.h>
#include <linux/skbuff.h>
#include <linux/devfs_fs_kernel.h>
#include "platform.h"
......@@ -26,7 +24,7 @@
#include "divasync.h"
#include "debug_if.h"
static char *main_revision = "$Revision: 1.32 $";
static char *main_revision = "$Revision: 1.32.6.5 $";
static int major;
......@@ -47,8 +45,7 @@ static char *DEVNAME = "DivasMAINT";
char *DRIVERRELEASE_MNT = "2.0";
static wait_queue_head_t msgwaitq;
static DECLARE_MUTEX(opened_sem);
static int opened;
static unsigned long opened;
static struct timeval start_time;
extern int mntfunc_init(int *, void **, unsigned long);
......@@ -73,20 +70,6 @@ static char *getrev(const char *revision)
return rev;
}
/*
* buffer alloc
*/
void *diva_os_malloc_tbuffer(unsigned long flags, unsigned long size)
{
return (kmalloc(size, GFP_KERNEL));
}
void diva_os_free_tbuffer(unsigned long flags, void *ptr)
{
if (ptr) {
kfree(ptr);
}
}
/*
* kernel/user space copy functions
*/
......@@ -131,154 +114,8 @@ void diva_os_get_time(dword * sec, dword * usec)
}
/*
* /proc entries
*/
extern struct proc_dir_entry *proc_net_eicon;
static struct proc_dir_entry *maint_proc_entry = NULL;
/*
Read function is provided for compatibility reason - this allows
to read unstructured traces, formated as ascii string only
*/
static ssize_t
maint_read(struct file *file, char __user *buf, size_t count, loff_t * off)
{
diva_dbg_entry_head_t *pmsg = NULL;
diva_os_spin_lock_magic_t old_irql;
word size;
char *pstr, *dli_label = "UNK";
int str_length;
int *str_msg;
if (!file->private_data) {
for (;;) {
while (
(pmsg =
diva_maint_get_message(&size,
&old_irql))) {
if (!(pmsg->facility == MSG_TYPE_STRING)) {
diva_maint_ack_message(1,
&old_irql);
} else {
break;
}
}
if (!pmsg) {
if (file->f_flags & O_NONBLOCK) {
return (-EAGAIN);
}
interruptible_sleep_on(&msgwaitq);
if (signal_pending(current)) {
return (-ERESTARTSYS);
}
} else {
break;
}
}
/*
The length of message that shoule be read is:
pmsg->data_length + label(25) + DrvID(2) + byte CR + trailing zero
* device node operations
*/
if (!
(str_msg =
(int *) diva_os_malloc_tbuffer(0,
pmsg->data_length +
29 + 2 * sizeof(int)))) {
diva_maint_ack_message(0, &old_irql);
return (-ENOMEM);
}
pstr = (char *) &str_msg[2];
switch (pmsg->dli) {
case DLI_LOG:
dli_label = "LOG";
break;
case DLI_FTL:
dli_label = "FTL";
break;
case DLI_ERR:
dli_label = "ERR";
break;
case DLI_TRC:
dli_label = "TRC";
break;
case DLI_REG:
dli_label = "REG";
break;
case DLI_MEM:
dli_label = "MEM";
break;
case DLI_SPL:
dli_label = "SPL";
break;
case DLI_IRP:
dli_label = "IRP";
break;
case DLI_TIM:
dli_label = "TIM";
break;
case DLI_TAPI:
dli_label = "TAPI";
break;
case DLI_NDIS:
dli_label = "NDIS";
break;
case DLI_CONN:
dli_label = "CONN";
break;
case DLI_STAT:
dli_label = "STAT";
break;
case DLI_PRV0:
dli_label = "PRV0";
break;
case DLI_PRV1:
dli_label = "PRV1";
break;
case DLI_PRV2:
dli_label = "PRV2";
break;
case DLI_PRV3:
dli_label = "PRV3";
break;
}
str_length = sprintf(pstr, "%s %02x %s\n",
dli_label, (byte) pmsg->drv_id,
(char *) &pmsg[1]);
str_msg[0] = str_length;
str_msg[1] = 0;
file->private_data = str_msg;
diva_maint_ack_message(1, &old_irql);
} else {
str_msg = (int *) file->private_data;
pstr = (char *) &str_msg[2];
pstr += str_msg[1]; /* head + offset */
str_length = str_msg[0] - str_msg[1]; /* length - offset */
}
str_length = MIN(str_length, count);
if (diva_os_copy_to_user(NULL, buf, pstr, str_length)) {
diva_os_free_tbuffer(0, str_msg);
file->private_data = NULL;
return (-EFAULT);
}
str_msg[1] += str_length;
if ((str_msg[0] - str_msg[1]) <= 0) {
diva_os_free_tbuffer(0, str_msg);
file->private_data = NULL;
}
return (str_length);
}
static ssize_t
maint_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
{
return (-ENODEV);
}
static unsigned int maint_poll(struct file *file, poll_table * wait)
{
unsigned int mask = 0;
......@@ -293,13 +130,10 @@ static unsigned int maint_poll(struct file *file, poll_table * wait)
static int maint_open(struct inode *ino, struct file *filep)
{
down(&opened_sem);
if (opened) {
up(&opened_sem);
/* only one open is allowed, so we test
it atomically */
if (test_and_set_bit(0, &opened))
return (-EBUSY);
}
opened++;
up(&opened_sem);
filep->private_data = NULL;
......@@ -309,54 +143,16 @@ static int maint_open(struct inode *ino, struct file *filep)
static int maint_close(struct inode *ino, struct file *filep)
{
if (filep->private_data) {
diva_os_free_tbuffer(0, filep->private_data);
filep->private_data = NULL;
diva_os_free(0, filep->private_data);
filep->private_data = 0;
}
down(&opened_sem);
opened--;
up(&opened_sem);
return (0);
}
/* clear 'used' flag */
clear_bit(0, &opened);
/*
* fops
*/
static struct file_operations maint_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.read = maint_read,
.write = maint_write,
.poll = maint_poll,
.open = maint_open,
.release = maint_close
};
static int DIVA_INIT_FUNCTION create_maint_proc(void)
{
maint_proc_entry =
create_proc_entry("maint", S_IFREG | S_IRUGO | S_IWUSR,
proc_net_eicon);
if (!maint_proc_entry)
return (0);
maint_proc_entry->proc_fops = &maint_fops;
maint_proc_entry->owner = THIS_MODULE;
return (1);
}
static void remove_maint_proc(void)
{
if (maint_proc_entry) {
remove_proc_entry("maint", proc_net_eicon);
maint_proc_entry = NULL;
}
}
/*
* device node operations
*/
static ssize_t divas_maint_write(struct file *file, const char __user *buf,
size_t count, loff_t * ppos)
{
......@@ -427,18 +223,10 @@ static int DIVA_INIT_FUNCTION maint_init(void)
ret = -EIO;
goto out;
}
if (!create_maint_proc()) {
printk(KERN_ERR "%s: failed to create proc entry.\n",
DRIVERLNAME);
divas_maint_unregister_chrdev();
ret = -EIO;
goto out;
}
if (!(mntfunc_init(&buffer_length, &buffer, diva_dbg_mem))) {
printk(KERN_ERR "%s: failed to connect to DIDD.\n",
DRIVERLNAME);
remove_maint_proc();
divas_maint_unregister_chrdev();
ret = -EIO;
goto out;
......@@ -457,7 +245,6 @@ static int DIVA_INIT_FUNCTION maint_init(void)
*/
static void DIVA_EXIT_FUNCTION maint_exit(void)
{
remove_maint_proc();
divas_maint_unregister_chrdev();
mntfunc_finit();
......@@ -466,3 +253,4 @@ static void DIVA_EXIT_FUNCTION maint_exit(void)
module_init(maint_init);
module_exit(maint_exit);
/* $Id: divasfunc.c,v 1.23 2004/04/08 01:17:57 armin Exp $
/* $Id: divasfunc.c,v 1.23.4.2 2004/08/28 20:03:53 armin Exp $
*
* Low level driver for Eicon DIVA Server ISDN cards.
*
......@@ -27,8 +27,6 @@ extern void DIVA_DIDD_Read(void *, int);
extern PISDN_ADAPTER IoAdapters[MAX_ADAPTER];
#define MAX_DESCRIPTORS 32
extern char *DRIVERRELEASE_DIVAS;
static dword notify_handle;
......
......@@ -31,33 +31,31 @@
#define IDI_SYNC_REQ_SET_POSTCALL 0x03
#define IDI_SYNC_REQ_GET_XLOG 0x04
#define IDI_SYNC_REQ_GET_FEATURES 0x05
/* Added for DIVA USB support */
#define IDI_SYNC_REQ_USB_REGISTER 0x06
#define IDI_SYNC_REQ_USB_RELEASE 0x07
#define IDI_SYNC_REQ_USB_ADD_DEVICE 0x08
#define IDI_SYNC_REQ_USB_START_DEVICE 0x09
#define IDI_SYNC_REQ_USB_STOP_DEVICE 0x0A
#define IDI_SYNC_REQ_USB_REMOVE_DEVICE 0x0B
/* Added for Diva Server Monitor */
#define IDI_SYNC_REQ_GET_CARDTYPE 0x0C
#define IDI_SYNC_REQ_GET_DBG_XLOG 0x0D
#define IDI_SYNC_REQ_GET_LINE_IDX 0x0E
#define DIVA_USB
#define DIVA_USB_REQ 0xAC
#define DIVA_USB_TEST 0xAB
#define DIVA_USB_ADD_ADAPTER 0xAC
#define DIVA_USB_REMOVE_ADAPTER 0xAD
/******************************************************************************/
#define IDI_SYNC_REQ_SERIAL_HOOK 0x80
#define IDI_SYNC_REQ_XCHANGE_STATUS 0x81
#define IDI_SYNC_REQ_USB_HOOK 0x82
#define IDI_SYNC_REQ_PORTDRV_HOOK 0x83
#define IDI_SYNC_REQ_SLI (0x84) /* SLI request from 3signal modem drivers */
#define IDI_SYNC_REQ_SLI 0x84 /* SLI request from 3signal modem drivers */
#define IDI_SYNC_REQ_RECONFIGURE 0x85
#define IDI_SYNC_REQ_RESET 0x86
#define IDI_SYNC_REQ_GET_85X_DEVICE_DATA 0x87
#define IDI_SYNC_REQ_LOCK_85X 0x88
#define IDI_SYNC_REQ_DIVA_85X_USB_DATA_EXCHANGE 0x99
#define IDI_SYNC_REQ_DIPORT_EXCHANGE_REQ 0x98
#define IDI_SYNC_REQ_GET_85X_EXT_PORT_TYPE 0xA0
#define IDI_SYNC_REQ_DIPORT_GET_85X_TX_CTRL_FN 0x98
/******************************************************************************/
#define IDI_SYNC_REQ_XDI_GET_EXTENDED_FEATURES 0x92
/*
......@@ -87,6 +85,8 @@ typedef struct _diva_xdi_get_extended_xdi_features {
#define DIVA_XDI_EXTENDED_FEATURE_CAPI_PRMS 0x08
#define DIVA_XDI_EXTENDED_FEATURE_NO_CANCEL_RC 0x10
#define DIVA_XDI_EXTENDED_FEATURE_RX_DMA 0x20
#define DIVA_XDI_EXTENDED_FEATURE_MANAGEMENT_DMA 0x40
#define DIVA_XDI_EXTENDED_FEATURE_WIDE_ID 0x80
#define DIVA_XDI_EXTENDED_FEATURES_MAX_SZ 1
/******************************************************************************/
#define IDI_SYNC_REQ_XDI_GET_ADAPTER_SDRAM_BAR 0x93
......@@ -115,6 +115,7 @@ typedef struct _diva_xdi_get_capi_parameters {
typedef struct _diva_xdi_get_logical_adapter_number {
dword logical_adapter_number;
dword controller;
dword total_controllers;
} diva_xdi_get_logical_adapter_number_s_t;
/******************************************************************************/
#define IDI_SYNC_REQ_UP1DM_OPERATION 0x96
......@@ -134,6 +135,7 @@ typedef struct _diva_xdi_dma_descriptor_operation {
#define IDI_SYNC_REQ_DIDD_ADD_ADAPTER 0x03
#define IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER 0x04
#define IDI_SYNC_REQ_DIDD_READ_ADAPTER_ARRAY 0x05
#define IDI_SYNC_REQ_DIDD_GET_CFG_LIB_IFC 0x10
typedef struct _diva_didd_adapter_notify {
dword handle; /* Notification handle */
void * callback;
......@@ -149,6 +151,9 @@ typedef struct _diva_didd_read_adapter_array {
void * buffer;
dword length;
} diva_didd_read_adapter_array_t;
typedef struct _diva_didd_get_cfg_lib_ifc {
void* ifc;
} diva_didd_get_cfg_lib_ifc_t;
/******************************************************************************/
#define IDI_SYNC_REQ_XDI_GET_STREAM 0x91
#define DIVA_XDI_SYNCHRONOUS_SERVICE 0x01
......@@ -466,6 +471,10 @@ typedef union
ENTITY e;
diva_didd_read_adapter_array_t info;
} didd_read_adapter_array;
struct {
ENTITY e;
diva_didd_get_cfg_lib_ifc_t info;
} didd_get_cfg_lib_ifc;
struct {
unsigned char Req;
unsigned char Rc;
......
/* $Id: idifunc.c,v 1.14.4.2 2004/05/09 16:42:20 armin Exp $
/* $Id: idifunc.c,v 1.14.4.4 2004/08/28 20:03:53 armin Exp $
*
* Driver for Eicon DIVA Server ISDN cards.
* User Mode IDI Interface
......@@ -25,8 +25,6 @@ extern void DIVA_DIDD_Read(void *, int);
extern int diva_user_mode_idi_create_adapter(const DESCRIPTOR *, int);
extern void diva_user_mode_idi_remove_adapter(int);
#define MAX_DESCRIPTORS 32
static dword notify_handle;
static DESCRIPTOR DAdapter;
static DESCRIPTOR MAdapter;
......
......@@ -77,6 +77,7 @@ static byte extended_xdi_features[DIVA_XDI_EXTENDED_FEATURES_MAX_SZ+1] = {
#if defined(DIVA_IDI_RX_DMA)
DIVA_XDI_EXTENDED_FEATURE_CMA |
DIVA_XDI_EXTENDED_FEATURE_RX_DMA |
DIVA_XDI_EXTENDED_FEATURE_MANAGEMENT_DMA |
#endif
DIVA_XDI_EXTENDED_FEATURE_NO_CANCEL_RC),
0
......@@ -226,8 +227,10 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
if (pI->descriptor_number >= 0) {
dword dma_magic;
void* local_addr;
#if 0
DBG_TRC(("A(%d) dma_alloc(%d)",
IoAdapter->ANum, pI->descriptor_number))
#endif
diva_get_dma_map_entry (\
(struct _diva_dma_map_entry*)IoAdapter->dma_map,
pI->descriptor_number,
......@@ -240,7 +243,9 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
}
} else if ((pI->operation == IDI_SYNC_REQ_DMA_DESCRIPTOR_FREE) &&
(pI->descriptor_number >= 0)) {
#if 0
DBG_TRC(("A(%d) dma_free(%d)", IoAdapter->ANum, pI->descriptor_number))
#endif
diva_free_dma_map_entry((struct _diva_dma_map_entry*)IoAdapter->dma_map,
pI->descriptor_number);
pI->descriptor_number = -1;
......@@ -257,6 +262,7 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
&syncReq->xdi_logical_adapter_number.info;
pI->logical_adapter_number = IoAdapter->ANum;
pI->controller = IoAdapter->ControllerNumber;
pI->total_controllers = IoAdapter->Properties.Adapters;
} return;
case IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS: {
diva_xdi_get_capi_parameters_t prms, *pI = &syncReq->xdi_capi_prms.info;
......@@ -318,6 +324,16 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
}
syncReq->GetSerial.serial = 0 ;
break ;
case IDI_SYNC_REQ_GET_CARDTYPE:
if ( IoAdapter )
{
syncReq->GetCardType.cardtype = IoAdapter->cardType ;
DBG_TRC(("xdi: Adapter %d / CardType %ld",
IoAdapter->ANum, IoAdapter->cardType))
return ;
}
syncReq->GetCardType.cardtype = 0 ;
break ;
case IDI_SYNC_REQ_GET_XLOG:
if ( IoAdapter )
{
......@@ -326,6 +342,14 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
}
e->Ind = 0 ;
break ;
case IDI_SYNC_REQ_GET_DBG_XLOG:
if ( IoAdapter )
{
pcm_req (IoAdapter, e) ;
return ;
}
e->Ind = 0 ;
break ;
case IDI_SYNC_REQ_GET_FEATURES:
if ( IoAdapter )
{
......@@ -345,7 +369,9 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
}
if ( IoAdapter )
{
#if 0
DBG_FTL(("xdi: unknown Req 0 / Rc %d !", e->Rc))
#endif
return ;
}
}
......@@ -496,7 +522,7 @@ pcm_req (PISDN_ADAPTER IoAdapter, ENTITY *e)
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock,
&OldIrql,
"data_pcm_1");
IoAdapter->pcm_data = (unsigned long)pcm;
IoAdapter->pcm_data = (void *)pcm;
IoAdapter->pcm_pending = 1;
diva_os_schedule_soft_isr (&IoAdapter->req_soft_isr);
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock,
......@@ -510,7 +536,7 @@ pcm_req (PISDN_ADAPTER IoAdapter, ENTITY *e)
&OldIrql,
"data_pcm_3");
IoAdapter->pcm_pending = 0;
IoAdapter->pcm_data = 0;
IoAdapter->pcm_data = NULL ;
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock,
&OldIrql,
"data_pcm_3");
......@@ -528,7 +554,7 @@ pcm_req (PISDN_ADAPTER IoAdapter, ENTITY *e)
&OldIrql,
"data_pcm_4");
IoAdapter->pcm_pending = 0;
IoAdapter->pcm_data = 0;
IoAdapter->pcm_data = NULL ;
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock,
&OldIrql,
"data_pcm_4");
......@@ -839,21 +865,21 @@ void CALLBACK(ADAPTER * a, ENTITY * e)
/* --------------------------------------------------------------------------
routines for aligned reading and writing on RISC
-------------------------------------------------------------------------- */
void outp_words_from_buffer (word* adr, byte* P, word len)
void outp_words_from_buffer (word* adr, byte* P, dword len)
{
word i = 0;
dword i = 0;
word w;
while (i < (len & 0xfffe)) {
while (i < (len & 0xfffffffe)) {
w = P[i++];
w += (P[i++])<<8;
outppw (adr, w);
}
}
void inp_words_to_buffer (word* adr, byte* P, word len)
void inp_words_to_buffer (word* adr, byte* P, dword len)
{
word i = 0;
dword i = 0;
word w;
while (i < (len & 0xfffe)) {
while (i < (len & 0xfffffffe)) {
w = inppw (adr);
P[i++] = (byte)(w);
P[i++] = (byte)(w>>8);
......
......@@ -39,6 +39,14 @@ typedef struct {
DEVICE_NAME DeviceName[4] ;
PISDN_ADAPTER QuadroAdapter[4] ;
} ADAPTER_LIST_ENTRY, *PADAPTER_LIST_ENTRY ;
/* --------------------------------------------------------------------------
Special OS memory support structures
-------------------------------------------------------------------------- */
#define MAX_MAPPED_ENTRIES 8
typedef struct {
void * Address;
dword Length;
} ADAPTER_MEMORY ;
/* --------------------------------------------------------------------------
Configuration of XDI clients carried by XDI
-------------------------------------------------------------------------- */
......@@ -52,6 +60,7 @@ typedef struct _diva_xdi_capi_cfg {
-------------------------------------------------------------------------- */
struct _ISDN_ADAPTER {
void (* DIRequest)(PISDN_ADAPTER, ENTITY *) ;
int State ; /* from NT4 1.srv, a good idea, but a poor achievment */
int Initialized ;
int RegisteredWithDidd ;
int Unavailable ; /* callback function possible? */
......@@ -63,6 +72,7 @@ struct _ISDN_ADAPTER {
/*
remember mapped memory areas
*/
ADAPTER_MEMORY MappedMemory[MAX_MAPPED_ENTRIES] ;
CARD_PROPERTIES Properties ;
dword cardType ;
dword protocol_id ; /* configured protocol identifier */
......@@ -105,6 +115,7 @@ struct _ISDN_ADAPTER {
char *ProtocolSuffix ; /* internal protocolfile table */
char Archive[32] ;
char Protocol[32] ;
char AddDownload[32] ; /* Dsp- or other additional download files */
char Oad1[ISDN_MAX_NUM_LEN] ;
char Osa1[ISDN_MAX_NUM_LEN] ;
char Oad2[ISDN_MAX_NUM_LEN] ;
......@@ -153,8 +164,26 @@ struct _ISDN_ADAPTER {
byte ModemCarrierWaitTimeSec;
byte ModemCarrierLossWaitTimeTenthSec;
byte PiafsLinkTurnaroundInFrames;
byte DiscAfterProgress;
byte AniDniLimiter[3];
byte TxAttenuation; /* PRI/E1 only: attenuate TX signal */
word QsigFeatures;
dword GenerateRingtone ;
dword SupplementaryServicesFeatures;
dword R2Dialect;
dword R2CasOptions;
dword FaxV34Options;
dword DisabledDspMask;
dword AdapterTestMask;
dword DspImageLength;
word AlertToIn20mSecTicks;
word ModemEyeSetup;
byte R2CtryLength;
byte CCBSRelTimer;
byte *PcCfgBufferFile;/* flexible parameter via file */
byte *PcCfgBuffer ; /* flexible parameter via multistring */
diva_os_dump_file_t dump_file; /* dump memory to file at lowest irq level */
diva_os_board_trace_t board_trace ; /* traces from the board */
diva_os_spin_lock_t isr_spin_lock;
diva_os_spin_lock_t data_spin_lock;
diva_os_soft_isr_t req_soft_isr;
......@@ -180,15 +209,21 @@ struct _ISDN_ADAPTER {
void (* stop)(PISDN_ADAPTER) ;
void (* rstFnc)(PISDN_ADAPTER) ;
void (* trapFnc)(PISDN_ADAPTER) ;
dword (* DetectDsps)(PISDN_ADAPTER) ;
void (* os_trap_nfy_Fnc)(PISDN_ADAPTER, dword) ;
diva_os_isr_callback_t diva_isr_handler;
dword sdram_bar;
dword sdram_bar; /* must be 32 bit */
dword fpga_features;
volatile int pcm_pending;
volatile unsigned long pcm_data;
volatile void * pcm_data;
diva_xdi_capi_cfg_t capi_cfg;
dword tasks;
void* dma_map;
void *dma_map;
int (*DivaAdapterTestProc)(PISDN_ADAPTER);
void *AdapterTestMemoryStart;
dword AdapterTestMemoryLength;
const byte* cfg_lib_memory_init;
dword cfg_lib_memory_init_length;
};
/* ---------------------------------------------------------------------
Entity table
......@@ -219,8 +254,8 @@ struct s_load {
/* ---------------------------------------------------------------------
Functions for port io
--------------------------------------------------------------------- */
void outp_words_from_buffer (word* adr, byte* P, word len);
void inp_words_to_buffer (word* adr, byte* P, word len);
void outp_words_from_buffer (word* adr, byte* P, dword len);
void inp_words_to_buffer (word* adr, byte* P, dword len);
/* ---------------------------------------------------------------------
platform specific conversions
--------------------------------------------------------------------- */
......@@ -240,6 +275,10 @@ void io_out(ADAPTER * a, void * adr, byte data);
void io_outw(ADAPTER * a, void * adr, word data);
void io_out_buffer(ADAPTER * a, void * adr, void * P, word length);
void io_inc(ADAPTER * a, void * adr);
void bri_in_buffer (PISDN_ADAPTER IoAdapter, dword Pos,
void *Buf, dword Len);
int bri_out_buffer (PISDN_ADAPTER IoAdapter, dword Pos,
void *Buf, dword Len, int Verify);
/* ---------------------------------------------------------------------
ram access functions for memory mapped cards
--------------------------------------------------------------------- */
......
......@@ -337,13 +337,60 @@ static int SuperTraceMessageInput (void* hLib) {
pLib->e.RNum = 1;
pLib->e.R->P = (byte*)&pLib->buffer[0];
pLib->e.R->PLength = (word)(sizeof(pLib->buffer) - 1);
} else {
/*
Indication reception complete, process it now
*/
byte* p = (byte*)&pLib->buffer[0];
pLib->buffer[pLib->e.R->PLength] = 0; /* terminate I.E. with zero */
switch (Ind) {
case MAN_COMBI_IND: {
int total_length = pLib->e.R->PLength;
word this_ind_length;
while (total_length > 3 && *p) {
Ind = *p++;
this_ind_length = (word)p[0] | ((word)p[1] << 8);
p += 2;
switch (Ind) {
case MAN_INFO_IND:
if (process_idi_info (pLib, (diva_man_var_header_t*)p)) {
return (-1);
}
break;
case MAN_EVENT_IND:
if (process_idi_event (pLib, (diva_man_var_header_t*)p)) {
return (-1);
}
break;
case MAN_TRACE_IND:
if (pLib->trace_on == 1) {
/*
Ignore first trace event that is result of
EVENT_ON operation
*/
pLib->trace_on++;
} else {
/*
Delivery XLOG buffer to application
*/
if (pLib->user_proc_table.trace_proc) {
(*(pLib->user_proc_table.trace_proc))(pLib->user_proc_table.user_context,
&pLib->instance, pLib->Adapter,
p, this_ind_length);
}
}
break;
default:
diva_mnt_internal_dprintf (0, DLI_ERR, "Unknon IDI Ind (DMA mode): %02x", Ind);
}
p += (this_ind_length+1);
total_length -= (4 + this_ind_length);
}
} break;
case MAN_INFO_IND:
if (process_idi_info (pLib, (diva_man_var_header_t*)p)) {
return (-1);
......
......@@ -49,6 +49,8 @@ typedef struct _diva_strace_path2action {
void* variable; /* Variable that will receive value */
} diva_strace_path2action_t;
#define DIVA_MAX_MANAGEMENT_TRANSFER_SIZE 4096
typedef struct _diva_strace_context {
diva_strace_library_interface_t instance;
......@@ -62,7 +64,7 @@ typedef struct _diva_strace_context {
IDI_CALL request;
BUFFERS XData;
BUFFERS RData;
byte buffer[2048+512+1];
byte buffer[DIVA_MAX_MANAGEMENT_TRANSFER_SIZE + 1];
int removal_state;
int general_b_ch_event;
int general_fax_event;
......
/* $Id: mntfunc.c,v 1.19 2004/01/09 21:22:03 armin Exp $
/* $Id: mntfunc.c,v 1.19.6.2 2004/08/28 20:03:53 armin Exp $
*
* Driver for Eicon DIVA Server ISDN cards.
* Maint module
......@@ -23,17 +23,12 @@ extern char *DRIVERRELEASE_MNT;
extern void DIVA_DIDD_Read(void *, int);
#define MAX_DESCRIPTORS 32
static dword notify_handle;
static DESCRIPTOR DAdapter;
static DESCRIPTOR MAdapter;
static DESCRIPTOR MaintDescriptor =
{ IDI_DIMAINT, 0, 0, (IDI_CALL) diva_maint_prtComp };
extern void *diva_os_malloc_tbuffer(unsigned long flags,
unsigned long size);
extern void diva_os_free_tbuffer(unsigned long flags, void *ptr);
extern int diva_os_copy_to_user(void *os_handle, void __user *dst,
const void *src, int length);
extern int diva_os_copy_from_user(void *os_handle, void *dst,
......@@ -46,16 +41,6 @@ static void no_printf(unsigned char *x, ...)
#include "debuglib.c"
/*
* stop debug
*/
static void stop_dbg(void)
{
DbgDeregister();
memset(&MAdapter, 0, sizeof(MAdapter));
dprintf = no_printf;
}
/*
* DIDD callback function
*/
......@@ -66,7 +51,9 @@ static void *didd_callback(void *context, DESCRIPTOR * adapter,
DBG_ERR(("cb: Change in DAdapter ? Oops ?."));
} else if (adapter->type == IDI_DIMAINT) {
if (removal) {
stop_dbg();
DbgDeregister();
memset(&MAdapter, 0, sizeof(MAdapter));
dprintf = no_printf;
} else {
memcpy(&MAdapter, adapter, sizeof(MAdapter));
dprintf = (DIVA_DI_PRINTF) MAdapter.request;
......@@ -131,8 +118,6 @@ static void DIVA_EXIT_FUNCTION disconnect_didd(void)
{
IDI_SYNC_REQ req;
stop_dbg();
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;
......@@ -193,34 +178,63 @@ int maint_read_write(void __user *buf, int count)
}
break;
/*
Filter commands will ignore the ID due to fact that filtering affects
the B- channel and Audio Tap trace levels only. Also MAINT driver will
select the right trace ID by itself
*/
case DITRACE_WRITE_SELECTIVE_TRACE_FILTER:
if (!mask) {
ret = diva_set_trace_filter (1, "*");
} else if (mask < sizeof(data)) {
if (copy_from_user((void *)&data[0], (void *)(((byte*)buf)+12), mask)) {
ret = -EFAULT;
} else {
ret = diva_set_trace_filter ((int)mask, data);
}
} else {
ret = -EINVAL;
}
break;
case DITRACE_READ_SELECTIVE_TRACE_FILTER:
if ((ret = diva_get_trace_filter (sizeof(data), data)) > 0) {
if (copy_to_user ((void*)buf, (void*)&data[0], ret))
ret = -EFAULT;
} else {
ret = -ENODEV;
}
break;
case DITRACE_READ_TRACE_ENTRY:{
diva_os_spin_lock_magic_t old_irql;
word size;
diva_dbg_entry_head_t *pmsg;
byte *pbuf;
if ((pmsg = diva_maint_get_message(&size, &old_irql))) {
if (!(pbuf = diva_os_malloc(0, mask))) {
return (-ENOMEM);
}
for(;;) {
if (!(pmsg =
diva_maint_get_message(&size, &old_irql))) {
break;
}
if (size > mask) {
diva_maint_ack_message(0, &old_irql);
ret = -EINVAL;
} else {
if (!(pbuf = diva_os_malloc_tbuffer(0, size)))
{
diva_maint_ack_message(0, &old_irql);
ret = -ENOMEM;
} else {
break;
}
ret = size;
memcpy(pbuf, pmsg, size);
diva_maint_ack_message(1, &old_irql);
if ((count < size) || diva_os_copy_to_user (NULL, buf,
(void *) pbuf, size))
if ((count < size) ||
diva_os_copy_to_user (NULL, buf, (void *) pbuf, size))
ret = -EFAULT;
diva_os_free_tbuffer(0, pbuf);
}
}
} else {
ret = 0;
break;
}
diva_os_free(0, pbuf);
}
break;
......@@ -235,7 +249,7 @@ int maint_read_write(void __user *buf, int count)
ret = -EINVAL;
break;
}
if (!(pbuf = diva_os_malloc_tbuffer(0, mask))) {
if (!(pbuf = diva_os_malloc(0, mask))) {
return (-ENOMEM);
}
......@@ -273,7 +287,7 @@ int maint_read_write(void __user *buf, int count)
} else {
ret = written;
}
diva_os_free_tbuffer(0, pbuf);
diva_os_free(0, pbuf);
}
break;
......@@ -302,7 +316,7 @@ int DIVA_INIT_FUNCTION mntfunc_init(int *buffer_length, void **buffer,
} else {
while ((*buffer_length >= (64 * 1024))
&&
(!(*buffer = diva_os_malloc_tbuffer(0, *buffer_length)))) {
(!(*buffer = diva_os_malloc (0, *buffer_length)))) {
*buffer_length -= 1024;
}
......@@ -314,7 +328,7 @@ int DIVA_INIT_FUNCTION mntfunc_init(int *buffer_length, void **buffer,
if (diva_maint_init(*buffer, *buffer_length, (diva_dbg_mem == 0))) {
if (!diva_dbg_mem) {
diva_os_free_tbuffer(0, *buffer);
diva_os_free (0, *buffer);
}
DBG_ERR(("init: maint init failed"));
return (0);
......@@ -324,7 +338,7 @@ int DIVA_INIT_FUNCTION mntfunc_init(int *buffer_length, void **buffer,
DBG_ERR(("init: failed to connect to DIDD."));
diva_maint_finit();
if (!diva_dbg_mem) {
diva_os_free_tbuffer(0, *buffer);
diva_os_free (0, *buffer);
}
return (0);
}
......@@ -339,6 +353,8 @@ void DIVA_EXIT_FUNCTION mntfunc_finit(void)
void *buffer;
int i = 100;
DbgDeregister();
while (diva_mnt_shutdown_xdi_adapters() && i--) {
diva_os_sleep(10);
}
......@@ -346,6 +362,9 @@ void DIVA_EXIT_FUNCTION mntfunc_finit(void)
disconnect_didd();
if ((buffer = diva_maint_finit())) {
diva_os_free_tbuffer(0, buffer);
diva_os_free (0, buffer);
}
memset(&MAdapter, 0, sizeof(MAdapter));
dprintf = no_printf;
}
......@@ -143,6 +143,7 @@ struct dual
#define N_DATA_ACK 12 /* data ack ind for D-bit procedure */
#define N_EDATA_ACK 13 /* data ack ind for INTERRUPT */
#define N_XON 15 /* clear RNR state */
#define N_COMBI_IND N_XON /* combined indication */
#define N_Q_BIT 0x10 /* Q-bit for req/ind */
#define N_M_BIT 0x20 /* M-bit for req/ind */
#define N_D_BIT 0x40 /* D-bit for req/ind */
......@@ -228,6 +229,10 @@ struct dual
#define VSWITCH_IND 66 /* capifunctions for D-CH-switching */
#define MWI_POLL 67 /* Message Waiting Status Request fkt */
#define CALL_PEND_NOTIFY 68 /* notify capi to set new listen */
#define DO_NOTHING 69 /* dont do somethin if you get this */
#define INT_CT_REJ 70 /* ECT rejected internal command */
#define CALL_HOLD_COMPLETE 71 /* In NT Mode indicate hold complete */
#define CALL_RETRIEVE_COMPLETE 72 /* In NT Mode indicate retrieve complete */
/*------------------------------------------------------------------*/
/* management service primitives */
/*------------------------------------------------------------------*/
......@@ -241,6 +246,7 @@ struct dual
#define MAN_INFO_IND 2
#define MAN_EVENT_IND 3
#define MAN_TRACE_IND 4
#define MAN_COMBI_IND 9
#define MAN_ESC 0x80
/*------------------------------------------------------------------*/
/* return code coding */
......@@ -265,6 +271,7 @@ struct dual
/*------------------------------------------------------------------*/
#define SHIFT 0x90 /* codeset shift */
#define MORE 0xa0 /* more data */
#define SDNCMPL 0xa1 /* sending complete */
#define CL 0xb0 /* congestion level */
/* codeset 0 */
#define SMSG 0x00 /* segmented message */
......@@ -288,6 +295,8 @@ struct dual
#define RDX 0x73 /* redirecting number extended */
#define RDN 0x74 /* redirecting number */
#define RIN 0x76 /* redirection number */
#define IUP 0x76 /* VN6 rerouter->PCS (codeset 6) */
#define IPU 0x77 /* VN6 PCS->rerouter (codeset 6) */
#define RI 0x79 /* restart indicator */
#define MIE 0x7a /* management info element */
#define LLC 0x7c /* low layer compatibility */
......@@ -296,6 +305,8 @@ struct dual
#define ESC 0x7f /* escape extension */
#define DLC 0x20 /* data link layer configuration */
#define NLC 0x21 /* network layer configuration */
#define REDIRECT_IE 0x22 /* redirection request/indication data */
#define REDIRECT_NET_IE 0x23 /* redirection network override data */
/* codeset 6 */
#define SIN 0x01 /* service indicator */
#define CIF 0x02 /* charging information */
......@@ -306,6 +317,7 @@ struct dual
/*------------------------------------------------------------------*/
#define MSGTYPEIE 0x7a /* Messagetype info element */
#define CRIE 0x7b /* INFO info element */
#define CODESET6IE 0xec /* Tunnel for Codeset 6 IEs */
#define VSWITCHIE 0xed /* VSwitch info element */
#define SSEXTIE 0xee /* Supplem. Service info element */
#define PROFILEIE 0xef /* Profile info element */
......@@ -344,6 +356,13 @@ struct dual
#define CCBS_REQUEST 0x32
#define CCBS_DEACTIVATE 0x33
#define CCBS_INTERROGATE 0x34
#define CCBS_STATUS 0x35
#define CCBS_ERASE 0x36
#define CCBS_B_FREE 0x37
#define CCNR_INFO_RETAIN 0x38
#define CCBS_REMOTE_USER_FREE 0x39
#define CCNR_REQUEST 0x3a
#define CCNR_INTERROGATE 0x3b
#define GET_SUPPORTED_SERVICES 0xff
#define DIVERSION_PROCEDURE_CFU 0x70
#define DIVERSION_PROCEDURE_CFB 0x71
......@@ -362,6 +381,7 @@ struct dual
#define SMASK_3PTY 0x00000008
#define SMASK_CALL_FORWARDING 0x00000010
#define SMASK_CALL_DEFLECTION 0x00000020
#define SMASK_MCID 0x00000040
#define SMASK_CCBS 0x00000080
#define SMASK_MWI 0x00000100
#define SMASK_CCNR 0x00000200
......@@ -406,6 +426,8 @@ struct dual
#define RTPL2_IN 13 /* RTP layer-2 protocol, incomming */
#define RTPL2 14 /* RTP layer-2 protocol */
#define V120_V42BIS 15 /* V.120 asynchronous mode supporting V.42bis compression */
#define LISTENER 27 /* Layer 2 to listen line */
#define MTP2 28 /* MTP2 Layer 2 */
#define PIAFS_CRC 29 /* PIAFS Layer 2 with CRC calculation at L2 */
/* ------------------------------------------------------
PIAFS DLC DEFINITIONS
......@@ -506,6 +528,22 @@ Byte | 8 7 6 5 4 3 2 1
| | | data transfer. |
+---------------------+------+-----------------------------------------+
*/
/* ------------------------------------------------------
LISTENER DLC DEFINITIONS
------------------------------------------------------ */
#define LISTENER_FEATURE_MASK_CUMMULATIVE 0x0001
/* ------------------------------------------------------
LISTENER META-FRAME CODE/PRIMITIVE DEFINITIONS
------------------------------------------------------ */
#define META_CODE_LL_UDATA_RX 0x01
#define META_CODE_LL_UDATA_TX 0x02
#define META_CODE_LL_DATA_RX 0x03
#define META_CODE_LL_DATA_TX 0x04
#define META_CODE_LL_MDATA_RX 0x05
#define META_CODE_LL_MDATA_TX 0x06
#define META_CODE_EMPTY 0x10
#define META_CODE_LOST_FRAMES 0x11
#define META_FLAG_TRUNCATED 0x0001
/*------------------------------------------------------------------*/
/* CAPI-like profile to indicate features on LAW_REQ */
/*------------------------------------------------------------------*/
......@@ -577,6 +615,14 @@ Byte | 8 7 6 5 4 3 2 1
#define MANUFACTURER_FEATURE_DMACONNECT 0x04000000L
#define MANUFACTURER_FEATURE_AUDIO_TAP 0x08000000L
#define MANUFACTURER_FEATURE_FAX_NONSTANDARD 0x10000000L
#define MANUFACTURER_FEATURE_SS7 0x20000000L
#define MANUFACTURER_FEATURE_MADAPTER 0x40000000L
#define MANUFACTURER_FEATURE_MEASURE 0x80000000L
#define MANUFACTURER_FEATURE2_LISTENING 0x00000001L
#define MANUFACTURER_FEATURE2_SS_DIFFCONTPOSSIBLE 0x00000002L
#define MANUFACTURER_FEATURE2_GENERIC_TONE 0x00000004L
#define MANUFACTURER_FEATURE2_COLOR_FAX 0x00000008L
#define MANUFACTURER_FEATURE2_SS_ECT_DIFFCONTPOSSIBLE 0x00000010L
#define RTP_PRIM_PAYLOAD_PCMU_8000 0
#define RTP_PRIM_PAYLOAD_1016_8000 1
#define RTP_PRIM_PAYLOAD_G726_32_8000 2
......@@ -624,6 +670,15 @@ Byte | 8 7 6 5 4 3 2 1
#define VSINVOKEID 4
#define VSCLMRKS 5
#define VSTBCTIDENT 6
#define VSETSILINKID 7
#define VSSAMECONTROLLER 8
/* Errorcodes for VSETSILINKID begin */
#define VSETSILINKIDRRWC 1
#define VSETSILINKIDREJECT 2
#define VSETSILINKIDTIMEOUT 3
#define VSETSILINKIDFAILCOUNT 4
#define VSETSILINKIDERROR 5
/* Errorcodes for VSETSILINKID end */
/* -----------------------------------------------------------**
** The PROTOCOL_FEATURE_STRING in feature.h (included **
** in prstart.sx and astart.sx) defines capabilities and **
......@@ -647,5 +702,37 @@ Byte | 8 7 6 5 4 3 2 1
#define PROTCAP_FREE13 0x2000 /* not used */
#define PROTCAP_FREE14 0x4000 /* not used */
#define PROTCAP_EXTENSION 0x8000 /* used for future extentions */
/* -----------------------------------------------------------* */
/* Onhook data transmission ETS30065901 */
/* Message Type */
/*#define RESERVED4 0x4*/
#define CALL_SETUP 0x80
#define MESSAGE_WAITING_INDICATOR 0x82
/*#define RESERVED84 0x84*/
/*#define RESERVED85 0x85*/
#define ADVICE_OF_CHARGE 0x86
/*1111 0001
to
1111 1111
F1H - Reserved for network operator use
to
FFH*/
/* Parameter Types */
#define DATE_AND_TIME 1
#define CLI_PARAMETER_TYPE 2
#define CALLED_DIRECTORY_NUMBER_PARAMETER_TYPE 3
#define REASON_FOR_ABSENCE_OF_CLI_PARAMETER_TYPE 4
#define NAME_PARAMETER_TYPE 7
#define REASON_FOR_ABSENCE_OF_CALLING_PARTY_NAME_PARAMETER_TYPE 8
#define VISUAL_INDICATOR_PARAMETER_TYPE 0xb
#define COMPLEMENTARY_CLI_PARAMETER_TYPE 0x10
#define CALL_TYPE_PARAMETER_TYPE 0x11
#define FIRST_CALLED_LINE_DIRECTORY_NUMBER_PARAMETER_TYPE 0x12
#define NETWORK_MESSAGE_SYSTEM_STATUS_PARAMETER_TYPE 0x13
#define FORWARDED_CALL_TYPE_PARAMETER_TYPE 0x15
#define TYPE_OF_CALLING_USER_PARAMETER_TYPE 0x16
#define REDIRECTING_NUMBER_PARAMETER_TYPE 0x1a
#define EXTENSION_FOR_NETWORK_OPERATOR_USE_PARAMETER_TYPE 0xe0
/* -----------------------------------------------------------* */
#else
#endif /* PC_H_INCLUDED } */
/* $Id: platform.h,v 1.37.4.1 2004/07/28 14:47:21 armin Exp $
/* $Id: platform.h,v 1.37.4.2 2004/08/28 20:03:53 armin Exp $
*
* platform.h
*
......@@ -269,20 +269,6 @@ static __inline__ void diva_os_leave_spin_lock (diva_os_spin_lock_t* a, \
diva_os_spin_lock_magic_t* old_irql, \
void* dbg) { spin_unlock_bh(a); }
static __inline__ void diva_os_enter_spin_lock_hard (diva_os_spin_lock_t* a, \
diva_os_spin_lock_magic_t* old_irql, \
void* dbg) { \
unsigned long flags; \
spin_lock_irqsave (a, flags); \
*old_irql = (diva_os_spin_lock_magic_t)flags; \
}
static __inline__ void diva_os_leave_spin_lock_hard (diva_os_spin_lock_t* a, \
diva_os_spin_lock_magic_t* old_irql, \
void* dbg) { \
unsigned long flags = (unsigned long)*old_irql; \
spin_unlock_irqrestore (a, flags); \
}
#define diva_os_destroy_spin_lock(a,b) do { } while(0)
/*
......@@ -347,12 +333,18 @@ diva_os_atomic_decrement(diva_os_atomic_t* pv)
#define DIVA_IDI_RX_DMA 1
/*
** endian macros
*/
#define READ_WORD(addr) readw(addr)
#define READ_DWORD(addr) readl(addr)
#define WRITE_WORD(addr,v) writew(v,addr)
#define WRITE_DWORD(addr,v) writel(v,addr)
/*
** 32/64 bit macors
*/
#ifdef BITS_PER_LONG
#if BITS_PER_LONG > 32
#define PLATFORM_GT_32BIT
......@@ -360,8 +352,23 @@ diva_os_atomic_decrement(diva_os_atomic_t* pv)
#endif
#endif
/*
** undef os definitions of macros we use
*/
#undef ID_MASK
#undef N_DATA
#undef ADDR
/*
** dump file
*/
#define diva_os_dump_file_t char
#define diva_os_board_trace_t char
#define diva_os_dump_file(__x__) do { } while(0)
/*
** size of internal arrays
*/
#define MAX_DESCRIPTORS 64
#endif /* __PLATFORM_H__ */
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