rebase on mainstream patchset 2.6.9
This commit is contained in:
parent
2bed1074f1
commit
5eafc1b73c
|
@ -434,7 +434,10 @@ act2000_isa_download(act2000_card * card, act2000_ddef __user * cb)
|
||||||
l = (length > 1024) ? 1024 : length;
|
l = (length > 1024) ? 1024 : length;
|
||||||
c = 0;
|
c = 0;
|
||||||
b = buf;
|
b = buf;
|
||||||
copy_from_user(buf, p, l);
|
if (copy_from_user(buf, p, l)) {
|
||||||
|
kfree(buf);
|
||||||
|
return -EFAULT;
|
||||||
|
}
|
||||||
while (c < l) {
|
while (c < l) {
|
||||||
if (act2000_isa_writeb(card, *b++)) {
|
if (act2000_isa_writeb(card, *b++)) {
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
|
|
|
@ -436,51 +436,62 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
|
||||||
struct sk_buff *nskb;
|
struct sk_buff *nskb;
|
||||||
int datalen;
|
int datalen;
|
||||||
u16 errcode, datahandle;
|
u16 errcode, datahandle;
|
||||||
|
struct tty_ldisc *ld;
|
||||||
|
|
||||||
datalen = skb->len - CAPIMSG_LEN(skb->data);
|
datalen = skb->len - CAPIMSG_LEN(skb->data);
|
||||||
if (mp->tty) {
|
if (mp->tty == NULL)
|
||||||
if (mp->tty->ldisc.receive_buf == 0) {
|
{
|
||||||
printk(KERN_ERR "capi: ldisc has no receive_buf function\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (mp->ttyinstop) {
|
|
||||||
#if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
|
|
||||||
printk(KERN_DEBUG "capi: recv tty throttled\n");
|
|
||||||
#endif
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (mp->tty->ldisc.receive_room &&
|
|
||||||
mp->tty->ldisc.receive_room(mp->tty) < datalen) {
|
|
||||||
#if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
|
|
||||||
printk(KERN_DEBUG "capi: no room in tty\n");
|
|
||||||
#endif
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if ((nskb = gen_data_b3_resp_for(mp, skb)) == 0) {
|
|
||||||
printk(KERN_ERR "capi: gen_data_b3_resp failed\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4);
|
|
||||||
errcode = capi20_put_message(mp->ap, nskb);
|
|
||||||
if (errcode != CAPI_NOERROR) {
|
|
||||||
printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n",
|
|
||||||
errcode);
|
|
||||||
kfree_skb(nskb);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
(void)skb_pull(skb, CAPIMSG_LEN(skb->data));
|
|
||||||
#ifdef _DEBUG_DATAFLOW
|
#ifdef _DEBUG_DATAFLOW
|
||||||
printk(KERN_DEBUG "capi: DATA_B3_RESP %u len=%d => ldisc\n",
|
printk(KERN_DEBUG "capi: currently no receiver\n");
|
||||||
datahandle, skb->len);
|
|
||||||
#endif
|
#endif
|
||||||
mp->tty->ldisc.receive_buf(mp->tty, skb->data, NULL, skb->len);
|
return -1;
|
||||||
kfree_skb(skb);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#ifdef _DEBUG_DATAFLOW
|
|
||||||
printk(KERN_DEBUG "capi: currently no receiver\n");
|
ld = tty_ldisc_ref(mp->tty);
|
||||||
|
if (ld == NULL)
|
||||||
|
return -1;
|
||||||
|
if (ld->receive_buf == NULL) {
|
||||||
|
#if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
|
||||||
|
printk(KERN_DEBUG "capi: ldisc has no receive_buf function\n");
|
||||||
#endif
|
#endif
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
if (mp->ttyinstop) {
|
||||||
|
#if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
|
||||||
|
printk(KERN_DEBUG "capi: recv tty throttled\n");
|
||||||
|
#endif
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
if (ld->receive_room &&
|
||||||
|
ld->receive_room(mp->tty) < datalen) {
|
||||||
|
#if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
|
||||||
|
printk(KERN_DEBUG "capi: no room in tty\n");
|
||||||
|
#endif
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
if ((nskb = gen_data_b3_resp_for(mp, skb)) == 0) {
|
||||||
|
printk(KERN_ERR "capi: gen_data_b3_resp failed\n");
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4);
|
||||||
|
errcode = capi20_put_message(mp->ap, nskb);
|
||||||
|
if (errcode != CAPI_NOERROR) {
|
||||||
|
printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n",
|
||||||
|
errcode);
|
||||||
|
kfree_skb(nskb);
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
(void)skb_pull(skb, CAPIMSG_LEN(skb->data));
|
||||||
|
#ifdef _DEBUG_DATAFLOW
|
||||||
|
printk(KERN_DEBUG "capi: DATA_B3_RESP %u len=%d => ldisc\n",
|
||||||
|
datahandle, skb->len);
|
||||||
|
#endif
|
||||||
|
ld->receive_buf(mp->tty, skb->data, NULL, skb->len);
|
||||||
|
kfree_skb(skb);
|
||||||
|
tty_ldisc_deref(ld);
|
||||||
|
return 0;
|
||||||
|
bad:
|
||||||
|
tty_ldisc_deref(ld);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -614,6 +625,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
|
||||||
|
|
||||||
|
|
||||||
if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_IND) {
|
if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_IND) {
|
||||||
|
|
||||||
datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+4+2);
|
datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+4+2);
|
||||||
#ifdef _DEBUG_DATAFLOW
|
#ifdef _DEBUG_DATAFLOW
|
||||||
printk(KERN_DEBUG "capi_signal: DATA_B3_IND %u len=%d\n",
|
printk(KERN_DEBUG "capi_signal: DATA_B3_IND %u len=%d\n",
|
||||||
|
@ -633,10 +645,8 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
|
||||||
#endif
|
#endif
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
(void)capiminor_del_ack(mp, datahandle);
|
(void)capiminor_del_ack(mp, datahandle);
|
||||||
if (mp->tty) {
|
if (mp->tty)
|
||||||
if (mp->tty->ldisc.write_wakeup)
|
tty_wakeup(mp->tty);
|
||||||
mp->tty->ldisc.write_wakeup(mp->tty);
|
|
||||||
}
|
|
||||||
(void)handle_minor_send(mp);
|
(void)handle_minor_send(mp);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -512,7 +512,8 @@ static void send_message(capidrv_contr * card, _cmsg * cmsg)
|
||||||
len = CAPIMSG_LEN(cmsg->buf);
|
len = CAPIMSG_LEN(cmsg->buf);
|
||||||
skb = alloc_skb(len, GFP_ATOMIC);
|
skb = alloc_skb(len, GFP_ATOMIC);
|
||||||
memcpy(skb_put(skb, len), cmsg->buf, len);
|
memcpy(skb_put(skb, len), cmsg->buf, len);
|
||||||
capi20_put_message(&global.ap, skb);
|
if (capi20_put_message(&global.ap, skb) != CAPI_NOERROR)
|
||||||
|
kfree_skb(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------- state machine -------------------------------------------- */
|
/* -------- state machine -------------------------------------------- */
|
||||||
|
|
|
@ -389,7 +389,7 @@ u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
|
||||||
CAPIMSG_NCCI(skb->data),
|
CAPIMSG_NCCI(skb->data),
|
||||||
CAPIMSG_MSGID(skb->data));
|
CAPIMSG_MSGID(skb->data));
|
||||||
if (retval != CAPI_NOERROR)
|
if (retval != CAPI_NOERROR)
|
||||||
goto out;
|
return retval;
|
||||||
|
|
||||||
dlen = CAPIMSG_DATALEN(skb->data);
|
dlen = CAPIMSG_DATALEN(skb->data);
|
||||||
|
|
||||||
|
@ -399,16 +399,14 @@ u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
|
||||||
b1_put_slice(port, skb->data + len, dlen);
|
b1_put_slice(port, skb->data + len, dlen);
|
||||||
spin_unlock_irqrestore(&card->lock, flags);
|
spin_unlock_irqrestore(&card->lock, flags);
|
||||||
} else {
|
} else {
|
||||||
retval = CAPI_NOERROR;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&card->lock, flags);
|
spin_lock_irqsave(&card->lock, flags);
|
||||||
b1_put_byte(port, SEND_MESSAGE);
|
b1_put_byte(port, SEND_MESSAGE);
|
||||||
b1_put_slice(port, skb->data, len);
|
b1_put_slice(port, skb->data, len);
|
||||||
spin_unlock_irqrestore(&card->lock, flags);
|
spin_unlock_irqrestore(&card->lock, flags);
|
||||||
}
|
}
|
||||||
out:
|
|
||||||
dev_kfree_skb_any(skb);
|
dev_kfree_skb_any(skb);
|
||||||
return retval;
|
return CAPI_NOERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
|
@ -839,8 +839,6 @@ u16 b1dma_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
|
||||||
}
|
}
|
||||||
if (retval == CAPI_NOERROR)
|
if (retval == CAPI_NOERROR)
|
||||||
b1dma_queue_tx(card, skb);
|
b1dma_queue_tx(card, skb);
|
||||||
else
|
|
||||||
dev_kfree_skb_any(skb);
|
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1029,8 +1029,6 @@ static u16 c4_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
|
||||||
spin_lock_irqsave(&card->lock, flags);
|
spin_lock_irqsave(&card->lock, flags);
|
||||||
c4_dispatch_tx(card);
|
c4_dispatch_tx(card);
|
||||||
spin_unlock_irqrestore(&card->lock, flags);
|
spin_unlock_irqrestore(&card->lock, flags);
|
||||||
} else {
|
|
||||||
dev_kfree_skb_any(skb);
|
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -472,7 +472,7 @@ static u16 t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
|
||||||
CAPIMSG_NCCI(skb->data),
|
CAPIMSG_NCCI(skb->data),
|
||||||
CAPIMSG_MSGID(skb->data));
|
CAPIMSG_MSGID(skb->data));
|
||||||
if (retval != CAPI_NOERROR)
|
if (retval != CAPI_NOERROR)
|
||||||
goto out;
|
return retval;
|
||||||
|
|
||||||
dlen = CAPIMSG_DATALEN(skb->data);
|
dlen = CAPIMSG_DATALEN(skb->data);
|
||||||
|
|
||||||
|
@ -482,16 +482,15 @@ static u16 t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
|
||||||
t1_put_slice(port, skb->data + len, dlen);
|
t1_put_slice(port, skb->data + len, dlen);
|
||||||
spin_unlock_irqrestore(&card->lock, flags);
|
spin_unlock_irqrestore(&card->lock, flags);
|
||||||
} else {
|
} else {
|
||||||
retval = CAPI_NOERROR;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&card->lock, flags);
|
spin_lock_irqsave(&card->lock, flags);
|
||||||
b1_put_byte(port, SEND_MESSAGE);
|
b1_put_byte(port, SEND_MESSAGE);
|
||||||
t1_put_slice(port, skb->data, len);
|
t1_put_slice(port, skb->data, len);
|
||||||
spin_unlock_irqrestore(&card->lock, flags);
|
spin_unlock_irqrestore(&card->lock, flags);
|
||||||
}
|
}
|
||||||
out:
|
|
||||||
dev_kfree_skb_any(skb);
|
dev_kfree_skb_any(skb);
|
||||||
return retval;
|
return CAPI_NOERROR;
|
||||||
}
|
}
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -998,7 +998,8 @@ static u16 diva_send_message(struct capi_ctr *ctrl,
|
||||||
|
|
||||||
write_end:
|
write_end:
|
||||||
diva_os_leave_spin_lock(&api_lock, &old_irql, "send message");
|
diva_os_leave_spin_lock(&api_lock, &old_irql, "send message");
|
||||||
diva_os_free_message_buffer(dmb);
|
if (retval == CAPI_NOERROR)
|
||||||
|
diva_os_free_message_buffer(dmb);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
#ifndef __CAPIFUNC_H__
|
#ifndef __CAPIFUNC_H__
|
||||||
#define __CAPIFUNC_H__
|
#define __CAPIFUNC_H__
|
||||||
|
|
||||||
#define MAX_DESCRIPTORS 32
|
|
||||||
|
|
||||||
#define DRRELMAJOR 2
|
#define DRRELMAJOR 2
|
||||||
#define DRRELMINOR 0
|
#define DRRELMINOR 0
|
||||||
#define DRRELEXTRA ""
|
#define DRRELEXTRA ""
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "divasync.h"
|
#include "divasync.h"
|
||||||
#include "kst_ifc.h"
|
#include "kst_ifc.h"
|
||||||
#include "maintidi.h"
|
#include "maintidi.h"
|
||||||
|
#include "man_defs.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
LOCALS
|
LOCALS
|
||||||
|
@ -13,17 +14,23 @@
|
||||||
|
|
||||||
static void DI_register (void *arg);
|
static void DI_register (void *arg);
|
||||||
static void DI_deregister (pDbgHandle hDbg);
|
static void DI_deregister (pDbgHandle hDbg);
|
||||||
static void DI_format (int do_lock, word id, int type, char *format, va_list ap);
|
static void DI_format (int do_lock, word id, int type, char *format, va_list argument_list);
|
||||||
static void DI_format_locked (word id, int type, char *format, va_list argument_list);
|
static void DI_format_locked (word id, int type, char *format, va_list argument_list);
|
||||||
static void DI_format_old (word id, char *format, va_list ap) { }
|
static void DI_format_old (word id, char *format, va_list ap) { }
|
||||||
static void DiProcessEventLog (word id, dword msgID, va_list ap) { }
|
static void DiProcessEventLog (unsigned short id, unsigned long msgID, va_list ap) { }
|
||||||
static void single_p (byte * P, word * PLength, byte Id);
|
static void single_p (byte * P, word * PLength, byte Id);
|
||||||
static void diva_maint_xdi_cb (ENTITY* e);
|
static void diva_maint_xdi_cb (ENTITY* e);
|
||||||
static word SuperTraceCreateReadReq (byte* P, const char* path);
|
static word SuperTraceCreateReadReq (byte* P, const char* path);
|
||||||
|
static int diva_mnt_cmp_nmbr (const char* nmbr);
|
||||||
|
static void diva_free_dma_descriptor (IDI_CALL request, int nr);
|
||||||
|
static int diva_get_dma_descriptor (IDI_CALL request, dword *dma_magic);
|
||||||
void diva_mnt_internal_dprintf (dword drv_id, dword type, char* p, ...);
|
void diva_mnt_internal_dprintf (dword drv_id, dword type, char* p, ...);
|
||||||
|
|
||||||
static dword MaxDumpSize = 256 ;
|
static dword MaxDumpSize = 256 ;
|
||||||
static dword MaxXlogSize = 2 + 128 ;
|
static dword MaxXlogSize = 2 + 128 ;
|
||||||
|
static char TraceFilter[DIVA_MAX_SELECTIVE_FILTER_LENGTH+1];
|
||||||
|
static int TraceFilterIdent = -1;
|
||||||
|
static int TraceFilterChannel = -1;
|
||||||
|
|
||||||
typedef struct _diva_maint_client {
|
typedef struct _diva_maint_client {
|
||||||
dword sec;
|
dword sec;
|
||||||
|
@ -40,9 +47,10 @@ typedef struct _diva_maint_client {
|
||||||
BUFFERS XData;
|
BUFFERS XData;
|
||||||
char xbuffer[2048+512];
|
char xbuffer[2048+512];
|
||||||
byte* pmem;
|
byte* pmem;
|
||||||
int request_pending;
|
int request_pending;
|
||||||
|
int dma_handle;
|
||||||
} diva_maint_client_t;
|
} diva_maint_client_t;
|
||||||
static diva_maint_client_t clients[64];
|
static diva_maint_client_t clients[MAX_DESCRIPTORS];
|
||||||
|
|
||||||
static void diva_change_management_debug_mask (diva_maint_client_t* pC, dword old_mask);
|
static void diva_change_management_debug_mask (diva_maint_client_t* pC, dword old_mask);
|
||||||
|
|
||||||
|
@ -201,6 +209,10 @@ int diva_maint_init (byte* base, unsigned long length, int do_init) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TraceFilter[0] = 0;
|
||||||
|
TraceFilterIdent = -1;
|
||||||
|
TraceFilterChannel = -1;
|
||||||
|
|
||||||
dbg_base = base;
|
dbg_base = base;
|
||||||
|
|
||||||
diva_os_get_time (&start_sec, &start_usec);
|
diva_os_get_time (&start_sec, &start_usec);
|
||||||
|
@ -249,7 +261,6 @@ int diva_maint_init (byte* base, unsigned long length, int do_init) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,16 +313,16 @@ diva_dbg_entry_head_t* diva_maint_get_message (word* size,
|
||||||
diva_os_spin_lock_magic_t* old_irql) {
|
diva_os_spin_lock_magic_t* old_irql) {
|
||||||
diva_dbg_entry_head_t* pmsg = NULL;
|
diva_dbg_entry_head_t* pmsg = NULL;
|
||||||
|
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, old_irql, "read");
|
diva_os_enter_spin_lock (&dbg_q_lock, old_irql, "read");
|
||||||
if (dbg_q_busy) {
|
if (dbg_q_busy) {
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, old_irql, "read_busy");
|
diva_os_leave_spin_lock (&dbg_q_lock, old_irql, "read_busy");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
dbg_q_busy = 1;
|
dbg_q_busy = 1;
|
||||||
|
|
||||||
if (!(pmsg = (diva_dbg_entry_head_t*)queuePeekMsg (dbg_queue, size))) {
|
if (!(pmsg = (diva_dbg_entry_head_t*)queuePeekMsg (dbg_queue, size))) {
|
||||||
dbg_q_busy = 0;
|
dbg_q_busy = 0;
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, old_irql, "read_empty");
|
diva_os_leave_spin_lock (&dbg_q_lock, old_irql, "read_empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
return (pmsg);
|
return (pmsg);
|
||||||
|
@ -330,7 +341,7 @@ void diva_maint_ack_message (int do_release,
|
||||||
queueFreeMsg (dbg_queue);
|
queueFreeMsg (dbg_queue);
|
||||||
}
|
}
|
||||||
dbg_q_busy = 0;
|
dbg_q_busy = 0;
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, old_irql, "read_ack");
|
diva_os_leave_spin_lock (&dbg_q_lock, old_irql, "read_ack");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -378,14 +389,14 @@ static void DI_register (void *arg) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "register");
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "register");
|
||||||
|
|
||||||
for (id = 1; id < (sizeof(clients)/sizeof(clients[0])); id++) {
|
for (id = 1; id < (sizeof(clients)/sizeof(clients[0])); id++) {
|
||||||
if (clients[id].hDbg == hDbg) {
|
if (clients[id].hDbg == hDbg) {
|
||||||
/*
|
/*
|
||||||
driver already registered
|
driver already registered
|
||||||
*/
|
*/
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "register");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "register");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (clients[id].hDbg) { /* slot is busy */
|
if (clients[id].hDbg) { /* slot is busy */
|
||||||
|
@ -468,7 +479,7 @@ static void DI_register (void *arg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "register");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "register");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DI_deregister (pDbgHandle hDbg) {
|
static void DI_deregister (pDbgHandle hDbg) {
|
||||||
|
@ -480,8 +491,8 @@ static void DI_deregister (pDbgHandle hDbg) {
|
||||||
|
|
||||||
diva_os_get_time (&sec, &usec);
|
diva_os_get_time (&sec, &usec);
|
||||||
|
|
||||||
diva_os_enter_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "read");
|
diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "read");
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "read");
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "read");
|
||||||
|
|
||||||
for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) {
|
for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) {
|
||||||
if (clients[i].hDbg == hDbg) {
|
if (clients[i].hDbg == hDbg) {
|
||||||
|
@ -543,8 +554,8 @@ static void DI_deregister (pDbgHandle hDbg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "read_ack");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "read_ack");
|
||||||
diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "read_ack");
|
diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "read_ack");
|
||||||
|
|
||||||
if (pmem) {
|
if (pmem) {
|
||||||
diva_os_free (0, pmem);
|
diva_os_free (0, pmem);
|
||||||
|
@ -572,13 +583,22 @@ static void DI_format (int do_lock,
|
||||||
char *data;
|
char *data;
|
||||||
unsigned short code;
|
unsigned short code;
|
||||||
|
|
||||||
if (!format)
|
if (diva_os_in_irq()) {
|
||||||
|
dbg_sequence++;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!format) ||
|
||||||
|
((TraceFilter[0] != 0) && ((TraceFilterIdent < 0) || (TraceFilterChannel < 0)))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
diva_os_get_time (&sec, &usec);
|
diva_os_get_time (&sec, &usec);
|
||||||
|
|
||||||
if (do_lock) {
|
if (do_lock) {
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "format");
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "format");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -703,7 +723,7 @@ static void DI_format (int do_lock,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_lock) {
|
if (do_lock) {
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "format");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "format");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,7 +740,7 @@ int diva_get_driver_info (dword id, byte* data, int data_length) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "driver info");
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "driver info");
|
||||||
|
|
||||||
if (clients[id].hDbg) {
|
if (clients[id].hDbg) {
|
||||||
*p++ = 1;
|
*p++ = 1;
|
||||||
|
@ -757,7 +777,7 @@ int diva_get_driver_info (dword id, byte* data, int data_length) {
|
||||||
}
|
}
|
||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "driver info");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "driver info");
|
||||||
|
|
||||||
return (p - data);
|
return (p - data);
|
||||||
}
|
}
|
||||||
|
@ -769,7 +789,7 @@ int diva_get_driver_dbg_mask (dword id, byte* data) {
|
||||||
if (!data || !id || (id >= (sizeof(clients)/sizeof(clients[0])))) {
|
if (!data || !id || (id >= (sizeof(clients)/sizeof(clients[0])))) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "driver info");
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "driver info");
|
||||||
|
|
||||||
if (clients[id].hDbg) {
|
if (clients[id].hDbg) {
|
||||||
ret = 4;
|
ret = 4;
|
||||||
|
@ -779,7 +799,7 @@ int diva_get_driver_dbg_mask (dword id, byte* data) {
|
||||||
*data++= (byte)(clients[id].hDbg->dbgMask >> 24);
|
*data++= (byte)(clients[id].hDbg->dbgMask >> 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "driver info");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "driver info");
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
@ -793,8 +813,8 @@ int diva_set_driver_dbg_mask (dword id, dword mask) {
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_enter_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "dbg mask");
|
diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "dbg mask");
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "dbg mask");
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "dbg mask");
|
||||||
|
|
||||||
if (clients[id].hDbg) {
|
if (clients[id].hDbg) {
|
||||||
dword old_mask = clients[id].hDbg->dbgMask;
|
dword old_mask = clients[id].hDbg->dbgMask;
|
||||||
|
@ -806,14 +826,14 @@ int diva_set_driver_dbg_mask (dword id, dword mask) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "dbg mask");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "dbg mask");
|
||||||
|
|
||||||
if (clients[id].request_pending) {
|
if (clients[id].request_pending) {
|
||||||
clients[id].request_pending = 0;
|
clients[id].request_pending = 0;
|
||||||
(*(clients[id].request))((ENTITY*)(*(clients[id].pIdiLib->DivaSTraceGetHandle))(clients[id].pIdiLib->hLib));
|
(*(clients[id].request))((ENTITY*)(*(clients[id].pIdiLib->DivaSTraceGetHandle))(clients[id].pIdiLib->hLib));
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "dbg mask");
|
diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "dbg mask");
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
@ -851,12 +871,12 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
|
||||||
diva_os_get_time (&sec, &usec);
|
diva_os_get_time (&sec, &usec);
|
||||||
diva_get_idi_adapter_info (d->request, &serial, &logical);
|
diva_get_idi_adapter_info (d->request, &serial, &logical);
|
||||||
if (serial & 0xff000000) {
|
if (serial & 0xff000000) {
|
||||||
sprintf (tmp, "ADAPTER:%d SN:%d-%d",
|
sprintf (tmp, "ADAPTER:%d SN:%u-%d",
|
||||||
(int)logical,
|
(int)logical,
|
||||||
serial & 0x00ffffff,
|
serial & 0x00ffffff,
|
||||||
(byte)(((serial & 0xff000000) >> 24) + 1));
|
(byte)(((serial & 0xff000000) >> 24) + 1));
|
||||||
} else {
|
} else {
|
||||||
sprintf (tmp, "ADAPTER:%d SN:%d", (int)logical, serial);
|
sprintf (tmp, "ADAPTER:%d SN:%u", (int)logical, serial);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(pmem = diva_os_malloc (0, DivaSTraceGetMemotyRequirement (d->channels)))) {
|
if (!(pmem = diva_os_malloc (0, DivaSTraceGetMemotyRequirement (d->channels)))) {
|
||||||
|
@ -864,13 +884,14 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
|
||||||
}
|
}
|
||||||
memset (pmem, 0x00, DivaSTraceGetMemotyRequirement (d->channels));
|
memset (pmem, 0x00, DivaSTraceGetMemotyRequirement (d->channels));
|
||||||
|
|
||||||
diva_os_enter_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "register");
|
diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "register");
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "register");
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "register");
|
||||||
|
|
||||||
for (id = 1; id < (sizeof(clients)/sizeof(clients[0])); id++) {
|
for (id = 1; id < (sizeof(clients)/sizeof(clients[0])); id++) {
|
||||||
if (clients[id].hDbg && (clients[id].request == d->request)) {
|
if (clients[id].hDbg && (clients[id].request == d->request)) {
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "register");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "register");
|
||||||
diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "register");
|
diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "register");
|
||||||
|
diva_os_free(0, pmem);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (clients[id].hDbg) { /* slot is busy */
|
if (clients[id].hDbg) { /* slot is busy */
|
||||||
|
@ -891,8 +912,8 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (free_id < 0) {
|
if (free_id < 0) {
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "register");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "register");
|
||||||
diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "register");
|
diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "register");
|
||||||
diva_os_free (0, pmem);
|
diva_os_free (0, pmem);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -908,6 +929,7 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
|
||||||
clients[id].Dbg.drvTag[0] = 0;
|
clients[id].Dbg.drvTag[0] = 0;
|
||||||
clients[id].logical = (int)logical;
|
clients[id].logical = (int)logical;
|
||||||
clients[id].channels = (int)d->channels;
|
clients[id].channels = (int)d->channels;
|
||||||
|
clients[id].dma_handle = -1;
|
||||||
|
|
||||||
clients[id].Dbg.dbgMask = 0;
|
clients[id].Dbg.dbgMask = 0;
|
||||||
clients[id].dbgMask = clients[id].Dbg.dbgMask;
|
clients[id].dbgMask = clients[id].Dbg.dbgMask;
|
||||||
|
@ -949,8 +971,8 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
|
||||||
clients[id].request = NULL;
|
clients[id].request = NULL;
|
||||||
clients[id].request_pending = 0;
|
clients[id].request_pending = 0;
|
||||||
clients[id].hDbg = NULL;
|
clients[id].hDbg = NULL;
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "register");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "register");
|
||||||
diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "register");
|
diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "register");
|
||||||
diva_os_free (0, pmem);
|
diva_os_free (0, pmem);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -988,14 +1010,14 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
|
||||||
org_mask = clients[id].Dbg.dbgMask;
|
org_mask = clients[id].Dbg.dbgMask;
|
||||||
clients[id].Dbg.dbgMask = 0;
|
clients[id].Dbg.dbgMask = 0;
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "register");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "register");
|
||||||
|
|
||||||
if (clients[id].request_pending) {
|
if (clients[id].request_pending) {
|
||||||
clients[id].request_pending = 0;
|
clients[id].request_pending = 0;
|
||||||
(*(clients[id].request))((ENTITY*)(*(clients[id].pIdiLib->DivaSTraceGetHandle))(clients[id].pIdiLib->hLib));
|
(*(clients[id].request))((ENTITY*)(*(clients[id].pIdiLib->DivaSTraceGetHandle))(clients[id].pIdiLib->hLib));
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "register");
|
diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "register");
|
||||||
|
|
||||||
diva_set_driver_dbg_mask (id, org_mask);
|
diva_set_driver_dbg_mask (id, org_mask);
|
||||||
}
|
}
|
||||||
|
@ -1012,8 +1034,8 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d) {
|
||||||
|
|
||||||
diva_os_get_time (&sec, &usec);
|
diva_os_get_time (&sec, &usec);
|
||||||
|
|
||||||
diva_os_enter_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "read");
|
diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "read");
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "read");
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "read");
|
||||||
|
|
||||||
for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) {
|
for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) {
|
||||||
if (clients[i].hDbg && (clients[i].request == d->request)) {
|
if (clients[i].hDbg && (clients[i].request == d->request)) {
|
||||||
|
@ -1030,8 +1052,15 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d) {
|
||||||
}
|
}
|
||||||
|
|
||||||
clients[i].hDbg = NULL;
|
clients[i].hDbg = NULL;
|
||||||
clients[i].request = NULL;
|
|
||||||
clients[i].request_pending = 0;
|
clients[i].request_pending = 0;
|
||||||
|
if (clients[i].dma_handle >= 0) {
|
||||||
|
/*
|
||||||
|
Free DMA handle
|
||||||
|
*/
|
||||||
|
diva_free_dma_descriptor (clients[i].request, clients[i].dma_handle);
|
||||||
|
clients[i].dma_handle = -1;
|
||||||
|
}
|
||||||
|
clients[i].request = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Log driver register, MAINT driver ID is '0'
|
Log driver register, MAINT driver ID is '0'
|
||||||
|
@ -1069,8 +1098,8 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "read_ack");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "read_ack");
|
||||||
diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "read_ack");
|
diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "read_ack");
|
||||||
|
|
||||||
if (pmem) {
|
if (pmem) {
|
||||||
diva_os_free (0, pmem);
|
diva_os_free (0, pmem);
|
||||||
|
@ -1142,6 +1171,42 @@ int SuperTraceASSIGN (void* AdapterHandle, byte* data) {
|
||||||
|
|
||||||
if (pC && pC->pIdiLib && pC->request) {
|
if (pC && pC->pIdiLib && pC->request) {
|
||||||
ENTITY* e = (ENTITY*)(*(pC->pIdiLib->DivaSTraceGetHandle))(pC->pIdiLib->hLib);
|
ENTITY* e = (ENTITY*)(*(pC->pIdiLib->DivaSTraceGetHandle))(pC->pIdiLib->hLib);
|
||||||
|
IDI_SYNC_REQ* preq;
|
||||||
|
char buffer[((sizeof(preq->xdi_extended_features)+4) > sizeof(ENTITY)) ? (sizeof(preq->xdi_extended_features)+4) : sizeof(ENTITY)];
|
||||||
|
char features[4];
|
||||||
|
word assign_data_length = 1;
|
||||||
|
|
||||||
|
features[0] = 0;
|
||||||
|
pC->xbuffer[0] = 0;
|
||||||
|
preq = (IDI_SYNC_REQ*)&buffer[0];
|
||||||
|
preq->xdi_extended_features.Req = 0;
|
||||||
|
preq->xdi_extended_features.Rc = IDI_SYNC_REQ_XDI_GET_EXTENDED_FEATURES;
|
||||||
|
preq->xdi_extended_features.info.buffer_length_in_bytes = sizeof(features);
|
||||||
|
preq->xdi_extended_features.info.features = &features[0];
|
||||||
|
|
||||||
|
(*(pC->request))((ENTITY*)preq);
|
||||||
|
|
||||||
|
if ((features[0] & DIVA_XDI_EXTENDED_FEATURES_VALID) &&
|
||||||
|
(features[0] & DIVA_XDI_EXTENDED_FEATURE_MANAGEMENT_DMA)) {
|
||||||
|
dword rx_dma_magic;
|
||||||
|
if ((pC->dma_handle = diva_get_dma_descriptor (pC->request, &rx_dma_magic)) >= 0) {
|
||||||
|
pC->xbuffer[0] = LLI;
|
||||||
|
pC->xbuffer[1] = 8;
|
||||||
|
pC->xbuffer[2] = 0x40;
|
||||||
|
pC->xbuffer[3] = (byte)pC->dma_handle;
|
||||||
|
pC->xbuffer[4] = (byte)rx_dma_magic;
|
||||||
|
pC->xbuffer[5] = (byte)(rx_dma_magic >> 8);
|
||||||
|
pC->xbuffer[6] = (byte)(rx_dma_magic >> 16);
|
||||||
|
pC->xbuffer[7] = (byte)(rx_dma_magic >> 24);
|
||||||
|
pC->xbuffer[8] = (byte)DIVA_MAX_MANAGEMENT_TRANSFER_SIZE;
|
||||||
|
pC->xbuffer[9] = (byte)(DIVA_MAX_MANAGEMENT_TRANSFER_SIZE >> 8);
|
||||||
|
pC->xbuffer[10] = 0;
|
||||||
|
|
||||||
|
assign_data_length = 11;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pC->dma_handle = -1;
|
||||||
|
}
|
||||||
|
|
||||||
e->Id = MAN_ID;
|
e->Id = MAN_ID;
|
||||||
e->callback = diva_maint_xdi_cb;
|
e->callback = diva_maint_xdi_cb;
|
||||||
|
@ -1149,9 +1214,8 @@ int SuperTraceASSIGN (void* AdapterHandle, byte* data) {
|
||||||
e->X = &pC->XData;
|
e->X = &pC->XData;
|
||||||
e->Req = ASSIGN;
|
e->Req = ASSIGN;
|
||||||
e->ReqCh = 0;
|
e->ReqCh = 0;
|
||||||
e->X->PLength = 1;
|
e->X->PLength = assign_data_length;
|
||||||
e->X->P = (byte*)&pC->xbuffer[0];
|
e->X->P = (byte*)&pC->xbuffer[0];
|
||||||
pC->xbuffer[0] = 0;
|
|
||||||
|
|
||||||
pC->request_pending = 1;
|
pC->request_pending = 1;
|
||||||
|
|
||||||
|
@ -1300,16 +1364,25 @@ static void diva_maint_xdi_cb (ENTITY* e) {
|
||||||
diva_os_spin_lock_magic_t old_irql, old_irql1;
|
diva_os_spin_lock_magic_t old_irql, old_irql1;
|
||||||
|
|
||||||
|
|
||||||
diva_os_enter_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "xdi_cb");
|
diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "xdi_cb");
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "xdi_cb");
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "xdi_cb");
|
||||||
|
|
||||||
pC = (diva_maint_client_t*)pLib->hAdapter;
|
pC = (diva_maint_client_t*)pLib->hAdapter;
|
||||||
|
|
||||||
if ((*(pLib->instance.DivaSTraceMessageInput))(&pLib->instance)) {
|
if ((e->complete == 255) || (pC->dma_handle < 0)) {
|
||||||
diva_mnt_internal_dprintf (0, DLI_ERR, "Trace internal library error");
|
if ((*(pLib->instance.DivaSTraceMessageInput))(&pLib->instance)) {
|
||||||
|
diva_mnt_internal_dprintf (0, DLI_ERR, "Trace internal library error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
Process combined management interface indication
|
||||||
|
*/
|
||||||
|
if ((*(pLib->instance.DivaSTraceMessageInput))(&pLib->instance)) {
|
||||||
|
diva_mnt_internal_dprintf (0, DLI_ERR, "Trace internal library error (DMA mode)");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "xdi_cb");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "xdi_cb");
|
||||||
|
|
||||||
|
|
||||||
if (pC->request_pending) {
|
if (pC->request_pending) {
|
||||||
|
@ -1317,7 +1390,7 @@ static void diva_maint_xdi_cb (ENTITY* e) {
|
||||||
(*(pC->request))(e);
|
(*(pC->request))(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "xdi_cb");
|
diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "xdi_cb");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1365,8 +1438,42 @@ static void diva_maint_state_change_notify (void* user_context,
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (notify_subject) {
|
switch (notify_subject) {
|
||||||
case DIVA_SUPER_TRACE_NOTIFY_LINE_CHANGE:
|
case DIVA_SUPER_TRACE_NOTIFY_LINE_CHANGE: {
|
||||||
if (pC->hDbg->dbgMask & DIVA_MGT_DBG_LINE_EVENTS) {
|
int view = (TraceFilter[0] == 0);
|
||||||
|
/*
|
||||||
|
Process selective Trace
|
||||||
|
*/
|
||||||
|
if (channel->Line[0] == 'I' && channel->Line[1] == 'd' &&
|
||||||
|
channel->Line[2] == 'l' && channel->Line[3] == 'e') {
|
||||||
|
if ((TraceFilterIdent == pC->hDbg->id) && (TraceFilterChannel == (int)channel->ChannelNumber)) {
|
||||||
|
(*(hLib->DivaSTraceSetBChannel))(hLib, (int)channel->ChannelNumber, 0);
|
||||||
|
(*(hLib->DivaSTraceSetAudioTap))(hLib, (int)channel->ChannelNumber, 0);
|
||||||
|
diva_mnt_internal_dprintf (pC->hDbg->id, DLI_LOG, "Selective Trace OFF for Ch=%d",
|
||||||
|
(int)channel->ChannelNumber);
|
||||||
|
TraceFilterIdent = -1;
|
||||||
|
TraceFilterChannel = -1;
|
||||||
|
view = 1;
|
||||||
|
}
|
||||||
|
} else if (TraceFilter[0] && (TraceFilterIdent < 0) && !(diva_mnt_cmp_nmbr (&channel->RemoteAddress[0]) &&
|
||||||
|
diva_mnt_cmp_nmbr (&channel->LocalAddress[0]))) {
|
||||||
|
|
||||||
|
if ((pC->hDbg->dbgMask & DIVA_MGT_DBG_IFC_BCHANNEL) != 0) { /* Activate B-channel trace */
|
||||||
|
(*(hLib->DivaSTraceSetBChannel))(hLib, (int)channel->ChannelNumber, 1);
|
||||||
|
}
|
||||||
|
if ((pC->hDbg->dbgMask & DIVA_MGT_DBG_IFC_AUDIO) != 0) { /* Activate AudioTap Trace */
|
||||||
|
(*(hLib->DivaSTraceSetAudioTap))(hLib, (int)channel->ChannelNumber, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
TraceFilterIdent = pC->hDbg->id;
|
||||||
|
TraceFilterChannel = (int)channel->ChannelNumber;
|
||||||
|
|
||||||
|
if (TraceFilterIdent >= 0) {
|
||||||
|
diva_mnt_internal_dprintf (pC->hDbg->id, DLI_LOG, "Selective Trace ON for Ch=%d",
|
||||||
|
(int)channel->ChannelNumber);
|
||||||
|
view = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (view && (pC->hDbg->dbgMask & DIVA_MGT_DBG_LINE_EVENTS)) {
|
||||||
diva_mnt_internal_dprintf (pC->hDbg->id, DLI_STAT, "L Ch = %d",
|
diva_mnt_internal_dprintf (pC->hDbg->id, DLI_STAT, "L Ch = %d",
|
||||||
(int)channel->ChannelNumber);
|
(int)channel->ChannelNumber);
|
||||||
diva_mnt_internal_dprintf (pC->hDbg->id, DLI_STAT, "L Status = <%s>", &channel->Line[0]);
|
diva_mnt_internal_dprintf (pC->hDbg->id, DLI_STAT, "L Status = <%s>", &channel->Line[0]);
|
||||||
|
@ -1392,10 +1499,26 @@ static void diva_maint_state_change_notify (void* user_context,
|
||||||
channel->LastDisconnecCause);
|
channel->LastDisconnecCause);
|
||||||
diva_mnt_internal_dprintf (pC->hDbg->id, DLI_STAT, "L Owner = <%s>", &channel->UserID[0]);
|
diva_mnt_internal_dprintf (pC->hDbg->id, DLI_STAT, "L Owner = <%s>", &channel->UserID[0]);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
} break;
|
||||||
|
|
||||||
case DIVA_SUPER_TRACE_NOTIFY_MODEM_CHANGE:
|
case DIVA_SUPER_TRACE_NOTIFY_MODEM_CHANGE:
|
||||||
if (pC->hDbg->dbgMask & DIVA_MGT_DBG_MDM_PROGRESS) {
|
if (pC->hDbg->dbgMask & DIVA_MGT_DBG_MDM_PROGRESS) {
|
||||||
|
{
|
||||||
|
int ch = TraceFilterChannel;
|
||||||
|
int id = TraceFilterIdent;
|
||||||
|
|
||||||
|
if ((id >= 0) && (ch >= 0) && (id < sizeof(clients)/sizeof(clients[0])) &&
|
||||||
|
(clients[id].Dbg.id == (byte)id) && (clients[id].pIdiLib == hLib)) {
|
||||||
|
if (ch != (int)modem->ChannelNumber) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (TraceFilter[0] != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
diva_mnt_internal_dprintf(pC->hDbg->id, DLI_STAT, "MDM Ch = %lu",
|
diva_mnt_internal_dprintf(pC->hDbg->id, DLI_STAT, "MDM Ch = %lu",
|
||||||
(int)modem->ChannelNumber);
|
(int)modem->ChannelNumber);
|
||||||
diva_mnt_internal_dprintf(pC->hDbg->id, DLI_STAT, "MDM Event = %lu", modem->Event);
|
diva_mnt_internal_dprintf(pC->hDbg->id, DLI_STAT, "MDM Event = %lu", modem->Event);
|
||||||
|
@ -1428,6 +1551,20 @@ static void diva_maint_state_change_notify (void* user_context,
|
||||||
|
|
||||||
case DIVA_SUPER_TRACE_NOTIFY_FAX_CHANGE:
|
case DIVA_SUPER_TRACE_NOTIFY_FAX_CHANGE:
|
||||||
if (pC->hDbg->dbgMask & DIVA_MGT_DBG_FAX_PROGRESS) {
|
if (pC->hDbg->dbgMask & DIVA_MGT_DBG_FAX_PROGRESS) {
|
||||||
|
{
|
||||||
|
int ch = TraceFilterChannel;
|
||||||
|
int id = TraceFilterIdent;
|
||||||
|
|
||||||
|
if ((id >= 0) && (ch >= 0) && (id < sizeof(clients)/sizeof(clients[0])) &&
|
||||||
|
(clients[id].Dbg.id == (byte)id) && (clients[id].pIdiLib == hLib)) {
|
||||||
|
if (ch != (int)fax->ChannelNumber) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (TraceFilter[0] != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
diva_mnt_internal_dprintf(pC->hDbg->id, DLI_STAT, "FAX Ch = %lu",(int)fax->ChannelNumber);
|
diva_mnt_internal_dprintf(pC->hDbg->id, DLI_STAT, "FAX Ch = %lu",(int)fax->ChannelNumber);
|
||||||
diva_mnt_internal_dprintf(pC->hDbg->id, DLI_STAT, "FAX Event = %lu", fax->Event);
|
diva_mnt_internal_dprintf(pC->hDbg->id, DLI_STAT, "FAX Event = %lu", fax->Event);
|
||||||
diva_mnt_internal_dprintf(pC->hDbg->id, DLI_STAT, "FAX Pages = %lu", fax->Page_Counter);
|
diva_mnt_internal_dprintf(pC->hDbg->id, DLI_STAT, "FAX Pages = %lu", fax->Page_Counter);
|
||||||
|
@ -1660,6 +1797,52 @@ static void diva_maint_trace_notify (void* user_context,
|
||||||
diva_dbg_entry_head_t* pmsg;
|
diva_dbg_entry_head_t* pmsg;
|
||||||
word size;
|
word size;
|
||||||
dword sec, usec;
|
dword sec, usec;
|
||||||
|
int ch = TraceFilterChannel;
|
||||||
|
int id = TraceFilterIdent;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Selective trace
|
||||||
|
*/
|
||||||
|
if ((id >= 0) && (ch >= 0) && (id < sizeof(clients)/sizeof(clients[0])) &&
|
||||||
|
(clients[id].Dbg.id == (byte)id) && (clients[id].pIdiLib == hLib)) {
|
||||||
|
const char* p = NULL;
|
||||||
|
int ch_value = -1;
|
||||||
|
MI_XLOG_HDR *TrcData = (MI_XLOG_HDR *)xlog_buffer;
|
||||||
|
|
||||||
|
if (Adapter != clients[id].logical) {
|
||||||
|
return; /* Ignore all trace messages from other adapters */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TrcData->code == 24) {
|
||||||
|
p = (char*)&TrcData->code;
|
||||||
|
p += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
All L1 messages start as [dsp,ch], so we can filter this information
|
||||||
|
and filter out all messages that use different channel
|
||||||
|
*/
|
||||||
|
if (p && p[0] == '[') {
|
||||||
|
if (p[2] == ',') {
|
||||||
|
p += 3;
|
||||||
|
ch_value = *p - '0';
|
||||||
|
} else if (p[3] == ',') {
|
||||||
|
p += 4;
|
||||||
|
ch_value = *p - '0';
|
||||||
|
}
|
||||||
|
if (ch_value >= 0) {
|
||||||
|
if (p[2] == ']') {
|
||||||
|
ch_value = ch_value * 10 + p[1] - '0';
|
||||||
|
}
|
||||||
|
if (ch_value != ch) {
|
||||||
|
return; /* Ignore other channels */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (TraceFilter[0] != 0) {
|
||||||
|
return; /* Ignore trace if trace filter is activated, but idle */
|
||||||
|
}
|
||||||
|
|
||||||
diva_os_get_time (&sec, &usec);
|
diva_os_get_time (&sec, &usec);
|
||||||
|
|
||||||
|
@ -1705,18 +1888,20 @@ static void diva_change_management_debug_mask (diva_maint_client_t* pC, dword ol
|
||||||
(*(pC->pIdiLib->DivaSTraceSetDChannel))(pC->pIdiLib,
|
(*(pC->pIdiLib->DivaSTraceSetDChannel))(pC->pIdiLib,
|
||||||
(pC->hDbg->dbgMask & DIVA_MGT_DBG_DCHAN) != 0);
|
(pC->hDbg->dbgMask & DIVA_MGT_DBG_DCHAN) != 0);
|
||||||
}
|
}
|
||||||
if (changed & DIVA_MGT_DBG_IFC_BCHANNEL) {
|
if (!TraceFilter[0]) {
|
||||||
int i, state = ((pC->hDbg->dbgMask & DIVA_MGT_DBG_IFC_BCHANNEL) != 0);
|
if (changed & DIVA_MGT_DBG_IFC_BCHANNEL) {
|
||||||
|
int i, state = ((pC->hDbg->dbgMask & DIVA_MGT_DBG_IFC_BCHANNEL) != 0);
|
||||||
|
|
||||||
for (i = 0; i < pC->channels; i++) {
|
for (i = 0; i < pC->channels; i++) {
|
||||||
(*(pC->pIdiLib->DivaSTraceSetBChannel))(pC->pIdiLib, i+1, state);
|
(*(pC->pIdiLib->DivaSTraceSetBChannel))(pC->pIdiLib, i+1, state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (changed & DIVA_MGT_DBG_IFC_AUDIO) {
|
||||||
if (changed & DIVA_MGT_DBG_IFC_AUDIO) {
|
int i, state = ((pC->hDbg->dbgMask & DIVA_MGT_DBG_IFC_AUDIO) != 0);
|
||||||
int i, state = ((pC->hDbg->dbgMask & DIVA_MGT_DBG_IFC_AUDIO) != 0);
|
|
||||||
|
|
||||||
for (i = 0; i < pC->channels; i++) {
|
for (i = 0; i < pC->channels; i++) {
|
||||||
(*(pC->pIdiLib->DivaSTraceSetAudioTap))(pC->pIdiLib, i+1, state);
|
(*(pC->pIdiLib->DivaSTraceSetAudioTap))(pC->pIdiLib, i+1, state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1743,8 +1928,8 @@ int diva_mnt_shutdown_xdi_adapters (void) {
|
||||||
for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) {
|
for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) {
|
||||||
pmem = NULL;
|
pmem = NULL;
|
||||||
|
|
||||||
diva_os_enter_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "unload");
|
diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "unload");
|
||||||
diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "unload");
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "unload");
|
||||||
|
|
||||||
if (clients[i].hDbg && clients[i].pIdiLib && clients[i].request) {
|
if (clients[i].hDbg && clients[i].pIdiLib && clients[i].request) {
|
||||||
if ((*(clients[i].pIdiLib->DivaSTraceLibraryStop))(clients[i].pIdiLib) == 1) {
|
if ((*(clients[i].pIdiLib->DivaSTraceLibraryStop))(clients[i].pIdiLib) == 1) {
|
||||||
|
@ -1759,19 +1944,31 @@ int diva_mnt_shutdown_xdi_adapters (void) {
|
||||||
clients[i].pmem = NULL;
|
clients[i].pmem = NULL;
|
||||||
}
|
}
|
||||||
clients[i].hDbg = NULL;
|
clients[i].hDbg = NULL;
|
||||||
clients[i].request = NULL;
|
|
||||||
clients[i].request_pending = 0;
|
clients[i].request_pending = 0;
|
||||||
|
|
||||||
|
if (clients[i].dma_handle >= 0) {
|
||||||
|
/*
|
||||||
|
Free DMA handle
|
||||||
|
*/
|
||||||
|
diva_free_dma_descriptor (clients[i].request, clients[i].dma_handle);
|
||||||
|
clients[i].dma_handle = -1;
|
||||||
|
}
|
||||||
|
clients[i].request = NULL;
|
||||||
} else {
|
} else {
|
||||||
fret = -1;
|
fret = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "unload");
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "unload");
|
||||||
if (clients[i].hDbg && clients[i].pIdiLib && clients[i].request && clients[i].request_pending) {
|
if (clients[i].hDbg && clients[i].pIdiLib && clients[i].request && clients[i].request_pending) {
|
||||||
clients[i].request_pending = 0;
|
clients[i].request_pending = 0;
|
||||||
(*(clients[i].request))((ENTITY*)(*(clients[i].pIdiLib->DivaSTraceGetHandle))(clients[i].pIdiLib->hLib));
|
(*(clients[i].request))((ENTITY*)(*(clients[i].pIdiLib->DivaSTraceGetHandle))(clients[i].pIdiLib->hLib));
|
||||||
|
if (clients[i].dma_handle >= 0) {
|
||||||
|
diva_free_dma_descriptor (clients[i].request, clients[i].dma_handle);
|
||||||
|
clients[i].dma_handle = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "unload");
|
diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "unload");
|
||||||
|
|
||||||
if (pmem) {
|
if (pmem) {
|
||||||
diva_os_free (0, pmem);
|
diva_os_free (0, pmem);
|
||||||
|
@ -1781,3 +1978,156 @@ int diva_mnt_shutdown_xdi_adapters (void) {
|
||||||
return (fret);
|
return (fret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Set/Read the trace filter used for selective tracing.
|
||||||
|
Affects B- and Audio Tap trace mask at run time
|
||||||
|
*/
|
||||||
|
int diva_set_trace_filter (int filter_length, const char* filter) {
|
||||||
|
diva_os_spin_lock_magic_t old_irql, old_irql1;
|
||||||
|
int i, ch, on, client_b_on, client_atap_on;
|
||||||
|
|
||||||
|
diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "dbg mask");
|
||||||
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "write_filter");
|
||||||
|
|
||||||
|
if (filter_length <= DIVA_MAX_SELECTIVE_FILTER_LENGTH) {
|
||||||
|
memcpy (&TraceFilter[0], filter, filter_length);
|
||||||
|
if (TraceFilter[filter_length]) {
|
||||||
|
TraceFilter[filter_length] = 0;
|
||||||
|
}
|
||||||
|
if (TraceFilter[0] == '*') {
|
||||||
|
TraceFilter[0] = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
filter_length = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TraceFilterIdent = -1;
|
||||||
|
TraceFilterChannel = -1;
|
||||||
|
|
||||||
|
on = (TraceFilter[0] == 0);
|
||||||
|
|
||||||
|
for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) {
|
||||||
|
if (clients[i].hDbg && clients[i].pIdiLib && clients[i].request) {
|
||||||
|
client_b_on = on && ((clients[i].hDbg->dbgMask & DIVA_MGT_DBG_IFC_BCHANNEL) != 0);
|
||||||
|
client_atap_on = on && ((clients[i].hDbg->dbgMask & DIVA_MGT_DBG_IFC_AUDIO) != 0);
|
||||||
|
for (ch = 0; ch < clients[i].channels; ch++) {
|
||||||
|
(*(clients[i].pIdiLib->DivaSTraceSetBChannel))(clients[i].pIdiLib->hLib, ch+1, client_b_on);
|
||||||
|
(*(clients[i].pIdiLib->DivaSTraceSetAudioTap))(clients[i].pIdiLib->hLib, ch+1, client_atap_on);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) {
|
||||||
|
if (clients[i].hDbg && clients[i].pIdiLib && clients[i].request && clients[i].request_pending) {
|
||||||
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "write_filter");
|
||||||
|
clients[i].request_pending = 0;
|
||||||
|
(*(clients[i].request))((ENTITY*)(*(clients[i].pIdiLib->DivaSTraceGetHandle))(clients[i].pIdiLib->hLib));
|
||||||
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "write_filter");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "write_filter");
|
||||||
|
diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "dbg mask");
|
||||||
|
|
||||||
|
return (filter_length);
|
||||||
|
}
|
||||||
|
|
||||||
|
int diva_get_trace_filter (int max_length, char* filter) {
|
||||||
|
diva_os_spin_lock_magic_t old_irql;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "read_filter");
|
||||||
|
len = strlen (&TraceFilter[0]) + 1;
|
||||||
|
if (max_length >= len) {
|
||||||
|
memcpy (filter, &TraceFilter[0], len);
|
||||||
|
}
|
||||||
|
diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "read_filter");
|
||||||
|
|
||||||
|
return (len);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int diva_dbg_cmp_key (const char* ref, const char* key) {
|
||||||
|
while (*key && (*ref++ == *key++));
|
||||||
|
return (!*key && !*ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
In case trace filter starts with "C" character then
|
||||||
|
all following characters are interpreted as command.
|
||||||
|
Followings commands are available:
|
||||||
|
- single, trace single call at time, independent from CPN/CiPN
|
||||||
|
*/
|
||||||
|
static int diva_mnt_cmp_nmbr (const char* nmbr) {
|
||||||
|
const char* ref = &TraceFilter[0];
|
||||||
|
int ref_len = strlen(&TraceFilter[0]), nmbr_len = strlen(nmbr);
|
||||||
|
|
||||||
|
if (ref[0] == 'C') {
|
||||||
|
if (diva_dbg_cmp_key (&ref[1], "single")) {
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ref_len || (ref_len > nmbr_len)) {
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
nmbr = nmbr + nmbr_len - 1;
|
||||||
|
ref = ref + ref_len - 1;
|
||||||
|
|
||||||
|
while (ref_len--) {
|
||||||
|
if (*nmbr-- != *ref--) {
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int diva_get_dma_descriptor (IDI_CALL request, dword *dma_magic) {
|
||||||
|
ENTITY e;
|
||||||
|
IDI_SYNC_REQ* pReq = (IDI_SYNC_REQ*)&e;
|
||||||
|
|
||||||
|
if (!request) {
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
pReq->xdi_dma_descriptor_operation.Req = 0;
|
||||||
|
pReq->xdi_dma_descriptor_operation.Rc = IDI_SYNC_REQ_DMA_DESCRIPTOR_OPERATION;
|
||||||
|
|
||||||
|
pReq->xdi_dma_descriptor_operation.info.operation = IDI_SYNC_REQ_DMA_DESCRIPTOR_ALLOC;
|
||||||
|
pReq->xdi_dma_descriptor_operation.info.descriptor_number = -1;
|
||||||
|
pReq->xdi_dma_descriptor_operation.info.descriptor_address = NULL;
|
||||||
|
pReq->xdi_dma_descriptor_operation.info.descriptor_magic = 0;
|
||||||
|
|
||||||
|
(*request)((ENTITY*)pReq);
|
||||||
|
|
||||||
|
if (!pReq->xdi_dma_descriptor_operation.info.operation &&
|
||||||
|
(pReq->xdi_dma_descriptor_operation.info.descriptor_number >= 0) &&
|
||||||
|
pReq->xdi_dma_descriptor_operation.info.descriptor_magic) {
|
||||||
|
*dma_magic = pReq->xdi_dma_descriptor_operation.info.descriptor_magic;
|
||||||
|
return (pReq->xdi_dma_descriptor_operation.info.descriptor_number);
|
||||||
|
} else {
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void diva_free_dma_descriptor (IDI_CALL request, int nr) {
|
||||||
|
ENTITY e;
|
||||||
|
IDI_SYNC_REQ* pReq = (IDI_SYNC_REQ*)&e;
|
||||||
|
|
||||||
|
if (!request || (nr < 0)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pReq->xdi_dma_descriptor_operation.Req = 0;
|
||||||
|
pReq->xdi_dma_descriptor_operation.Rc = IDI_SYNC_REQ_DMA_DESCRIPTOR_OPERATION;
|
||||||
|
|
||||||
|
pReq->xdi_dma_descriptor_operation.info.operation = IDI_SYNC_REQ_DMA_DESCRIPTOR_FREE;
|
||||||
|
pReq->xdi_dma_descriptor_operation.info.descriptor_number = nr;
|
||||||
|
pReq->xdi_dma_descriptor_operation.info.descriptor_address = NULL;
|
||||||
|
pReq->xdi_dma_descriptor_operation.info.descriptor_magic = 0;
|
||||||
|
|
||||||
|
(*request)((ENTITY*)pReq);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,12 +57,18 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d);
|
||||||
void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d);
|
void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d);
|
||||||
int diva_mnt_shutdown_xdi_adapters (void);
|
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_CMD_GET_DRIVER_INFO 1
|
||||||
#define DITRACE_READ_DRIVER_DBG_MASK 2
|
#define DITRACE_READ_DRIVER_DBG_MASK 2
|
||||||
#define DITRACE_WRITE_DRIVER_DBG_MASK 3
|
#define DITRACE_WRITE_DRIVER_DBG_MASK 3
|
||||||
#define DITRACE_READ_TRACE_ENTRY 4
|
#define DITRACE_READ_TRACE_ENTRY 4
|
||||||
#define DITRACE_READ_TRACE_ENTRYS 5
|
#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
|
Trace lavels for debug via management interface
|
||||||
|
|
|
@ -232,7 +232,7 @@ typedef struct _DbgHandle_ *pDbgHandle ;
|
||||||
typedef void ( * DbgEnd) (pDbgHandle) ;
|
typedef void ( * DbgEnd) (pDbgHandle) ;
|
||||||
typedef void ( * DbgLog) (unsigned short, int, char *, va_list) ;
|
typedef void ( * DbgLog) (unsigned short, int, char *, va_list) ;
|
||||||
typedef void ( * DbgOld) (unsigned short, 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 void ( * DbgIrq) (unsigned short, int, char *, va_list) ;
|
||||||
typedef struct _DbgHandle_
|
typedef struct _DbgHandle_
|
||||||
{ char Registered ; /* driver successfull registered */
|
{ char Registered ; /* driver successfull registered */
|
||||||
|
@ -259,7 +259,7 @@ typedef struct _DbgHandle_
|
||||||
void *pReserved3 ;
|
void *pReserved3 ;
|
||||||
} _DbgHandle_ ;
|
} _DbgHandle_ ;
|
||||||
extern _DbgHandle_ myDriverDebugHandle ;
|
extern _DbgHandle_ myDriverDebugHandle ;
|
||||||
typedef struct
|
typedef struct _OldDbgHandle_
|
||||||
{ struct _OldDbgHandle_ *next ;
|
{ struct _OldDbgHandle_ *next ;
|
||||||
void *pIrp ;
|
void *pIrp ;
|
||||||
long regTime[2] ;
|
long regTime[2] ;
|
||||||
|
@ -310,7 +310,7 @@ typedef struct
|
||||||
unsigned long B_ChannelMask;
|
unsigned long B_ChannelMask;
|
||||||
unsigned long LogBufferSize;
|
unsigned long LogBufferSize;
|
||||||
} CardTrace;
|
} CardTrace;
|
||||||
} u1;
|
}Data;
|
||||||
} _DbgExtendedInfo_;
|
} _DbgExtendedInfo_;
|
||||||
#ifndef DIVA_NO_DEBUGLIB
|
#ifndef DIVA_NO_DEBUGLIB
|
||||||
/* -------------------------------------------------------------
|
/* -------------------------------------------------------------
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
#include "dadapter.h"
|
#include "dadapter.h"
|
||||||
#include "divasync.h"
|
#include "divasync.h"
|
||||||
|
|
||||||
#define MAX_DESCRIPTORS 32
|
|
||||||
|
|
||||||
#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)
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,6 @@ 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 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)
|
||||||
|
|
||||||
|
@ -50,8 +48,8 @@ extern void DIVA_DIDD_Read(void *, int);
|
||||||
static struct proc_dir_entry *proc_didd;
|
static struct proc_dir_entry *proc_didd;
|
||||||
struct proc_dir_entry *proc_net_eicon = NULL;
|
struct proc_dir_entry *proc_net_eicon = NULL;
|
||||||
|
|
||||||
EXPORT_SYMBOL_NOVERS(DIVA_DIDD_Read);
|
EXPORT_SYMBOL(DIVA_DIDD_Read);
|
||||||
EXPORT_SYMBOL_NOVERS(proc_net_eicon);
|
EXPORT_SYMBOL(proc_net_eicon);
|
||||||
|
|
||||||
static char *getrev(const char *revision)
|
static char *getrev(const char *revision)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/smp_lock.h>
|
#include <linux/smp_lock.h>
|
||||||
#include <linux/poll.h>
|
#include <linux/poll.h>
|
||||||
#include <linux/proc_fs.h>
|
|
||||||
#include <linux/skbuff.h>
|
|
||||||
#include <linux/devfs_fs_kernel.h>
|
#include <linux/devfs_fs_kernel.h>
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
@ -47,8 +45,7 @@ static char *DEVNAME = "DivasMAINT";
|
||||||
char *DRIVERRELEASE_MNT = "2.0";
|
char *DRIVERRELEASE_MNT = "2.0";
|
||||||
|
|
||||||
static wait_queue_head_t msgwaitq;
|
static wait_queue_head_t msgwaitq;
|
||||||
static DECLARE_MUTEX(opened_sem);
|
static unsigned long opened;
|
||||||
static int opened;
|
|
||||||
static struct timeval start_time;
|
static struct timeval start_time;
|
||||||
|
|
||||||
extern int mntfunc_init(int *, void **, unsigned long);
|
extern int mntfunc_init(int *, void **, unsigned long);
|
||||||
|
@ -73,20 +70,6 @@ static char *getrev(const char *revision)
|
||||||
return rev;
|
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
|
* kernel/user space copy functions
|
||||||
*/
|
*/
|
||||||
|
@ -131,154 +114,8 @@ void diva_os_get_time(dword * sec, dword * usec)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* /proc entries
|
* device node operations
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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
|
|
||||||
*/
|
|
||||||
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)
|
static unsigned int maint_poll(struct file *file, poll_table * wait)
|
||||||
{
|
{
|
||||||
unsigned int mask = 0;
|
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)
|
static int maint_open(struct inode *ino, struct file *filep)
|
||||||
{
|
{
|
||||||
down(&opened_sem);
|
/* only one open is allowed, so we test
|
||||||
if (opened) {
|
it atomically */
|
||||||
up(&opened_sem);
|
if (test_and_set_bit(0, &opened))
|
||||||
return (-EBUSY);
|
return (-EBUSY);
|
||||||
}
|
|
||||||
opened++;
|
|
||||||
up(&opened_sem);
|
|
||||||
|
|
||||||
filep->private_data = NULL;
|
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)
|
static int maint_close(struct inode *ino, struct file *filep)
|
||||||
{
|
{
|
||||||
if (filep->private_data) {
|
if (filep->private_data) {
|
||||||
diva_os_free_tbuffer(0, filep->private_data);
|
diva_os_free(0, filep->private_data);
|
||||||
filep->private_data = NULL;
|
filep->private_data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
down(&opened_sem);
|
/* clear 'used' flag */
|
||||||
opened--;
|
clear_bit(0, &opened);
|
||||||
up(&opened_sem);
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* 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,
|
static ssize_t divas_maint_write(struct file *file, const char __user *buf,
|
||||||
size_t count, loff_t * ppos)
|
size_t count, loff_t * ppos)
|
||||||
{
|
{
|
||||||
|
@ -427,18 +223,10 @@ static int DIVA_INIT_FUNCTION maint_init(void)
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
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))) {
|
if (!(mntfunc_init(&buffer_length, &buffer, diva_dbg_mem))) {
|
||||||
printk(KERN_ERR "%s: failed to connect to DIDD.\n",
|
printk(KERN_ERR "%s: failed to connect to DIDD.\n",
|
||||||
DRIVERLNAME);
|
DRIVERLNAME);
|
||||||
remove_maint_proc();
|
|
||||||
divas_maint_unregister_chrdev();
|
divas_maint_unregister_chrdev();
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -457,7 +245,6 @@ static int DIVA_INIT_FUNCTION maint_init(void)
|
||||||
*/
|
*/
|
||||||
static void DIVA_EXIT_FUNCTION maint_exit(void)
|
static void DIVA_EXIT_FUNCTION maint_exit(void)
|
||||||
{
|
{
|
||||||
remove_maint_proc();
|
|
||||||
divas_maint_unregister_chrdev();
|
divas_maint_unregister_chrdev();
|
||||||
mntfunc_finit();
|
mntfunc_finit();
|
||||||
|
|
||||||
|
@ -466,3 +253,4 @@ static void DIVA_EXIT_FUNCTION maint_exit(void)
|
||||||
|
|
||||||
module_init(maint_init);
|
module_init(maint_init);
|
||||||
module_exit(maint_exit);
|
module_exit(maint_exit);
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,6 @@ extern void DIVA_DIDD_Read(void *, int);
|
||||||
|
|
||||||
extern PISDN_ADAPTER IoAdapters[MAX_ADAPTER];
|
extern PISDN_ADAPTER IoAdapters[MAX_ADAPTER];
|
||||||
|
|
||||||
#define MAX_DESCRIPTORS 32
|
|
||||||
|
|
||||||
extern char *DRIVERRELEASE_DIVAS;
|
extern char *DRIVERRELEASE_DIVAS;
|
||||||
|
|
||||||
static dword notify_handle;
|
static dword notify_handle;
|
||||||
|
@ -76,10 +74,10 @@ void diva_xdi_didd_register_adapter(int card)
|
||||||
d.features = IoAdapters[card - 1]->Properties.Features;
|
d.features = IoAdapters[card - 1]->Properties.Features;
|
||||||
DBG_TRC(("DIDD register A(%d) channels=%d", card,
|
DBG_TRC(("DIDD register A(%d) channels=%d", card,
|
||||||
d.channels))
|
d.channels))
|
||||||
/* workaround for different Name in structure */
|
/* workaround for different Name in structure */
|
||||||
strlcpy(IoAdapters[card - 1]->Name,
|
strlcpy(IoAdapters[card - 1]->Name,
|
||||||
IoAdapters[card - 1]->Properties.Name,
|
IoAdapters[card - 1]->Properties.Name,
|
||||||
sizeof(IoAdapters[card - 1]->Name));
|
sizeof(IoAdapters[card - 1]->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;
|
||||||
|
|
|
@ -31,33 +31,31 @@
|
||||||
#define IDI_SYNC_REQ_SET_POSTCALL 0x03
|
#define IDI_SYNC_REQ_SET_POSTCALL 0x03
|
||||||
#define IDI_SYNC_REQ_GET_XLOG 0x04
|
#define IDI_SYNC_REQ_GET_XLOG 0x04
|
||||||
#define IDI_SYNC_REQ_GET_FEATURES 0x05
|
#define IDI_SYNC_REQ_GET_FEATURES 0x05
|
||||||
/* Added for DIVA USB support */
|
|
||||||
#define IDI_SYNC_REQ_USB_REGISTER 0x06
|
#define IDI_SYNC_REQ_USB_REGISTER 0x06
|
||||||
#define IDI_SYNC_REQ_USB_RELEASE 0x07
|
#define IDI_SYNC_REQ_USB_RELEASE 0x07
|
||||||
#define IDI_SYNC_REQ_USB_ADD_DEVICE 0x08
|
#define IDI_SYNC_REQ_USB_ADD_DEVICE 0x08
|
||||||
#define IDI_SYNC_REQ_USB_START_DEVICE 0x09
|
#define IDI_SYNC_REQ_USB_START_DEVICE 0x09
|
||||||
#define IDI_SYNC_REQ_USB_STOP_DEVICE 0x0A
|
#define IDI_SYNC_REQ_USB_STOP_DEVICE 0x0A
|
||||||
#define IDI_SYNC_REQ_USB_REMOVE_DEVICE 0x0B
|
#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_CARDTYPE 0x0C
|
||||||
#define IDI_SYNC_REQ_GET_DBG_XLOG 0x0D
|
#define IDI_SYNC_REQ_GET_DBG_XLOG 0x0D
|
||||||
#define IDI_SYNC_REQ_GET_LINE_IDX 0x0E
|
|
||||||
#define DIVA_USB
|
#define DIVA_USB
|
||||||
#define DIVA_USB_REQ 0xAC
|
#define DIVA_USB_REQ 0xAC
|
||||||
#define DIVA_USB_TEST 0xAB
|
#define DIVA_USB_TEST 0xAB
|
||||||
#define DIVA_USB_ADD_ADAPTER 0xAC
|
#define DIVA_USB_ADD_ADAPTER 0xAC
|
||||||
#define DIVA_USB_REMOVE_ADAPTER 0xAD
|
#define DIVA_USB_REMOVE_ADAPTER 0xAD
|
||||||
/******************************************************************************/
|
|
||||||
#define IDI_SYNC_REQ_SERIAL_HOOK 0x80
|
#define IDI_SYNC_REQ_SERIAL_HOOK 0x80
|
||||||
#define IDI_SYNC_REQ_XCHANGE_STATUS 0x81
|
#define IDI_SYNC_REQ_XCHANGE_STATUS 0x81
|
||||||
#define IDI_SYNC_REQ_USB_HOOK 0x82
|
#define IDI_SYNC_REQ_USB_HOOK 0x82
|
||||||
#define IDI_SYNC_REQ_PORTDRV_HOOK 0x83
|
#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_RECONFIGURE 0x85
|
||||||
#define IDI_SYNC_REQ_RESET 0x86
|
#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_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_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
|
#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_CAPI_PRMS 0x08
|
||||||
#define DIVA_XDI_EXTENDED_FEATURE_NO_CANCEL_RC 0x10
|
#define DIVA_XDI_EXTENDED_FEATURE_NO_CANCEL_RC 0x10
|
||||||
#define DIVA_XDI_EXTENDED_FEATURE_RX_DMA 0x20
|
#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 DIVA_XDI_EXTENDED_FEATURES_MAX_SZ 1
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
#define IDI_SYNC_REQ_XDI_GET_ADAPTER_SDRAM_BAR 0x93
|
#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 {
|
typedef struct _diva_xdi_get_logical_adapter_number {
|
||||||
dword logical_adapter_number;
|
dword logical_adapter_number;
|
||||||
dword controller;
|
dword controller;
|
||||||
|
dword total_controllers;
|
||||||
} diva_xdi_get_logical_adapter_number_s_t;
|
} diva_xdi_get_logical_adapter_number_s_t;
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
#define IDI_SYNC_REQ_UP1DM_OPERATION 0x96
|
#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_ADD_ADAPTER 0x03
|
||||||
#define IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER 0x04
|
#define IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER 0x04
|
||||||
#define IDI_SYNC_REQ_DIDD_READ_ADAPTER_ARRAY 0x05
|
#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 {
|
typedef struct _diva_didd_adapter_notify {
|
||||||
dword handle; /* Notification handle */
|
dword handle; /* Notification handle */
|
||||||
void * callback;
|
void * callback;
|
||||||
|
@ -149,6 +151,9 @@ typedef struct _diva_didd_read_adapter_array {
|
||||||
void * buffer;
|
void * buffer;
|
||||||
dword length;
|
dword length;
|
||||||
} diva_didd_read_adapter_array_t;
|
} 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 IDI_SYNC_REQ_XDI_GET_STREAM 0x91
|
||||||
#define DIVA_XDI_SYNCHRONOUS_SERVICE 0x01
|
#define DIVA_XDI_SYNCHRONOUS_SERVICE 0x01
|
||||||
|
@ -466,6 +471,10 @@ typedef union
|
||||||
ENTITY e;
|
ENTITY e;
|
||||||
diva_didd_read_adapter_array_t info;
|
diva_didd_read_adapter_array_t info;
|
||||||
} didd_read_adapter_array;
|
} didd_read_adapter_array;
|
||||||
|
struct {
|
||||||
|
ENTITY e;
|
||||||
|
diva_didd_get_cfg_lib_ifc_t info;
|
||||||
|
} didd_get_cfg_lib_ifc;
|
||||||
struct {
|
struct {
|
||||||
unsigned char Req;
|
unsigned char Req;
|
||||||
unsigned char Rc;
|
unsigned char Rc;
|
||||||
|
|
|
@ -25,8 +25,6 @@ extern void DIVA_DIDD_Read(void *, int);
|
||||||
extern int diva_user_mode_idi_create_adapter(const DESCRIPTOR *, int);
|
extern int diva_user_mode_idi_create_adapter(const DESCRIPTOR *, int);
|
||||||
extern void diva_user_mode_idi_remove_adapter(int);
|
extern void diva_user_mode_idi_remove_adapter(int);
|
||||||
|
|
||||||
#define MAX_DESCRIPTORS 32
|
|
||||||
|
|
||||||
static dword notify_handle;
|
static dword notify_handle;
|
||||||
static DESCRIPTOR DAdapter;
|
static DESCRIPTOR DAdapter;
|
||||||
static DESCRIPTOR MAdapter;
|
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)
|
#if defined(DIVA_IDI_RX_DMA)
|
||||||
DIVA_XDI_EXTENDED_FEATURE_CMA |
|
DIVA_XDI_EXTENDED_FEATURE_CMA |
|
||||||
DIVA_XDI_EXTENDED_FEATURE_RX_DMA |
|
DIVA_XDI_EXTENDED_FEATURE_RX_DMA |
|
||||||
|
DIVA_XDI_EXTENDED_FEATURE_MANAGEMENT_DMA |
|
||||||
#endif
|
#endif
|
||||||
DIVA_XDI_EXTENDED_FEATURE_NO_CANCEL_RC),
|
DIVA_XDI_EXTENDED_FEATURE_NO_CANCEL_RC),
|
||||||
0
|
0
|
||||||
|
@ -226,8 +227,10 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
|
||||||
if (pI->descriptor_number >= 0) {
|
if (pI->descriptor_number >= 0) {
|
||||||
dword dma_magic;
|
dword dma_magic;
|
||||||
void* local_addr;
|
void* local_addr;
|
||||||
|
#if 0
|
||||||
DBG_TRC(("A(%d) dma_alloc(%d)",
|
DBG_TRC(("A(%d) dma_alloc(%d)",
|
||||||
IoAdapter->ANum, pI->descriptor_number))
|
IoAdapter->ANum, pI->descriptor_number))
|
||||||
|
#endif
|
||||||
diva_get_dma_map_entry (\
|
diva_get_dma_map_entry (\
|
||||||
(struct _diva_dma_map_entry*)IoAdapter->dma_map,
|
(struct _diva_dma_map_entry*)IoAdapter->dma_map,
|
||||||
pI->descriptor_number,
|
pI->descriptor_number,
|
||||||
|
@ -240,7 +243,9 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
|
||||||
}
|
}
|
||||||
} else if ((pI->operation == IDI_SYNC_REQ_DMA_DESCRIPTOR_FREE) &&
|
} else if ((pI->operation == IDI_SYNC_REQ_DMA_DESCRIPTOR_FREE) &&
|
||||||
(pI->descriptor_number >= 0)) {
|
(pI->descriptor_number >= 0)) {
|
||||||
|
#if 0
|
||||||
DBG_TRC(("A(%d) dma_free(%d)", IoAdapter->ANum, pI->descriptor_number))
|
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,
|
diva_free_dma_map_entry((struct _diva_dma_map_entry*)IoAdapter->dma_map,
|
||||||
pI->descriptor_number);
|
pI->descriptor_number);
|
||||||
pI->descriptor_number = -1;
|
pI->descriptor_number = -1;
|
||||||
|
@ -257,6 +262,7 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
|
||||||
&syncReq->xdi_logical_adapter_number.info;
|
&syncReq->xdi_logical_adapter_number.info;
|
||||||
pI->logical_adapter_number = IoAdapter->ANum;
|
pI->logical_adapter_number = IoAdapter->ANum;
|
||||||
pI->controller = IoAdapter->ControllerNumber;
|
pI->controller = IoAdapter->ControllerNumber;
|
||||||
|
pI->total_controllers = IoAdapter->Properties.Adapters;
|
||||||
} return;
|
} return;
|
||||||
case IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS: {
|
case IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS: {
|
||||||
diva_xdi_get_capi_parameters_t prms, *pI = &syncReq->xdi_capi_prms.info;
|
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 ;
|
syncReq->GetSerial.serial = 0 ;
|
||||||
break ;
|
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:
|
case IDI_SYNC_REQ_GET_XLOG:
|
||||||
if ( IoAdapter )
|
if ( IoAdapter )
|
||||||
{
|
{
|
||||||
|
@ -326,6 +342,14 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
|
||||||
}
|
}
|
||||||
e->Ind = 0 ;
|
e->Ind = 0 ;
|
||||||
break ;
|
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:
|
case IDI_SYNC_REQ_GET_FEATURES:
|
||||||
if ( IoAdapter )
|
if ( IoAdapter )
|
||||||
{
|
{
|
||||||
|
@ -345,7 +369,9 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
|
||||||
}
|
}
|
||||||
if ( IoAdapter )
|
if ( IoAdapter )
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
DBG_FTL(("xdi: unknown Req 0 / Rc %d !", e->Rc))
|
DBG_FTL(("xdi: unknown Req 0 / Rc %d !", e->Rc))
|
||||||
|
#endif
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -496,7 +522,7 @@ pcm_req (PISDN_ADAPTER IoAdapter, ENTITY *e)
|
||||||
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock,
|
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock,
|
||||||
&OldIrql,
|
&OldIrql,
|
||||||
"data_pcm_1");
|
"data_pcm_1");
|
||||||
IoAdapter->pcm_data = (unsigned long)pcm;
|
IoAdapter->pcm_data = (void *)pcm;
|
||||||
IoAdapter->pcm_pending = 1;
|
IoAdapter->pcm_pending = 1;
|
||||||
diva_os_schedule_soft_isr (&IoAdapter->req_soft_isr);
|
diva_os_schedule_soft_isr (&IoAdapter->req_soft_isr);
|
||||||
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock,
|
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock,
|
||||||
|
@ -510,7 +536,7 @@ pcm_req (PISDN_ADAPTER IoAdapter, ENTITY *e)
|
||||||
&OldIrql,
|
&OldIrql,
|
||||||
"data_pcm_3");
|
"data_pcm_3");
|
||||||
IoAdapter->pcm_pending = 0;
|
IoAdapter->pcm_pending = 0;
|
||||||
IoAdapter->pcm_data = 0;
|
IoAdapter->pcm_data = NULL ;
|
||||||
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock,
|
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock,
|
||||||
&OldIrql,
|
&OldIrql,
|
||||||
"data_pcm_3");
|
"data_pcm_3");
|
||||||
|
@ -528,7 +554,7 @@ pcm_req (PISDN_ADAPTER IoAdapter, ENTITY *e)
|
||||||
&OldIrql,
|
&OldIrql,
|
||||||
"data_pcm_4");
|
"data_pcm_4");
|
||||||
IoAdapter->pcm_pending = 0;
|
IoAdapter->pcm_pending = 0;
|
||||||
IoAdapter->pcm_data = 0;
|
IoAdapter->pcm_data = NULL ;
|
||||||
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock,
|
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock,
|
||||||
&OldIrql,
|
&OldIrql,
|
||||||
"data_pcm_4");
|
"data_pcm_4");
|
||||||
|
@ -668,7 +694,7 @@ word io_inw(ADAPTER * a, void * adr)
|
||||||
void io_in_buffer(ADAPTER * a, void * adr, void * buffer, word len)
|
void io_in_buffer(ADAPTER * a, void * adr, void * buffer, word len)
|
||||||
{
|
{
|
||||||
byte *Port = (byte*)DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io);
|
byte *Port = (byte*)DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io);
|
||||||
byte* P = (byte*)buffer;
|
byte* P = (byte*)buffer;
|
||||||
if ((long)adr & 1) {
|
if ((long)adr & 1) {
|
||||||
outppw(Port+4, (word)(unsigned long)adr);
|
outppw(Port+4, (word)(unsigned long)adr);
|
||||||
*P = inpp(Port);
|
*P = inpp(Port);
|
||||||
|
@ -678,7 +704,7 @@ void io_in_buffer(ADAPTER * a, void * adr, void * buffer, word len)
|
||||||
if (!len) {
|
if (!len) {
|
||||||
DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port);
|
DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outppw(Port+4, (word)(unsigned long)adr);
|
outppw(Port+4, (word)(unsigned long)adr);
|
||||||
inppw_buffer (Port, P, len+1);
|
inppw_buffer (Port, P, len+1);
|
||||||
|
@ -710,7 +736,7 @@ void io_outw(ADAPTER * a, void * adr, word data)
|
||||||
void io_out_buffer(ADAPTER * a, void * adr, void * buffer, word len)
|
void io_out_buffer(ADAPTER * a, void * adr, void * buffer, word len)
|
||||||
{
|
{
|
||||||
byte *Port = (byte*)DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io);
|
byte *Port = (byte*)DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io);
|
||||||
byte* P = (byte*)buffer;
|
byte* P = (byte*)buffer;
|
||||||
if ((long)adr & 1) {
|
if ((long)adr & 1) {
|
||||||
outppw(Port+4, (word)(unsigned long)adr);
|
outppw(Port+4, (word)(unsigned long)adr);
|
||||||
outpp(Port, *P);
|
outpp(Port, *P);
|
||||||
|
@ -839,21 +865,21 @@ void CALLBACK(ADAPTER * a, ENTITY * e)
|
||||||
/* --------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------
|
||||||
routines for aligned reading and writing on RISC
|
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;
|
word w;
|
||||||
while (i < (len & 0xfffe)) {
|
while (i < (len & 0xfffffffe)) {
|
||||||
w = P[i++];
|
w = P[i++];
|
||||||
w += (P[i++])<<8;
|
w += (P[i++])<<8;
|
||||||
outppw (adr, w);
|
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;
|
word w;
|
||||||
while (i < (len & 0xfffe)) {
|
while (i < (len & 0xfffffffe)) {
|
||||||
w = inppw (adr);
|
w = inppw (adr);
|
||||||
P[i++] = (byte)(w);
|
P[i++] = (byte)(w);
|
||||||
P[i++] = (byte)(w>>8);
|
P[i++] = (byte)(w>>8);
|
||||||
|
|
|
@ -39,6 +39,14 @@ typedef struct {
|
||||||
DEVICE_NAME DeviceName[4] ;
|
DEVICE_NAME DeviceName[4] ;
|
||||||
PISDN_ADAPTER QuadroAdapter[4] ;
|
PISDN_ADAPTER QuadroAdapter[4] ;
|
||||||
} ADAPTER_LIST_ENTRY, *PADAPTER_LIST_ENTRY ;
|
} 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
|
Configuration of XDI clients carried by XDI
|
||||||
-------------------------------------------------------------------------- */
|
-------------------------------------------------------------------------- */
|
||||||
|
@ -52,6 +60,7 @@ typedef struct _diva_xdi_capi_cfg {
|
||||||
-------------------------------------------------------------------------- */
|
-------------------------------------------------------------------------- */
|
||||||
struct _ISDN_ADAPTER {
|
struct _ISDN_ADAPTER {
|
||||||
void (* DIRequest)(PISDN_ADAPTER, ENTITY *) ;
|
void (* DIRequest)(PISDN_ADAPTER, ENTITY *) ;
|
||||||
|
int State ; /* from NT4 1.srv, a good idea, but a poor achievment */
|
||||||
int Initialized ;
|
int Initialized ;
|
||||||
int RegisteredWithDidd ;
|
int RegisteredWithDidd ;
|
||||||
int Unavailable ; /* callback function possible? */
|
int Unavailable ; /* callback function possible? */
|
||||||
|
@ -63,6 +72,7 @@ struct _ISDN_ADAPTER {
|
||||||
/*
|
/*
|
||||||
remember mapped memory areas
|
remember mapped memory areas
|
||||||
*/
|
*/
|
||||||
|
ADAPTER_MEMORY MappedMemory[MAX_MAPPED_ENTRIES] ;
|
||||||
CARD_PROPERTIES Properties ;
|
CARD_PROPERTIES Properties ;
|
||||||
dword cardType ;
|
dword cardType ;
|
||||||
dword protocol_id ; /* configured protocol identifier */
|
dword protocol_id ; /* configured protocol identifier */
|
||||||
|
@ -87,15 +97,15 @@ struct _ISDN_ADAPTER {
|
||||||
dword downloadAddrTable[4] ; /* add. for MultiMaster */
|
dword downloadAddrTable[4] ; /* add. for MultiMaster */
|
||||||
dword MemoryBase ;
|
dword MemoryBase ;
|
||||||
dword MemorySize ;
|
dword MemorySize ;
|
||||||
byte *Address ;
|
byte *Address ;
|
||||||
byte *Config ;
|
byte *Config ;
|
||||||
byte *Control ;
|
byte *Control ;
|
||||||
byte *reset ;
|
byte *reset ;
|
||||||
byte *port ;
|
byte *port ;
|
||||||
byte *ram ;
|
byte *ram ;
|
||||||
byte *cfg ;
|
byte *cfg ;
|
||||||
byte *prom ;
|
byte *prom ;
|
||||||
byte *ctlReg ;
|
byte *ctlReg ;
|
||||||
struct pc_maint *pcm ;
|
struct pc_maint *pcm ;
|
||||||
diva_os_dependent_devica_name_t os_name;
|
diva_os_dependent_devica_name_t os_name;
|
||||||
byte Name[32] ;
|
byte Name[32] ;
|
||||||
|
@ -105,6 +115,7 @@ struct _ISDN_ADAPTER {
|
||||||
char *ProtocolSuffix ; /* internal protocolfile table */
|
char *ProtocolSuffix ; /* internal protocolfile table */
|
||||||
char Archive[32] ;
|
char Archive[32] ;
|
||||||
char Protocol[32] ;
|
char Protocol[32] ;
|
||||||
|
char AddDownload[32] ; /* Dsp- or other additional download files */
|
||||||
char Oad1[ISDN_MAX_NUM_LEN] ;
|
char Oad1[ISDN_MAX_NUM_LEN] ;
|
||||||
char Osa1[ISDN_MAX_NUM_LEN] ;
|
char Osa1[ISDN_MAX_NUM_LEN] ;
|
||||||
char Oad2[ISDN_MAX_NUM_LEN] ;
|
char Oad2[ISDN_MAX_NUM_LEN] ;
|
||||||
|
@ -153,8 +164,26 @@ struct _ISDN_ADAPTER {
|
||||||
byte ModemCarrierWaitTimeSec;
|
byte ModemCarrierWaitTimeSec;
|
||||||
byte ModemCarrierLossWaitTimeTenthSec;
|
byte ModemCarrierLossWaitTimeTenthSec;
|
||||||
byte PiafsLinkTurnaroundInFrames;
|
byte PiafsLinkTurnaroundInFrames;
|
||||||
|
byte DiscAfterProgress;
|
||||||
|
byte AniDniLimiter[3];
|
||||||
|
byte TxAttenuation; /* PRI/E1 only: attenuate TX signal */
|
||||||
word QsigFeatures;
|
word QsigFeatures;
|
||||||
dword GenerateRingtone ;
|
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 isr_spin_lock;
|
||||||
diva_os_spin_lock_t data_spin_lock;
|
diva_os_spin_lock_t data_spin_lock;
|
||||||
diva_os_soft_isr_t req_soft_isr;
|
diva_os_soft_isr_t req_soft_isr;
|
||||||
|
@ -180,15 +209,21 @@ struct _ISDN_ADAPTER {
|
||||||
void (* stop)(PISDN_ADAPTER) ;
|
void (* stop)(PISDN_ADAPTER) ;
|
||||||
void (* rstFnc)(PISDN_ADAPTER) ;
|
void (* rstFnc)(PISDN_ADAPTER) ;
|
||||||
void (* trapFnc)(PISDN_ADAPTER) ;
|
void (* trapFnc)(PISDN_ADAPTER) ;
|
||||||
|
dword (* DetectDsps)(PISDN_ADAPTER) ;
|
||||||
void (* os_trap_nfy_Fnc)(PISDN_ADAPTER, dword) ;
|
void (* os_trap_nfy_Fnc)(PISDN_ADAPTER, dword) ;
|
||||||
diva_os_isr_callback_t diva_isr_handler;
|
diva_os_isr_callback_t diva_isr_handler;
|
||||||
dword sdram_bar;
|
dword sdram_bar; /* must be 32 bit */
|
||||||
dword fpga_features;
|
dword fpga_features;
|
||||||
volatile int pcm_pending;
|
volatile int pcm_pending;
|
||||||
volatile unsigned long pcm_data;
|
volatile void * pcm_data;
|
||||||
diva_xdi_capi_cfg_t capi_cfg;
|
diva_xdi_capi_cfg_t capi_cfg;
|
||||||
dword tasks;
|
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
|
Entity table
|
||||||
|
@ -219,8 +254,8 @@ struct s_load {
|
||||||
/* ---------------------------------------------------------------------
|
/* ---------------------------------------------------------------------
|
||||||
Functions for port io
|
Functions for port io
|
||||||
--------------------------------------------------------------------- */
|
--------------------------------------------------------------------- */
|
||||||
void outp_words_from_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, word len);
|
void inp_words_to_buffer (word* adr, byte* P, dword len);
|
||||||
/* ---------------------------------------------------------------------
|
/* ---------------------------------------------------------------------
|
||||||
platform specific conversions
|
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_outw(ADAPTER * a, void * adr, word data);
|
||||||
void io_out_buffer(ADAPTER * a, void * adr, void * P, word length);
|
void io_out_buffer(ADAPTER * a, void * adr, void * P, word length);
|
||||||
void io_inc(ADAPTER * a, void * adr);
|
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
|
ram access functions for memory mapped cards
|
||||||
--------------------------------------------------------------------- */
|
--------------------------------------------------------------------- */
|
||||||
|
|
|
@ -115,7 +115,7 @@ diva_strace_library_interface_t* DivaSTraceLibraryCreateInstance (int Adapter,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pmem += sizeof(*pLib);
|
pmem += sizeof(*pLib);
|
||||||
memset(pLib, 0x00, sizeof(*pLib));
|
memset(pLib, 0x00, sizeof(*pLib));
|
||||||
|
|
||||||
pLib->Adapter = Adapter;
|
pLib->Adapter = Adapter;
|
||||||
|
@ -337,13 +337,60 @@ static int SuperTraceMessageInput (void* hLib) {
|
||||||
pLib->e.RNum = 1;
|
pLib->e.RNum = 1;
|
||||||
pLib->e.R->P = (byte*)&pLib->buffer[0];
|
pLib->e.R->P = (byte*)&pLib->buffer[0];
|
||||||
pLib->e.R->PLength = (word)(sizeof(pLib->buffer) - 1);
|
pLib->e.R->PLength = (word)(sizeof(pLib->buffer) - 1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
Indication reception complete, process it now
|
Indication reception complete, process it now
|
||||||
*/
|
*/
|
||||||
byte* p = (byte*)&pLib->buffer[0];
|
byte* p = (byte*)&pLib->buffer[0];
|
||||||
pLib->buffer[pLib->e.R->PLength] = 0; /* terminate I.E. with zero */
|
pLib->buffer[pLib->e.R->PLength] = 0; /* terminate I.E. with zero */
|
||||||
|
|
||||||
switch (Ind) {
|
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:
|
case MAN_INFO_IND:
|
||||||
if (process_idi_info (pLib, (diva_man_var_header_t*)p)) {
|
if (process_idi_info (pLib, (diva_man_var_header_t*)p)) {
|
||||||
return (-1);
|
return (-1);
|
||||||
|
@ -806,7 +853,7 @@ static int ScheduleNextTraceRequest (diva_strace_context_t* pLib) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_idi_event (diva_strace_context_t* pLib,
|
static int process_idi_event (diva_strace_context_t* pLib,
|
||||||
diva_man_var_header_t* pVar) {
|
diva_man_var_header_t* pVar) {
|
||||||
const char* path = (char*)&pVar->path_length+1;
|
const char* path = (char*)&pVar->path_length+1;
|
||||||
char name[64];
|
char name[64];
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -49,6 +49,8 @@ typedef struct _diva_strace_path2action {
|
||||||
void* variable; /* Variable that will receive value */
|
void* variable; /* Variable that will receive value */
|
||||||
} diva_strace_path2action_t;
|
} diva_strace_path2action_t;
|
||||||
|
|
||||||
|
#define DIVA_MAX_MANAGEMENT_TRANSFER_SIZE 4096
|
||||||
|
|
||||||
typedef struct _diva_strace_context {
|
typedef struct _diva_strace_context {
|
||||||
diva_strace_library_interface_t instance;
|
diva_strace_library_interface_t instance;
|
||||||
|
|
||||||
|
@ -62,7 +64,7 @@ typedef struct _diva_strace_context {
|
||||||
IDI_CALL request;
|
IDI_CALL request;
|
||||||
BUFFERS XData;
|
BUFFERS XData;
|
||||||
BUFFERS RData;
|
BUFFERS RData;
|
||||||
byte buffer[2048+512+1];
|
byte buffer[DIVA_MAX_MANAGEMENT_TRANSFER_SIZE + 1];
|
||||||
int removal_state;
|
int removal_state;
|
||||||
int general_b_ch_event;
|
int general_b_ch_event;
|
||||||
int general_fax_event;
|
int general_fax_event;
|
||||||
|
|
|
@ -23,17 +23,12 @@ extern char *DRIVERRELEASE_MNT;
|
||||||
|
|
||||||
extern void DIVA_DIDD_Read(void *, int);
|
extern void DIVA_DIDD_Read(void *, int);
|
||||||
|
|
||||||
#define MAX_DESCRIPTORS 32
|
|
||||||
|
|
||||||
static dword notify_handle;
|
static dword notify_handle;
|
||||||
static DESCRIPTOR DAdapter;
|
static DESCRIPTOR DAdapter;
|
||||||
static DESCRIPTOR MAdapter;
|
static DESCRIPTOR MAdapter;
|
||||||
static DESCRIPTOR MaintDescriptor =
|
static DESCRIPTOR MaintDescriptor =
|
||||||
{ IDI_DIMAINT, 0, 0, (IDI_CALL) diva_maint_prtComp };
|
{ 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,
|
extern int diva_os_copy_to_user(void *os_handle, void __user *dst,
|
||||||
const void *src, int length);
|
const void *src, int length);
|
||||||
extern int diva_os_copy_from_user(void *os_handle, void *dst,
|
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"
|
#include "debuglib.c"
|
||||||
|
|
||||||
/*
|
|
||||||
* stop debug
|
|
||||||
*/
|
|
||||||
static void stop_dbg(void)
|
|
||||||
{
|
|
||||||
DbgDeregister();
|
|
||||||
memset(&MAdapter, 0, sizeof(MAdapter));
|
|
||||||
dprintf = no_printf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DIDD callback function
|
* DIDD callback function
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +51,9 @@ static void *didd_callback(void *context, DESCRIPTOR * adapter,
|
||||||
DBG_ERR(("cb: Change in DAdapter ? Oops ?."));
|
DBG_ERR(("cb: Change in DAdapter ? Oops ?."));
|
||||||
} else if (adapter->type == IDI_DIMAINT) {
|
} else if (adapter->type == IDI_DIMAINT) {
|
||||||
if (removal) {
|
if (removal) {
|
||||||
stop_dbg();
|
DbgDeregister();
|
||||||
|
memset(&MAdapter, 0, sizeof(MAdapter));
|
||||||
|
dprintf = no_printf;
|
||||||
} else {
|
} else {
|
||||||
memcpy(&MAdapter, adapter, sizeof(MAdapter));
|
memcpy(&MAdapter, adapter, sizeof(MAdapter));
|
||||||
dprintf = (DIVA_DI_PRINTF) MAdapter.request;
|
dprintf = (DIVA_DI_PRINTF) MAdapter.request;
|
||||||
|
@ -131,8 +118,6 @@ static void DIVA_EXIT_FUNCTION disconnect_didd(void)
|
||||||
{
|
{
|
||||||
IDI_SYNC_REQ req;
|
IDI_SYNC_REQ req;
|
||||||
|
|
||||||
stop_dbg();
|
|
||||||
|
|
||||||
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;
|
||||||
|
@ -193,34 +178,63 @@ int maint_read_write(void __user *buf, int count)
|
||||||
}
|
}
|
||||||
break;
|
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(data, (char __user *)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 (buf, data, ret))
|
||||||
|
ret = -EFAULT;
|
||||||
|
} else {
|
||||||
|
ret = -ENODEV;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case DITRACE_READ_TRACE_ENTRY:{
|
case DITRACE_READ_TRACE_ENTRY:{
|
||||||
diva_os_spin_lock_magic_t old_irql;
|
diva_os_spin_lock_magic_t old_irql;
|
||||||
word size;
|
word size;
|
||||||
diva_dbg_entry_head_t *pmsg;
|
diva_dbg_entry_head_t *pmsg;
|
||||||
byte *pbuf;
|
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) {
|
if (size > mask) {
|
||||||
diva_maint_ack_message(0, &old_irql);
|
diva_maint_ack_message(0, &old_irql);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
} else {
|
break;
|
||||||
if (!(pbuf = diva_os_malloc_tbuffer(0, size)))
|
|
||||||
{
|
|
||||||
diva_maint_ack_message(0, &old_irql);
|
|
||||||
ret = -ENOMEM;
|
|
||||||
} else {
|
|
||||||
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))
|
|
||||||
ret = -EFAULT;
|
|
||||||
diva_os_free_tbuffer(0, pbuf);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
ret = size;
|
||||||
ret = 0;
|
memcpy(pbuf, pmsg, size);
|
||||||
|
diva_maint_ack_message(1, &old_irql);
|
||||||
|
if ((count < size) ||
|
||||||
|
diva_os_copy_to_user (NULL, buf, (void *) pbuf, size))
|
||||||
|
ret = -EFAULT;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
diva_os_free(0, pbuf);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -235,7 +249,7 @@ int maint_read_write(void __user *buf, int count)
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!(pbuf = diva_os_malloc_tbuffer(0, mask))) {
|
if (!(pbuf = diva_os_malloc(0, mask))) {
|
||||||
return (-ENOMEM);
|
return (-ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +287,7 @@ int maint_read_write(void __user *buf, int count)
|
||||||
} else {
|
} else {
|
||||||
ret = written;
|
ret = written;
|
||||||
}
|
}
|
||||||
diva_os_free_tbuffer(0, pbuf);
|
diva_os_free(0, pbuf);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -302,7 +316,7 @@ int DIVA_INIT_FUNCTION mntfunc_init(int *buffer_length, void **buffer,
|
||||||
} else {
|
} else {
|
||||||
while ((*buffer_length >= (64 * 1024))
|
while ((*buffer_length >= (64 * 1024))
|
||||||
&&
|
&&
|
||||||
(!(*buffer = diva_os_malloc_tbuffer(0, *buffer_length)))) {
|
(!(*buffer = diva_os_malloc (0, *buffer_length)))) {
|
||||||
*buffer_length -= 1024;
|
*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_maint_init(*buffer, *buffer_length, (diva_dbg_mem == 0))) {
|
||||||
if (!diva_dbg_mem) {
|
if (!diva_dbg_mem) {
|
||||||
diva_os_free_tbuffer(0, *buffer);
|
diva_os_free (0, *buffer);
|
||||||
}
|
}
|
||||||
DBG_ERR(("init: maint init failed"));
|
DBG_ERR(("init: maint init failed"));
|
||||||
return (0);
|
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."));
|
DBG_ERR(("init: failed to connect to DIDD."));
|
||||||
diva_maint_finit();
|
diva_maint_finit();
|
||||||
if (!diva_dbg_mem) {
|
if (!diva_dbg_mem) {
|
||||||
diva_os_free_tbuffer(0, *buffer);
|
diva_os_free (0, *buffer);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -339,6 +353,8 @@ void DIVA_EXIT_FUNCTION mntfunc_finit(void)
|
||||||
void *buffer;
|
void *buffer;
|
||||||
int i = 100;
|
int i = 100;
|
||||||
|
|
||||||
|
DbgDeregister();
|
||||||
|
|
||||||
while (diva_mnt_shutdown_xdi_adapters() && i--) {
|
while (diva_mnt_shutdown_xdi_adapters() && i--) {
|
||||||
diva_os_sleep(10);
|
diva_os_sleep(10);
|
||||||
}
|
}
|
||||||
|
@ -346,6 +362,9 @@ void DIVA_EXIT_FUNCTION mntfunc_finit(void)
|
||||||
disconnect_didd();
|
disconnect_didd();
|
||||||
|
|
||||||
if ((buffer = diva_maint_finit())) {
|
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_DATA_ACK 12 /* data ack ind for D-bit procedure */
|
||||||
#define N_EDATA_ACK 13 /* data ack ind for INTERRUPT */
|
#define N_EDATA_ACK 13 /* data ack ind for INTERRUPT */
|
||||||
#define N_XON 15 /* clear RNR state */
|
#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_Q_BIT 0x10 /* Q-bit for req/ind */
|
||||||
#define N_M_BIT 0x20 /* M-bit for req/ind */
|
#define N_M_BIT 0x20 /* M-bit for req/ind */
|
||||||
#define N_D_BIT 0x40 /* D-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 VSWITCH_IND 66 /* capifunctions for D-CH-switching */
|
||||||
#define MWI_POLL 67 /* Message Waiting Status Request fkt */
|
#define MWI_POLL 67 /* Message Waiting Status Request fkt */
|
||||||
#define CALL_PEND_NOTIFY 68 /* notify capi to set new listen */
|
#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 */
|
/* management service primitives */
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
|
@ -241,6 +246,7 @@ struct dual
|
||||||
#define MAN_INFO_IND 2
|
#define MAN_INFO_IND 2
|
||||||
#define MAN_EVENT_IND 3
|
#define MAN_EVENT_IND 3
|
||||||
#define MAN_TRACE_IND 4
|
#define MAN_TRACE_IND 4
|
||||||
|
#define MAN_COMBI_IND 9
|
||||||
#define MAN_ESC 0x80
|
#define MAN_ESC 0x80
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
/* return code coding */
|
/* return code coding */
|
||||||
|
@ -265,6 +271,7 @@ struct dual
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
#define SHIFT 0x90 /* codeset shift */
|
#define SHIFT 0x90 /* codeset shift */
|
||||||
#define MORE 0xa0 /* more data */
|
#define MORE 0xa0 /* more data */
|
||||||
|
#define SDNCMPL 0xa1 /* sending complete */
|
||||||
#define CL 0xb0 /* congestion level */
|
#define CL 0xb0 /* congestion level */
|
||||||
/* codeset 0 */
|
/* codeset 0 */
|
||||||
#define SMSG 0x00 /* segmented message */
|
#define SMSG 0x00 /* segmented message */
|
||||||
|
@ -288,6 +295,8 @@ struct dual
|
||||||
#define RDX 0x73 /* redirecting number extended */
|
#define RDX 0x73 /* redirecting number extended */
|
||||||
#define RDN 0x74 /* redirecting number */
|
#define RDN 0x74 /* redirecting number */
|
||||||
#define RIN 0x76 /* redirection 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 RI 0x79 /* restart indicator */
|
||||||
#define MIE 0x7a /* management info element */
|
#define MIE 0x7a /* management info element */
|
||||||
#define LLC 0x7c /* low layer compatibility */
|
#define LLC 0x7c /* low layer compatibility */
|
||||||
|
@ -296,6 +305,8 @@ struct dual
|
||||||
#define ESC 0x7f /* escape extension */
|
#define ESC 0x7f /* escape extension */
|
||||||
#define DLC 0x20 /* data link layer configuration */
|
#define DLC 0x20 /* data link layer configuration */
|
||||||
#define NLC 0x21 /* network 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 */
|
/* codeset 6 */
|
||||||
#define SIN 0x01 /* service indicator */
|
#define SIN 0x01 /* service indicator */
|
||||||
#define CIF 0x02 /* charging information */
|
#define CIF 0x02 /* charging information */
|
||||||
|
@ -306,6 +317,7 @@ struct dual
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
#define MSGTYPEIE 0x7a /* Messagetype info element */
|
#define MSGTYPEIE 0x7a /* Messagetype info element */
|
||||||
#define CRIE 0x7b /* INFO info element */
|
#define CRIE 0x7b /* INFO info element */
|
||||||
|
#define CODESET6IE 0xec /* Tunnel for Codeset 6 IEs */
|
||||||
#define VSWITCHIE 0xed /* VSwitch info element */
|
#define VSWITCHIE 0xed /* VSwitch info element */
|
||||||
#define SSEXTIE 0xee /* Supplem. Service info element */
|
#define SSEXTIE 0xee /* Supplem. Service info element */
|
||||||
#define PROFILEIE 0xef /* Profile info element */
|
#define PROFILEIE 0xef /* Profile info element */
|
||||||
|
@ -344,6 +356,13 @@ struct dual
|
||||||
#define CCBS_REQUEST 0x32
|
#define CCBS_REQUEST 0x32
|
||||||
#define CCBS_DEACTIVATE 0x33
|
#define CCBS_DEACTIVATE 0x33
|
||||||
#define CCBS_INTERROGATE 0x34
|
#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 GET_SUPPORTED_SERVICES 0xff
|
||||||
#define DIVERSION_PROCEDURE_CFU 0x70
|
#define DIVERSION_PROCEDURE_CFU 0x70
|
||||||
#define DIVERSION_PROCEDURE_CFB 0x71
|
#define DIVERSION_PROCEDURE_CFB 0x71
|
||||||
|
@ -362,6 +381,7 @@ struct dual
|
||||||
#define SMASK_3PTY 0x00000008
|
#define SMASK_3PTY 0x00000008
|
||||||
#define SMASK_CALL_FORWARDING 0x00000010
|
#define SMASK_CALL_FORWARDING 0x00000010
|
||||||
#define SMASK_CALL_DEFLECTION 0x00000020
|
#define SMASK_CALL_DEFLECTION 0x00000020
|
||||||
|
#define SMASK_MCID 0x00000040
|
||||||
#define SMASK_CCBS 0x00000080
|
#define SMASK_CCBS 0x00000080
|
||||||
#define SMASK_MWI 0x00000100
|
#define SMASK_MWI 0x00000100
|
||||||
#define SMASK_CCNR 0x00000200
|
#define SMASK_CCNR 0x00000200
|
||||||
|
@ -406,6 +426,8 @@ struct dual
|
||||||
#define RTPL2_IN 13 /* RTP layer-2 protocol, incomming */
|
#define RTPL2_IN 13 /* RTP layer-2 protocol, incomming */
|
||||||
#define RTPL2 14 /* RTP layer-2 protocol */
|
#define RTPL2 14 /* RTP layer-2 protocol */
|
||||||
#define V120_V42BIS 15 /* V.120 asynchronous mode supporting V.42bis compression */
|
#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 */
|
#define PIAFS_CRC 29 /* PIAFS Layer 2 with CRC calculation at L2 */
|
||||||
/* ------------------------------------------------------
|
/* ------------------------------------------------------
|
||||||
PIAFS DLC DEFINITIONS
|
PIAFS DLC DEFINITIONS
|
||||||
|
@ -506,6 +528,22 @@ Byte | 8 7 6 5 4 3 2 1
|
||||||
| | | data transfer. |
|
| | | 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 */
|
/* 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_DMACONNECT 0x04000000L
|
||||||
#define MANUFACTURER_FEATURE_AUDIO_TAP 0x08000000L
|
#define MANUFACTURER_FEATURE_AUDIO_TAP 0x08000000L
|
||||||
#define MANUFACTURER_FEATURE_FAX_NONSTANDARD 0x10000000L
|
#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_PCMU_8000 0
|
||||||
#define RTP_PRIM_PAYLOAD_1016_8000 1
|
#define RTP_PRIM_PAYLOAD_1016_8000 1
|
||||||
#define RTP_PRIM_PAYLOAD_G726_32_8000 2
|
#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 VSINVOKEID 4
|
||||||
#define VSCLMRKS 5
|
#define VSCLMRKS 5
|
||||||
#define VSTBCTIDENT 6
|
#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 **
|
** The PROTOCOL_FEATURE_STRING in feature.h (included **
|
||||||
** in prstart.sx and astart.sx) defines capabilities and **
|
** 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_FREE13 0x2000 /* not used */
|
||||||
#define PROTCAP_FREE14 0x4000 /* not used */
|
#define PROTCAP_FREE14 0x4000 /* not used */
|
||||||
#define PROTCAP_EXTENSION 0x8000 /* used for future extentions */
|
#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
|
#else
|
||||||
#endif /* PC_H_INCLUDED } */
|
#endif /* PC_H_INCLUDED } */
|
||||||
|
|
|
@ -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, \
|
diva_os_spin_lock_magic_t* old_irql, \
|
||||||
void* dbg) { spin_unlock_bh(a); }
|
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)
|
#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
|
#define DIVA_IDI_RX_DMA 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
** endian macros
|
||||||
|
*/
|
||||||
#define READ_WORD(addr) readw(addr)
|
#define READ_WORD(addr) readw(addr)
|
||||||
#define READ_DWORD(addr) readl(addr)
|
#define READ_DWORD(addr) readl(addr)
|
||||||
|
|
||||||
#define WRITE_WORD(addr,v) writew(v,addr)
|
#define WRITE_WORD(addr,v) writew(v,addr)
|
||||||
#define WRITE_DWORD(addr,v) writel(v,addr)
|
#define WRITE_DWORD(addr,v) writel(v,addr)
|
||||||
|
|
||||||
|
/*
|
||||||
|
** 32/64 bit macors
|
||||||
|
*/
|
||||||
#ifdef BITS_PER_LONG
|
#ifdef BITS_PER_LONG
|
||||||
#if BITS_PER_LONG > 32
|
#if BITS_PER_LONG > 32
|
||||||
#define PLATFORM_GT_32BIT
|
#define PLATFORM_GT_32BIT
|
||||||
|
@ -360,8 +352,23 @@ diva_os_atomic_decrement(diva_os_atomic_t* pv)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
** undef os definitions of macros we use
|
||||||
|
*/
|
||||||
#undef ID_MASK
|
#undef ID_MASK
|
||||||
#undef N_DATA
|
#undef N_DATA
|
||||||
#undef ADDR
|
#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__ */
|
#endif /* __PLATFORM_H__ */
|
||||||
|
|
|
@ -752,70 +752,70 @@ setup_avm_pcipnp(struct IsdnCard *card)
|
||||||
cs->hw.avm.cfg_reg = card->para[1];
|
cs->hw.avm.cfg_reg = card->para[1];
|
||||||
cs->irq = card->para[0];
|
cs->irq = card->para[0];
|
||||||
cs->subtyp = AVM_FRITZ_PNP;
|
cs->subtyp = AVM_FRITZ_PNP;
|
||||||
} else {
|
goto ready;
|
||||||
|
}
|
||||||
#ifdef __ISAPNP__
|
#ifdef __ISAPNP__
|
||||||
if (isapnp_present()) {
|
if (isapnp_present()) {
|
||||||
struct pnp_dev *pnp_avm_d = NULL;
|
struct pnp_dev *pnp_avm_d = NULL;
|
||||||
if ((pnp_avm_c = pnp_find_card(
|
if ((pnp_avm_c = pnp_find_card(
|
||||||
|
ISAPNP_VENDOR('A', 'V', 'M'),
|
||||||
|
ISAPNP_FUNCTION(0x0900), pnp_avm_c))) {
|
||||||
|
if ((pnp_avm_d = pnp_find_dev(pnp_avm_c,
|
||||||
ISAPNP_VENDOR('A', 'V', 'M'),
|
ISAPNP_VENDOR('A', 'V', 'M'),
|
||||||
ISAPNP_FUNCTION(0x0900), pnp_avm_c))) {
|
ISAPNP_FUNCTION(0x0900), pnp_avm_d))) {
|
||||||
if ((pnp_avm_d = pnp_find_dev(pnp_avm_c,
|
int err;
|
||||||
ISAPNP_VENDOR('A', 'V', 'M'),
|
|
||||||
ISAPNP_FUNCTION(0x0900), pnp_avm_d))) {
|
|
||||||
int err;
|
|
||||||
|
|
||||||
pnp_disable_dev(pnp_avm_d);
|
pnp_disable_dev(pnp_avm_d);
|
||||||
err = pnp_activate_dev(pnp_avm_d);
|
err = pnp_activate_dev(pnp_avm_d);
|
||||||
if (err<0) {
|
if (err<0) {
|
||||||
printk(KERN_WARNING "%s: pnp_activate_dev ret(%d)\n",
|
printk(KERN_WARNING "%s: pnp_activate_dev ret(%d)\n",
|
||||||
__FUNCTION__, err);
|
__FUNCTION__, err);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
|
||||||
cs->hw.avm.cfg_reg =
|
|
||||||
pnp_port_start(pnp_avm_d, 0);
|
|
||||||
cs->irq = pnp_irq(pnp_avm_d, 0);
|
|
||||||
if (!cs->irq) {
|
|
||||||
printk(KERN_ERR "FritzPnP:No IRQ\n");
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
if (!cs->hw.avm.cfg_reg) {
|
|
||||||
printk(KERN_ERR "FritzPnP:No IO address\n");
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
cs->subtyp = AVM_FRITZ_PNP;
|
|
||||||
goto ready;
|
|
||||||
}
|
}
|
||||||
|
cs->hw.avm.cfg_reg =
|
||||||
|
pnp_port_start(pnp_avm_d, 0);
|
||||||
|
cs->irq = pnp_irq(pnp_avm_d, 0);
|
||||||
|
if (!cs->irq) {
|
||||||
|
printk(KERN_ERR "FritzPnP:No IRQ\n");
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
if (!cs->hw.avm.cfg_reg) {
|
||||||
|
printk(KERN_ERR "FritzPnP:No IO address\n");
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
cs->subtyp = AVM_FRITZ_PNP;
|
||||||
|
goto ready;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
printk(KERN_INFO "FritzPnP: no ISA PnP present\n");
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
printk(KERN_INFO "FritzPnP: no ISA PnP present\n");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
if ((dev_avm = pci_find_device(PCI_VENDOR_ID_AVM,
|
if ((dev_avm = pci_find_device(PCI_VENDOR_ID_AVM,
|
||||||
PCI_DEVICE_ID_AVM_A1, dev_avm))) {
|
PCI_DEVICE_ID_AVM_A1, dev_avm))) {
|
||||||
cs->irq = dev_avm->irq;
|
cs->irq = dev_avm->irq;
|
||||||
if (!cs->irq) {
|
if (!cs->irq) {
|
||||||
printk(KERN_ERR "FritzPCI: No IRQ for PCI card found\n");
|
printk(KERN_ERR "FritzPCI: No IRQ for PCI card found\n");
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
if (pci_enable_device(dev_avm))
|
|
||||||
return(0);
|
|
||||||
cs->hw.avm.cfg_reg = pci_resource_start(dev_avm, 1);
|
|
||||||
if (!cs->hw.avm.cfg_reg) {
|
|
||||||
printk(KERN_ERR "FritzPCI: No IO-Adr for PCI card found\n");
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
cs->subtyp = AVM_FRITZ_PCI;
|
|
||||||
} else {
|
|
||||||
printk(KERN_WARNING "FritzPCI: No PCI card found\n");
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
cs->irq_flags |= SA_SHIRQ;
|
if (pci_enable_device(dev_avm))
|
||||||
#else
|
return(0);
|
||||||
printk(KERN_WARNING "FritzPCI: NO_PCI_BIOS\n");
|
cs->hw.avm.cfg_reg = pci_resource_start(dev_avm, 1);
|
||||||
return (0);
|
if (!cs->hw.avm.cfg_reg) {
|
||||||
#endif /* CONFIG_PCI */
|
printk(KERN_ERR "FritzPCI: No IO-Adr for PCI card found\n");
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
cs->subtyp = AVM_FRITZ_PCI;
|
||||||
|
} else {
|
||||||
|
printk(KERN_WARNING "FritzPCI: No PCI card found\n");
|
||||||
|
return(0);
|
||||||
}
|
}
|
||||||
|
cs->irq_flags |= SA_SHIRQ;
|
||||||
|
#else
|
||||||
|
printk(KERN_WARNING "FritzPCI: NO_PCI_BIOS\n");
|
||||||
|
return (0);
|
||||||
|
#endif /* CONFIG_PCI */
|
||||||
ready:
|
ready:
|
||||||
cs->hw.avm.isac = cs->hw.avm.cfg_reg + 0x10;
|
cs->hw.avm.isac = cs->hw.avm.cfg_reg + 0x10;
|
||||||
if (!request_region(cs->hw.avm.cfg_reg, 32,
|
if (!request_region(cs->hw.avm.cfg_reg, 32,
|
||||||
|
|
|
@ -265,7 +265,7 @@ setup_bkm_a4t(struct IsdnCard *card)
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
u_int pci_memaddr = 0, found = 0;
|
u_int pci_memaddr = 0, found = 0;
|
||||||
I20_REGISTER_FILE *pI20_Regs;
|
I20_REGISTER_FILE *pI20_Regs;
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(tmp, bkm_a4t_revision);
|
strcpy(tmp, bkm_a4t_revision);
|
||||||
|
@ -275,7 +275,7 @@ setup_bkm_a4t(struct IsdnCard *card)
|
||||||
} else
|
} else
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
while ((dev_a4t = pci_find_device(PCI_VENDOR_ID_ZORAN,
|
while ((dev_a4t = pci_find_device(PCI_VENDOR_ID_ZORAN,
|
||||||
PCI_DEVICE_ID_ZORAN_36120, dev_a4t))) {
|
PCI_DEVICE_ID_ZORAN_36120, dev_a4t))) {
|
||||||
u16 sub_sys;
|
u16 sub_sys;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
#include "bkm_ax.h"
|
#include "bkm_ax.h"
|
||||||
|
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
|
|
||||||
#define ATTEMPT_PCI_REMAPPING /* Required for PLX rev 1 */
|
#define ATTEMPT_PCI_REMAPPING /* Required for PLX rev 1 */
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ static u_char pci_irq __initdata = 0;
|
||||||
int __init
|
int __init
|
||||||
setup_sct_quadro(struct IsdnCard *card)
|
setup_sct_quadro(struct IsdnCard *card)
|
||||||
{
|
{
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
struct IsdnCardState *cs = card->cs;
|
struct IsdnCardState *cs = card->cs;
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
u_char pci_rev_id;
|
u_char pci_rev_id;
|
||||||
|
|
|
@ -1027,7 +1027,7 @@ setup_diva(struct IsdnCard *card)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
cs->subtyp = 0;
|
cs->subtyp = 0;
|
||||||
if ((dev_diva = pci_find_device(PCI_VENDOR_ID_EICON,
|
if ((dev_diva = pci_find_device(PCI_VENDOR_ID_EICON,
|
||||||
PCI_DEVICE_ID_EICON_DIVA20, dev_diva))) {
|
PCI_DEVICE_ID_EICON_DIVA20, dev_diva))) {
|
||||||
|
|
|
@ -1022,7 +1022,7 @@ setup_elsa(struct IsdnCard *card)
|
||||||
cs->hw.elsa.base,
|
cs->hw.elsa.base,
|
||||||
cs->irq);
|
cs->irq);
|
||||||
} else if (cs->typ == ISDN_CTYPE_ELSA_PCI) {
|
} else if (cs->typ == ISDN_CTYPE_ELSA_PCI) {
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
cs->subtyp = 0;
|
cs->subtyp = 0;
|
||||||
if ((dev_qs1000 = pci_find_device(PCI_VENDOR_ID_ELSA,
|
if ((dev_qs1000 = pci_find_device(PCI_VENDOR_ID_ELSA,
|
||||||
PCI_DEVICE_ID_ELSA_MICROLINK, dev_qs1000))) {
|
PCI_DEVICE_ID_ELSA_MICROLINK, dev_qs1000))) {
|
||||||
|
|
|
@ -299,7 +299,7 @@ setup_enternow_pci(struct IsdnCard *card)
|
||||||
struct IsdnCardState *cs = card->cs;
|
struct IsdnCardState *cs = card->cs;
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
|
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
#ifdef __BIG_ENDIAN
|
#ifdef __BIG_ENDIAN
|
||||||
#error "not running on big endian machines now"
|
#error "not running on big endian machines now"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -634,7 +634,7 @@ setup_gazel(struct IsdnCard *card)
|
||||||
return (0);
|
return (0);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
if (setup_gazelpci(cs))
|
if (setup_gazelpci(cs))
|
||||||
return (0);
|
return (0);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -39,7 +39,6 @@ typedef struct {
|
||||||
#define CLKDEL_TE 0x0e /* CLKDEL in TE mode */
|
#define CLKDEL_TE 0x0e /* CLKDEL in TE mode */
|
||||||
#define CLKDEL_NT 0x6c /* CLKDEL in NT mode */
|
#define CLKDEL_NT 0x6c /* CLKDEL in NT mode */
|
||||||
|
|
||||||
|
|
||||||
static const PCI_ENTRY id_list[] =
|
static const PCI_ENTRY id_list[] =
|
||||||
{
|
{
|
||||||
{PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_2BD0, "CCD/Billion/Asuscom", "2BD0"},
|
{PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_2BD0, "CCD/Billion/Asuscom", "2BD0"},
|
||||||
|
@ -69,7 +68,7 @@ static const PCI_ENTRY id_list[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
|
|
||||||
/******************************************/
|
/******************************************/
|
||||||
/* free hardware resources used by driver */
|
/* free hardware resources used by driver */
|
||||||
|
@ -1659,7 +1658,7 @@ setup_hfcpci(struct IsdnCard *card)
|
||||||
#endif
|
#endif
|
||||||
strcpy(tmp, hfcpci_revision);
|
strcpy(tmp, hfcpci_revision);
|
||||||
printk(KERN_INFO "HiSax: HFC-PCI driver Rev. %s\n", HiSax_getrev(tmp));
|
printk(KERN_INFO "HiSax: HFC-PCI driver Rev. %s\n", HiSax_getrev(tmp));
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
cs->hw.hfcpci.int_s1 = 0;
|
cs->hw.hfcpci.int_s1 = 0;
|
||||||
cs->dc.hfcpci.ph_state = 0;
|
cs->dc.hfcpci.ph_state = 0;
|
||||||
cs->hw.hfcpci.fifo = 255;
|
cs->hw.hfcpci.fifo = 255;
|
||||||
|
@ -1703,11 +1702,11 @@ setup_hfcpci(struct IsdnCard *card)
|
||||||
/* Allocate memory for FIFOS */
|
/* Allocate memory for FIFOS */
|
||||||
/* Because the HFC-PCI needs a 32K physical alignment, we */
|
/* Because the HFC-PCI needs a 32K physical alignment, we */
|
||||||
/* need to allocate the double mem and align the address */
|
/* need to allocate the double mem and align the address */
|
||||||
if (!((void *) cs->hw.hfcpci.share_start = kmalloc(65536, GFP_KERNEL))) {
|
if (!(cs->hw.hfcpci.share_start = kmalloc(65536, GFP_KERNEL))) {
|
||||||
printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n");
|
printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
(ulong) cs->hw.hfcpci.fifos =
|
cs->hw.hfcpci.fifos = (void *)
|
||||||
(((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000;
|
(((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000;
|
||||||
pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u_int) virt_to_bus(cs->hw.hfcpci.fifos));
|
pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u_int) virt_to_bus(cs->hw.hfcpci.fifos));
|
||||||
cs->hw.hfcpci.pci_io = ioremap((ulong) cs->hw.hfcpci.pci_io, 256);
|
cs->hw.hfcpci.pci_io = ioremap((ulong) cs->hw.hfcpci.pci_io, 256);
|
||||||
|
|
|
@ -309,7 +309,7 @@ setup_niccy(struct IsdnCard *card)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
u_int pci_ioaddr;
|
u_int pci_ioaddr;
|
||||||
cs->subtyp = 0;
|
cs->subtyp = 0;
|
||||||
if ((niccy_dev = pci_find_device(PCI_VENDOR_ID_SATSAGEM,
|
if ((niccy_dev = pci_find_device(PCI_VENDOR_ID_SATSAGEM,
|
||||||
|
|
|
@ -167,7 +167,7 @@ setup_netjet_s(struct IsdnCard *card)
|
||||||
return(0);
|
return(0);
|
||||||
test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
|
test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
|
||||||
|
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
|
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
|
|
|
@ -137,7 +137,7 @@ setup_netjet_u(struct IsdnCard *card)
|
||||||
int bytecnt;
|
int bytecnt;
|
||||||
struct IsdnCardState *cs = card->cs;
|
struct IsdnCardState *cs = card->cs;
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
#endif
|
#endif
|
||||||
#ifdef __BIG_ENDIAN
|
#ifdef __BIG_ENDIAN
|
||||||
#error "not running on big endian machines now"
|
#error "not running on big endian machines now"
|
||||||
|
@ -148,7 +148,7 @@ setup_netjet_u(struct IsdnCard *card)
|
||||||
return(0);
|
return(0);
|
||||||
test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
|
test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
|
||||||
|
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
|
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
|
|
|
@ -618,7 +618,7 @@ setup_sedlbauer(struct IsdnCard *card)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Probe for Sedlbauer speed pci */
|
/* Probe for Sedlbauer speed pci */
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
if ((dev_sedl = pci_find_device(PCI_VENDOR_ID_TIGERJET,
|
if ((dev_sedl = pci_find_device(PCI_VENDOR_ID_TIGERJET,
|
||||||
PCI_DEVICE_ID_TIGERJET_100, dev_sedl))) {
|
PCI_DEVICE_ID_TIGERJET_100, dev_sedl))) {
|
||||||
if (pci_enable_device(dev_sedl))
|
if (pci_enable_device(dev_sedl))
|
||||||
|
|
|
@ -143,9 +143,6 @@ static void usb_ctrl_complete(struct urb *urb, struct pt_regs *regs)
|
||||||
if (ctrl_msg->dr.bRequest == USB_REQ_CLEAR_FEATURE) {
|
if (ctrl_msg->dr.bRequest == USB_REQ_CLEAR_FEATURE) {
|
||||||
/* Special case handling for pipe reset */
|
/* Special case handling for pipe reset */
|
||||||
le16_to_cpus(&ctrl_msg->dr.wIndex);
|
le16_to_cpus(&ctrl_msg->dr.wIndex);
|
||||||
usb_endpoint_running(adapter->usb_dev,
|
|
||||||
ctrl_msg->dr.wIndex & ~USB_DIR_IN,
|
|
||||||
(ctrl_msg->dr.wIndex & USB_DIR_IN) == 0);
|
|
||||||
|
|
||||||
/* toggle is reset on clear */
|
/* toggle is reset on clear */
|
||||||
usb_settoggle(adapter->usb_dev,
|
usb_settoggle(adapter->usb_dev,
|
||||||
|
|
|
@ -300,7 +300,7 @@ setup_telespci(struct IsdnCard *card)
|
||||||
printk(KERN_INFO "HiSax: Teles/PCI driver Rev. %s\n", HiSax_getrev(tmp));
|
printk(KERN_INFO "HiSax: Teles/PCI driver Rev. %s\n", HiSax_getrev(tmp));
|
||||||
if (cs->typ != ISDN_CTYPE_TELESPCI)
|
if (cs->typ != ISDN_CTYPE_TELESPCI)
|
||||||
return (0);
|
return (0);
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
if ((dev_tel = pci_find_device (PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36120, dev_tel))) {
|
if ((dev_tel = pci_find_device (PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36120, dev_tel))) {
|
||||||
if (pci_enable_device(dev_tel))
|
if (pci_enable_device(dev_tel))
|
||||||
return(0);
|
return(0);
|
||||||
|
|
|
@ -1012,7 +1012,7 @@ setup_w6692(struct IsdnCard *card)
|
||||||
printk(KERN_INFO "HiSax: W6692 driver Rev. %s\n", HiSax_getrev(tmp));
|
printk(KERN_INFO "HiSax: W6692 driver Rev. %s\n", HiSax_getrev(tmp));
|
||||||
if (cs->typ != ISDN_CTYPE_W6692)
|
if (cs->typ != ISDN_CTYPE_W6692)
|
||||||
return (0);
|
return (0);
|
||||||
#if CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
while (id_list[id_idx].vendor_id) {
|
while (id_list[id_idx].vendor_id) {
|
||||||
dev_w6692 = pci_find_device(id_list[id_idx].vendor_id,
|
dev_w6692 = pci_find_device(id_list[id_idx].vendor_id,
|
||||||
id_list[id_idx].device_id,
|
id_list[id_idx].device_id,
|
||||||
|
|
|
@ -1369,7 +1369,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
|
||||||
|
|
||||||
skb->mac.raw = skb->data;
|
skb->mac.raw = skb->data;
|
||||||
skb_pull(skb, ETH_HLEN);
|
skb_pull(skb, ETH_HLEN);
|
||||||
eth = skb->mac.ethernet;
|
eth = eth_hdr(skb);
|
||||||
|
|
||||||
if (*eth->h_dest & 1) {
|
if (*eth->h_dest & 1) {
|
||||||
if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0)
|
if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0)
|
||||||
|
|
|
@ -296,10 +296,7 @@ isdn_tty_tint(modem_info * info)
|
||||||
info->send_outstanding++;
|
info->send_outstanding++;
|
||||||
info->msr &= ~UART_MSR_CTS;
|
info->msr &= ~UART_MSR_CTS;
|
||||||
info->lsr &= ~UART_LSR_TEMT;
|
info->lsr &= ~UART_LSR_TEMT;
|
||||||
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
|
tty_wakeup(tty);
|
||||||
tty->ldisc.write_wakeup)
|
|
||||||
(tty->ldisc.write_wakeup) (tty);
|
|
||||||
wake_up_interruptible(&tty->write_wait);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (slen < 0) {
|
if (slen < 0) {
|
||||||
|
@ -1174,10 +1171,7 @@ isdn_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int co
|
||||||
/* If DLE decoding results in zero-transmit, but
|
/* If DLE decoding results in zero-transmit, but
|
||||||
* c originally was non-zero, do a wakeup.
|
* c originally was non-zero, do a wakeup.
|
||||||
*/
|
*/
|
||||||
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
|
tty_wakeup(tty);
|
||||||
tty->ldisc.write_wakeup)
|
|
||||||
(tty->ldisc.write_wakeup) (tty);
|
|
||||||
wake_up_interruptible(&tty->write_wait);
|
|
||||||
info->msr |= UART_MSR_CTS;
|
info->msr |= UART_MSR_CTS;
|
||||||
info->lsr |= UART_LSR_TEMT;
|
info->lsr |= UART_LSR_TEMT;
|
||||||
}
|
}
|
||||||
|
@ -1290,9 +1284,7 @@ isdn_tty_flush_buffer(struct tty_struct *tty)
|
||||||
isdn_tty_cleanup_xmit(info);
|
isdn_tty_cleanup_xmit(info);
|
||||||
info->xmit_count = 0;
|
info->xmit_count = 0;
|
||||||
wake_up_interruptible(&tty->write_wait);
|
wake_up_interruptible(&tty->write_wait);
|
||||||
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
|
tty_wakeup(tty);
|
||||||
tty->ldisc.write_wakeup)
|
|
||||||
(tty->ldisc.write_wakeup) (tty);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1747,10 +1739,10 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
|
||||||
}
|
}
|
||||||
dev->modempoll--;
|
dev->modempoll--;
|
||||||
isdn_tty_shutdown(info);
|
isdn_tty_shutdown(info);
|
||||||
|
|
||||||
if (tty->driver->flush_buffer)
|
if (tty->driver->flush_buffer)
|
||||||
tty->driver->flush_buffer(tty);
|
tty->driver->flush_buffer(tty);
|
||||||
if (tty->ldisc.flush_buffer)
|
tty_ldisc_flush(tty);
|
||||||
tty->ldisc.flush_buffer(tty);
|
|
||||||
info->tty = NULL;
|
info->tty = NULL;
|
||||||
info->ncarrier = 0;
|
info->ncarrier = 0;
|
||||||
tty->closing = 0;
|
tty->closing = 0;
|
||||||
|
@ -2681,8 +2673,7 @@ isdn_tty_modem_result(int code, modem_info * info)
|
||||||
if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) {
|
if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (info->tty->ldisc.flush_buffer)
|
tty_ldisc_flush(info->tty);
|
||||||
info->tty->ldisc.flush_buffer(info->tty);
|
|
||||||
if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
|
if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
|
||||||
(!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
|
(!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
|
||||||
(info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {
|
(info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
/* Local functions prototypes */
|
/* Local functions prototypes */
|
||||||
static int __devinit tpam_probe(struct pci_dev *, const struct pci_device_id *);
|
static int __devinit tpam_probe(struct pci_dev *, const struct pci_device_id *);
|
||||||
static void __devexit tpam_unregister_card(tpam_card *);
|
static void __devexit tpam_unregister_card(struct pci_dev *, tpam_card *);
|
||||||
static void __devexit tpam_remove(struct pci_dev *);
|
static void __devexit tpam_remove(struct pci_dev *);
|
||||||
static int __init tpam_init(void);
|
static int __init tpam_init(void);
|
||||||
static void __exit tpam_exit(void);
|
static void __exit tpam_exit(void);
|
||||||
|
@ -86,13 +86,20 @@ u32 tpam_findchannel(tpam_card *card, u32 ncoid) {
|
||||||
*/
|
*/
|
||||||
static int __devinit tpam_probe(struct pci_dev *dev, const struct pci_device_id *pci_id) {
|
static int __devinit tpam_probe(struct pci_dev *dev, const struct pci_device_id *pci_id) {
|
||||||
tpam_card *card, *c;
|
tpam_card *card, *c;
|
||||||
int i;
|
int i, err;
|
||||||
|
|
||||||
|
if (pci_enable_device(dev)) {
|
||||||
|
printk(KERN_ERR "TurboPAM: can't enable PCI device at %s\n",
|
||||||
|
pci_name(dev));
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
/* allocate memory for the board structure */
|
/* allocate memory for the board structure */
|
||||||
if (!(card = (tpam_card *)kmalloc(sizeof(tpam_card), GFP_KERNEL))) {
|
if (!(card = (tpam_card *)kmalloc(sizeof(tpam_card), GFP_KERNEL))) {
|
||||||
printk(KERN_ERR "TurboPAM: tpam_register_card: "
|
printk(KERN_ERR "TurboPAM: tpam_register_card: "
|
||||||
"kmalloc failed!\n");
|
"kmalloc failed!\n");
|
||||||
return -ENOMEM;
|
err = -ENOMEM;
|
||||||
|
goto err_out_disable_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset((char *)card, 0, sizeof(tpam_card));
|
memset((char *)card, 0, sizeof(tpam_card));
|
||||||
|
@ -106,8 +113,8 @@ static int __devinit tpam_probe(struct pci_dev *dev, const struct pci_device_id
|
||||||
card->interface.id, card)) {
|
card->interface.id, card)) {
|
||||||
printk(KERN_ERR "TurboPAM: tpam_register_card: "
|
printk(KERN_ERR "TurboPAM: tpam_register_card: "
|
||||||
"could not request irq %d\n", card->irq);
|
"could not request irq %d\n", card->irq);
|
||||||
kfree(card);
|
err = -EIO;
|
||||||
return -EIO;
|
goto err_out_free_card;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remap board memory */
|
/* remap board memory */
|
||||||
|
@ -115,9 +122,8 @@ static int __devinit tpam_probe(struct pci_dev *dev, const struct pci_device_id
|
||||||
0x800000))) {
|
0x800000))) {
|
||||||
printk(KERN_ERR "TurboPAM: tpam_register_card: "
|
printk(KERN_ERR "TurboPAM: tpam_register_card: "
|
||||||
"unable to remap bar0\n");
|
"unable to remap bar0\n");
|
||||||
free_irq(card->irq, card);
|
err = -EIO;
|
||||||
kfree(card);
|
goto err_out_free_irq;
|
||||||
return -EIO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reset the board */
|
/* reset the board */
|
||||||
|
@ -150,10 +156,8 @@ static int __devinit tpam_probe(struct pci_dev *dev, const struct pci_device_id
|
||||||
if (!register_isdn(&card->interface)) {
|
if (!register_isdn(&card->interface)) {
|
||||||
printk(KERN_ERR "TurboPAM: tpam_register_card: "
|
printk(KERN_ERR "TurboPAM: tpam_register_card: "
|
||||||
"unable to register %s\n", card->interface.id);
|
"unable to register %s\n", card->interface.id);
|
||||||
free_irq(card->irq, card);
|
err = -EIO;
|
||||||
iounmap((void *)card->bar0);
|
goto err_out_iounmap;
|
||||||
kfree(card);
|
|
||||||
return -EIO;
|
|
||||||
}
|
}
|
||||||
card->id = card->interface.channels;
|
card->id = card->interface.channels;
|
||||||
|
|
||||||
|
@ -195,6 +199,19 @@ static int __devinit tpam_probe(struct pci_dev *dev, const struct pci_device_id
|
||||||
pci_set_drvdata(dev, card);
|
pci_set_drvdata(dev, card);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err_out_iounmap:
|
||||||
|
iounmap((void *)card->bar0);
|
||||||
|
|
||||||
|
err_out_free_irq:
|
||||||
|
free_irq(card->irq, card);
|
||||||
|
|
||||||
|
err_out_free_card:
|
||||||
|
kfree(card);
|
||||||
|
|
||||||
|
err_out_disable_dev:
|
||||||
|
pci_disable_device(dev);
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -202,7 +219,7 @@ static int __devinit tpam_probe(struct pci_dev *dev, const struct pci_device_id
|
||||||
*
|
*
|
||||||
* card: the board.
|
* card: the board.
|
||||||
*/
|
*/
|
||||||
static void __devexit tpam_unregister_card(tpam_card *card) {
|
static void __devexit tpam_unregister_card(struct pci_dev *pcidev, tpam_card *card) {
|
||||||
isdn_ctrl cmd;
|
isdn_ctrl cmd;
|
||||||
|
|
||||||
/* prevent the ISDN link layer that the driver will be unloaded */
|
/* prevent the ISDN link layer that the driver will be unloaded */
|
||||||
|
@ -215,6 +232,8 @@ static void __devexit tpam_unregister_card(tpam_card *card) {
|
||||||
|
|
||||||
/* release mapped memory */
|
/* release mapped memory */
|
||||||
iounmap((void *)card->bar0);
|
iounmap((void *)card->bar0);
|
||||||
|
|
||||||
|
pci_disable_device(pcidev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -235,7 +254,7 @@ static void __devexit tpam_remove(struct pci_dev *pcidev) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* unregister each board */
|
/* unregister each board */
|
||||||
tpam_unregister_card(card);
|
tpam_unregister_card(pcidev, card);
|
||||||
|
|
||||||
/* and free the board structure itself */
|
/* and free the board structure itself */
|
||||||
kfree(card);
|
kfree(card);
|
||||||
|
|
Loading…
Reference in New Issue