isdn: whitespace coding style cleanup

isdn source code uses a not-current coding style.

Update the coding style used on a per-line basis
so that git diff -w shows only elided blank lines
at EOF.

Done with emacs and some scripts and some typing.

Built x86 allyesconfig.
No detected change in objdump -d or size.

Signed-off-by: Joe Perches <joe@perches.com>
This commit is contained in:
Joe Perches
2012-02-19 19:52:38 -08:00
parent 0b0a635f79
commit 475be4d85a
314 changed files with 49170 additions and 49266 deletions

View File

@@ -129,7 +129,7 @@ typedef struct act2000_chan {
typedef struct msn_entry { typedef struct msn_entry {
char eaz; char eaz;
char msn[16]; char msn[16];
struct msn_entry * next; struct msn_entry *next;
} msn_entry; } msn_entry;
typedef struct irq_data_isa { typedef struct irq_data_isa {

View File

@@ -85,7 +85,7 @@ act2000_isa_interrupt(int dummy, void *dev_id)
} }
static void static void
act2000_isa_select_irq(act2000_card * card) act2000_isa_select_irq(act2000_card *card)
{ {
unsigned char reg; unsigned char reg;
@@ -117,7 +117,7 @@ act2000_isa_select_irq(act2000_card * card)
} }
static void static void
act2000_isa_enable_irq(act2000_card * card) act2000_isa_enable_irq(act2000_card *card)
{ {
act2000_isa_select_irq(card); act2000_isa_select_irq(card);
/* Enable READ irq */ /* Enable READ irq */
@@ -129,7 +129,7 @@ act2000_isa_enable_irq(act2000_card * card)
* If irq is -1, choose next free irq, else irq is given explicitly. * If irq is -1, choose next free irq, else irq is given explicitly.
*/ */
int int
act2000_isa_config_irq(act2000_card * card, short irq) act2000_isa_config_irq(act2000_card *card, short irq)
{ {
int old_irq; int old_irq;
@@ -147,7 +147,7 @@ act2000_isa_config_irq(act2000_card * card, short irq)
card->irq = old_irq; card->irq = old_irq;
card->flags |= ACT2000_FLAGS_IVALID; card->flags |= ACT2000_FLAGS_IVALID;
printk(KERN_WARNING printk(KERN_WARNING
"act2000: Could not request irq %d\n",irq); "act2000: Could not request irq %d\n", irq);
return -EBUSY; return -EBUSY;
} else { } else {
act2000_isa_select_irq(card); act2000_isa_select_irq(card);
@@ -159,7 +159,7 @@ act2000_isa_config_irq(act2000_card * card, short irq)
} }
int int
act2000_isa_config_port(act2000_card * card, unsigned short portbase) act2000_isa_config_port(act2000_card *card, unsigned short portbase)
{ {
if (card->flags & ACT2000_FLAGS_PVALID) { if (card->flags & ACT2000_FLAGS_PVALID) {
release_region(card->port, ISA_REGION); release_region(card->port, ISA_REGION);
@@ -178,7 +178,7 @@ act2000_isa_config_port(act2000_card * card, unsigned short portbase)
* Release ressources, used by an adaptor. * Release ressources, used by an adaptor.
*/ */
void void
act2000_isa_release(act2000_card * card) act2000_isa_release(act2000_card *card)
{ {
unsigned long flags; unsigned long flags;
@@ -194,7 +194,7 @@ act2000_isa_release(act2000_card * card)
} }
static int static int
act2000_isa_writeb(act2000_card * card, u_char data) act2000_isa_writeb(act2000_card *card, u_char data)
{ {
u_char timeout = 40; u_char timeout = 40;
@@ -211,7 +211,7 @@ act2000_isa_writeb(act2000_card * card, u_char data)
} }
static int static int
act2000_isa_readb(act2000_card * card, u_char * data) act2000_isa_readb(act2000_card *card, u_char *data)
{ {
u_char timeout = 40; u_char timeout = 40;
@@ -291,7 +291,7 @@ act2000_isa_receive(act2000_card *card)
} }
void void
act2000_isa_send(act2000_card * card) act2000_isa_send(act2000_card *card)
{ {
unsigned long flags; unsigned long flags;
struct sk_buff *skb; struct sk_buff *skb;
@@ -307,7 +307,7 @@ act2000_isa_send(act2000_card * card)
card->ack_msg = card->sbuf->data; card->ack_msg = card->sbuf->data;
msg = (actcapi_msg *)card->sbuf->data; msg = (actcapi_msg *)card->sbuf->data;
if ((msg->hdr.cmd.cmd == 0x86) && if ((msg->hdr.cmd.cmd == 0x86) &&
(msg->hdr.cmd.subcmd == 0) ) { (msg->hdr.cmd.subcmd == 0)) {
/* Save flags in message */ /* Save flags in message */
card->need_b3ack = msg->msg.data_b3_req.flags; card->need_b3ack = msg->msg.data_b3_req.flags;
msg->msg.data_b3_req.flags = 0; msg->msg.data_b3_req.flags = 0;
@@ -335,7 +335,7 @@ act2000_isa_send(act2000_card * card)
} }
msg = (actcapi_msg *)card->ack_msg; msg = (actcapi_msg *)card->ack_msg;
if ((msg->hdr.cmd.cmd == 0x86) && if ((msg->hdr.cmd.cmd == 0x86) &&
(msg->hdr.cmd.subcmd == 0) ) { (msg->hdr.cmd.subcmd == 0)) {
/* /*
* If it's user data, reset data-ptr * If it's user data, reset data-ptr
* and put skb into ackq. * and put skb into ackq.
@@ -354,11 +354,11 @@ act2000_isa_send(act2000_card * card)
* Get firmware ID, check for 'ISDN' signature. * Get firmware ID, check for 'ISDN' signature.
*/ */
static int static int
act2000_isa_getid(act2000_card * card) act2000_isa_getid(act2000_card *card)
{ {
act2000_fwid fid; act2000_fwid fid;
u_char *p = (u_char *) & fid; u_char *p = (u_char *)&fid;
int count = 0; int count = 0;
while (1) { while (1) {
@@ -392,7 +392,7 @@ act2000_isa_getid(act2000_card * card)
* Download microcode into card, check Firmware signature. * Download microcode into card, check Firmware signature.
*/ */
int int
act2000_isa_download(act2000_card * card, act2000_ddef __user * cb) act2000_isa_download(act2000_card *card, act2000_ddef __user *cb)
{ {
unsigned int length; unsigned int length;
int l; int l;

View File

@@ -114,22 +114,22 @@ typedef enum {
/* Macros for accessing ports */ /* Macros for accessing ports */
#define ISA_PORT_COR (card->port+ISA_COR) #define ISA_PORT_COR (card->port + ISA_COR)
#define ISA_PORT_ISR (card->port+ISA_ISR) #define ISA_PORT_ISR (card->port + ISA_ISR)
#define ISA_PORT_EPR (card->port+ISA_EPR) #define ISA_PORT_EPR (card->port + ISA_EPR)
#define ISA_PORT_EER (card->port+ISA_EER) #define ISA_PORT_EER (card->port + ISA_EER)
#define ISA_PORT_SDI (card->port+ISA_SDI) #define ISA_PORT_SDI (card->port + ISA_SDI)
#define ISA_PORT_SDO (card->port+ISA_SDO) #define ISA_PORT_SDO (card->port + ISA_SDO)
#define ISA_PORT_SIS (card->port+ISA_SIS) #define ISA_PORT_SIS (card->port + ISA_SIS)
#define ISA_PORT_SOS (card->port+ISA_SOS) #define ISA_PORT_SOS (card->port + ISA_SOS)
/* Prototypes */ /* Prototypes */
extern int act2000_isa_detect(unsigned short portbase); extern int act2000_isa_detect(unsigned short portbase);
extern int act2000_isa_config_irq(act2000_card * card, short irq); extern int act2000_isa_config_irq(act2000_card *card, short irq);
extern int act2000_isa_config_port(act2000_card * card, unsigned short portbase); extern int act2000_isa_config_port(act2000_card *card, unsigned short portbase);
extern int act2000_isa_download(act2000_card * card, act2000_ddef __user * cb); extern int act2000_isa_download(act2000_card *card, act2000_ddef __user *cb);
extern void act2000_isa_release(act2000_card * card); extern void act2000_isa_release(act2000_card *card);
extern void act2000_isa_receive(act2000_card *card); extern void act2000_isa_receive(act2000_card *card);
extern void act2000_isa_send(act2000_card *card); extern void act2000_isa_send(act2000_card *card);

View File

@@ -88,7 +88,7 @@ static actcapi_msgdsc valid_msg[] = {
* 2 = Valid message, B-Channel-data * 2 = Valid message, B-Channel-data
*/ */
int int
actcapi_chkhdr(act2000_card * card, actcapi_msghdr *hdr) actcapi_chkhdr(act2000_card *card, actcapi_msghdr *hdr)
{ {
int i; int i;
@@ -99,7 +99,7 @@ actcapi_chkhdr(act2000_card * card, actcapi_msghdr *hdr)
for (i = 0; i < num_valid_imsg; i++) for (i = 0; i < num_valid_imsg; i++)
if ((hdr->cmd.cmd == valid_msg[i].cmd.cmd) && if ((hdr->cmd.cmd == valid_msg[i].cmd.cmd) &&
(hdr->cmd.subcmd == valid_msg[i].cmd.subcmd)) { (hdr->cmd.subcmd == valid_msg[i].cmd.subcmd)) {
return (i?1:2); return (i ? 1 : 2);
} }
return 0; return 0;
} }
@@ -113,19 +113,19 @@ actcapi_chkhdr(act2000_card * card, actcapi_msghdr *hdr)
m->hdr.cmd.cmd = c; \ m->hdr.cmd.cmd = c; \
m->hdr.cmd.subcmd = s; \ m->hdr.cmd.subcmd = s; \
m->hdr.msgnum = actcapi_nextsmsg(card); \ m->hdr.msgnum = actcapi_nextsmsg(card); \
} else m = NULL;\ } else m = NULL; \
} }
#define ACTCAPI_CHKSKB if (!skb) { \ #define ACTCAPI_CHKSKB if (!skb) { \
printk(KERN_WARNING "actcapi: alloc_skb failed\n"); \ printk(KERN_WARNING "actcapi: alloc_skb failed\n"); \
return; \ return; \
} }
#define ACTCAPI_QUEUE_TX { \ #define ACTCAPI_QUEUE_TX { \
actcapi_debug_msg(skb, 1); \ actcapi_debug_msg(skb, 1); \
skb_queue_tail(&card->sndq, skb); \ skb_queue_tail(&card->sndq, skb); \
act2000_schedule_tx(card); \ act2000_schedule_tx(card); \
} }
int int
actcapi_listen_req(act2000_card *card) actcapi_listen_req(act2000_card *card)
@@ -145,7 +145,7 @@ actcapi_listen_req(act2000_card *card)
m->msg.listen_req.controller = 0; m->msg.listen_req.controller = 0;
m->msg.listen_req.infomask = 0x3f; /* All information */ m->msg.listen_req.infomask = 0x3f; /* All information */
m->msg.listen_req.eazmask = eazmask; m->msg.listen_req.eazmask = eazmask;
m->msg.listen_req.simask = (eazmask)?0x86:0; /* All SI's */ m->msg.listen_req.simask = (eazmask) ? 0x86 : 0; /* All SI's */
ACTCAPI_QUEUE_TX; ACTCAPI_QUEUE_TX;
return 0; return 0;
} }
@@ -168,7 +168,7 @@ actcapi_connect_req(act2000_card *card, act2000_chan *chan, char *phone,
m->msg.connect_req.infomask = 0x3f; m->msg.connect_req.infomask = 0x3f;
m->msg.connect_req.si1 = si1; m->msg.connect_req.si1 = si1;
m->msg.connect_req.si2 = si2; m->msg.connect_req.si2 = si2;
m->msg.connect_req.eaz = eaz?eaz:'0'; m->msg.connect_req.eaz = eaz ? eaz : '0';
m->msg.connect_req.addr.len = strlen(phone) + 1; m->msg.connect_req.addr.len = strlen(phone) + 1;
m->msg.connect_req.addr.tnp = 0x81; m->msg.connect_req.addr.tnp = 0x81;
memcpy(m->msg.connect_req.addr.num, phone, strlen(phone)); memcpy(m->msg.connect_req.addr.num, phone, strlen(phone));
@@ -209,14 +209,14 @@ actcapi_manufacturer_req_net(act2000_card *card)
} }
m->msg.manufacturer_req_net.manuf_msg = 0x11; m->msg.manufacturer_req_net.manuf_msg = 0x11;
m->msg.manufacturer_req_net.controller = 1; m->msg.manufacturer_req_net.controller = 1;
m->msg.manufacturer_req_net.nettype = (card->ptype == ISDN_PTYPE_EURO)?1:0; m->msg.manufacturer_req_net.nettype = (card->ptype == ISDN_PTYPE_EURO) ? 1 : 0;
ACTCAPI_QUEUE_TX; ACTCAPI_QUEUE_TX;
printk(KERN_INFO "act2000 %s: D-channel protocol now %s\n", printk(KERN_INFO "act2000 %s: D-channel protocol now %s\n",
card->interface.id, (card->ptype == ISDN_PTYPE_EURO)?"euro":"1tr6"); card->interface.id, (card->ptype == ISDN_PTYPE_EURO) ? "euro" : "1tr6");
card->interface.features &= card->interface.features &=
~(ISDN_FEATURE_P_UNKNOWN | ISDN_FEATURE_P_EURO | ISDN_FEATURE_P_1TR6); ~(ISDN_FEATURE_P_UNKNOWN | ISDN_FEATURE_P_EURO | ISDN_FEATURE_P_1TR6);
card->interface.features |= card->interface.features |=
((card->ptype == ISDN_PTYPE_EURO)?ISDN_FEATURE_P_EURO:ISDN_FEATURE_P_1TR6); ((card->ptype == ISDN_PTYPE_EURO) ? ISDN_FEATURE_P_EURO : ISDN_FEATURE_P_1TR6);
return 0; return 0;
} }
@@ -238,7 +238,7 @@ actcapi_manufacturer_req_v42(act2000_card *card, ulong arg)
} }
m->msg.manufacturer_req_v42.manuf_msg = 0x10; m->msg.manufacturer_req_v42.manuf_msg = 0x10;
m->msg.manufacturer_req_v42.controller = 0; m->msg.manufacturer_req_v42.controller = 0;
m->msg.manufacturer_req_v42.v42control = (arg?1:0); m->msg.manufacturer_req_v42.v42control = (arg ? 1 : 0);
ACTCAPI_QUEUE_TX; ACTCAPI_QUEUE_TX;
return 0; return 0;
} }
@@ -434,7 +434,7 @@ actcapi_connect_b3_resp(act2000_card *card, act2000_chan *chan, __u8 rejectcause
actcapi_msg *m; actcapi_msg *m;
struct sk_buff *skb; struct sk_buff *skb;
ACTCAPI_MKHDR((rejectcause?3:17), 0x82, 0x03); ACTCAPI_MKHDR((rejectcause ? 3 : 17), 0x82, 0x03);
ACTCAPI_CHKSKB; ACTCAPI_CHKSKB;
m->msg.connect_b3_resp.ncci = chan->ncci; m->msg.connect_b3_resp.ncci = chan->ncci;
m->msg.connect_b3_resp.rejectcause = rejectcause; m->msg.connect_b3_resp.rejectcause = rejectcause;
@@ -1030,7 +1030,7 @@ actcapi_debug_msg(struct sk_buff *skb, int direction)
descr = valid_msg[i].description; descr = valid_msg[i].description;
break; break;
} }
printk(KERN_DEBUG "%s %s msg\n", direction?"Outgoing":"Incoming", descr); printk(KERN_DEBUG "%s %s msg\n", direction ? "Outgoing" : "Incoming", descr);
printk(KERN_DEBUG " ApplID = %d\n", msg->hdr.applicationID); printk(KERN_DEBUG " ApplID = %d\n", msg->hdr.applicationID);
printk(KERN_DEBUG " Len = %d\n", msg->hdr.len); printk(KERN_DEBUG " Len = %d\n", msg->hdr.len);
printk(KERN_DEBUG " MsgNum = 0x%04x\n", msg->hdr.msgnum); printk(KERN_DEBUG " MsgNum = 0x%04x\n", msg->hdr.msgnum);
@@ -1086,7 +1086,7 @@ actcapi_debug_msg(struct sk_buff *skb, int direction)
int l = msg->hdr.len - 12; int l = msg->hdr.len - 12;
int j; int j;
char *p = tmp; char *p = tmp;
for (j = 0; j < l ; j++) for (j = 0; j < l; j++)
p += sprintf(p, "%02x ", msg->msg.info_ind.el.display[j]); p += sprintf(p, "%02x ", msg->msg.info_ind.el.display[j]);
printk(KERN_DEBUG " D = '%s'\n", tmp); printk(KERN_DEBUG " D = '%s'\n", tmp);
} }

View File

@@ -46,10 +46,10 @@ typedef struct actcapi_addr {
typedef union actcapi_infonr { /* info number */ typedef union actcapi_infonr { /* info number */
__u16 mask; /* info-mask field */ __u16 mask; /* info-mask field */
struct bmask { /* bit definitions */ struct bmask { /* bit definitions */
unsigned codes : 3; /* code set */ unsigned codes:3; /* code set */
unsigned rsvd : 5; /* reserved */ unsigned rsvd:5; /* reserved */
unsigned svind : 1; /* single, variable length ind. */ unsigned svind:1; /* single, variable length ind. */
unsigned wtype : 7; /* W-element type */ unsigned wtype:7; /* W-element type */
} bmask; } bmask;
} actcapi_infonr; } actcapi_infonr;
@@ -59,12 +59,12 @@ typedef union actcapi_infoel { /* info element */
__u8 display[40]; /* display contents */ __u8 display[40]; /* display contents */
__u8 uuinfo[40]; /* User-user info field */ __u8 uuinfo[40]; /* User-user info field */
struct cause { /* Cause information */ struct cause { /* Cause information */
unsigned ext2 : 1; /* extension */ unsigned ext2:1; /* extension */
unsigned cod : 2; /* coding standard */ unsigned cod:2; /* coding standard */
unsigned spare : 1; /* spare */ unsigned spare:1; /* spare */
unsigned loc : 4; /* location */ unsigned loc:4; /* location */
unsigned ext1 : 1; /* extension */ unsigned ext1:1; /* extension */
unsigned cval : 7; /* Cause value */ unsigned cval:7; /* Cause value */
} cause; } cause;
struct charge { /* Charging information */ struct charge { /* Charging information */
__u8 toc; /* type of charging info */ __u8 toc; /* type of charging info */
@@ -111,14 +111,14 @@ typedef struct actcapi_ncpd {
* Bit 5-7 = Controller * Bit 5-7 = Controller
* Bit 8-15 = NCCI * Bit 8-15 = NCCI
*/ */
#define MAKE_NCCI(plci,contr,ncci) \ #define MAKE_NCCI(plci, contr, ncci) \
((plci & 0x1f) | ((contr & 0x7) << 5) | ((ncci & 0xff) << 8)) ((plci & 0x1f) | ((contr & 0x7) << 5) | ((ncci & 0xff) << 8))
#define EVAL_NCCI(fakencci,plci,contr,ncci) { \ #define EVAL_NCCI(fakencci, plci, contr, ncci) { \
plci = fakencci & 0x1f; \ plci = fakencci & 0x1f; \
contr = (fakencci >> 5) & 0x7; \ contr = (fakencci >> 5) & 0x7; \
ncci = (fakencci >> 8) & 0xff; \ ncci = (fakencci >> 8) & 0xff; \
} }
/* /*
* Layout of PLCI field in a B3 DATA CAPI message is different from * Layout of PLCI field in a B3 DATA CAPI message is different from
@@ -128,13 +128,13 @@ typedef struct actcapi_ncpd {
* Bit 5-7 = Controller * Bit 5-7 = Controller
* Bit 8-15 = reserved (must be 0) * Bit 8-15 = reserved (must be 0)
*/ */
#define MAKE_PLCI(plci,contr) \ #define MAKE_PLCI(plci, contr) \
((plci & 0x1f) | ((contr & 0x7) << 5)) ((plci & 0x1f) | ((contr & 0x7) << 5))
#define EVAL_PLCI(fakeplci,plci,contr) { \ #define EVAL_PLCI(fakeplci, plci, contr) { \
plci = fakeplci & 0x1f; \ plci = fakeplci & 0x1f; \
contr = (fakeplci >> 5) & 0x7; \ contr = (fakeplci >> 5) & 0x7; \
} }
typedef struct actcapi_msg { typedef struct actcapi_msg {
actcapi_msghdr hdr; actcapi_msghdr hdr;

View File

@@ -33,9 +33,9 @@ static int act_port = -1; /* -1 = Autoprobe */
static int act_irq = -1; static int act_irq = -1;
static char *act_id = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; static char *act_id = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
MODULE_DESCRIPTION( "ISDN4Linux: Driver for IBM Active 2000 ISDN card"); MODULE_DESCRIPTION("ISDN4Linux: Driver for IBM Active 2000 ISDN card");
MODULE_AUTHOR( "Fritz Elfert"); MODULE_AUTHOR("Fritz Elfert");
MODULE_LICENSE( "GPL"); MODULE_LICENSE("GPL");
MODULE_PARM_DESC(act_bus, "BusType of first card, 1=ISA, 2=MCA, 3=PCMCIA, currently only ISA"); MODULE_PARM_DESC(act_bus, "BusType of first card, 1=ISA, 2=MCA, 3=PCMCIA, currently only ISA");
MODULE_PARM_DESC(membase, "Base port address of first card"); MODULE_PARM_DESC(membase, "Base port address of first card");
MODULE_PARM_DESC(act_irq, "IRQ of first card"); MODULE_PARM_DESC(act_irq, "IRQ of first card");
@@ -111,10 +111,10 @@ act2000_find_eaz(act2000_card *card, char eaz)
while (p) { while (p) {
if (p->eaz == eaz) if (p->eaz == eaz)
return(p->msn); return (p->msn);
p = p->next; p = p->next;
} }
return("\0"); return ("\0");
} }
/* /*
@@ -230,17 +230,17 @@ act2000_receive(struct work_struct *work)
static void static void
act2000_poll(unsigned long data) act2000_poll(unsigned long data)
{ {
act2000_card * card = (act2000_card *)data; act2000_card *card = (act2000_card *)data;
unsigned long flags; unsigned long flags;
act2000_receive(&card->poll_tq); act2000_receive(&card->poll_tq);
spin_lock_irqsave(&card->lock, flags); spin_lock_irqsave(&card->lock, flags);
mod_timer(&card->ptimer, jiffies+3); mod_timer(&card->ptimer, jiffies + 3);
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
} }
static int static int
act2000_command(act2000_card * card, isdn_ctrl * c) act2000_command(act2000_card *card, isdn_ctrl *c)
{ {
ulong a; ulong a;
act2000_chan *chan; act2000_chan *chan;
@@ -280,7 +280,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
} }
return ret; return ret;
case ACT2000_IOCTL_SETPROTO: case ACT2000_IOCTL_SETPROTO:
card->ptype = a?ISDN_PTYPE_EURO:ISDN_PTYPE_1TR6; card->ptype = a ? ISDN_PTYPE_EURO : ISDN_PTYPE_1TR6;
if (!(card->flags & ACT2000_FLAGS_RUNNING)) if (!(card->flags & ACT2000_FLAGS_RUNNING))
return 0; return 0;
actcapi_manufacturer_req_net(card); actcapi_manufacturer_req_net(card);
@@ -292,7 +292,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
if ((ret = act2000_set_msn(card, tmp))) if ((ret = act2000_set_msn(card, tmp)))
return ret; return ret;
if (card->flags & ACT2000_FLAGS_RUNNING) if (card->flags & ACT2000_FLAGS_RUNNING)
return(actcapi_manufacturer_req_msn(card)); return (actcapi_manufacturer_req_msn(card));
return 0; return 0;
case ACT2000_IOCTL_ADDCARD: case ACT2000_IOCTL_ADDCARD:
if (copy_from_user(&cdef, arg, if (copy_from_user(&cdef, arg,
@@ -471,7 +471,7 @@ act2000_sendbuf(act2000_card *card, int channel, int ack, struct sk_buff *skb)
/* Read the Status-replies from the Interface */ /* Read the Status-replies from the Interface */
static int static int
act2000_readstatus(u_char __user * buf, int len, act2000_card * card) act2000_readstatus(u_char __user *buf, int len, act2000_card *card)
{ {
int count; int count;
u_char __user *p; u_char __user *p;
@@ -506,7 +506,7 @@ act2000_findcard(int driverid)
* Wrapper functions for interface to linklevel * Wrapper functions for interface to linklevel
*/ */
static int static int
if_command(isdn_ctrl * c) if_command(isdn_ctrl *c)
{ {
act2000_card *card = act2000_findcard(c->driver); act2000_card *card = act2000_findcard(c->driver);
@@ -534,7 +534,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel)
} }
static int static int
if_readstatus(u_char __user * buf, int len, int id, int channel) if_readstatus(u_char __user *buf, int len, int id, int channel)
{ {
act2000_card *card = act2000_findcard(id); act2000_card *card = act2000_findcard(id);
@@ -602,7 +602,7 @@ act2000_alloccard(int bus, int port, int irq, char *id)
card->interface.hl_hdrlen = 20; card->interface.hl_hdrlen = 20;
card->ptype = ISDN_PTYPE_EURO; card->ptype = ISDN_PTYPE_EURO;
strlcpy(card->interface.id, id, sizeof(card->interface.id)); strlcpy(card->interface.id, id, sizeof(card->interface.id));
for (i=0; i<ACT2000_BCH; i++) { for (i = 0; i < ACT2000_BCH; i++) {
card->bch[i].plci = 0x8000; card->bch[i].plci = 0x8000;
card->bch[i].ncci = 0x8000; card->bch[i].ncci = 0x8000;
card->bch[i].l2prot = ISDN_PROTO_L2_X75I; card->bch[i].l2prot = ISDN_PROTO_L2_X75I;
@@ -620,7 +620,7 @@ act2000_alloccard(int bus, int port, int irq, char *id)
* register card at linklevel * register card at linklevel
*/ */
static int static int
act2000_registercard(act2000_card * card) act2000_registercard(act2000_card *card)
{ {
switch (card->bus) { switch (card->bus) {
case ACT2000_BUS_ISA: case ACT2000_BUS_ISA:
@@ -645,7 +645,7 @@ act2000_registercard(act2000_card * card)
} }
static void static void
unregister_card(act2000_card * card) unregister_card(act2000_card *card)
{ {
isdn_ctrl cmd; isdn_ctrl cmd;

View File

@@ -391,7 +391,7 @@ gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
struct sk_buff *nskb; struct sk_buff *nskb;
nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_KERNEL); nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_KERNEL);
if (nskb) { if (nskb) {
u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2); u16 datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 4 + 2);
unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN); unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN);
capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN); capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN);
capimsg_setu16(s, 2, mp->ap->applid); capimsg_setu16(s, 2, mp->ap->applid);
@@ -618,7 +618,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
goto unlock_out; goto unlock_out;
} }
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);
pr_debug("capi_signal: DATA_B3_IND %u len=%d\n", pr_debug("capi_signal: DATA_B3_IND %u len=%d\n",
datahandle, skb->len-CAPIMSG_LEN(skb->data)); datahandle, skb->len-CAPIMSG_LEN(skb->data));
skb_queue_tail(&mp->inqueue, skb); skb_queue_tail(&mp->inqueue, skb);
@@ -627,10 +627,10 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
} else if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_CONF) { } else if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_CONF) {
datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4); datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4);
pr_debug("capi_signal: DATA_B3_CONF %u 0x%x\n", pr_debug("capi_signal: DATA_B3_CONF %u 0x%x\n",
datahandle, datahandle,
CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+2)); CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 2));
kfree_skb(skb); kfree_skb(skb);
capiminor_del_ack(mp, datahandle); capiminor_del_ack(mp, datahandle);
tty = tty_port_tty_get(&mp->port); tty = tty_port_tty_get(&mp->port);
@@ -736,7 +736,7 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
} }
static unsigned int static unsigned int
capi_poll(struct file *file, poll_table * wait) capi_poll(struct file *file, poll_table *wait)
{ {
struct capidev *cdev = file->private_data; struct capidev *cdev = file->private_data;
unsigned int mask = 0; unsigned int mask = 0;
@@ -804,7 +804,7 @@ register_out:
if (copy_from_user(&data.contr, argp, if (copy_from_user(&data.contr, argp,
sizeof(data.contr))) sizeof(data.contr)))
return -EFAULT; return -EFAULT;
cdev->errcode = capi20_get_serial (data.contr, data.serial); cdev->errcode = capi20_get_serial(data.contr, data.serial);
if (cdev->errcode) if (cdev->errcode)
return -EIO; return -EIO;
if (copy_to_user(argp, data.serial, if (copy_to_user(argp, data.serial,
@@ -1070,7 +1070,7 @@ static int capinc_tty_write(struct tty_struct *tty,
mp->outbytes += skb->len; mp->outbytes += skb->len;
} }
skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+count, GFP_ATOMIC); skb = alloc_skb(CAPI_DATA_B3_REQ_LEN + count, GFP_ATOMIC);
if (!skb) { if (!skb) {
printk(KERN_ERR "capinc_tty_write: alloc_skb failed\n"); printk(KERN_ERR "capinc_tty_write: alloc_skb failed\n");
spin_unlock_bh(&mp->outlock); spin_unlock_bh(&mp->outlock);
@@ -1111,7 +1111,7 @@ static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
invoke_send = true; invoke_send = true;
} }
skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+CAPI_MAX_BLKSIZE, GFP_ATOMIC); skb = alloc_skb(CAPI_DATA_B3_REQ_LEN + CAPI_MAX_BLKSIZE, GFP_ATOMIC);
if (skb) { if (skb) {
skb_reserve(skb, CAPI_DATA_B3_REQ_LEN); skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
*(skb_put(skb, 1)) = ch; *(skb_put(skb, 1)) = ch;
@@ -1180,7 +1180,7 @@ static int capinc_tty_ioctl(struct tty_struct *tty,
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios * old) static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
{ {
pr_debug("capinc_tty_set_termios\n"); pr_debug("capinc_tty_set_termios\n");
} }

View File

@@ -40,7 +40,7 @@ static int debugmode = 0;
MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux"); MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux");
MODULE_AUTHOR("Carsten Paeth"); MODULE_AUTHOR("Carsten Paeth");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_param(debugmode, uint, S_IRUGO|S_IWUSR); module_param(debugmode, uint, S_IRUGO | S_IWUSR);
/* -------- type definitions ----------------------------------------- */ /* -------- type definitions ----------------------------------------- */
@@ -329,7 +329,7 @@ static capidrv_contr *findcontrbynumber(u32 contr)
/* -------- plci management ------------------------------------------ */ /* -------- plci management ------------------------------------------ */
static capidrv_plci *new_plci(capidrv_contr * card, int chan) static capidrv_plci *new_plci(capidrv_contr *card, int chan)
{ {
capidrv_plci *plcip; capidrv_plci *plcip;
@@ -349,7 +349,7 @@ static capidrv_plci *new_plci(capidrv_contr * card, int chan)
return plcip; return plcip;
} }
static capidrv_plci *find_plci_by_plci(capidrv_contr * card, u32 plci) static capidrv_plci *find_plci_by_plci(capidrv_contr *card, u32 plci)
{ {
capidrv_plci *p; capidrv_plci *p;
for (p = card->plci_list; p; p = p->next) for (p = card->plci_list; p; p = p->next)
@@ -358,7 +358,7 @@ static capidrv_plci *find_plci_by_plci(capidrv_contr * card, u32 plci)
return NULL; return NULL;
} }
static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid) static capidrv_plci *find_plci_by_msgid(capidrv_contr *card, u16 msgid)
{ {
capidrv_plci *p; capidrv_plci *p;
for (p = card->plci_list; p; p = p->next) for (p = card->plci_list; p; p = p->next)
@@ -367,7 +367,7 @@ static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid)
return NULL; return NULL;
} }
static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci) static capidrv_plci *find_plci_by_ncci(capidrv_contr *card, u32 ncci)
{ {
capidrv_plci *p; capidrv_plci *p;
for (p = card->plci_list; p; p = p->next) for (p = card->plci_list; p; p = p->next)
@@ -376,7 +376,7 @@ static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci)
return NULL; return NULL;
} }
static void free_plci(capidrv_contr * card, capidrv_plci * plcip) static void free_plci(capidrv_contr *card, capidrv_plci *plcip)
{ {
capidrv_plci **pp; capidrv_plci **pp;
@@ -396,8 +396,8 @@ static void free_plci(capidrv_contr * card, capidrv_plci * plcip)
/* -------- ncci management ------------------------------------------ */ /* -------- ncci management ------------------------------------------ */
static inline capidrv_ncci *new_ncci(capidrv_contr * card, static inline capidrv_ncci *new_ncci(capidrv_contr *card,
capidrv_plci * plcip, capidrv_plci *plcip,
u32 ncci) u32 ncci)
{ {
capidrv_ncci *nccip; capidrv_ncci *nccip;
@@ -421,7 +421,7 @@ static inline capidrv_ncci *new_ncci(capidrv_contr * card,
return nccip; return nccip;
} }
static inline capidrv_ncci *find_ncci(capidrv_contr * card, u32 ncci) static inline capidrv_ncci *find_ncci(capidrv_contr *card, u32 ncci)
{ {
capidrv_plci *plcip; capidrv_plci *plcip;
capidrv_ncci *p; capidrv_ncci *p;
@@ -435,7 +435,7 @@ static inline capidrv_ncci *find_ncci(capidrv_contr * card, u32 ncci)
return NULL; return NULL;
} }
static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card, static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr *card,
u32 ncci, u16 msgid) u32 ncci, u16 msgid)
{ {
capidrv_plci *plcip; capidrv_plci *plcip;
@@ -450,7 +450,7 @@ static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card,
return NULL; return NULL;
} }
static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip) static void free_ncci(capidrv_contr *card, struct capidrv_ncci *nccip)
{ {
struct capidrv_ncci **pp; struct capidrv_ncci **pp;
@@ -478,7 +478,7 @@ static int capidrv_add_ack(struct capidrv_ncci *nccip,
n->next = NULL; n->next = NULL;
n->datahandle = datahandle; n->datahandle = datahandle;
n->len = len; n->len = len;
for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ; for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next);
*pp = n; *pp = n;
return 0; return 0;
} }
@@ -502,7 +502,7 @@ static int capidrv_del_ack(struct capidrv_ncci *nccip, u16 datahandle)
/* -------- convert and send capi message ---------------------------- */ /* -------- convert and send capi message ---------------------------- */
static void send_message(capidrv_contr * card, _cmsg * cmsg) static void send_message(capidrv_contr *card, _cmsg *cmsg)
{ {
struct sk_buff *skb; struct sk_buff *skb;
size_t len; size_t len;
@@ -540,7 +540,7 @@ static struct listenstatechange listentable[] =
{}, {},
}; };
static void listen_change_state(capidrv_contr * card, int event) static void listen_change_state(capidrv_contr *card, int event)
{ {
struct listenstatechange *p = listentable; struct listenstatechange *p = listentable;
while (p->event) { while (p->event) {
@@ -560,7 +560,7 @@ static void listen_change_state(capidrv_contr * card, int event)
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
static void p0(capidrv_contr * card, capidrv_plci * plci) static void p0(capidrv_contr *card, capidrv_plci *plci)
{ {
isdn_ctrl cmd; isdn_ctrl cmd;
@@ -578,7 +578,7 @@ struct plcistatechange {
int actstate; int actstate;
int nextstate; int nextstate;
int event; int event;
void (*changefunc) (capidrv_contr * card, capidrv_plci * plci); void (*changefunc)(capidrv_contr *card, capidrv_plci *plci);
}; };
static struct plcistatechange plcitable[] = static struct plcistatechange plcitable[] =
@@ -635,7 +635,7 @@ static struct plcistatechange plcitable[] =
{}, {},
}; };
static void plci_change_state(capidrv_contr * card, capidrv_plci * plci, int event) static void plci_change_state(capidrv_contr *card, capidrv_plci *plci, int event)
{ {
struct plcistatechange *p = plcitable; struct plcistatechange *p = plcitable;
while (p->event) { while (p->event) {
@@ -658,7 +658,7 @@ static void plci_change_state(capidrv_contr * card, capidrv_plci * plci, int eve
static _cmsg cmsg; static _cmsg cmsg;
static void n0(capidrv_contr * card, capidrv_ncci * ncci) static void n0(capidrv_contr *card, capidrv_ncci *ncci)
{ {
isdn_ctrl cmd; isdn_ctrl cmd;
@@ -687,7 +687,7 @@ struct nccistatechange {
int actstate; int actstate;
int nextstate; int nextstate;
int event; int event;
void (*changefunc) (capidrv_contr * card, capidrv_ncci * ncci); void (*changefunc)(capidrv_contr *card, capidrv_ncci *ncci);
}; };
static struct nccistatechange nccitable[] = static struct nccistatechange nccitable[] =
@@ -718,13 +718,13 @@ static struct nccistatechange nccitable[] =
{ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
/* N-4 */ /* N-4 */
{ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
{ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,NULL}, {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR, NULL},
/* N-5 */ /* N-5 */
{ST_NCCI_DISCONNECTED, ST_NCCI_NONE, EV_NCCI_DISCONNECT_B3_RESP, n0}, {ST_NCCI_DISCONNECTED, ST_NCCI_NONE, EV_NCCI_DISCONNECT_B3_RESP, n0},
{}, {},
}; };
static void ncci_change_state(capidrv_contr * card, capidrv_ncci * ncci, int event) static void ncci_change_state(capidrv_contr *card, capidrv_ncci *ncci, int event)
{ {
struct nccistatechange *p = nccitable; struct nccistatechange *p = nccitable;
while (p->event) { while (p->event) {
@@ -751,7 +751,7 @@ static void ncci_change_state(capidrv_contr * card, capidrv_ncci * ncci, int eve
/* ------------------------------------------------------------------- */ /* ------------------------------------------------------------------- */
static inline int new_bchan(capidrv_contr * card) static inline int new_bchan(capidrv_contr *card)
{ {
int i; int i;
for (i = 0; i < card->nbchan; i++) { for (i = 0; i < card->nbchan; i++) {
@@ -765,7 +765,7 @@ static inline int new_bchan(capidrv_contr * card)
/* ------------------------------------------------------------------- */ /* ------------------------------------------------------------------- */
static void handle_controller(_cmsg * cmsg) static void handle_controller(_cmsg *cmsg)
{ {
capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f);
@@ -791,10 +791,10 @@ static void handle_controller(_cmsg * cmsg)
break; break;
case CAPI_MANUFACTURER_IND: /* Controller */ case CAPI_MANUFACTURER_IND: /* Controller */
if ( cmsg->ManuID == 0x214D5641 if (cmsg->ManuID == 0x214D5641
&& cmsg->Class == 0 && cmsg->Class == 0
&& cmsg->Function == 1) { && cmsg->Function == 1) {
u8 *data = cmsg->ManuData+3; u8 *data = cmsg->ManuData + 3;
u16 len = cmsg->ManuData[0]; u16 len = cmsg->ManuData[0];
u16 layer; u16 layer;
int direction; int direction;
@@ -803,7 +803,7 @@ static void handle_controller(_cmsg * cmsg)
data += 2; data += 2;
} }
len -= 2; len -= 2;
layer = ((*(data-1)) << 8) | *(data-2); layer = ((*(data - 1)) << 8) | *(data - 2);
if (layer & 0x300) if (layer & 0x300)
direction = (layer & 0x200) ? 0 : 1; direction = (layer & 0x200) ? 0 : 1;
else direction = (layer & 0x800) ? 0 : 1; else direction = (layer & 0x800) ? 0 : 1;
@@ -858,14 +858,14 @@ static void handle_controller(_cmsg * cmsg)
} }
return; return;
ignored: ignored:
printk(KERN_INFO "capidrv-%d: %s from controller 0x%x ignored\n", printk(KERN_INFO "capidrv-%d: %s from controller 0x%x ignored\n",
card->contrnr, card->contrnr,
capi_cmd2str(cmsg->Command, cmsg->Subcommand), capi_cmd2str(cmsg->Command, cmsg->Subcommand),
cmsg->adr.adrController); cmsg->adr.adrController);
} }
static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) static void handle_incoming_call(capidrv_contr *card, _cmsg *cmsg)
{ {
capidrv_plci *plcip; capidrv_plci *plcip;
capidrv_bchan *bchan; capidrv_bchan *bchan;
@@ -990,7 +990,7 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg)
return; return;
} }
static void handle_plci(_cmsg * cmsg) static void handle_plci(_cmsg *cmsg)
{ {
capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f);
capidrv_plci *plcip; capidrv_plci *plcip;
@@ -1159,13 +1159,13 @@ static void handle_plci(_cmsg * cmsg)
cmsg->adr.adrPLCI); cmsg->adr.adrPLCI);
} }
return; return;
ignored: ignored:
printk(KERN_INFO "capidrv-%d: %s for plci 0x%x ignored\n", printk(KERN_INFO "capidrv-%d: %s for plci 0x%x ignored\n",
card->contrnr, card->contrnr,
capi_cmd2str(cmsg->Command, cmsg->Subcommand), capi_cmd2str(cmsg->Command, cmsg->Subcommand),
cmsg->adr.adrPLCI); cmsg->adr.adrPLCI);
return; return;
notfound: notfound:
printk(KERN_ERR "capidrv-%d: %s: plci 0x%x not found\n", printk(KERN_ERR "capidrv-%d: %s: plci 0x%x not found\n",
card->contrnr, card->contrnr,
capi_cmd2str(cmsg->Command, cmsg->Subcommand), capi_cmd2str(cmsg->Command, cmsg->Subcommand),
@@ -1173,7 +1173,7 @@ static void handle_plci(_cmsg * cmsg)
return; return;
} }
static void handle_ncci(_cmsg * cmsg) static void handle_ncci(_cmsg *cmsg)
{ {
capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f);
capidrv_plci *plcip; capidrv_plci *plcip;
@@ -1340,13 +1340,13 @@ static void handle_ncci(_cmsg * cmsg)
cmsg->adr.adrNCCI); cmsg->adr.adrNCCI);
} }
return; return;
ignored: ignored:
printk(KERN_INFO "capidrv-%d: %s for ncci 0x%x ignored\n", printk(KERN_INFO "capidrv-%d: %s for ncci 0x%x ignored\n",
card->contrnr, card->contrnr,
capi_cmd2str(cmsg->Command, cmsg->Subcommand), capi_cmd2str(cmsg->Command, cmsg->Subcommand),
cmsg->adr.adrNCCI); cmsg->adr.adrNCCI);
return; return;
notfound: notfound:
printk(KERN_ERR "capidrv-%d: %s: ncci 0x%x not found\n", printk(KERN_ERR "capidrv-%d: %s: ncci 0x%x not found\n",
card->contrnr, card->contrnr,
capi_cmd2str(cmsg->Command, cmsg->Subcommand), capi_cmd2str(cmsg->Command, cmsg->Subcommand),
@@ -1354,7 +1354,7 @@ static void handle_ncci(_cmsg * cmsg)
} }
static void handle_data(_cmsg * cmsg, struct sk_buff *skb) static void handle_data(_cmsg *cmsg, struct sk_buff *skb)
{ {
capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f); capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f);
capidrv_ncci *nccip; capidrv_ncci *nccip;
@@ -1449,7 +1449,7 @@ static void handle_dtrace_data(capidrv_contr *card,
PUTBYTE_TO_STATUS(card, ':'); PUTBYTE_TO_STATUS(card, ':');
} }
for (p = data, end = data+len; p < end; p++) { for (p = data, end = data + len; p < end; p++) {
PUTBYTE_TO_STATUS(card, ' '); PUTBYTE_TO_STATUS(card, ' ');
PUTBYTE_TO_STATUS(card, hex_asc_hi(*p)); PUTBYTE_TO_STATUS(card, hex_asc_hi(*p));
PUTBYTE_TO_STATUS(card, hex_asc_lo(*p)); PUTBYTE_TO_STATUS(card, hex_asc_lo(*p));
@@ -1458,7 +1458,7 @@ static void handle_dtrace_data(capidrv_contr *card,
cmd.command = ISDN_STAT_STAVAIL; cmd.command = ISDN_STAT_STAVAIL;
cmd.driver = card->myid; cmd.driver = card->myid;
cmd.arg = len*3+5; cmd.arg = len * 3 + 5;
card->interface.statcallb(&cmd); card->interface.statcallb(&cmd);
} }
@@ -1466,7 +1466,7 @@ static void handle_dtrace_data(capidrv_contr *card,
static _cmsg cmdcmsg; static _cmsg cmdcmsg;
static int capidrv_ioctl(isdn_ctrl * c, capidrv_contr * card) static int capidrv_ioctl(isdn_ctrl *c, capidrv_contr *card)
{ {
switch (c->arg) { switch (c->arg) {
case 1: case 1:
@@ -1540,10 +1540,10 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep)
if (digit2 <= 0 || digit2 > 30) return -4; if (digit2 <= 0 || digit2 > 30) return -4;
if (*s == 0 || *s == ',' || *s == ' ') { if (*s == 0 || *s == ',' || *s == ' ') {
if (digit1 > digit2) if (digit1 > digit2)
for (i = digit2; i <= digit1 ; i++) for (i = digit2; i <= digit1; i++)
bmask |= (1 << i); bmask |= (1 << i);
else else
for (i = digit1; i <= digit2 ; i++) for (i = digit1; i <= digit2; i++)
bmask |= (1 << i); bmask |= (1 << i);
digit1 = digit2 = 0; digit1 = digit2 = 0;
if (*s) s++; if (*s) s++;
@@ -1556,7 +1556,7 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep)
return 0; return 0;
} }
static int FVteln2capi20(char *teln, u8 AdditionalInfo[1+2+2+31]) static int FVteln2capi20(char *teln, u8 AdditionalInfo[1 + 2 + 2 + 31])
{ {
unsigned long bmask; unsigned long bmask;
int active; int active;
@@ -1565,7 +1565,7 @@ static int FVteln2capi20(char *teln, u8 AdditionalInfo[1+2+2+31])
rc = decodeFVteln(teln, &bmask, &active); rc = decodeFVteln(teln, &bmask, &active);
if (rc) return rc; if (rc) return rc;
/* Length */ /* Length */
AdditionalInfo[0] = 2+2+31; AdditionalInfo[0] = 2 + 2 + 31;
/* Channel: 3 => use channel allocation */ /* Channel: 3 => use channel allocation */
AdditionalInfo[1] = 3; AdditionalInfo[2] = 0; AdditionalInfo[1] = 3; AdditionalInfo[2] = 0;
/* Operation: 0 => DTE mode, 1 => DCE mode */ /* Operation: 0 => DTE mode, 1 => DCE mode */
@@ -1576,17 +1576,17 @@ static int FVteln2capi20(char *teln, u8 AdditionalInfo[1+2+2+31])
} }
/* Channel mask array */ /* Channel mask array */
AdditionalInfo[5] = 0; /* no D-Channel */ AdditionalInfo[5] = 0; /* no D-Channel */
for (i=1; i <= 30; i++) for (i = 1; i <= 30; i++)
AdditionalInfo[5+i] = (bmask & (1 << i)) ? 0xff : 0; AdditionalInfo[5 + i] = (bmask & (1 << i)) ? 0xff : 0;
return 0; return 0;
} }
static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) static int capidrv_command(isdn_ctrl *c, capidrv_contr *card)
{ {
isdn_ctrl cmd; isdn_ctrl cmd;
struct capidrv_bchan *bchan; struct capidrv_bchan *bchan;
struct capidrv_plci *plcip; struct capidrv_plci *plcip;
u8 AdditionalInfo[1+2+2+31]; u8 AdditionalInfo[1 + 2 + 2 + 31];
int rc, isleasedline = 0; int rc, isleasedline = 0;
if (c->command == ISDN_CMD_IOCTL) if (c->command == ISDN_CMD_IOCTL)
@@ -1826,7 +1826,7 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
return 0; return 0;
} }
static int if_command(isdn_ctrl * c) static int if_command(isdn_ctrl *c)
{ {
capidrv_contr *card = findcontrbydriverid(c->driver); capidrv_contr *card = findcontrbydriverid(c->driver);
@@ -1949,7 +1949,7 @@ static int if_readstat(u8 __user *buf, int len, int id, int channel)
return -ENODEV; return -ENODEV;
} }
for (p=buf, count=0; count < len; p++, count++) { for (p = buf, count = 0; count < len; p++, count++) {
if (put_user(*card->q931_read++, p)) if (put_user(*card->q931_read++, p))
return -EFAULT; return -EFAULT;
if (card->q931_read > card->q931_end) if (card->q931_read > card->q931_end)
@@ -2031,7 +2031,7 @@ static void listentimerfunc(unsigned long x)
if (card->state != ST_LISTEN_NONE && card->state != ST_LISTEN_ACTIVE) if (card->state != ST_LISTEN_NONE && card->state != ST_LISTEN_ACTIVE)
printk(KERN_ERR "%s: controller dead ??\n", card->name); printk(KERN_ERR "%s: controller dead ??\n", card->name);
send_listen(card); send_listen(card);
mod_timer(&card->listentimer, jiffies + 60*HZ); mod_timer(&card->listentimer, jiffies + 60 * HZ);
} }
@@ -2079,11 +2079,11 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
ISDN_FEATURE_L2_X75I | ISDN_FEATURE_L2_X75I |
ISDN_FEATURE_L2_X75UI | ISDN_FEATURE_L2_X75UI |
ISDN_FEATURE_L2_X75BUI; ISDN_FEATURE_L2_X75BUI;
if (profp->support1 & (1<<2)) if (profp->support1 & (1 << 2))
card->interface.features |= ISDN_FEATURE_L2_V11096 | card->interface.features |= ISDN_FEATURE_L2_V11096 |
ISDN_FEATURE_L2_V11019 | ISDN_FEATURE_L2_V11019 |
ISDN_FEATURE_L2_V11038; ISDN_FEATURE_L2_V11038;
if (profp->support1 & (1<<8)) if (profp->support1 & (1 << 8))
card->interface.features |= ISDN_FEATURE_L2_MODEM; card->interface.features |= ISDN_FEATURE_L2_MODEM;
card->interface.hl_hdrlen = 22; /* len of DATA_B3_REQ */ card->interface.hl_hdrlen = 22; /* len of DATA_B3_REQ */
strncpy(card->interface.id, id, sizeof(card->interface.id) - 1); strncpy(card->interface.id, id, sizeof(card->interface.id) - 1);
@@ -2122,7 +2122,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
card->listentimer.data = (unsigned long)card; card->listentimer.data = (unsigned long)card;
card->listentimer.function = listentimerfunc; card->listentimer.function = listentimerfunc;
send_listen(card); send_listen(card);
mod_timer(&card->listentimer, jiffies + 60*HZ); mod_timer(&card->listentimer, jiffies + 60 * HZ);
printk(KERN_INFO "%s: now up (%d B channels)\n", printk(KERN_INFO "%s: now up (%d B channels)\n",
card->name, card->nbchan); card->name, card->nbchan);
@@ -2168,17 +2168,17 @@ static int capidrv_delcontr(u16 contr)
cmd.command = ISDN_STAT_DISCH; cmd.command = ISDN_STAT_DISCH;
cmd.driver = card->myid; cmd.driver = card->myid;
cmd.arg = card->nbchan-1; cmd.arg = card->nbchan - 1;
cmd.parm.num[0] = 0; cmd.parm.num[0] = 0;
if (debugmode) if (debugmode)
printk(KERN_DEBUG "capidrv-%d: id=%d disable chan=%ld\n", printk(KERN_DEBUG "capidrv-%d: id=%d disable chan=%ld\n",
card->contrnr, card->myid, cmd.arg); card->contrnr, card->myid, cmd.arg);
card->interface.statcallb(&cmd); card->interface.statcallb(&cmd);
if (card->bchans[card->nbchan-1].nccip) if (card->bchans[card->nbchan - 1].nccip)
free_ncci(card, card->bchans[card->nbchan-1].nccip); free_ncci(card, card->bchans[card->nbchan - 1].nccip);
if (card->bchans[card->nbchan-1].plcip) if (card->bchans[card->nbchan - 1].plcip)
free_plci(card, card->bchans[card->nbchan-1].plcip); free_plci(card, card->bchans[card->nbchan - 1].plcip);
if (card->plci_list) if (card->plci_list)
printk(KERN_ERR "capidrv: bug in free_plci()\n"); printk(KERN_ERR "capidrv: bug in free_plci()\n");
card->nbchan--; card->nbchan--;

View File

@@ -5,8 +5,8 @@
#include <linux/isdn/capilli.h> #include <linux/isdn/capilli.h>
#define DBG(format, arg...) do { \ #define DBG(format, arg...) do { \
printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \ printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
} while (0) } while (0)
struct capilib_msgidqueue { struct capilib_msgidqueue {
struct capilib_msgidqueue *next; struct capilib_msgidqueue *next;
@@ -28,7 +28,7 @@ struct capilib_ncci {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// NCCI Handling // NCCI Handling
static inline void mq_init(struct capilib_ncci * np) static inline void mq_init(struct capilib_ncci *np)
{ {
u_int i; u_int i;
np->msgidqueue = NULL; np->msgidqueue = NULL;
@@ -42,7 +42,7 @@ static inline void mq_init(struct capilib_ncci * np)
} }
} }
static inline int mq_enqueue(struct capilib_ncci * np, u16 msgid) static inline int mq_enqueue(struct capilib_ncci *np, u16 msgid)
{ {
struct capilib_msgidqueue *mq; struct capilib_msgidqueue *mq;
if ((mq = np->msgidfree) == NULL) if ((mq = np->msgidfree) == NULL)
@@ -59,7 +59,7 @@ static inline int mq_enqueue(struct capilib_ncci * np, u16 msgid)
return 1; return 1;
} }
static inline int mq_dequeue(struct capilib_ncci * np, u16 msgid) static inline int mq_dequeue(struct capilib_ncci *np, u16 msgid)
{ {
struct capilib_msgidqueue **pp; struct capilib_msgidqueue **pp;
for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) { for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) {

View File

@@ -387,17 +387,17 @@ static unsigned char *cpars[] =
/*-------------------------------------------------------*/ /*-------------------------------------------------------*/
#define byteTLcpy(x,y) *(u8 *)(x)=*(u8 *)(y); #define byteTLcpy(x, y) *(u8 *)(x) = *(u8 *)(y);
#define wordTLcpy(x,y) *(u16 *)(x)=*(u16 *)(y); #define wordTLcpy(x, y) *(u16 *)(x) = *(u16 *)(y);
#define dwordTLcpy(x,y) memcpy(x,y,4); #define dwordTLcpy(x, y) memcpy(x, y, 4);
#define structTLcpy(x,y,l) memcpy (x,y,l) #define structTLcpy(x, y, l) memcpy(x, y, l)
#define structTLcpyovl(x,y,l) memmove (x,y,l) #define structTLcpyovl(x, y, l) memmove(x, y, l)
#define byteTRcpy(x,y) *(u8 *)(y)=*(u8 *)(x); #define byteTRcpy(x, y) *(u8 *)(y) = *(u8 *)(x);
#define wordTRcpy(x,y) *(u16 *)(y)=*(u16 *)(x); #define wordTRcpy(x, y) *(u16 *)(y) = *(u16 *)(x);
#define dwordTRcpy(x,y) memcpy(y,x,4); #define dwordTRcpy(x, y) memcpy(y, x, 4);
#define structTRcpy(x,y,l) memcpy (y,x,l) #define structTRcpy(x, y, l) memcpy(y, x, l)
#define structTRcpyovl(x,y,l) memmove (y,x,l) #define structTRcpyovl(x, y, l) memmove(y, x, l)
/*-------------------------------------------------------*/ /*-------------------------------------------------------*/
static unsigned command_2_index(unsigned c, unsigned sc) static unsigned command_2_index(unsigned c, unsigned sc)
@@ -414,9 +414,9 @@ static unsigned command_2_index(unsigned c, unsigned sc)
/*-------------------------------------------------------*/ /*-------------------------------------------------------*/
#define TYP (cdef[cmsg->par[cmsg->p]].typ) #define TYP (cdef[cmsg->par[cmsg->p]].typ)
#define OFF (((u8 *)cmsg)+cdef[cmsg->par[cmsg->p]].off) #define OFF (((u8 *)cmsg) + cdef[cmsg->par[cmsg->p]].off)
static void jumpcstruct(_cmsg * cmsg) static void jumpcstruct(_cmsg *cmsg)
{ {
unsigned layer; unsigned layer;
for (cmsg->p++, layer = 1; layer;) { for (cmsg->p++, layer = 1; layer;) {
@@ -433,7 +433,7 @@ static void jumpcstruct(_cmsg * cmsg)
} }
} }
/*-------------------------------------------------------*/ /*-------------------------------------------------------*/
static void pars_2_message(_cmsg * cmsg) static void pars_2_message(_cmsg *cmsg)
{ {
for (; TYP != _CEND; cmsg->p++) { for (; TYP != _CEND; cmsg->p++) {
@@ -499,7 +499,7 @@ static void pars_2_message(_cmsg * cmsg)
* Return value: 0 for success * Return value: 0 for success
*/ */
unsigned capi_cmsg2message(_cmsg * cmsg, u8 * msg) unsigned capi_cmsg2message(_cmsg *cmsg, u8 *msg)
{ {
cmsg->m = msg; cmsg->m = msg;
cmsg->l = 8; cmsg->l = 8;
@@ -518,7 +518,7 @@ unsigned capi_cmsg2message(_cmsg * cmsg, u8 * msg)
} }
/*-------------------------------------------------------*/ /*-------------------------------------------------------*/
static void message_2_pars(_cmsg * cmsg) static void message_2_pars(_cmsg *cmsg)
{ {
for (; TYP != _CEND; cmsg->p++) { for (; TYP != _CEND; cmsg->p++) {
@@ -569,7 +569,7 @@ static void message_2_pars(_cmsg * cmsg)
* Return value: 0 for success * Return value: 0 for success
*/ */
unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg) unsigned capi_message2cmsg(_cmsg *cmsg, u8 *msg)
{ {
memset(cmsg, 0, sizeof(_cmsg)); memset(cmsg, 0, sizeof(_cmsg));
cmsg->m = msg; cmsg->m = msg;
@@ -600,7 +600,7 @@ unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg)
* Return value: 0 for success * Return value: 0 for success
*/ */
unsigned capi_cmsg_header(_cmsg * cmsg, u16 _ApplId, unsigned capi_cmsg_header(_cmsg *cmsg, u16 _ApplId,
u8 _Command, u8 _Subcommand, u8 _Command, u8 _Subcommand,
u16 _Messagenumber, u32 _Controller) u16 _Messagenumber, u32 _Controller)
{ {
@@ -744,10 +744,10 @@ static char *pnames[] =
#include <stdarg.h> #include <stdarg.h>
/*-------------------------------------------------------*/ /*-------------------------------------------------------*/
static _cdebbuf *bufprint(_cdebbuf *cdb, char *fmt,...) static _cdebbuf *bufprint(_cdebbuf *cdb, char *fmt, ...)
{ {
va_list f; va_list f;
size_t n,r; size_t n, r;
if (!cdb) if (!cdb)
return NULL; return NULL;
@@ -783,7 +783,7 @@ static _cdebbuf *bufprint(_cdebbuf *cdb, char *fmt,...)
return cdb; return cdb;
} }
static _cdebbuf *printstructlen(_cdebbuf *cdb, u8 * m, unsigned len) static _cdebbuf *printstructlen(_cdebbuf *cdb, u8 *m, unsigned len)
{ {
unsigned hex = 0; unsigned hex = 0;
@@ -807,7 +807,7 @@ static _cdebbuf *printstructlen(_cdebbuf *cdb, u8 * m, unsigned len)
return cdb; return cdb;
} }
static _cdebbuf *printstruct(_cdebbuf *cdb, u8 * m) static _cdebbuf *printstruct(_cdebbuf *cdb, u8 *m)
{ {
unsigned len; unsigned len;
@@ -940,7 +940,7 @@ void cdebbuf_free(_cdebbuf *cdb)
* The returned buffer should be freed by a call to cdebbuf_free() after use. * The returned buffer should be freed by a call to cdebbuf_free() after use.
*/ */
_cdebbuf *capi_message2str(u8 * msg) _cdebbuf *capi_message2str(u8 *msg)
{ {
_cdebbuf *cdb; _cdebbuf *cdb;
_cmsg *cmsg; _cmsg *cmsg;
@@ -986,7 +986,7 @@ _cdebbuf *capi_message2str(u8 * msg)
* The returned buffer should be freed by a call to cdebbuf_free() after use. * The returned buffer should be freed by a call to cdebbuf_free() after use.
*/ */
_cdebbuf *capi_cmsg2str(_cmsg * cmsg) _cdebbuf *capi_cmsg2str(_cmsg *cmsg)
{ {
_cdebbuf *cdb; _cdebbuf *cdb;
@@ -1008,7 +1008,7 @@ _cdebbuf *capi_cmsg2str(_cmsg * cmsg)
int __init cdebug_init(void) int __init cdebug_init(void)
{ {
g_cmsg= kmalloc(sizeof(_cmsg), GFP_KERNEL); g_cmsg = kmalloc(sizeof(_cmsg), GFP_KERNEL);
if (!g_cmsg) if (!g_cmsg)
return -ENOMEM; return -ENOMEM;
g_debbuf = kmalloc(sizeof(_cdebbuf), GFP_KERNEL); g_debbuf = kmalloc(sizeof(_cdebbuf), GFP_KERNEL);
@@ -1041,12 +1041,12 @@ void __exit cdebug_exit(void)
static _cdebbuf g_debbuf = {"CONFIG_CAPI_TRACE not enabled", NULL, 0, 0}; static _cdebbuf g_debbuf = {"CONFIG_CAPI_TRACE not enabled", NULL, 0, 0};
_cdebbuf *capi_message2str(u8 * msg) _cdebbuf *capi_message2str(u8 *msg)
{ {
return &g_debbuf; return &g_debbuf;
} }
_cdebbuf *capi_cmsg2str(_cmsg * cmsg) _cdebbuf *capi_cmsg2str(_cmsg *cmsg)
{ {
return &g_debbuf; return &g_debbuf;
} }

View File

@@ -55,7 +55,7 @@ struct capictr_event {
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
static struct capi_version driver_version = {2, 0, 1, 1<<4}; static struct capi_version driver_version = {2, 0, 1, 1 << 4};
static char driver_serial[CAPI_SERIAL_LEN] = "0004711"; static char driver_serial[CAPI_SERIAL_LEN] = "0004711";
static char capi_manufakturer[64] = "AVM Berlin"; static char capi_manufakturer[64] = "AVM Berlin";
@@ -796,7 +796,7 @@ u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb)
cmd = CAPIMSG_COMMAND(skb->data); cmd = CAPIMSG_COMMAND(skb->data);
subcmd = CAPIMSG_SUBCOMMAND(skb->data); subcmd = CAPIMSG_SUBCOMMAND(skb->data);
if (cmd == CAPI_DATA_B3 && subcmd== CAPI_REQ) { if (cmd == CAPI_DATA_B3 && subcmd == CAPI_REQ) {
ctr->nsentdatapkt++; ctr->nsentdatapkt++;
ap->nsentdatapkt++; ap->nsentdatapkt++;
if (ctr->traceflag > 2) if (ctr->traceflag > 2)
@@ -1136,7 +1136,7 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
retval = wait_on_ctr_state(ctr, CAPI_CTR_RUNNING); retval = wait_on_ctr_state(ctr, CAPI_CTR_RUNNING);
load_unlock_out: load_unlock_out:
mutex_unlock(&capi_controller_lock); mutex_unlock(&capi_controller_lock);
return retval; return retval;
@@ -1167,7 +1167,7 @@ load_unlock_out:
retval = wait_on_ctr_state(ctr, CAPI_CTR_DETECTED); retval = wait_on_ctr_state(ctr, CAPI_CTR_DETECTED);
reset_unlock_out: reset_unlock_out:
mutex_unlock(&capi_controller_lock); mutex_unlock(&capi_controller_lock);
return retval; return retval;
} }
@@ -1235,7 +1235,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data)
cparams.membase = cdef.membase; cparams.membase = cdef.membase;
cparams.cardnr = cdef.cardnr; cparams.cardnr = cdef.cardnr;
cparams.cardtype = 0; cparams.cardtype = 0;
cdef.driver[sizeof(cdef.driver)-1] = 0; cdef.driver[sizeof(cdef.driver) - 1] = 0;
mutex_lock(&capi_drivers_lock); mutex_lock(&capi_drivers_lock);

View File

@@ -17,8 +17,8 @@
#ifdef KCAPI_DEBUG #ifdef KCAPI_DEBUG
#define DBG(format, arg...) do { \ #define DBG(format, arg...) do { \
printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \ printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
} while (0) } while (0)
#else #else
#define DBG(format, arg...) /* */ #define DBG(format, arg...) /* */
#endif #endif
@@ -49,4 +49,3 @@ static inline void kcapi_proc_init(void) { };
static inline void kcapi_proc_exit(void) { }; static inline void kcapi_proc_exit(void) { };
#endif #endif

View File

@@ -23,13 +23,13 @@ MODULE_LICENSE("GPL");
/* structure containing interface to hl */ /* structure containing interface to hl */
/****************************************/ /****************************************/
isdn_divert_if divert_if = isdn_divert_if divert_if =
{ DIVERT_IF_MAGIC, /* magic value */ { DIVERT_IF_MAGIC, /* magic value */
DIVERT_CMD_REG, /* register cmd */ DIVERT_CMD_REG, /* register cmd */
ll_callback, /* callback routine from ll */ ll_callback, /* callback routine from ll */
NULL, /* command still not specified */ NULL, /* command still not specified */
NULL, /* drv_to_name */ NULL, /* drv_to_name */
NULL, /* name_to_drv */ NULL, /* name_to_drv */
}; };
/*************************/ /*************************/
/* Module interface code */ /* Module interface code */
@@ -40,15 +40,15 @@ static int __init divert_init(void)
if (divert_dev_init()) if (divert_dev_init())
{ printk(KERN_WARNING "dss1_divert: cannot install device, not loaded\n"); { printk(KERN_WARNING "dss1_divert: cannot install device, not loaded\n");
return(-EIO); return (-EIO);
} }
if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR) if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR)
{ divert_dev_deinit(); { divert_dev_deinit();
printk(KERN_WARNING "dss1_divert: error %d registering module, not loaded\n",i); printk(KERN_WARNING "dss1_divert: error %d registering module, not loaded\n", i);
return(-EIO); return (-EIO);
} }
printk(KERN_INFO "dss1_divert module successfully installed\n"); printk(KERN_INFO "dss1_divert module successfully installed\n");
return(0); return (0);
} }
/**********************/ /**********************/
@@ -62,7 +62,7 @@ static void __exit divert_exit(void)
spin_lock_irqsave(&divert_lock, flags); spin_lock_irqsave(&divert_lock, flags);
divert_if.cmd = DIVERT_CMD_REL; /* release */ divert_if.cmd = DIVERT_CMD_REL; /* release */
if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR) if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR)
{ printk(KERN_WARNING "dss1_divert: error %d releasing module\n",i); { printk(KERN_WARNING "dss1_divert: error %d releasing module\n", i);
spin_unlock_irqrestore(&divert_lock, flags); spin_unlock_irqrestore(&divert_lock, flags);
return; return;
} }
@@ -79,4 +79,3 @@ static void __exit divert_exit(void)
module_init(divert_init); module_init(divert_init);
module_exit(divert_exit); module_exit(divert_exit);

View File

@@ -53,7 +53,7 @@ put_info_buffer(char *cp)
return; /* no memory */ return; /* no memory */
strcpy(ib->info_start, cp); /* set output string */ strcpy(ib->info_start, cp); /* set output string */
ib->next = NULL; ib->next = NULL;
spin_lock_irqsave( &divert_info_lock, flags ); spin_lock_irqsave(&divert_info_lock, flags);
ib->usage_cnt = if_used; ib->usage_cnt = if_used;
if (!divert_info_head) if (!divert_info_head)
divert_info_head = ib; /* new head */ divert_info_head = ib; /* new head */
@@ -71,7 +71,7 @@ put_info_buffer(char *cp)
} else } else
break; break;
} /* divert_info_head->next */ } /* divert_info_head->next */
spin_unlock_irqrestore( &divert_info_lock, flags ); spin_unlock_irqrestore(&divert_info_lock, flags);
wake_up_interruptible(&(rd_queue)); wake_up_interruptible(&(rd_queue));
} /* put_info_buffer */ } /* put_info_buffer */
@@ -81,7 +81,7 @@ put_info_buffer(char *cp)
/* deflection device read routine */ /* deflection device read routine */
/**********************************/ /**********************************/
static ssize_t static ssize_t
isdn_divert_read(struct file *file, char __user *buf, size_t count, loff_t * off) isdn_divert_read(struct file *file, char __user *buf, size_t count, loff_t *off)
{ {
struct divert_info *inf; struct divert_info *inf;
int len; int len;
@@ -109,7 +109,7 @@ isdn_divert_read(struct file *file, char __user *buf, size_t count, loff_t * off
/* deflection device write routine */ /* deflection device write routine */
/**********************************/ /**********************************/
static ssize_t static ssize_t
isdn_divert_write(struct file *file, const char __user *buf, size_t count, loff_t * off) isdn_divert_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
{ {
return (-ENODEV); return (-ENODEV);
} /* isdn_divert_write */ } /* isdn_divert_write */
@@ -119,7 +119,7 @@ isdn_divert_write(struct file *file, const char __user *buf, size_t count, loff_
/* select routines for various kernels */ /* select routines for various kernels */
/***************************************/ /***************************************/
static unsigned int static unsigned int
isdn_divert_poll(struct file *file, poll_table * wait) isdn_divert_poll(struct file *file, poll_table *wait)
{ {
unsigned int mask = 0; unsigned int mask = 0;
@@ -139,13 +139,13 @@ isdn_divert_open(struct inode *ino, struct file *filep)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave( &divert_info_lock, flags ); spin_lock_irqsave(&divert_info_lock, flags);
if_used++; if_used++;
if (divert_info_head) if (divert_info_head)
filep->private_data = &(divert_info_tail->next); filep->private_data = &(divert_info_tail->next);
else else
filep->private_data = &divert_info_head; filep->private_data = &divert_info_head;
spin_unlock_irqrestore( &divert_info_lock, flags ); spin_unlock_irqrestore(&divert_info_lock, flags);
/* start_divert(); */ /* start_divert(); */
return nonseekable_open(ino, filep); return nonseekable_open(ino, filep);
} /* isdn_divert_open */ } /* isdn_divert_open */
@@ -159,7 +159,7 @@ isdn_divert_close(struct inode *ino, struct file *filep)
struct divert_info *inf; struct divert_info *inf;
unsigned long flags; unsigned long flags;
spin_lock_irqsave( &divert_info_lock, flags ); spin_lock_irqsave(&divert_info_lock, flags);
if_used--; if_used--;
inf = *((struct divert_info **) filep->private_data); inf = *((struct divert_info **) filep->private_data);
while (inf) { while (inf) {
@@ -172,7 +172,7 @@ isdn_divert_close(struct inode *ino, struct file *filep)
divert_info_head = divert_info_head->next; divert_info_head = divert_info_head->next;
kfree(inf); kfree(inf);
} }
spin_unlock_irqrestore( &divert_info_lock, flags ); spin_unlock_irqrestore(&divert_info_lock, flags);
return (0); return (0);
} /* isdn_divert_close */ } /* isdn_divert_close */

View File

@@ -20,7 +20,7 @@
/* structure keeping calling info */ /* structure keeping calling info */
/**********************************/ /**********************************/
struct call_struc struct call_struc
{ isdn_ctrl ics; /* delivered setup + driver parameters */ { isdn_ctrl ics; /* delivered setup + driver parameters */
ulong divert_id; /* Id delivered to user */ ulong divert_id; /* Id delivered to user */
unsigned char akt_state; /* actual state */ unsigned char akt_state; /* actual state */
char deflect_dest[35]; /* deflection destination */ char deflect_dest[35]; /* deflection destination */
@@ -28,16 +28,16 @@ struct call_struc
char info[90]; /* device info output */ char info[90]; /* device info output */
struct call_struc *next; /* pointer to next entry */ struct call_struc *next; /* pointer to next entry */
struct call_struc *prev; struct call_struc *prev;
}; };
/********************************************/ /********************************************/
/* structure keeping deflection table entry */ /* structure keeping deflection table entry */
/********************************************/ /********************************************/
struct deflect_struc struct deflect_struc
{ struct deflect_struc *next,*prev; { struct deflect_struc *next, *prev;
divert_rule rule; /* used rule */ divert_rule rule; /* used rule */
}; };
/*****************************************/ /*****************************************/
@@ -64,7 +64,7 @@ static void deflect_timer_expire(ulong arg)
del_timer(&cs->timer); /* delete active timer */ del_timer(&cs->timer); /* delete active timer */
spin_unlock_irqrestore(&divert_lock, flags); spin_unlock_irqrestore(&divert_lock, flags);
switch(cs->akt_state) switch (cs->akt_state)
{ case DEFLECT_PROCEED: { case DEFLECT_PROCEED:
cs->ics.command = ISDN_CMD_HANGUP; /* cancel action */ cs->ics.command = ISDN_CMD_HANGUP; /* cancel action */
divert_if.ll_cmd(&cs->ics); divert_if.ll_cmd(&cs->ics);
@@ -78,7 +78,7 @@ static void deflect_timer_expire(ulong arg)
case DEFLECT_ALERT: case DEFLECT_ALERT:
cs->ics.command = ISDN_CMD_REDIR; /* protocol */ cs->ics.command = ISDN_CMD_REDIR; /* protocol */
strlcpy(cs->ics.parm.setup.phone, cs->deflect_dest, sizeof(cs->ics.parm.setup.phone)); strlcpy(cs->ics.parm.setup.phone, cs->deflect_dest, sizeof(cs->ics.parm.setup.phone));
strcpy(cs->ics.parm.setup.eazmsn,"Testtext delayed"); strcpy(cs->ics.parm.setup.eazmsn, "Testtext delayed");
divert_if.ll_cmd(&cs->ics); divert_if.ll_cmd(&cs->ics);
spin_lock_irqsave(&divert_lock, flags); spin_lock_irqsave(&divert_lock, flags);
cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */ cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
@@ -112,13 +112,13 @@ int cf_command(int drvid, int mode,
u_char proc, char *msn, u_char proc, char *msn,
u_char service, char *fwd_nr, ulong *procid) u_char service, char *fwd_nr, ulong *procid)
{ unsigned long flags; { unsigned long flags;
int retval,msnlen; int retval, msnlen;
int fwd_len; int fwd_len;
char *p,*ielenp,tmp[60]; char *p, *ielenp, tmp[60];
struct call_struc *cs; struct call_struc *cs;
if (strchr(msn,'.')) return(-EINVAL); /* subaddress not allowed in msn */ if (strchr(msn, '.')) return (-EINVAL); /* subaddress not allowed in msn */
if ((proc & 0x7F) > 2) return(-EINVAL); if ((proc & 0x7F) > 2) return (-EINVAL);
proc &= 3; proc &= 3;
p = tmp; p = tmp;
*p++ = 0x30; /* enumeration */ *p++ = 0x30; /* enumeration */
@@ -131,14 +131,14 @@ int cf_command(int drvid, int mode,
*p++ = service; /* service to handle */ *p++ = service; /* service to handle */
if (mode == 1) if (mode == 1)
{ if (!*fwd_nr) return(-EINVAL); /* destination missing */ { if (!*fwd_nr) return (-EINVAL); /* destination missing */
if (strchr(fwd_nr,'.')) return(-EINVAL); /* subaddress not allowed */ if (strchr(fwd_nr, '.')) return (-EINVAL); /* subaddress not allowed */
fwd_len = strlen(fwd_nr); fwd_len = strlen(fwd_nr);
*p++ = 0x30; /* number enumeration */ *p++ = 0x30; /* number enumeration */
*p++ = fwd_len + 2; /* complete forward to len */ *p++ = fwd_len + 2; /* complete forward to len */
*p++ = 0x80; /* fwd to nr */ *p++ = 0x80; /* fwd to nr */
*p++ = fwd_len; /* length of number */ *p++ = fwd_len; /* length of number */
strcpy(p,fwd_nr); /* copy number */ strcpy(p, fwd_nr); /* copy number */
p += fwd_len; /* pointer beyond fwd */ p += fwd_len; /* pointer beyond fwd */
} /* activate */ } /* activate */
@@ -146,7 +146,7 @@ int cf_command(int drvid, int mode,
*p++ = 0x80; /* msn number */ *p++ = 0x80; /* msn number */
if (msnlen > 1) if (msnlen > 1)
{ *p++ = msnlen; /* length */ { *p++ = msnlen; /* length */
strcpy(p,msn); strcpy(p, msn);
p += msnlen; p += msnlen;
} }
else *p++ = 0; else *p++ = 0;
@@ -155,7 +155,7 @@ int cf_command(int drvid, int mode,
/* allocate mem for information struct */ /* allocate mem for information struct */
if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC))) if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
return(-ENOMEM); /* no memory */ return (-ENOMEM); /* no memory */
init_timer(&cs->timer); init_timer(&cs->timer);
cs->info[0] = '\0'; cs->info[0] = '\0';
cs->timer.function = deflect_timer_expire; cs->timer.function = deflect_timer_expire;
@@ -163,7 +163,7 @@ int cf_command(int drvid, int mode,
cs->ics.driver = drvid; cs->ics.driver = drvid;
cs->ics.command = ISDN_CMD_PROT_IO; /* protocol specific io */ cs->ics.command = ISDN_CMD_PROT_IO; /* protocol specific io */
cs->ics.arg = DSS1_CMD_INVOKE; /* invoke supplementary service */ cs->ics.arg = DSS1_CMD_INVOKE; /* invoke supplementary service */
cs->ics.parm.dss1_io.proc = (mode == 1) ? 7: (mode == 2) ? 11:8; /* operation */ cs->ics.parm.dss1_io.proc = (mode == 1) ? 7 : (mode == 2) ? 11 : 8; /* operation */
cs->ics.parm.dss1_io.timeout = 4000; /* from ETS 300 207-1 */ cs->ics.parm.dss1_io.timeout = 4000; /* from ETS 300 207-1 */
cs->ics.parm.dss1_io.datalen = p - tmp; /* total len */ cs->ics.parm.dss1_io.datalen = p - tmp; /* total len */
cs->ics.parm.dss1_io.data = tmp; /* start of buffer */ cs->ics.parm.dss1_io.data = tmp; /* start of buffer */
@@ -173,8 +173,8 @@ int cf_command(int drvid, int mode,
spin_unlock_irqrestore(&divert_lock, flags); spin_unlock_irqrestore(&divert_lock, flags);
*procid = cs->ics.parm.dss1_io.ll_id; *procid = cs->ics.parm.dss1_io.ll_id;
sprintf(cs->info,"%d 0x%lx %s%s 0 %s %02x %d%s%s\n", sprintf(cs->info, "%d 0x%lx %s%s 0 %s %02x %d%s%s\n",
(!mode ) ? DIVERT_DEACTIVATE : (mode == 1) ? DIVERT_ACTIVATE : DIVERT_REPORT, (!mode) ? DIVERT_DEACTIVATE : (mode == 1) ? DIVERT_ACTIVATE : DIVERT_REPORT,
cs->ics.parm.dss1_io.ll_id, cs->ics.parm.dss1_io.ll_id,
(mode != 2) ? "" : "0 ", (mode != 2) ? "" : "0 ",
divert_if.drv_to_name(cs->ics.driver), divert_if.drv_to_name(cs->ics.driver),
@@ -195,7 +195,7 @@ int cf_command(int drvid, int mode,
} }
else else
kfree(cs); kfree(cs);
return(retval); return (retval);
} /* cf_command */ } /* cf_command */
@@ -208,18 +208,18 @@ int deflect_extern_action(u_char cmd, ulong callid, char *to_nr)
unsigned long flags; unsigned long flags;
int i; int i;
if ((cmd & 0x7F) > 2) return(-EINVAL); /* invalid command */ if ((cmd & 0x7F) > 2) return (-EINVAL); /* invalid command */
cs = divert_head; /* start of parameter list */ cs = divert_head; /* start of parameter list */
while (cs) while (cs)
{ if (cs->divert_id == callid) break; /* found */ { if (cs->divert_id == callid) break; /* found */
cs = cs->next; cs = cs->next;
} /* search entry */ } /* search entry */
if (!cs) return(-EINVAL); /* invalid callid */ if (!cs) return (-EINVAL); /* invalid callid */
ic.driver = cs->ics.driver; ic.driver = cs->ics.driver;
ic.arg = cs->ics.arg; ic.arg = cs->ics.arg;
i = -EINVAL; i = -EINVAL;
if (cs->akt_state == DEFLECT_AUTODEL) return(i); /* no valid call */ if (cs->akt_state == DEFLECT_AUTODEL) return (i); /* no valid call */
switch (cmd & 0x7F) switch (cmd & 0x7F)
{ case 0: /* hangup */ { case 0: /* hangup */
del_timer(&cs->timer); del_timer(&cs->timer);
@@ -233,7 +233,7 @@ int deflect_extern_action(u_char cmd, ulong callid, char *to_nr)
break; break;
case 1: /* alert */ case 1: /* alert */
if (cs->akt_state == DEFLECT_ALERT) return(0); if (cs->akt_state == DEFLECT_ALERT) return (0);
cmd &= 0x7F; /* never wait */ cmd &= 0x7F; /* never wait */
del_timer(&cs->timer); del_timer(&cs->timer);
ic.command = ISDN_CMD_ALERT; ic.command = ISDN_CMD_ALERT;
@@ -267,19 +267,19 @@ int deflect_extern_action(u_char cmd, ulong callid, char *to_nr)
break; break;
} /* switch */ } /* switch */
return(i); return (i);
} /* deflect_extern_action */ } /* deflect_extern_action */
/********************************/ /********************************/
/* insert a new rule before idx */ /* insert a new rule before idx */
/********************************/ /********************************/
int insertrule(int idx, divert_rule *newrule) int insertrule(int idx, divert_rule *newrule)
{ struct deflect_struc *ds,*ds1=NULL; { struct deflect_struc *ds, *ds1 = NULL;
unsigned long flags; unsigned long flags;
if (!(ds = kmalloc(sizeof(struct deflect_struc), if (!(ds = kmalloc(sizeof(struct deflect_struc),
GFP_KERNEL))) GFP_KERNEL)))
return(-ENOMEM); /* no memory */ return (-ENOMEM); /* no memory */
ds->rule = *newrule; /* set rule */ ds->rule = *newrule; /* set rule */
@@ -312,14 +312,14 @@ int insertrule(int idx, divert_rule *newrule)
} }
spin_unlock_irqrestore(&divert_lock, flags); spin_unlock_irqrestore(&divert_lock, flags);
return(0); return (0);
} /* insertrule */ } /* insertrule */
/***********************************/ /***********************************/
/* delete the rule at position idx */ /* delete the rule at position idx */
/***********************************/ /***********************************/
int deleterule(int idx) int deleterule(int idx)
{ struct deflect_struc *ds,*ds1; { struct deflect_struc *ds, *ds1;
unsigned long flags; unsigned long flags;
if (idx < 0) if (idx < 0)
@@ -333,7 +333,7 @@ int deleterule(int idx)
ds = ds->next; ds = ds->next;
kfree(ds1); kfree(ds1);
} }
return(0); return (0);
} }
spin_lock_irqsave(&divert_lock, flags); spin_lock_irqsave(&divert_lock, flags);
@@ -347,7 +347,7 @@ int deleterule(int idx)
if (!ds) if (!ds)
{ {
spin_unlock_irqrestore(&divert_lock, flags); spin_unlock_irqrestore(&divert_lock, flags);
return(-EINVAL); return (-EINVAL);
} }
if (ds->next) if (ds->next)
@@ -362,7 +362,7 @@ int deleterule(int idx)
spin_unlock_irqrestore(&divert_lock, flags); spin_unlock_irqrestore(&divert_lock, flags);
kfree(ds); kfree(ds);
return(0); return (0);
} /* deleterule */ } /* deleterule */
/*******************************************/ /*******************************************/
@@ -371,15 +371,15 @@ int deleterule(int idx)
divert_rule *getruleptr(int idx) divert_rule *getruleptr(int idx)
{ struct deflect_struc *ds = table_head; { struct deflect_struc *ds = table_head;
if (idx < 0) return(NULL); if (idx < 0) return (NULL);
while ((ds) && (idx >= 0)) while ((ds) && (idx >= 0))
{ if (!(idx--)) { if (!(idx--))
{ return(&ds->rule); { return (&ds->rule);
break; break;
} }
ds = ds->next; ds = ds->next;
} }
return(NULL); return (NULL);
} /* getruleptr */ } /* getruleptr */
/*************************************************/ /*************************************************/
@@ -390,11 +390,11 @@ static int isdn_divert_icall(isdn_ctrl *ic)
unsigned long flags; unsigned long flags;
struct call_struc *cs = NULL; struct call_struc *cs = NULL;
struct deflect_struc *dv; struct deflect_struc *dv;
char *p,*p1; char *p, *p1;
u_char accept; u_char accept;
/* first check the internal deflection table */ /* first check the internal deflection table */
for (dv = table_head; dv ; dv = dv->next ) for (dv = table_head; dv; dv = dv->next)
{ /* scan table */ { /* scan table */
if (((dv->rule.callopt == 1) && (ic->command == ISDN_STAT_ICALLW)) || if (((dv->rule.callopt == 1) && (ic->command == ISDN_STAT_ICALLW)) ||
((dv->rule.callopt == 2) && (ic->command == ISDN_STAT_ICALL))) ((dv->rule.callopt == 2) && (ic->command == ISDN_STAT_ICALL)))
@@ -422,7 +422,7 @@ static int isdn_divert_icall(isdn_ctrl *ic)
} /* complete compare */ } /* complete compare */
if (!accept) continue; /* not accepted */ if (!accept) continue; /* not accepted */
if ((strcmp(dv->rule.caller,"0")) || (ic->parm.setup.phone[0])) if ((strcmp(dv->rule.caller, "0")) || (ic->parm.setup.phone[0]))
{ p = dv->rule.caller; { p = dv->rule.caller;
p1 = ic->parm.setup.phone; p1 = ic->parm.setup.phone;
accept = 0; accept = 0;
@@ -442,7 +442,7 @@ static int isdn_divert_icall(isdn_ctrl *ic)
switch (dv->rule.action) switch (dv->rule.action)
{ case DEFLECT_IGNORE: { case DEFLECT_IGNORE:
return(0); return (0);
break; break;
case DEFLECT_ALERT: case DEFLECT_ALERT:
@@ -451,17 +451,17 @@ static int isdn_divert_icall(isdn_ctrl *ic)
case DEFLECT_REJECT: case DEFLECT_REJECT:
if (dv->rule.action == DEFLECT_PROCEED) if (dv->rule.action == DEFLECT_PROCEED)
if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime))) if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime)))
return(0); /* no external deflection needed */ return (0); /* no external deflection needed */
if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC))) if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
return(0); /* no memory */ return (0); /* no memory */
init_timer(&cs->timer); init_timer(&cs->timer);
cs->info[0] = '\0'; cs->info[0] = '\0';
cs->timer.function = deflect_timer_expire; cs->timer.function = deflect_timer_expire;
cs->timer.data = (ulong) cs; /* pointer to own structure */ cs->timer.data = (ulong) cs; /* pointer to own structure */
cs->ics = *ic; /* copy incoming data */ cs->ics = *ic; /* copy incoming data */
if (!cs->ics.parm.setup.phone[0]) strcpy(cs->ics.parm.setup.phone,"0"); if (!cs->ics.parm.setup.phone[0]) strcpy(cs->ics.parm.setup.phone, "0");
if (!cs->ics.parm.setup.eazmsn[0]) strcpy(cs->ics.parm.setup.eazmsn,"0"); if (!cs->ics.parm.setup.eazmsn[0]) strcpy(cs->ics.parm.setup.eazmsn, "0");
cs->ics.parm.setup.screen = dv->rule.screen; cs->ics.parm.setup.screen = dv->rule.screen;
if (dv->rule.waittime) if (dv->rule.waittime)
cs->timer.expires = jiffies + (HZ * dv->rule.waittime); cs->timer.expires = jiffies + (HZ * dv->rule.waittime);
@@ -476,9 +476,9 @@ static int isdn_divert_icall(isdn_ctrl *ic)
spin_unlock_irqrestore(&divert_lock, flags); spin_unlock_irqrestore(&divert_lock, flags);
cs->prev = NULL; cs->prev = NULL;
if (cs->akt_state == DEFLECT_ALERT) if (cs->akt_state == DEFLECT_ALERT)
{ strcpy(cs->deflect_dest,dv->rule.to_nr); { strcpy(cs->deflect_dest, dv->rule.to_nr);
if (!cs->timer.expires) if (!cs->timer.expires)
{ strcpy(ic->parm.setup.eazmsn,"Testtext direct"); { strcpy(ic->parm.setup.eazmsn, "Testtext direct");
ic->parm.setup.screen = dv->rule.screen; ic->parm.setup.screen = dv->rule.screen;
strlcpy(ic->parm.setup.phone, dv->rule.to_nr, sizeof(ic->parm.setup.phone)); strlcpy(ic->parm.setup.phone, dv->rule.to_nr, sizeof(ic->parm.setup.phone));
cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */ cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
@@ -492,11 +492,11 @@ static int isdn_divert_icall(isdn_ctrl *ic)
{ cs->deflect_dest[0] = '\0'; { cs->deflect_dest[0] = '\0';
retval = 4; /* only proceed */ retval = 4; /* only proceed */
} }
sprintf(cs->info,"%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n", sprintf(cs->info, "%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n",
cs->akt_state, cs->akt_state,
cs->divert_id, cs->divert_id,
divert_if.drv_to_name(cs->ics.driver), divert_if.drv_to_name(cs->ics.driver),
(ic->command == ISDN_STAT_ICALLW) ? "1":"0", (ic->command == ISDN_STAT_ICALLW) ? "1" : "0",
cs->ics.parm.setup.phone, cs->ics.parm.setup.phone,
cs->ics.parm.setup.eazmsn, cs->ics.parm.setup.eazmsn,
cs->ics.parm.setup.si1, cs->ics.parm.setup.si1,
@@ -508,12 +508,12 @@ static int isdn_divert_icall(isdn_ctrl *ic)
(dv->rule.action == DEFLECT_REJECT)) (dv->rule.action == DEFLECT_REJECT))
{ put_info_buffer(cs->info); { put_info_buffer(cs->info);
kfree(cs); /* remove */ kfree(cs); /* remove */
return((dv->rule.action == DEFLECT_REPORT) ? 0:2); /* nothing to do */ return ((dv->rule.action == DEFLECT_REPORT) ? 0 : 2); /* nothing to do */
} }
break; break;
default: default:
return(0); /* ignore call */ return (0); /* ignore call */
break; break;
} /* switch action */ } /* switch action */
break; break;
@@ -528,10 +528,10 @@ static int isdn_divert_icall(isdn_ctrl *ic)
spin_unlock_irqrestore(&divert_lock, flags); spin_unlock_irqrestore(&divert_lock, flags);
put_info_buffer(cs->info); put_info_buffer(cs->info);
return(retval); return (retval);
} }
else else
return(0); return (0);
} /* isdn_divert_icall */ } /* isdn_divert_icall */
@@ -558,32 +558,32 @@ static int put_address(char *st, u_char *p, int len)
{ u_char retval = 0; { u_char retval = 0;
u_char adr_typ = 0; /* network standard */ u_char adr_typ = 0; /* network standard */
if (len < 2) return(retval); if (len < 2) return (retval);
if (*p == 0xA1) if (*p == 0xA1)
{ retval = *(++p) + 2; /* total length */ { retval = *(++p) + 2; /* total length */
if (retval > len) return(0); /* too short */ if (retval > len) return (0); /* too short */
len = retval - 2; /* remaining length */ len = retval - 2; /* remaining length */
if (len < 3) return(0); if (len < 3) return (0);
if ((*(++p) != 0x0A) || (*(++p) != 1)) return(0); if ((*(++p) != 0x0A) || (*(++p) != 1)) return (0);
adr_typ = *(++p); adr_typ = *(++p);
len -= 3; len -= 3;
p++; p++;
if (len < 2) return(0); if (len < 2) return (0);
if (*p++ != 0x12) return(0); if (*p++ != 0x12) return (0);
if (*p > len) return(0); /* check number length */ if (*p > len) return (0); /* check number length */
len = *p++; len = *p++;
} }
else else
if (*p == 0x80) if (*p == 0x80)
{ retval = *(++p) + 2; /* total length */ { retval = *(++p) + 2; /* total length */
if (retval > len) return(0); if (retval > len) return (0);
len = retval - 2; len = retval - 2;
p++; p++;
} }
else else
return(0); /* invalid address information */ return (0); /* invalid address information */
sprintf(st,"%d ",adr_typ); sprintf(st, "%d ", adr_typ);
st += strlen(st); st += strlen(st);
if (!len) if (!len)
*st++ = '-'; *st++ = '-';
@@ -591,7 +591,7 @@ static int put_address(char *st, u_char *p, int len)
while (len--) while (len--)
*st++ = *p++; *st++ = *p++;
*st = '\0'; *st = '\0';
return(retval); return (retval);
} /* put_address */ } /* put_address */
/*************************************/ /*************************************/
@@ -601,91 +601,91 @@ static int interrogate_success(isdn_ctrl *ic, struct call_struc *cs)
{ char *src = ic->parm.dss1_io.data; { char *src = ic->parm.dss1_io.data;
int restlen = ic->parm.dss1_io.datalen; int restlen = ic->parm.dss1_io.datalen;
int cnt = 1; int cnt = 1;
u_char n,n1; u_char n, n1;
char st[90], *p, *stp; char st[90], *p, *stp;
if (restlen < 2) return(-100); /* frame too short */ if (restlen < 2) return (-100); /* frame too short */
if (*src++ != 0x30) return(-101); if (*src++ != 0x30) return (-101);
if ((n = *src++) > 0x81) return(-102); /* invalid length field */ if ((n = *src++) > 0x81) return (-102); /* invalid length field */
restlen -= 2; /* remaining bytes */ restlen -= 2; /* remaining bytes */
if (n == 0x80) if (n == 0x80)
{ if (restlen < 2) return(-103); { if (restlen < 2) return (-103);
if ((*(src+restlen-1)) || (*(src+restlen-2))) return(-104); if ((*(src + restlen - 1)) || (*(src + restlen - 2))) return (-104);
restlen -= 2; restlen -= 2;
} }
else else
if ( n == 0x81) if (n == 0x81)
{ n = *src++; { n = *src++;
restlen--; restlen--;
if (n > restlen) return(-105); if (n > restlen) return (-105);
restlen = n; restlen = n;
} }
else else
if (n > restlen) return(-106); if (n > restlen) return (-106);
else else
restlen = n; /* standard format */ restlen = n; /* standard format */
if (restlen < 3) return(-107); /* no procedure */ if (restlen < 3) return (-107); /* no procedure */
if ((*src++ != 2) || (*src++ != 1) || (*src++ != 0x0B)) return(-108); if ((*src++ != 2) || (*src++ != 1) || (*src++ != 0x0B)) return (-108);
restlen -= 3; restlen -= 3;
if (restlen < 2) return(-109); /* list missing */ if (restlen < 2) return (-109); /* list missing */
if (*src == 0x31) if (*src == 0x31)
{ src++; { src++;
if ((n = *src++) > 0x81) return(-110); /* invalid length field */ if ((n = *src++) > 0x81) return (-110); /* invalid length field */
restlen -= 2; /* remaining bytes */ restlen -= 2; /* remaining bytes */
if (n == 0x80) if (n == 0x80)
{ if (restlen < 2) return(-111); { if (restlen < 2) return (-111);
if ((*(src+restlen-1)) || (*(src+restlen-2))) return(-112); if ((*(src + restlen - 1)) || (*(src + restlen - 2))) return (-112);
restlen -= 2; restlen -= 2;
} }
else else
if ( n == 0x81) if (n == 0x81)
{ n = *src++; { n = *src++;
restlen--; restlen--;
if (n > restlen) return(-113); if (n > restlen) return (-113);
restlen = n; restlen = n;
} }
else else
if (n > restlen) return(-114); if (n > restlen) return (-114);
else else
restlen = n; /* standard format */ restlen = n; /* standard format */
} /* result list header */ } /* result list header */
while (restlen >= 2) while (restlen >= 2)
{ stp = st; { stp = st;
sprintf(stp,"%d 0x%lx %d %s ",DIVERT_REPORT, ic->parm.dss1_io.ll_id, sprintf(stp, "%d 0x%lx %d %s ", DIVERT_REPORT, ic->parm.dss1_io.ll_id,
cnt++,divert_if.drv_to_name(ic->driver)); cnt++, divert_if.drv_to_name(ic->driver));
stp += strlen(stp); stp += strlen(stp);
if (*src++ != 0x30) return(-115); /* invalid enum */ if (*src++ != 0x30) return (-115); /* invalid enum */
n = *src++; n = *src++;
restlen -= 2; restlen -= 2;
if (n > restlen) return(-116); /* enum length wrong */ if (n > restlen) return (-116); /* enum length wrong */
restlen -= n; restlen -= n;
p = src; /* one entry */ p = src; /* one entry */
src += n; src += n;
if (!(n1 = put_address(stp,p,n & 0xFF))) continue; if (!(n1 = put_address(stp, p, n & 0xFF))) continue;
stp += strlen(stp); stp += strlen(stp);
p += n1; p += n1;
n -= n1; n -= n1;
if (n < 6) continue; /* no service and proc */ if (n < 6) continue; /* no service and proc */
if ((*p++ != 0x0A) || (*p++ != 1)) continue; if ((*p++ != 0x0A) || (*p++ != 1)) continue;
sprintf(stp," 0x%02x ",(*p++) & 0xFF); sprintf(stp, " 0x%02x ", (*p++) & 0xFF);
stp += strlen(stp); stp += strlen(stp);
if ((*p++ != 0x0A) || (*p++ != 1)) continue; if ((*p++ != 0x0A) || (*p++ != 1)) continue;
sprintf(stp,"%d ",(*p++) & 0xFF); sprintf(stp, "%d ", (*p++) & 0xFF);
stp += strlen(stp); stp += strlen(stp);
n -= 6; n -= 6;
if (n > 2) if (n > 2)
{ if (*p++ != 0x30) continue; { if (*p++ != 0x30) continue;
if (*p > (n-2)) continue; if (*p > (n - 2)) continue;
n = *p++; n = *p++;
if (!(n1 = put_address(stp,p,n & 0xFF))) continue; if (!(n1 = put_address(stp, p, n & 0xFF))) continue;
stp += strlen(stp); stp += strlen(stp);
} }
sprintf(stp,"\n"); sprintf(stp, "\n");
put_info_buffer(st); put_info_buffer(st);
} /* while restlen */ } /* while restlen */
if (restlen) return(-117); if (restlen) return (-117);
return(0); return (0);
} /* interrogate_success */ } /* interrogate_success */
/*********************************************/ /*********************************************/
@@ -706,7 +706,7 @@ static int prot_stat_callback(isdn_ctrl *ic)
(cs->ics.parm.dss1_io.hl_id == ic->parm.dss1_io.hl_id)) (cs->ics.parm.dss1_io.hl_id == ic->parm.dss1_io.hl_id))
{ switch (ic->arg) { switch (ic->arg)
{ case DSS1_STAT_INVOKE_ERR: { case DSS1_STAT_INVOKE_ERR:
sprintf(cs->info,"128 0x%lx 0x%x\n", sprintf(cs->info, "128 0x%lx 0x%x\n",
ic->parm.dss1_io.ll_id, ic->parm.dss1_io.ll_id,
ic->parm.dss1_io.timeout); ic->parm.dss1_io.timeout);
put_info_buffer(cs->info); put_info_buffer(cs->info);
@@ -720,15 +720,15 @@ static int prot_stat_callback(isdn_ctrl *ic)
break; break;
case 11: case 11:
i = interrogate_success(ic,cs); i = interrogate_success(ic, cs);
if (i) if (i)
sprintf(cs->info,"%d 0x%lx %d\n",DIVERT_REPORT, sprintf(cs->info, "%d 0x%lx %d\n", DIVERT_REPORT,
ic->parm.dss1_io.ll_id,i); ic->parm.dss1_io.ll_id, i);
put_info_buffer(cs->info); put_info_buffer(cs->info);
break; break;
default: default:
printk(KERN_WARNING "dss1_divert: unknown proc %d\n",cs->ics.parm.dss1_io.proc); printk(KERN_WARNING "dss1_divert: unknown proc %d\n", cs->ics.parm.dss1_io.proc);
break; break;
} }
@@ -736,7 +736,7 @@ static int prot_stat_callback(isdn_ctrl *ic)
break; break;
default: default:
printk(KERN_WARNING "dss1_divert unknown invoke answer %lx\n",ic->arg); printk(KERN_WARNING "dss1_divert unknown invoke answer %lx\n", ic->arg);
break; break;
} }
cs1 = cs; /* remember structure */ cs1 = cs; /* remember structure */
@@ -750,7 +750,7 @@ static int prot_stat_callback(isdn_ctrl *ic)
break; break;
default: default:
printk(KERN_WARNING "dss1_divert unknown cmd 0x%lx\n",cs->ics.arg); printk(KERN_WARNING "dss1_divert unknown cmd 0x%lx\n", cs->ics.arg);
break; break;
} /* switch ics.arg */ } /* switch ics.arg */
cs = cs->next; cs = cs->next;
@@ -759,7 +759,7 @@ static int prot_stat_callback(isdn_ctrl *ic)
if (!cs1) if (!cs1)
{ printk(KERN_WARNING "dss1_divert unhandled process\n"); { printk(KERN_WARNING "dss1_divert unhandled process\n");
return(0); return (0);
} }
if (cs1->ics.driver == -1) if (cs1->ics.driver == -1)
@@ -776,7 +776,7 @@ static int prot_stat_callback(isdn_ctrl *ic)
kfree(cs1); kfree(cs1);
} }
return(0); return (0);
} /* prot_stat_callback */ } /* prot_stat_callback */
@@ -794,23 +794,23 @@ static int isdn_divert_stat_callback(isdn_ctrl *ic)
{ if ((ic->driver == cs->ics.driver) && (ic->arg == cs->ics.arg)) { if ((ic->driver == cs->ics.driver) && (ic->arg == cs->ics.arg))
{ switch (ic->command) { switch (ic->command)
{ case ISDN_STAT_DHUP: { case ISDN_STAT_DHUP:
sprintf(cs->info,"129 0x%lx\n",cs->divert_id); sprintf(cs->info, "129 0x%lx\n", cs->divert_id);
del_timer(&cs->timer); del_timer(&cs->timer);
cs->ics.driver = -1; cs->ics.driver = -1;
break; break;
case ISDN_STAT_CAUSE: case ISDN_STAT_CAUSE:
sprintf(cs->info,"130 0x%lx %s\n",cs->divert_id,ic->parm.num); sprintf(cs->info, "130 0x%lx %s\n", cs->divert_id, ic->parm.num);
break; break;
case ISDN_STAT_REDIR: case ISDN_STAT_REDIR:
sprintf(cs->info,"131 0x%lx\n",cs->divert_id); sprintf(cs->info, "131 0x%lx\n", cs->divert_id);
del_timer(&cs->timer); del_timer(&cs->timer);
cs->ics.driver = -1; cs->ics.driver = -1;
break; break;
default: default:
sprintf(cs->info,"999 0x%lx 0x%x\n",cs->divert_id,(int)(ic->command)); sprintf(cs->info, "999 0x%lx 0x%x\n", cs->divert_id, (int)(ic->command));
break; break;
} }
put_info_buffer(cs->info); put_info_buffer(cs->info);
@@ -831,7 +831,7 @@ static int isdn_divert_stat_callback(isdn_ctrl *ic)
kfree(cs1); kfree(cs1);
} }
} }
return(retval); /* not found */ return (retval); /* not found */
} /* isdn_divert_stat_callback */ } /* isdn_divert_stat_callback */
@@ -843,21 +843,20 @@ int ll_callback(isdn_ctrl *ic)
switch (ic->command) switch (ic->command)
{ case ISDN_STAT_ICALL: { case ISDN_STAT_ICALL:
case ISDN_STAT_ICALLW: case ISDN_STAT_ICALLW:
return(isdn_divert_icall(ic)); return (isdn_divert_icall(ic));
break; break;
case ISDN_STAT_PROT: case ISDN_STAT_PROT:
if ((ic->arg & 0xFF) == ISDN_PTYPE_EURO) if ((ic->arg & 0xFF) == ISDN_PTYPE_EURO)
{ if (ic->arg != DSS1_STAT_INVOKE_BRD) { if (ic->arg != DSS1_STAT_INVOKE_BRD)
return(prot_stat_callback(ic)); return (prot_stat_callback(ic));
else else
return(0); /* DSS1 invoke broadcast */ return (0); /* DSS1 invoke broadcast */
} }
else else
return(-1); /* protocol not euro */ return (-1); /* protocol not euro */
default: default:
return(isdn_divert_stat_callback(ic)); return (isdn_divert_stat_callback(ic));
} }
} /* ll_callback */ } /* ll_callback */

View File

@@ -25,8 +25,8 @@
#define IIOCDELRULE _IO('I', 7) /* delete a rule */ #define IIOCDELRULE _IO('I', 7) /* delete a rule */
#define IIOCDODFACT _IO('I', 8) /* hangup/reject/alert/immediately deflect a call */ #define IIOCDODFACT _IO('I', 8) /* hangup/reject/alert/immediately deflect a call */
#define IIOCDOCFACT _IO('I', 9) /* activate control forwarding in PBX */ #define IIOCDOCFACT _IO('I', 9) /* activate control forwarding in PBX */
#define IIOCDOCFDIS _IO('I',10) /* deactivate control forwarding in PBX */ #define IIOCDOCFDIS _IO('I', 10) /* deactivate control forwarding in PBX */
#define IIOCDOCFINT _IO('I',11) /* interrogate control forwarding in PBX */ #define IIOCDOCFINT _IO('I', 11) /* interrogate control forwarding in PBX */
/*************************************/ /*************************************/
/* states reported through interface */ /* states reported through interface */
@@ -44,11 +44,11 @@
#define DEFLECT_ALL_IDS 0xFFFFFFFF /* all drivers selected */ #define DEFLECT_ALL_IDS 0xFFFFFFFF /* all drivers selected */
typedef struct typedef struct
{ ulong drvid; /* driver ids, bit mapped */ { ulong drvid; /* driver ids, bit mapped */
char my_msn[35]; /* desired msn, subaddr allowed */ char my_msn[35]; /* desired msn, subaddr allowed */
char caller[35]; /* caller id, partial string with * + subaddr allowed */ char caller[35]; /* caller id, partial string with * + subaddr allowed */
char to_nr[35]; /* deflected to number incl. subaddress */ char to_nr[35]; /* deflected to number incl. subaddress */
u_char si1,si2; /* service indicators, si1=bitmask, si1+2 0 = all */ u_char si1, si2; /* service indicators, si1=bitmask, si1+2 0 = all */
u_char screen; /* screening: 0 = no info, 1 = info, 2 = nfo with nr */ u_char screen; /* screening: 0 = no info, 1 = info, 2 = nfo with nr */
u_char callopt; /* option for call handling: u_char callopt; /* option for call handling:
0 = all calls 0 = all calls
@@ -63,10 +63,10 @@ typedef struct
actions 1-2 only take place if interface is opened actions 1-2 only take place if interface is opened
*/ */
u_char waittime; /* maximum wait time for proceeding */ u_char waittime; /* maximum wait time for proceeding */
} divert_rule; } divert_rule;
typedef union typedef union
{ int drv_version; /* return of driver version */ { int drv_version; /* return of driver version */
struct struct
{ int drvid; /* id of driver */ { int drvid; /* id of driver */
char drvnam[30]; /* name of driver */ char drvnam[30]; /* name of driver */
@@ -92,7 +92,7 @@ typedef union
char msn[25]; /* desired msn, empty = all */ char msn[25]; /* desired msn, empty = all */
char fwd_nr[35];/* forwarded to number + subaddress */ char fwd_nr[35];/* forwarded to number + subaddress */
} cf_ctrl; } cf_ctrl;
} divert_ioctl; } divert_ioctl;
#ifdef __KERNEL__ #ifdef __KERNEL__
@@ -105,10 +105,10 @@ typedef union
/* structure keeping ascii info for device output */ /* structure keeping ascii info for device output */
/**************************************************/ /**************************************************/
struct divert_info struct divert_info
{ struct divert_info *next; { struct divert_info *next;
ulong usage_cnt; /* number of files still to work */ ulong usage_cnt; /* number of files still to work */
char info_start[2]; /* info string start */ char info_start[2]; /* info string start */
}; };
/**************/ /**************/

View File

@@ -543,7 +543,7 @@ static struct sk_buff *iraw_encode(struct sk_buff *skb)
/* size of new buffer (worst case = every byte must be stuffed): /* size of new buffer (worst case = every byte must be stuffed):
* 2 * original size + room for link layer header * 2 * original size + room for link layer header
*/ */
iraw_skb = dev_alloc_skb(2*skb->len + skb->mac_len); iraw_skb = dev_alloc_skb(2 * skb->len + skb->mac_len);
if (!iraw_skb) { if (!iraw_skb) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return NULL; return NULL;

View File

@@ -1017,17 +1017,17 @@ static int starturbs(struct bc_state *bcs)
} }
/* keep one URB free, submit the others */ /* keep one URB free, submit the others */
for (k = 0; k < BAS_OUTURBS-1; ++k) { for (k = 0; k < BAS_OUTURBS - 1; ++k) {
dump_urb(DEBUG_ISO, "Initial isoc write", urb); dump_urb(DEBUG_ISO, "Initial isoc write", urb);
rc = usb_submit_urb(ubc->isoouturbs[k].urb, GFP_ATOMIC); rc = usb_submit_urb(ubc->isoouturbs[k].urb, GFP_ATOMIC);
if (rc != 0) if (rc != 0)
goto error; goto error;
} }
dump_urb(DEBUG_ISO, "Initial isoc write (free)", urb); dump_urb(DEBUG_ISO, "Initial isoc write (free)", urb);
ubc->isooutfree = &ubc->isoouturbs[BAS_OUTURBS-1]; ubc->isooutfree = &ubc->isoouturbs[BAS_OUTURBS - 1];
ubc->isooutdone = ubc->isooutovfl = NULL; ubc->isooutdone = ubc->isooutovfl = NULL;
return 0; return 0;
error: error:
stopurbs(ubc); stopurbs(ubc);
return rc; return rc;
} }
@@ -2454,12 +2454,12 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
/* wait a bit for blocking conditions to go away */ /* wait a bit for blocking conditions to go away */
rc = wait_event_timeout(ucs->waitqueue, rc = wait_event_timeout(ucs->waitqueue,
!(ucs->basstate & !(ucs->basstate &
(BS_B1OPEN|BS_B2OPEN|BS_ATRDPEND|BS_ATWRPEND)), (BS_B1OPEN | BS_B2OPEN | BS_ATRDPEND | BS_ATWRPEND)),
BAS_TIMEOUT*HZ/10); BAS_TIMEOUT * HZ / 10);
gig_dbg(DEBUG_SUSPEND, "wait_event_timeout() -> %d", rc); gig_dbg(DEBUG_SUSPEND, "wait_event_timeout() -> %d", rc);
/* check for conditions preventing suspend */ /* check for conditions preventing suspend */
if (ucs->basstate & (BS_B1OPEN|BS_B2OPEN|BS_ATRDPEND|BS_ATWRPEND)) { if (ucs->basstate & (BS_B1OPEN | BS_B2OPEN | BS_ATRDPEND | BS_ATWRPEND)) {
dev_warn(cs->dev, "cannot suspend:\n"); dev_warn(cs->dev, "cannot suspend:\n");
if (ucs->basstate & BS_B1OPEN) if (ucs->basstate & BS_B1OPEN)
dev_warn(cs->dev, " B channel 1 open\n"); dev_warn(cs->dev, " B channel 1 open\n");
@@ -2482,7 +2482,7 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
return rc; return rc;
} }
wait_event_timeout(ucs->waitqueue, !ucs->pending, wait_event_timeout(ucs->waitqueue, !ucs->pending,
BAS_TIMEOUT*HZ/10); BAS_TIMEOUT * HZ / 10);
/* in case of timeout, proceed anyway */ /* in case of timeout, proceed anyway */
} }

View File

@@ -26,17 +26,17 @@
#define CapiFacilitySpecificFunctionNotSupported 0x3011 #define CapiFacilitySpecificFunctionNotSupported 0x3011
/* missing from capicmd.h */ /* missing from capicmd.h */
#define CAPI_CONNECT_IND_BASELEN (CAPI_MSG_BASELEN+4+2+8*1) #define CAPI_CONNECT_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 2 + 8 * 1)
#define CAPI_CONNECT_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN+4+3*1) #define CAPI_CONNECT_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 3 * 1)
#define CAPI_CONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN+4+1) #define CAPI_CONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 1)
#define CAPI_CONNECT_B3_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN+4+1) #define CAPI_CONNECT_B3_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 1)
#define CAPI_DATA_B3_REQ_LEN64 (CAPI_MSG_BASELEN+4+4+2+2+2+8) #define CAPI_DATA_B3_REQ_LEN64 (CAPI_MSG_BASELEN + 4 + 4 + 2 + 2 + 2 + 8)
#define CAPI_DATA_B3_CONF_LEN (CAPI_MSG_BASELEN+4+2+2) #define CAPI_DATA_B3_CONF_LEN (CAPI_MSG_BASELEN + 4 + 2 + 2)
#define CAPI_DISCONNECT_IND_LEN (CAPI_MSG_BASELEN+4+2) #define CAPI_DISCONNECT_IND_LEN (CAPI_MSG_BASELEN + 4 + 2)
#define CAPI_DISCONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN+4+2+1) #define CAPI_DISCONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 2 + 1)
#define CAPI_FACILITY_CONF_BASELEN (CAPI_MSG_BASELEN+4+2+2+1) #define CAPI_FACILITY_CONF_BASELEN (CAPI_MSG_BASELEN + 4 + 2 + 2 + 1)
/* most _CONF messages contain only Controller/PLCI/NCCI and Info parameters */ /* most _CONF messages contain only Controller/PLCI/NCCI and Info parameters */
#define CAPI_STDCONF_LEN (CAPI_MSG_BASELEN+4+2) #define CAPI_STDCONF_LEN (CAPI_MSG_BASELEN + 4 + 2)
#define CAPI_FACILITY_HANDSET 0x0000 #define CAPI_FACILITY_HANDSET 0x0000
#define CAPI_FACILITY_DTMF 0x0001 #define CAPI_FACILITY_DTMF 0x0001
@@ -97,10 +97,10 @@ struct gigaset_capi_ctr {
/* two _cmsg structures possibly used concurrently: */ /* two _cmsg structures possibly used concurrently: */
_cmsg hcmsg; /* for message composition triggered from hardware */ _cmsg hcmsg; /* for message composition triggered from hardware */
_cmsg acmsg; /* for dissection of messages sent from application */ _cmsg acmsg; /* for dissection of messages sent from application */
u8 bc_buf[MAX_BC_OCTETS+1]; u8 bc_buf[MAX_BC_OCTETS + 1];
u8 hlc_buf[MAX_HLC_OCTETS+1]; u8 hlc_buf[MAX_HLC_OCTETS + 1];
u8 cgpty_buf[MAX_NUMBER_DIGITS+3]; u8 cgpty_buf[MAX_NUMBER_DIGITS + 3];
u8 cdpty_buf[MAX_NUMBER_DIGITS+2]; u8 cdpty_buf[MAX_NUMBER_DIGITS + 2];
}; };
/* CIP Value table (from CAPI 2.0 standard, ch. 6.1) */ /* CIP Value table (from CAPI 2.0 standard, ch. 6.1) */
@@ -259,15 +259,15 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,
CAPIMSG_APPID(data), CAPIMSG_MSGID(data), l, CAPIMSG_APPID(data), CAPIMSG_MSGID(data), l,
CAPIMSG_CONTROL(data)); CAPIMSG_CONTROL(data));
l -= 12; l -= 12;
dbgline = kmalloc(3*l, GFP_ATOMIC); dbgline = kmalloc(3 * l, GFP_ATOMIC);
if (!dbgline) if (!dbgline)
return; return;
for (i = 0; i < l; i++) { for (i = 0; i < l; i++) {
dbgline[3*i] = hex_asc_hi(data[12+i]); dbgline[3 * i] = hex_asc_hi(data[12 + i]);
dbgline[3*i+1] = hex_asc_lo(data[12+i]); dbgline[3 * i + 1] = hex_asc_lo(data[12 + i]);
dbgline[3*i+2] = ' '; dbgline[3 * i + 2] = ' ';
} }
dbgline[3*l-1] = '\0'; dbgline[3 * l - 1] = '\0';
gig_dbg(level, " %s", dbgline); gig_dbg(level, " %s", dbgline);
kfree(dbgline); kfree(dbgline);
if (CAPIMSG_COMMAND(data) == CAPI_DATA_B3 && if (CAPIMSG_COMMAND(data) == CAPI_DATA_B3 &&
@@ -279,16 +279,16 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,
return; return;
if (l > 64) if (l > 64)
l = 64; /* arbitrary limit */ l = 64; /* arbitrary limit */
dbgline = kmalloc(3*l, GFP_ATOMIC); dbgline = kmalloc(3 * l, GFP_ATOMIC);
if (!dbgline) if (!dbgline)
return; return;
data += CAPIMSG_LEN(data); data += CAPIMSG_LEN(data);
for (i = 0; i < l; i++) { for (i = 0; i < l; i++) {
dbgline[3*i] = hex_asc_hi(data[i]); dbgline[3 * i] = hex_asc_hi(data[i]);
dbgline[3*i+1] = hex_asc_lo(data[i]); dbgline[3 * i + 1] = hex_asc_lo(data[i]);
dbgline[3*i+2] = ' '; dbgline[3 * i + 2] = ' ';
} }
dbgline[3*l-1] = '\0'; dbgline[3 * l - 1] = '\0';
gig_dbg(level, " %s", dbgline); gig_dbg(level, " %s", dbgline);
kfree(dbgline); kfree(dbgline);
} }
@@ -301,7 +301,7 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,
static const char *format_ie(const char *ie) static const char *format_ie(const char *ie)
{ {
static char result[3*MAX_FMT_IE_LEN]; static char result[3 * MAX_FMT_IE_LEN];
int len, count; int len, count;
char *pout = result; char *pout = result;
@@ -310,7 +310,7 @@ static const char *format_ie(const char *ie)
count = len = ie[0]; count = len = ie[0];
if (count > MAX_FMT_IE_LEN) if (count > MAX_FMT_IE_LEN)
count = MAX_FMT_IE_LEN-1; count = MAX_FMT_IE_LEN - 1;
while (count--) { while (count--) {
*pout++ = hex_asc_hi(*++ie); *pout++ = hex_asc_hi(*++ie);
*pout++ = hex_asc_lo(*ie); *pout++ = hex_asc_lo(*ie);
@@ -589,7 +589,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state)
} }
iif->cdpty_buf[0] = i + 1; iif->cdpty_buf[0] = i + 1;
iif->cdpty_buf[1] = 0x80; /* type / numbering plan unknown */ iif->cdpty_buf[1] = 0x80; /* type / numbering plan unknown */
memcpy(iif->cdpty_buf+2, at_state->str_var[STR_ZCPN], i); memcpy(iif->cdpty_buf + 2, at_state->str_var[STR_ZCPN], i);
iif->hcmsg.CalledPartyNumber = iif->cdpty_buf; iif->hcmsg.CalledPartyNumber = iif->cdpty_buf;
msgsize += iif->hcmsg.CalledPartyNumber[0]; msgsize += iif->hcmsg.CalledPartyNumber[0];
} }
@@ -605,7 +605,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state)
iif->cgpty_buf[0] = i + 2; iif->cgpty_buf[0] = i + 2;
iif->cgpty_buf[1] = 0x00; /* type / numbering plan unknown */ iif->cgpty_buf[1] = 0x00; /* type / numbering plan unknown */
iif->cgpty_buf[2] = 0x80; /* pres. allowed, not screened */ iif->cgpty_buf[2] = 0x80; /* pres. allowed, not screened */
memcpy(iif->cgpty_buf+3, at_state->str_var[STR_NMBR], i); memcpy(iif->cgpty_buf + 3, at_state->str_var[STR_NMBR], i);
iif->hcmsg.CallingPartyNumber = iif->cgpty_buf; iif->hcmsg.CallingPartyNumber = iif->cgpty_buf;
msgsize += iif->hcmsg.CallingPartyNumber[0]; msgsize += iif->hcmsg.CallingPartyNumber[0];
} }
@@ -1318,7 +1318,7 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
cmsg->adr.adrPLCI |= (bcs->channel + 1) << 8; cmsg->adr.adrPLCI |= (bcs->channel + 1) << 8;
/* build command table */ /* build command table */
commands = kzalloc(AT_NUM*(sizeof *commands), GFP_KERNEL); commands = kzalloc(AT_NUM * (sizeof *commands), GFP_KERNEL);
if (!commands) if (!commands)
goto oom; goto oom;
@@ -1353,10 +1353,10 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
commands[AT_TYPE] = kstrdup(s, GFP_KERNEL); commands[AT_TYPE] = kstrdup(s, GFP_KERNEL);
if (!commands[AT_TYPE]) if (!commands[AT_TYPE])
goto oom; goto oom;
commands[AT_DIAL] = kmalloc(l+3, GFP_KERNEL); commands[AT_DIAL] = kmalloc(l + 3, GFP_KERNEL);
if (!commands[AT_DIAL]) if (!commands[AT_DIAL])
goto oom; goto oom;
snprintf(commands[AT_DIAL], l+3, "D%.*s\r", l, pp); snprintf(commands[AT_DIAL], l + 3, "D%.*s\r", l, pp);
/* encode parameter: Calling party number */ /* encode parameter: Calling party number */
pp = cmsg->CallingPartyNumber; pp = cmsg->CallingPartyNumber;
@@ -1406,10 +1406,10 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
if (l) { if (l) {
/* number */ /* number */
commands[AT_MSN] = kmalloc(l+8, GFP_KERNEL); commands[AT_MSN] = kmalloc(l + 8, GFP_KERNEL);
if (!commands[AT_MSN]) if (!commands[AT_MSN])
goto oom; goto oom;
snprintf(commands[AT_MSN], l+8, "^SMSN=%*s\r", l, pp); snprintf(commands[AT_MSN], l + 8, "^SMSN=%*s\r", l, pp);
} }
} }
@@ -1430,13 +1430,13 @@ static void do_connect_req(struct gigaset_capi_ctr *iif,
/* determine lengths */ /* determine lengths */
if (cmsg->BC && cmsg->BC[0]) /* BC specified explicitly */ if (cmsg->BC && cmsg->BC[0]) /* BC specified explicitly */
lbc = 2*cmsg->BC[0]; lbc = 2 * cmsg->BC[0];
else if (cip2bchlc[cmsg->CIPValue].bc) /* BC derived from CIP */ else if (cip2bchlc[cmsg->CIPValue].bc) /* BC derived from CIP */
lbc = strlen(cip2bchlc[cmsg->CIPValue].bc); lbc = strlen(cip2bchlc[cmsg->CIPValue].bc);
else /* no BC */ else /* no BC */
lbc = 0; lbc = 0;
if (cmsg->HLC && cmsg->HLC[0]) /* HLC specified explicitly */ if (cmsg->HLC && cmsg->HLC[0]) /* HLC specified explicitly */
lhlc = 2*cmsg->HLC[0]; lhlc = 2 * cmsg->HLC[0];
else if (cip2bchlc[cmsg->CIPValue].hlc) /* HLC derived from CIP */ else if (cip2bchlc[cmsg->CIPValue].hlc) /* HLC derived from CIP */
lhlc = strlen(cip2bchlc[cmsg->CIPValue].hlc); lhlc = strlen(cip2bchlc[cmsg->CIPValue].hlc);
else /* no HLC */ else /* no HLC */
@@ -1669,7 +1669,7 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif,
} }
/* Accept call */ /* Accept call */
if (!gigaset_add_event(cs, &cs->bcs[channel-1].at_state, if (!gigaset_add_event(cs, &cs->bcs[channel - 1].at_state,
EV_ACCEPT, NULL, 0, NULL)) EV_ACCEPT, NULL, 0, NULL))
return; return;
gigaset_schedule_event(cs); gigaset_schedule_event(cs);
@@ -1723,7 +1723,7 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif,
/* reject call - will trigger DISCONNECT_IND for this app */ /* reject call - will trigger DISCONNECT_IND for this app */
dev_info(cs->dev, "%s: Reject=%x\n", dev_info(cs->dev, "%s: Reject=%x\n",
"CONNECT_RESP", cmsg->Reject); "CONNECT_RESP", cmsg->Reject);
if (!gigaset_add_event(cs, &cs->bcs[channel-1].at_state, if (!gigaset_add_event(cs, &cs->bcs[channel - 1].at_state,
EV_HUP, NULL, 0, NULL)) EV_HUP, NULL, 0, NULL))
return; return;
gigaset_schedule_event(cs); gigaset_schedule_event(cs);
@@ -1756,7 +1756,7 @@ static void do_connect_b3_req(struct gigaset_capi_ctr *iif,
send_conf(iif, ap, skb, CapiIllContrPlciNcci); send_conf(iif, ap, skb, CapiIllContrPlciNcci);
return; return;
} }
bcs = &cs->bcs[channel-1]; bcs = &cs->bcs[channel - 1];
/* mark logical connection active */ /* mark logical connection active */
bcs->apconnstate = APCONN_ACTIVE; bcs->apconnstate = APCONN_ACTIVE;
@@ -1801,7 +1801,7 @@ static void do_connect_b3_resp(struct gigaset_capi_ctr *iif,
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return; return;
} }
bcs = &cs->bcs[channel-1]; bcs = &cs->bcs[channel - 1];
if (cmsg->Reject) { if (cmsg->Reject) {
/* Reject: clear B3 connect received flag */ /* Reject: clear B3 connect received flag */
@@ -1947,7 +1947,7 @@ static void do_disconnect_b3_req(struct gigaset_capi_ctr *iif,
send_conf(iif, ap, skb, CapiIllContrPlciNcci); send_conf(iif, ap, skb, CapiIllContrPlciNcci);
return; return;
} }
bcs = &cs->bcs[channel-1]; bcs = &cs->bcs[channel - 1];
/* reject if logical connection not active */ /* reject if logical connection not active */
if (bcs->apconnstate < APCONN_ACTIVE) { if (bcs->apconnstate < APCONN_ACTIVE) {
@@ -1997,7 +1997,7 @@ static void do_data_b3_req(struct gigaset_capi_ctr *iif,
send_conf(iif, ap, skb, CapiIllContrPlciNcci); send_conf(iif, ap, skb, CapiIllContrPlciNcci);
return; return;
} }
bcs = &cs->bcs[channel-1]; bcs = &cs->bcs[channel - 1];
if (msglen != CAPI_DATA_B3_REQ_LEN && msglen != CAPI_DATA_B3_REQ_LEN64) if (msglen != CAPI_DATA_B3_REQ_LEN && msglen != CAPI_DATA_B3_REQ_LEN64)
dev_notice(cs->dev, "%s: unexpected length %d\n", dev_notice(cs->dev, "%s: unexpected length %d\n",
"DATA_B3_REQ", msglen); "DATA_B3_REQ", msglen);

View File

@@ -30,7 +30,7 @@
/* Module parameters */ /* Module parameters */
int gigaset_debuglevel; int gigaset_debuglevel;
EXPORT_SYMBOL_GPL(gigaset_debuglevel); EXPORT_SYMBOL_GPL(gigaset_debuglevel);
module_param_named(debug, gigaset_debuglevel, int, S_IRUGO|S_IWUSR); module_param_named(debug, gigaset_debuglevel, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "debug level"); MODULE_PARM_DESC(debug, "debug level");
/* driver state flags */ /* driver state flags */
@@ -123,7 +123,7 @@ int gigaset_enterconfigmode(struct cardstate *cs)
if (r < 0) if (r < 0)
goto error; goto error;
} }
r = setflags(cs, TIOCM_RTS|TIOCM_DTR, 800); r = setflags(cs, TIOCM_RTS | TIOCM_DTR, 800);
if (r < 0) if (r < 0)
goto error; goto error;
@@ -131,8 +131,8 @@ int gigaset_enterconfigmode(struct cardstate *cs)
error: error:
dev_err(cs->dev, "error %d on setuartbits\n", -r); dev_err(cs->dev, "error %d on setuartbits\n", -r);
cs->control_state = TIOCM_RTS|TIOCM_DTR; cs->control_state = TIOCM_RTS | TIOCM_DTR;
cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS|TIOCM_DTR); cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS | TIOCM_DTR);
return -1; return -1;
} }
@@ -591,7 +591,7 @@ int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,
if (head > tail) if (head > tail)
n = head - 1 - tail; n = head - 1 - tail;
else if (head == 0) else if (head == 0)
n = (RBUFSIZE-1) - tail; n = (RBUFSIZE - 1) - tail;
else else
n = RBUFSIZE - tail; n = RBUFSIZE - tail;
if (!n) { if (!n) {
@@ -911,10 +911,10 @@ int gigaset_start(struct cardstate *cs)
spin_unlock_irqrestore(&cs->lock, flags); spin_unlock_irqrestore(&cs->lock, flags);
if (cs->mstate != MS_LOCKED) { if (cs->mstate != MS_LOCKED) {
cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR|TIOCM_RTS); cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR | TIOCM_RTS);
cs->ops->baud_rate(cs, B115200); cs->ops->baud_rate(cs, B115200);
cs->ops->set_line_ctrl(cs, CS8); cs->ops->set_line_ctrl(cs, CS8);
cs->control_state = TIOCM_DTR|TIOCM_RTS; cs->control_state = TIOCM_DTR | TIOCM_RTS;
} }
cs->waiting = 1; cs->waiting = 1;

View File

@@ -153,104 +153,104 @@ struct reply_t gigaset_tab_nocid[] =
* action, command */ * action, command */
/* initialize device, set cid mode if possible */ /* initialize device, set cid mode if possible */
{RSP_INIT, -1, -1, SEQ_INIT, 100, 1, {ACT_TIMEOUT} }, {RSP_INIT, -1, -1, SEQ_INIT, 100, 1, {ACT_TIMEOUT} },
{EV_TIMEOUT, 100, 100, -1, 101, 3, {0}, "Z\r"}, {EV_TIMEOUT, 100, 100, -1, 101, 3, {0}, "Z\r"},
{RSP_OK, 101, 103, -1, 120, 5, {ACT_GETSTRING}, {RSP_OK, 101, 103, -1, 120, 5, {ACT_GETSTRING},
"+GMR\r"}, "+GMR\r"},
{EV_TIMEOUT, 101, 101, -1, 102, 5, {0}, "Z\r"}, {EV_TIMEOUT, 101, 101, -1, 102, 5, {0}, "Z\r"},
{RSP_ERROR, 101, 101, -1, 102, 5, {0}, "Z\r"}, {RSP_ERROR, 101, 101, -1, 102, 5, {0}, "Z\r"},
{EV_TIMEOUT, 102, 102, -1, 108, 5, {ACT_SETDLE1}, {EV_TIMEOUT, 102, 102, -1, 108, 5, {ACT_SETDLE1},
"^SDLE=0\r"}, "^SDLE=0\r"},
{RSP_OK, 108, 108, -1, 104, -1}, {RSP_OK, 108, 108, -1, 104, -1},
{RSP_ZDLE, 104, 104, 0, 103, 5, {0}, "Z\r"}, {RSP_ZDLE, 104, 104, 0, 103, 5, {0}, "Z\r"},
{EV_TIMEOUT, 104, 104, -1, 0, 0, {ACT_FAILINIT} }, {EV_TIMEOUT, 104, 104, -1, 0, 0, {ACT_FAILINIT} },
{RSP_ERROR, 108, 108, -1, 0, 0, {ACT_FAILINIT} }, {RSP_ERROR, 108, 108, -1, 0, 0, {ACT_FAILINIT} },
{EV_TIMEOUT, 108, 108, -1, 105, 2, {ACT_SETDLE0, {EV_TIMEOUT, 108, 108, -1, 105, 2, {ACT_SETDLE0,
ACT_HUPMODEM, ACT_HUPMODEM,
ACT_TIMEOUT} }, ACT_TIMEOUT} },
{EV_TIMEOUT, 105, 105, -1, 103, 5, {0}, "Z\r"}, {EV_TIMEOUT, 105, 105, -1, 103, 5, {0}, "Z\r"},
{RSP_ERROR, 102, 102, -1, 107, 5, {0}, "^GETPRE\r"}, {RSP_ERROR, 102, 102, -1, 107, 5, {0}, "^GETPRE\r"},
{RSP_OK, 107, 107, -1, 0, 0, {ACT_CONFIGMODE} }, {RSP_OK, 107, 107, -1, 0, 0, {ACT_CONFIGMODE} },
{RSP_ERROR, 107, 107, -1, 0, 0, {ACT_FAILINIT} }, {RSP_ERROR, 107, 107, -1, 0, 0, {ACT_FAILINIT} },
{EV_TIMEOUT, 107, 107, -1, 0, 0, {ACT_FAILINIT} }, {EV_TIMEOUT, 107, 107, -1, 0, 0, {ACT_FAILINIT} },
{RSP_ERROR, 103, 103, -1, 0, 0, {ACT_FAILINIT} }, {RSP_ERROR, 103, 103, -1, 0, 0, {ACT_FAILINIT} },
{EV_TIMEOUT, 103, 103, -1, 0, 0, {ACT_FAILINIT} }, {EV_TIMEOUT, 103, 103, -1, 0, 0, {ACT_FAILINIT} },
{RSP_STRING, 120, 120, -1, 121, -1, {ACT_SETVER} }, {RSP_STRING, 120, 120, -1, 121, -1, {ACT_SETVER} },
{EV_TIMEOUT, 120, 121, -1, 0, 0, {ACT_FAILVER, {EV_TIMEOUT, 120, 121, -1, 0, 0, {ACT_FAILVER,
ACT_INIT} }, ACT_INIT} },
{RSP_ERROR, 120, 121, -1, 0, 0, {ACT_FAILVER, {RSP_ERROR, 120, 121, -1, 0, 0, {ACT_FAILVER,
ACT_INIT} }, ACT_INIT} },
{RSP_OK, 121, 121, -1, 0, 0, {ACT_GOTVER, {RSP_OK, 121, 121, -1, 0, 0, {ACT_GOTVER,
ACT_INIT} }, ACT_INIT} },
/* leave dle mode */ /* leave dle mode */
{RSP_INIT, 0, 0, SEQ_DLE0, 201, 5, {0}, "^SDLE=0\r"}, {RSP_INIT, 0, 0, SEQ_DLE0, 201, 5, {0}, "^SDLE=0\r"},
{RSP_OK, 201, 201, -1, 202, -1}, {RSP_OK, 201, 201, -1, 202, -1},
{RSP_ZDLE, 202, 202, 0, 0, 0, {ACT_DLE0} }, {RSP_ZDLE, 202, 202, 0, 0, 0, {ACT_DLE0} },
{RSP_NODEV, 200, 249, -1, 0, 0, {ACT_FAKEDLE0} }, {RSP_NODEV, 200, 249, -1, 0, 0, {ACT_FAKEDLE0} },
{RSP_ERROR, 200, 249, -1, 0, 0, {ACT_FAILDLE0} }, {RSP_ERROR, 200, 249, -1, 0, 0, {ACT_FAILDLE0} },
{EV_TIMEOUT, 200, 249, -1, 0, 0, {ACT_FAILDLE0} }, {EV_TIMEOUT, 200, 249, -1, 0, 0, {ACT_FAILDLE0} },
/* enter dle mode */ /* enter dle mode */
{RSP_INIT, 0, 0, SEQ_DLE1, 251, 5, {0}, "^SDLE=1\r"}, {RSP_INIT, 0, 0, SEQ_DLE1, 251, 5, {0}, "^SDLE=1\r"},
{RSP_OK, 251, 251, -1, 252, -1}, {RSP_OK, 251, 251, -1, 252, -1},
{RSP_ZDLE, 252, 252, 1, 0, 0, {ACT_DLE1} }, {RSP_ZDLE, 252, 252, 1, 0, 0, {ACT_DLE1} },
{RSP_ERROR, 250, 299, -1, 0, 0, {ACT_FAILDLE1} }, {RSP_ERROR, 250, 299, -1, 0, 0, {ACT_FAILDLE1} },
{EV_TIMEOUT, 250, 299, -1, 0, 0, {ACT_FAILDLE1} }, {EV_TIMEOUT, 250, 299, -1, 0, 0, {ACT_FAILDLE1} },
/* incoming call */ /* incoming call */
{RSP_RING, -1, -1, -1, -1, -1, {ACT_RING} }, {RSP_RING, -1, -1, -1, -1, -1, {ACT_RING} },
/* get cid */ /* get cid */
{RSP_INIT, 0, 0, SEQ_CID, 301, 5, {0}, "^SGCI?\r"}, {RSP_INIT, 0, 0, SEQ_CID, 301, 5, {0}, "^SGCI?\r"},
{RSP_OK, 301, 301, -1, 302, -1}, {RSP_OK, 301, 301, -1, 302, -1},
{RSP_ZGCI, 302, 302, -1, 0, 0, {ACT_CID} }, {RSP_ZGCI, 302, 302, -1, 0, 0, {ACT_CID} },
{RSP_ERROR, 301, 349, -1, 0, 0, {ACT_FAILCID} }, {RSP_ERROR, 301, 349, -1, 0, 0, {ACT_FAILCID} },
{EV_TIMEOUT, 301, 349, -1, 0, 0, {ACT_FAILCID} }, {EV_TIMEOUT, 301, 349, -1, 0, 0, {ACT_FAILCID} },
/* enter cid mode */ /* enter cid mode */
{RSP_INIT, 0, 0, SEQ_CIDMODE, 150, 5, {0}, "^SGCI=1\r"}, {RSP_INIT, 0, 0, SEQ_CIDMODE, 150, 5, {0}, "^SGCI=1\r"},
{RSP_OK, 150, 150, -1, 0, 0, {ACT_CMODESET} }, {RSP_OK, 150, 150, -1, 0, 0, {ACT_CMODESET} },
{RSP_ERROR, 150, 150, -1, 0, 0, {ACT_FAILCMODE} }, {RSP_ERROR, 150, 150, -1, 0, 0, {ACT_FAILCMODE} },
{EV_TIMEOUT, 150, 150, -1, 0, 0, {ACT_FAILCMODE} }, {EV_TIMEOUT, 150, 150, -1, 0, 0, {ACT_FAILCMODE} },
/* leave cid mode */ /* leave cid mode */
{RSP_INIT, 0, 0, SEQ_UMMODE, 160, 5, {0}, "Z\r"}, {RSP_INIT, 0, 0, SEQ_UMMODE, 160, 5, {0}, "Z\r"},
{RSP_OK, 160, 160, -1, 0, 0, {ACT_UMODESET} }, {RSP_OK, 160, 160, -1, 0, 0, {ACT_UMODESET} },
{RSP_ERROR, 160, 160, -1, 0, 0, {ACT_FAILUMODE} }, {RSP_ERROR, 160, 160, -1, 0, 0, {ACT_FAILUMODE} },
{EV_TIMEOUT, 160, 160, -1, 0, 0, {ACT_FAILUMODE} }, {EV_TIMEOUT, 160, 160, -1, 0, 0, {ACT_FAILUMODE} },
/* abort getting cid */ /* abort getting cid */
{RSP_INIT, 0, 0, SEQ_NOCID, 0, 0, {ACT_ABORTCID} }, {RSP_INIT, 0, 0, SEQ_NOCID, 0, 0, {ACT_ABORTCID} },
/* reset */ /* reset */
{RSP_INIT, 0, 0, SEQ_SHUTDOWN, 504, 5, {0}, "Z\r"}, {RSP_INIT, 0, 0, SEQ_SHUTDOWN, 504, 5, {0}, "Z\r"},
{RSP_OK, 504, 504, -1, 0, 0, {ACT_SDOWN} }, {RSP_OK, 504, 504, -1, 0, 0, {ACT_SDOWN} },
{RSP_ERROR, 501, 599, -1, 0, 0, {ACT_FAILSDOWN} }, {RSP_ERROR, 501, 599, -1, 0, 0, {ACT_FAILSDOWN} },
{EV_TIMEOUT, 501, 599, -1, 0, 0, {ACT_FAILSDOWN} }, {EV_TIMEOUT, 501, 599, -1, 0, 0, {ACT_FAILSDOWN} },
{RSP_NODEV, 501, 599, -1, 0, 0, {ACT_FAKESDOWN} }, {RSP_NODEV, 501, 599, -1, 0, 0, {ACT_FAKESDOWN} },
{EV_PROC_CIDMODE, -1, -1, -1, -1, -1, {ACT_PROC_CIDMODE} }, {EV_PROC_CIDMODE, -1, -1, -1, -1, -1, {ACT_PROC_CIDMODE} },
{EV_IF_LOCK, -1, -1, -1, -1, -1, {ACT_IF_LOCK} }, {EV_IF_LOCK, -1, -1, -1, -1, -1, {ACT_IF_LOCK} },
{EV_IF_VER, -1, -1, -1, -1, -1, {ACT_IF_VER} }, {EV_IF_VER, -1, -1, -1, -1, -1, {ACT_IF_VER} },
{EV_START, -1, -1, -1, -1, -1, {ACT_START} }, {EV_START, -1, -1, -1, -1, -1, {ACT_START} },
{EV_STOP, -1, -1, -1, -1, -1, {ACT_STOP} }, {EV_STOP, -1, -1, -1, -1, -1, {ACT_STOP} },
{EV_SHUTDOWN, -1, -1, -1, -1, -1, {ACT_SHUTDOWN} }, {EV_SHUTDOWN, -1, -1, -1, -1, -1, {ACT_SHUTDOWN} },
/* misc. */ /* misc. */
{RSP_ERROR, -1, -1, -1, -1, -1, {ACT_ERROR} }, {RSP_ERROR, -1, -1, -1, -1, -1, {ACT_ERROR} },
{RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} }, {RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} },
{RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} }, {RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} },
{RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} }, {RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} },
{RSP_LAST} {RSP_LAST}
}; };
/* 600: start dialing, 650: dial in progress, 800: connection is up, 700: ring, /* 600: start dialing, 650: dial in progress, 800: connection is up, 700: ring,
@@ -261,91 +261,91 @@ struct reply_t gigaset_tab_cid[] =
* action, command */ * action, command */
/* dial */ /* dial */
{EV_DIAL, -1, -1, -1, -1, -1, {ACT_DIAL} }, {EV_DIAL, -1, -1, -1, -1, -1, {ACT_DIAL} },
{RSP_INIT, 0, 0, SEQ_DIAL, 601, 5, {ACT_CMD+AT_BC} }, {RSP_INIT, 0, 0, SEQ_DIAL, 601, 5, {ACT_CMD + AT_BC} },
{RSP_OK, 601, 601, -1, 603, 5, {ACT_CMD+AT_PROTO} }, {RSP_OK, 601, 601, -1, 603, 5, {ACT_CMD + AT_PROTO} },
{RSP_OK, 603, 603, -1, 604, 5, {ACT_CMD+AT_TYPE} }, {RSP_OK, 603, 603, -1, 604, 5, {ACT_CMD + AT_TYPE} },
{RSP_OK, 604, 604, -1, 605, 5, {ACT_CMD+AT_MSN} }, {RSP_OK, 604, 604, -1, 605, 5, {ACT_CMD + AT_MSN} },
{RSP_NULL, 605, 605, -1, 606, 5, {ACT_CMD+AT_CLIP} }, {RSP_NULL, 605, 605, -1, 606, 5, {ACT_CMD + AT_CLIP} },
{RSP_OK, 605, 605, -1, 606, 5, {ACT_CMD+AT_CLIP} }, {RSP_OK, 605, 605, -1, 606, 5, {ACT_CMD + AT_CLIP} },
{RSP_NULL, 606, 606, -1, 607, 5, {ACT_CMD+AT_ISO} }, {RSP_NULL, 606, 606, -1, 607, 5, {ACT_CMD + AT_ISO} },
{RSP_OK, 606, 606, -1, 607, 5, {ACT_CMD+AT_ISO} }, {RSP_OK, 606, 606, -1, 607, 5, {ACT_CMD + AT_ISO} },
{RSP_OK, 607, 607, -1, 608, 5, {0}, "+VLS=17\r"}, {RSP_OK, 607, 607, -1, 608, 5, {0}, "+VLS=17\r"},
{RSP_OK, 608, 608, -1, 609, -1}, {RSP_OK, 608, 608, -1, 609, -1},
{RSP_ZSAU, 609, 609, ZSAU_PROCEEDING, 610, 5, {ACT_CMD+AT_DIAL} }, {RSP_ZSAU, 609, 609, ZSAU_PROCEEDING, 610, 5, {ACT_CMD + AT_DIAL} },
{RSP_OK, 610, 610, -1, 650, 0, {ACT_DIALING} }, {RSP_OK, 610, 610, -1, 650, 0, {ACT_DIALING} },
{RSP_ERROR, 601, 610, -1, 0, 0, {ACT_ABORTDIAL} }, {RSP_ERROR, 601, 610, -1, 0, 0, {ACT_ABORTDIAL} },
{EV_TIMEOUT, 601, 610, -1, 0, 0, {ACT_ABORTDIAL} }, {EV_TIMEOUT, 601, 610, -1, 0, 0, {ACT_ABORTDIAL} },
/* optional dialing responses */ /* optional dialing responses */
{EV_BC_OPEN, 650, 650, -1, 651, -1}, {EV_BC_OPEN, 650, 650, -1, 651, -1},
{RSP_ZVLS, 609, 651, 17, -1, -1, {ACT_DEBUG} }, {RSP_ZVLS, 609, 651, 17, -1, -1, {ACT_DEBUG} },
{RSP_ZCTP, 610, 651, -1, -1, -1, {ACT_DEBUG} }, {RSP_ZCTP, 610, 651, -1, -1, -1, {ACT_DEBUG} },
{RSP_ZCPN, 610, 651, -1, -1, -1, {ACT_DEBUG} }, {RSP_ZCPN, 610, 651, -1, -1, -1, {ACT_DEBUG} },
{RSP_ZSAU, 650, 651, ZSAU_CALL_DELIVERED, -1, -1, {ACT_DEBUG} }, {RSP_ZSAU, 650, 651, ZSAU_CALL_DELIVERED, -1, -1, {ACT_DEBUG} },
/* connect */ /* connect */
{RSP_ZSAU, 650, 650, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT} }, {RSP_ZSAU, 650, 650, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT} },
{RSP_ZSAU, 651, 651, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT, {RSP_ZSAU, 651, 651, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT,
ACT_NOTIFY_BC_UP} }, ACT_NOTIFY_BC_UP} },
{RSP_ZSAU, 750, 750, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT} }, {RSP_ZSAU, 750, 750, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT} },
{RSP_ZSAU, 751, 751, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT, {RSP_ZSAU, 751, 751, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT,
ACT_NOTIFY_BC_UP} }, ACT_NOTIFY_BC_UP} },
{EV_BC_OPEN, 800, 800, -1, 800, -1, {ACT_NOTIFY_BC_UP} }, {EV_BC_OPEN, 800, 800, -1, 800, -1, {ACT_NOTIFY_BC_UP} },
/* remote hangup */ /* remote hangup */
{RSP_ZSAU, 650, 651, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEREJECT} }, {RSP_ZSAU, 650, 651, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEREJECT} },
{RSP_ZSAU, 750, 751, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP} }, {RSP_ZSAU, 750, 751, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP} },
{RSP_ZSAU, 800, 800, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP} }, {RSP_ZSAU, 800, 800, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP} },
/* hangup */ /* hangup */
{EV_HUP, -1, -1, -1, -1, -1, {ACT_HUP} }, {EV_HUP, -1, -1, -1, -1, -1, {ACT_HUP} },
{RSP_INIT, -1, -1, SEQ_HUP, 401, 5, {0}, "+VLS=0\r"}, {RSP_INIT, -1, -1, SEQ_HUP, 401, 5, {0}, "+VLS=0\r"},
{RSP_OK, 401, 401, -1, 402, 5}, {RSP_OK, 401, 401, -1, 402, 5},
{RSP_ZVLS, 402, 402, 0, 403, 5}, {RSP_ZVLS, 402, 402, 0, 403, 5},
{RSP_ZSAU, 403, 403, ZSAU_DISCONNECT_REQ, -1, -1, {ACT_DEBUG} }, {RSP_ZSAU, 403, 403, ZSAU_DISCONNECT_REQ, -1, -1, {ACT_DEBUG} },
{RSP_ZSAU, 403, 403, ZSAU_NULL, 0, 0, {ACT_DISCONNECT} }, {RSP_ZSAU, 403, 403, ZSAU_NULL, 0, 0, {ACT_DISCONNECT} },
{RSP_NODEV, 401, 403, -1, 0, 0, {ACT_FAKEHUP} }, {RSP_NODEV, 401, 403, -1, 0, 0, {ACT_FAKEHUP} },
{RSP_ERROR, 401, 401, -1, 0, 0, {ACT_ABORTHUP} }, {RSP_ERROR, 401, 401, -1, 0, 0, {ACT_ABORTHUP} },
{EV_TIMEOUT, 401, 403, -1, 0, 0, {ACT_ABORTHUP} }, {EV_TIMEOUT, 401, 403, -1, 0, 0, {ACT_ABORTHUP} },
{EV_BC_CLOSED, 0, 0, -1, 0, -1, {ACT_NOTIFY_BC_DOWN} }, {EV_BC_CLOSED, 0, 0, -1, 0, -1, {ACT_NOTIFY_BC_DOWN} },
/* ring */ /* ring */
{RSP_ZBC, 700, 700, -1, -1, -1, {0} }, {RSP_ZBC, 700, 700, -1, -1, -1, {0} },
{RSP_ZHLC, 700, 700, -1, -1, -1, {0} }, {RSP_ZHLC, 700, 700, -1, -1, -1, {0} },
{RSP_NMBR, 700, 700, -1, -1, -1, {0} }, {RSP_NMBR, 700, 700, -1, -1, -1, {0} },
{RSP_ZCPN, 700, 700, -1, -1, -1, {0} }, {RSP_ZCPN, 700, 700, -1, -1, -1, {0} },
{RSP_ZCTP, 700, 700, -1, -1, -1, {0} }, {RSP_ZCTP, 700, 700, -1, -1, -1, {0} },
{EV_TIMEOUT, 700, 700, -1, 720, 720, {ACT_ICALL} }, {EV_TIMEOUT, 700, 700, -1, 720, 720, {ACT_ICALL} },
{EV_BC_CLOSED, 720, 720, -1, 0, -1, {ACT_NOTIFY_BC_DOWN} }, {EV_BC_CLOSED, 720, 720, -1, 0, -1, {ACT_NOTIFY_BC_DOWN} },
/*accept icall*/ /*accept icall*/
{EV_ACCEPT, -1, -1, -1, -1, -1, {ACT_ACCEPT} }, {EV_ACCEPT, -1, -1, -1, -1, -1, {ACT_ACCEPT} },
{RSP_INIT, 720, 720, SEQ_ACCEPT, 721, 5, {ACT_CMD+AT_PROTO} }, {RSP_INIT, 720, 720, SEQ_ACCEPT, 721, 5, {ACT_CMD + AT_PROTO} },
{RSP_OK, 721, 721, -1, 722, 5, {ACT_CMD+AT_ISO} }, {RSP_OK, 721, 721, -1, 722, 5, {ACT_CMD + AT_ISO} },
{RSP_OK, 722, 722, -1, 723, 5, {0}, "+VLS=17\r"}, {RSP_OK, 722, 722, -1, 723, 5, {0}, "+VLS=17\r"},
{RSP_OK, 723, 723, -1, 724, 5, {0} }, {RSP_OK, 723, 723, -1, 724, 5, {0} },
{RSP_ZVLS, 724, 724, 17, 750, 50, {ACT_ACCEPTED} }, {RSP_ZVLS, 724, 724, 17, 750, 50, {ACT_ACCEPTED} },
{RSP_ERROR, 721, 729, -1, 0, 0, {ACT_ABORTACCEPT} }, {RSP_ERROR, 721, 729, -1, 0, 0, {ACT_ABORTACCEPT} },
{EV_TIMEOUT, 721, 729, -1, 0, 0, {ACT_ABORTACCEPT} }, {EV_TIMEOUT, 721, 729, -1, 0, 0, {ACT_ABORTACCEPT} },
{RSP_ZSAU, 700, 729, ZSAU_NULL, 0, 0, {ACT_ABORTACCEPT} }, {RSP_ZSAU, 700, 729, ZSAU_NULL, 0, 0, {ACT_ABORTACCEPT} },
{RSP_ZSAU, 700, 729, ZSAU_ACTIVE, 0, 0, {ACT_ABORTACCEPT} }, {RSP_ZSAU, 700, 729, ZSAU_ACTIVE, 0, 0, {ACT_ABORTACCEPT} },
{RSP_ZSAU, 700, 729, ZSAU_DISCONNECT_IND, 0, 0, {ACT_ABORTACCEPT} }, {RSP_ZSAU, 700, 729, ZSAU_DISCONNECT_IND, 0, 0, {ACT_ABORTACCEPT} },
{EV_BC_OPEN, 750, 750, -1, 751, -1}, {EV_BC_OPEN, 750, 750, -1, 751, -1},
{EV_TIMEOUT, 750, 751, -1, 0, 0, {ACT_CONNTIMEOUT} }, {EV_TIMEOUT, 750, 751, -1, 0, 0, {ACT_CONNTIMEOUT} },
/* B channel closed (general case) */ /* B channel closed (general case) */
{EV_BC_CLOSED, -1, -1, -1, -1, -1, {ACT_NOTIFY_BC_DOWN} }, {EV_BC_CLOSED, -1, -1, -1, -1, -1, {ACT_NOTIFY_BC_DOWN} },
/* misc. */ /* misc. */
{RSP_ZCON, -1, -1, -1, -1, -1, {ACT_DEBUG} }, {RSP_ZCON, -1, -1, -1, -1, -1, {ACT_DEBUG} },
{RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} }, {RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} },
{RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} }, {RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} },
{RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} }, {RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} },
{RSP_LAST} {RSP_LAST}
}; };
@@ -461,7 +461,7 @@ void gigaset_handle_modem_response(struct cardstate *cs)
} }
rawstring = 0; rawstring = 0;
cid = params > 1 ? cid_of_response(argv[params-1]) : 0; cid = params > 1 ? cid_of_response(argv[params - 1]) : 0;
if (cid < 0) { if (cid < 0) {
gigaset_add_event(cs, &cs->at_state, RSP_INVAL, gigaset_add_event(cs, &cs->at_state, RSP_INVAL,
NULL, 0, NULL); NULL, 0, NULL);

View File

@@ -164,7 +164,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
#define BAS_CORRFRAMES 4 /* flow control multiplicator */ #define BAS_CORRFRAMES 4 /* flow control multiplicator */
#define BAS_INBUFSIZE (BAS_MAXFRAME * BAS_NUMFRAMES) #define BAS_INBUFSIZE (BAS_MAXFRAME * BAS_NUMFRAMES)
/* size of isoc in buf per URB */ /* size of isoc in buf per URB */
#define BAS_OUTBUFSIZE 4096 /* size of common isoc out buffer */ #define BAS_OUTBUFSIZE 4096 /* size of common isoc out buffer */
#define BAS_OUTBUFPAD BAS_MAXFRAME /* size of pad area for isoc out buf */ #define BAS_OUTBUFPAD BAS_MAXFRAME /* size of pad area for isoc out buf */
@@ -491,7 +491,7 @@ struct cardstate {
spinlock_t ev_lock; spinlock_t ev_lock;
/* current modem response */ /* current modem response */
unsigned char respdata[MAX_RESP_SIZE+1]; unsigned char respdata[MAX_RESP_SIZE + 1];
unsigned cbytes; unsigned cbytes;
/* private data of hardware drivers */ /* private data of hardware drivers */

View File

@@ -243,7 +243,7 @@ static int command_from_LL(isdn_ctrl *cntrl)
dev_kfree_skb(bcs->rx_skb); dev_kfree_skb(bcs->rx_skb);
gigaset_new_rx_skb(bcs); gigaset_new_rx_skb(bcs);
commands = kzalloc(AT_NUM*(sizeof *commands), GFP_ATOMIC); commands = kzalloc(AT_NUM * (sizeof *commands), GFP_ATOMIC);
if (!commands) { if (!commands) {
gigaset_free_channel(bcs); gigaset_free_channel(bcs);
dev_err(cs->dev, "ISDN_CMD_DIAL: out of memory\n"); dev_err(cs->dev, "ISDN_CMD_DIAL: out of memory\n");
@@ -261,7 +261,7 @@ static int command_from_LL(isdn_ctrl *cntrl)
if (!commands[AT_TYPE]) if (!commands[AT_TYPE])
goto oom; goto oom;
snprintf(commands[AT_DIAL], l, snprintf(commands[AT_DIAL], l,
"D%s\r", cntrl->parm.setup.phone+2); "D%s\r", cntrl->parm.setup.phone + 2);
} else { } else {
commands[AT_TYPE] = kstrdup("^SCTP=1\r", GFP_ATOMIC); commands[AT_TYPE] = kstrdup("^SCTP=1\r", GFP_ATOMIC);
if (!commands[AT_TYPE]) if (!commands[AT_TYPE])

View File

@@ -33,10 +33,10 @@ static int if_lock(struct cardstate *cs, int *arg)
} }
if (!cmd && cs->mstate == MS_LOCKED && cs->connected) { if (!cmd && cs->mstate == MS_LOCKED && cs->connected) {
cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR|TIOCM_RTS); cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR | TIOCM_RTS);
cs->ops->baud_rate(cs, B115200); cs->ops->baud_rate(cs, B115200);
cs->ops->set_line_ctrl(cs, CS8); cs->ops->set_line_ctrl(cs, CS8);
cs->control_state = TIOCM_DTR|TIOCM_RTS; cs->control_state = TIOCM_DTR | TIOCM_RTS;
} }
cs->waiting = 1; cs->waiting = 1;
@@ -299,7 +299,7 @@ static int if_tiocmget(struct tty_struct *tty)
if (mutex_lock_interruptible(&cs->mutex)) if (mutex_lock_interruptible(&cs->mutex))
return -ERESTARTSYS; return -ERESTARTSYS;
retval = cs->control_state & (TIOCM_RTS|TIOCM_DTR); retval = cs->control_state & (TIOCM_RTS | TIOCM_DTR);
mutex_unlock(&cs->mutex); mutex_unlock(&cs->mutex);
@@ -329,7 +329,7 @@ static int if_tiocmset(struct tty_struct *tty,
gig_dbg(DEBUG_IF, "not connected"); gig_dbg(DEBUG_IF, "not connected");
retval = -ENODEV; retval = -ENODEV;
} else { } else {
mc = (cs->control_state | set) & ~clear & (TIOCM_RTS|TIOCM_DTR); mc = (cs->control_state | set) & ~clear & (TIOCM_RTS | TIOCM_DTR);
retval = cs->ops->set_modem_ctrl(cs, cs->control_state, mc); retval = cs->ops->set_modem_ctrl(cs, cs->control_state, mc);
cs->control_state = mc; cs->control_state = mc;
} }

View File

@@ -56,7 +56,7 @@ static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr,
return count; return count;
} }
static DEVICE_ATTR(cidmode, S_IRUGO|S_IWUSR, show_cidmode, set_cidmode); static DEVICE_ATTR(cidmode, S_IRUGO | S_IWUSR, show_cidmode, set_cidmode);
/* free sysfs for device */ /* free sysfs for device */
void gigaset_free_dev_sysfs(struct cardstate *cs) void gigaset_free_dev_sysfs(struct cardstate *cs)

View File

@@ -264,7 +264,7 @@ static inline void b1_put_byte(unsigned int base, unsigned char val)
static inline int b1_save_put_byte(unsigned int base, unsigned char val) static inline int b1_save_put_byte(unsigned int base, unsigned char val)
{ {
unsigned long stop = jiffies + 2 * HZ; unsigned long stop = jiffies + 2 * HZ;
while (!b1_tx_empty(base) && time_before(jiffies,stop)); while (!b1_tx_empty(base) && time_before(jiffies, stop));
if (!b1_tx_empty(base)) return -1; if (!b1_tx_empty(base)) return -1;
b1outp(base, B1_WRITE, val); b1outp(base, B1_WRITE, val);
return 0; return 0;
@@ -418,20 +418,20 @@ static inline unsigned int t1_get_slice(unsigned int base,
if (t1_isfastlink(base)) { if (t1_isfastlink(base)) {
int status; int status;
while (i > 0) { while (i > 0) {
status = t1_fifostatus(base) & (T1F_IREADY|T1F_IHALF); status = t1_fifostatus(base) & (T1F_IREADY | T1F_IHALF);
if (i >= FIFO_INPBSIZE) status |= T1F_IFULL; if (i >= FIFO_INPBSIZE) status |= T1F_IFULL;
switch (status) { switch (status) {
case T1F_IREADY|T1F_IHALF|T1F_IFULL: case T1F_IREADY | T1F_IHALF | T1F_IFULL:
insb(base+B1_READ, dp, FIFO_INPBSIZE); insb(base + B1_READ, dp, FIFO_INPBSIZE);
dp += FIFO_INPBSIZE; dp += FIFO_INPBSIZE;
i -= FIFO_INPBSIZE; i -= FIFO_INPBSIZE;
#ifdef FASTLINK_DEBUG #ifdef FASTLINK_DEBUG
wcnt += FIFO_INPBSIZE; wcnt += FIFO_INPBSIZE;
#endif #endif
break; break;
case T1F_IREADY|T1F_IHALF: case T1F_IREADY | T1F_IHALF:
insb(base+B1_READ,dp, i); insb(base + B1_READ, dp, i);
#ifdef FASTLINK_DEBUG #ifdef FASTLINK_DEBUG
wcnt += i; wcnt += i;
#endif #endif
@@ -467,16 +467,16 @@ static inline void t1_put_slice(unsigned int base,
if (t1_isfastlink(base)) { if (t1_isfastlink(base)) {
int status; int status;
while (i > 0) { while (i > 0) {
status = t1_fifostatus(base) & (T1F_OREADY|T1F_OHALF); status = t1_fifostatus(base) & (T1F_OREADY | T1F_OHALF);
if (i >= FIFO_OUTBSIZE) status |= T1F_OEMPTY; if (i >= FIFO_OUTBSIZE) status |= T1F_OEMPTY;
switch (status) { switch (status) {
case T1F_OREADY|T1F_OHALF|T1F_OEMPTY: case T1F_OREADY | T1F_OHALF | T1F_OEMPTY:
outsb(base+B1_WRITE, dp, FIFO_OUTBSIZE); outsb(base + B1_WRITE, dp, FIFO_OUTBSIZE);
dp += FIFO_OUTBSIZE; dp += FIFO_OUTBSIZE;
i -= FIFO_OUTBSIZE; i -= FIFO_OUTBSIZE;
break; break;
case T1F_OREADY|T1F_OHALF: case T1F_OREADY | T1F_OHALF:
outsb(base+B1_WRITE, dp, i); outsb(base + B1_WRITE, dp, i);
dp += i; dp += i;
i = 0; i = 0;
break; break;
@@ -543,8 +543,8 @@ avmcard *b1_alloc_card(int nr_controllers);
void b1_free_card(avmcard *card); void b1_free_card(avmcard *card);
int b1_detect(unsigned int base, enum avmcardtype cardtype); int b1_detect(unsigned int base, enum avmcardtype cardtype);
void b1_getrevision(avmcard *card); void b1_getrevision(avmcard *card);
int b1_load_t4file(avmcard *card, capiloaddatapart * t4file); int b1_load_t4file(avmcard *card, capiloaddatapart *t4file);
int b1_load_config(avmcard *card, capiloaddatapart * config); int b1_load_config(avmcard *card, capiloaddatapart *config);
int b1_loaded(avmcard *card); int b1_loaded(avmcard *card);
int b1_load_firmware(struct capi_ctr *ctrl, capiloaddata *data); int b1_load_firmware(struct capi_ctr *ctrl, capiloaddata *data);

View File

@@ -126,7 +126,7 @@ int b1_detect(unsigned int base, enum avmcardtype cardtype)
|| (inb(base + B1_OUTSTAT) & 0xfe)) || (inb(base + B1_OUTSTAT) & 0xfe))
return 3; return 3;
for (onoff = !0, i= 0; i < 10 ; i++) { for (onoff = !0, i = 0; i < 10; i++) {
b1_set_test_bit(base, cardtype, onoff); b1_set_test_bit(base, cardtype, onoff);
if (b1_get_test_bit(base, cardtype) != onoff) if (b1_get_test_bit(base, cardtype) != onoff)
return 4; return 4;
@@ -149,7 +149,7 @@ void b1_getrevision(avmcard *card)
} }
#define FWBUF_SIZE 256 #define FWBUF_SIZE 256
int b1_load_t4file(avmcard *card, capiloaddatapart * t4file) int b1_load_t4file(avmcard *card, capiloaddatapart *t4file)
{ {
unsigned char buf[FWBUF_SIZE]; unsigned char buf[FWBUF_SIZE];
unsigned char *dp; unsigned char *dp;
@@ -191,7 +191,7 @@ int b1_load_t4file(avmcard *card, capiloaddatapart * t4file)
return 0; return 0;
} }
int b1_load_config(avmcard *card, capiloaddatapart * config) int b1_load_config(avmcard *card, capiloaddatapart *config)
{ {
unsigned char buf[FWBUF_SIZE]; unsigned char buf[FWBUF_SIZE];
unsigned char *dp; unsigned char *dp;
@@ -215,7 +215,7 @@ int b1_load_config(avmcard *card, capiloaddatapart * config)
} }
for (i = 0; i < FWBUF_SIZE; ) { for (i = 0; i < FWBUF_SIZE; ) {
b1_put_byte(base, SEND_CONFIG); b1_put_byte(base, SEND_CONFIG);
for (j=0; j < 4; j++) { for (j = 0; j < 4; j++) {
b1_put_byte(base, buf[i++]); b1_put_byte(base, buf[i++]);
} }
} }
@@ -231,7 +231,7 @@ int b1_load_config(avmcard *card, capiloaddatapart * config)
} }
for (i = 0; i < left; ) { for (i = 0; i < left; ) {
b1_put_byte(base, SEND_CONFIG); b1_put_byte(base, SEND_CONFIG);
for (j=0; j < 4; j++) { for (j = 0; j < 4; j++) {
if (i < left) if (i < left)
b1_put_byte(base, buf[i++]); b1_put_byte(base, buf[i++]);
else else
@@ -312,7 +312,7 @@ int b1_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
b1_setinterrupt(port, card->irq, card->cardtype); b1_setinterrupt(port, card->irq, card->cardtype);
b1_put_byte(port, SEND_INIT); b1_put_byte(port, SEND_INIT);
b1_put_word(port, CAPI_MAXAPPL); b1_put_word(port, CAPI_MAXAPPL);
b1_put_word(port, AVM_NCCI_PER_CHANNEL*2); b1_put_word(port, AVM_NCCI_PER_CHANNEL * 2);
b1_put_word(port, ctrl->cnr - 1); b1_put_word(port, ctrl->cnr - 1);
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
@@ -353,7 +353,7 @@ void b1_register_appl(struct capi_ctr *ctrl,
spin_lock_irqsave(&card->lock, flags); spin_lock_irqsave(&card->lock, flags);
b1_put_byte(port, SEND_REGISTER); b1_put_byte(port, SEND_REGISTER);
b1_put_word(port, appl); b1_put_word(port, appl);
b1_put_word(port, 1024 * (nconn+1)); b1_put_word(port, 1024 * (nconn + 1));
b1_put_word(port, nconn); b1_put_word(port, nconn);
b1_put_word(port, rp->datablkcnt); b1_put_word(port, rp->datablkcnt);
b1_put_word(port, rp->datablklen); b1_put_word(port, rp->datablklen);
@@ -430,7 +430,7 @@ void b1_parse_version(avmctrl_info *cinfo)
cinfo->version[j] = &cinfo->versionbuf[i + 1]; cinfo->version[j] = &cinfo->versionbuf[i + 1];
strlcpy(ctrl->serial, cinfo->version[VER_SERIAL], sizeof(ctrl->serial)); strlcpy(ctrl->serial, cinfo->version[VER_SERIAL], sizeof(ctrl->serial));
memcpy(&ctrl->profile, cinfo->version[VER_PROFILE],sizeof(capi_profile)); memcpy(&ctrl->profile, cinfo->version[VER_PROFILE], sizeof(capi_profile));
strlcpy(ctrl->manu, "AVM GmbH", sizeof(ctrl->manu)); strlcpy(ctrl->manu, "AVM GmbH", sizeof(ctrl->manu));
dversion = cinfo->version[VER_DRIVER]; dversion = cinfo->version[VER_DRIVER];
ctrl->version.majorversion = 2; ctrl->version.majorversion = 2;
@@ -449,11 +449,11 @@ void b1_parse_version(avmctrl_info *cinfo)
strcpy(cinfo->cardname, cinfo->version[VER_CARDTYPE]); strcpy(cinfo->cardname, cinfo->version[VER_CARDTYPE]);
else strcpy(cinfo->cardname, "B1"); else strcpy(cinfo->cardname, "B1");
break; break;
case 3: strcpy(cinfo->cardname,"PCMCIA B"); break; case 3: strcpy(cinfo->cardname, "PCMCIA B"); break;
case 4: strcpy(cinfo->cardname,"PCMCIA M1"); break; case 4: strcpy(cinfo->cardname, "PCMCIA M1"); break;
case 5: strcpy(cinfo->cardname,"PCMCIA M2"); break; case 5: strcpy(cinfo->cardname, "PCMCIA M2"); break;
case 6: strcpy(cinfo->cardname,"B1 V3.0"); break; case 6: strcpy(cinfo->cardname, "B1 V3.0"); break;
case 7: strcpy(cinfo->cardname,"B1 PCI"); break; case 7: strcpy(cinfo->cardname, "B1 PCI"); break;
default: sprintf(cinfo->cardname, "AVM?%u", (unsigned int)flag); break; default: sprintf(cinfo->cardname, "AVM?%u", (unsigned int)flag); break;
} }
printk(KERN_NOTICE "%s: card %d \"%s\" ready.\n", printk(KERN_NOTICE "%s: card %d \"%s\" ready.\n",
@@ -521,7 +521,7 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
if (MsgLen < 30) { /* not CAPI 64Bit */ if (MsgLen < 30) { /* not CAPI 64Bit */
memset(card->msgbuf+MsgLen, 0, 30-MsgLen); memset(card->msgbuf + MsgLen, 0, 30-MsgLen);
MsgLen = 30; MsgLen = 30;
CAPIMSG_SETLEN(card->msgbuf, 30); CAPIMSG_SETLEN(card->msgbuf, 30);
} }
@@ -600,10 +600,10 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
MsgLen = b1_get_slice(card->port, card->msgbuf); MsgLen = b1_get_slice(card->port, card->msgbuf);
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
card->msgbuf[MsgLen] = 0; card->msgbuf[MsgLen] = 0;
while ( MsgLen > 0 while (MsgLen > 0
&& ( card->msgbuf[MsgLen-1] == '\n' && (card->msgbuf[MsgLen - 1] == '\n'
|| card->msgbuf[MsgLen-1] == '\r')) { || card->msgbuf[MsgLen - 1] == '\r')) {
card->msgbuf[MsgLen-1] = 0; card->msgbuf[MsgLen - 1] = 0;
MsgLen--; MsgLen--;
} }
printk(KERN_INFO "%s: task %d \"%s\" ready.\n", printk(KERN_INFO "%s: task %d \"%s\" ready.\n",
@@ -614,10 +614,10 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
MsgLen = b1_get_slice(card->port, card->msgbuf); MsgLen = b1_get_slice(card->port, card->msgbuf);
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
card->msgbuf[MsgLen] = 0; card->msgbuf[MsgLen] = 0;
while ( MsgLen > 0 while (MsgLen > 0
&& ( card->msgbuf[MsgLen-1] == '\n' && (card->msgbuf[MsgLen - 1] == '\n'
|| card->msgbuf[MsgLen-1] == '\r')) { || card->msgbuf[MsgLen - 1] == '\r')) {
card->msgbuf[MsgLen-1] = 0; card->msgbuf[MsgLen - 1] = 0;
MsgLen--; MsgLen--;
} }
printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf); printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf);
@@ -750,12 +750,12 @@ avmcard_dma_alloc(char *name, struct pci_dev *pdev, long rsize, long ssize)
return p; return p;
err_free_consistent: err_free_consistent:
pci_free_consistent(p->pcidev, p->recvbuf.size, pci_free_consistent(p->pcidev, p->recvbuf.size,
p->recvbuf.dmabuf, p->recvbuf.dmaaddr); p->recvbuf.dmabuf, p->recvbuf.dmaaddr);
err_kfree: err_kfree:
kfree(p); kfree(p);
err: err:
return NULL; return NULL;
} }
@@ -800,7 +800,7 @@ static int __init b1_init(void)
if ((p = strchr(revision, ':')) != NULL && p[1]) { if ((p = strchr(revision, ':')) != NULL && p[1]) {
strlcpy(rev, p + 2, 32); strlcpy(rev, p + 2, 32);
if ((p = strchr(rev, '$')) != NULL && p > rev) if ((p = strchr(rev, '$')) != NULL && p > rev)
*(p-1) = 0; *(p - 1) = 0;
} else } else
strcpy(rev, "1.0"); strcpy(rev, "1.0");

View File

@@ -110,7 +110,7 @@ static int b1dma_tolink(avmcard *card, void *buf, unsigned int len)
unsigned long stop = jiffies + 1 * HZ; /* maximum wait time 1 sec */ unsigned long stop = jiffies + 1 * HZ; /* maximum wait time 1 sec */
unsigned char *s = (unsigned char *)buf; unsigned char *s = (unsigned char *)buf;
while (len--) { while (len--) {
while ( !b1dma_tx_empty(card->port) while (!b1dma_tx_empty(card->port)
&& time_before(jiffies, stop)); && time_before(jiffies, stop));
if (!b1dma_tx_empty(card->port)) if (!b1dma_tx_empty(card->port))
return -1; return -1;
@@ -124,7 +124,7 @@ static int b1dma_fromlink(avmcard *card, void *buf, unsigned int len)
unsigned long stop = jiffies + 1 * HZ; /* maximum wait time 1 sec */ unsigned long stop = jiffies + 1 * HZ; /* maximum wait time 1 sec */
unsigned char *s = (unsigned char *)buf; unsigned char *s = (unsigned char *)buf;
while (len--) { while (len--) {
while ( !b1dma_rx_full(card->port) while (!b1dma_rx_full(card->port)
&& time_before(jiffies, stop)); && time_before(jiffies, stop));
if (!b1dma_rx_full(card->port)) if (!b1dma_rx_full(card->port))
return -1; return -1;
@@ -136,7 +136,7 @@ static int b1dma_fromlink(avmcard *card, void *buf, unsigned int len)
static int WriteReg(avmcard *card, u32 reg, u8 val) static int WriteReg(avmcard *card, u32 reg, u8 val)
{ {
u8 cmd = 0x00; u8 cmd = 0x00;
if ( b1dma_tolink(card, &cmd, 1) == 0 if (b1dma_tolink(card, &cmd, 1) == 0
&& b1dma_tolink(card, &reg, 4) == 0) { && b1dma_tolink(card, &reg, 4) == 0) {
u32 tmp = val; u32 tmp = val;
return b1dma_tolink(card, &tmp, 4); return b1dma_tolink(card, &tmp, 4);
@@ -147,7 +147,7 @@ static int WriteReg(avmcard *card, u32 reg, u8 val)
static u8 ReadReg(avmcard *card, u32 reg) static u8 ReadReg(avmcard *card, u32 reg)
{ {
u8 cmd = 0x01; u8 cmd = 0x01;
if ( b1dma_tolink(card, &cmd, 1) == 0 if (b1dma_tolink(card, &cmd, 1) == 0
&& b1dma_tolink(card, &reg, 4) == 0) { && b1dma_tolink(card, &reg, 4) == 0) {
u32 tmp; u32 tmp;
if (b1dma_fromlink(card, &tmp, 4) == 0) if (b1dma_fromlink(card, &tmp, 4) == 0)
@@ -258,13 +258,13 @@ static int b1dma_detect(avmcard *card)
b1dma_writel(card, 0xffffffff, AMCC_RXPTR); b1dma_writel(card, 0xffffffff, AMCC_RXPTR);
b1dma_writel(card, 0xffffffff, AMCC_TXPTR); b1dma_writel(card, 0xffffffff, AMCC_TXPTR);
if ( b1dma_readl(card, AMCC_RXPTR) != 0xfffffffc if (b1dma_readl(card, AMCC_RXPTR) != 0xfffffffc
|| b1dma_readl(card, AMCC_TXPTR) != 0xfffffffc) || b1dma_readl(card, AMCC_TXPTR) != 0xfffffffc)
return 2; return 2;
b1dma_writel(card, 0x0, AMCC_RXPTR); b1dma_writel(card, 0x0, AMCC_RXPTR);
b1dma_writel(card, 0x0, AMCC_TXPTR); b1dma_writel(card, 0x0, AMCC_TXPTR);
if ( b1dma_readl(card, AMCC_RXPTR) != 0x0 if (b1dma_readl(card, AMCC_RXPTR) != 0x0
|| b1dma_readl(card, AMCC_TXPTR) != 0x0) || b1dma_readl(card, AMCC_TXPTR) != 0x0)
return 3; return 3;
@@ -274,14 +274,14 @@ static int b1dma_detect(avmcard *card)
t1outp(card->port, 0x02, 0x02); t1outp(card->port, 0x02, 0x02);
t1outp(card->port, 0x03, 0x02); t1outp(card->port, 0x03, 0x02);
if ( (t1inp(card->port, 0x02) & 0xFE) != 0x02 if ((t1inp(card->port, 0x02) & 0xFE) != 0x02
|| t1inp(card->port, 0x3) != 0x03) || t1inp(card->port, 0x3) != 0x03)
return 4; return 4;
t1outp(card->port, 0x02, 0x00); t1outp(card->port, 0x02, 0x00);
t1outp(card->port, 0x03, 0x00); t1outp(card->port, 0x03, 0x00);
if ( (t1inp(card->port, 0x02) & 0xFE) != 0x00 if ((t1inp(card->port, 0x02) & 0xFE) != 0x00
|| t1inp(card->port, 0x3) != 0x01) || t1inp(card->port, 0x3) != 0x01)
return 5; return 5;
@@ -297,25 +297,25 @@ int t1pci_detect(avmcard *card)
/* Transputer test */ /* Transputer test */
if ( WriteReg(card, 0x80001000, 0x11) != 0 if (WriteReg(card, 0x80001000, 0x11) != 0
|| WriteReg(card, 0x80101000, 0x22) != 0 || WriteReg(card, 0x80101000, 0x22) != 0
|| WriteReg(card, 0x80201000, 0x33) != 0 || WriteReg(card, 0x80201000, 0x33) != 0
|| WriteReg(card, 0x80301000, 0x44) != 0) || WriteReg(card, 0x80301000, 0x44) != 0)
return 6; return 6;
if ( ReadReg(card, 0x80001000) != 0x11 if (ReadReg(card, 0x80001000) != 0x11
|| ReadReg(card, 0x80101000) != 0x22 || ReadReg(card, 0x80101000) != 0x22
|| ReadReg(card, 0x80201000) != 0x33 || ReadReg(card, 0x80201000) != 0x33
|| ReadReg(card, 0x80301000) != 0x44) || ReadReg(card, 0x80301000) != 0x44)
return 7; return 7;
if ( WriteReg(card, 0x80001000, 0x55) != 0 if (WriteReg(card, 0x80001000, 0x55) != 0
|| WriteReg(card, 0x80101000, 0x66) != 0 || WriteReg(card, 0x80101000, 0x66) != 0
|| WriteReg(card, 0x80201000, 0x77) != 0 || WriteReg(card, 0x80201000, 0x77) != 0
|| WriteReg(card, 0x80301000, 0x88) != 0) || WriteReg(card, 0x80301000, 0x88) != 0)
return 8; return 8;
if ( ReadReg(card, 0x80001000) != 0x55 if (ReadReg(card, 0x80001000) != 0x55
|| ReadReg(card, 0x80101000) != 0x66 || ReadReg(card, 0x80101000) != 0x66
|| ReadReg(card, 0x80201000) != 0x77 || ReadReg(card, 0x80201000) != 0x77
|| ReadReg(card, 0x80301000) != 0x88) || ReadReg(card, 0x80301000) != 0x88)
@@ -331,13 +331,13 @@ int b1pciv4_detect(avmcard *card)
if ((ret = b1dma_detect(card)) != 0) if ((ret = b1dma_detect(card)) != 0)
return ret; return ret;
for (i=0; i < 5 ; i++) { for (i = 0; i < 5; i++) {
if (WriteReg(card, 0x80A00000, 0x21) != 0) if (WriteReg(card, 0x80A00000, 0x21) != 0)
return 6; return 6;
if ((ReadReg(card, 0x80A00000) & 0x01) != 0x01) if ((ReadReg(card, 0x80A00000) & 0x01) != 0x01)
return 7; return 7;
} }
for (i=0; i < 5 ; i++) { for (i = 0; i < 5; i++) {
if (WriteReg(card, 0x80A00000, 0x20) != 0) if (WriteReg(card, 0x80A00000, 0x20) != 0)
return 8; return 8;
if ((ReadReg(card, 0x80A00000) & 0x01) != 0x00) if ((ReadReg(card, 0x80A00000) & 0x01) != 0x00)
@@ -398,7 +398,7 @@ static void b1dma_dispatch_tx(avmcard *card)
printk(KERN_DEBUG "tx: put msg len=%d\n", txlen); printk(KERN_DEBUG "tx: put msg len=%d\n", txlen);
#endif #endif
} else { } else {
txlen = skb->len-2; txlen = skb->len - 2;
#ifdef AVM_B1DMA_POLLDEBUG #ifdef AVM_B1DMA_POLLDEBUG
if (skb->data[2] == SEND_POLLACK) if (skb->data[2] == SEND_POLLACK)
printk(KERN_INFO "%s: send ack\n", card->name); printk(KERN_INFO "%s: send ack\n", card->name);
@@ -450,7 +450,7 @@ static void b1dma_handle_rx(avmcard *card)
avmcard_dmainfo *dma = card->dma; avmcard_dmainfo *dma = card->dma;
struct capi_ctr *ctrl = &cinfo->capi_ctrl; struct capi_ctr *ctrl = &cinfo->capi_ctrl;
struct sk_buff *skb; struct sk_buff *skb;
void *p = dma->recvbuf.dmabuf+4; void *p = dma->recvbuf.dmabuf + 4;
u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize; u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize;
u8 b1cmd = _get_byte(&p); u8 b1cmd = _get_byte(&p);
@@ -466,11 +466,11 @@ static void b1dma_handle_rx(avmcard *card)
DataB3Len = _get_slice(&p, card->databuf); DataB3Len = _get_slice(&p, card->databuf);
if (MsgLen < 30) { /* not CAPI 64Bit */ if (MsgLen < 30) { /* not CAPI 64Bit */
memset(card->msgbuf+MsgLen, 0, 30-MsgLen); memset(card->msgbuf + MsgLen, 0, 30 - MsgLen);
MsgLen = 30; MsgLen = 30;
CAPIMSG_SETLEN(card->msgbuf, 30); CAPIMSG_SETLEN(card->msgbuf, 30);
} }
if (!(skb = alloc_skb(DataB3Len+MsgLen, GFP_ATOMIC))) { if (!(skb = alloc_skb(DataB3Len + MsgLen, GFP_ATOMIC))) {
printk(KERN_ERR "%s: incoming packet dropped\n", printk(KERN_ERR "%s: incoming packet dropped\n",
card->name); card->name);
} else { } else {
@@ -550,10 +550,10 @@ static void b1dma_handle_rx(avmcard *card)
ApplId = (unsigned) _get_word(&p); ApplId = (unsigned) _get_word(&p);
MsgLen = _get_slice(&p, card->msgbuf); MsgLen = _get_slice(&p, card->msgbuf);
card->msgbuf[MsgLen] = 0; card->msgbuf[MsgLen] = 0;
while ( MsgLen > 0 while (MsgLen > 0
&& ( card->msgbuf[MsgLen-1] == '\n' && (card->msgbuf[MsgLen - 1] == '\n'
|| card->msgbuf[MsgLen-1] == '\r')) { || card->msgbuf[MsgLen - 1] == '\r')) {
card->msgbuf[MsgLen-1] = 0; card->msgbuf[MsgLen - 1] = 0;
MsgLen--; MsgLen--;
} }
printk(KERN_INFO "%s: task %d \"%s\" ready.\n", printk(KERN_INFO "%s: task %d \"%s\" ready.\n",
@@ -563,10 +563,10 @@ static void b1dma_handle_rx(avmcard *card)
case RECEIVE_DEBUGMSG: case RECEIVE_DEBUGMSG:
MsgLen = _get_slice(&p, card->msgbuf); MsgLen = _get_slice(&p, card->msgbuf);
card->msgbuf[MsgLen] = 0; card->msgbuf[MsgLen] = 0;
while ( MsgLen > 0 while (MsgLen > 0
&& ( card->msgbuf[MsgLen-1] == '\n' && (card->msgbuf[MsgLen - 1] == '\n'
|| card->msgbuf[MsgLen-1] == '\r')) { || card->msgbuf[MsgLen - 1] == '\r')) {
card->msgbuf[MsgLen-1] = 0; card->msgbuf[MsgLen - 1] = 0;
MsgLen--; MsgLen--;
} }
printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf); printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf);
@@ -607,7 +607,7 @@ static void b1dma_handle_interrupt(avmcard *card)
if (rxlen == 0) { if (rxlen == 0) {
dma->recvlen = *((u32 *)dma->recvbuf.dmabuf); dma->recvlen = *((u32 *)dma->recvbuf.dmabuf);
rxlen = (dma->recvlen + 3) & ~3; rxlen = (dma->recvlen + 3) & ~3;
b1dma_writel(card, dma->recvbuf.dmaaddr+4, AMCC_RXPTR); b1dma_writel(card, dma->recvbuf.dmaaddr + 4, AMCC_RXPTR);
b1dma_writel(card, rxlen, AMCC_RXLEN); b1dma_writel(card, rxlen, AMCC_RXLEN);
#ifdef AVM_B1DMA_DEBUG #ifdef AVM_B1DMA_DEBUG
} else { } else {
@@ -694,7 +694,7 @@ static void b1dma_send_init(avmcard *card)
_put_byte(&p, 0); _put_byte(&p, 0);
_put_byte(&p, SEND_INIT); _put_byte(&p, SEND_INIT);
_put_word(&p, CAPI_MAXAPPL); _put_word(&p, CAPI_MAXAPPL);
_put_word(&p, AVM_NCCI_PER_CHANNEL*30); _put_word(&p, AVM_NCCI_PER_CHANNEL * 30);
_put_word(&p, card->cardnr - 1); _put_word(&p, card->cardnr - 1);
skb_put(skb, (u8 *)p - (u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
@@ -733,8 +733,8 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
card->csr = AVM_FLAG; card->csr = AVM_FLAG;
b1dma_writel(card, card->csr, AMCC_INTCSR); b1dma_writel(card, card->csr, AMCC_INTCSR);
b1dma_writel(card, EN_A2P_TRANSFERS|EN_P2A_TRANSFERS|A2P_HI_PRIORITY| b1dma_writel(card, EN_A2P_TRANSFERS | EN_P2A_TRANSFERS | A2P_HI_PRIORITY |
P2A_HI_PRIORITY|RESET_A2P_FLAGS|RESET_P2A_FLAGS, P2A_HI_PRIORITY | RESET_A2P_FLAGS | RESET_P2A_FLAGS,
AMCC_MCSR); AMCC_MCSR);
t1outp(card->port, 0x07, 0x30); t1outp(card->port, 0x07, 0x30);
t1outp(card->port, 0x10, 0xF0); t1outp(card->port, 0x10, 0xF0);
@@ -793,7 +793,7 @@ void b1dma_register_appl(struct capi_ctr *ctrl,
_put_byte(&p, 0); _put_byte(&p, 0);
_put_byte(&p, SEND_REGISTER); _put_byte(&p, SEND_REGISTER);
_put_word(&p, appl); _put_word(&p, appl);
_put_word(&p, 1024 * (nconn+1)); _put_word(&p, 1024 * (nconn + 1));
_put_word(&p, nconn); _put_word(&p, nconn);
_put_word(&p, rp->datablkcnt); _put_word(&p, rp->datablkcnt);
_put_word(&p, rp->datablklen); _put_word(&p, rp->datablklen);
@@ -977,7 +977,7 @@ static int __init b1dma_init(void)
if ((p = strchr(revision, ':')) != NULL && p[1]) { if ((p = strchr(revision, ':')) != NULL && p[1]) {
strlcpy(rev, p + 2, sizeof(rev)); strlcpy(rev, p + 2, sizeof(rev));
if ((p = strchr(rev, '$')) != NULL && p > rev) if ((p = strchr(rev, '$')) != NULL && p > rev)
*(p-1) = 0; *(p - 1) = 0;
} else } else
strcpy(rev, "1.0"); strcpy(rev, "1.0");

View File

@@ -80,7 +80,7 @@ static int b1isa_probe(struct pci_dev *pdev)
card->cardtype = avm_b1isa; card->cardtype = avm_b1isa;
sprintf(card->name, "b1isa-%x", card->port); sprintf(card->name, "b1isa-%x", card->port);
if ( card->port != 0x150 && card->port != 0x250 if (card->port != 0x150 && card->port != 0x250
&& card->port != 0x300 && card->port != 0x340) { && card->port != 0x300 && card->port != 0x340) {
printk(KERN_WARNING "b1isa: invalid port 0x%x.\n", card->port); printk(KERN_WARNING "b1isa: invalid port 0x%x.\n", card->port);
retval = -EINVAL; retval = -EINVAL;
@@ -136,13 +136,13 @@ static int b1isa_probe(struct pci_dev *pdev)
pci_set_drvdata(pdev, cinfo); pci_set_drvdata(pdev, cinfo);
return 0; return 0;
err_free_irq: err_free_irq:
free_irq(card->irq, card); free_irq(card->irq, card);
err_release_region: err_release_region:
release_region(card->port, AVMB1_PORTLEN); release_region(card->port, AVMB1_PORTLEN);
err_free: err_free:
b1_free_card(card); b1_free_card(card);
err: err:
return retval; return retval;
} }
@@ -206,7 +206,7 @@ static int __init b1isa_init(void)
if ((p = strchr(revision, ':')) != NULL && p[1]) { if ((p = strchr(revision, ':')) != NULL && p[1]) {
strlcpy(rev, p + 2, 32); strlcpy(rev, p + 2, 32);
if ((p = strchr(rev, '$')) != NULL && p > rev) if ((p = strchr(rev, '$')) != NULL && p > rev)
*(p-1) = 0; *(p - 1) = 0;
} else } else
strcpy(rev, "1.0"); strcpy(rev, "1.0");

View File

@@ -133,13 +133,13 @@ static int b1pci_probe(struct capicardparams *p, struct pci_dev *pdev)
pci_set_drvdata(pdev, card); pci_set_drvdata(pdev, card);
return 0; return 0;
err_free_irq: err_free_irq:
free_irq(card->irq, card); free_irq(card->irq, card);
err_release_region: err_release_region:
release_region(card->port, AVMB1_PORTLEN); release_region(card->port, AVMB1_PORTLEN);
err_free: err_free:
b1_free_card(card); b1_free_card(card);
err: err:
return retval; return retval;
} }
@@ -193,7 +193,7 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev)
goto err; goto err;
} }
card->dma = avmcard_dma_alloc("b1pci", pdev, 2048+128, 2048+128); card->dma = avmcard_dma_alloc("b1pci", pdev, 2048 + 128, 2048 + 128);
if (!card->dma) { if (!card->dma) {
printk(KERN_WARNING "b1pci: dma alloc.\n"); printk(KERN_WARNING "b1pci: dma alloc.\n");
retval = -ENOMEM; retval = -ENOMEM;
@@ -267,17 +267,17 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev)
pci_set_drvdata(pdev, card); pci_set_drvdata(pdev, card);
return 0; return 0;
err_free_irq: err_free_irq:
free_irq(card->irq, card); free_irq(card->irq, card);
err_unmap: err_unmap:
iounmap(card->mbase); iounmap(card->mbase);
err_release_region: err_release_region:
release_region(card->port, AVMB1_PORTLEN); release_region(card->port, AVMB1_PORTLEN);
err_free_dma: err_free_dma:
avmcard_dma_free(card->dma); avmcard_dma_free(card->dma);
err_free: err_free:
b1_free_card(card); b1_free_card(card);
err: err:
return retval; return retval;
} }
@@ -385,7 +385,7 @@ static int __init b1pci_init(void)
if ((p = strchr(revision, ':')) != NULL && p[1]) { if ((p = strchr(revision, ':')) != NULL && p[1]) {
strlcpy(rev, p + 2, 32); strlcpy(rev, p + 2, 32);
if ((p = strchr(rev, '$')) != NULL && p > rev) if ((p = strchr(rev, '$')) != NULL && p > rev)
*(p-1) = 0; *(p - 1) = 0;
} else } else
strcpy(rev, "1.0"); strcpy(rev, "1.0");

View File

@@ -119,7 +119,7 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq,
switch (cardtype) { switch (cardtype) {
case avm_m1: cardname = "M1"; break; case avm_m1: cardname = "M1"; break;
case avm_m2: cardname = "M2"; break; case avm_m2: cardname = "M2"; break;
default : cardname = "B1 PCMCIA"; break; default: cardname = "B1 PCMCIA"; break;
} }
printk(KERN_INFO "b1pcmcia: AVM %s at i/o %#x, irq %d, revision %d\n", printk(KERN_INFO "b1pcmcia: AVM %s at i/o %#x, irq %d, revision %d\n",
@@ -128,11 +128,11 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq,
list_add(&card->list, &cards); list_add(&card->list, &cards);
return cinfo->capi_ctrl.cnr; return cinfo->capi_ctrl.cnr;
err_free_irq: err_free_irq:
free_irq(card->irq, card); free_irq(card->irq, card);
err_free: err_free:
b1_free_card(card); b1_free_card(card);
err: err:
return retval; return retval;
} }
@@ -204,7 +204,7 @@ static int __init b1pcmcia_init(void)
if ((p = strchr(revision, ':')) != NULL && p[1]) { if ((p = strchr(revision, ':')) != NULL && p[1]) {
strlcpy(rev, p + 2, 32); strlcpy(rev, p + 2, 32);
if ((p = strchr(rev, '$')) != NULL && p > rev) if ((p = strchr(rev, '$')) != NULL && p > rev)
*(p-1) = 0; *(p - 1) = 0;
} else } else
strcpy(rev, "1.0"); strcpy(rev, "1.0");

View File

@@ -129,8 +129,8 @@ static void c4_dispatch_tx(avmcard *card);
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
#define RESET_TIMEOUT (15*HZ) /* 15 sec */ #define RESET_TIMEOUT (15 * HZ) /* 15 sec */
#define PEEK_POKE_TIMEOUT (HZ/10) /* 0.1 sec */ #define PEEK_POKE_TIMEOUT (HZ / 10) /* 0.1 sec */
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
@@ -148,7 +148,7 @@ static inline int wait_for_doorbell(avmcard *card, unsigned long t)
unsigned long stop; unsigned long stop;
stop = jiffies + t; stop = jiffies + t;
while (c4inmeml(card->mbase+DOORBELL) != 0xffffffff) { while (c4inmeml(card->mbase + DOORBELL) != 0xffffffff) {
if (!time_before(jiffies, stop)) if (!time_before(jiffies, stop))
return -1; return -1;
mb(); mb();
@@ -159,40 +159,40 @@ static inline int wait_for_doorbell(avmcard *card, unsigned long t)
static int c4_poke(avmcard *card, unsigned long off, unsigned long value) static int c4_poke(avmcard *card, unsigned long off, unsigned long value)
{ {
if (wait_for_doorbell(card, HZ/10) < 0) if (wait_for_doorbell(card, HZ / 10) < 0)
return -1; return -1;
c4outmeml(card->mbase+MBOX_PEEK_POKE, off); c4outmeml(card->mbase + MBOX_PEEK_POKE, off);
c4outmeml(card->mbase+DOORBELL, DBELL_ADDR); c4outmeml(card->mbase + DOORBELL, DBELL_ADDR);
if (wait_for_doorbell(card, HZ/10) < 0) if (wait_for_doorbell(card, HZ / 10) < 0)
return -1; return -1;
c4outmeml(card->mbase+MBOX_PEEK_POKE, value); c4outmeml(card->mbase + MBOX_PEEK_POKE, value);
c4outmeml(card->mbase+DOORBELL, DBELL_DATA | DBELL_ADDR); c4outmeml(card->mbase + DOORBELL, DBELL_DATA | DBELL_ADDR);
return 0; return 0;
} }
static int c4_peek(avmcard *card, unsigned long off, unsigned long *valuep) static int c4_peek(avmcard *card, unsigned long off, unsigned long *valuep)
{ {
if (wait_for_doorbell(card, HZ/10) < 0) if (wait_for_doorbell(card, HZ / 10) < 0)
return -1; return -1;
c4outmeml(card->mbase+MBOX_PEEK_POKE, off); c4outmeml(card->mbase + MBOX_PEEK_POKE, off);
c4outmeml(card->mbase+DOORBELL, DBELL_RNWR | DBELL_ADDR); c4outmeml(card->mbase + DOORBELL, DBELL_RNWR | DBELL_ADDR);
if (wait_for_doorbell(card, HZ/10) < 0) if (wait_for_doorbell(card, HZ / 10) < 0)
return -1; return -1;
*valuep = c4inmeml(card->mbase+MBOX_PEEK_POKE); *valuep = c4inmeml(card->mbase + MBOX_PEEK_POKE);
return 0; return 0;
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file) static int c4_load_t4file(avmcard *card, capiloaddatapart *t4file)
{ {
u32 val; u32 val;
unsigned char *dp; unsigned char *dp;
@@ -297,13 +297,13 @@ static void c4_reset(avmcard *card)
{ {
unsigned long stop; unsigned long stop;
c4outmeml(card->mbase+DOORBELL, DBELL_RESET_ARM); c4outmeml(card->mbase + DOORBELL, DBELL_RESET_ARM);
stop = jiffies + HZ*10; stop = jiffies + HZ * 10;
while (c4inmeml(card->mbase+DOORBELL) != 0xffffffff) { while (c4inmeml(card->mbase + DOORBELL) != 0xffffffff) {
if (!time_before(jiffies, stop)) if (!time_before(jiffies, stop))
return; return;
c4outmeml(card->mbase+DOORBELL, DBELL_ADDR); c4outmeml(card->mbase + DOORBELL, DBELL_ADDR);
mb(); mb();
} }
@@ -317,38 +317,38 @@ static int c4_detect(avmcard *card)
{ {
unsigned long stop, dummy; unsigned long stop, dummy;
c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x0c); c4outmeml(card->mbase + PCI_OUT_INT_MASK, 0x0c);
if (c4inmeml(card->mbase+PCI_OUT_INT_MASK) != 0x0c) if (c4inmeml(card->mbase + PCI_OUT_INT_MASK) != 0x0c)
return 1; return 1;
c4outmeml(card->mbase+DOORBELL, DBELL_RESET_ARM); c4outmeml(card->mbase + DOORBELL, DBELL_RESET_ARM);
stop = jiffies + HZ*10; stop = jiffies + HZ * 10;
while (c4inmeml(card->mbase+DOORBELL) != 0xffffffff) { while (c4inmeml(card->mbase + DOORBELL) != 0xffffffff) {
if (!time_before(jiffies, stop)) if (!time_before(jiffies, stop))
return 2; return 2;
c4outmeml(card->mbase+DOORBELL, DBELL_ADDR); c4outmeml(card->mbase + DOORBELL, DBELL_ADDR);
mb(); mb();
} }
c4_poke(card, DC21285_ARMCSR_BASE + CHAN_1_CONTROL, 0); c4_poke(card, DC21285_ARMCSR_BASE + CHAN_1_CONTROL, 0);
c4_poke(card, DC21285_ARMCSR_BASE + CHAN_2_CONTROL, 0); c4_poke(card, DC21285_ARMCSR_BASE + CHAN_2_CONTROL, 0);
c4outmeml(card->mbase+MAILBOX_0, 0x55aa55aa); c4outmeml(card->mbase + MAILBOX_0, 0x55aa55aa);
if (c4inmeml(card->mbase+MAILBOX_0) != 0x55aa55aa) return 3; if (c4inmeml(card->mbase + MAILBOX_0) != 0x55aa55aa) return 3;
c4outmeml(card->mbase+MAILBOX_0, 0xaa55aa55); c4outmeml(card->mbase + MAILBOX_0, 0xaa55aa55);
if (c4inmeml(card->mbase+MAILBOX_0) != 0xaa55aa55) return 4; if (c4inmeml(card->mbase + MAILBOX_0) != 0xaa55aa55) return 4;
if (c4_poke(card, DC21285_ARMCSR_BASE+DBELL_SA_MASK, 0)) return 5; if (c4_poke(card, DC21285_ARMCSR_BASE + DBELL_SA_MASK, 0)) return 5;
if (c4_poke(card, DC21285_ARMCSR_BASE+DBELL_PCI_MASK, 0)) return 6; if (c4_poke(card, DC21285_ARMCSR_BASE + DBELL_PCI_MASK, 0)) return 6;
if (c4_poke(card, DC21285_ARMCSR_BASE+SA_CONTROL, SA_CTL_ALLRIGHT)) if (c4_poke(card, DC21285_ARMCSR_BASE + SA_CONTROL, SA_CTL_ALLRIGHT))
return 7; return 7;
if (c4_poke(card, DC21285_ARMCSR_BASE+XBUS_CYCLE, INIT_XBUS_CYCLE)) if (c4_poke(card, DC21285_ARMCSR_BASE + XBUS_CYCLE, INIT_XBUS_CYCLE))
return 8; return 8;
if (c4_poke(card, DC21285_ARMCSR_BASE+XBUS_STROBE, INIT_XBUS_STROBE)) if (c4_poke(card, DC21285_ARMCSR_BASE + XBUS_STROBE, INIT_XBUS_STROBE))
return 8; return 8;
if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_TIMING, 0)) return 9; if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_TIMING, 0)) return 9;
mdelay(1); mdelay(1);
@@ -357,46 +357,46 @@ static int c4_detect(avmcard *card)
if (c4_peek(card, DC21285_DRAM_A2MR, &dummy)) return 12; if (c4_peek(card, DC21285_DRAM_A2MR, &dummy)) return 12;
if (c4_peek(card, DC21285_DRAM_A3MR, &dummy)) return 13; if (c4_peek(card, DC21285_DRAM_A3MR, &dummy)) return 13;
if (c4_poke(card, DC21285_DRAM_A0MR+CAS_OFFSET, 0)) return 14; if (c4_poke(card, DC21285_DRAM_A0MR + CAS_OFFSET, 0)) return 14;
if (c4_poke(card, DC21285_DRAM_A1MR+CAS_OFFSET, 0)) return 15; if (c4_poke(card, DC21285_DRAM_A1MR + CAS_OFFSET, 0)) return 15;
if (c4_poke(card, DC21285_DRAM_A2MR+CAS_OFFSET, 0)) return 16; if (c4_poke(card, DC21285_DRAM_A2MR + CAS_OFFSET, 0)) return 16;
if (c4_poke(card, DC21285_DRAM_A3MR+CAS_OFFSET, 0)) return 17; if (c4_poke(card, DC21285_DRAM_A3MR + CAS_OFFSET, 0)) return 17;
mdelay(1); mdelay(1);
if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_TIMING, DRAM_TIMING_DEF)) if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_TIMING, DRAM_TIMING_DEF))
return 18; return 18;
if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_ADDR_SIZE_0,DRAM_AD_SZ_DEF0)) if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_ADDR_SIZE_0, DRAM_AD_SZ_DEF0))
return 19; return 19;
if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_ADDR_SIZE_1,DRAM_AD_SZ_NULL)) if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_ADDR_SIZE_1, DRAM_AD_SZ_NULL))
return 20; return 20;
if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_ADDR_SIZE_2,DRAM_AD_SZ_NULL)) if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_ADDR_SIZE_2, DRAM_AD_SZ_NULL))
return 21; return 21;
if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_ADDR_SIZE_3,DRAM_AD_SZ_NULL)) if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_ADDR_SIZE_3, DRAM_AD_SZ_NULL))
return 22; return 22;
/* Transputer test */ /* Transputer test */
if ( c4_poke(card, 0x000000, 0x11111111) if (c4_poke(card, 0x000000, 0x11111111)
|| c4_poke(card, 0x400000, 0x22222222) || c4_poke(card, 0x400000, 0x22222222)
|| c4_poke(card, 0x800000, 0x33333333) || c4_poke(card, 0x800000, 0x33333333)
|| c4_poke(card, 0xC00000, 0x44444444)) || c4_poke(card, 0xC00000, 0x44444444))
return 23; return 23;
if ( c4_peek(card, 0x000000, &dummy) || dummy != 0x11111111 if (c4_peek(card, 0x000000, &dummy) || dummy != 0x11111111
|| c4_peek(card, 0x400000, &dummy) || dummy != 0x22222222 || c4_peek(card, 0x400000, &dummy) || dummy != 0x22222222
|| c4_peek(card, 0x800000, &dummy) || dummy != 0x33333333 || c4_peek(card, 0x800000, &dummy) || dummy != 0x33333333
|| c4_peek(card, 0xC00000, &dummy) || dummy != 0x44444444) || c4_peek(card, 0xC00000, &dummy) || dummy != 0x44444444)
return 24; return 24;
if ( c4_poke(card, 0x000000, 0x55555555) if (c4_poke(card, 0x000000, 0x55555555)
|| c4_poke(card, 0x400000, 0x66666666) || c4_poke(card, 0x400000, 0x66666666)
|| c4_poke(card, 0x800000, 0x77777777) || c4_poke(card, 0x800000, 0x77777777)
|| c4_poke(card, 0xC00000, 0x88888888)) || c4_poke(card, 0xC00000, 0x88888888))
return 25; return 25;
if ( c4_peek(card, 0x000000, &dummy) || dummy != 0x55555555 if (c4_peek(card, 0x000000, &dummy) || dummy != 0x55555555
|| c4_peek(card, 0x400000, &dummy) || dummy != 0x66666666 || c4_peek(card, 0x400000, &dummy) || dummy != 0x66666666
|| c4_peek(card, 0x800000, &dummy) || dummy != 0x77777777 || c4_peek(card, 0x800000, &dummy) || dummy != 0x77777777
|| c4_peek(card, 0xC00000, &dummy) || dummy != 0x88888888) || c4_peek(card, 0xC00000, &dummy) || dummy != 0x88888888)
@@ -451,7 +451,7 @@ static void c4_dispatch_tx(avmcard *card)
printk(KERN_DEBUG "%s: tx put msg len=%d\n", card->name, txlen); printk(KERN_DEBUG "%s: tx put msg len=%d\n", card->name, txlen);
#endif #endif
} else { } else {
txlen = skb->len-2; txlen = skb->len - 2;
#ifdef AVM_C4_POLLDEBUG #ifdef AVM_C4_POLLDEBUG
if (skb->data[2] == SEND_POLLACK) if (skb->data[2] == SEND_POLLACK)
printk(KERN_INFO "%s: ack to c4\n", card->name); printk(KERN_INFO "%s: ack to c4\n", card->name);
@@ -465,12 +465,12 @@ static void c4_dispatch_tx(avmcard *card)
} }
txlen = (txlen + 3) & ~3; txlen = (txlen + 3) & ~3;
c4outmeml(card->mbase+MBOX_DOWN_ADDR, dma->sendbuf.dmaaddr); c4outmeml(card->mbase + MBOX_DOWN_ADDR, dma->sendbuf.dmaaddr);
c4outmeml(card->mbase+MBOX_DOWN_LEN, txlen); c4outmeml(card->mbase + MBOX_DOWN_LEN, txlen);
card->csr |= DBELL_DOWN_ARM; card->csr |= DBELL_DOWN_ARM;
c4outmeml(card->mbase+DOORBELL, DBELL_DOWN_ARM); c4outmeml(card->mbase + DOORBELL, DBELL_DOWN_ARM);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
} }
@@ -528,11 +528,11 @@ static void c4_handle_rx(avmcard *card)
ctrl = &card->ctrlinfo[cidx].capi_ctrl; ctrl = &card->ctrlinfo[cidx].capi_ctrl;
if (MsgLen < 30) { /* not CAPI 64Bit */ if (MsgLen < 30) { /* not CAPI 64Bit */
memset(card->msgbuf+MsgLen, 0, 30-MsgLen); memset(card->msgbuf + MsgLen, 0, 30 - MsgLen);
MsgLen = 30; MsgLen = 30;
CAPIMSG_SETLEN(card->msgbuf, 30); CAPIMSG_SETLEN(card->msgbuf, 30);
} }
if (!(skb = alloc_skb(DataB3Len+MsgLen, GFP_ATOMIC))) { if (!(skb = alloc_skb(DataB3Len + MsgLen, GFP_ATOMIC))) {
printk(KERN_ERR "%s: incoming packet dropped\n", printk(KERN_ERR "%s: incoming packet dropped\n",
card->name); card->name);
} else { } else {
@@ -570,7 +570,7 @@ static void c4_handle_rx(avmcard *card)
ApplId = _get_word(&p); ApplId = _get_word(&p);
NCCI = _get_word(&p); NCCI = _get_word(&p);
WindowSize = _get_word(&p); WindowSize = _get_word(&p);
cidx = (NCCI&0x7f) - card->cardnr; cidx = (NCCI & 0x7f) - card->cardnr;
if (cidx >= card->nlogcontr) cidx = 0; if (cidx >= card->nlogcontr) cidx = 0;
capilib_new_ncci(&card->ctrlinfo[cidx].ncci_head, ApplId, NCCI, WindowSize); capilib_new_ncci(&card->ctrlinfo[cidx].ncci_head, ApplId, NCCI, WindowSize);
@@ -583,7 +583,7 @@ static void c4_handle_rx(avmcard *card)
NCCI = _get_word(&p); NCCI = _get_word(&p);
if (NCCI != 0xffffffff) { if (NCCI != 0xffffffff) {
cidx = (NCCI&0x7f) - card->cardnr; cidx = (NCCI & 0x7f) - card->cardnr;
if (cidx >= card->nlogcontr) cidx = 0; if (cidx >= card->nlogcontr) cidx = 0;
capilib_free_ncci(&card->ctrlinfo[cidx].ncci_head, ApplId, NCCI); capilib_free_ncci(&card->ctrlinfo[cidx].ncci_head, ApplId, NCCI);
} }
@@ -595,14 +595,14 @@ static void c4_handle_rx(avmcard *card)
#endif #endif
if (!suppress_pollack) if (!suppress_pollack)
queue_pollack(card); queue_pollack(card);
for (cidx=0; cidx < card->nr_controllers; cidx++) { for (cidx = 0; cidx < card->nr_controllers; cidx++) {
ctrl = &card->ctrlinfo[cidx].capi_ctrl; ctrl = &card->ctrlinfo[cidx].capi_ctrl;
capi_ctr_resume_output(ctrl); capi_ctr_resume_output(ctrl);
} }
break; break;
case RECEIVE_STOP: case RECEIVE_STOP:
for (cidx=0; cidx < card->nr_controllers; cidx++) { for (cidx = 0; cidx < card->nr_controllers; cidx++) {
ctrl = &card->ctrlinfo[cidx].capi_ctrl; ctrl = &card->ctrlinfo[cidx].capi_ctrl;
capi_ctr_suspend_output(ctrl); capi_ctr_suspend_output(ctrl);
} }
@@ -613,7 +613,7 @@ static void c4_handle_rx(avmcard *card)
cidx = card->nlogcontr; cidx = card->nlogcontr;
if (cidx >= card->nr_controllers) { if (cidx >= card->nr_controllers) {
printk(KERN_ERR "%s: card with %d controllers ??\n", printk(KERN_ERR "%s: card with %d controllers ??\n",
card->name, cidx+1); card->name, cidx + 1);
break; break;
} }
card->nlogcontr++; card->nlogcontr++;
@@ -632,10 +632,10 @@ static void c4_handle_rx(avmcard *card)
ApplId = (unsigned) _get_word(&p); ApplId = (unsigned) _get_word(&p);
MsgLen = _get_slice(&p, card->msgbuf); MsgLen = _get_slice(&p, card->msgbuf);
card->msgbuf[MsgLen] = 0; card->msgbuf[MsgLen] = 0;
while ( MsgLen > 0 while (MsgLen > 0
&& ( card->msgbuf[MsgLen-1] == '\n' && (card->msgbuf[MsgLen - 1] == '\n'
|| card->msgbuf[MsgLen-1] == '\r')) { || card->msgbuf[MsgLen - 1] == '\r')) {
card->msgbuf[MsgLen-1] = 0; card->msgbuf[MsgLen - 1] = 0;
MsgLen--; MsgLen--;
} }
printk(KERN_INFO "%s: task %d \"%s\" ready.\n", printk(KERN_INFO "%s: task %d \"%s\" ready.\n",
@@ -645,10 +645,10 @@ static void c4_handle_rx(avmcard *card)
case RECEIVE_DEBUGMSG: case RECEIVE_DEBUGMSG:
MsgLen = _get_slice(&p, card->msgbuf); MsgLen = _get_slice(&p, card->msgbuf);
card->msgbuf[MsgLen] = 0; card->msgbuf[MsgLen] = 0;
while ( MsgLen > 0 while (MsgLen > 0
&& ( card->msgbuf[MsgLen-1] == '\n' && (card->msgbuf[MsgLen - 1] == '\n'
|| card->msgbuf[MsgLen-1] == '\r')) { || card->msgbuf[MsgLen - 1] == '\r')) {
card->msgbuf[MsgLen-1] = 0; card->msgbuf[MsgLen - 1] = 0;
MsgLen--; MsgLen--;
} }
printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf); printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf);
@@ -669,16 +669,16 @@ static irqreturn_t c4_handle_interrupt(avmcard *card)
u32 status; u32 status;
spin_lock_irqsave(&card->lock, flags); spin_lock_irqsave(&card->lock, flags);
status = c4inmeml(card->mbase+DOORBELL); status = c4inmeml(card->mbase + DOORBELL);
if (status & DBELL_RESET_HOST) { if (status & DBELL_RESET_HOST) {
u_int i; u_int i;
c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x0c); c4outmeml(card->mbase + PCI_OUT_INT_MASK, 0x0c);
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
if (card->nlogcontr == 0) if (card->nlogcontr == 0)
return IRQ_HANDLED; return IRQ_HANDLED;
printk(KERN_ERR "%s: unexpected reset\n", card->name); printk(KERN_ERR "%s: unexpected reset\n", card->name);
for (i=0; i < card->nr_controllers; i++) { for (i = 0; i < card->nr_controllers; i++) {
avmctrl_info *cinfo = &card->ctrlinfo[i]; avmctrl_info *cinfo = &card->ctrlinfo[i];
memset(cinfo->version, 0, sizeof(cinfo->version)); memset(cinfo->version, 0, sizeof(cinfo->version));
spin_lock_irqsave(&card->lock, flags); spin_lock_irqsave(&card->lock, flags);
@@ -695,22 +695,22 @@ static irqreturn_t c4_handle_interrupt(avmcard *card)
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
c4outmeml(card->mbase+DOORBELL, status); c4outmeml(card->mbase + DOORBELL, status);
if ((status & DBELL_UP_HOST) != 0) { if ((status & DBELL_UP_HOST) != 0) {
card->dma->recvlen = c4inmeml(card->mbase+MBOX_UP_LEN); card->dma->recvlen = c4inmeml(card->mbase + MBOX_UP_LEN);
c4outmeml(card->mbase+MBOX_UP_LEN, 0); c4outmeml(card->mbase + MBOX_UP_LEN, 0);
c4_handle_rx(card); c4_handle_rx(card);
card->dma->recvlen = 0; card->dma->recvlen = 0;
c4outmeml(card->mbase+MBOX_UP_LEN, card->dma->recvbuf.size); c4outmeml(card->mbase + MBOX_UP_LEN, card->dma->recvbuf.size);
c4outmeml(card->mbase+DOORBELL, DBELL_UP_ARM); c4outmeml(card->mbase + DOORBELL, DBELL_UP_ARM);
} }
if ((status & DBELL_DOWN_HOST) != 0) { if ((status & DBELL_DOWN_HOST) != 0) {
card->csr &= ~DBELL_DOWN_ARM; card->csr &= ~DBELL_DOWN_ARM;
c4_dispatch_tx(card); c4_dispatch_tx(card);
} else if (card->csr & DBELL_DOWN_HOST) { } else if (card->csr & DBELL_DOWN_HOST) {
if (c4inmeml(card->mbase+MBOX_DOWN_LEN) == 0) { if (c4inmeml(card->mbase + MBOX_DOWN_LEN) == 0) {
card->csr &= ~DBELL_DOWN_ARM; card->csr &= ~DBELL_DOWN_ARM;
c4_dispatch_tx(card); c4_dispatch_tx(card);
} }
@@ -745,7 +745,7 @@ static void c4_send_init(avmcard *card)
_put_byte(&p, 0); _put_byte(&p, 0);
_put_byte(&p, SEND_INIT); _put_byte(&p, SEND_INIT);
_put_word(&p, CAPI_MAXAPPL); _put_word(&p, CAPI_MAXAPPL);
_put_word(&p, AVM_NCCI_PER_CHANNEL*30); _put_word(&p, AVM_NCCI_PER_CHANNEL * 30);
_put_word(&p, card->cardnr - 1); _put_word(&p, card->cardnr - 1);
skb_put(skb, (u8 *)p - (u8 *)skb->data); skb_put(skb, (u8 *)p - (u8 *)skb->data);
@@ -761,7 +761,7 @@ static int queue_sendconfigword(avmcard *card, u32 val)
unsigned long flags; unsigned long flags;
void *p; void *p;
skb = alloc_skb(3+4, GFP_ATOMIC); skb = alloc_skb(3 + 4, GFP_ATOMIC);
if (!skb) { if (!skb) {
printk(KERN_CRIT "%s: no memory, send config\n", printk(KERN_CRIT "%s: no memory, send config\n",
card->name); card->name);
@@ -787,7 +787,7 @@ static int queue_sendconfig(avmcard *card, char cval[4])
unsigned long flags; unsigned long flags;
void *p; void *p;
skb = alloc_skb(3+4, GFP_ATOMIC); skb = alloc_skb(3 + 4, GFP_ATOMIC);
if (!skb) { if (!skb) {
printk(KERN_CRIT "%s: no memory, send config\n", printk(KERN_CRIT "%s: no memory, send config\n",
card->name); card->name);
@@ -811,7 +811,7 @@ static int queue_sendconfig(avmcard *card, char cval[4])
return 0; return 0;
} }
static int c4_send_config(avmcard *card, capiloaddatapart * config) static int c4_send_config(avmcard *card, capiloaddatapart *config)
{ {
u8 val[4]; u8 val[4];
unsigned char *dp; unsigned char *dp;
@@ -866,19 +866,19 @@ static int c4_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
} }
card->csr = 0; card->csr = 0;
c4outmeml(card->mbase+MBOX_UP_LEN, 0); c4outmeml(card->mbase + MBOX_UP_LEN, 0);
c4outmeml(card->mbase+MBOX_DOWN_LEN, 0); c4outmeml(card->mbase + MBOX_DOWN_LEN, 0);
c4outmeml(card->mbase+DOORBELL, DBELL_INIT); c4outmeml(card->mbase + DOORBELL, DBELL_INIT);
mdelay(1); mdelay(1);
c4outmeml(card->mbase+DOORBELL, c4outmeml(card->mbase + DOORBELL,
DBELL_UP_HOST | DBELL_DOWN_HOST | DBELL_RESET_HOST); DBELL_UP_HOST | DBELL_DOWN_HOST | DBELL_RESET_HOST);
c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x08); c4outmeml(card->mbase + PCI_OUT_INT_MASK, 0x08);
card->dma->recvlen = 0; card->dma->recvlen = 0;
c4outmeml(card->mbase+MBOX_UP_ADDR, card->dma->recvbuf.dmaaddr); c4outmeml(card->mbase + MBOX_UP_ADDR, card->dma->recvbuf.dmaaddr);
c4outmeml(card->mbase+MBOX_UP_LEN, card->dma->recvbuf.size); c4outmeml(card->mbase + MBOX_UP_LEN, card->dma->recvbuf.size);
c4outmeml(card->mbase+DOORBELL, DBELL_UP_ARM); c4outmeml(card->mbase + DOORBELL, DBELL_UP_ARM);
if (data->configuration.len > 0 && data->configuration.data) { if (data->configuration.len > 0 && data->configuration.data) {
retval = c4_send_config(card, &data->configuration); retval = c4_send_config(card, &data->configuration);
@@ -909,7 +909,7 @@ static void c4_reset_ctr(struct capi_ctr *ctrl)
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
for (i=0; i < card->nr_controllers; i++) { for (i = 0; i < card->nr_controllers; i++) {
cinfo = &card->ctrlinfo[i]; cinfo = &card->ctrlinfo[i];
memset(cinfo->version, 0, sizeof(cinfo->version)); memset(cinfo->version, 0, sizeof(cinfo->version));
capi_ctr_down(&cinfo->capi_ctrl); capi_ctr_down(&cinfo->capi_ctrl);
@@ -928,7 +928,7 @@ static void c4_remove(struct pci_dev *pdev)
c4_reset(card); c4_reset(card);
for (i=0; i < card->nr_controllers; i++) { for (i = 0; i < card->nr_controllers; i++) {
cinfo = &card->ctrlinfo[i]; cinfo = &card->ctrlinfo[i];
detach_capi_ctr(&cinfo->capi_ctrl); detach_capi_ctr(&cinfo->capi_ctrl);
} }
@@ -973,7 +973,7 @@ static void c4_register_appl(struct capi_ctr *ctrl,
_put_byte(&p, 0); _put_byte(&p, 0);
_put_byte(&p, SEND_REGISTER); _put_byte(&p, SEND_REGISTER);
_put_word(&p, appl); _put_word(&p, appl);
_put_word(&p, 1024 * (nconn+1)); _put_word(&p, 1024 * (nconn + 1));
_put_word(&p, nconn); _put_word(&p, nconn);
_put_word(&p, rp->datablkcnt); _put_word(&p, rp->datablkcnt);
_put_word(&p, rp->datablklen); _put_word(&p, rp->datablklen);
@@ -1156,7 +1156,7 @@ static int c4_add_card(struct capicardparams *p, struct pci_dev *dev,
retval = -ENOMEM; retval = -ENOMEM;
goto err; goto err;
} }
card->dma = avmcard_dma_alloc("c4", dev, 2048+128, 2048+128); card->dma = avmcard_dma_alloc("c4", dev, 2048 + 128, 2048 + 128);
if (!card->dma) { if (!card->dma) {
printk(KERN_WARNING "c4: no memory.\n"); printk(KERN_WARNING "c4: no memory.\n");
retval = -ENOMEM; retval = -ENOMEM;
@@ -1195,12 +1195,12 @@ static int c4_add_card(struct capicardparams *p, struct pci_dev *dev,
retval = request_irq(card->irq, c4_interrupt, IRQF_SHARED, card->name, card); retval = request_irq(card->irq, c4_interrupt, IRQF_SHARED, card->name, card);
if (retval) { if (retval) {
printk(KERN_ERR "c4: unable to get IRQ %d.\n",card->irq); printk(KERN_ERR "c4: unable to get IRQ %d.\n", card->irq);
retval = -EBUSY; retval = -EBUSY;
goto err_unmap; goto err_unmap;
} }
for (i=0; i < nr_controllers ; i++) { for (i = 0; i < nr_controllers; i++) {
cinfo = &card->ctrlinfo[i]; cinfo = &card->ctrlinfo[i];
cinfo->capi_ctrl.owner = THIS_MODULE; cinfo->capi_ctrl.owner = THIS_MODULE;
cinfo->capi_ctrl.driver_name = "c4"; cinfo->capi_ctrl.driver_name = "c4";
@@ -1233,17 +1233,17 @@ static int c4_add_card(struct capicardparams *p, struct pci_dev *dev,
pci_set_drvdata(dev, card); pci_set_drvdata(dev, card);
return 0; return 0;
err_free_irq: err_free_irq:
free_irq(card->irq, card); free_irq(card->irq, card);
err_unmap: err_unmap:
iounmap(card->mbase); iounmap(card->mbase);
err_release_region: err_release_region:
release_region(card->port, AVMB1_PORTLEN); release_region(card->port, AVMB1_PORTLEN);
err_free_dma: err_free_dma:
avmcard_dma_free(card->dma); avmcard_dma_free(card->dma);
err_free: err_free:
b1_free_card(card); b1_free_card(card);
err: err:
return retval; return retval;
} }
@@ -1305,7 +1305,7 @@ static int __init c4_init(void)
if ((p = strchr(revision, ':')) != NULL && p[1]) { if ((p = strchr(revision, ':')) != NULL && p[1]) {
strlcpy(rev, p + 2, 32); strlcpy(rev, p + 2, 32);
if ((p = strchr(rev, '$')) != NULL && p > rev) if ((p = strchr(rev, '$')) != NULL && p > rev)
*(p-1) = 0; *(p - 1) = 0;
} else } else
strcpy(rev, "1.0"); strcpy(rev, "1.0");

View File

@@ -86,48 +86,48 @@ static int t1_detectandinit(unsigned int base, unsigned irq, int cardnr)
/* board reset */ /* board reset */
t1outp(base, T1_RESETBOARD, 0xf); t1outp(base, T1_RESETBOARD, 0xf);
mdelay(100); mdelay(100);
dummy = t1inp(base, T1_FASTLINK+T1_OUTSTAT); /* first read */ dummy = t1inp(base, T1_FASTLINK + T1_OUTSTAT); /* first read */
/* write config */ /* write config */
dummy = (base >> 4) & 0xff; dummy = (base >> 4) & 0xff;
for (i=1;i<=0xf;i++) t1outp(base, i, dummy); for (i = 1; i <= 0xf; i++) t1outp(base, i, dummy);
t1outp(base, HEMA_PAL_ID & 0xf, dummy); t1outp(base, HEMA_PAL_ID & 0xf, dummy);
t1outp(base, HEMA_PAL_ID >> 4, cregs[0]); t1outp(base, HEMA_PAL_ID >> 4, cregs[0]);
for(i=1;i<7;i++) t1outp(base, 0, cregs[i]); for (i = 1; i < 7; i++) t1outp(base, 0, cregs[i]);
t1outp(base, ((base >> 4)) & 0x3, cregs[7]); t1outp(base, ((base >> 4)) & 0x3, cregs[7]);
/* restore_flags(flags); */ /* restore_flags(flags); */
mdelay(100); mdelay(100);
t1outp(base, T1_FASTLINK+T1_RESETLINK, 0); t1outp(base, T1_FASTLINK + T1_RESETLINK, 0);
t1outp(base, T1_SLOWLINK+T1_RESETLINK, 0); t1outp(base, T1_SLOWLINK + T1_RESETLINK, 0);
mdelay(10); mdelay(10);
t1outp(base, T1_FASTLINK+T1_RESETLINK, 1); t1outp(base, T1_FASTLINK + T1_RESETLINK, 1);
t1outp(base, T1_SLOWLINK+T1_RESETLINK, 1); t1outp(base, T1_SLOWLINK + T1_RESETLINK, 1);
mdelay(100); mdelay(100);
t1outp(base, T1_FASTLINK+T1_RESETLINK, 0); t1outp(base, T1_FASTLINK + T1_RESETLINK, 0);
t1outp(base, T1_SLOWLINK+T1_RESETLINK, 0); t1outp(base, T1_SLOWLINK + T1_RESETLINK, 0);
mdelay(10); mdelay(10);
t1outp(base, T1_FASTLINK+T1_ANALYSE, 0); t1outp(base, T1_FASTLINK + T1_ANALYSE, 0);
mdelay(5); mdelay(5);
t1outp(base, T1_SLOWLINK+T1_ANALYSE, 0); t1outp(base, T1_SLOWLINK + T1_ANALYSE, 0);
if (t1inp(base, T1_FASTLINK+T1_OUTSTAT) != 0x1) /* tx empty */ if (t1inp(base, T1_FASTLINK + T1_OUTSTAT) != 0x1) /* tx empty */
return 1; return 1;
if (t1inp(base, T1_FASTLINK+T1_INSTAT) != 0x0) /* rx empty */ if (t1inp(base, T1_FASTLINK + T1_INSTAT) != 0x0) /* rx empty */
return 2; return 2;
if (t1inp(base, T1_FASTLINK+T1_IRQENABLE) != 0x0) if (t1inp(base, T1_FASTLINK + T1_IRQENABLE) != 0x0)
return 3; return 3;
if ((t1inp(base, T1_FASTLINK+T1_FIFOSTAT) & 0xf0) != 0x70) if ((t1inp(base, T1_FASTLINK + T1_FIFOSTAT) & 0xf0) != 0x70)
return 4; return 4;
if ((t1inp(base, T1_FASTLINK+T1_IRQMASTER) & 0x0e) != 0) if ((t1inp(base, T1_FASTLINK + T1_IRQMASTER) & 0x0e) != 0)
return 5; return 5;
if ((t1inp(base, T1_FASTLINK+T1_IDENT) & 0x7d) != 1) if ((t1inp(base, T1_FASTLINK + T1_IDENT) & 0x7d) != 1)
return 6; return 6;
if (t1inp(base, T1_SLOWLINK+T1_OUTSTAT) != 0x1) /* tx empty */ if (t1inp(base, T1_SLOWLINK + T1_OUTSTAT) != 0x1) /* tx empty */
return 7; return 7;
if ((t1inp(base, T1_SLOWLINK+T1_IRQMASTER) & 0x0e) != 0) if ((t1inp(base, T1_SLOWLINK + T1_IRQMASTER) & 0x0e) != 0)
return 8; return 8;
if ((t1inp(base, T1_SLOWLINK+T1_IDENT) & 0x7d) != 0) if ((t1inp(base, T1_SLOWLINK + T1_IDENT) & 0x7d) != 0)
return 9; return 9;
return 0; return 0;
} }
@@ -163,11 +163,11 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
if (MsgLen < 30) { /* not CAPI 64Bit */ if (MsgLen < 30) { /* not CAPI 64Bit */
memset(card->msgbuf+MsgLen, 0, 30-MsgLen); memset(card->msgbuf + MsgLen, 0, 30 - MsgLen);
MsgLen = 30; MsgLen = 30;
CAPIMSG_SETLEN(card->msgbuf, 30); CAPIMSG_SETLEN(card->msgbuf, 30);
} }
if (!(skb = alloc_skb(DataB3Len+MsgLen, GFP_ATOMIC))) { if (!(skb = alloc_skb(DataB3Len + MsgLen, GFP_ATOMIC))) {
printk(KERN_ERR "%s: incoming packet dropped\n", printk(KERN_ERR "%s: incoming packet dropped\n",
card->name); card->name);
} else { } else {
@@ -242,10 +242,10 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
MsgLen = t1_get_slice(card->port, card->msgbuf); MsgLen = t1_get_slice(card->port, card->msgbuf);
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
card->msgbuf[MsgLen] = 0; card->msgbuf[MsgLen] = 0;
while ( MsgLen > 0 while (MsgLen > 0
&& ( card->msgbuf[MsgLen-1] == '\n' && (card->msgbuf[MsgLen - 1] == '\n'
|| card->msgbuf[MsgLen-1] == '\r')) { || card->msgbuf[MsgLen - 1] == '\r')) {
card->msgbuf[MsgLen-1] = 0; card->msgbuf[MsgLen - 1] = 0;
MsgLen--; MsgLen--;
} }
printk(KERN_INFO "%s: task %d \"%s\" ready.\n", printk(KERN_INFO "%s: task %d \"%s\" ready.\n",
@@ -256,10 +256,10 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
MsgLen = t1_get_slice(card->port, card->msgbuf); MsgLen = t1_get_slice(card->port, card->msgbuf);
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
card->msgbuf[MsgLen] = 0; card->msgbuf[MsgLen] = 0;
while ( MsgLen > 0 while (MsgLen > 0
&& ( card->msgbuf[MsgLen-1] == '\n' && (card->msgbuf[MsgLen - 1] == '\n'
|| card->msgbuf[MsgLen-1] == '\r')) { || card->msgbuf[MsgLen - 1] == '\r')) {
card->msgbuf[MsgLen-1] = 0; card->msgbuf[MsgLen - 1] = 0;
MsgLen--; MsgLen--;
} }
printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf); printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf);
@@ -318,7 +318,7 @@ static int t1isa_load_firmware(struct capi_ctr *ctrl, capiloaddata *data)
b1_setinterrupt(port, card->irq, card->cardtype); b1_setinterrupt(port, card->irq, card->cardtype);
b1_put_byte(port, SEND_INIT); b1_put_byte(port, SEND_INIT);
b1_put_word(port, CAPI_MAXAPPL); b1_put_word(port, CAPI_MAXAPPL);
b1_put_word(port, AVM_NCCI_PER_CHANNEL*30); b1_put_word(port, AVM_NCCI_PER_CHANNEL * 30);
b1_put_word(port, ctrl->cnr - 1); b1_put_word(port, ctrl->cnr - 1);
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
@@ -445,13 +445,13 @@ static int t1isa_probe(struct pci_dev *pdev, int cardnr)
pci_set_drvdata(pdev, cinfo); pci_set_drvdata(pdev, cinfo);
return 0; return 0;
err_free_irq: err_free_irq:
free_irq(card->irq, card); free_irq(card->irq, card);
err_release_region: err_release_region:
release_region(card->port, AVMB1_PORTLEN); release_region(card->port, AVMB1_PORTLEN);
err_free: err_free:
b1_free_card(card); b1_free_card(card);
err: err:
return retval; return retval;
} }
@@ -555,7 +555,7 @@ static int __init t1isa_init(void)
if ((p = strchr(revision, ':')) != NULL && p[1]) { if ((p = strchr(revision, ':')) != NULL && p[1]) {
strlcpy(rev, p + 2, 32); strlcpy(rev, p + 2, 32);
if ((p = strchr(rev, '$')) != NULL && p > rev) if ((p = strchr(rev, '$')) != NULL && p > rev)
*(p-1) = 0; *(p - 1) = 0;
} else } else
strcpy(rev, "1.0"); strcpy(rev, "1.0");

View File

@@ -59,7 +59,7 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev)
goto err; goto err;
} }
card->dma = avmcard_dma_alloc("t1pci", pdev, 2048+128, 2048+128); card->dma = avmcard_dma_alloc("t1pci", pdev, 2048 + 128, 2048 + 128);
if (!card->dma) { if (!card->dma) {
printk(KERN_WARNING "t1pci: no memory.\n"); printk(KERN_WARNING "t1pci: no memory.\n");
retval = -ENOMEM; retval = -ENOMEM;
@@ -136,17 +136,17 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev)
pci_set_drvdata(pdev, card); pci_set_drvdata(pdev, card);
return 0; return 0;
err_free_irq: err_free_irq:
free_irq(card->irq, card); free_irq(card->irq, card);
err_unmap: err_unmap:
iounmap(card->mbase); iounmap(card->mbase);
err_release_region: err_release_region:
release_region(card->port, AVMB1_PORTLEN); release_region(card->port, AVMB1_PORTLEN);
err_free_dma: err_free_dma:
avmcard_dma_free(card->dma); avmcard_dma_free(card->dma);
err_free: err_free:
b1_free_card(card); b1_free_card(card);
err: err:
return retval; return retval;
} }
@@ -237,7 +237,7 @@ static int __init t1pci_init(void)
if ((p = strchr(revision, ':')) != NULL && p[1]) { if ((p = strchr(revision, ':')) != NULL && p[1]) {
strlcpy(rev, p + 2, 32); strlcpy(rev, p + 2, 32);
if ((p = strchr(rev, '$')) != NULL && p > rev) if ((p = strchr(rev, '$')) != NULL && p > rev)
*(p-1) = 0; *(p - 1) = 0;
} else } else
strcpy(rev, "1.0"); strcpy(rev, "1.0");

View File

@@ -25,29 +25,29 @@
*/ */
#ifndef _INC_CAPI20 #ifndef _INC_CAPI20
#define _INC_CAPI20 #define _INC_CAPI20
/* operations on message queues */ /* operations on message queues */
/* the common device type for CAPI20 drivers */ /* the common device type for CAPI20 drivers */
#define FILE_DEVICE_CAPI20 0x8001 #define FILE_DEVICE_CAPI20 0x8001
/* DEVICE_CONTROL codes for user and kernel mode applications */ /* DEVICE_CONTROL codes for user and kernel mode applications */
#define CAPI20_CTL_REGISTER 0x0801 #define CAPI20_CTL_REGISTER 0x0801
#define CAPI20_CTL_RELEASE 0x0802 #define CAPI20_CTL_RELEASE 0x0802
#define CAPI20_CTL_GET_MANUFACTURER 0x0805 #define CAPI20_CTL_GET_MANUFACTURER 0x0805
#define CAPI20_CTL_GET_VERSION 0x0806 #define CAPI20_CTL_GET_VERSION 0x0806
#define CAPI20_CTL_GET_SERIAL 0x0807 #define CAPI20_CTL_GET_SERIAL 0x0807
#define CAPI20_CTL_GET_PROFILE 0x0808 #define CAPI20_CTL_GET_PROFILE 0x0808
/* INTERNAL_DEVICE_CONTROL codes for kernel mode applicatios only */ /* INTERNAL_DEVICE_CONTROL codes for kernel mode applicatios only */
#define CAPI20_CTL_PUT_MESSAGE 0x0803 #define CAPI20_CTL_PUT_MESSAGE 0x0803
#define CAPI20_CTL_GET_MESSAGE 0x0804 #define CAPI20_CTL_GET_MESSAGE 0x0804
/* the wrapped codes as required by the system */ /* the wrapped codes as required by the system */
#define CAPI_CTL_CODE(f,m) CTL_CODE(FILE_DEVICE_CAPI20,f,m,FILE_ANY_ACCESS) #define CAPI_CTL_CODE(f, m) CTL_CODE(FILE_DEVICE_CAPI20, f, m, FILE_ANY_ACCESS)
#define IOCTL_CAPI_REGISTER CAPI_CTL_CODE(CAPI20_CTL_REGISTER,METHOD_BUFFERED) #define IOCTL_CAPI_REGISTER CAPI_CTL_CODE(CAPI20_CTL_REGISTER, METHOD_BUFFERED)
#define IOCTL_CAPI_RELEASE CAPI_CTL_CODE(CAPI20_CTL_RELEASE,METHOD_BUFFERED) #define IOCTL_CAPI_RELEASE CAPI_CTL_CODE(CAPI20_CTL_RELEASE, METHOD_BUFFERED)
#define IOCTL_CAPI_GET_MANUFACTURER CAPI_CTL_CODE(CAPI20_CTL_GET_MANUFACTURER,METHOD_BUFFERED) #define IOCTL_CAPI_GET_MANUFACTURER CAPI_CTL_CODE(CAPI20_CTL_GET_MANUFACTURER, METHOD_BUFFERED)
#define IOCTL_CAPI_GET_VERSION CAPI_CTL_CODE(CAPI20_CTL_GET_VERSION,METHOD_BUFFERED) #define IOCTL_CAPI_GET_VERSION CAPI_CTL_CODE(CAPI20_CTL_GET_VERSION, METHOD_BUFFERED)
#define IOCTL_CAPI_GET_SERIAL CAPI_CTL_CODE(CAPI20_CTL_GET_SERIAL,METHOD_BUFFERED) #define IOCTL_CAPI_GET_SERIAL CAPI_CTL_CODE(CAPI20_CTL_GET_SERIAL, METHOD_BUFFERED)
#define IOCTL_CAPI_GET_PROFILE CAPI_CTL_CODE(CAPI20_CTL_GET_PROFILE,METHOD_BUFFERED) #define IOCTL_CAPI_GET_PROFILE CAPI_CTL_CODE(CAPI20_CTL_GET_PROFILE, METHOD_BUFFERED)
#define IOCTL_CAPI_PUT_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_PUT_MESSAGE,METHOD_BUFFERED) #define IOCTL_CAPI_PUT_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_PUT_MESSAGE, METHOD_BUFFERED)
#define IOCTL_CAPI_GET_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_GET_MESSAGE,METHOD_BUFFERED) #define IOCTL_CAPI_GET_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_GET_MESSAGE, METHOD_BUFFERED)
struct divas_capi_register_params { struct divas_capi_register_params {
word MessageBufferSize; word MessageBufferSize;
word maxLogicalConnection; word maxLogicalConnection;
@@ -68,7 +68,7 @@ typedef struct api_profile_s {
dword B2_Protocols; dword B2_Protocols;
dword B3_Protocols; dword B3_Protocols;
} API_PROFILE; } API_PROFILE;
/* ISDN Common API message types */ /* ISDN Common API message types */
#define _ALERT_R 0x8001 #define _ALERT_R 0x8001
#define _CONNECT_R 0x8002 #define _CONNECT_R 0x8002
#define _CONNECT_I 0x8202 #define _CONNECT_I 0x8202
@@ -93,9 +93,9 @@ typedef struct api_profile_s {
#define _CONNECT_B3_T90_ACTIVE_I 0x8288 #define _CONNECT_B3_T90_ACTIVE_I 0x8288
#define _MANUFACTURER_R 0x80ff #define _MANUFACTURER_R 0x80ff
#define _MANUFACTURER_I 0x82ff #define _MANUFACTURER_I 0x82ff
/* OR this to convert a REQUEST to a CONFIRM */ /* OR this to convert a REQUEST to a CONFIRM */
#define CONFIRM 0x0100 #define CONFIRM 0x0100
/* OR this to convert a INDICATION to a RESPONSE */ /* OR this to convert a INDICATION to a RESPONSE */
#define RESPONSE 0x0100 #define RESPONSE 0x0100
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* diehl isdn private MANUFACTURER codes */ /* diehl isdn private MANUFACTURER codes */
@@ -115,15 +115,15 @@ typedef struct api_profile_s {
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* parameter structures */ /* parameter structures */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* ALERT-REQUEST */ /* ALERT-REQUEST */
typedef struct { typedef struct {
byte structs[0]; /* Additional Info */ byte structs[0]; /* Additional Info */
} _ALT_REQP; } _ALT_REQP;
/* ALERT-CONFIRM */ /* ALERT-CONFIRM */
typedef struct { typedef struct {
word Info; word Info;
} _ALT_CONP; } _ALT_CONP;
/* CONNECT-REQUEST */ /* CONNECT-REQUEST */
typedef struct { typedef struct {
word CIP_Value; word CIP_Value;
byte structs[0]; /* Called party number, byte structs[0]; /* Called party number,
@@ -136,11 +136,11 @@ typedef struct {
HLC, HLC,
Additional Info */ Additional Info */
} _CON_REQP; } _CON_REQP;
/* CONNECT-CONFIRM */ /* CONNECT-CONFIRM */
typedef struct { typedef struct {
word Info; word Info;
} _CON_CONP; } _CON_CONP;
/* CONNECT-INDICATION */ /* CONNECT-INDICATION */
typedef struct { typedef struct {
word CIP_Value; word CIP_Value;
byte structs[0]; /* Called party number, byte structs[0]; /* Called party number,
@@ -152,7 +152,7 @@ typedef struct {
HLC, HLC,
Additional Info */ Additional Info */
} _CON_INDP; } _CON_INDP;
/* CONNECT-RESPONSE */ /* CONNECT-RESPONSE */
typedef struct { typedef struct {
word Accept; word Accept;
byte structs[0]; /* B_protocol, byte structs[0]; /* B_protocol,
@@ -160,75 +160,75 @@ typedef struct {
Connected party subaddress, Connected party subaddress,
LLC */ LLC */
} _CON_RESP; } _CON_RESP;
/* CONNECT-ACTIVE-INDICATION */ /* CONNECT-ACTIVE-INDICATION */
typedef struct { typedef struct {
byte structs[0]; /* Connected party number, byte structs[0]; /* Connected party number,
Connected party subaddress, Connected party subaddress,
LLC */ LLC */
} _CON_A_INDP; } _CON_A_INDP;
/* CONNECT-ACTIVE-RESPONSE */ /* CONNECT-ACTIVE-RESPONSE */
typedef struct { typedef struct {
byte structs[0]; /* empty */ byte structs[0]; /* empty */
} _CON_A_RESP; } _CON_A_RESP;
/* DISCONNECT-REQUEST */ /* DISCONNECT-REQUEST */
typedef struct { typedef struct {
byte structs[0]; /* Additional Info */ byte structs[0]; /* Additional Info */
} _DIS_REQP; } _DIS_REQP;
/* DISCONNECT-CONFIRM */ /* DISCONNECT-CONFIRM */
typedef struct { typedef struct {
word Info; word Info;
} _DIS_CONP; } _DIS_CONP;
/* DISCONNECT-INDICATION */ /* DISCONNECT-INDICATION */
typedef struct { typedef struct {
word Info; word Info;
} _DIS_INDP; } _DIS_INDP;
/* DISCONNECT-RESPONSE */ /* DISCONNECT-RESPONSE */
typedef struct { typedef struct {
byte structs[0]; /* empty */ byte structs[0]; /* empty */
} _DIS_RESP; } _DIS_RESP;
/* LISTEN-REQUEST */ /* LISTEN-REQUEST */
typedef struct { typedef struct {
dword Info_Mask; dword Info_Mask;
dword CIP_Mask; dword CIP_Mask;
byte structs[0]; /* Calling party number, byte structs[0]; /* Calling party number,
Calling party subaddress */ Calling party subaddress */
} _LIS_REQP; } _LIS_REQP;
/* LISTEN-CONFIRM */ /* LISTEN-CONFIRM */
typedef struct { typedef struct {
word Info; word Info;
} _LIS_CONP; } _LIS_CONP;
/* INFO-REQUEST */ /* INFO-REQUEST */
typedef struct { typedef struct {
byte structs[0]; /* Called party number, byte structs[0]; /* Called party number,
Additional Info */ Additional Info */
} _INF_REQP; } _INF_REQP;
/* INFO-CONFIRM */ /* INFO-CONFIRM */
typedef struct { typedef struct {
word Info; word Info;
} _INF_CONP; } _INF_CONP;
/* INFO-INDICATION */ /* INFO-INDICATION */
typedef struct { typedef struct {
word Number; word Number;
byte structs[0]; /* Info element */ byte structs[0]; /* Info element */
} _INF_INDP; } _INF_INDP;
/* INFO-RESPONSE */ /* INFO-RESPONSE */
typedef struct { typedef struct {
byte structs[0]; /* empty */ byte structs[0]; /* empty */
} _INF_RESP; } _INF_RESP;
/* SELECT-B-REQUEST */ /* SELECT-B-REQUEST */
typedef struct { typedef struct {
byte structs[0]; /* B-protocol */ byte structs[0]; /* B-protocol */
} _SEL_B_REQP; } _SEL_B_REQP;
/* SELECT-B-CONFIRM */ /* SELECT-B-CONFIRM */
typedef struct { typedef struct {
word Info; word Info;
} _SEL_B_CONP; } _SEL_B_CONP;
/* FACILITY-REQUEST */ /* FACILITY-REQUEST */
typedef struct { typedef struct {
word Selector; word Selector;
byte structs[0]; /* Facility parameters */ byte structs[0]; /* Facility parameters */
} _FAC_REQP; } _FAC_REQP;
/* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */ /* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */
typedef struct { typedef struct {
byte struct_length; byte struct_length;
word function; word function;
@@ -236,72 +236,72 @@ typedef struct {
word SupplementaryServiceInfo; word SupplementaryServiceInfo;
dword SupportedServices; dword SupportedServices;
} _FAC_CON_STRUCTS; } _FAC_CON_STRUCTS;
/* FACILITY-CONFIRM */ /* FACILITY-CONFIRM */
typedef struct { typedef struct {
word Info; word Info;
word Selector; word Selector;
byte structs[0]; /* Facility parameters */ byte structs[0]; /* Facility parameters */
} _FAC_CONP; } _FAC_CONP;
/* FACILITY-INDICATION */ /* FACILITY-INDICATION */
typedef struct { typedef struct {
word Selector; word Selector;
byte structs[0]; /* Facility parameters */ byte structs[0]; /* Facility parameters */
} _FAC_INDP; } _FAC_INDP;
/* FACILITY-RESPONSE */ /* FACILITY-RESPONSE */
typedef struct { typedef struct {
word Selector; word Selector;
byte structs[0]; /* Facility parameters */ byte structs[0]; /* Facility parameters */
} _FAC_RESP; } _FAC_RESP;
/* CONNECT-B3-REQUEST */ /* CONNECT-B3-REQUEST */
typedef struct { typedef struct {
byte structs[0]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_REQP; } _CON_B3_REQP;
/* CONNECT-B3-CONFIRM */ /* CONNECT-B3-CONFIRM */
typedef struct { typedef struct {
word Info; word Info;
} _CON_B3_CONP; } _CON_B3_CONP;
/* CONNECT-B3-INDICATION */ /* CONNECT-B3-INDICATION */
typedef struct { typedef struct {
byte structs[0]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_INDP; } _CON_B3_INDP;
/* CONNECT-B3-RESPONSE */ /* CONNECT-B3-RESPONSE */
typedef struct { typedef struct {
word Accept; word Accept;
byte structs[0]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_RESP; } _CON_B3_RESP;
/* CONNECT-B3-ACTIVE-INDICATION */ /* CONNECT-B3-ACTIVE-INDICATION */
typedef struct { typedef struct {
byte structs[0]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_A_INDP; } _CON_B3_A_INDP;
/* CONNECT-B3-ACTIVE-RESPONSE */ /* CONNECT-B3-ACTIVE-RESPONSE */
typedef struct { typedef struct {
byte structs[0]; /* empty */ byte structs[0]; /* empty */
} _CON_B3_A_RESP; } _CON_B3_A_RESP;
/* DISCONNECT-B3-REQUEST */ /* DISCONNECT-B3-REQUEST */
typedef struct { typedef struct {
byte structs[0]; /* NCPI */ byte structs[0]; /* NCPI */
} _DIS_B3_REQP; } _DIS_B3_REQP;
/* DISCONNECT-B3-CONFIRM */ /* DISCONNECT-B3-CONFIRM */
typedef struct { typedef struct {
word Info; word Info;
} _DIS_B3_CONP; } _DIS_B3_CONP;
/* DISCONNECT-B3-INDICATION */ /* DISCONNECT-B3-INDICATION */
typedef struct { typedef struct {
word Info; word Info;
byte structs[0]; /* NCPI */ byte structs[0]; /* NCPI */
} _DIS_B3_INDP; } _DIS_B3_INDP;
/* DISCONNECT-B3-RESPONSE */ /* DISCONNECT-B3-RESPONSE */
typedef struct { typedef struct {
byte structs[0]; /* empty */ byte structs[0]; /* empty */
} _DIS_B3_RESP; } _DIS_B3_RESP;
/* DATA-B3-REQUEST */ /* DATA-B3-REQUEST */
typedef struct { typedef struct {
dword Data; dword Data;
word Data_Length; word Data_Length;
word Number; word Number;
word Flags; word Flags;
} _DAT_B3_REQP; } _DAT_B3_REQP;
/* DATA-B3-REQUEST 64 BIT Systems */ /* DATA-B3-REQUEST 64 BIT Systems */
typedef struct { typedef struct {
dword Data; dword Data;
word Data_Length; word Data_Length;
@@ -309,19 +309,19 @@ typedef struct {
word Flags; word Flags;
void *pData; void *pData;
} _DAT_B3_REQ64P; } _DAT_B3_REQ64P;
/* DATA-B3-CONFIRM */ /* DATA-B3-CONFIRM */
typedef struct { typedef struct {
word Number; word Number;
word Info; word Info;
} _DAT_B3_CONP; } _DAT_B3_CONP;
/* DATA-B3-INDICATION */ /* DATA-B3-INDICATION */
typedef struct { typedef struct {
dword Data; dword Data;
word Data_Length; word Data_Length;
word Number; word Number;
word Flags; word Flags;
} _DAT_B3_INDP; } _DAT_B3_INDP;
/* DATA-B3-INDICATION 64 BIT Systems */ /* DATA-B3-INDICATION 64 BIT Systems */
typedef struct { typedef struct {
dword Data; dword Data;
word Data_Length; word Data_Length;
@@ -329,31 +329,31 @@ typedef struct {
word Flags; word Flags;
void *pData; void *pData;
} _DAT_B3_IND64P; } _DAT_B3_IND64P;
/* DATA-B3-RESPONSE */ /* DATA-B3-RESPONSE */
typedef struct { typedef struct {
word Number; word Number;
} _DAT_B3_RESP; } _DAT_B3_RESP;
/* RESET-B3-REQUEST */ /* RESET-B3-REQUEST */
typedef struct { typedef struct {
byte structs[0]; /* NCPI */ byte structs[0]; /* NCPI */
} _RES_B3_REQP; } _RES_B3_REQP;
/* RESET-B3-CONFIRM */ /* RESET-B3-CONFIRM */
typedef struct { typedef struct {
word Info; word Info;
} _RES_B3_CONP; } _RES_B3_CONP;
/* RESET-B3-INDICATION */ /* RESET-B3-INDICATION */
typedef struct { typedef struct {
byte structs[0]; /* NCPI */ byte structs[0]; /* NCPI */
} _RES_B3_INDP; } _RES_B3_INDP;
/* RESET-B3-RESPONSE */ /* RESET-B3-RESPONSE */
typedef struct { typedef struct {
byte structs[0]; /* empty */ byte structs[0]; /* empty */
} _RES_B3_RESP; } _RES_B3_RESP;
/* CONNECT-B3-T90-ACTIVE-INDICATION */ /* CONNECT-B3-T90-ACTIVE-INDICATION */
typedef struct { typedef struct {
byte structs[0]; /* NCPI */ byte structs[0]; /* NCPI */
} _CON_B3_T90_A_INDP; } _CON_B3_T90_A_INDP;
/* CONNECT-B3-T90-ACTIVE-RESPONSE */ /* CONNECT-B3-T90-ACTIVE-RESPONSE */
typedef struct { typedef struct {
word Reject; word Reject;
byte structs[0]; /* NCPI */ byte structs[0]; /* NCPI */

View File

@@ -182,7 +182,7 @@ static byte capidtmf_leading_zeroes_table[0x100] =
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void capidtmf_goertzel_loop (long *buffer, long *coeffs, short *sample, long count) static void capidtmf_goertzel_loop(long *buffer, long *coeffs, short *sample, long count)
{ {
int i, j; int i, j;
long c, d, q0, q1, q2; long c, d, q0, q1, q2;
@@ -246,7 +246,7 @@ static void capidtmf_goertzel_loop (long *buffer, long *coeffs, short *sample, l
} }
static void capidtmf_goertzel_result (long *buffer, long *coeffs) static void capidtmf_goertzel_result(long *buffer, long *coeffs)
{ {
int i; int i;
long d, e, q1, q2, lo, mid, hi; long d, e, q1, q2, lo, mid, hi;
@@ -409,7 +409,7 @@ static word capidtmf_recv_guard_snr_high_table[CAPIDTMF_RECV_TOTAL_FREQUENCY_COU
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void capidtmf_recv_init (t_capidtmf_state *p_state) static void capidtmf_recv_init(t_capidtmf_state *p_state)
{ {
p_state->recv.min_gap_duration = 1; p_state->recv.min_gap_duration = 1;
p_state->recv.min_digit_duration = 1; p_state->recv.min_digit_duration = 1;
@@ -427,7 +427,7 @@ static void capidtmf_recv_init (t_capidtmf_state *p_state)
} }
void capidtmf_recv_enable (t_capidtmf_state *p_state, word min_digit_duration, word min_gap_duration) void capidtmf_recv_enable(t_capidtmf_state *p_state, word min_digit_duration, word min_gap_duration)
{ {
p_state->recv.indication_state_ack &= CAPIDTMF_RECV_INDICATION_DIGIT; p_state->recv.indication_state_ack &= CAPIDTMF_RECV_INDICATION_DIGIT;
p_state->recv.min_digit_duration = (word)(((((dword) min_digit_duration) * 8) + p_state->recv.min_digit_duration = (word)(((((dword) min_digit_duration) * 8) +
@@ -446,11 +446,11 @@ void capidtmf_recv_enable (t_capidtmf_state *p_state, word min_digit_duration,
} }
void capidtmf_recv_disable (t_capidtmf_state *p_state) void capidtmf_recv_disable(t_capidtmf_state *p_state)
{ {
p_state->recv.state &= ~CAPIDTMF_RECV_STATE_DTMF_ACTIVE; p_state->recv.state &= ~CAPIDTMF_RECV_STATE_DTMF_ACTIVE;
if (p_state->recv.state == CAPIDTMF_RECV_STATE_IDLE) if (p_state->recv.state == CAPIDTMF_RECV_STATE_IDLE)
capidtmf_recv_init (p_state); capidtmf_recv_init(p_state);
else else
{ {
p_state->recv.cycle_counter = 0; p_state->recv.cycle_counter = 0;
@@ -461,7 +461,7 @@ void capidtmf_recv_disable (t_capidtmf_state *p_state)
} }
word capidtmf_recv_indication (t_capidtmf_state *p_state, byte *buffer) word capidtmf_recv_indication(t_capidtmf_state *p_state, byte *buffer)
{ {
word i, j, k, flags; word i, j, k, flags;
@@ -487,7 +487,7 @@ word capidtmf_recv_indication (t_capidtmf_state *p_state, byte *buffer)
#define CAPIDTMF_RECV_WINDOWED_SAMPLES 32 #define CAPIDTMF_RECV_WINDOWED_SAMPLES 32
void capidtmf_recv_block (t_capidtmf_state *p_state, byte *buffer, word length) void capidtmf_recv_block(t_capidtmf_state *p_state, byte *buffer, word length)
{ {
byte result_digit; byte result_digit;
word sample_number, cycle_counter, n, i; word sample_number, cycle_counter, n, i;
@@ -539,14 +539,14 @@ void capidtmf_recv_block (t_capidtmf_state *p_state, byte *buffer, word leng
} }
} }
capidtmf_recv_goertzel_coef_table[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT - 1] = CAPIDTMF_RECV_FUNDAMENTAL_OFFSET; capidtmf_recv_goertzel_coef_table[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT - 1] = CAPIDTMF_RECV_FUNDAMENTAL_OFFSET;
capidtmf_goertzel_loop (p_state->recv.goertzel_buffer[0], capidtmf_goertzel_loop(p_state->recv.goertzel_buffer[0],
capidtmf_recv_goertzel_coef_table, windowed_sample_buffer, n); capidtmf_recv_goertzel_coef_table, windowed_sample_buffer, n);
cycle_counter += n; cycle_counter += n;
sample_number += n; sample_number += n;
} }
else else
{ {
capidtmf_goertzel_result (p_state->recv.goertzel_buffer[0], capidtmf_goertzel_result(p_state->recv.goertzel_buffer[0],
capidtmf_recv_goertzel_coef_table); capidtmf_recv_goertzel_coef_table);
for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++) for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++)
{ {
@@ -554,12 +554,12 @@ void capidtmf_recv_block (t_capidtmf_state *p_state, byte *buffer, word leng
hi = (dword)(p_state->recv.goertzel_buffer[1][i]); hi = (dword)(p_state->recv.goertzel_buffer[1][i]);
if (hi != 0) if (hi != 0)
{ {
n = capidtmf_dword_leading_zeroes (hi); n = capidtmf_dword_leading_zeroes(hi);
hi = (hi << n) | (lo >> (32 - n)); hi = (hi << n) | (lo >> (32 - n));
} }
else else
{ {
n = capidtmf_dword_leading_zeroes (lo); n = capidtmf_dword_leading_zeroes(lo);
hi = lo << n; hi = lo << n;
n += 32; n += 32;
} }
@@ -651,7 +651,7 @@ void capidtmf_recv_block (t_capidtmf_state *p_state, byte *buffer, word leng
0 : p_state->recv.digit_write_pos + 1; 0 : p_state->recv.digit_write_pos + 1;
if (i == p_state->recv.digit_read_pos) if (i == p_state->recv.digit_read_pos)
{ {
trace (dprintf ("%s,%d: Receive digit overrun", trace(dprintf("%s,%d: Receive digit overrun",
(char *)(FILE_), __LINE__)); (char *)(FILE_), __LINE__));
} }
else else
@@ -675,10 +675,10 @@ void capidtmf_recv_block (t_capidtmf_state *p_state, byte *buffer, word leng
} }
void capidtmf_init (t_capidtmf_state *p_state, byte ulaw) void capidtmf_init(t_capidtmf_state *p_state, byte ulaw)
{ {
p_state->ulaw = ulaw; p_state->ulaw = ulaw;
capidtmf_recv_init (p_state); capidtmf_recv_init(p_state);
} }

View File

@@ -67,13 +67,13 @@ typedef struct tag_capidtmf_state
byte ulaw; byte ulaw;
t_capidtmf_recv_state recv; t_capidtmf_recv_state recv;
} t_capidtmf_state; } t_capidtmf_state;
word capidtmf_recv_indication (t_capidtmf_state *p_state, byte *buffer); word capidtmf_recv_indication(t_capidtmf_state *p_state, byte *buffer);
void capidtmf_recv_block (t_capidtmf_state *p_state, byte *buffer, word length); void capidtmf_recv_block(t_capidtmf_state *p_state, byte *buffer, word length);
void capidtmf_init (t_capidtmf_state *p_state, byte ulaw); void capidtmf_init(t_capidtmf_state *p_state, byte ulaw);
void capidtmf_recv_enable (t_capidtmf_state *p_state, word min_digit_duration, word min_gap_duration); void capidtmf_recv_enable(t_capidtmf_state *p_state, word min_digit_duration, word min_gap_duration);
void capidtmf_recv_disable (t_capidtmf_state *p_state); void capidtmf_recv_disable(t_capidtmf_state *p_state);
#define capidtmf_indication(p_state,buffer) (((p_state)->recv.indication_state != (p_state)->recv.indication_state_ack) ? capidtmf_recv_indication (p_state, buffer) : 0) #define capidtmf_indication(p_state, buffer) (((p_state)->recv.indication_state != (p_state)->recv.indication_state_ack) ? capidtmf_recv_indication(p_state, buffer) : 0)
#define capidtmf_recv_process_block(p_state,buffer,length) { if ((p_state)->recv.state != CAPIDTMF_RECV_STATE_IDLE) capidtmf_recv_block (p_state, buffer, length); } #define capidtmf_recv_process_block(p_state, buffer, length) { if ((p_state)->recv.state != CAPIDTMF_RECV_STATE_IDLE) capidtmf_recv_block(p_state, buffer, length); }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#endif #endif

View File

@@ -43,7 +43,7 @@ static diva_os_spin_lock_t api_lock;
static LIST_HEAD(cards); static LIST_HEAD(cards);
static dword notify_handle; static dword notify_handle;
static void DIRequest(ENTITY * e); static void DIRequest(ENTITY *e);
static DESCRIPTOR MAdapter; static DESCRIPTOR MAdapter;
static DESCRIPTOR DAdapter; static DESCRIPTOR DAdapter;
static byte ControllerMap[MAX_DESCRIPTORS + 1]; static byte ControllerMap[MAX_DESCRIPTORS + 1];
@@ -160,7 +160,7 @@ static int find_free_id(void)
break; break;
num++; num++;
} }
return(num + 1); return (num + 1);
} }
/* /*
@@ -176,7 +176,7 @@ static diva_card *find_card_by_ctrl(word controller)
if (ControllerMap[card->Id] == controller) { if (ControllerMap[card->Id] == controller) {
if (card->remove_in_progress) if (card->remove_in_progress)
card = NULL; card = NULL;
return(card); return (card);
} }
} }
return (diva_card *) 0; return (diva_card *) 0;
@@ -185,14 +185,14 @@ static diva_card *find_card_by_ctrl(word controller)
/* /*
* Buffer RX/TX * Buffer RX/TX
*/ */
void *TransmitBufferSet(APPL * appl, dword ref) void *TransmitBufferSet(APPL *appl, dword ref)
{ {
appl->xbuffer_used[ref] = true; appl->xbuffer_used[ref] = true;
DBG_PRV1(("%d:xbuf_used(%d)", appl->Id, ref + 1)) DBG_PRV1(("%d:xbuf_used(%d)", appl->Id, ref + 1))
return (void *)(long)ref; return (void *)(long)ref;
} }
void *TransmitBufferGet(APPL * appl, void *p) void *TransmitBufferGet(APPL *appl, void *p)
{ {
if (appl->xbuffer_internal[(dword)(long)p]) if (appl->xbuffer_internal[(dword)(long)p])
return appl->xbuffer_internal[(dword)(long)p]; return appl->xbuffer_internal[(dword)(long)p];
@@ -200,13 +200,13 @@ void *TransmitBufferGet(APPL * appl, void *p)
return appl->xbuffer_ptr[(dword)(long)p]; return appl->xbuffer_ptr[(dword)(long)p];
} }
void TransmitBufferFree(APPL * appl, void *p) void TransmitBufferFree(APPL *appl, void *p)
{ {
appl->xbuffer_used[(dword)(long)p] = false; appl->xbuffer_used[(dword)(long)p] = false;
DBG_PRV1(("%d:xbuf_free(%d)", appl->Id, ((dword)(long)p) + 1)) DBG_PRV1(("%d:xbuf_free(%d)", appl->Id, ((dword)(long)p) + 1))
} }
void *ReceiveBufferGet(APPL * appl, int Num) void *ReceiveBufferGet(APPL *appl, int Num)
{ {
return &appl->ReceiveBuffer[Num * appl->MaxDataLength]; return &appl->ReceiveBuffer[Num * appl->MaxDataLength];
} }
@@ -217,12 +217,12 @@ void *ReceiveBufferGet(APPL * appl, int Num)
void api_remove_complete(void) void api_remove_complete(void)
{ {
DBG_PRV1(("api_remove_complete")) DBG_PRV1(("api_remove_complete"))
} }
/* /*
* main function called by message.c * main function called by message.c
*/ */
void sendf(APPL * appl, word command, dword Id, word Number, byte * format, ...) void sendf(APPL *appl, word command, dword Id, word Number, byte *format, ...)
{ {
word i, j; word i, j;
word length = 12, dlength = 0; word length = 12, dlength = 0;
@@ -247,7 +247,7 @@ void sendf(APPL * appl, word command, dword Id, word Number, byte * format, ...)
PUT_WORD(&msg.header.number, Number); PUT_WORD(&msg.header.number, Number);
PUT_DWORD(&msg.header.controller, Id); PUT_DWORD(&msg.header.controller, Id);
write = (byte *) & msg; write = (byte *)&msg;
write += 12; write += 12;
va_start(ap, format); va_start(ap, format);
@@ -287,7 +287,7 @@ void sendf(APPL * appl, word command, dword Id, word Number, byte * format, ...)
if (command == _DATA_B3_I) if (command == _DATA_B3_I)
dlength = GET_WORD( dlength = GET_WORD(
((byte *) & msg.info.data_b3_ind.Data_Length)); ((byte *)&msg.info.data_b3_ind.Data_Length));
if (!(dmb = diva_os_alloc_message_buffer(length + dlength, if (!(dmb = diva_os_alloc_message_buffer(length + dlength,
(void **) &write))) { (void **) &write))) {
@@ -296,7 +296,7 @@ void sendf(APPL * appl, word command, dword Id, word Number, byte * format, ...)
} }
/* copy msg header to sk_buff */ /* copy msg header to sk_buff */
memcpy(write, (byte *) & msg, length); memcpy(write, (byte *)&msg, length);
/* if DATA_B3_IND, copy data too */ /* if DATA_B3_IND, copy data too */
if (command == _DATA_B3_I) { if (command == _DATA_B3_I) {
@@ -388,7 +388,7 @@ static void clean_adapter(int id, struct list_head *free_mem_q)
* remove a card, but ensures consistent state of LI tables * remove a card, but ensures consistent state of LI tables
* in the time adapter is removed * in the time adapter is removed
*/ */
static void divacapi_remove_card(DESCRIPTOR * d) static void divacapi_remove_card(DESCRIPTOR *d)
{ {
diva_card *card = NULL; diva_card *card = NULL;
diva_os_spin_lock_magic_t old_irql; diva_os_spin_lock_magic_t old_irql;
@@ -434,7 +434,7 @@ static void divacapi_remove_card(DESCRIPTOR * d)
diva_os_leave_spin_lock(&api_lock, &old_irql, "remove card"); diva_os_leave_spin_lock(&api_lock, &old_irql, "remove card");
/* After releasing the lock, we can free the memory */ /* After releasing the lock, we can free the memory */
diva_os_free (0, card); diva_os_free(0, card);
} }
/* free queued memory areas */ /* free queued memory areas */
@@ -469,7 +469,7 @@ rescan:
/* /*
* sync_callback * sync_callback
*/ */
static void sync_callback(ENTITY * e) static void sync_callback(ENTITY *e)
{ {
diva_os_spin_lock_magic_t old_irql; diva_os_spin_lock_magic_t old_irql;
@@ -483,7 +483,7 @@ static void sync_callback(ENTITY * e)
/* /*
* add a new card * add a new card
*/ */
static int diva_add_card(DESCRIPTOR * d) static int diva_add_card(DESCRIPTOR *d)
{ {
int k = 0, i = 0; int k = 0, i = 0;
diva_os_spin_lock_magic_t old_irql; diva_os_spin_lock_magic_t old_irql;
@@ -492,7 +492,7 @@ static int diva_add_card(DESCRIPTOR * d)
DIVA_CAPI_ADAPTER *a = NULL; DIVA_CAPI_ADAPTER *a = NULL;
IDI_SYNC_REQ sync_req; IDI_SYNC_REQ sync_req;
char serial[16]; char serial[16];
void* mem_to_free; void *mem_to_free;
LI_CONFIG *new_li_config_table; LI_CONFIG *new_li_config_table;
int j; int j;
@@ -504,7 +504,7 @@ static int diva_add_card(DESCRIPTOR * d)
memcpy(&card->d, d, sizeof(DESCRIPTOR)); memcpy(&card->d, d, sizeof(DESCRIPTOR));
sync_req.GetName.Req = 0; sync_req.GetName.Req = 0;
sync_req.GetName.Rc = IDI_SYNC_REQ_GET_NAME; sync_req.GetName.Rc = IDI_SYNC_REQ_GET_NAME;
card->d.request((ENTITY *) & sync_req); card->d.request((ENTITY *)&sync_req);
strlcpy(card->name, sync_req.GetName.name, sizeof(card->name)); strlcpy(card->name, sync_req.GetName.name, sizeof(card->name));
ctrl = &card->capi_ctrl; ctrl = &card->capi_ctrl;
strcpy(ctrl->name, card->name); strcpy(ctrl->name, card->name);
@@ -533,7 +533,7 @@ static int diva_add_card(DESCRIPTOR * d)
sync_req.GetSerial.Req = 0; sync_req.GetSerial.Req = 0;
sync_req.GetSerial.Rc = IDI_SYNC_REQ_GET_SERIAL; sync_req.GetSerial.Rc = IDI_SYNC_REQ_GET_SERIAL;
sync_req.GetSerial.serial = 0; sync_req.GetSerial.serial = 0;
card->d.request((ENTITY *) & sync_req); card->d.request((ENTITY *)&sync_req);
if ((i = ((sync_req.GetSerial.serial & 0xff000000) >> 24))) { if ((i = ((sync_req.GetSerial.serial & 0xff000000) >> 24))) {
sprintf(serial, "%ld-%d", sprintf(serial, "%ld-%d",
sync_req.GetSerial.serial & 0x00ffffff, i + 1); sync_req.GetSerial.serial & 0x00ffffff, i + 1);
@@ -554,7 +554,7 @@ static int diva_add_card(DESCRIPTOR * d)
sync_req.xdi_capi_prms.Rc = IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS; sync_req.xdi_capi_prms.Rc = IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS;
sync_req.xdi_capi_prms.info.structure_length = sync_req.xdi_capi_prms.info.structure_length =
sizeof(diva_xdi_get_capi_parameters_t); sizeof(diva_xdi_get_capi_parameters_t);
card->d.request((ENTITY *) & sync_req); card->d.request((ENTITY *)&sync_req);
a->flag_dynamic_l1_down = a->flag_dynamic_l1_down =
sync_req.xdi_capi_prms.info.flag_dynamic_l1_down; sync_req.xdi_capi_prms.info.flag_dynamic_l1_down;
a->group_optimization_enabled = a->group_optimization_enabled =
@@ -689,7 +689,7 @@ static int diva_add_card(DESCRIPTOR * d)
diva_os_leave_spin_lock(&api_lock, &old_irql, "add card"); diva_os_leave_spin_lock(&api_lock, &old_irql, "add card");
if (mem_to_free) { if (mem_to_free) {
diva_os_free (0, mem_to_free); diva_os_free(0, mem_to_free);
} }
i = 0; i = 0;
@@ -722,7 +722,7 @@ static int diva_add_card(DESCRIPTOR * d)
* register appl * register appl
*/ */
static void diva_register_appl(struct capi_ctr *ctrl, __u16 appl, static void diva_register_appl(struct capi_ctr *ctrl, __u16 appl,
capi_register_params * rp) capi_register_params *rp)
{ {
APPL *this; APPL *this;
word bnum, xnum; word bnum, xnum;
@@ -876,7 +876,7 @@ static void diva_release_appl(struct capi_ctr *ctrl, __u16 appl)
* send message * send message
*/ */
static u16 diva_send_message(struct capi_ctr *ctrl, static u16 diva_send_message(struct capi_ctr *ctrl,
diva_os_message_buffer_s * dmb) diva_os_message_buffer_s *dmb)
{ {
int i = 0; int i = 0;
word ret = 0; word ret = 0;
@@ -996,7 +996,7 @@ static u16 diva_send_message(struct capi_ctr *ctrl,
break; break;
} }
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");
if (retval == CAPI_NOERROR) if (retval == CAPI_NOERROR)
diva_os_free_message_buffer(dmb); diva_os_free_message_buffer(dmb);
@@ -1007,7 +1007,7 @@ static u16 diva_send_message(struct capi_ctr *ctrl,
/* /*
* cards request function * cards request function
*/ */
static void DIRequest(ENTITY * e) static void DIRequest(ENTITY *e)
{ {
DIVA_CAPI_ADAPTER *a = &(adapter[(byte) e->user[0]]); DIVA_CAPI_ADAPTER *a = &(adapter[(byte) e->user[0]]);
diva_card *os_card = (diva_card *) a->os_card; diva_card *os_card = (diva_card *) a->os_card;
@@ -1022,7 +1022,7 @@ static void DIRequest(ENTITY * e)
/* /*
* callback function from didd * callback function from didd
*/ */
static void didd_callback(void *context, DESCRIPTOR * adapter, int removal) static void didd_callback(void *context, DESCRIPTOR *adapter, int removal)
{ {
if (adapter->type == IDI_DADAPTER) { if (adapter->type == IDI_DADAPTER) {
DBG_ERR(("Notification about IDI_DADAPTER change ! Oops.")); DBG_ERR(("Notification about IDI_DADAPTER change ! Oops."));
@@ -1074,7 +1074,7 @@ static int divacapi_connect_didd(void)
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
req.didd_notify.info.callback = (void *)didd_callback; req.didd_notify.info.callback = (void *)didd_callback;
req.didd_notify.info.context = NULL; req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
if (req.didd_notify.e.Rc != 0xff) { if (req.didd_notify.e.Rc != 0xff) {
stop_dbg(); stop_dbg();
return (0); return (0);
@@ -1105,7 +1105,7 @@ static void divacapi_disconnect_didd(void)
req.didd_notify.e.Req = 0; req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY; req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY;
req.didd_notify.info.handle = notify_handle; req.didd_notify.info.handle = notify_handle;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
} }
/* /*
@@ -1176,7 +1176,7 @@ static void do_api_remove_start(void)
if (ret) if (ret)
DBG_ERR(("could not remove signaling ID's")) DBG_ERR(("could not remove signaling ID's"))
} }
/* /*
* init * init

View File

@@ -69,7 +69,7 @@ diva_os_message_buffer_s *diva_os_alloc_message_buffer(unsigned long size,
/* /*
* free a message buffer * free a message buffer
*/ */
void diva_os_free_message_buffer(diva_os_message_buffer_s * dmb) void diva_os_free_message_buffer(diva_os_message_buffer_s *dmb)
{ {
kfree_skb(dmb); kfree_skb(dmb);
} }

View File

@@ -94,7 +94,7 @@
*/ */
#define CARD_UNKNOWN 0 #define CARD_UNKNOWN 0
#define CARD_NONE 0 #define CARD_NONE 0
/* DIVA cards */ /* DIVA cards */
#define CARDTYPE_DIVA_MCA 0 #define CARDTYPE_DIVA_MCA 0
#define CARDTYPE_DIVA_ISA 1 #define CARDTYPE_DIVA_ISA 1
#define CARDTYPE_DIVA_PCM 2 #define CARDTYPE_DIVA_PCM 2
@@ -102,10 +102,10 @@
#define CARDTYPE_DIVAPRO_PCM 4 #define CARDTYPE_DIVAPRO_PCM 4
#define CARDTYPE_DIVAPICO_ISA 5 #define CARDTYPE_DIVAPICO_ISA 5
#define CARDTYPE_DIVAPICO_PCM 6 #define CARDTYPE_DIVAPICO_PCM 6
/* DIVA 2.0 cards */ /* DIVA 2.0 cards */
#define CARDTYPE_DIVAPRO20_PCI 7 #define CARDTYPE_DIVAPRO20_PCI 7
#define CARDTYPE_DIVA20_PCI 8 #define CARDTYPE_DIVA20_PCI 8
/* S cards */ /* S cards */
#define CARDTYPE_QUADRO_ISA 9 #define CARDTYPE_QUADRO_ISA 9
#define CARDTYPE_S_ISA 10 #define CARDTYPE_S_ISA 10
#define CARDTYPE_S_MCA 11 #define CARDTYPE_S_MCA 11
@@ -117,57 +117,57 @@
#define CARDTYPE_SCOM_MCA 17 #define CARDTYPE_SCOM_MCA 17
#define CARDTYPE_PR_ISA 18 #define CARDTYPE_PR_ISA 18
#define CARDTYPE_PR_MCA 19 #define CARDTYPE_PR_MCA 19
/* Diva Server cards (formerly called Maestra, later Amadeo) */ /* Diva Server cards (formerly called Maestra, later Amadeo) */
#define CARDTYPE_MAESTRA_ISA 20 #define CARDTYPE_MAESTRA_ISA 20
#define CARDTYPE_MAESTRA_PCI 21 #define CARDTYPE_MAESTRA_PCI 21
/* Diva Server cards to be developed (Quadro, Primary rate) */ /* Diva Server cards to be developed (Quadro, Primary rate) */
#define CARDTYPE_DIVASRV_Q_8M_PCI 22 #define CARDTYPE_DIVASRV_Q_8M_PCI 22
#define CARDTYPE_DIVASRV_P_30M_PCI 23 #define CARDTYPE_DIVASRV_P_30M_PCI 23
#define CARDTYPE_DIVASRV_P_2M_PCI 24 #define CARDTYPE_DIVASRV_P_2M_PCI 24
#define CARDTYPE_DIVASRV_P_9M_PCI 25 #define CARDTYPE_DIVASRV_P_9M_PCI 25
/* DIVA 2.0 cards */ /* DIVA 2.0 cards */
#define CARDTYPE_DIVA20_ISA 26 #define CARDTYPE_DIVA20_ISA 26
#define CARDTYPE_DIVA20U_ISA 27 #define CARDTYPE_DIVA20U_ISA 27
#define CARDTYPE_DIVA20U_PCI 28 #define CARDTYPE_DIVA20U_PCI 28
#define CARDTYPE_DIVAPRO20_ISA 29 #define CARDTYPE_DIVAPRO20_ISA 29
#define CARDTYPE_DIVAPRO20U_ISA 30 #define CARDTYPE_DIVAPRO20U_ISA 30
#define CARDTYPE_DIVAPRO20U_PCI 31 #define CARDTYPE_DIVAPRO20U_PCI 31
/* DIVA combi cards (piccola ISDN + rockwell V.34 modem) */ /* DIVA combi cards (piccola ISDN + rockwell V.34 modem) */
#define CARDTYPE_DIVAMOBILE_PCM 32 #define CARDTYPE_DIVAMOBILE_PCM 32
#define CARDTYPE_TDKGLOBALPRO_PCM 33 #define CARDTYPE_TDKGLOBALPRO_PCM 33
/* DIVA Pro PC OEM card for 'New Media Corporation' */ /* DIVA Pro PC OEM card for 'New Media Corporation' */
#define CARDTYPE_NMC_DIVAPRO_PCM 34 #define CARDTYPE_NMC_DIVAPRO_PCM 34
/* DIVA Pro 2.0 OEM cards for 'British Telecom' */ /* DIVA Pro 2.0 OEM cards for 'British Telecom' */
#define CARDTYPE_BT_EXLANE_PCI 35 #define CARDTYPE_BT_EXLANE_PCI 35
#define CARDTYPE_BT_EXLANE_ISA 36 #define CARDTYPE_BT_EXLANE_ISA 36
/* DIVA low cost cards, 1st name DIVA 3.0, 2nd DIVA 2.01, 3rd ??? */ /* DIVA low cost cards, 1st name DIVA 3.0, 2nd DIVA 2.01, 3rd ??? */
#define CARDTYPE_DIVALOW_ISA 37 #define CARDTYPE_DIVALOW_ISA 37
#define CARDTYPE_DIVALOWU_ISA 38 #define CARDTYPE_DIVALOWU_ISA 38
#define CARDTYPE_DIVALOW_PCI 39 #define CARDTYPE_DIVALOW_PCI 39
#define CARDTYPE_DIVALOWU_PCI 40 #define CARDTYPE_DIVALOWU_PCI 40
/* DIVA combi cards (piccola ISDN + rockwell V.90 modem) */ /* DIVA combi cards (piccola ISDN + rockwell V.90 modem) */
#define CARDTYPE_DIVAMOBILE_V90_PCM 41 #define CARDTYPE_DIVAMOBILE_V90_PCM 41
#define CARDTYPE_TDKGLOBPRO_V90_PCM 42 #define CARDTYPE_TDKGLOBPRO_V90_PCM 42
#define CARDTYPE_DIVASRV_P_23M_PCI 43 #define CARDTYPE_DIVASRV_P_23M_PCI 43
#define CARDTYPE_DIVALOW_USB 44 #define CARDTYPE_DIVALOW_USB 44
/* DIVA Audio (CT) family */ /* DIVA Audio (CT) family */
#define CARDTYPE_DIVA_CT_ST 45 #define CARDTYPE_DIVA_CT_ST 45
#define CARDTYPE_DIVA_CT_U 46 #define CARDTYPE_DIVA_CT_U 46
#define CARDTYPE_DIVA_CTLITE_ST 47 #define CARDTYPE_DIVA_CTLITE_ST 47
#define CARDTYPE_DIVA_CTLITE_U 48 #define CARDTYPE_DIVA_CTLITE_U 48
/* DIVA ISDN plus V.90 series */ /* DIVA ISDN plus V.90 series */
#define CARDTYPE_DIVAISDN_V90_PCM 49 #define CARDTYPE_DIVAISDN_V90_PCM 49
#define CARDTYPE_DIVAISDN_V90_PCI 50 #define CARDTYPE_DIVAISDN_V90_PCI 50
#define CARDTYPE_DIVAISDN_TA 51 #define CARDTYPE_DIVAISDN_TA 51
/* DIVA Server Voice cards */ /* DIVA Server Voice cards */
#define CARDTYPE_DIVASRV_VOICE_Q_8M_PCI 52 #define CARDTYPE_DIVASRV_VOICE_Q_8M_PCI 52
/* DIVA Server V2 cards */ /* DIVA Server V2 cards */
#define CARDTYPE_DIVASRV_Q_8M_V2_PCI 53 #define CARDTYPE_DIVASRV_Q_8M_V2_PCI 53
#define CARDTYPE_DIVASRV_P_30M_V2_PCI 54 #define CARDTYPE_DIVASRV_P_30M_V2_PCI 54
/* DIVA Server Voice V2 cards */ /* DIVA Server Voice V2 cards */
#define CARDTYPE_DIVASRV_VOICE_Q_8M_V2_PCI 55 #define CARDTYPE_DIVASRV_VOICE_Q_8M_V2_PCI 55
#define CARDTYPE_DIVASRV_VOICE_P_30M_V2_PCI 56 #define CARDTYPE_DIVASRV_VOICE_P_30M_V2_PCI 56
/* Diva LAN */ /* Diva LAN */
#define CARDTYPE_DIVAISDN_LAN 57 #define CARDTYPE_DIVAISDN_LAN 57
#define CARDTYPE_DIVA_202_PCI_ST 58 #define CARDTYPE_DIVA_202_PCI_ST 58
#define CARDTYPE_DIVA_202_PCI_U 59 #define CARDTYPE_DIVA_202_PCI_U 59
@@ -182,7 +182,7 @@
#define CARDTYPE_DIVA_V2_PCM 67 #define CARDTYPE_DIVA_V2_PCM 67
/* Re-badged Diva Pro PC Card */ /* Re-badged Diva Pro PC Card */
#define CARDTYPE_DIVA_PC_CARD 68 #define CARDTYPE_DIVA_PC_CARD 68
/* next free card type identifier */ /* next free card type identifier */
#define CARDTYPE_MAX 69 #define CARDTYPE_MAX 69
/* /*
* The card families * The card families
@@ -262,7 +262,7 @@ typedef struct CARD_PROPERTIES
unsigned short SizeMem; /* size of memory window per adapter */ unsigned short SizeMem; /* size of memory window per adapter */
} CARD_PROPERTIES; } CARD_PROPERTIES;
typedef struct CARD_RESOURCE typedef struct CARD_RESOURCE
{ unsigned char Int [10]; { unsigned char Int[10];
unsigned short IoFirst; unsigned short IoFirst;
unsigned short IoStep; unsigned short IoStep;
unsigned short IoCnt; unsigned short IoCnt;
@@ -272,7 +272,7 @@ typedef struct CARD_RESOURCE
} CARD_RESOURCE; } CARD_RESOURCE;
/* test if the card of type 't' is a plug & play card */ /* test if the card of type 't' is a plug & play card */
#define IS_PNP(t) \ #define IS_PNP(t) \
( \ ( \
( \ ( \
CardProperties[t].Bus != BUS_ISA \ CardProperties[t].Bus != BUS_ISA \
&& \ && \
@@ -284,9 +284,9 @@ typedef struct CARD_RESOURCE
&& \ && \
CardProperties[t].Card != CARD_DIVA \ CardProperties[t].Card != CARD_DIVA \
) \ ) \
) )
/* extract IDI Descriptor info for card type 't' (p == DescType/Features) */ /* extract IDI Descriptor info for card type 't' (p == DescType/Features) */
#define IDI_PROP(t,p) (CardProperties[t].p) #define IDI_PROP(t, p) (CardProperties[t].p)
#if CARDTYPE_H_WANT_DATA #if CARDTYPE_H_WANT_DATA
#if CARDTYPE_H_WANT_IDI_DATA #if CARDTYPE_H_WANT_IDI_DATA
/* include "di_defs.h" for IDI adapter type and feature flag definitions */ /* include "di_defs.h" for IDI adapter type and feature flag definitions */
@@ -328,502 +328,502 @@ typedef struct CARD_RESOURCE
#define DI_SOFT_V110 0 #define DI_SOFT_V110 0
#endif #endif
/*--- CardProperties [Index=CARDTYPE_....] ---------------------------------*/ /*--- CardProperties [Index=CARDTYPE_....] ---------------------------------*/
CARD_PROPERTIES CardProperties [ ] = CARD_PROPERTIES CardProperties[] =
{ {
{ /* 0 */ { /* 0 */
"Diva MCA", 0x6336, 0x0100, "Diva MCA", 0x6336, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3,
CARD_DIVA, CARD_I_NONE, BUS_MCA, CHIP_DSP, CARD_DIVA, CARD_I_NONE, BUS_MCA, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 1 */ { /* 1 */
"Diva ISA", 0x0000, 0x0100, "Diva ISA", 0x0000, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3,
CARD_DIVA, CARD_I_NONE, BUS_ISA, CHIP_DSP, CARD_DIVA, CARD_I_NONE, BUS_ISA, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 2 */ { /* 2 */
"Diva/PCM", 0x0000, 0x0100, "Diva/PCM", 0x0000, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3,
CARD_DIVA, CARD_I_NONE, BUS_PCM, CHIP_DSP, CARD_DIVA, CARD_I_NONE, BUS_PCM, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 3 */ { /* 3 */
"Diva PRO ISA", 0x0031, 0x0100, "Diva PRO ISA", 0x0031, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC,
CARD_PRO, CARD_I_NONE, BUS_ISA, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_ISA, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 4 */ { /* 4 */
"Diva PRO PC-Card", 0x0000, 0x0100, "Diva PRO PC-Card", 0x0000, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_PRO, CARD_I_NONE, BUS_PCM, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_PCM, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 5 */ { /* 5 */
"Diva PICCOLA ISA", 0x0051, 0x0100, "Diva PICCOLA ISA", 0x0051, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_ISA, CHIP_HSCX, CARD_PICO, CARD_I_NONE, BUS_ISA, CHIP_HSCX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 6 */ { /* 6 */
"Diva PICCOLA PCM", 0x0000, 0x0100, "Diva PICCOLA PCM", 0x0000, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_HSCX, CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_HSCX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 7 */ { /* 7 */
"Diva PRO 2.0 S/T PCI", 0xe001, 0x0200, "Diva PRO 2.0 S/T PCI", 0xe001, 0x0200,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS,
CARD_PRO, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 8 */ { /* 8 */
"Diva 2.0 S/T PCI", 0xe002, 0x0200, "Diva 2.0 S/T PCI", 0xe002, 0x0200,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | DI_POTS | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | DI_POTS | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_PCI, CHIP_HSCX, CARD_PICO, CARD_I_NONE, BUS_PCI, CHIP_HSCX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 9 */ { /* 9 */
"QUADRO ISA", 0x0000, 0x0100, "QUADRO ISA", 0x0000, 0x0100,
IDI_ADAPTER_S, FAMILY_S, DI_NULL, IDI_ADAPTER_S, FAMILY_S, DI_NULL,
CARD_QUAD, CARD_I_QUAD, BUS_ISA, CHIP_NONE, CARD_QUAD, CARD_I_QUAD, BUS_ISA, CHIP_NONE,
4, 2, 16, 0, 0x800 4, 2, 16, 0, 0x800
}, },
{ /* 10 */ { /* 10 */
"S ISA", 0x0000, 0x0100, "S ISA", 0x0000, 0x0100,
IDI_ADAPTER_S, FAMILY_S, DI_CODEC, IDI_ADAPTER_S, FAMILY_S, DI_CODEC,
CARD_S, CARD_I_S, BUS_ISA, CHIP_NONE, CARD_S, CARD_I_S, BUS_ISA, CHIP_NONE,
1, 1, 16, 0, 0x800 1, 1, 16, 0, 0x800
}, },
{ /* 11 */ { /* 11 */
"S MCA", 0x6a93, 0x0100, "S MCA", 0x6a93, 0x0100,
IDI_ADAPTER_S, FAMILY_S, DI_CODEC, IDI_ADAPTER_S, FAMILY_S, DI_CODEC,
CARD_S, CARD_I_S, BUS_MCA, CHIP_NONE, CARD_S, CARD_I_S, BUS_MCA, CHIP_NONE,
1, 1, 16, 16, 0x400 1, 1, 16, 16, 0x400
}, },
{ /* 12 */ { /* 12 */
"SX ISA", 0x0000, 0x0100, "SX ISA", 0x0000, 0x0100,
IDI_ADAPTER_S, FAMILY_S, DI_NULL, IDI_ADAPTER_S, FAMILY_S, DI_NULL,
CARD_SX, CARD_I_SX, BUS_ISA, CHIP_NONE, CARD_SX, CARD_I_SX, BUS_ISA, CHIP_NONE,
1, 2, 16, 0, 0x800 1, 2, 16, 0, 0x800
}, },
{ /* 13 */ { /* 13 */
"SX MCA", 0x6a93, 0x0100, "SX MCA", 0x6a93, 0x0100,
IDI_ADAPTER_S, FAMILY_S, DI_NULL, IDI_ADAPTER_S, FAMILY_S, DI_NULL,
CARD_SX, CARD_I_SX, BUS_MCA, CHIP_NONE, CARD_SX, CARD_I_SX, BUS_MCA, CHIP_NONE,
1, 2, 16, 16, 0x400 1, 2, 16, 16, 0x400
}, },
{ /* 14 */ { /* 14 */
"SXN ISA", 0x0000, 0x0100, "SXN ISA", 0x0000, 0x0100,
IDI_ADAPTER_S, FAMILY_S, DI_NULL, IDI_ADAPTER_S, FAMILY_S, DI_NULL,
CARD_SXN, CARD_I_SCOM, BUS_ISA, CHIP_NONE, CARD_SXN, CARD_I_SCOM, BUS_ISA, CHIP_NONE,
1, 2, 16, 0, 0x800 1, 2, 16, 0, 0x800
}, },
{ /* 15 */ { /* 15 */
"SXN MCA", 0x6a93, 0x0100, "SXN MCA", 0x6a93, 0x0100,
IDI_ADAPTER_S, FAMILY_S, DI_NULL, IDI_ADAPTER_S, FAMILY_S, DI_NULL,
CARD_SXN, CARD_I_SCOM, BUS_MCA, CHIP_NONE, CARD_SXN, CARD_I_SCOM, BUS_MCA, CHIP_NONE,
1, 2, 16, 16, 0x400 1, 2, 16, 16, 0x400
}, },
{ /* 16 */ { /* 16 */
"SCOM ISA", 0x0000, 0x0100, "SCOM ISA", 0x0000, 0x0100,
IDI_ADAPTER_S, FAMILY_S, DI_CODEC, IDI_ADAPTER_S, FAMILY_S, DI_CODEC,
CARD_SCOM, CARD_I_SCOM, BUS_ISA, CHIP_NONE, CARD_SCOM, CARD_I_SCOM, BUS_ISA, CHIP_NONE,
1, 2, 16, 0, 0x800 1, 2, 16, 0, 0x800
}, },
{ /* 17 */ { /* 17 */
"SCOM MCA", 0x6a93, 0x0100, "SCOM MCA", 0x6a93, 0x0100,
IDI_ADAPTER_S, FAMILY_S, DI_CODEC, IDI_ADAPTER_S, FAMILY_S, DI_CODEC,
CARD_SCOM, CARD_I_SCOM, BUS_MCA, CHIP_NONE, CARD_SCOM, CARD_I_SCOM, BUS_MCA, CHIP_NONE,
1, 2, 16, 16, 0x400 1, 2, 16, 16, 0x400
}, },
{ /* 18 */ { /* 18 */
"S2M ISA", 0x0000, 0x0100, "S2M ISA", 0x0000, 0x0100,
IDI_ADAPTER_PR, FAMILY_S, DI_NULL, IDI_ADAPTER_PR, FAMILY_S, DI_NULL,
CARD_PR, CARD_I_PR, BUS_ISA, CHIP_NONE, CARD_PR, CARD_I_PR, BUS_ISA, CHIP_NONE,
1, 30, 256, 0, 0x4000 1, 30, 256, 0, 0x4000
}, },
{ /* 19 */ { /* 19 */
"S2M MCA", 0x6abb, 0x0100, "S2M MCA", 0x6abb, 0x0100,
IDI_ADAPTER_PR, FAMILY_S, DI_NULL, IDI_ADAPTER_PR, FAMILY_S, DI_NULL,
CARD_PR, CARD_I_PR, BUS_MCA, CHIP_NONE, CARD_PR, CARD_I_PR, BUS_MCA, CHIP_NONE,
1, 30, 256, 16, 0x4000 1, 30, 256, 16, 0x4000
}, },
{ /* 20 */ { /* 20 */
"Diva Server BRI-2M ISA", 0x0041, 0x0100, "Diva Server BRI-2M ISA", 0x0041, 0x0100,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_MAE, CARD_I_NONE, BUS_ISA, CHIP_DSP, CARD_MAE, CARD_I_NONE, BUS_ISA, CHIP_DSP,
1, 2, 16, 8, 0 1, 2, 16, 8, 0
}, },
{ /* 21 */ { /* 21 */
"Diva Server BRI-2M PCI", 0xE010, 0x0100, "Diva Server BRI-2M PCI", 0xE010, 0x0100,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_MAE, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAE, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 16, 8, 0 1, 2, 16, 8, 0
}, },
{ /* 22 */ { /* 22 */
"Diva Server 4BRI-8M PCI", 0xE012, 0x0100, "Diva Server 4BRI-8M PCI", 0xE012, 0x0100,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_MAEQ, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAEQ, CARD_I_NONE, BUS_PCI, CHIP_DSP,
4, 2, 16, 8, 0 4, 2, 16, 8, 0
}, },
{ /* 23 */ { /* 23 */
"Diva Server PRI-30M PCI", 0xE014, 0x0100, "Diva Server PRI-30M PCI", 0xE014, 0x0100,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 30, 256, 8, 0 1, 30, 256, 8, 0
}, },
{ /* 24 */ { /* 24 */
"Diva Server PRI-2M PCI", 0xe014, 0x0100, "Diva Server PRI-2M PCI", 0xe014, 0x0100,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 30, 256, 8, 0 1, 30, 256, 8, 0
}, },
{ /* 25 */ { /* 25 */
"Diva Server PRI-9M PCI", 0x0000, 0x0100, "Diva Server PRI-9M PCI", 0x0000, 0x0100,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 30, 256, 8, 0 1, 30, 256, 8, 0
}, },
{ /* 26 */ { /* 26 */
"Diva 2.0 S/T ISA", 0x0071, 0x0200, "Diva 2.0 S/T ISA", 0x0071, 0x0200,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | DI_POTS | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | DI_POTS | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_ISA, CHIP_HSCX, CARD_PICO, CARD_I_NONE, BUS_ISA, CHIP_HSCX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 27 */ { /* 27 */
"Diva 2.0 U ISA", 0x0091, 0x0200, "Diva 2.0 U ISA", 0x0091, 0x0200,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | DI_POTS | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | DI_POTS | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_ISA, CHIP_HSCX, CARD_PICO, CARD_I_NONE, BUS_ISA, CHIP_HSCX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 28 */ { /* 28 */
"Diva 2.0 U PCI", 0xe004, 0x0200, "Diva 2.0 U PCI", 0xe004, 0x0200,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | DI_POTS | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | DI_POTS | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_PCI, CHIP_HSCX, CARD_PICO, CARD_I_NONE, BUS_PCI, CHIP_HSCX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 29 */ { /* 29 */
"Diva PRO 2.0 S/T ISA", 0x0061, 0x0200, "Diva PRO 2.0 S/T ISA", 0x0061, 0x0200,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS,
CARD_PRO, CARD_I_NONE, BUS_ISA, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_ISA, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 30 */ { /* 30 */
"Diva PRO 2.0 U ISA", 0x0081, 0x0200, "Diva PRO 2.0 U ISA", 0x0081, 0x0200,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS,
CARD_PRO, CARD_I_NONE, BUS_ISA, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_ISA, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 31 */ { /* 31 */
"Diva PRO 2.0 U PCI", 0xe003, 0x0200, "Diva PRO 2.0 U PCI", 0xe003, 0x0200,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS,
CARD_PRO, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 32 */ { /* 32 */
"Diva MOBILE", 0x0000, 0x0100, "Diva MOBILE", 0x0000, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_HSCX, CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_HSCX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 33 */ { /* 33 */
"TDK DFI3600", 0x0000, 0x0100, "TDK DFI3600", 0x0000, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_HSCX, CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_HSCX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 34 (OEM version of 4 - "Diva PRO PC-Card") */ { /* 34 (OEM version of 4 - "Diva PRO PC-Card") */
"New Media ISDN", 0x0000, 0x0100, "New Media ISDN", 0x0000, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_PRO, CARD_I_NONE, BUS_PCM, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_PCM, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 35 (OEM version of 7 - "Diva PRO 2.0 S/T PCI") */ { /* 35 (OEM version of 7 - "Diva PRO 2.0 S/T PCI") */
"BT ExLane PCI", 0xe101, 0x0200, "BT ExLane PCI", 0xe101, 0x0200,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS,
CARD_PRO, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 36 (OEM version of 29 - "Diva PRO 2.0 S/T ISA") */ { /* 36 (OEM version of 29 - "Diva PRO 2.0 S/T ISA") */
"BT ExLane ISA", 0x1061, 0x0200, "BT ExLane ISA", 0x1061, 0x0200,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_POTS,
CARD_PRO, CARD_I_NONE, BUS_ISA, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_ISA, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 37 */ { /* 37 */
"Diva 2.01 S/T ISA", 0x00A1, 0x0300, "Diva 2.01 S/T ISA", 0x00A1, 0x0300,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_DIVALOW, CARD_I_NONE, BUS_ISA, CHIP_IPAC, CARD_DIVALOW, CARD_I_NONE, BUS_ISA, CHIP_IPAC,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 38 */ { /* 38 */
"Diva 2.01 U ISA", 0x00B1, 0x0300, "Diva 2.01 U ISA", 0x00B1, 0x0300,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_DIVALOW, CARD_I_NONE, BUS_ISA, CHIP_IPAC, CARD_DIVALOW, CARD_I_NONE, BUS_ISA, CHIP_IPAC,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 39 */ { /* 39 */
"Diva 2.01 S/T PCI", 0xe005, 0x0300, "Diva 2.01 S/T PCI", 0xe005, 0x0300,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_DIVALOW, CARD_I_NONE, BUS_PCI, CHIP_IPAC, CARD_DIVALOW, CARD_I_NONE, BUS_PCI, CHIP_IPAC,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 40 no ID yet */ { /* 40 no ID yet */
"Diva 2.01 U PCI", 0x0000, 0x0300, "Diva 2.01 U PCI", 0x0000, 0x0300,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_DIVALOW, CARD_I_NONE, BUS_PCI, CHIP_IPAC, CARD_DIVALOW, CARD_I_NONE, BUS_PCI, CHIP_IPAC,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 41 */ { /* 41 */
"Diva MOBILE V.90", 0x0000, 0x0100, "Diva MOBILE V.90", 0x0000, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_HSCX, CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_HSCX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 42 */ { /* 42 */
"TDK DFI3600 V.90", 0x0000, 0x0100, "TDK DFI3600 V.90", 0x0000, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_HSCX, CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_HSCX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 43 */ { /* 43 */
"Diva Server PRI-23M PCI", 0xe014, 0x0100, "Diva Server PRI-23M PCI", 0xe014, 0x0100,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 30, 256, 8, 0 1, 30, 256, 8, 0
}, },
{ /* 44 */ { /* 44 */
"Diva 2.01 S/T USB", 0x1000, 0x0300, "Diva 2.01 S/T USB", 0x1000, 0x0300,
IDI_ADAPTER_DIVA ,FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA , FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_DIVALOW, CARD_I_NONE, BUS_USB, CHIP_IPAC, CARD_DIVALOW, CARD_I_NONE, BUS_USB, CHIP_IPAC,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 45 */ { /* 45 */
"Diva CT S/T PCI", 0xe006, 0x0300, "Diva CT S/T PCI", 0xe006, 0x0300,
IDI_ADAPTER_DIVA ,FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC, IDI_ADAPTER_DIVA , FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC,
CARD_CT, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_CT, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 0, 0, 0 1, 2, 0, 0, 0
}, },
{ /* 46 */ { /* 46 */
"Diva CT U PCI", 0xe007, 0x0300, "Diva CT U PCI", 0xe007, 0x0300,
IDI_ADAPTER_DIVA ,FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC, IDI_ADAPTER_DIVA , FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC,
CARD_CT, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_CT, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 0, 0, 0 1, 2, 0, 0, 0
}, },
{ /* 47 */ { /* 47 */
"Diva CT Lite S/T PCI", 0xe008, 0x0300, "Diva CT Lite S/T PCI", 0xe008, 0x0300,
IDI_ADAPTER_DIVA ,FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC, IDI_ADAPTER_DIVA , FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC,
CARD_CT, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_CT, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 0, 0, 0 1, 2, 0, 0, 0
}, },
{ /* 48 */ { /* 48 */
"Diva CT Lite U PCI", 0xe009, 0x0300, "Diva CT Lite U PCI", 0xe009, 0x0300,
IDI_ADAPTER_DIVA ,FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC, IDI_ADAPTER_DIVA , FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC,
CARD_CT, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_CT, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 0, 0, 0 1, 2, 0, 0, 0
}, },
{ /* 49 */ { /* 49 */
"Diva ISDN+V.90 PC Card", 0x8D8C, 0x0100, "Diva ISDN+V.90 PC Card", 0x8D8C, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC,
CARD_DIVALOW, CARD_I_NONE, BUS_PCM, CHIP_IPAC, CARD_DIVALOW, CARD_I_NONE, BUS_PCM, CHIP_IPAC,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 50 */ { /* 50 */
"Diva ISDN+V.90 PCI", 0xe00A, 0x0100, "Diva ISDN+V.90 PCI", 0xe00A, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_DIVALOW, CARD_I_NONE, BUS_PCI, CHIP_IPAC, CARD_DIVALOW, CARD_I_NONE, BUS_PCI, CHIP_IPAC,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 51 (DivaTA) no ID */ { /* 51 (DivaTA) no ID */
"Diva TA", 0x0000, 0x0300, "Diva TA", 0x0000, 0x0300,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V110 | DI_FAX3 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V110 | DI_FAX3 | SOFT_DSP_ADD_FEATURES,
CARD_DIVATA, CARD_I_NONE, BUS_COM, CHIP_EXTERN, CARD_DIVATA, CARD_I_NONE, BUS_COM, CHIP_EXTERN,
1, 1, 0, 8, 0 1, 1, 0, 8, 0
}, },
{ /* 52 (Diva Server 4BRI-8M PCI adapter enabled for Voice) */ { /* 52 (Diva Server 4BRI-8M PCI adapter enabled for Voice) */
"Diva Server Voice 4BRI-8M PCI", 0xE016, 0x0100, "Diva Server Voice 4BRI-8M PCI", 0xE016, 0x0100,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_VOICE_OVER_IP, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_VOICE_OVER_IP,
CARD_MAEQ, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAEQ, CARD_I_NONE, BUS_PCI, CHIP_DSP,
4, 2, 16, 8, 0 4, 2, 16, 8, 0
}, },
{ /* 53 (Diva Server 4BRI 2.0 adapter) */ { /* 53 (Diva Server 4BRI 2.0 adapter) */
"Diva Server 4BRI-8M 2.0 PCI", 0xE013, 0x0200, "Diva Server 4BRI-8M 2.0 PCI", 0xE013, 0x0200,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_MAEQ, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAEQ, CARD_I_NONE, BUS_PCI, CHIP_DSP,
4, 2, 16, 8, 0 4, 2, 16, 8, 0
}, },
{ /* 54 (Diva Server PRI 2.0 adapter) */ { /* 54 (Diva Server PRI 2.0 adapter) */
"Diva Server PRI 2.0 PCI", 0xE015, 0x0200, "Diva Server PRI 2.0 PCI", 0xE015, 0x0200,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 30, 256, 8, 0 1, 30, 256, 8, 0
}, },
{ /* 55 (Diva Server 4BRI-8M 2.0 PCI adapter enabled for Voice) */ { /* 55 (Diva Server 4BRI-8M 2.0 PCI adapter enabled for Voice) */
"Diva Server Voice 4BRI-8M 2.0 PCI", 0xE017, 0x0200, "Diva Server Voice 4BRI-8M 2.0 PCI", 0xE017, 0x0200,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_VOICE_OVER_IP, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_VOICE_OVER_IP,
CARD_MAEQ, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAEQ, CARD_I_NONE, BUS_PCI, CHIP_DSP,
4, 2, 16, 8, 0 4, 2, 16, 8, 0
}, },
{ /* 56 (Diva Server PRI 2.0 PCI adapter enabled for Voice) */ { /* 56 (Diva Server PRI 2.0 PCI adapter enabled for Voice) */
"Diva Server Voice PRI 2.0 PCI", 0xE019, 0x0200, "Diva Server Voice PRI 2.0 PCI", 0xE019, 0x0200,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_VOICE_OVER_IP, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_VOICE_OVER_IP,
CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAEP, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 30, 256, 8, 0 1, 30, 256, 8, 0
}, },
{ {
/* 57 (DivaLan ) no ID */ /* 57 (DivaLan ) no ID */
"Diva LAN", 0x0000, 0x0300, "Diva LAN", 0x0000, 0x0300,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V110 | DI_FAX3 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V110 | DI_FAX3 | SOFT_DSP_ADD_FEATURES,
CARD_DIVALAN, CARD_I_NONE, BUS_LAN, CHIP_EXTERN, CARD_DIVALAN, CARD_I_NONE, BUS_LAN, CHIP_EXTERN,
1, 1, 0, 8, 0 1, 1, 0, 8, 0
}, },
{ /* 58 */ { /* 58 */
"Diva 2.02 PCI S/T", 0xE00B, 0x0300, "Diva 2.02 PCI S/T", 0xE00B, 0x0300,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES | DI_SOFT_V110, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES | DI_SOFT_V110,
CARD_DIVALOW, CARD_I_NONE, BUS_PCI, CHIP_IPACX, CARD_DIVALOW, CARD_I_NONE, BUS_PCI, CHIP_IPACX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 59 */ { /* 59 */
"Diva 2.02 PCI U", 0xE00C, 0x0300, "Diva 2.02 PCI U", 0xE00C, 0x0300,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_DIVALOW, CARD_I_NONE, BUS_PCI, CHIP_IPACX, CARD_DIVALOW, CARD_I_NONE, BUS_PCI, CHIP_IPACX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 60 */ { /* 60 */
"Diva Server BRI-2M 2.0 PCI", 0xE018, 0x0200, "Diva Server BRI-2M 2.0 PCI", 0xE018, 0x0200,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_MAE2, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAE2, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 16, 8, 0 1, 2, 16, 8, 0
}, },
{ /* 61 (the previous name was Diva Server BRI-2F 2.0 PCI) */ { /* 61 (the previous name was Diva Server BRI-2F 2.0 PCI) */
"Diva Server 2FX", 0xE01A, 0x0200, "Diva Server 2FX", 0xE01A, 0x0200,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_SOFT_V110, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_SOFT_V110,
CARD_MAE2, CARD_I_NONE, BUS_PCI, CHIP_IPACX, CARD_MAE2, CARD_I_NONE, BUS_PCI, CHIP_IPACX,
1, 2, 16, 8, 0 1, 2, 16, 8, 0
}, },
{ /* 62 */ { /* 62 */
" Diva ISDN USB 2.0", 0x1003, 0x0300, " Diva ISDN USB 2.0", 0x1003, 0x0300,
IDI_ADAPTER_DIVA ,FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA , FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_DIVALOW, CARD_I_NONE, BUS_USB, CHIP_IPACX, CARD_DIVALOW, CARD_I_NONE, BUS_USB, CHIP_IPACX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 63 (Diva Server BRI-2M 2.0 PCI adapter enabled for Voice) */ { /* 63 (Diva Server BRI-2M 2.0 PCI adapter enabled for Voice) */
"Diva Server Voice BRI-2M 2.0 PCI", 0xE01B, 0x0200, "Diva Server Voice BRI-2M 2.0 PCI", 0xE01B, 0x0200,
IDI_ADAPTER_MAESTRA,FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_VOICE_OVER_IP, IDI_ADAPTER_MAESTRA, FAMILY_MAESTRA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_VOICE_OVER_IP,
CARD_MAE2, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_MAE2, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 16, 8, 0 1, 2, 16, 8, 0
}, },
{ /* 64 */ { /* 64 */
"Diva Pro 3.0 PCI", 0xe00d, 0x0300, "Diva Pro 3.0 PCI", 0xe00d, 0x0300,
IDI_ADAPTER_DIVA ,FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM, IDI_ADAPTER_DIVA , FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM,
CARD_PRO, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 0, 0, 0 1, 2, 0, 0, 0
}, },
{ /* 65 */ { /* 65 */
"Diva ISDN + CT 2.0", 0xE00E, 0x0300, "Diva ISDN + CT 2.0", 0xE00E, 0x0300,
IDI_ADAPTER_DIVA ,FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC, IDI_ADAPTER_DIVA , FAMILY_DIVA, DI_V1x0 | DI_FAX3 | DI_MODEM | DI_CODEC,
CARD_CT, CARD_I_NONE, BUS_PCI, CHIP_DSP, CARD_CT, CARD_I_NONE, BUS_PCI, CHIP_DSP,
1, 2, 0, 0, 0 1, 2, 0, 0, 0
}, },
{ /* 66 */ { /* 66 */
"Diva Mobile V.90 PC Card", 0x8331, 0x0100, "Diva Mobile V.90 PC Card", 0x8331, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_IPACX, CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_IPACX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 67 */ { /* 67 */
"Diva ISDN PC Card", 0x8311, 0x0100, "Diva ISDN PC Card", 0x8311, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_IPACX, CARD_PICO, CARD_I_NONE, BUS_PCM, CHIP_IPACX,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
{ /* 68 */ { /* 68 */
"Diva ISDN PC Card", 0x0000, 0x0100, "Diva ISDN PC Card", 0x0000, 0x0100,
IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES, IDI_ADAPTER_DIVA, FAMILY_DIVA, DI_V120 | SOFT_DSP_ADD_FEATURES,
CARD_PRO, CARD_I_NONE, BUS_PCM, CHIP_DSP, CARD_PRO, CARD_I_NONE, BUS_PCM, CHIP_DSP,
1, 2, 0, 8, 0 1, 2, 0, 8, 0
}, },
} ; };
#if CARDTYPE_H_WANT_RESOURCE_DATA #if CARDTYPE_H_WANT_RESOURCE_DATA
/*--- CardResource [Index=CARDTYPE_....] ---------------------------(GEI)-*/ /*--- CardResource [Index=CARDTYPE_....] ---------------------------(GEI)-*/
CARD_RESOURCE CardResource [ ] = { CARD_RESOURCE CardResource[] = {
/* Interrupts IO-Address Mem-Address */ /* Interrupts IO-Address Mem-Address */
/* 0*/ { 3,4,9,0,0,0,0,0,0,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA MCA /* 0*/ { 3,4,9,0,0,0,0,0,0,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA MCA
/* 1*/ { 3,4,9,10,11,12,0,0,0,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA ISA /* 1*/ { 3,4,9,10,11,12,0,0,0,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA ISA
/* 2*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA PCMCIA /* 2*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA PCMCIA
/* 3*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA PRO ISA /* 3*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA PRO ISA
/* 4*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA PRO PCMCIA /* 4*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA PRO PCMCIA
/* 5*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA PICCOLA ISA /* 5*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA PICCOLA ISA
/* 6*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA PICCOLA PCMCIA /* 6*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA PICCOLA PCMCIA
/* 7*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA PRO 2.0 PCI /* 7*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA PRO 2.0 PCI
/* 8*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.0 PCI /* 8*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.0 PCI
/* 9*/ { 3,4,5,7,9,10,11,12,0,0, 0x0,0x0,0, 0x80000,0x2000,64 }, // QUADRO ISA /* 9*/ { 3,4,5,7,9,10,11,12,0,0, 0x0,0x0,0, 0x80000,0x2000,64 }, // QUADRO ISA
/*10*/ { 3,4,9,10,11,12,0,0,0,0, 0x0,0x0,0, 0xc0000,0x2000,16 }, // S ISA /*10*/ { 3,4,9,10,11,12,0,0,0,0, 0x0,0x0,0, 0xc0000,0x2000,16 }, // S ISA
/*11*/ { 3,4,9,0,0,0,0,0,0,0, 0xc00,0x10,16, 0xc0000,0x2000,16 }, // S MCA /*11*/ { 3,4,9,0,0,0,0,0,0,0, 0xc00,0x10,16, 0xc0000,0x2000,16 }, // S MCA
/*12*/ { 3,4,9,10,11,12,0,0,0,0, 0x0,0x0,0, 0xc0000,0x2000,16 }, // SX ISA /*12*/ { 3,4,9,10,11,12,0,0,0,0, 0x0,0x0,0, 0xc0000,0x2000,16 }, // SX ISA
/*13*/ { 3,4,9,0,0,0,0,0,0,0, 0xc00,0x10,16, 0xc0000,0x2000,16 }, // SX MCA /*13*/ { 3,4,9,0,0,0,0,0,0,0, 0xc00,0x10,16, 0xc0000,0x2000,16 }, // SX MCA
/*14*/ { 3,4,5,7,9,10,11,12,0,0, 0x0,0x0,0, 0x80000,0x0800,256 }, // SXN ISA /*14*/ { 3,4,5,7,9,10,11,12,0,0, 0x0,0x0,0, 0x80000,0x0800,256 }, // SXN ISA
/*15*/ { 3,4,9,0,0,0,0,0,0,0, 0xc00,0x10,16, 0xc0000,0x2000,16 }, // SXN MCA /*15*/ { 3,4,9,0,0,0,0,0,0,0, 0xc00,0x10,16, 0xc0000,0x2000,16 }, // SXN MCA
/*16*/ { 3,4,5,7,9,10,11,12,0,0, 0x0,0x0,0, 0x80000,0x0800,256 }, // SCOM ISA /*16*/ { 3,4,5,7,9,10,11,12,0,0, 0x0,0x0,0, 0x80000,0x0800,256 }, // SCOM ISA
/*17*/ { 3,4,9,0,0,0,0,0,0,0, 0xc00,0x10,16, 0xc0000,0x2000,16 }, // SCOM MCA /*17*/ { 3,4,9,0,0,0,0,0,0,0, 0xc00,0x10,16, 0xc0000,0x2000,16 }, // SCOM MCA
/*18*/ { 3,4,5,7,9,10,11,12,0,0, 0x0,0x0,0, 0xc0000,0x4000,16 }, // S2M ISA /*18*/ { 3,4,5,7,9,10,11,12,0,0, 0x0,0x0,0, 0xc0000,0x4000,16 }, // S2M ISA
/*19*/ { 3,4,9,0,0,0,0,0,0,0, 0xc00,0x10,16, 0xc0000,0x4000,16 }, // S2M MCA /*19*/ { 3,4,9,0,0,0,0,0,0,0, 0xc00,0x10,16, 0xc0000,0x4000,16 }, // S2M MCA
/*20*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // MAESTRA ISA /*20*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // MAESTRA ISA
/*21*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // MAESTRA PCI /*21*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // MAESTRA PCI
/*22*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // MAESTRA QUADRO ISA /*22*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // MAESTRA QUADRO ISA
/*23*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x20,2048, 0x0,0x0,0 }, // MAESTRA QUADRO PCI /*23*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x20,2048, 0x0,0x0,0 }, // MAESTRA QUADRO PCI
/*24*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // MAESTRA PRIMARY ISA /*24*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // MAESTRA PRIMARY ISA
/*25*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // MAESTRA PRIMARY PCI /*25*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // MAESTRA PRIMARY PCI
/*26*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA 2.0 ISA /*26*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA 2.0 ISA
/*27*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA 2.0 /U ISA /*27*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA 2.0 /U ISA
/*28*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.0 /U PCI /*28*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.0 /U PCI
/*29*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA PRO 2.0 ISA /*29*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA PRO 2.0 ISA
/*30*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA PRO 2.0 /U ISA /*30*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA PRO 2.0 /U ISA
/*31*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA PRO 2.0 /U PCI /*31*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA PRO 2.0 /U PCI
/*32*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA MOBILE /*32*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA MOBILE
/*33*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // TDK DFI3600 (same as DIVA MOBILE [32]) /*33*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // TDK DFI3600 (same as DIVA MOBILE [32])
/*34*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // New Media ISDN (same as DIVA PRO PCMCIA [4]) /*34*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // New Media ISDN (same as DIVA PRO PCMCIA [4])
/*35*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // BT ExLane PCI (same as DIVA PRO 2.0 PCI [7]) /*35*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // BT ExLane PCI (same as DIVA PRO 2.0 PCI [7])
/*36*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // BT ExLane ISA (same as DIVA PRO 2.0 ISA [29]) /*36*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // BT ExLane ISA (same as DIVA PRO 2.0 ISA [29])
/*37*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA 2.01 S/T ISA /*37*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA 2.01 S/T ISA
/*38*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA 2.01 U ISA /*38*/ { 3,5,7,9,10,11,12,14,15,0, 0x200,0x20,16, 0x0,0x0,0 }, // DIVA 2.01 U ISA
/*39*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.01 S/T PCI /*39*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.01 S/T PCI
/*40*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.01 U PCI /*40*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.01 U PCI
/*41*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA MOBILE V.90 /*41*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA MOBILE V.90
/*42*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // TDK DFI3600 V.90 (same as DIVA MOBILE V.90 [39]) /*42*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // TDK DFI3600 V.90 (same as DIVA MOBILE V.90 [39])
/*43*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x20,2048, 0x0,0x0,0 }, // DIVA Server PRI-23M PCI /*43*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x20,2048, 0x0,0x0,0 }, // DIVA Server PRI-23M PCI
/*44*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA 2.01 S/T USB /*44*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA 2.01 S/T USB
/*45*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA CT S/T PCI /*45*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA CT S/T PCI
/*46*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA CT U PCI /*46*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA CT U PCI
/*47*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA CT Lite S/T PCI /*47*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA CT Lite S/T PCI
/*48*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA CT Lite U PCI /*48*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA CT Lite U PCI
/*49*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA ISDN+V.90 PC Card /*49*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA ISDN+V.90 PC Card
/*50*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA ISDN+V.90 PCI /*50*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA ISDN+V.90 PCI
/*51*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA TA /*51*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA TA
/*52*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x20,2048, 0x0,0x0,0 }, // MAESTRA VOICE QUADRO PCI /*52*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x20,2048, 0x0,0x0,0 }, // MAESTRA VOICE QUADRO PCI
/*53*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x20,2048, 0x0,0x0,0 }, // MAESTRA VOICE QUADRO PCI /*53*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x20,2048, 0x0,0x0,0 }, // MAESTRA VOICE QUADRO PCI
/*54*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // MAESTRA VOICE PRIMARY PCI /*54*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // MAESTRA VOICE PRIMARY PCI
/*55*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x20,2048, 0x0,0x0,0 }, // MAESTRA VOICE QUADRO PCI /*55*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x20,2048, 0x0,0x0,0 }, // MAESTRA VOICE QUADRO PCI
/*56*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // MAESTRA VOICE PRIMARY PCI /*56*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // MAESTRA VOICE PRIMARY PCI
/*57*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA LAN /*57*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA LAN
/*58*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.02 S/T PCI /*58*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.02 S/T PCI
/*59*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.02 U PCI /*59*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 2.02 U PCI
/*60*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // Diva Server BRI-2M 2.0 PCI /*60*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // Diva Server BRI-2M 2.0 PCI
/*61*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // Diva Server BRI-2F PCI /*61*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // Diva Server BRI-2F PCI
/*62*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA 2.01 S/T USB /*62*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA 2.01 S/T USB
/*63*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // Diva Server Voice BRI-2M 2.0 PCI /*63*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // Diva Server Voice BRI-2M 2.0 PCI
/*64*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 3.0 PCI /*64*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA 3.0 PCI
/*65*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA CT S/T PCI V2.0 /*65*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA CT S/T PCI V2.0
/*66*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA Mobile V.90 PC Card /*66*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA Mobile V.90 PC Card
/*67*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA ISDN PC Card /*67*/ { 0,0,0,0,0,0,0,0,0,0, 0x0,0x0,0, 0x0,0x0,0 }, // DIVA ISDN PC Card
/*68*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA ISDN PC Card /*68*/ { 3,4,5,7,9,10,11,12,14,15, 0x0,0x8,8192, 0x0,0x0,0 }, // DIVA ISDN PC Card
}; };
#endif /*CARDTYPE_H_WANT_RESOURCE_DATA*/ #endif /*CARDTYPE_H_WANT_RESOURCE_DATA*/
#else /*!CARDTYPE_H_WANT_DATA*/ #else /*!CARDTYPE_H_WANT_DATA*/
extern CARD_PROPERTIES CardProperties [] ; extern CARD_PROPERTIES CardProperties[];
extern CARD_RESOURCE CardResource [] ; extern CARD_RESOURCE CardResource[];
#endif /*CARDTYPE_H_WANT_DATA*/ #endif /*CARDTYPE_H_WANT_DATA*/
/* /*
* all existing download files * all existing download files
@@ -902,21 +902,21 @@ extern CARD_RESOURCE CardResource [] ;
#define CARD_D_NEW_DSP_COMBIFILE 63 #define CARD_D_NEW_DSP_COMBIFILE 63
typedef struct CARD_FILES_DATA typedef struct CARD_FILES_DATA
{ {
char * Name; char *Name;
unsigned char Type; unsigned char Type;
} }
CARD_FILES_DATA; CARD_FILES_DATA;
typedef struct CARD_FILES typedef struct CARD_FILES
{ {
unsigned char Boot; unsigned char Boot;
unsigned char Dsp [CARD_DSP_CNT]; unsigned char Dsp[CARD_DSP_CNT];
unsigned char DspTelindus; unsigned char DspTelindus;
unsigned char Prot [CARD_PROT_CNT]; unsigned char Prot[CARD_PROT_CNT];
} }
CARD_FILES; CARD_FILES;
#if CARDTYPE_H_WANT_DATA #if CARDTYPE_H_WANT_DATA
#if CARDTYPE_H_WANT_FILE_DATA #if CARDTYPE_H_WANT_FILE_DATA
CARD_FILES_DATA CardFData [] = { CARD_FILES_DATA CardFData[] = {
// Filename Filetype // Filename Filetype
0, CARD_FT_UNKNOWN, 0, CARD_FT_UNKNOWN,
"didnload.bin", CARD_FT_B, "didnload.bin", CARD_FT_B,
@@ -983,7 +983,7 @@ CARD_FILES_DATA CardFData [] = {
"di_swed.sm", CARD_FT_M, "di_swed.sm", CARD_FT_M,
"didspdld.bin", CARD_FT_NEW_DSP_COMBIFILE "didspdld.bin", CARD_FT_NEW_DSP_COMBIFILE
}; };
CARD_FILES CardFiles [] = CARD_FILES CardFiles[] =
{ {
{ /* CARD_UNKNOWN */ { /* CARD_UNKNOWN */
CARD_FILE_NONE, CARD_FILE_NONE,
@@ -1092,7 +1092,7 @@ CARD_FILES CardFiles [] =
}; };
#endif /*CARDTYPE_H_WANT_FILE_DATA*/ #endif /*CARDTYPE_H_WANT_FILE_DATA*/
#else /*!CARDTYPE_H_WANT_DATA*/ #else /*!CARDTYPE_H_WANT_DATA*/
extern CARD_FILES_DATA CardFData [] ; extern CARD_FILES_DATA CardFData[];
extern CARD_FILES CardFiles [] ; extern CARD_FILES CardFiles[];
#endif /*CARDTYPE_H_WANT_DATA*/ #endif /*CARDTYPE_H_WANT_DATA*/
#endif /* _CARDTYPE_H_ */ #endif /* _CARDTYPE_H_ */

View File

@@ -1,4 +1,3 @@
/* /*
* *
Copyright (c) Eicon Networks, 2002. Copyright (c) Eicon Networks, 2002.
@@ -34,12 +33,12 @@
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
typedef struct _didd_adapter_change_notification { typedef struct _didd_adapter_change_notification {
didd_adapter_change_callback_t callback; didd_adapter_change_callback_t callback;
void IDI_CALL_ENTITY_T * context; void IDI_CALL_ENTITY_T *context;
} didd_adapter_change_notification_t, \ } didd_adapter_change_notification_t, \
* IDI_CALL_ENTITY_T pdidd_adapter_change_notification_t; * IDI_CALL_ENTITY_T pdidd_adapter_change_notification_t;
#define DIVA_DIDD_MAX_NOTIFICATIONS 256 #define DIVA_DIDD_MAX_NOTIFICATIONS 256
static didd_adapter_change_notification_t\ static didd_adapter_change_notification_t \
NotificationTable[DIVA_DIDD_MAX_NOTIFICATIONS]; NotificationTable[DIVA_DIDD_MAX_NOTIFICATIONS];
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Array to held adapter information Array to held adapter information
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
@@ -49,13 +48,13 @@ static dword Adapters = 0; /* Number of adapters */
Shadow IDI_DIMAINT Shadow IDI_DIMAINT
and 'shadow' debug stuff and 'shadow' debug stuff
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void no_printf (unsigned char * format, ...) static void no_printf(unsigned char *format, ...)
{ {
#ifdef EBUG #ifdef EBUG
va_list ap; va_list ap;
va_start (ap, format); va_start(ap, format);
debug((format, ap)); debug((format, ap));
va_end (ap); va_end(ap);
#endif #endif
} }
@@ -73,7 +72,7 @@ static DESCRIPTOR MAdapter = {IDI_DIMAINT, /* Adapter Type */
get all descriptors will receive information about DAdapter get all descriptors will receive information about DAdapter
{ byte type, byte channels, word features, IDI_CALL request } { byte type, byte channels, word features, IDI_CALL request }
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void IDI_CALL_LINK_T diva_dadapter_request (ENTITY IDI_CALL_ENTITY_T *); static void IDI_CALL_LINK_T diva_dadapter_request(ENTITY IDI_CALL_ENTITY_T *);
static DESCRIPTOR DAdapter = {IDI_DADAPTER, /* Adapter Type */ static DESCRIPTOR DAdapter = {IDI_DADAPTER, /* Adapter Type */
0x00, /* Channels */ 0x00, /* Channels */
0x0000, /* Features */ 0x0000, /* Features */
@@ -81,61 +80,61 @@ static DESCRIPTOR DAdapter = {IDI_DADAPTER, /* Adapter Type */
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
LOCALS LOCALS
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static dword diva_register_adapter_callback (\ static dword diva_register_adapter_callback(\
didd_adapter_change_callback_t callback, didd_adapter_change_callback_t callback,
void IDI_CALL_ENTITY_T* context); void IDI_CALL_ENTITY_T *context);
static void diva_remove_adapter_callback (dword handle); static void diva_remove_adapter_callback(dword handle);
static void diva_notify_adapter_change (DESCRIPTOR* d, int removal); static void diva_notify_adapter_change(DESCRIPTOR *d, int removal);
static diva_os_spin_lock_t didd_spin; static diva_os_spin_lock_t didd_spin;
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Should be called as first step, after driver init Should be called as first step, after driver init
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
void diva_didd_load_time_init (void) { void diva_didd_load_time_init(void) {
memset (&HandleTable[0], 0x00, sizeof(HandleTable)); memset(&HandleTable[0], 0x00, sizeof(HandleTable));
memset (&NotificationTable[0], 0x00, sizeof(NotificationTable)); memset(&NotificationTable[0], 0x00, sizeof(NotificationTable));
diva_os_initialize_spin_lock (&didd_spin, "didd"); diva_os_initialize_spin_lock(&didd_spin, "didd");
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Should be called as last step, if driver does unload Should be called as last step, if driver does unload
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
void diva_didd_load_time_finit (void) { void diva_didd_load_time_finit(void) {
diva_os_destroy_spin_lock (&didd_spin, "didd"); diva_os_destroy_spin_lock(&didd_spin, "didd");
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Called in order to register new adapter in adapter array Called in order to register new adapter in adapter array
return adapter handle (> 0) on success return adapter handle (> 0) on success
return -1 adapter array overflow return -1 adapter array overflow
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static int diva_didd_add_descriptor (DESCRIPTOR* d) { static int diva_didd_add_descriptor(DESCRIPTOR *d) {
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
int i; int i;
if (d->type == IDI_DIMAINT) { if (d->type == IDI_DIMAINT) {
if (d->request) { if (d->request) {
MAdapter.request = d->request; MAdapter.request = d->request;
dprintf = (DIVA_DI_PRINTF)d->request; dprintf = (DIVA_DI_PRINTF)d->request;
diva_notify_adapter_change (&MAdapter, 0); /* Inserted */ diva_notify_adapter_change(&MAdapter, 0); /* Inserted */
DBG_TRC (("DIMAINT registered, dprintf=%08x", d->request)) DBG_TRC(("DIMAINT registered, dprintf=%08x", d->request))
} else { } else {
DBG_TRC (("DIMAINT removed")) DBG_TRC(("DIMAINT removed"))
diva_notify_adapter_change (&MAdapter, 1); /* About to remove */ diva_notify_adapter_change(&MAdapter, 1); /* About to remove */
MAdapter.request = (IDI_CALL)no_printf; MAdapter.request = (IDI_CALL)no_printf;
dprintf = no_printf; dprintf = no_printf;
} }
return (NEW_MAX_DESCRIPTORS); return (NEW_MAX_DESCRIPTORS);
} }
for (i = 0; i < NEW_MAX_DESCRIPTORS; i++) { for (i = 0; i < NEW_MAX_DESCRIPTORS; i++) {
diva_os_enter_spin_lock (&didd_spin, &irql, "didd_add"); diva_os_enter_spin_lock(&didd_spin, &irql, "didd_add");
if (HandleTable[i].type == 0) { if (HandleTable[i].type == 0) {
memcpy (&HandleTable[i], d, sizeof(*d)); memcpy(&HandleTable[i], d, sizeof(*d));
Adapters++; Adapters++;
diva_os_leave_spin_lock (&didd_spin, &irql, "didd_add"); diva_os_leave_spin_lock(&didd_spin, &irql, "didd_add");
diva_notify_adapter_change (d, 0); /* we have new adapter */ diva_notify_adapter_change(d, 0); /* we have new adapter */
DBG_TRC (("Add adapter[%d], request=%08x", (i+1), d->request)) DBG_TRC(("Add adapter[%d], request=%08x", (i + 1), d->request))
return (i+1); return (i + 1);
} }
diva_os_leave_spin_lock (&didd_spin, &irql, "didd_add"); diva_os_leave_spin_lock(&didd_spin, &irql, "didd_add");
} }
DBG_ERR (("Can't add adapter, out of resources")) DBG_ERR(("Can't add adapter, out of resources"))
return (-1); return (-1);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
@@ -143,64 +142,64 @@ static int diva_didd_add_descriptor (DESCRIPTOR* d) {
return adapter handle (> 0) on success return adapter handle (> 0) on success
return 0 on success return 0 on success
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static int diva_didd_remove_descriptor (IDI_CALL request) { static int diva_didd_remove_descriptor(IDI_CALL request) {
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
int i; int i;
if (request == MAdapter.request) { if (request == MAdapter.request) {
DBG_TRC(("DIMAINT removed")) DBG_TRC(("DIMAINT removed"))
dprintf = no_printf; dprintf = no_printf;
diva_notify_adapter_change (&MAdapter, 1); /* About to remove */ diva_notify_adapter_change(&MAdapter, 1); /* About to remove */
MAdapter.request = (IDI_CALL)no_printf; MAdapter.request = (IDI_CALL)no_printf;
return (0); return (0);
} }
for (i = 0; (Adapters && (i < NEW_MAX_DESCRIPTORS)); i++) { for (i = 0; (Adapters && (i < NEW_MAX_DESCRIPTORS)); i++) {
if (HandleTable[i].request == request) { if (HandleTable[i].request == request) {
diva_notify_adapter_change (&HandleTable[i], 1); /* About to remove */ diva_notify_adapter_change(&HandleTable[i], 1); /* About to remove */
diva_os_enter_spin_lock (&didd_spin, &irql, "didd_rm"); diva_os_enter_spin_lock(&didd_spin, &irql, "didd_rm");
memset (&HandleTable[i], 0x00, sizeof(HandleTable[0])); memset(&HandleTable[i], 0x00, sizeof(HandleTable[0]));
Adapters--; Adapters--;
diva_os_leave_spin_lock (&didd_spin, &irql, "didd_rm"); diva_os_leave_spin_lock(&didd_spin, &irql, "didd_rm");
DBG_TRC (("Remove adapter[%d], request=%08x", (i+1), request)) DBG_TRC(("Remove adapter[%d], request=%08x", (i + 1), request))
return (0); return (0);
} }
} }
DBG_ERR (("Invalid request=%08x, can't remove adapter", request)) DBG_ERR(("Invalid request=%08x, can't remove adapter", request))
return (-1); return (-1);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Read adapter array Read adapter array
return 1 if not enough space to save all available adapters return 1 if not enough space to save all available adapters
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static int diva_didd_read_adapter_array (DESCRIPTOR* buffer, int length) { static int diva_didd_read_adapter_array(DESCRIPTOR *buffer, int length) {
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
int src, dst; int src, dst;
memset (buffer, 0x00, length); memset(buffer, 0x00, length);
length /= sizeof(DESCRIPTOR); length /= sizeof(DESCRIPTOR);
DBG_TRC (("DIDD_Read, space = %d, Adapters = %d", length, Adapters+2)) DBG_TRC(("DIDD_Read, space = %d, Adapters = %d", length, Adapters + 2))
diva_os_enter_spin_lock (&didd_spin, &irql, "didd_read"); diva_os_enter_spin_lock(&didd_spin, &irql, "didd_read");
for (src = 0, dst = 0; for (src = 0, dst = 0;
(Adapters && (src < NEW_MAX_DESCRIPTORS) && (dst < length)); (Adapters && (src < NEW_MAX_DESCRIPTORS) && (dst < length));
src++) { src++) {
if (HandleTable[src].type) { if (HandleTable[src].type) {
memcpy (&buffer[dst], &HandleTable[src], sizeof(DESCRIPTOR)); memcpy(&buffer[dst], &HandleTable[src], sizeof(DESCRIPTOR));
dst++; dst++;
} }
} }
diva_os_leave_spin_lock (&didd_spin, &irql, "didd_read"); diva_os_leave_spin_lock(&didd_spin, &irql, "didd_read");
if (dst < length) { if (dst < length) {
memcpy (&buffer[dst], &MAdapter, sizeof(DESCRIPTOR)); memcpy(&buffer[dst], &MAdapter, sizeof(DESCRIPTOR));
dst++; dst++;
} else { } else {
DBG_ERR (("Can't write DIMAINT. Array too small")) DBG_ERR(("Can't write DIMAINT. Array too small"))
} }
if (dst < length) { if (dst < length) {
memcpy (&buffer[dst], &DAdapter, sizeof(DESCRIPTOR)); memcpy(&buffer[dst], &DAdapter, sizeof(DESCRIPTOR));
dst++; dst++;
} else { } else {
DBG_ERR (("Can't write DADAPTER. Array too small")) DBG_ERR(("Can't write DADAPTER. Array too small"))
} }
DBG_TRC (("Read %d adapters", dst)) DBG_TRC(("Read %d adapters", dst))
return (dst == length); return (dst == length);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
@@ -208,12 +207,12 @@ static int diva_didd_read_adapter_array (DESCRIPTOR* buffer, int length) {
This function does process only synchronous requests, and is used This function does process only synchronous requests, and is used
for reception/registration of new interfaces for reception/registration of new interfaces
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void IDI_CALL_LINK_T diva_dadapter_request (\ static void IDI_CALL_LINK_T diva_dadapter_request( \
ENTITY IDI_CALL_ENTITY_T *e) { ENTITY IDI_CALL_ENTITY_T *e) {
IDI_SYNC_REQ *syncReq = (IDI_SYNC_REQ *)e ; IDI_SYNC_REQ *syncReq = (IDI_SYNC_REQ *)e;
if (e->Req) { /* We do not process it, also return error */ if (e->Req) { /* We do not process it, also return error */
e->Rc = OUT_OF_RESOURCES; e->Rc = OUT_OF_RESOURCES;
DBG_ERR (("Can't process async request, Req=%02x", e->Req)) DBG_ERR(("Can't process async request, Req=%02x", e->Req))
return; return;
} }
/* /*
@@ -221,37 +220,37 @@ static void IDI_CALL_LINK_T diva_dadapter_request (\
*/ */
switch (e->Rc) { switch (e->Rc) {
case IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY: { case IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY: {
diva_didd_adapter_notify_t* pinfo = &syncReq->didd_notify.info; diva_didd_adapter_notify_t *pinfo = &syncReq->didd_notify.info;
pinfo->handle = diva_register_adapter_callback (\ pinfo->handle = diva_register_adapter_callback( \
(didd_adapter_change_callback_t)pinfo->callback, (didd_adapter_change_callback_t)pinfo->callback,
(void IDI_CALL_ENTITY_T *)pinfo->context); (void IDI_CALL_ENTITY_T *)pinfo->context);
e->Rc = 0xff; e->Rc = 0xff;
} break; } break;
case IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY: { case IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY: {
diva_didd_adapter_notify_t* pinfo = &syncReq->didd_notify.info; diva_didd_adapter_notify_t *pinfo = &syncReq->didd_notify.info;
diva_remove_adapter_callback (pinfo->handle); diva_remove_adapter_callback(pinfo->handle);
e->Rc = 0xff; e->Rc = 0xff;
} break; } break;
case IDI_SYNC_REQ_DIDD_ADD_ADAPTER: { case IDI_SYNC_REQ_DIDD_ADD_ADAPTER: {
diva_didd_add_adapter_t* pinfo = &syncReq->didd_add_adapter.info; diva_didd_add_adapter_t *pinfo = &syncReq->didd_add_adapter.info;
if (diva_didd_add_descriptor ((DESCRIPTOR*)pinfo->descriptor) < 0) { if (diva_didd_add_descriptor((DESCRIPTOR *)pinfo->descriptor) < 0) {
e->Rc = OUT_OF_RESOURCES; e->Rc = OUT_OF_RESOURCES;
} else { } else {
e->Rc = 0xff; e->Rc = 0xff;
} }
} break; } break;
case IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER: { case IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER: {
diva_didd_remove_adapter_t* pinfo = &syncReq->didd_remove_adapter.info; diva_didd_remove_adapter_t *pinfo = &syncReq->didd_remove_adapter.info;
if (diva_didd_remove_descriptor ((IDI_CALL)pinfo->p_request) < 0) { if (diva_didd_remove_descriptor((IDI_CALL)pinfo->p_request) < 0) {
e->Rc = OUT_OF_RESOURCES; e->Rc = OUT_OF_RESOURCES;
} else { } else {
e->Rc = 0xff; e->Rc = 0xff;
} }
} break; } break;
case IDI_SYNC_REQ_DIDD_READ_ADAPTER_ARRAY: { case IDI_SYNC_REQ_DIDD_READ_ADAPTER_ARRAY: {
diva_didd_read_adapter_array_t* pinfo =\ diva_didd_read_adapter_array_t *pinfo =\
&syncReq->didd_read_adapter_array.info; &syncReq->didd_read_adapter_array.info;
if (diva_didd_read_adapter_array ((DESCRIPTOR*)pinfo->buffer, if (diva_didd_read_adapter_array((DESCRIPTOR *)pinfo->buffer,
(int)pinfo->length)) { (int)pinfo->length)) {
e->Rc = OUT_OF_RESOURCES; e->Rc = OUT_OF_RESOURCES;
} else { } else {
@@ -259,66 +258,66 @@ static void IDI_CALL_LINK_T diva_dadapter_request (\
} }
} break; } break;
default: default:
DBG_ERR (("Can't process sync request, Req=%02x", e->Rc)) DBG_ERR(("Can't process sync request, Req=%02x", e->Rc))
e->Rc = OUT_OF_RESOURCES; e->Rc = OUT_OF_RESOURCES;
} }
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
IDI client does register his notification function IDI client does register his notification function
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static dword diva_register_adapter_callback (\ static dword diva_register_adapter_callback( \
didd_adapter_change_callback_t callback, didd_adapter_change_callback_t callback,
void IDI_CALL_ENTITY_T* context) { void IDI_CALL_ENTITY_T *context) {
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
dword i; dword i;
for (i = 0; i < DIVA_DIDD_MAX_NOTIFICATIONS; i++) { for (i = 0; i < DIVA_DIDD_MAX_NOTIFICATIONS; i++) {
diva_os_enter_spin_lock (&didd_spin, &irql, "didd_nfy_add"); diva_os_enter_spin_lock(&didd_spin, &irql, "didd_nfy_add");
if (!NotificationTable[i].callback) { if (!NotificationTable[i].callback) {
NotificationTable[i].callback = callback; NotificationTable[i].callback = callback;
NotificationTable[i].context = context; NotificationTable[i].context = context;
diva_os_leave_spin_lock (&didd_spin, &irql, "didd_nfy_add"); diva_os_leave_spin_lock(&didd_spin, &irql, "didd_nfy_add");
DBG_TRC(("Register adapter notification[%d]=%08x", i+1, callback)) DBG_TRC(("Register adapter notification[%d]=%08x", i + 1, callback))
return (i+1); return (i + 1);
} }
diva_os_leave_spin_lock (&didd_spin, &irql, "didd_nfy_add"); diva_os_leave_spin_lock(&didd_spin, &irql, "didd_nfy_add");
} }
DBG_ERR (("Can't register adapter notification, overflow")) DBG_ERR(("Can't register adapter notification, overflow"))
return (0); return (0);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
IDI client does register his notification function IDI client does register his notification function
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void diva_remove_adapter_callback (dword handle) { static void diva_remove_adapter_callback(dword handle) {
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
if (handle && ((--handle) < DIVA_DIDD_MAX_NOTIFICATIONS)) { if (handle && ((--handle) < DIVA_DIDD_MAX_NOTIFICATIONS)) {
diva_os_enter_spin_lock (&didd_spin, &irql, "didd_nfy_rm"); diva_os_enter_spin_lock(&didd_spin, &irql, "didd_nfy_rm");
NotificationTable[handle].callback = NULL; NotificationTable[handle].callback = NULL;
NotificationTable[handle].context = NULL; NotificationTable[handle].context = NULL;
diva_os_leave_spin_lock (&didd_spin, &irql, "didd_nfy_rm"); diva_os_leave_spin_lock(&didd_spin, &irql, "didd_nfy_rm");
DBG_TRC(("Remove adapter notification[%d]", (int)(handle+1))) DBG_TRC(("Remove adapter notification[%d]", (int)(handle + 1)))
return; return;
} }
DBG_ERR(("Can't remove adapter notification, handle=%d", handle)) DBG_ERR(("Can't remove adapter notification, handle=%d", handle))
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Notify all client about adapter array change Notify all client about adapter array change
Does suppose following behavior in the client side: Does suppose following behavior in the client side:
Step 1: Redister Notification Step 1: Redister Notification
Step 2: Read Adapter Array Step 2: Read Adapter Array
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void diva_notify_adapter_change (DESCRIPTOR* d, int removal) { static void diva_notify_adapter_change(DESCRIPTOR *d, int removal) {
int i, do_notify; int i, do_notify;
didd_adapter_change_notification_t nfy; didd_adapter_change_notification_t nfy;
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
for (i = 0; i < DIVA_DIDD_MAX_NOTIFICATIONS; i++) { for (i = 0; i < DIVA_DIDD_MAX_NOTIFICATIONS; i++) {
do_notify = 0; do_notify = 0;
diva_os_enter_spin_lock (&didd_spin, &irql, "didd_nfy"); diva_os_enter_spin_lock(&didd_spin, &irql, "didd_nfy");
if (NotificationTable[i].callback) { if (NotificationTable[i].callback) {
memcpy (&nfy, &NotificationTable[i], sizeof(nfy)); memcpy(&nfy, &NotificationTable[i], sizeof(nfy));
do_notify = 1; do_notify = 1;
} }
diva_os_leave_spin_lock (&didd_spin, &irql, "didd_nfy"); diva_os_leave_spin_lock(&didd_spin, &irql, "didd_nfy");
if (do_notify) { if (do_notify) {
(*(nfy.callback))(nfy.context, d, removal); (*(nfy.callback))(nfy.context, d, removal);
} }
@@ -359,8 +358,7 @@ static void diva_notify_adapter_change (DESCRIPTOR* d, int removal) {
This approach does allow to load/unload debug interface on demand, This approach does allow to load/unload debug interface on demand,
and save memory, it it is necessary. and save memory, it it is necessary.
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
void IDI_CALL_LINK_T DIVA_DIDD_Read (void IDI_CALL_ENTITY_T * buffer, void IDI_CALL_LINK_T DIVA_DIDD_Read(void IDI_CALL_ENTITY_T *buffer,
int length) { int length) {
diva_didd_read_adapter_array (buffer, length); diva_didd_read_adapter_array(buffer, length);
} }

View File

@@ -26,8 +26,8 @@
#ifndef __DIVA_DIDD_DADAPTER_INC__ #ifndef __DIVA_DIDD_DADAPTER_INC__
#define __DIVA_DIDD_DADAPTER_INC__ #define __DIVA_DIDD_DADAPTER_INC__
void diva_didd_load_time_init (void); void diva_didd_load_time_init(void);
void diva_didd_load_time_finit (void); void diva_didd_load_time_finit(void);
#define NEW_MAX_DESCRIPTORS 64 #define NEW_MAX_DESCRIPTORS 64

File diff suppressed because it is too large Load Diff

View File

@@ -41,25 +41,25 @@ typedef struct _diva_dbg_entry_head {
dword data_length; dword data_length;
} diva_dbg_entry_head_t; } diva_dbg_entry_head_t;
int diva_maint_init (byte* base, unsigned long length, int do_init); int diva_maint_init(byte *base, unsigned long length, int do_init);
void* diva_maint_finit (void); void *diva_maint_finit(void);
dword diva_dbg_q_length (void); dword diva_dbg_q_length(void);
diva_dbg_entry_head_t* diva_maint_get_message (word* size, 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);
void diva_maint_ack_message (int do_release, void diva_maint_ack_message(int do_release,
diva_os_spin_lock_magic_t* old_irql); diva_os_spin_lock_magic_t *old_irql);
void diva_maint_prtComp (char *format, ...); void diva_maint_prtComp(char *format, ...);
void diva_maint_wakeup_read (void); void diva_maint_wakeup_read(void);
int diva_get_driver_info (dword id, byte* data, int data_length); int diva_get_driver_info(dword id, byte *data, int data_length);
int diva_get_driver_dbg_mask (dword id, byte* data); int diva_get_driver_dbg_mask(dword id, byte *data);
int diva_set_driver_dbg_mask (dword id, dword mask); int diva_set_driver_dbg_mask(dword id, dword mask);
void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d); 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 #define DIVA_MAX_SELECTIVE_FILTER_LENGTH 127
int diva_set_trace_filter (int filter_length, const char* filter); int diva_set_trace_filter(int filter_length, const char *filter);
int diva_get_trace_filter (int max_length, 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
@@ -72,7 +72,7 @@ int diva_get_trace_filter (int max_length, char* filter);
/* /*
Trace lavels for debug via management interface Trace lavels for debug via management interface
*/ */
#define DIVA_MGT_DBG_TRACE 0x00000001 /* All trace messages from the card */ #define DIVA_MGT_DBG_TRACE 0x00000001 /* All trace messages from the card */
#define DIVA_MGT_DBG_DCHAN 0x00000002 /* All D-channel relater trace messages */ #define DIVA_MGT_DBG_DCHAN 0x00000002 /* All D-channel relater trace messages */
#define DIVA_MGT_DBG_MDM_PROGRESS 0x00000004 /* Modem progress events */ #define DIVA_MGT_DBG_MDM_PROGRESS 0x00000004 /* Modem progress events */
@@ -86,5 +86,3 @@ int diva_get_trace_filter (int max_length, char* filter);
#define DIVA_MGT_DBG_IFC_AUDIO 0x00000400 /* Audio Tap trace for all channels */ #define DIVA_MGT_DBG_IFC_AUDIO 0x00000400 /* Audio Tap trace for all channels */
# endif /* DEBUG_IF___H */ # endif /* DEBUG_IF___H */

View File

@@ -34,15 +34,15 @@ _DbgHandle_ myDriverDebugHandle = { 0 /*!Registered*/, DBG_HANDLE_VERSION };
DIVA_DI_PRINTF dprintf = no_printf; DIVA_DI_PRINTF dprintf = no_printf;
/*****************************************************************************/ /*****************************************************************************/
#define DBG_FUNC(name) \ #define DBG_FUNC(name) \
void \ void \
myDbgPrint_##name (char *format, ...) \ myDbgPrint_##name(char *format, ...) \
{ va_list ap ; \ { va_list ap; \
if ( myDriverDebugHandle.dbg_prt ) \ if (myDriverDebugHandle.dbg_prt) \
{ va_start (ap, format) ; \ { va_start(ap, format); \
(myDriverDebugHandle.dbg_prt) \ (myDriverDebugHandle.dbg_prt) \
(myDriverDebugHandle.id, DLI_##name, format, ap) ; \ (myDriverDebugHandle.id, DLI_##name, format, ap); \
va_end (ap) ; \ va_end(ap); \
} } } }
DBG_FUNC(LOG) DBG_FUNC(LOG)
DBG_FUNC(FTL) DBG_FUNC(FTL)
DBG_FUNC(ERR) DBG_FUNC(ERR)
@@ -50,14 +50,14 @@ DBG_FUNC(TRC)
DBG_FUNC(MXLOG) DBG_FUNC(MXLOG)
DBG_FUNC(FTL_MXLOG) DBG_FUNC(FTL_MXLOG)
void void
myDbgPrint_EVL (long msgID, ...) myDbgPrint_EVL(long msgID, ...)
{ va_list ap ; { va_list ap;
if ( myDriverDebugHandle.dbg_ev ) if (myDriverDebugHandle.dbg_ev)
{ va_start (ap, msgID) ; { va_start(ap, msgID);
(myDriverDebugHandle.dbg_ev) (myDriverDebugHandle.dbg_ev)
(myDriverDebugHandle.id, (unsigned long)msgID, ap) ; (myDriverDebugHandle.id, (unsigned long)msgID, ap);
va_end (ap) ; va_end(ap);
} } } }
DBG_FUNC(REG) DBG_FUNC(REG)
DBG_FUNC(MEM) DBG_FUNC(MEM)
DBG_FUNC(SPL) DBG_FUNC(SPL)
@@ -76,70 +76,70 @@ DBG_FUNC(PRV2)
DBG_FUNC(PRV3) DBG_FUNC(PRV3)
/*****************************************************************************/ /*****************************************************************************/
int int
DbgRegister (char *drvName, char *drvTag, unsigned long dbgMask) DbgRegister(char *drvName, char *drvTag, unsigned long dbgMask)
{ {
int len; int len;
/* /*
* deregister (if already registered) and zero out myDriverDebugHandle * deregister (if already registered) and zero out myDriverDebugHandle
*/ */
DbgDeregister () ; DbgDeregister();
/* /*
* initialize the debug handle * initialize the debug handle
*/ */
myDriverDebugHandle.Version = DBG_HANDLE_VERSION ; myDriverDebugHandle.Version = DBG_HANDLE_VERSION;
myDriverDebugHandle.id = -1 ; myDriverDebugHandle.id = -1;
myDriverDebugHandle.dbgMask = dbgMask | (DL_EVL | DL_FTL | DL_LOG) ; myDriverDebugHandle.dbgMask = dbgMask | (DL_EVL | DL_FTL | DL_LOG);
len = strlen (drvName) ; len = strlen(drvName);
memcpy (myDriverDebugHandle.drvName, drvName, memcpy(myDriverDebugHandle.drvName, drvName,
(len < sizeof(myDriverDebugHandle.drvName)) ? (len < sizeof(myDriverDebugHandle.drvName)) ?
len : sizeof(myDriverDebugHandle.drvName) - 1) ; len : sizeof(myDriverDebugHandle.drvName) - 1);
len = strlen (drvTag) ; len = strlen(drvTag);
memcpy (myDriverDebugHandle.drvTag, drvTag, memcpy(myDriverDebugHandle.drvTag, drvTag,
(len < sizeof(myDriverDebugHandle.drvTag)) ? (len < sizeof(myDriverDebugHandle.drvTag)) ?
len : sizeof(myDriverDebugHandle.drvTag) - 1) ; len : sizeof(myDriverDebugHandle.drvTag) - 1);
/* /*
* Try to register debugging via old (and only) interface * Try to register debugging via old (and only) interface
*/ */
dprintf("\000\377", &myDriverDebugHandle) ; dprintf("\000\377", &myDriverDebugHandle);
if ( myDriverDebugHandle.dbg_prt ) if (myDriverDebugHandle.dbg_prt)
{ {
return (1) ; return (1);
} }
/* /*
* Check if we registered with an old maint driver (see debuglib.h) * Check if we registered with an old maint driver (see debuglib.h)
*/ */
if ( myDriverDebugHandle.dbg_end != NULL if (myDriverDebugHandle.dbg_end != NULL
/* location of 'dbg_prt' in _OldDbgHandle_ struct */ /* location of 'dbg_prt' in _OldDbgHandle_ struct */
&& (myDriverDebugHandle.regTime.LowPart || && (myDriverDebugHandle.regTime.LowPart ||
myDriverDebugHandle.regTime.HighPart ) ) myDriverDebugHandle.regTime.HighPart))
/* same location as in _OldDbgHandle_ struct */ /* same location as in _OldDbgHandle_ struct */
{ {
dprintf("%s: Cannot log to old maint driver !", drvName) ; dprintf("%s: Cannot log to old maint driver !", drvName);
myDriverDebugHandle.dbg_end = myDriverDebugHandle.dbg_end =
((_OldDbgHandle_ *)&myDriverDebugHandle)->dbg_end ; ((_OldDbgHandle_ *)&myDriverDebugHandle)->dbg_end;
DbgDeregister () ; DbgDeregister();
} }
return (0) ; return (0);
} }
/*****************************************************************************/ /*****************************************************************************/
void void
DbgSetLevel (unsigned long dbgMask) DbgSetLevel(unsigned long dbgMask)
{ {
myDriverDebugHandle.dbgMask = dbgMask | (DL_EVL | DL_FTL | DL_LOG) ; myDriverDebugHandle.dbgMask = dbgMask | (DL_EVL | DL_FTL | DL_LOG);
} }
/*****************************************************************************/ /*****************************************************************************/
void void
DbgDeregister (void) DbgDeregister(void)
{ {
if ( myDriverDebugHandle.dbg_end ) if (myDriverDebugHandle.dbg_end)
{ {
(myDriverDebugHandle.dbg_end)(&myDriverDebugHandle) ; (myDriverDebugHandle.dbg_end)(&myDriverDebugHandle);
} }
memset (&myDriverDebugHandle, 0, sizeof(myDriverDebugHandle)) ; memset(&myDriverDebugHandle, 0, sizeof(myDriverDebugHandle));
} }
void xdi_dbg_xlog (char* x, ...) { void xdi_dbg_xlog(char *x, ...) {
va_list ap; va_list ap;
va_start (ap, x); va_start(ap, x);
if (myDriverDebugHandle.dbg_end && if (myDriverDebugHandle.dbg_end &&
(myDriverDebugHandle.dbg_irq || myDriverDebugHandle.dbg_old) && (myDriverDebugHandle.dbg_irq || myDriverDebugHandle.dbg_old) &&
(myDriverDebugHandle.dbgMask & DL_STAT)) { (myDriverDebugHandle.dbgMask & DL_STAT)) {

View File

@@ -103,43 +103,43 @@
#define DL_TO_KERNEL 0x40000000 #define DL_TO_KERNEL 0x40000000
#ifdef DIVA_NO_DEBUGLIB #ifdef DIVA_NO_DEBUGLIB
#define myDbgPrint_LOG(x...) do { } while(0); #define myDbgPrint_LOG(x...) do { } while (0);
#define myDbgPrint_FTL(x...) do { } while(0); #define myDbgPrint_FTL(x...) do { } while (0);
#define myDbgPrint_ERR(x...) do { } while(0); #define myDbgPrint_ERR(x...) do { } while (0);
#define myDbgPrint_TRC(x...) do { } while(0); #define myDbgPrint_TRC(x...) do { } while (0);
#define myDbgPrint_MXLOG(x...) do { } while(0); #define myDbgPrint_MXLOG(x...) do { } while (0);
#define myDbgPrint_EVL(x...) do { } while(0); #define myDbgPrint_EVL(x...) do { } while (0);
#define myDbgPrint_REG(x...) do { } while(0); #define myDbgPrint_REG(x...) do { } while (0);
#define myDbgPrint_MEM(x...) do { } while(0); #define myDbgPrint_MEM(x...) do { } while (0);
#define myDbgPrint_SPL(x...) do { } while(0); #define myDbgPrint_SPL(x...) do { } while (0);
#define myDbgPrint_IRP(x...) do { } while(0); #define myDbgPrint_IRP(x...) do { } while (0);
#define myDbgPrint_TIM(x...) do { } while(0); #define myDbgPrint_TIM(x...) do { } while (0);
#define myDbgPrint_BLK(x...) do { } while(0); #define myDbgPrint_BLK(x...) do { } while (0);
#define myDbgPrint_TAPI(x...) do { } while(0); #define myDbgPrint_TAPI(x...) do { } while (0);
#define myDbgPrint_NDIS(x...) do { } while(0); #define myDbgPrint_NDIS(x...) do { } while (0);
#define myDbgPrint_CONN(x...) do { } while(0); #define myDbgPrint_CONN(x...) do { } while (0);
#define myDbgPrint_STAT(x...) do { } while(0); #define myDbgPrint_STAT(x...) do { } while (0);
#define myDbgPrint_SEND(x...) do { } while(0); #define myDbgPrint_SEND(x...) do { } while (0);
#define myDbgPrint_RECV(x...) do { } while(0); #define myDbgPrint_RECV(x...) do { } while (0);
#define myDbgPrint_PRV0(x...) do { } while(0); #define myDbgPrint_PRV0(x...) do { } while (0);
#define myDbgPrint_PRV1(x...) do { } while(0); #define myDbgPrint_PRV1(x...) do { } while (0);
#define myDbgPrint_PRV2(x...) do { } while(0); #define myDbgPrint_PRV2(x...) do { } while (0);
#define myDbgPrint_PRV3(x...) do { } while(0); #define myDbgPrint_PRV3(x...) do { } while (0);
#define DBG_TEST(func,args) do { } while(0); #define DBG_TEST(func, args) do { } while (0);
#define DBG_EVL_ID(args) do { } while(0); #define DBG_EVL_ID(args) do { } while (0);
#else /* DIVA_NO_DEBUGLIB */ #else /* DIVA_NO_DEBUGLIB */
/* /*
* define low level macros for formatted & raw debugging * define low level macros for formatted & raw debugging
*/ */
#define DBG_DECL(func) extern void myDbgPrint_##func (char *, ...) ; #define DBG_DECL(func) extern void myDbgPrint_##func(char *, ...);
DBG_DECL(LOG) DBG_DECL(LOG)
DBG_DECL(FTL) DBG_DECL(FTL)
DBG_DECL(ERR) DBG_DECL(ERR)
DBG_DECL(TRC) DBG_DECL(TRC)
DBG_DECL(MXLOG) DBG_DECL(MXLOG)
DBG_DECL(FTL_MXLOG) DBG_DECL(FTL_MXLOG)
extern void myDbgPrint_EVL (long, ...) ; extern void myDbgPrint_EVL(long, ...);
DBG_DECL(REG) DBG_DECL(REG)
DBG_DECL(MEM) DBG_DECL(MEM)
DBG_DECL(SPL) DBG_DECL(SPL)
@@ -160,30 +160,30 @@ DBG_DECL(PRV3)
/* /*
* tracing to maint and kernel if selected in the trace mask. * tracing to maint and kernel if selected in the trace mask.
*/ */
#define DBG_TEST(func,args) \ #define DBG_TEST(func, args) \
{ if ( (myDriverDebugHandle.dbgMask) & (unsigned long)DL_##func ) \ { if ((myDriverDebugHandle.dbgMask) & (unsigned long)DL_##func) \
{ \ { \
if ( (myDriverDebugHandle.dbgMask) & DL_TO_KERNEL ) \ if ((myDriverDebugHandle.dbgMask) & DL_TO_KERNEL) \
{DbgPrint args; DbgPrint ("\r\n");} \ { DbgPrint args; DbgPrint("\r\n"); } \
myDbgPrint_##func args ; \ myDbgPrint_##func args; \
} } } }
#else #else
/* /*
* Standard tracing to maint driver. * Standard tracing to maint driver.
*/ */
#define DBG_TEST(func,args) \ #define DBG_TEST(func, args) \
{ if ( (myDriverDebugHandle.dbgMask) & (unsigned long)DL_##func ) \ { if ((myDriverDebugHandle.dbgMask) & (unsigned long)DL_##func) \
{ myDbgPrint_##func args ; \ { myDbgPrint_##func args; \
} } } }
#endif #endif
/* /*
* For event level debug use a separate define, the parameter are * For event level debug use a separate define, the parameter are
* different and cause compiler errors on some systems. * different and cause compiler errors on some systems.
*/ */
#define DBG_EVL_ID(args) \ #define DBG_EVL_ID(args) \
{ if ( (myDriverDebugHandle.dbgMask) & (unsigned long)DL_EVL ) \ { if ((myDriverDebugHandle.dbgMask) & (unsigned long)DL_EVL) \
{ myDbgPrint_EVL args ; \ { myDbgPrint_EVL args; \
} } } }
#endif /* DIVA_NO_DEBUGLIB */ #endif /* DIVA_NO_DEBUGLIB */
@@ -214,61 +214,61 @@ DBG_DECL(PRV3)
* prototypes for debug register/deregister functions in "debuglib.c" * prototypes for debug register/deregister functions in "debuglib.c"
*/ */
#ifdef DIVA_NO_DEBUGLIB #ifdef DIVA_NO_DEBUGLIB
#define DbgRegister(name,tag, mask) do { } while(0) #define DbgRegister(name, tag, mask) do { } while (0)
#define DbgDeregister() do { } while(0) #define DbgDeregister() do { } while (0)
#define DbgSetLevel(mask) do { } while(0) #define DbgSetLevel(mask) do { } while (0)
#else #else
extern DIVA_DI_PRINTF dprintf; extern DIVA_DI_PRINTF dprintf;
extern int DbgRegister (char *drvName, char *drvTag, unsigned long dbgMask) ; extern int DbgRegister(char *drvName, char *drvTag, unsigned long dbgMask);
extern void DbgDeregister (void) ; extern void DbgDeregister(void);
extern void DbgSetLevel (unsigned long dbgMask) ; extern void DbgSetLevel(unsigned long dbgMask);
#endif #endif
/* /*
* driver internal structure for debug handling; * driver internal structure for debug handling;
* in client drivers this structure is maintained in "debuglib.c", * in client drivers this structure is maintained in "debuglib.c",
* in the debug driver "debug.c" maintains a chain of such structs. * in the debug driver "debug.c" maintains a chain of such structs.
*/ */
typedef struct _DbgHandle_ *pDbgHandle ; 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 long, 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 successfully registered */ { char Registered; /* driver successfully registered */
#define DBG_HANDLE_REG_NEW 0x01 /* this (new) structure */ #define DBG_HANDLE_REG_NEW 0x01 /* this (new) structure */
#define DBG_HANDLE_REG_OLD 0x7f /* old structure (see below) */ #define DBG_HANDLE_REG_OLD 0x7f /* old structure (see below) */
char Version; /* version of this structure */ char Version; /* version of this structure */
#define DBG_HANDLE_VERSION 1 /* contains dbg_old function now */ #define DBG_HANDLE_VERSION 1 /* contains dbg_old function now */
#define DBG_HANDLE_VER_EXT 2 /* pReserved points to extended info*/ #define DBG_HANDLE_VER_EXT 2 /* pReserved points to extended info*/
short id ; /* internal id of registered driver */ short id; /* internal id of registered driver */
struct _DbgHandle_ *next ; /* ptr to next registered driver */ struct _DbgHandle_ *next; /* ptr to next registered driver */
struct /*LARGE_INTEGER*/ { struct /*LARGE_INTEGER*/ {
unsigned long LowPart; unsigned long LowPart;
long HighPart; long HighPart;
} regTime ; /* timestamp for registration */ } regTime; /* timestamp for registration */
void *pIrp ; /* ptr to pending i/o request */ void *pIrp; /* ptr to pending i/o request */
unsigned long dbgMask ; /* current debug mask */ unsigned long dbgMask; /* current debug mask */
char drvName[128] ; /* ASCII name of registered driver */ char drvName[128]; /* ASCII name of registered driver */
char drvTag[64] ; /* revision string */ char drvTag[64]; /* revision string */
DbgEnd dbg_end ; /* function for debug closing */ DbgEnd dbg_end; /* function for debug closing */
DbgLog dbg_prt ; /* function for debug appending */ DbgLog dbg_prt; /* function for debug appending */
DbgOld dbg_old ; /* function for old debug appending */ DbgOld dbg_old; /* function for old debug appending */
DbgEv dbg_ev ; /* function for Windows NT Eventlog */ DbgEv dbg_ev; /* function for Windows NT Eventlog */
DbgIrq dbg_irq ; /* function for irql checked debug */ DbgIrq dbg_irq; /* function for irql checked debug */
void *pReserved3 ; void *pReserved3;
} _DbgHandle_ ; } _DbgHandle_;
extern _DbgHandle_ myDriverDebugHandle ; extern _DbgHandle_ myDriverDebugHandle;
typedef struct _OldDbgHandle_ typedef struct _OldDbgHandle_
{ struct _OldDbgHandle_ *next ; { struct _OldDbgHandle_ *next;
void *pIrp ; void *pIrp;
long regTime[2] ; long regTime[2];
unsigned long dbgMask ; unsigned long dbgMask;
short id ; short id;
char drvName[78] ; char drvName[78];
DbgEnd dbg_end ; DbgEnd dbg_end;
DbgLog dbg_prt ; DbgLog dbg_prt;
} _OldDbgHandle_ ; } _OldDbgHandle_;
/* the differences in DbgHandles /* the differences in DbgHandles
old: tmp: new: old: tmp: new:
0 long next char Registered char Registered 0 long next char Registered char Registered
@@ -304,19 +304,19 @@ typedef struct
/* DBG_EXT_TYPE_CARD_TRACE */ /* DBG_EXT_TYPE_CARD_TRACE */
struct struct
{ {
void ( * MaskChangedNotify) (void *pContext); void (*MaskChangedNotify)(void *pContext);
unsigned long ModuleTxtMask; unsigned long ModuleTxtMask;
unsigned long DebugLevel; unsigned long DebugLevel;
unsigned long B_ChannelMask; unsigned long B_ChannelMask;
unsigned long LogBufferSize; unsigned long LogBufferSize;
} CardTrace; } CardTrace;
}Data; } Data;
} _DbgExtendedInfo_; } _DbgExtendedInfo_;
#ifndef DIVA_NO_DEBUGLIB #ifndef DIVA_NO_DEBUGLIB
/* ------------------------------------------------------------- /* -------------------------------------------------------------
Function used for xlog-style debug Function used for xlog-style debug
------------------------------------------------------------- */ ------------------------------------------------------------- */
#define XDI_USE_XLOG 1 #define XDI_USE_XLOG 1
void xdi_dbg_xlog (char* x, ...); void xdi_dbg_xlog(char *x, ...);
#endif /* DIVA_NO_DEBUGLIB */ #endif /* DIVA_NO_DEBUGLIB */
#endif /* __DEBUGLIB_H__ */ #endif /* __DEBUGLIB_H__ */

View File

@@ -29,14 +29,14 @@
rest of the world rest of the world
should be divisible by 4 should be divisible by 4
*/ */
#define DIVA_DFIFO_RAW_SZ (2512*8) #define DIVA_DFIFO_RAW_SZ (2512 * 8)
#define DIVA_DFIFO_DATA_SZ 68 #define DIVA_DFIFO_DATA_SZ 68
#define DIVA_DFIFO_HDR_SZ 4 #define DIVA_DFIFO_HDR_SZ 4
#define DIVA_DFIFO_SEGMENT_SZ (DIVA_DFIFO_DATA_SZ+DIVA_DFIFO_HDR_SZ) #define DIVA_DFIFO_SEGMENT_SZ (DIVA_DFIFO_DATA_SZ + DIVA_DFIFO_HDR_SZ)
#define DIVA_DFIFO_SEGMENTS ((DIVA_DFIFO_RAW_SZ)/(DIVA_DFIFO_SEGMENT_SZ)+1) #define DIVA_DFIFO_SEGMENTS ((DIVA_DFIFO_RAW_SZ) / (DIVA_DFIFO_SEGMENT_SZ) + 1)
#define DIVA_DFIFO_MEM_SZ (\ #define DIVA_DFIFO_MEM_SZ ( \
(DIVA_DFIFO_SEGMENT_SZ)*(DIVA_DFIFO_SEGMENTS)+\ (DIVA_DFIFO_SEGMENT_SZ) * (DIVA_DFIFO_SEGMENTS) + \
(DIVA_DFIFO_CACHE_SZ)*2\ (DIVA_DFIFO_CACHE_SZ) * 2 \
) )
#define DIVA_DFIFO_STEP DIVA_DFIFO_SEGMENT_SZ #define DIVA_DFIFO_STEP DIVA_DFIFO_SEGMENT_SZ
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
@@ -50,5 +50,5 @@
#define DIVA_DFIFO_READY 0x40 /* This block is ready for processing */ #define DIVA_DFIFO_READY 0x40 /* This block is ready for processing */
#define DIVA_DFIFO_LAST 0x20 /* This block is last in message */ #define DIVA_DFIFO_LAST 0x20 /* This block is last in message */
#define DIVA_DFIFO_AUTO 0x10 /* Don't look for 'ready', don't ack */ #define DIVA_DFIFO_AUTO 0x10 /* Don't look for 'ready', don't ack */
int diva_dfifo_create (void* start, int length); int diva_dfifo_create(void *start, int length);
#endif #endif

View File

@@ -29,9 +29,9 @@
#include "di_defs.h" #include "di_defs.h"
#include "di.h" #include "di.h"
#if !defined USE_EXTENDED_DEBUGS #if !defined USE_EXTENDED_DEBUGS
#include "dimaint.h" #include "dimaint.h"
#else #else
#define dprintf #define dprintf
#endif #endif
#include "io.h" #include "io.h"
#include "dfifo.h" #include "dfifo.h"
@@ -40,9 +40,9 @@
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* local function prototypes */ /* local function prototypes */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
void pr_out(ADAPTER * a); void pr_out(ADAPTER *a);
byte pr_dpc(ADAPTER * a); byte pr_dpc(ADAPTER *a);
static byte pr_ready(ADAPTER * a); static byte pr_ready(ADAPTER *a);
static byte isdn_rc(ADAPTER *, byte, byte, byte, word, dword, dword); static byte isdn_rc(ADAPTER *, byte, byte, byte, word, dword, dword);
static byte isdn_ind(ADAPTER *, byte, byte, byte, PBUFFER *, byte, word); static byte isdn_ind(ADAPTER *, byte, byte, byte, PBUFFER *, byte, word);
/* ----------------------------------------------------------------- /* -----------------------------------------------------------------
@@ -56,16 +56,16 @@ static byte isdn_ind(ADAPTER *, byte, byte, byte, PBUFFER *, byte, word);
----------------------------------------------------------------- */ ----------------------------------------------------------------- */
#if defined(XDI_USE_XLOG) #if defined(XDI_USE_XLOG)
#define XDI_A_NR(_x_) ((byte)(((ISDN_ADAPTER *)(_x_->io))->ANum)) #define XDI_A_NR(_x_) ((byte)(((ISDN_ADAPTER *)(_x_->io))->ANum))
static void xdi_xlog (byte *msg, word code, int length); static void xdi_xlog(byte *msg, word code, int length);
static byte xdi_xlog_sec = 0; static byte xdi_xlog_sec = 0;
#else #else
#define XDI_A_NR(_x_) ((byte)0) #define XDI_A_NR(_x_) ((byte)0)
#endif #endif
static void xdi_xlog_rc_event (byte Adapter, static void xdi_xlog_rc_event(byte Adapter,
byte Id, byte Ch, byte Rc, byte cb, byte type); byte Id, byte Ch, byte Rc, byte cb, byte type);
static void xdi_xlog_request (byte Adapter, byte Id, static void xdi_xlog_request(byte Adapter, byte Id,
byte Ch, byte Req, byte type); byte Ch, byte Req, byte type);
static void xdi_xlog_ind (byte Adapter, static void xdi_xlog_ind(byte Adapter,
byte Id, byte Id,
byte Ch, byte Ch,
byte Ind, byte Ind,
@@ -75,15 +75,15 @@ static void xdi_xlog_ind (byte Adapter,
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* output function */ /* output function */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
void pr_out(ADAPTER * a) void pr_out(ADAPTER *a)
{ {
byte e_no; byte e_no;
ENTITY * this = NULL; ENTITY *this = NULL;
BUFFERS *X; BUFFERS *X;
word length; word length;
word i; word i;
word clength; word clength;
REQ * ReqOut; REQ *ReqOut;
byte more; byte more;
byte ReadyCount; byte ReadyCount;
byte ReqCount; byte ReqCount;
@@ -91,35 +91,35 @@ void pr_out(ADAPTER * a)
dtrc(dprintf("pr_out")); dtrc(dprintf("pr_out"));
/* while a request is pending ... */ /* while a request is pending ... */
e_no = look_req(a); e_no = look_req(a);
if(!e_no) if (!e_no)
{ {
dtrc(dprintf("no_req")); dtrc(dprintf("no_req"));
return; return;
} }
ReadyCount = pr_ready(a); ReadyCount = pr_ready(a);
if(!ReadyCount) if (!ReadyCount)
{ {
dtrc(dprintf("not_ready")); dtrc(dprintf("not_ready"));
return; return;
} }
ReqCount = 0; ReqCount = 0;
while(e_no && ReadyCount) { while (e_no && ReadyCount) {
next_req(a); next_req(a);
this = entity_ptr(a, e_no); this = entity_ptr(a, e_no);
#ifdef USE_EXTENDED_DEBUGS #ifdef USE_EXTENDED_DEBUGS
if ( !this ) if (!this)
{ {
DBG_FTL(("XDI: [%02x] !A%d ==> NULL entity ptr - try to ignore", DBG_FTL(("XDI: [%02x] !A%d ==> NULL entity ptr - try to ignore",
xdi_xlog_sec++, (int)((ISDN_ADAPTER *)a->io)->ANum)) xdi_xlog_sec++, (int)((ISDN_ADAPTER *)a->io)->ANum))
e_no = look_req(a) ; e_no = look_req(a);
ReadyCount-- ; ReadyCount--;
continue ; continue;
} }
{ {
DBG_TRC((">A%d Id=0x%x Req=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, this->Id, this->Req)) DBG_TRC((">A%d Id=0x%x Req=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, this->Id, this->Req))
} }
#else #else
dbug(dprintf("out:Req=%x,Id=%x,Ch=%x",this->Req,this->Id,this->ReqCh)); dbug(dprintf("out:Req=%x,Id=%x,Ch=%x", this->Req, this->Id, this->ReqCh));
#endif #endif
/* get address of next available request buffer */ /* get address of next available request buffer */
ReqOut = (REQ *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextReq)]; ReqOut = (REQ *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextReq)];
@@ -131,16 +131,16 @@ void pr_out(ADAPTER * a)
/* adapters request buffer */ /* adapters request buffer */
length = 0; length = 0;
i = this->XCurrent; i = this->XCurrent;
X = PTR_X(a,this); X = PTR_X(a, this);
while(i<this->XNum && length<270) { while (i < this->XNum && length < 270) {
clength = min((word)(270-length),(word)(X[i].PLength-this->XOffset)); clength = min((word)(270 - length), (word)(X[i].PLength-this->XOffset));
a->ram_out_buffer(a, a->ram_out_buffer(a,
&ReqOut->XBuffer.P[length], &ReqOut->XBuffer.P[length],
PTR_P(a,this,&X[i].P[this->XOffset]), PTR_P(a, this, &X[i].P[this->XOffset]),
clength); clength);
length +=clength; length += clength;
this->XOffset +=clength; this->XOffset += clength;
if(this->XOffset==X[i].PLength) { if (this->XOffset == X[i].PLength) {
this->XCurrent = (byte)++i; this->XCurrent = (byte)++i;
this->XOffset = 0; this->XOffset = 0;
} }
@@ -148,13 +148,13 @@ void pr_out(ADAPTER * a)
#if defined(DIVA_ISTREAM) #if defined(DIVA_ISTREAM)
} else { /* Use CMA extension in order to transfer data to the card */ } else { /* Use CMA extension in order to transfer data to the card */
i = this->XCurrent; i = this->XCurrent;
X = PTR_X(a,this); X = PTR_X(a, this);
while (i < this->XNum) { while (i < this->XNum) {
diva_istream_write (a, diva_istream_write(a,
this->Id, this->Id,
PTR_P(a,this,&X[i].P[0]), PTR_P(a, this, &X[i].P[0]),
X[i].PLength, X[i].PLength,
((i+1) == this->XNum), ((i + 1) == this->XNum),
0, 0); 0, 0);
this->XCurrent = (byte)++i; this->XCurrent = (byte)++i;
} }
@@ -165,20 +165,20 @@ void pr_out(ADAPTER * a)
a->ram_out(a, &ReqOut->ReqId, this->Id); a->ram_out(a, &ReqOut->ReqId, this->Id);
a->ram_out(a, &ReqOut->ReqCh, this->ReqCh); a->ram_out(a, &ReqOut->ReqCh, this->ReqCh);
/* if it's a specific request (no ASSIGN) ... */ /* if it's a specific request (no ASSIGN) ... */
if(this->Id &0x1f) { if (this->Id & 0x1f) {
/* if buffers are left in the list of data buffers do */ /* if buffers are left in the list of data buffers do */
/* do chaining (LL_MDATA, N_MDATA) */ /* do chaining (LL_MDATA, N_MDATA) */
this->More++; this->More++;
if(i<this->XNum && this->MInd) { if (i < this->XNum && this->MInd) {
xdi_xlog_request (XDI_A_NR(a), this->Id, this->ReqCh, this->MInd, xdi_xlog_request(XDI_A_NR(a), this->Id, this->ReqCh, this->MInd,
a->IdTypeTable[this->No]); a->IdTypeTable[this->No]);
a->ram_out(a, &ReqOut->Req, this->MInd); a->ram_out(a, &ReqOut->Req, this->MInd);
more = true; more = true;
} }
else { else {
xdi_xlog_request (XDI_A_NR(a), this->Id, this->ReqCh, this->Req, xdi_xlog_request(XDI_A_NR(a), this->Id, this->ReqCh, this->Req,
a->IdTypeTable[this->No]); a->IdTypeTable[this->No]);
this->More |=XMOREF; this->More |= XMOREF;
a->ram_out(a, &ReqOut->Req, this->Req); a->ram_out(a, &ReqOut->Req, this->Req);
more = false; more = false;
if (a->FlowControlIdTable[this->ReqCh] == this->Id) if (a->FlowControlIdTable[this->ReqCh] == this->Id)
@@ -192,23 +192,23 @@ void pr_out(ADAPTER * a)
} }
/* if we did chaining, this entity is put back into the */ /* if we did chaining, this entity is put back into the */
/* request queue */ /* request queue */
if(more) { if (more) {
req_queue(a,this->No); req_queue(a, this->No);
} }
} }
/* else it's a ASSIGN */ /* else it's a ASSIGN */
else { else {
/* save the request code used for buffer chaining */ /* save the request code used for buffer chaining */
this->MInd = 0; this->MInd = 0;
if (this->Id==BLLC_ID) this->MInd = LL_MDATA; if (this->Id == BLLC_ID) this->MInd = LL_MDATA;
if (this->Id==NL_ID || if (this->Id == NL_ID ||
this->Id==TASK_ID || this->Id == TASK_ID ||
this->Id==MAN_ID this->Id == MAN_ID
) this->MInd = N_MDATA; ) this->MInd = N_MDATA;
/* send the ASSIGN */ /* send the ASSIGN */
a->IdTypeTable[this->No] = this->Id; a->IdTypeTable[this->No] = this->Id;
xdi_xlog_request (XDI_A_NR(a),this->Id,this->ReqCh,this->Req, this->Id); xdi_xlog_request(XDI_A_NR(a), this->Id, this->ReqCh, this->Req, this->Id);
this->More |=XMOREF; this->More |= XMOREF;
a->ram_out(a, &ReqOut->Req, this->Req); a->ram_out(a, &ReqOut->Req, this->Req);
/* save the reference of the ASSIGN */ /* save the reference of the ASSIGN */
assign_queue(a, this->No, a->ram_inw(a, &ReqOut->Reference)); assign_queue(a, this->No, a->ram_inw(a, &ReqOut->Reference));
@@ -223,7 +223,7 @@ void pr_out(ADAPTER * a)
(byte)(a->ram_in(a, &PR_RAM->ReqInput) + ReqCount)); (byte)(a->ram_in(a, &PR_RAM->ReqInput) + ReqCount));
/* if it is a 'unreturncoded' UREMOVE request, remove the */ /* if it is a 'unreturncoded' UREMOVE request, remove the */
/* Id from our table after sending the request */ /* Id from our table after sending the request */
if(this && (this->Req==UREMOVE) && this->Id) { if (this && (this->Req == UREMOVE) && this->Id) {
Id = this->Id; Id = this->Id;
e_no = a->IdTable[Id]; e_no = a->IdTable[Id];
free_entity(a, e_no); free_entity(a, e_no);
@@ -236,13 +236,13 @@ void pr_out(ADAPTER * a)
this->Id = 0; this->Id = 0;
} }
} }
static byte pr_ready(ADAPTER * a) static byte pr_ready(ADAPTER *a)
{ {
byte ReadyCount; byte ReadyCount;
ReadyCount = (byte)(a->ram_in(a, &PR_RAM->ReqOutput) - ReadyCount = (byte)(a->ram_in(a, &PR_RAM->ReqOutput) -
a->ram_in(a, &PR_RAM->ReqInput)); a->ram_in(a, &PR_RAM->ReqInput));
if(!ReadyCount) { if (!ReadyCount) {
if(!a->ReadyInt) { if (!a->ReadyInt) {
a->ram_inc(a, &PR_RAM->ReadyInt); a->ram_inc(a, &PR_RAM->ReadyInt);
a->ReadyInt++; a->ReadyInt++;
} }
@@ -252,30 +252,30 @@ static byte pr_ready(ADAPTER * a)
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* isdn interrupt handler */ /* isdn interrupt handler */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
byte pr_dpc(ADAPTER * a) byte pr_dpc(ADAPTER *a)
{ {
byte Count; byte Count;
RC * RcIn; RC *RcIn;
IND * IndIn; IND *IndIn;
byte c; byte c;
byte RNRId; byte RNRId;
byte Rc; byte Rc;
byte Ind; byte Ind;
/* if return codes are available ... */ /* if return codes are available ... */
if((Count = a->ram_in(a, &PR_RAM->RcOutput)) != 0) { if ((Count = a->ram_in(a, &PR_RAM->RcOutput)) != 0) {
dtrc(dprintf("#Rc=%x",Count)); dtrc(dprintf("#Rc=%x", Count));
/* get the buffer address of the first return code */ /* get the buffer address of the first return code */
RcIn = (RC *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextRc)]; RcIn = (RC *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextRc)];
/* for all return codes do ... */ /* for all return codes do ... */
while(Count--) { while (Count--) {
if((Rc=a->ram_in(a, &RcIn->Rc)) != 0) { if ((Rc = a->ram_in(a, &RcIn->Rc)) != 0) {
dword tmp[2]; dword tmp[2];
/* /*
Get extended information, associated with return code Get extended information, associated with return code
*/ */
a->ram_in_buffer(a, a->ram_in_buffer(a,
&RcIn->Reserved2[0], &RcIn->Reserved2[0],
(byte*)&tmp[0], (byte *)&tmp[0],
8); 8);
/* call return code handler, if it is not our return code */ /* call return code handler, if it is not our return code */
/* the handler returns 2 */ /* the handler returns 2 */
@@ -293,29 +293,29 @@ byte pr_dpc(ADAPTER * a)
RcIn = (RC *)&PR_RAM->B[a->ram_inw(a, &RcIn->next)]; RcIn = (RC *)&PR_RAM->B[a->ram_inw(a, &RcIn->next)];
} }
/* clear all return codes (no chaining!) */ /* clear all return codes (no chaining!) */
a->ram_out(a, &PR_RAM->RcOutput ,0); a->ram_out(a, &PR_RAM->RcOutput, 0);
/* call output function */ /* call output function */
pr_out(a); pr_out(a);
} }
/* clear RNR flag */ /* clear RNR flag */
RNRId = 0; RNRId = 0;
/* if indications are available ... */ /* if indications are available ... */
if((Count = a->ram_in(a, &PR_RAM->IndOutput)) != 0) { if ((Count = a->ram_in(a, &PR_RAM->IndOutput)) != 0) {
dtrc(dprintf("#Ind=%x",Count)); dtrc(dprintf("#Ind=%x", Count));
/* get the buffer address of the first indication */ /* get the buffer address of the first indication */
IndIn = (IND *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextInd)]; IndIn = (IND *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextInd)];
/* for all indications do ... */ /* for all indications do ... */
while(Count--) { while (Count--) {
/* if the application marks an indication as RNR, all */ /* if the application marks an indication as RNR, all */
/* indications from the same Id delivered in this interrupt */ /* indications from the same Id delivered in this interrupt */
/* are marked RNR */ /* are marked RNR */
if(RNRId && RNRId==a->ram_in(a, &IndIn->IndId)) { if (RNRId && RNRId == a->ram_in(a, &IndIn->IndId)) {
a->ram_out(a, &IndIn->Ind, 0); a->ram_out(a, &IndIn->Ind, 0);
a->ram_out(a, &IndIn->RNR, true); a->ram_out(a, &IndIn->RNR, true);
} }
else { else {
Ind = a->ram_in(a, &IndIn->Ind); Ind = a->ram_in(a, &IndIn->Ind);
if(Ind) { if (Ind) {
RNRId = 0; RNRId = 0;
/* call indication handler, a return value of 2 means chain */ /* call indication handler, a return value of 2 means chain */
/* a return value of 1 means RNR */ /* a return value of 1 means RNR */
@@ -327,7 +327,7 @@ byte pr_dpc(ADAPTER * a)
&IndIn->RBuffer, &IndIn->RBuffer,
a->ram_in(a, &IndIn->MInd), a->ram_in(a, &IndIn->MInd),
a->ram_inw(a, &IndIn->MLength)); a->ram_inw(a, &IndIn->MLength));
if(c==1) { if (c == 1) {
dtrc(dprintf("RNR")); dtrc(dprintf("RNR"));
a->ram_out(a, &IndIn->Ind, 0); a->ram_out(a, &IndIn->Ind, 0);
RNRId = a->ram_in(a, &IndIn->IndId); RNRId = a->ram_in(a, &IndIn->IndId);
@@ -342,13 +342,13 @@ byte pr_dpc(ADAPTER * a)
} }
return false; return false;
} }
byte scom_test_int(ADAPTER * a) byte scom_test_int(ADAPTER *a)
{ {
return a->ram_in(a,(void *)0x3fe); return a->ram_in(a, (void *)0x3fe);
} }
void scom_clear_int(ADAPTER * a) void scom_clear_int(ADAPTER *a)
{ {
a->ram_out(a,(void *)0x3fe,0); a->ram_out(a, (void *)0x3fe, 0);
} }
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* return code handler */ /* return code handler */
@@ -361,7 +361,7 @@ static byte isdn_rc(ADAPTER *a,
dword extended_info_type, dword extended_info_type,
dword extended_info) dword extended_info)
{ {
ENTITY * this; ENTITY *this;
byte e_no; byte e_no;
word i; word i;
int cancel_rc; int cancel_rc;
@@ -370,12 +370,12 @@ static byte isdn_rc(ADAPTER *a,
DBG_TRC(("<A%d Id=0x%x Rc=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, Id, Rc)) DBG_TRC(("<A%d Id=0x%x Rc=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, Id, Rc))
} }
#else #else
dbug(dprintf("isdn_rc(Rc=%x,Id=%x,Ch=%x)",Rc,Id,Ch)); dbug(dprintf("isdn_rc(Rc=%x,Id=%x,Ch=%x)", Rc, Id, Ch));
#endif #endif
/* check for ready interrupt */ /* check for ready interrupt */
if(Rc==READY_INT) { if (Rc == READY_INT) {
xdi_xlog_rc_event (XDI_A_NR(a), Id, Ch, Rc, 0, 0); xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 0, 0);
if(a->ReadyInt) { if (a->ReadyInt) {
a->ReadyInt--; a->ReadyInt--;
return 0; return 0;
} }
@@ -383,19 +383,19 @@ static byte isdn_rc(ADAPTER *a,
} }
/* if we know this Id ... */ /* if we know this Id ... */
e_no = a->IdTable[Id]; e_no = a->IdTable[Id];
if(e_no) { if (e_no) {
this = entity_ptr(a,e_no); this = entity_ptr(a, e_no);
xdi_xlog_rc_event (XDI_A_NR(a), Id, Ch, Rc, 0, a->IdTypeTable[this->No]); xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 0, a->IdTypeTable[this->No]);
this->RcCh = Ch; this->RcCh = Ch;
/* if it is a return code to a REMOVE request, remove the */ /* if it is a return code to a REMOVE request, remove the */
/* Id from our table */ /* Id from our table */
if ((a->misc_flags_table[e_no] & DIVA_MISC_FLAGS_REMOVE_PENDING) && if ((a->misc_flags_table[e_no] & DIVA_MISC_FLAGS_REMOVE_PENDING) &&
(Rc==OK)) { (Rc == OK)) {
if (a->IdTypeTable[e_no] == NL_ID) { if (a->IdTypeTable[e_no] == NL_ID) {
if (a->RcExtensionSupported && if (a->RcExtensionSupported &&
(extended_info_type != DIVA_RC_TYPE_REMOVE_COMPLETE)) { (extended_info_type != DIVA_RC_TYPE_REMOVE_COMPLETE)) {
dtrc(dprintf("XDI: N-REMOVE, A(%02x) Id:%02x, ignore RC=OK", dtrc(dprintf("XDI: N-REMOVE, A(%02x) Id:%02x, ignore RC=OK",
XDI_A_NR(a),Id)); XDI_A_NR(a), Id));
return (0); return (0);
} }
if (extended_info_type == DIVA_RC_TYPE_REMOVE_COMPLETE) if (extended_info_type == DIVA_RC_TYPE_REMOVE_COMPLETE)
@@ -423,16 +423,16 @@ static byte isdn_rc(ADAPTER *a,
this->More &= ~XMOREC; this->More &= ~XMOREC;
this->More |= 1; this->More |= 1;
dtrc(dprintf("XDI: correct MORE on REMOVE A(%02x) Id:%02x", dtrc(dprintf("XDI: correct MORE on REMOVE A(%02x) Id:%02x",
XDI_A_NR(a),Id)); XDI_A_NR(a), Id));
} }
} }
if (Rc==OK_FC) { if (Rc == OK_FC) {
a->FlowControlIdTable[Ch] = Id; a->FlowControlIdTable[Ch] = Id;
a->FlowControlSkipTable[Ch] = false; a->FlowControlSkipTable[Ch] = false;
this->Rc = Rc; this->Rc = Rc;
this->More &= ~(XBUSY | XMOREC); this->More &= ~(XBUSY | XMOREC);
this->complete=0xff; this->complete = 0xff;
xdi_xlog_rc_event (XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]); xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]);
CALLBACK(a, this); CALLBACK(a, this);
return 0; return 0;
} }
@@ -449,8 +449,8 @@ static byte isdn_rc(ADAPTER *a,
if (extended_info_type == DIVA_RC_TYPE_OK_FC) { if (extended_info_type == DIVA_RC_TYPE_OK_FC) {
a->misc_flags_table[e_no] |= DIVA_MISC_FLAGS_NO_RC_CANCELLING; a->misc_flags_table[e_no] |= DIVA_MISC_FLAGS_NO_RC_CANCELLING;
this->Rc = Rc; this->Rc = Rc;
this->complete=0xff; this->complete = 0xff;
xdi_xlog_rc_event (XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]); xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]);
DBG_TRC(("XDI OK_FC A(%02x) Id:%02x Ch:%02x Rc:%02x", DBG_TRC(("XDI OK_FC A(%02x) Id:%02x Ch:%02x Rc:%02x",
XDI_A_NR(a), Id, Ch, Rc)) XDI_A_NR(a), Id, Ch, Rc))
CALLBACK(a, this); CALLBACK(a, this);
@@ -465,38 +465,38 @@ static byte isdn_rc(ADAPTER *a,
this->Rc = Rc; this->Rc = Rc;
if (Ch == this->ReqCh) if (Ch == this->ReqCh)
{ {
this->More &=~(XBUSY | XMOREC); this->More &= ~(XBUSY | XMOREC);
this->complete=0xff; this->complete = 0xff;
} }
xdi_xlog_rc_event (XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]); xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]);
CALLBACK(a, this); CALLBACK(a, this);
} }
return 0; return 0;
} }
if (this->More &XMOREC) if (this->More & XMOREC)
this->More--; this->More--;
/* call the application callback function */ /* call the application callback function */
if (((!cancel_rc) || (this->More & XMOREF)) && !(this->More & XMOREC)) { if (((!cancel_rc) || (this->More & XMOREF)) && !(this->More & XMOREC)) {
this->Rc = Rc; this->Rc = Rc;
this->More &=~XBUSY; this->More &= ~XBUSY;
this->complete=0xff; this->complete = 0xff;
xdi_xlog_rc_event (XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]); xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]);
CALLBACK(a, this); CALLBACK(a, this);
} }
return 0; return 0;
} }
/* if it's an ASSIGN return code check if it's a return */ /* if it's an ASSIGN return code check if it's a return */
/* code to an ASSIGN request from us */ /* code to an ASSIGN request from us */
if((Rc &0xf0)==ASSIGN_RC) { if ((Rc & 0xf0) == ASSIGN_RC) {
e_no = get_assign(a, Ref); e_no = get_assign(a, Ref);
if(e_no) { if (e_no) {
this = entity_ptr(a,e_no); this = entity_ptr(a, e_no);
this->Id = Id; this->Id = Id;
xdi_xlog_rc_event (XDI_A_NR(a), Id, Ch, Rc, 2, a->IdTypeTable[this->No]); xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 2, a->IdTypeTable[this->No]);
/* call the application callback function */ /* call the application callback function */
this->Rc = Rc; this->Rc = Rc;
this->More &=~XBUSY; this->More &= ~XBUSY;
this->complete=0xff; this->complete = 0xff;
#if defined(DIVA_ISTREAM) /* { */ #if defined(DIVA_ISTREAM) /* { */
if ((Rc == ASSIGN_OK) && a->ram_offset && if ((Rc == ASSIGN_OK) && a->ram_offset &&
(a->IdTypeTable[this->No] == NL_ID) && (a->IdTypeTable[this->No] == NL_ID) &&
@@ -507,9 +507,9 @@ static byte isdn_rc(ADAPTER *a,
dword tmp[2]; dword tmp[2];
extended_info -= offset; extended_info -= offset;
#ifdef PLATFORM_GT_32BIT #ifdef PLATFORM_GT_32BIT
a->ram_in_dw(a, (void*)ULongToPtr(extended_info), (dword*)&tmp[0], 2); a->ram_in_dw(a, (void *)ULongToPtr(extended_info), (dword *)&tmp[0], 2);
#else #else
a->ram_in_dw(a, (void*)extended_info, (dword*)&tmp[0], 2); a->ram_in_dw(a, (void *)extended_info, (dword *)&tmp[0], 2);
#endif #endif
a->tx_stream[Id] = tmp[0]; a->tx_stream[Id] = tmp[0];
a->rx_stream[Id] = tmp[1]; a->rx_stream[Id] = tmp[1];
@@ -533,7 +533,7 @@ static byte isdn_rc(ADAPTER *a,
} }
#endif /* } */ #endif /* } */
CALLBACK(a, this); CALLBACK(a, this);
if(Rc==ASSIGN_OK) { if (Rc == ASSIGN_OK) {
a->IdTable[Id] = e_no; a->IdTable[Id] = e_no;
} }
else else
@@ -563,28 +563,28 @@ static byte isdn_ind(ADAPTER *a,
byte MInd, byte MInd,
word MLength) word MLength)
{ {
ENTITY * this; ENTITY *this;
word clength; word clength;
word offset; word offset;
BUFFERS *R; BUFFERS *R;
byte* cma = NULL; byte *cma = NULL;
#ifdef USE_EXTENDED_DEBUGS #ifdef USE_EXTENDED_DEBUGS
{ {
DBG_TRC(("<A%d Id=0x%x Ind=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, Id, Ind)) DBG_TRC(("<A%d Id=0x%x Ind=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, Id, Ind))
} }
#else #else
dbug(dprintf("isdn_ind(Ind=%x,Id=%x,Ch=%x)",Ind,Id,Ch)); dbug(dprintf("isdn_ind(Ind=%x,Id=%x,Ch=%x)", Ind, Id, Ch));
#endif #endif
if(a->IdTable[Id]) { if (a->IdTable[Id]) {
this = entity_ptr(a,a->IdTable[Id]); this = entity_ptr(a, a->IdTable[Id]);
this->IndCh = Ch; this->IndCh = Ch;
xdi_xlog_ind (XDI_A_NR(a), Id, Ch, Ind, xdi_xlog_ind(XDI_A_NR(a), Id, Ch, Ind,
0/* rnr_valid */, 0 /* rnr */, a->IdTypeTable[this->No]); 0/* rnr_valid */, 0 /* rnr */, a->IdTypeTable[this->No]);
/* if the Receive More flag is not yet set, this is the */ /* if the Receive More flag is not yet set, this is the */
/* first buffer of the packet */ /* first buffer of the packet */
if(this->RCurrent==0xff) { if (this->RCurrent == 0xff) {
/* check for receive buffer chaining */ /* check for receive buffer chaining */
if(Ind==this->MInd) { if (Ind == this->MInd) {
this->complete = 0; this->complete = 0;
this->Ind = MInd; this->Ind = MInd;
} }
@@ -600,23 +600,23 @@ static byte isdn_ind(ADAPTER *a,
(a->misc_flags_table[this->No] & DIVA_MISC_FLAGS_RX_DMA)) && (a->misc_flags_table[this->No] & DIVA_MISC_FLAGS_RX_DMA)) &&
((Ind == N_DATA) || ((Ind == N_DATA) ||
(a->protocol_capabilities & PROTCAP_CMA_ALLPR))) { (a->protocol_capabilities & PROTCAP_CMA_ALLPR))) {
PISDN_ADAPTER IoAdapter = (PISDN_ADAPTER)a->io ; PISDN_ADAPTER IoAdapter = (PISDN_ADAPTER)a->io;
if (a->misc_flags_table[this->No] & DIVA_MISC_FLAGS_RX_DMA) { if (a->misc_flags_table[this->No] & DIVA_MISC_FLAGS_RX_DMA) {
#if defined(DIVA_IDI_RX_DMA) #if defined(DIVA_IDI_RX_DMA)
dword d; dword d;
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,
(int)a->rx_stream[this->Id], (void**)&cma, &d); (int)a->rx_stream[this->Id], (void **)&cma, &d);
#else #else
cma = &a->stream_buffer[0]; cma = &a->stream_buffer[0];
cma[0] = cma[1] = cma[2] = cma[3] = 0; cma[0] = cma[1] = cma[2] = cma[3] = 0;
#endif #endif
this->RLength = MLength = (word)*(dword*)cma; this->RLength = MLength = (word)*(dword *)cma;
cma += 4; cma += 4;
} else { } else {
int final = 0; int final = 0;
cma = &a->stream_buffer[0]; cma = &a->stream_buffer[0];
this->RLength = MLength = (word)diva_istream_read (a, this->RLength = MLength = (word)diva_istream_read(a,
Id, Id,
cma, cma,
sizeof(a->stream_buffer), sizeof(a->stream_buffer),
@@ -628,8 +628,8 @@ static byte isdn_ind(ADAPTER *a,
} else { } else {
this->complete = 1; this->complete = 1;
} }
memcpy (IoAdapter->RBuffer.P, cma, IoAdapter->RBuffer.length) ; memcpy(IoAdapter->RBuffer.P, cma, IoAdapter->RBuffer.length);
this->RBuffer = (DBUFFER *)&IoAdapter->RBuffer ; this->RBuffer = (DBUFFER *)&IoAdapter->RBuffer;
} }
#endif #endif
if (!cma) { if (!cma) {
@@ -639,19 +639,19 @@ static byte isdn_ind(ADAPTER *a,
CALLBACK(a, this); CALLBACK(a, this);
/* map entity ptr, selector could be re-mapped by call to */ /* map entity ptr, selector could be re-mapped by call to */
/* IDI from within callback */ /* IDI from within callback */
this = entity_ptr(a,a->IdTable[Id]); this = entity_ptr(a, a->IdTable[Id]);
xdi_xlog_ind (XDI_A_NR(a), Id, Ch, Ind, xdi_xlog_ind(XDI_A_NR(a), Id, Ch, Ind,
1/* rnr_valid */, this->RNR/* rnr */, a->IdTypeTable[this->No]); 1/* rnr_valid */, this->RNR/* rnr */, a->IdTypeTable[this->No]);
/* check for RNR */ /* check for RNR */
if(this->RNR==1) { if (this->RNR == 1) {
this->RNR = 0; this->RNR = 0;
return 1; return 1;
} }
/* if no buffers are provided by the application, the */ /* if no buffers are provided by the application, the */
/* application want to copy the data itself including */ /* application want to copy the data itself including */
/* N_MDATA/LL_MDATA chaining */ /* N_MDATA/LL_MDATA chaining */
if(!this->RNR && !this->RNum) { if (!this->RNR && !this->RNum) {
xdi_xlog_ind (XDI_A_NR(a), Id, Ch, Ind, xdi_xlog_ind(XDI_A_NR(a), Id, Ch, Ind,
2/* rnr_valid */, 0/* rnr */, a->IdTypeTable[this->No]); 2/* rnr_valid */, 0/* rnr */, a->IdTypeTable[this->No]);
return 0; return 0;
} }
@@ -659,8 +659,8 @@ static byte isdn_ind(ADAPTER *a,
this->RCurrent = 0; this->RCurrent = 0;
this->ROffset = 0; this->ROffset = 0;
} }
if(this->RNR==2) { if (this->RNR == 2) {
if(Ind!=this->MInd) { if (Ind != this->MInd) {
this->RCurrent = 0xff; this->RCurrent = 0xff;
this->RNR = 0; this->RNR = 0;
} }
@@ -669,9 +669,9 @@ static byte isdn_ind(ADAPTER *a,
/* if we have received buffers from the application, copy */ /* if we have received buffers from the application, copy */
/* the data into these buffers */ /* the data into these buffers */
offset = 0; offset = 0;
R = PTR_R(a,this); R = PTR_R(a, this);
do { do {
if(this->ROffset==R[this->RCurrent].PLength) { if (this->ROffset == R[this->RCurrent].PLength) {
this->ROffset = 0; this->ROffset = 0;
this->RCurrent++; this->RCurrent++;
} }
@@ -681,38 +681,38 @@ static byte isdn_ind(ADAPTER *a,
clength = min(a->ram_inw(a, &RBuffer->length)-offset, clength = min(a->ram_inw(a, &RBuffer->length)-offset,
R[this->RCurrent].PLength-this->ROffset); R[this->RCurrent].PLength-this->ROffset);
} }
if(R[this->RCurrent].P) { if (R[this->RCurrent].P) {
if (cma) { if (cma) {
memcpy (PTR_P(a,this,&R[this->RCurrent].P[this->ROffset]), memcpy(PTR_P(a, this, &R[this->RCurrent].P[this->ROffset]),
&cma[offset], &cma[offset],
clength); clength);
} else { } else {
a->ram_in_buffer(a, a->ram_in_buffer(a,
&RBuffer->P[offset], &RBuffer->P[offset],
PTR_P(a,this,&R[this->RCurrent].P[this->ROffset]), PTR_P(a, this, &R[this->RCurrent].P[this->ROffset]),
clength); clength);
} }
} }
offset +=clength; offset += clength;
this->ROffset +=clength; this->ROffset += clength;
if (cma) { if (cma) {
if (offset >= MLength) { if (offset >= MLength) {
break; break;
} }
continue; continue;
} }
} while(offset<(a->ram_inw(a, &RBuffer->length))); } while (offset < (a->ram_inw(a, &RBuffer->length)));
/* if it's the last buffer of the packet, call the */ /* if it's the last buffer of the packet, call the */
/* application callback function for the receive complete */ /* application callback function for the receive complete */
/* call */ /* call */
if(Ind!=this->MInd) { if (Ind != this->MInd) {
R[this->RCurrent].PLength = this->ROffset; R[this->RCurrent].PLength = this->ROffset;
if(this->ROffset) this->RCurrent++; if (this->ROffset) this->RCurrent++;
this->RNum = this->RCurrent; this->RNum = this->RCurrent;
this->RCurrent = 0xff; this->RCurrent = 0xff;
this->Ind = Ind; this->Ind = Ind;
this->complete = 2; this->complete = 2;
xdi_xlog_ind (XDI_A_NR(a), Id, Ch, Ind, xdi_xlog_ind(XDI_A_NR(a), Id, Ch, Ind,
3/* rnr_valid */, 0/* rnr */, a->IdTypeTable[this->No]); 3/* rnr_valid */, 0/* rnr */, a->IdTypeTable[this->No]);
CALLBACK(a, this); CALLBACK(a, this);
} }
@@ -725,8 +725,8 @@ static byte isdn_ind(ADAPTER *a,
This function works in the same way as xlog on the This function works in the same way as xlog on the
active board active board
----------------------------------------------------------- */ ----------------------------------------------------------- */
static void xdi_xlog (byte *msg, word code, int length) { static void xdi_xlog(byte *msg, word code, int length) {
xdi_dbg_xlog ("\x00\x02", msg, code, length); xdi_dbg_xlog("\x00\x02", msg, code, length);
} }
#endif #endif
/* ----------------------------------------------------------- /* -----------------------------------------------------------
@@ -754,7 +754,7 @@ static void xdi_xlog (byte *msg, word code, int length) {
An unknown Id will cause "?-" in the front of the request. An unknown Id will cause "?-" in the front of the request.
In this case the log.c is to be extended. In this case the log.c is to be extended.
----------------------------------------------------------- */ ----------------------------------------------------------- */
static void xdi_xlog_rc_event (byte Adapter, static void xdi_xlog_rc_event(byte Adapter,
byte Id, byte Ch, byte Rc, byte cb, byte type) { byte Id, byte Ch, byte Rc, byte cb, byte type) {
#if defined(XDI_USE_XLOG) #if defined(XDI_USE_XLOG)
word LogInfo[4]; word LogInfo[4];
@@ -762,7 +762,7 @@ static void xdi_xlog_rc_event (byte Adapter,
PUT_WORD(&LogInfo[1], ((word)Id | (word)(Ch << 8))); PUT_WORD(&LogInfo[1], ((word)Id | (word)(Ch << 8)));
PUT_WORD(&LogInfo[2], ((word)Rc | (word)(type << 8))); PUT_WORD(&LogInfo[2], ((word)Rc | (word)(type << 8)));
PUT_WORD(&LogInfo[3], cb); PUT_WORD(&LogInfo[3], cb);
xdi_xlog ((byte*)&LogInfo[0], 221, sizeof(LogInfo)); xdi_xlog((byte *)&LogInfo[0], 221, sizeof(LogInfo));
#endif #endif
} }
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
@@ -778,14 +778,14 @@ static void xdi_xlog_rc_event (byte Adapter,
An unknown Id will cause "?-" in the front of the request. An unknown Id will cause "?-" in the front of the request.
In this case the log.c is to be extended. In this case the log.c is to be extended.
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
static void xdi_xlog_request (byte Adapter, byte Id, static void xdi_xlog_request(byte Adapter, byte Id,
byte Ch, byte Req, byte type) { byte Ch, byte Req, byte type) {
#if defined(XDI_USE_XLOG) #if defined(XDI_USE_XLOG)
word LogInfo[3]; word LogInfo[3];
PUT_WORD(&LogInfo[0], ((word)Adapter | (word)(xdi_xlog_sec++ << 8))); PUT_WORD(&LogInfo[0], ((word)Adapter | (word)(xdi_xlog_sec++ << 8)));
PUT_WORD(&LogInfo[1], ((word)Id | (word)(Ch << 8))); PUT_WORD(&LogInfo[1], ((word)Id | (word)(Ch << 8)));
PUT_WORD(&LogInfo[2], ((word)Req | (word)(type << 8))); PUT_WORD(&LogInfo[2], ((word)Req | (word)(type << 8)));
xdi_xlog ((byte*)&LogInfo[0], 220, sizeof(LogInfo)); xdi_xlog((byte *)&LogInfo[0], 220, sizeof(LogInfo));
#endif #endif
} }
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
@@ -817,7 +817,7 @@ static void xdi_xlog_request (byte Adapter, byte Id,
cause "?-" in the front of the request. In this case the cause "?-" in the front of the request. In this case the
log.c is to be extended. log.c is to be extended.
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
static void xdi_xlog_ind (byte Adapter, static void xdi_xlog_ind(byte Adapter,
byte Id, byte Id,
byte Ch, byte Ch,
byte Ind, byte Ind,
@@ -830,6 +830,6 @@ static void xdi_xlog_ind (byte Adapter,
PUT_WORD(&LogInfo[1], ((word)Id | (word)(Ch << 8))); PUT_WORD(&LogInfo[1], ((word)Id | (word)(Ch << 8)));
PUT_WORD(&LogInfo[2], ((word)Ind | (word)(type << 8))); PUT_WORD(&LogInfo[2], ((word)Ind | (word)(type << 8)));
PUT_WORD(&LogInfo[3], ((word)rnr | (word)(rnr_valid << 8))); PUT_WORD(&LogInfo[3], ((word)rnr | (word)(rnr_valid << 8)));
xdi_xlog ((byte*)&LogInfo[0], 222, sizeof(LogInfo)); xdi_xlog((byte *)&LogInfo[0], 222, sizeof(LogInfo));
#endif #endif
} }

View File

@@ -35,11 +35,11 @@
#define DIVA_MISC_FLAGS_REMOVE_PENDING 0x01 #define DIVA_MISC_FLAGS_REMOVE_PENDING 0x01
#define DIVA_MISC_FLAGS_NO_RC_CANCELLING 0x02 #define DIVA_MISC_FLAGS_NO_RC_CANCELLING 0x02
#define DIVA_MISC_FLAGS_RX_DMA 0x04 #define DIVA_MISC_FLAGS_RX_DMA 0x04
/* structure for all information we have to keep on a per */ /* structure for all information we have to keep on a per */
/* adapater basis */ /* adapater basis */
typedef struct adapter_s ADAPTER; typedef struct adapter_s ADAPTER;
struct adapter_s { struct adapter_s {
void * io; void *io;
byte IdTable[256]; byte IdTable[256];
byte IdTypeTable[256]; byte IdTypeTable[256];
byte FlowControlIdTable[256]; byte FlowControlIdTable[256];
@@ -48,30 +48,30 @@ struct adapter_s {
byte RcExtensionSupported; byte RcExtensionSupported;
byte misc_flags_table[256]; byte misc_flags_table[256];
dword protocol_capabilities; dword protocol_capabilities;
byte ( * ram_in)(ADAPTER * a, void * adr); byte (*ram_in)(ADAPTER *a, void *adr);
word ( * ram_inw)(ADAPTER * a, void * adr); word (*ram_inw)(ADAPTER *a, void *adr);
void (* ram_in_buffer)(ADAPTER * a, void * adr, void * P, word length); void (*ram_in_buffer)(ADAPTER *a, void *adr, void *P, word length);
void (* ram_look_ahead)(ADAPTER * a, PBUFFER * RBuffer, ENTITY * e); void (*ram_look_ahead)(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
void ( * ram_out)(ADAPTER * a, void * adr, byte data); void (*ram_out)(ADAPTER *a, void *adr, byte data);
void ( * ram_outw)(ADAPTER * a, void * adr, word data); void (*ram_outw)(ADAPTER *a, void *adr, word data);
void (* ram_out_buffer)(ADAPTER * a, void * adr, void * P, word length); void (*ram_out_buffer)(ADAPTER *a, void *adr, void *P, word length);
void ( * ram_inc)(ADAPTER * a, void * adr); void (*ram_inc)(ADAPTER *a, void *adr);
#if defined(DIVA_ISTREAM) #if defined(DIVA_ISTREAM)
dword rx_stream[256]; dword rx_stream[256];
dword tx_stream[256]; dword tx_stream[256];
word tx_pos[256]; word tx_pos[256];
word rx_pos[256]; word rx_pos[256];
byte stream_buffer[2512]; byte stream_buffer[2512];
dword ( * ram_offset)(ADAPTER * a); dword (*ram_offset)(ADAPTER *a);
void ( * ram_out_dw) (ADAPTER *a, void (*ram_out_dw)(ADAPTER *a,
void *addr, void *addr,
const dword* data, const dword *data,
int dwords); int dwords);
void ( * ram_in_dw) (ADAPTER *a, void (*ram_in_dw)(ADAPTER *a,
void *addr, void *addr,
dword* data, dword *data,
int dwords); int dwords);
void ( * istream_wakeup)(ADAPTER* a); void (*istream_wakeup)(ADAPTER *a);
#else #else
byte stream_buffer[4]; byte stream_buffer[4];
#endif #endif
@@ -79,39 +79,39 @@ struct adapter_s {
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* public functions of IDI common code */ /* public functions of IDI common code */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
void pr_out(ADAPTER * a); void pr_out(ADAPTER *a);
byte pr_dpc(ADAPTER * a); byte pr_dpc(ADAPTER *a);
byte scom_test_int(ADAPTER * a); byte scom_test_int(ADAPTER *a);
void scom_clear_int(ADAPTER * a); void scom_clear_int(ADAPTER *a);
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* OS specific functions used by IDI common code */ /* OS specific functions used by IDI common code */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
void free_entity(ADAPTER * a, byte e_no); void free_entity(ADAPTER *a, byte e_no);
void assign_queue(ADAPTER * a, byte e_no, word ref); void assign_queue(ADAPTER *a, byte e_no, word ref);
byte get_assign(ADAPTER * a, word ref); byte get_assign(ADAPTER *a, word ref);
void req_queue(ADAPTER * a, byte e_no); void req_queue(ADAPTER *a, byte e_no);
byte look_req(ADAPTER * a); byte look_req(ADAPTER *a);
void next_req(ADAPTER * a); void next_req(ADAPTER *a);
ENTITY * entity_ptr(ADAPTER * a, byte e_no); ENTITY *entity_ptr(ADAPTER *a, byte e_no);
#if defined(DIVA_ISTREAM) #if defined(DIVA_ISTREAM)
struct _diva_xdi_stream_interface; struct _diva_xdi_stream_interface;
void diva_xdi_provide_istream_info (ADAPTER* a, void diva_xdi_provide_istream_info(ADAPTER *a,
struct _diva_xdi_stream_interface* pI); struct _diva_xdi_stream_interface *pI);
void pr_stream (ADAPTER * a); void pr_stream(ADAPTER *a);
int diva_istream_write (void* context, int diva_istream_write(void *context,
int Id, int Id,
void* data, void *data,
int length, int length,
int final, int final,
byte usr1, byte usr1,
byte usr2); byte usr2);
int diva_istream_read (void* context, int diva_istream_read(void *context,
int Id, int Id,
void* data, void *data,
int max_length, int max_length,
int* final, int *final,
byte* usr1, byte *usr1,
byte* usr2); byte *usr2);
#if defined(DIVA_IDI_RX_DMA) #if defined(DIVA_IDI_RX_DMA)
#include "diva_dma.h" #include "diva_dma.h"
#endif #endif

View File

@@ -25,10 +25,10 @@
*/ */
#ifndef __DIVA_DI_DBG_INC__ #ifndef __DIVA_DI_DBG_INC__
#define __DIVA_DI_DBG_INC__ #define __DIVA_DI_DBG_INC__
#if !defined (dtrc) #if !defined(dtrc)
#define dtrc(a) #define dtrc(a)
#endif #endif
#if !defined (dbug) #if !defined(dbug)
#define dbug(a) #define dbug(a)
#endif #endif
#if !defined USE_EXTENDED_DEBUGS #if !defined USE_EXTENDED_DEBUGS

View File

@@ -25,7 +25,7 @@
*/ */
#ifndef _DI_DEFS_ #ifndef _DI_DEFS_
#define _DI_DEFS_ #define _DI_DEFS_
/* typedefs for our data structures */ /* typedefs for our data structures */
typedef struct get_name_s GET_NAME; typedef struct get_name_s GET_NAME;
/* The entity_s structure is used to pass all /* The entity_s structure is used to pass all
parameters between application and IDI */ parameters between application and IDI */
@@ -40,7 +40,7 @@ typedef struct get_para_s GET_PARA;
/* -------------------------------------------------------- /* --------------------------------------------------------
IDI_CALL IDI_CALL
-------------------------------------------------------- */ -------------------------------------------------------- */
typedef void (IDI_CALL_LINK_T * IDI_CALL)(ENTITY IDI_CALL_ENTITY_T *); typedef void (IDI_CALL_LINK_T *IDI_CALL)(ENTITY IDI_CALL_ENTITY_T *);
typedef struct { typedef struct {
word length; /* length of data/parameter field */ word length; /* length of data/parameter field */
byte P[270]; /* data/parameter field */ byte P[270]; /* data/parameter field */
@@ -52,7 +52,7 @@ struct get_name_s {
struct postcall_s { struct postcall_s {
word command; /* command = 0x0300 */ word command; /* command = 0x0300 */
word dummy; /* not used */ word dummy; /* not used */
void ( * callback)(void *); /* call back */ void (*callback)(void *); /* call back */
void *context; /* context pointer */ void *context; /* context pointer */
}; };
#define REQ_PARA 0x0600 /* request command line parameters */ #define REQ_PARA 0x0600 /* request command line parameters */
@@ -66,7 +66,7 @@ struct get_para_s {
}; };
struct buffers_s { struct buffers_s {
word PLength; word PLength;
byte * P; byte *P;
}; };
struct entity_s { struct entity_s {
byte Req; /* pending request */ byte Req; /* pending request */
@@ -79,10 +79,10 @@ struct entity_s {
byte GlobalId; /* reserved field */ byte GlobalId; /* reserved field */
byte XNum; /* number of X-buffers */ byte XNum; /* number of X-buffers */
byte RNum; /* number of R-buffers */ byte RNum; /* number of R-buffers */
BUFFERS * X; /* pointer to X-buffer list */ BUFFERS *X; /* pointer to X-buffer list */
BUFFERS * R; /* pointer to R-buffer list */ BUFFERS *R; /* pointer to R-buffer list */
word RLength; /* length of current R-data */ word RLength; /* length of current R-data */
DBUFFER * RBuffer; /* buffer of current R-data */ DBUFFER *RBuffer; /* buffer of current R-data */
byte RNR; /* receive not ready flag */ byte RNR; /* receive not ready flag */
byte complete; /* receive complete status */ byte complete; /* receive complete status */
IDI_CALL callback; IDI_CALL callback;
@@ -103,7 +103,7 @@ typedef struct {
word features; word features;
IDI_CALL request; IDI_CALL request;
} DESCRIPTOR; } DESCRIPTOR;
/* descriptor type field coding */ /* descriptor type field coding */
#define IDI_ADAPTER_S 1 #define IDI_ADAPTER_S 1
#define IDI_ADAPTER_PR 2 #define IDI_ADAPTER_PR 2
#define IDI_ADAPTER_DIVA 3 #define IDI_ADAPTER_DIVA 3
@@ -113,7 +113,7 @@ typedef struct {
#define IDI_DADAPTER 0xfd #define IDI_DADAPTER 0xfd
#define IDI_DIDDPNP 0xfe #define IDI_DIDDPNP 0xfe
#define IDI_DIMAINT 0xff #define IDI_DIMAINT 0xff
/* Hardware IDs ISA PNP */ /* Hardware IDs ISA PNP */
#define HW_ID_DIVA_PRO 3 /* same as IDI_ADAPTER_DIVA */ #define HW_ID_DIVA_PRO 3 /* same as IDI_ADAPTER_DIVA */
#define HW_ID_MAESTRA 4 /* same as IDI_ADAPTER_MAESTRA */ #define HW_ID_MAESTRA 4 /* same as IDI_ADAPTER_MAESTRA */
#define HW_ID_PICCOLA 5 #define HW_ID_PICCOLA 5
@@ -123,7 +123,7 @@ typedef struct {
#define HW_ID_DIVA20_U 9 #define HW_ID_DIVA20_U 9
#define HW_ID_DIVA30 10 #define HW_ID_DIVA30 10
#define HW_ID_DIVA30_U 11 #define HW_ID_DIVA30_U 11
/* Hardware IDs PCI */ /* Hardware IDs PCI */
#define HW_ID_EICON_PCI 0x1133 #define HW_ID_EICON_PCI 0x1133
#define HW_ID_SIEMENS_PCI 0x8001 /* unused SubVendor ID for Siemens Cornet-N cards */ #define HW_ID_SIEMENS_PCI 0x8001 /* unused SubVendor ID for Siemens Cornet-N cards */
#define HW_ID_PROTTYPE_CORNETN 0x0014 /* SubDevice ID for Siemens Cornet-N cards */ #define HW_ID_PROTTYPE_CORNETN 0x0014 /* SubDevice ID for Siemens Cornet-N cards */
@@ -153,7 +153,7 @@ typedef struct {
#define HW_ID_DSRV_VOICE_P30M_V2_PCI 0xe019 #define HW_ID_DSRV_VOICE_P30M_V2_PCI 0xe019
#define HW_ID_DSRV_B2F_PCI 0xe01a #define HW_ID_DSRV_B2F_PCI 0xe01a
#define HW_ID_DSRV_VOICE_B2M_V2_PCI 0xe01b #define HW_ID_DSRV_VOICE_B2M_V2_PCI 0xe01b
/* Hardware IDs USB */ /* Hardware IDs USB */
#define EICON_USB_VENDOR_ID 0x071D #define EICON_USB_VENDOR_ID 0x071D
#define HW_ID_DIVA_USB_REV1 0x1000 #define HW_ID_DIVA_USB_REV1 0x1000
#define HW_ID_DIVA_USB_REV2 0x1003 #define HW_ID_DIVA_USB_REV2 0x1003
@@ -162,7 +162,7 @@ typedef struct {
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Adapter array change notification framework Adapter array change notification framework
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
typedef void (IDI_CALL_LINK_T* didd_adapter_change_callback_t)( void IDI_CALL_ENTITY_T * context, DESCRIPTOR* adapter, int removal); typedef void (IDI_CALL_LINK_T *didd_adapter_change_callback_t)(void IDI_CALL_ENTITY_T *context, DESCRIPTOR *adapter, int removal);
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
#define DI_VOICE 0x0 /* obsolete define */ #define DI_VOICE 0x0 /* obsolete define */
#define DI_FAX3 0x1 #define DI_FAX3 0x1
@@ -177,5 +177,5 @@ typedef void (IDI_CALL_LINK_T* didd_adapter_change_callback_t)( void IDI_CAL
#define DI_EXTD_FAX 0x0200 /* Extended FAX (ECM, 2D, T.6, Polling) */ #define DI_EXTD_FAX 0x0200 /* Extended FAX (ECM, 2D, T.6, Polling) */
#define DI_AT_PARSER 0x0400 /* Build-in AT Parser in the L2 */ #define DI_AT_PARSER 0x0400 /* Build-in AT Parser in the L2 */
#define DI_VOICE_OVER_IP 0x0800 /* Voice over IP support */ #define DI_VOICE_OVER_IP 0x0800 /* Voice over IP support */
typedef void (IDI_CALL_LINK_T* _IDI_CALL)(void*, ENTITY*); typedef void (IDI_CALL_LINK_T *_IDI_CALL)(void *, ENTITY *);
#endif #endif

View File

@@ -28,7 +28,7 @@ static DESCRIPTOR _DAdapter;
/* /*
* didd callback function * didd callback function
*/ */
static void *didd_callback(void *context, DESCRIPTOR * adapter, static void *didd_callback(void *context, DESCRIPTOR *adapter,
int removal) int removal)
{ {
if (adapter->type == IDI_DADAPTER) { if (adapter->type == IDI_DADAPTER) {
@@ -65,7 +65,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
req.didd_notify.info.callback = (void *)didd_callback; req.didd_notify.info.callback = (void *)didd_callback;
req.didd_notify.info.context = NULL; req.didd_notify.info.context = NULL;
_DAdapter.request((ENTITY *) & req); _DAdapter.request((ENTITY *)&req);
if (req.didd_notify.e.Rc != 0xff) if (req.didd_notify.e.Rc != 0xff)
return (0); return (0);
notify_handle = req.didd_notify.info.handle; notify_handle = req.didd_notify.info.handle;
@@ -86,7 +86,7 @@ static void DIVA_EXIT_FUNCTION disconnect_didd(void)
req.didd_notify.e.Req = 0; req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY; req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY;
req.didd_notify.info.handle = notify_handle; req.didd_notify.info.handle = notify_handle;
_DAdapter.request((ENTITY *) & req); _DAdapter.request((ENTITY *)&req);
} }
/* /*

View File

@@ -28,12 +28,12 @@
PISDN_ADAPTER IoAdapters[MAX_ADAPTER]; PISDN_ADAPTER IoAdapters[MAX_ADAPTER];
extern IDI_CALL Requests[MAX_ADAPTER]; extern IDI_CALL Requests[MAX_ADAPTER];
extern int create_adapter_proc(diva_os_xdi_adapter_t * a); extern int create_adapter_proc(diva_os_xdi_adapter_t *a);
extern void remove_adapter_proc(diva_os_xdi_adapter_t * a); extern void remove_adapter_proc(diva_os_xdi_adapter_t *a);
#define DivaIdiReqFunc(N) \ #define DivaIdiReqFunc(N) \
static void DivaIdiRequest##N(ENTITY *e) \ static void DivaIdiRequest##N(ENTITY *e) \
{ if ( IoAdapters[N] ) (* IoAdapters[N]->DIRequest)(IoAdapters[N], e) ; } { if (IoAdapters[N]) (*IoAdapters[N]->DIRequest)(IoAdapters[N], e); }
/* /*
** Create own 32 Adapters ** Create own 32 Adapters
@@ -150,14 +150,14 @@ static int diva_find_free_adapters(int base, int nr)
return (0); return (0);
} }
static diva_os_xdi_adapter_t *diva_q_get_next(struct list_head * what) static diva_os_xdi_adapter_t *diva_q_get_next(struct list_head *what)
{ {
diva_os_xdi_adapter_t *a = NULL; diva_os_xdi_adapter_t *a = NULL;
if (what && (what->next != &adapter_queue)) if (what && (what->next != &adapter_queue))
a = list_entry(what->next, diva_os_xdi_adapter_t, link); a = list_entry(what->next, diva_os_xdi_adapter_t, link);
return(a); return (a);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
@@ -601,9 +601,9 @@ void diva_xdi_display_adapter_features(int card)
(features & DI_AT_PARSER) ? "Y" : "N")) (features & DI_AT_PARSER) ? "Y" : "N"))
DBG_LOG((" DI_VOICE_OVER_IP : %s", DBG_LOG((" DI_VOICE_OVER_IP : %s",
(features & DI_VOICE_OVER_IP) ? "Y" : "N")) (features & DI_VOICE_OVER_IP) ? "Y" : "N"))
} }
void diva_add_slave_adapter(diva_os_xdi_adapter_t * a) void diva_add_slave_adapter(diva_os_xdi_adapter_t *a)
{ {
diva_os_spin_lock_magic_t old_irql; diva_os_spin_lock_magic_t old_irql;
@@ -612,7 +612,7 @@ void diva_add_slave_adapter(diva_os_xdi_adapter_t * a)
diva_os_leave_spin_lock(&adapter_lock, &old_irql, "add_slave"); diva_os_leave_spin_lock(&adapter_lock, &old_irql, "add_slave");
} }
int diva_card_read_xlog(diva_os_xdi_adapter_t * a) int diva_card_read_xlog(diva_os_xdi_adapter_t *a)
{ {
diva_get_xlog_t *req; diva_get_xlog_t *req;
byte *data; byte *data;

View File

@@ -137,7 +137,7 @@ static int DIVA_INIT_FUNCTION divadidd_init(void)
goto out; goto out;
} }
out: out:
return (ret); return (ret);
} }

View File

@@ -28,44 +28,44 @@
/* /*
Every entry has length of PAGE_SIZE Every entry has length of PAGE_SIZE
and represents one single physical page and represents one single physical page
*/ */
struct _diva_dma_map_entry { struct _diva_dma_map_entry {
int busy; int busy;
dword phys_bus_addr; /* 32bit address as seen by the card */ dword phys_bus_addr; /* 32bit address as seen by the card */
void* local_ram_addr; /* local address as seen by the host */ void *local_ram_addr; /* local address as seen by the host */
void* addr_handle; /* handle uset to free allocated memory */ void *addr_handle; /* handle uset to free allocated memory */
}; };
/* /*
Create local mapping structure and init it to default state Create local mapping structure and init it to default state
*/ */
struct _diva_dma_map_entry* diva_alloc_dma_map (void* os_context, int nentries) { struct _diva_dma_map_entry *diva_alloc_dma_map(void *os_context, int nentries) {
diva_dma_map_entry_t* pmap = diva_os_malloc(0, sizeof(*pmap)*(nentries+1)); diva_dma_map_entry_t *pmap = diva_os_malloc(0, sizeof(*pmap) * (nentries + 1));
if (pmap) if (pmap)
memset (pmap, 0, sizeof(*pmap)*(nentries+1)); memset(pmap, 0, sizeof(*pmap) * (nentries + 1));
return pmap; return pmap;
} }
/* /*
Free local map (context should be freed before) if any Free local map (context should be freed before) if any
*/ */
void diva_free_dma_mapping (struct _diva_dma_map_entry* pmap) { void diva_free_dma_mapping(struct _diva_dma_map_entry *pmap) {
if (pmap) { if (pmap) {
diva_os_free (0, pmap); diva_os_free(0, pmap);
} }
} }
/* /*
Set information saved on the map entry Set information saved on the map entry
*/ */
void diva_init_dma_map_entry (struct _diva_dma_map_entry* pmap, void diva_init_dma_map_entry(struct _diva_dma_map_entry *pmap,
int nr, void* virt, dword phys, int nr, void *virt, dword phys,
void* addr_handle) { void *addr_handle) {
pmap[nr].phys_bus_addr = phys; pmap[nr].phys_bus_addr = phys;
pmap[nr].local_ram_addr = virt; pmap[nr].local_ram_addr = virt;
pmap[nr].addr_handle = addr_handle; pmap[nr].addr_handle = addr_handle;
} }
/* /*
Allocate one single entry in the map Allocate one single entry in the map
*/ */
int diva_alloc_dma_map_entry (struct _diva_dma_map_entry* pmap) { int diva_alloc_dma_map_entry(struct _diva_dma_map_entry *pmap) {
int i; int i;
for (i = 0; (pmap && pmap[i].local_ram_addr); i++) { for (i = 0; (pmap && pmap[i].local_ram_addr); i++) {
if (!pmap[i].busy) { if (!pmap[i].busy) {
@@ -77,18 +77,18 @@ int diva_alloc_dma_map_entry (struct _diva_dma_map_entry* pmap) {
} }
/* /*
Free one single entry in the map Free one single entry in the map
*/ */
void diva_free_dma_map_entry (struct _diva_dma_map_entry* pmap, int nr) { void diva_free_dma_map_entry(struct _diva_dma_map_entry *pmap, int nr) {
pmap[nr].busy = 0; pmap[nr].busy = 0;
} }
/* /*
Get information saved on the map entry Get information saved on the map entry
*/ */
void diva_get_dma_map_entry (struct _diva_dma_map_entry* pmap, int nr, void diva_get_dma_map_entry(struct _diva_dma_map_entry *pmap, int nr,
void** pvirt, dword* pphys) { void **pvirt, dword *pphys) {
*pphys = pmap[nr].phys_bus_addr; *pphys = pmap[nr].phys_bus_addr;
*pvirt = pmap[nr].local_ram_addr; *pvirt = pmap[nr].local_ram_addr;
} }
void* diva_get_entry_handle (struct _diva_dma_map_entry* pmap, int nr) { void *diva_get_entry_handle(struct _diva_dma_map_entry *pmap, int nr) {
return (pmap[nr].addr_handle); return (pmap[nr].addr_handle);
} }

View File

@@ -26,23 +26,23 @@
#ifndef __DIVA_DMA_MAPPING_IFC_H__ #ifndef __DIVA_DMA_MAPPING_IFC_H__
#define __DIVA_DMA_MAPPING_IFC_H__ #define __DIVA_DMA_MAPPING_IFC_H__
typedef struct _diva_dma_map_entry diva_dma_map_entry_t; typedef struct _diva_dma_map_entry diva_dma_map_entry_t;
struct _diva_dma_map_entry* diva_alloc_dma_map (void* os_context, int nentries); struct _diva_dma_map_entry *diva_alloc_dma_map(void *os_context, int nentries);
void diva_init_dma_map_entry (struct _diva_dma_map_entry* pmap, void diva_init_dma_map_entry(struct _diva_dma_map_entry *pmap,
int nr, void* virt, dword phys, int nr, void *virt, dword phys,
void* addr_handle); void *addr_handle);
int diva_alloc_dma_map_entry (struct _diva_dma_map_entry* pmap); int diva_alloc_dma_map_entry(struct _diva_dma_map_entry *pmap);
void diva_free_dma_map_entry (struct _diva_dma_map_entry* pmap, int entry); void diva_free_dma_map_entry(struct _diva_dma_map_entry *pmap, int entry);
void diva_get_dma_map_entry (struct _diva_dma_map_entry* pmap, int nr, void diva_get_dma_map_entry(struct _diva_dma_map_entry *pmap, int nr,
void** pvirt, dword* pphys); void **pvirt, dword *pphys);
void diva_free_dma_mapping (struct _diva_dma_map_entry* pmap); void diva_free_dma_mapping(struct _diva_dma_map_entry *pmap);
/* /*
Functionality to be implemented by OS wrapper Functionality to be implemented by OS wrapper
and running in process context and running in process context
*/ */
void diva_init_dma_map (void* hdev, void diva_init_dma_map(void *hdev,
struct _diva_dma_map_entry** ppmap, struct _diva_dma_map_entry **ppmap,
int nentries); int nentries);
void diva_free_dma_map (void* hdev, void diva_free_dma_map(void *hdev,
struct _diva_dma_map_entry* pmap); struct _diva_dma_map_entry *pmap);
void* diva_get_entry_handle (struct _diva_dma_map_entry* pmap, int nr); void *diva_get_entry_handle(struct _diva_dma_map_entry *pmap, int nr);
#endif #endif

View File

@@ -82,7 +82,7 @@
#define CODEC_PERMANENT 0x02 #define CODEC_PERMANENT 0x02
#define ADV_VOICE 0x03 #define ADV_VOICE 0x03
#define MAX_CIP_TYPES 5 /* kind of CIP types for group optimization */ #define MAX_CIP_TYPES 5 /* kind of CIP types for group optimization */
#define C_IND_MASK_DWORDS ((MAX_APPL+32) >> 5) #define C_IND_MASK_DWORDS ((MAX_APPL + 32) >> 5)
#define FAX_CONNECT_INFO_BUFFER_SIZE 256 #define FAX_CONNECT_INFO_BUFFER_SIZE 256
@@ -141,11 +141,11 @@ struct msn_ld_s {
struct api_parse_s { struct api_parse_s {
word length; word length;
byte * info; byte *info;
}; };
struct api_save_s { struct api_save_s {
API_PARSE parms[MAX_MSG_PARMS+1]; API_PARSE parms[MAX_MSG_PARMS + 1];
byte info[MAX_MSG_SIZE]; byte info[MAX_MSG_SIZE];
}; };
@@ -154,7 +154,7 @@ struct _DATA_B3_DESC {
word Number; word Number;
word Flags; word Flags;
word Length; word Length;
void * P; void *P;
}; };
struct _DATA_ACK_DESC { struct _DATA_ACK_DESC {
@@ -162,7 +162,7 @@ struct _DATA_ACK_DESC {
word Number; word Number;
}; };
typedef void (* t_std_internal_command)(dword Id, PLCI *plci, byte Rc); typedef void (*t_std_internal_command)(dword Id, PLCI *plci, byte Rc);
/************************************************************************/ /************************************************************************/
/* Don't forget to adapt dos.asm after changing the _APPL structure!!!! */ /* Don't forget to adapt dos.asm after changing the _APPL structure!!!! */
@@ -180,17 +180,17 @@ struct _APPL {
LIST_ENTRY s_function; LIST_ENTRY s_function;
dword s_context; dword s_context;
word s_count; word s_count;
APPL * s_next; APPL *s_next;
byte * xbuffer_used; byte *xbuffer_used;
void ** xbuffer_internal; void **xbuffer_internal;
void ** xbuffer_ptr; void **xbuffer_ptr;
byte * queue; byte *queue;
word queue_size; word queue_size;
word queue_free; word queue_free;
word queue_read; word queue_read;
@@ -205,9 +205,9 @@ struct _APPL {
byte MaxNCCIData; byte MaxNCCIData;
word MaxDataLength; word MaxDataLength;
word NCCIDataFlowCtrlTimer; word NCCIDataFlowCtrlTimer;
byte * ReceiveBuffer; byte *ReceiveBuffer;
word * DataNCCI; word *DataNCCI;
word * DataFlags; word *DataFlags;
}; };
@@ -245,7 +245,7 @@ struct _PLCI {
word msg_in_read_pos; word msg_in_read_pos;
word msg_in_wrap_pos; word msg_in_wrap_pos;
void * data_sent_ptr; void *data_sent_ptr;
byte data_sent; byte data_sent;
byte send_disc; byte send_disc;
byte sig_global_req; byte sig_global_req;
@@ -352,16 +352,16 @@ struct _DIVA_CAPI_ADAPTER {
byte max_listen; byte max_listen;
byte listen_active; byte listen_active;
PLCI *plci; PLCI *plci;
byte ch_ncci[MAX_NL_CHANNEL+1]; byte ch_ncci[MAX_NL_CHANNEL + 1];
byte ncci_ch[MAX_NCCI+1]; byte ncci_ch[MAX_NCCI + 1];
byte ncci_plci[MAX_NCCI+1]; byte ncci_plci[MAX_NCCI + 1];
byte ncci_state[MAX_NCCI+1]; byte ncci_state[MAX_NCCI + 1];
byte ncci_next[MAX_NCCI+1]; byte ncci_next[MAX_NCCI + 1];
NCCI ncci[MAX_NCCI+1]; NCCI ncci[MAX_NCCI + 1];
byte ch_flow_control[MAX_NL_CHANNEL+1]; /* Used by XON protocol */ byte ch_flow_control[MAX_NL_CHANNEL + 1]; /* Used by XON protocol */
byte ch_flow_control_pending; byte ch_flow_control_pending;
byte ch_flow_plci[MAX_NL_CHANNEL+1]; byte ch_flow_plci[MAX_NL_CHANNEL + 1];
int last_flow_control_ch; int last_flow_control_ch;
dword Info_Mask[MAX_APPL]; dword Info_Mask[MAX_APPL];
@@ -398,7 +398,7 @@ struct _DIVA_CAPI_ADAPTER {
byte flag_dynamic_l1_down; /* for hunt groups:down layer 1 if no appl present*/ byte flag_dynamic_l1_down; /* for hunt groups:down layer 1 if no appl present*/
byte FlowControlIdTable[256]; byte FlowControlIdTable[256];
byte FlowControlSkipTable[256]; byte FlowControlSkipTable[256];
void* os_card; /* pointer to associated OS dependent adapter structure */ void *os_card; /* pointer to associated OS dependent adapter structure */
}; };
@@ -528,13 +528,13 @@ struct t30_info_s {
#define T30_OPERATING_MODE_CAPI_NEG 4 #define T30_OPERATING_MODE_CAPI_NEG 4
#define T30_OPERATING_MODE_COUNT 5 #define T30_OPERATING_MODE_COUNT 5
/* EDATA transmit messages */ /* EDATA transmit messages */
#define EDATA_T30_DIS 0x01 #define EDATA_T30_DIS 0x01
#define EDATA_T30_FTT 0x02 #define EDATA_T30_FTT 0x02
#define EDATA_T30_MCF 0x03 #define EDATA_T30_MCF 0x03
#define EDATA_T30_PARAMETERS 0x04 #define EDATA_T30_PARAMETERS 0x04
/* EDATA receive messages */ /* EDATA receive messages */
#define EDATA_T30_DCS 0x81 #define EDATA_T30_DCS 0x81
#define EDATA_T30_TRAIN_OK 0x82 #define EDATA_T30_TRAIN_OK 0x82
#define EDATA_T30_EOP 0x83 #define EDATA_T30_EOP 0x83
@@ -639,10 +639,10 @@ struct t30_info_s {
typedef struct async_s ASYNC_FORMAT; typedef struct async_s ASYNC_FORMAT;
struct async_s { struct async_s {
unsigned pe: 1; unsigned pe:1;
unsigned parity:2; unsigned parity:2;
unsigned spare: 2; unsigned spare:2;
unsigned stp: 1; unsigned stp:1;
unsigned ch_len:2; /* 3th octett in CAI */ unsigned ch_len:2; /* 3th octett in CAI */
}; };
@@ -686,14 +686,14 @@ struct async_s {
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* Capi IE + Msg types */ /* Capi IE + Msg types */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
#define ESC_CAUSE 0x800|CAU /* Escape cause element */ #define ESC_CAUSE 0x800 | CAU /* Escape cause element */
#define ESC_MSGTYPE 0x800|MSGTYPEIE /* Escape message type */ #define ESC_MSGTYPE 0x800 | MSGTYPEIE /* Escape message type */
#define ESC_CHI 0x800|CHI /* Escape channel id */ #define ESC_CHI 0x800 | CHI /* Escape channel id */
#define ESC_LAW 0x800|BC /* Escape law info */ #define ESC_LAW 0x800 | BC /* Escape law info */
#define ESC_CR 0x800|CRIE /* Escape CallReference */ #define ESC_CR 0x800 | CRIE /* Escape CallReference */
#define ESC_PROFILE 0x800|PROFILEIE /* Escape profile */ #define ESC_PROFILE 0x800 | PROFILEIE /* Escape profile */
#define ESC_SSEXT 0x800|SSEXTIE /* Escape Supplem. Serv.*/ #define ESC_SSEXT 0x800 | SSEXTIE /* Escape Supplem. Serv.*/
#define ESC_VSWITCH 0x800|VSWITCHIE /* Escape VSwitch */ #define ESC_VSWITCH 0x800 | VSWITCHIE /* Escape VSwitch */
#define CST 0x14 /* Call State i.e. */ #define CST 0x14 /* Call State i.e. */
#define PI 0x1E /* Progress Indicator */ #define PI 0x1E /* Progress Indicator */
#define NI 0x27 /* Notification Ind */ #define NI 0x27 /* Notification Ind */
@@ -1114,29 +1114,29 @@ extern word li_total_channels;
/* /*
B2 configuration for PIAFS: B2 configuration for PIAFS:
+---------------------+------+-----------------------------------------+ +---------------------+------+-----------------------------------------+
| PIAFS Protocol | byte | Bit 1 - Protocol Speed | | PIAFS Protocol | byte | Bit 1 - Protocol Speed |
| Speed configuration | | 0 - 32K | | Speed configuration | | 0 - 32K |
| | | 1 - 64K (default) | | | | 1 - 64K (default) |
| | | Bit 2 - Variable Protocol Speed | | | | Bit 2 - Variable Protocol Speed |
| | | 0 - Speed is fix | | | | 0 - Speed is fix |
| | | 1 - Speed is variable (default) | | | | 1 - Speed is variable (default) |
+---------------------+------+-----------------------------------------+ +---------------------+------+-----------------------------------------+
| Direction | word | Enable compression/decompression for | | Direction | word | Enable compression/decompression for |
| | | 0: All direction | | | | 0: All direction |
| | | 1: disable outgoing data | | | | 1: disable outgoing data |
| | | 2: disable incomming data | | | | 2: disable incomming data |
| | | 3: disable both direction (default) | | | | 3: disable both direction (default) |
+---------------------+------+-----------------------------------------+ +---------------------+------+-----------------------------------------+
| Number of code | word | Parameter P1 of V.42bis in accordance | | Number of code | word | Parameter P1 of V.42bis in accordance |
| words | | with V.42bis | | words | | with V.42bis |
+---------------------+------+-----------------------------------------+ +---------------------+------+-----------------------------------------+
| Maximum String | word | Parameter P2 of V.42bis in accordance | | Maximum String | word | Parameter P2 of V.42bis in accordance |
| Length | | with V.42bis | | Length | | with V.42bis |
+---------------------+------+-----------------------------------------+ +---------------------+------+-----------------------------------------+
| control (UDATA) | byte | enable PIAFS control communication | | control (UDATA) | byte | enable PIAFS control communication |
| abilities | | | | abilities | | |
+---------------------+------+-----------------------------------------+ +---------------------+------+-----------------------------------------+
*/ */
#define PIAFS_UDATA_ABILITIES 0x80 #define PIAFS_UDATA_ABILITIES 0x80

View File

@@ -86,7 +86,7 @@ int diva_os_copy_from_user(void *os_handle, void *dst, const void __user *src,
/* /*
* get time * get time
*/ */
void diva_os_get_time(dword * sec, dword * usec) void diva_os_get_time(dword *sec, dword *usec)
{ {
struct timeval tv; struct timeval tv;
@@ -115,7 +115,7 @@ void diva_os_get_time(dword * sec, dword * usec)
/* /*
* device node operations * device node operations
*/ */
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;
@@ -158,13 +158,13 @@ static int maint_close(struct inode *ino, struct file *filep)
} }
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)
{ {
return (maint_read_write((char __user *) buf, (int) count)); return (maint_read_write((char __user *) buf, (int) count));
} }
static ssize_t divas_maint_read(struct file *file, char __user *buf, static ssize_t divas_maint_read(struct file *file, char __user *buf,
size_t count, loff_t * ppos) size_t count, loff_t *ppos)
{ {
return (maint_read_write(buf, (int) count)); return (maint_read_write(buf, (int) count));
} }
@@ -238,7 +238,7 @@ static int DIVA_INIT_FUNCTION maint_init(void)
DRIVERLNAME, buffer, (buffer_length / 1024), DRIVERLNAME, buffer, (buffer_length / 1024),
(diva_dbg_mem == 0) ? "internal" : "external", major); (diva_dbg_mem == 0) ? "internal" : "external", major);
out: out:
return (ret); return (ret);
} }
@@ -255,4 +255,3 @@ static void DIVA_EXIT_FUNCTION maint_exit(void)
module_init(maint_init); module_init(maint_init);
module_exit(maint_exit); module_exit(maint_exit);

View File

@@ -81,7 +81,7 @@ void diva_xdi_didd_register_adapter(int card)
req.didd_remove_adapter.e.Req = 0; req.didd_remove_adapter.e.Req = 0;
req.didd_add_adapter.e.Rc = IDI_SYNC_REQ_DIDD_ADD_ADAPTER; req.didd_add_adapter.e.Rc = IDI_SYNC_REQ_DIDD_ADD_ADAPTER;
req.didd_add_adapter.info.descriptor = (void *) &d; req.didd_add_adapter.info.descriptor = (void *) &d;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
if (req.didd_add_adapter.e.Rc != 0xff) { if (req.didd_add_adapter.e.Rc != 0xff) {
DBG_ERR(("DIDD register A(%d) failed !", card)) DBG_ERR(("DIDD register A(%d) failed !", card))
} }
@@ -103,7 +103,7 @@ void diva_xdi_didd_remove_adapter(int card)
req.didd_remove_adapter.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER; req.didd_remove_adapter.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER;
req.didd_remove_adapter.info.p_request = req.didd_remove_adapter.info.p_request =
(IDI_CALL) Requests[card - 1]; (IDI_CALL) Requests[card - 1];
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
memset(&(a->IdTable), 0x00, 256); memset(&(a->IdTable), 0x00, 256);
} }
@@ -115,7 +115,7 @@ static void start_dbg(void)
DbgRegister("DIVAS", DRIVERRELEASE_DIVAS, (debugmask) ? debugmask : DBG_DEFAULT); DbgRegister("DIVAS", DRIVERRELEASE_DIVAS, (debugmask) ? debugmask : DBG_DEFAULT);
DBG_LOG(("DIVA ISDNXDI BUILD (%s[%s])", DBG_LOG(("DIVA ISDNXDI BUILD (%s[%s])",
DIVA_BUILD, diva_xdi_common_code_build)) DIVA_BUILD, diva_xdi_common_code_build))
} }
/* /*
* stop debug * stop debug
@@ -130,7 +130,7 @@ static void stop_dbg(void)
/* /*
* didd callback function * didd callback function
*/ */
static void *didd_callback(void *context, DESCRIPTOR * adapter, static void *didd_callback(void *context, DESCRIPTOR *adapter,
int removal) int removal)
{ {
if (adapter->type == IDI_DADAPTER) { if (adapter->type == IDI_DADAPTER) {
@@ -171,7 +171,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
req.didd_notify.info.callback = (void *)didd_callback; req.didd_notify.info.callback = (void *)didd_callback;
req.didd_notify.info.context = NULL; req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
if (req.didd_notify.e.Rc != 0xff) { if (req.didd_notify.e.Rc != 0xff) {
stop_dbg(); stop_dbg();
return (0); return (0);
@@ -203,7 +203,7 @@ static void disconnect_didd(void)
req.didd_notify.e.Req = 0; req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY; req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY;
req.didd_notify.info.handle = notify_handle; req.didd_notify.info.handle = notify_handle;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
} }
/* /*

View File

@@ -71,10 +71,10 @@ static char *getrev(const char *revision)
* LOCALS * LOCALS
*/ */
static ssize_t um_idi_read(struct file *file, char __user *buf, size_t count, static ssize_t um_idi_read(struct file *file, char __user *buf, size_t count,
loff_t * offset); loff_t *offset);
static ssize_t um_idi_write(struct file *file, const char __user *buf, static ssize_t um_idi_write(struct file *file, const char __user *buf,
size_t count, loff_t * offset); size_t count, loff_t *offset);
static unsigned int um_idi_poll(struct file *file, poll_table * wait); static unsigned int um_idi_poll(struct file *file, poll_table *wait);
static int um_idi_open(struct inode *inode, struct file *file); static int um_idi_open(struct inode *inode, struct file *file);
static int um_idi_release(struct inode *inode, struct file *file); static int um_idi_release(struct inode *inode, struct file *file);
static int remove_entity(void *entity); static int remove_entity(void *entity);
@@ -194,7 +194,7 @@ static int DIVA_INIT_FUNCTION divasi_init(void)
} }
printk(KERN_INFO "%s: started with major %d\n", DRIVERLNAME, major); printk(KERN_INFO "%s: started with major %d\n", DRIVERLNAME, major);
out: out:
return (ret); return (ret);
} }
@@ -228,7 +228,7 @@ divas_um_idi_copy_to_user(void *os_handle, void *dst, const void *src,
} }
static ssize_t static ssize_t
um_idi_read(struct file *file, char __user *buf, size_t count, loff_t * offset) um_idi_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
{ {
diva_um_idi_os_context_t *p_os; diva_um_idi_os_context_t *p_os;
int ret = -EINVAL; int ret = -EINVAL;
@@ -310,7 +310,7 @@ static int um_idi_open_adapter(struct file *file, int adapter_nr)
static ssize_t static ssize_t
um_idi_write(struct file *file, const char __user *buf, size_t count, um_idi_write(struct file *file, const char __user *buf, size_t count,
loff_t * offset) loff_t *offset)
{ {
diva_um_idi_os_context_t *p_os; diva_um_idi_os_context_t *p_os;
int ret = -EINVAL; int ret = -EINVAL;
@@ -367,7 +367,7 @@ um_idi_write(struct file *file, const char __user *buf, size_t count,
return (ret); return (ret);
} }
static unsigned int um_idi_poll(struct file *file, poll_table * wait) static unsigned int um_idi_poll(struct file *file, poll_table *wait)
{ {
diva_um_idi_os_context_t *p_os; diva_um_idi_os_context_t *p_os;
@@ -434,7 +434,7 @@ static int um_idi_release(struct inode *inode, struct file *file)
goto out; goto out;
} }
out: out:
return (ret); return (ret);
} }
@@ -466,7 +466,7 @@ void diva_um_timer_function(unsigned long data)
wake_up_interruptible(&p_os->read_wait); wake_up_interruptible(&p_os->read_wait);
wake_up_interruptible(&p_os->close_wait); wake_up_interruptible(&p_os->close_wait);
DBG_ERR(("entity removal watchdog")) DBG_ERR(("entity removal watchdog"))
} }
/* /*
** If application exits without entity removal this function will remove ** If application exits without entity removal this function will remove

View File

@@ -77,7 +77,7 @@ typedef struct _diva_os_thread_dpc {
class, Device class to match. The class_mask tells which bits class, Device class to match. The class_mask tells which bits
class_mask of the class are honored during the comparison. class_mask of the class are honored during the comparison.
driver_data Data private to the driver. driver_data Data private to the driver.
*/ */
#if !defined(PCI_DEVICE_ID_EICON_MAESTRAP_2) #if !defined(PCI_DEVICE_ID_EICON_MAESTRAP_2)
#define PCI_DEVICE_ID_EICON_MAESTRAP_2 0xE015 #define PCI_DEVICE_ID_EICON_MAESTRAP_2 0xE015
@@ -109,7 +109,7 @@ typedef struct _diva_os_thread_dpc {
/* /*
This table should be sorted by PCI device ID This table should be sorted by PCI device ID
*/ */
static struct pci_device_id divas_pci_tbl[] = { static struct pci_device_id divas_pci_tbl[] = {
/* Diva Server BRI-2M PCI 0xE010 */ /* Diva Server BRI-2M PCI 0xE010 */
{ PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_MAESTRA), { PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_MAESTRA),
@@ -332,10 +332,10 @@ void PCIread(byte bus, byte func, int offset, void *data, int length,
Init map with DMA pages. It is not problem if some allocations fail - Init map with DMA pages. It is not problem if some allocations fail -
the channels that will not get one DMA page will use standard PIO the channels that will not get one DMA page will use standard PIO
interface interface
*/ */
static void *diva_pci_alloc_consistent(struct pci_dev *hwdev, static void *diva_pci_alloc_consistent(struct pci_dev *hwdev,
size_t size, size_t size,
dma_addr_t * dma_handle, dma_addr_t *dma_handle,
void **addr_handle) void **addr_handle)
{ {
void *addr = pci_alloc_consistent(hwdev, size, dma_handle); void *addr = pci_alloc_consistent(hwdev, size, dma_handle);
@@ -381,7 +381,7 @@ void diva_init_dma_map(void *hdev,
/* /*
Free all contained in the map entries and memory used by the map Free all contained in the map entries and memory used by the map
Should be always called after adapter removal from DIDD array Should be always called after adapter removal from DIDD array
*/ */
void diva_free_dma_map(void *hdev, struct _diva_dma_map_entry *pmap) void diva_free_dma_map(void *hdev, struct _diva_dma_map_entry *pmap)
{ {
struct pci_dev *pdev = (struct pci_dev *) hdev; struct pci_dev *pdev = (struct pci_dev *) hdev;
@@ -501,7 +501,7 @@ static void diva_os_dpc_proc(unsigned long context)
(*(pisr->callback)) (pisr, pisr->callback_context); (*(pisr->callback)) (pisr, pisr->callback_context);
} }
int diva_os_initialize_soft_isr(diva_os_soft_isr_t * psoft_isr, int diva_os_initialize_soft_isr(diva_os_soft_isr_t *psoft_isr,
diva_os_soft_isr_callback_t callback, diva_os_soft_isr_callback_t callback,
void *callback_context) void *callback_context)
{ {
@@ -520,7 +520,7 @@ int diva_os_initialize_soft_isr(diva_os_soft_isr_t * psoft_isr,
return (0); return (0);
} }
int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr) int diva_os_schedule_soft_isr(diva_os_soft_isr_t *psoft_isr)
{ {
if (psoft_isr && psoft_isr->object) { if (psoft_isr && psoft_isr->object) {
diva_os_thread_dpc_t *pdpc = diva_os_thread_dpc_t *pdpc =
@@ -532,12 +532,12 @@ int diva_os_schedule_soft_isr(diva_os_soft_isr_t * psoft_isr)
return (1); return (1);
} }
int diva_os_cancel_soft_isr(diva_os_soft_isr_t * psoft_isr) int diva_os_cancel_soft_isr(diva_os_soft_isr_t *psoft_isr)
{ {
return (0); return (0);
} }
void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr) void diva_os_remove_soft_isr(diva_os_soft_isr_t *psoft_isr)
{ {
if (psoft_isr && psoft_isr->object) { if (psoft_isr && psoft_isr->object) {
diva_os_thread_dpc_t *pdpc = diva_os_thread_dpc_t *pdpc =
@@ -589,7 +589,7 @@ static int divas_release(struct inode *inode, struct file *file)
} }
static ssize_t divas_write(struct file *file, const char __user *buf, static ssize_t divas_write(struct file *file, const char __user *buf,
size_t count, loff_t * ppos) size_t count, loff_t *ppos)
{ {
int ret = -EINVAL; int ret = -EINVAL;
@@ -620,7 +620,7 @@ static ssize_t divas_write(struct file *file, const char __user *buf,
} }
static ssize_t divas_read(struct file *file, char __user *buf, static ssize_t divas_read(struct file *file, char __user *buf,
size_t count, loff_t * ppos) size_t count, loff_t *ppos)
{ {
int ret = -EINVAL; int ret = -EINVAL;
@@ -650,7 +650,7 @@ static ssize_t divas_read(struct file *file, char __user *buf,
return (ret); return (ret);
} }
static unsigned int divas_poll(struct file *file, poll_table * wait) static unsigned int divas_poll(struct file *file, poll_table *wait)
{ {
if (!file->private_data) { if (!file->private_data) {
return (POLLERR); return (POLLERR);
@@ -824,7 +824,7 @@ static int DIVA_INIT_FUNCTION divas_init(void)
} }
printk(KERN_INFO "%s: started with major %d\n", DRIVERLNAME, major); printk(KERN_INFO "%s: started with major %d\n", DRIVERLNAME, major);
out: out:
return (ret); return (ret);
} }

View File

@@ -55,7 +55,7 @@ extern struct proc_dir_entry *proc_net_eicon;
static struct proc_dir_entry *divas_proc_entry = NULL; static struct proc_dir_entry *divas_proc_entry = NULL;
static ssize_t static ssize_t
divas_read(struct file *file, char __user *buf, size_t count, loff_t * off) divas_read(struct file *file, char __user *buf, size_t count, loff_t *off)
{ {
int len = 0; int len = 0;
int cadapter; int cadapter;
@@ -94,12 +94,12 @@ divas_read(struct file *file, char __user *buf, size_t count, loff_t * off)
} }
static ssize_t static ssize_t
divas_write(struct file *file, const char __user *buf, size_t count, loff_t * off) divas_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
{ {
return (-ENODEV); return (-ENODEV);
} }
static unsigned int divas_poll(struct file *file, poll_table * wait) static unsigned int divas_poll(struct file *file, poll_table *wait)
{ {
return (POLLERR); return (POLLERR);
} }
@@ -354,7 +354,7 @@ static const struct file_operations info_proc_fops = {
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Create adapter directory and files in proc file system Create adapter directory and files in proc file system
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
int create_adapter_proc(diva_os_xdi_adapter_t * a) int create_adapter_proc(diva_os_xdi_adapter_t *a)
{ {
struct proc_dir_entry *de, *pe; struct proc_dir_entry *de, *pe;
char tmp[16]; char tmp[16];
@@ -387,7 +387,7 @@ int create_adapter_proc(diva_os_xdi_adapter_t * a)
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Remove adapter directory and files in proc file system Remove adapter directory and files in proc file system
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
void remove_adapter_proc(diva_os_xdi_adapter_t * a) void remove_adapter_proc(diva_os_xdi_adapter_t *a)
{ {
char tmp[16]; char tmp[16];

View File

@@ -78,7 +78,7 @@ typedef struct _diva_xdi_get_extended_xdi_features {
} diva_xdi_get_extended_xdi_features_t; } diva_xdi_get_extended_xdi_features_t;
/* /*
features[0] features[0]
*/ */
#define DIVA_XDI_EXTENDED_FEATURES_VALID 0x01 #define DIVA_XDI_EXTENDED_FEATURES_VALID 0x01
#define DIVA_XDI_EXTENDED_FEATURE_CMA 0x02 #define DIVA_XDI_EXTENDED_FEATURE_CMA 0x02
#define DIVA_XDI_EXTENDED_FEATURE_SDRAM_BAR 0x04 #define DIVA_XDI_EXTENDED_FEATURE_SDRAM_BAR 0x04
@@ -97,7 +97,7 @@ typedef struct _diva_xdi_get_adapter_sdram_bar {
#define IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS 0x94 #define IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS 0x94
/* /*
CAPI Parameters will be written in the caller's buffer CAPI Parameters will be written in the caller's buffer
*/ */
typedef struct _diva_xdi_get_capi_parameters { typedef struct _diva_xdi_get_capi_parameters {
dword structure_length; dword structure_length;
byte flag_dynamic_l1_down; byte flag_dynamic_l1_down;
@@ -111,7 +111,7 @@ typedef struct _diva_xdi_get_capi_parameters {
in case of one adapter that supports multiple interfaces in case of one adapter that supports multiple interfaces
'controller' is zero for Master adapter (and adapter that supports 'controller' is zero for Master adapter (and adapter that supports
only one interface) only one interface)
*/ */
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;
@@ -126,7 +126,7 @@ typedef struct _diva_xdi_get_logical_adapter_number {
typedef struct _diva_xdi_dma_descriptor_operation { typedef struct _diva_xdi_dma_descriptor_operation {
int operation; int operation;
int descriptor_number; int descriptor_number;
void* descriptor_address; void *descriptor_address;
dword descriptor_magic; dword descriptor_magic;
} diva_xdi_dma_descriptor_operation_t; } diva_xdi_dma_descriptor_operation_t;
/******************************************************************************/ /******************************************************************************/
@@ -138,21 +138,21 @@ typedef struct _diva_xdi_dma_descriptor_operation {
#define IDI_SYNC_REQ_DIDD_GET_CFG_LIB_IFC 0x10 #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;
void * context; void *context;
} diva_didd_adapter_notify_t; } diva_didd_adapter_notify_t;
typedef struct _diva_didd_add_adapter { typedef struct _diva_didd_add_adapter {
void * descriptor; void *descriptor;
} diva_didd_add_adapter_t; } diva_didd_add_adapter_t;
typedef struct _diva_didd_remove_adapter { typedef struct _diva_didd_remove_adapter {
IDI_CALL p_request; IDI_CALL p_request;
} diva_didd_remove_adapter_t; } diva_didd_remove_adapter_t;
typedef struct _diva_didd_read_adapter_array { 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 { typedef struct _diva_didd_get_cfg_lib_ifc {
void* ifc; void *ifc;
} diva_didd_get_cfg_lib_ifc_t; } diva_didd_get_cfg_lib_ifc_t;
/******************************************************************************/ /******************************************************************************/
#define IDI_SYNC_REQ_XDI_GET_STREAM 0x91 #define IDI_SYNC_REQ_XDI_GET_STREAM 0x91
@@ -166,28 +166,28 @@ typedef struct _diva_xdi_stream_interface {
unsigned char Id; /* filled by XDI client */ unsigned char Id; /* filled by XDI client */
unsigned char provided_service; /* filled by XDI */ unsigned char provided_service; /* filled by XDI */
unsigned char requested_service; /* filled by XDI Client */ unsigned char requested_service; /* filled by XDI Client */
void* xdi_context; /* filled by XDI */ void *xdi_context; /* filled by XDI */
void* client_context; /* filled by XDI client */ void *client_context; /* filled by XDI client */
int (*write)(void* context, int (*write)(void *context,
int Id, int Id,
void* data, void *data,
int length, int length,
int final, int final,
byte usr1, byte usr1,
byte usr2); byte usr2);
int (*read)(void* context, int (*read)(void *context,
int Id, int Id,
void* data, void *data,
int max_length, int max_length,
int* final, int *final,
byte* usr1, byte *usr1,
byte* usr2); byte *usr2);
int (*complete)(void* client_context, int (*complete)(void *client_context,
int Id, int Id,
int what, int what,
void* data, void *data,
int length, int length,
int* final); int *final);
} diva_xdi_stream_interface_t; } diva_xdi_stream_interface_t;
/******************************************************************************/ /******************************************************************************/
/* /*
@@ -201,9 +201,9 @@ typedef struct
unsigned char HookState; /* current logical hook state */ unsigned char HookState; /* current logical hook state */
#define SERIAL_ON_HOOK 0x02 /* set in DIVA CTRL_R register */ #define SERIAL_ON_HOOK 0x02 /* set in DIVA CTRL_R register */
} SERIAL_STATE; } SERIAL_STATE;
typedef int ( * SERIAL_INT_CB) (void *Context) ; typedef int (*SERIAL_INT_CB)(void *Context);
typedef int ( * SERIAL_DPC_CB) (void *Context) ; typedef int (*SERIAL_DPC_CB)(void *Context);
typedef unsigned char ( * SERIAL_I_SYNC) (void *Context) ; typedef unsigned char (*SERIAL_I_SYNC)(void *Context);
typedef struct typedef struct
{ /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */ { /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */
unsigned char Req; /* request (must be always 0) */ unsigned char Req; /* request (must be always 0) */
@@ -243,13 +243,13 @@ typedef struct
#define DRIVER_STATUS_TRAPPED 0xAE #define DRIVER_STATUS_TRAPPED 0xAE
unsigned char wmpStatus; /* exported by WMP */ unsigned char wmpStatus; /* exported by WMP */
unsigned char idiStatus; /* exported by IDI */ unsigned char idiStatus; /* exported by IDI */
unsigned long wizProto ; /* from WMP registry to IDI */ unsigned long wizProto; /* from WMP registry to IDI */
/* the cardtype value is defined by cardtype.h */ /* the cardtype value is defined by cardtype.h */
unsigned long cardType ; /* from IDI registry to WMP */ unsigned long cardType; /* from IDI registry to WMP */
unsigned long nt2 ; /* from IDI registry to WMP */ unsigned long nt2; /* from IDI registry to WMP */
unsigned long permanent ; /* from IDI registry to WMP */ unsigned long permanent; /* from IDI registry to WMP */
unsigned long stableL2 ; /* from IDI registry to WMP */ unsigned long stableL2; /* from IDI registry to WMP */
unsigned long tei ; /* from IDI registry to WMP */ unsigned long tei; /* from IDI registry to WMP */
#define CRC4_MASK 0x00000003 #define CRC4_MASK 0x00000003
#define L1_TRISTATE_MASK 0x00000004 #define L1_TRISTATE_MASK 0x00000004
#define WATCHDOG_MASK 0x00000008 #define WATCHDOG_MASK 0x00000008
@@ -271,17 +271,17 @@ typedef struct
#define SET_STABLEL2 0x20000000 #define SET_STABLEL2 0x20000000
#define SET_TEI 0x40000000 #define SET_TEI 0x40000000
#define SET_NUMBERLEN 0x80000000 #define SET_NUMBERLEN 0x80000000
unsigned long Flag ; /* |31-Type-16|15-Mask-0| */ unsigned long Flag; /* |31-Type-16|15-Mask-0| */
unsigned long NumberLen ; /* reconfiguration: union is empty */ unsigned long NumberLen; /* reconfiguration: union is empty */
union { union {
struct { /* possible reconfiguration, but ... ; SET_BOARD */ struct { /* possible reconfiguration, but ... ; SET_BOARD */
unsigned long SerialNumber ; unsigned long SerialNumber;
char *pCardname ; /* di_defs.h: BOARD_NAME_LENGTH */ char *pCardname; /* di_defs.h: BOARD_NAME_LENGTH */
} board ; } board;
struct { /* reset: need resources */ struct { /* reset: need resources */
void * pRawResources ; void *pRawResources;
void * pXlatResources ; void *pXlatResources;
} res ; } res;
struct { /* reconfiguration: wizProto == PROTTYPE_RBSCAS */ struct { /* reconfiguration: wizProto == PROTTYPE_RBSCAS */
#define GLARE_RESOLVE_MASK 0x00000001 #define GLARE_RESOLVE_MASK 0x00000001
#define DID_MASK 0x00000002 #define DID_MASK 0x00000002
@@ -289,17 +289,17 @@ typedef struct
#define SET_GLARE_RESOLVE 0x00010000 #define SET_GLARE_RESOLVE 0x00010000
#define SET_DID 0x00020000 #define SET_DID 0x00020000
#define SET_BEARER_CAP 0x000c0000 #define SET_BEARER_CAP 0x000c0000
unsigned long Flag ; /* |31-Type-16|15-VALUE-0| */ unsigned long Flag; /* |31-Type-16|15-VALUE-0| */
unsigned short DigitTimeout ; unsigned short DigitTimeout;
unsigned short AnswerDelay ; unsigned short AnswerDelay;
} rbs ; } rbs;
struct { /* reconfiguration: wizProto == PROTTYPE_QSIG */ struct { /* reconfiguration: wizProto == PROTTYPE_QSIG */
#define CALL_REF_LENGTH1_MASK 0x00000001 #define CALL_REF_LENGTH1_MASK 0x00000001
#define BRI_CHANNEL_ID_MASK 0x00000002 #define BRI_CHANNEL_ID_MASK 0x00000002
#define SET_CALL_REF_LENGTH 0x00010000 #define SET_CALL_REF_LENGTH 0x00010000
#define SET_BRI_CHANNEL_ID 0x00020000 #define SET_BRI_CHANNEL_ID 0x00020000
unsigned long Flag ; /* |31-Type-16|15-VALUE-0| */ unsigned long Flag; /* |31-Type-16|15-VALUE-0| */
} qsig ; } qsig;
struct { /* reconfiguration: NumberLen != 0 */ struct { /* reconfiguration: NumberLen != 0 */
#define SET_SPID1 0x00010000 #define SET_SPID1 0x00010000
#define SET_NUMBER1 0x00020000 #define SET_NUMBER1 0x00020000
@@ -308,17 +308,17 @@ typedef struct
#define SET_NUMBER2 0x00200000 #define SET_NUMBER2 0x00200000
#define SET_SUBADDRESS2 0x00400000 #define SET_SUBADDRESS2 0x00400000
#define MASK_SET 0xffff0000 #define MASK_SET 0xffff0000
unsigned long Flag ; /* |31-Type-16|15-Channel-0| */ unsigned long Flag; /* |31-Type-16|15-Channel-0| */
unsigned char *pBuffer ; /* number value */ unsigned char *pBuffer; /* number value */
} isdnNo ; } isdnNo;
} }
parms parms
; ;
} isdnProps ; } isdnProps;
/* /*
* IDI_SYNC_REQ_PORTDRV_HOOK - signal plug/unplug (Award Cardware only) * IDI_SYNC_REQ_PORTDRV_HOOK - signal plug/unplug (Award Cardware only)
*/ */
typedef void ( * PORTDRV_HOOK_CB) (void *Context, int Plug) ; typedef void (*PORTDRV_HOOK_CB)(void *Context, int Plug);
typedef struct typedef struct
{ /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */ { /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */
unsigned char Req; /* request (must be always 0) */ unsigned char Req; /* request (must be always 0) */
@@ -328,11 +328,11 @@ typedef struct
PORTDRV_HOOK_CB Callback; /* to be called on plug/unplug */ PORTDRV_HOOK_CB Callback; /* to be called on plug/unplug */
void *Context; /* context for callback */ void *Context; /* context for callback */
unsigned long Info; /* more info if needed */ unsigned long Info; /* more info if needed */
} PORTDRV_HOOK ; } PORTDRV_HOOK;
/* Codes for the 'Rc' element in structure below. */ /* Codes for the 'Rc' element in structure below. */
#define SLI_INSTALL (0xA1) #define SLI_INSTALL (0xA1)
#define SLI_UNINSTALL (0xA2) #define SLI_UNINSTALL (0xA2)
typedef int ( * SLIENTRYPOINT)(void* p3SignalAPI, void* pContext); typedef int (*SLIENTRYPOINT)(void *p3SignalAPI, void *pContext);
typedef struct typedef struct
{ /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */ { /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */
unsigned char Req; /* request (must be always 0) */ unsigned char Req; /* request (must be always 0) */
@@ -342,16 +342,16 @@ typedef struct
SLIENTRYPOINT Callback; /* to be called on plug/unplug */ SLIENTRYPOINT Callback; /* to be called on plug/unplug */
void *Context; /* context for callback */ void *Context; /* context for callback */
unsigned long Info; /* more info if needed */ unsigned long Info; /* more info if needed */
} SLIENTRYPOINT_REQ ; } SLIENTRYPOINT_REQ;
/******************************************************************************/ /******************************************************************************/
/* /*
* Definitions for DIVA USB * Definitions for DIVA USB
*/ */
typedef int ( * USB_SEND_REQ) (unsigned char PipeIndex, unsigned char Type,void *Data, int sizeData); typedef int (*USB_SEND_REQ)(unsigned char PipeIndex, unsigned char Type, void *Data, int sizeData);
typedef int ( * USB_START_DEV) (void *Adapter, void *Ipac) ; typedef int (*USB_START_DEV)(void *Adapter, void *Ipac);
/* called from WDM */ /* called from WDM */
typedef void ( * USB_RECV_NOTIFY) (void *Ipac, void *msg) ; typedef void (*USB_RECV_NOTIFY)(void *Ipac, void *msg);
typedef void ( * USB_XMIT_NOTIFY) (void *Ipac, unsigned char PipeIndex) ; typedef void (*USB_XMIT_NOTIFY)(void *Ipac, unsigned char PipeIndex);
/******************************************************************************/ /******************************************************************************/
/* /*
* Parameter description for synchronous requests. * Parameter description for synchronous requests.
@@ -409,7 +409,7 @@ typedef union
unsigned char Rc; unsigned char Rc;
USB_SEND_REQ UsbSendRequest; /* function in Diva Usb WDM driver in usb_os.c, */ USB_SEND_REQ UsbSendRequest; /* function in Diva Usb WDM driver in usb_os.c, */
/* called from usb_drv.c to send a message to our device */ /* called from usb_drv.c to send a message to our device */
/* eg UsbSendRequest (USB_PIPE_SIGNAL, USB_IPAC_START, 0, 0) ; */ /* eg UsbSendRequest (USB_PIPE_SIGNAL, USB_IPAC_START, 0, 0); */
USB_RECV_NOTIFY usb_recv; /* called from usb_os.c to pass a received message and ptr to IPAC */ USB_RECV_NOTIFY usb_recv; /* called from usb_os.c to pass a received message and ptr to IPAC */
/* on to usb_drv.c by a call to usb_recv(). */ /* on to usb_drv.c by a call to usb_recv(). */
USB_XMIT_NOTIFY usb_xmit; /* called from usb_os.c in DivaUSB.sys WDM to indicate a completed transmit */ USB_XMIT_NOTIFY usb_xmit; /* called from usb_os.c in DivaUSB.sys WDM to indicate a completed transmit */
@@ -417,7 +417,7 @@ typedef union
USB_START_DEV UsbStartDevice; /* Start the USB Device, in usb_os.c */ USB_START_DEV UsbStartDevice; /* Start the USB Device, in usb_os.c */
IDI_CALL callback; /* routine to call back */ IDI_CALL callback; /* routine to call back */
ENTITY *contxt; /* ptr to entity to use */ ENTITY *contxt; /* ptr to entity to use */
void ** ipac_ptr; /* pointer to struct IPAC in VxD */ void **ipac_ptr; /* pointer to struct IPAC in VxD */
} Usb_Msg_old; } Usb_Msg_old;
/* message used by WDM and VXD to pass pointers of function and IPAC* */ /* message used by WDM and VXD to pass pointers of function and IPAC* */
struct struct
@@ -425,7 +425,7 @@ typedef union
unsigned char Rc; unsigned char Rc;
USB_SEND_REQ pUsbSendRequest;/* function in Diva Usb WDM driver in usb_os.c, */ USB_SEND_REQ pUsbSendRequest;/* function in Diva Usb WDM driver in usb_os.c, */
/* called from usb_drv.c to send a message to our device */ /* called from usb_drv.c to send a message to our device */
/* eg UsbSendRequest (USB_PIPE_SIGNAL, USB_IPAC_START, 0, 0) ; */ /* eg UsbSendRequest (USB_PIPE_SIGNAL, USB_IPAC_START, 0, 0); */
USB_RECV_NOTIFY p_usb_recv; /* called from usb_os.c to pass a received message and ptr to IPAC */ USB_RECV_NOTIFY p_usb_recv; /* called from usb_os.c to pass a received message and ptr to IPAC */
/* on to usb_drv.c by a call to usb_recv(). */ /* on to usb_drv.c by a call to usb_recv(). */
USB_XMIT_NOTIFY p_usb_xmit; /* called from usb_os.c in DivaUSB.sys WDM to indicate a completed transmit */ USB_XMIT_NOTIFY p_usb_xmit; /* called from usb_os.c in DivaUSB.sys WDM to indicate a completed transmit */

View File

@@ -14,7 +14,7 @@
#include "dqueue.h" #include "dqueue.h"
int int
diva_data_q_init(diva_um_idi_data_queue_t * q, diva_data_q_init(diva_um_idi_data_queue_t *q,
int max_length, int max_segments) int max_length, int max_segments)
{ {
int i; int i;
@@ -38,7 +38,7 @@ diva_data_q_init(diva_um_idi_data_queue_t * q,
return (0); return (0);
} }
int diva_data_q_finit(diva_um_idi_data_queue_t * q) int diva_data_q_finit(diva_um_idi_data_queue_t *q)
{ {
int i; int i;
@@ -54,12 +54,12 @@ int diva_data_q_finit(diva_um_idi_data_queue_t * q)
return (0); return (0);
} }
int diva_data_q_get_max_length(const diva_um_idi_data_queue_t * q) int diva_data_q_get_max_length(const diva_um_idi_data_queue_t *q)
{ {
return (q->max_length); return (q->max_length);
} }
void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t * q) void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t *q)
{ {
if ((!q->segment_pending) && (q->count < q->segments)) { if ((!q->segment_pending) && (q->count < q->segments)) {
q->segment_pending = 1; q->segment_pending = 1;
@@ -70,7 +70,7 @@ void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t * q)
} }
void void
diva_data_q_ack_segment4write(diva_um_idi_data_queue_t * q, int length) diva_data_q_ack_segment4write(diva_um_idi_data_queue_t *q, int length)
{ {
if (q->segment_pending) { if (q->segment_pending) {
q->length[q->write] = length; q->length[q->write] = length;
@@ -92,12 +92,12 @@ const void *diva_data_q_get_segment4read(const diva_um_idi_data_queue_t *
return NULL; return NULL;
} }
int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t * q) int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t *q)
{ {
return (q->length[q->read]); return (q->length[q->read]);
} }
void diva_data_q_ack_segment4read(diva_um_idi_data_queue_t * q) void diva_data_q_ack_segment4read(diva_um_idi_data_queue_t *q)
{ {
if (q->count) { if (q->count) {
q->length[q->read] = 0; q->length[q->read] = 0;

View File

@@ -16,16 +16,16 @@ typedef struct _diva_um_idi_data_queue {
int length[DIVA_UM_IDI_MAX_MSGS]; int length[DIVA_UM_IDI_MAX_MSGS];
} diva_um_idi_data_queue_t; } diva_um_idi_data_queue_t;
int diva_data_q_init(diva_um_idi_data_queue_t * q, int diva_data_q_init(diva_um_idi_data_queue_t *q,
int max_length, int max_segments); int max_length, int max_segments);
int diva_data_q_finit(diva_um_idi_data_queue_t * q); int diva_data_q_finit(diva_um_idi_data_queue_t *q);
int diva_data_q_get_max_length(const diva_um_idi_data_queue_t * q); int diva_data_q_get_max_length(const diva_um_idi_data_queue_t *q);
void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t * q); void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t *q);
void diva_data_q_ack_segment4write(diva_um_idi_data_queue_t * q, void diva_data_q_ack_segment4write(diva_um_idi_data_queue_t *q,
int length); int length);
const void *diva_data_q_get_segment4read(const diva_um_idi_data_queue_t * const void *diva_data_q_get_segment4read(const diva_um_idi_data_queue_t *
q); q);
int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t * q); int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t *q);
void diva_data_q_ack_segment4read(diva_um_idi_data_queue_t * q); void diva_data_q_ack_segment4read(diva_um_idi_data_queue_t *q);
#endif #endif

View File

@@ -27,7 +27,7 @@
#define DSP_DEFS_H_ #define DSP_DEFS_H_
#include "dspdids.h" #include "dspdids.h"
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#define dsp_download_reserve_space(fp,length) #define dsp_download_reserve_space(fp, length)
/*****************************************************************************/ /*****************************************************************************/
/* /*
* OS file access abstraction layer * OS file access abstraction layer
@@ -35,25 +35,25 @@
* I/O functions returns -1 on error, 0 on EOF * I/O functions returns -1 on error, 0 on EOF
*/ */
struct _OsFileHandle_; struct _OsFileHandle_;
typedef long ( * OsFileIo) (struct _OsFileHandle_ *handle, typedef long (*OsFileIo)(struct _OsFileHandle_ *handle,
void *buffer, void *buffer,
long size) ; long size);
typedef long ( * OsFileSeek)(struct _OsFileHandle_ *handle, typedef long (*OsFileSeek)(struct _OsFileHandle_ *handle,
long position, long position,
int mode) ; int mode);
typedef long ( * OsCardLoad)(struct _OsFileHandle_ *handle, typedef long (*OsCardLoad)(struct _OsFileHandle_ *handle,
long length, long length,
void * *addr) ; void **addr);
typedef struct _OsFileHandle_ typedef struct _OsFileHandle_
{ void *sysFileDesc ; { void *sysFileDesc;
unsigned long sysFileSize ; unsigned long sysFileSize;
OsFileIo sysFileRead ; OsFileIo sysFileRead;
OsFileSeek sysFileSeek ; OsFileSeek sysFileSeek;
void *sysLoadDesc ; void *sysLoadDesc;
OsCardLoad sysCardLoad ; OsCardLoad sysCardLoad;
} OsFileHandle ; } OsFileHandle;
extern OsFileHandle *OsOpenFile (char *path_name) ; extern OsFileHandle *OsOpenFile(char *path_name);
extern void OsCloseFile (OsFileHandle *fp) ; extern void OsCloseFile(OsFileHandle *fp);
/*****************************************************************************/ /*****************************************************************************/
#define DSP_TELINDUS_FILE "dspdload.bin" #define DSP_TELINDUS_FILE "dspdload.bin"
/* special DSP file for BRI cards for Qsig and CornetN because of missing memory */ /* special DSP file for BRI cards for Qsig and CornetN because of missing memory */
@@ -169,13 +169,13 @@ typedef struct tag_dsp_download_desc
word symbol_count; word symbol_count;
word data_block_count_dm; word data_block_count_dm;
word data_block_count_pm; word data_block_count_pm;
byte * p_excess_header_data; byte *p_excess_header_data;
char * p_download_description; char *p_download_description;
t_dsp_memory_block_desc *p_memory_block_table; t_dsp_memory_block_desc *p_memory_block_table;
t_dsp_segment_desc *p_segment_table; t_dsp_segment_desc *p_segment_table;
t_dsp_symbol_desc *p_symbol_table; t_dsp_symbol_desc *p_symbol_table;
word * p_data_blocks_dm; word *p_data_blocks_dm;
word * p_data_blocks_pm; word *p_data_blocks_pm;
} t_dsp_desc; } t_dsp_desc;
typedef struct tag_dsp_portable_download_desc /* be sure to keep native alignment for MAESTRA's */ typedef struct tag_dsp_portable_download_desc /* be sure to keep native alignment for MAESTRA's */
{ {
@@ -204,7 +204,7 @@ typedef struct tag_dsp_portable_download_desc /* be sure to keep native alignmen
#define DSP_DOWNLOAD_MAX_SEGMENTS 16 #define DSP_DOWNLOAD_MAX_SEGMENTS 16
#define DSP_UDATA_REQUEST_RECONFIGURE 0 #define DSP_UDATA_REQUEST_RECONFIGURE 0
/* /*
parameters: parameters:
<word> reconfigure delay (in 8kHz samples) <word> reconfigure delay (in 8kHz samples)
<word> reconfigure code <word> reconfigure code
<byte> reconfigure hdlc preamble flags <byte> reconfigure hdlc preamble flags
@@ -229,11 +229,11 @@ parameters:
#define DSP_RECONFIGURE_V17_12000 11 #define DSP_RECONFIGURE_V17_12000 11
#define DSP_RECONFIGURE_V17_14400 12 #define DSP_RECONFIGURE_V17_14400 12
/* /*
data indications if transparent framer data indications if transparent framer
<byte> data 0 <byte> data 0
<byte> data 1 <byte> data 1
... ...
data indications if HDLC framer data indications if HDLC framer
<byte> data 0 <byte> data 0
<byte> data 1 <byte> data 1
... ...
@@ -243,17 +243,17 @@ data indications if HDLC framer
*/ */
#define DSP_UDATA_INDICATION_SYNC 0 #define DSP_UDATA_INDICATION_SYNC 0
/* /*
returns: returns:
<word> time of sync (sampled from counter at 8kHz) <word> time of sync (sampled from counter at 8kHz)
*/ */
#define DSP_UDATA_INDICATION_DCD_OFF 1 #define DSP_UDATA_INDICATION_DCD_OFF 1
/* /*
returns: returns:
<word> time of DCD off (sampled from counter at 8kHz) <word> time of DCD off (sampled from counter at 8kHz)
*/ */
#define DSP_UDATA_INDICATION_DCD_ON 2 #define DSP_UDATA_INDICATION_DCD_ON 2
/* /*
returns: returns:
<word> time of DCD on (sampled from counter at 8kHz) <word> time of DCD on (sampled from counter at 8kHz)
<byte> connected norm <byte> connected norm
<word> connected options <word> connected options
@@ -261,12 +261,12 @@ returns:
*/ */
#define DSP_UDATA_INDICATION_CTS_OFF 3 #define DSP_UDATA_INDICATION_CTS_OFF 3
/* /*
returns: returns:
<word> time of CTS off (sampled from counter at 8kHz) <word> time of CTS off (sampled from counter at 8kHz)
*/ */
#define DSP_UDATA_INDICATION_CTS_ON 4 #define DSP_UDATA_INDICATION_CTS_ON 4
/* /*
returns: returns:
<word> time of CTS on (sampled from counter at 8kHz) <word> time of CTS on (sampled from counter at 8kHz)
<byte> connected norm <byte> connected norm
<word> connected options <word> connected options
@@ -292,10 +292,10 @@ returns:
#define DSP_CONNECTED_NORM_V17 17 #define DSP_CONNECTED_NORM_V17 17
#define DSP_CONNECTED_OPTION_TRELLIS 0x0001 #define DSP_CONNECTED_OPTION_TRELLIS 0x0001
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
extern char *dsp_read_file (OsFileHandle *fp, extern char *dsp_read_file(OsFileHandle *fp,
word card_type_number, word card_type_number,
word *p_dsp_download_count, word *p_dsp_download_count,
t_dsp_desc *p_dsp_download_table, t_dsp_desc *p_dsp_download_table,
t_dsp_portable_desc *p_dsp_portable_download_table) ; t_dsp_portable_desc *p_dsp_portable_download_table);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#endif /* DSP_DEFS_H_ */ #endif /* DSP_DEFS_H_ */

View File

@@ -5,7 +5,7 @@
/* /*
DSP registers on maestra pri DSP registers on maestra pri
*/ */
#define DSP1_PORT (0x00) #define DSP1_PORT (0x00)
#define DSP2_PORT (0x8) #define DSP2_PORT (0x8)
#define DSP3_PORT (0x800) #define DSP3_PORT (0x800)
@@ -42,6 +42,6 @@
Dsp related definitions Dsp related definitions
------------------------------------------------------------------ */ ------------------------------------------------------------------ */
#define DSP_SIGNATURE_PROBE_WORD 0x5a5a #define DSP_SIGNATURE_PROBE_WORD 0x5a5a
#define dsp_make_address_ex(pm,address) ((word)((pm) ? (address) : (address) + 0x4000)) #define dsp_make_address_ex(pm, address) ((word)((pm) ? (address) : (address) + 0x4000))
#endif #endif

View File

@@ -35,6 +35,6 @@
#define PLX9054_SOFT_RESET 0x4000 #define PLX9054_SOFT_RESET 0x4000
#define PLX9054_RELOAD_EEPROM 0x2000 #define PLX9054_RELOAD_EEPROM 0x2000
#define DIVA_4BRI_REVISION(__x__) (((__x__)->cardType == CARDTYPE_DIVASRV_Q_8M_V2_PCI) || ((__x__)->cardType == CARDTYPE_DIVASRV_VOICE_Q_8M_V2_PCI) || ((__x__)->cardType == CARDTYPE_DIVASRV_B_2M_V2_PCI) || ((__x__)->cardType == CARDTYPE_DIVASRV_B_2F_PCI) || ((__x__)->cardType == CARDTYPE_DIVASRV_VOICE_B_2M_V2_PCI)) #define DIVA_4BRI_REVISION(__x__) (((__x__)->cardType == CARDTYPE_DIVASRV_Q_8M_V2_PCI) || ((__x__)->cardType == CARDTYPE_DIVASRV_VOICE_Q_8M_V2_PCI) || ((__x__)->cardType == CARDTYPE_DIVASRV_B_2M_V2_PCI) || ((__x__)->cardType == CARDTYPE_DIVASRV_B_2F_PCI) || ((__x__)->cardType == CARDTYPE_DIVASRV_VOICE_B_2M_V2_PCI))
void diva_os_set_qBri_functions (PISDN_ADAPTER IoAdapter); void diva_os_set_qBri_functions(PISDN_ADAPTER IoAdapter);
void diva_os_set_qBri2_functions (PISDN_ADAPTER IoAdapter); void diva_os_set_qBri2_functions(PISDN_ADAPTER IoAdapter);
#endif #endif

View File

@@ -29,9 +29,9 @@
Functions exported from os dependent part of Functions exported from os dependent part of
BRI card configuration and used in BRI card configuration and used in
OS independed part OS independed part
*/ */
/* /*
Prepare OS dependent part of BRI functions Prepare OS dependent part of BRI functions
*/ */
void diva_os_prepare_maestra_functions (PISDN_ADAPTER IoAdapter); void diva_os_prepare_maestra_functions(PISDN_ADAPTER IoAdapter);
#endif #endif

View File

@@ -29,10 +29,10 @@
Functions exported from os dependent part of Functions exported from os dependent part of
PRI card configuration and used in PRI card configuration and used in
OS independed part OS independed part
*/ */
/* /*
Prepare OS dependent part of PRI/PRI Rev.2 functions Prepare OS dependent part of PRI/PRI Rev.2 functions
*/ */
void diva_os_prepare_pri_functions (PISDN_ADAPTER IoAdapter); void diva_os_prepare_pri_functions(PISDN_ADAPTER IoAdapter);
void diva_os_prepare_pri2_functions (PISDN_ADAPTER IoAdapter); void diva_os_prepare_pri2_functions(PISDN_ADAPTER IoAdapter);
#endif #endif

View File

@@ -11,17 +11,17 @@
typedef struct _divas_um_idi_entity { typedef struct _divas_um_idi_entity {
struct list_head link; struct list_head link;
diva_um_idi_adapter_t* adapter; /* Back to adapter */ diva_um_idi_adapter_t *adapter; /* Back to adapter */
ENTITY e; ENTITY e;
void* os_ref; void *os_ref;
dword status; dword status;
void* os_context; void *os_context;
int rc_count; int rc_count;
diva_um_idi_data_queue_t data; /* definad by user 1 ... MAX */ diva_um_idi_data_queue_t data; /* definad by user 1 ... MAX */
diva_um_idi_data_queue_t rc; /* two entries */ diva_um_idi_data_queue_t rc; /* two entries */
BUFFERS XData; BUFFERS XData;
BUFFERS RData; BUFFERS RData;
byte buffer[2048+512]; byte buffer[2048 + 512];
} divas_um_idi_entity_t; } divas_um_idi_entity_t;

View File

@@ -25,27 +25,27 @@
*/ */
#ifndef __DIVA_XDI_CARD_CONFIG_HELPERS_INC__ #ifndef __DIVA_XDI_CARD_CONFIG_HELPERS_INC__
#define __DIVA_XDI_CARD_CONFIG_HELPERS_INC__ #define __DIVA_XDI_CARD_CONFIG_HELPERS_INC__
dword diva_get_protocol_file_features (byte* File, dword diva_get_protocol_file_features(byte *File,
int offset, int offset,
char *IdStringBuffer, char *IdStringBuffer,
dword IdBufferSize); dword IdBufferSize);
void diva_configure_protocol (PISDN_ADAPTER IoAdapter); void diva_configure_protocol(PISDN_ADAPTER IoAdapter);
/* /*
Low level file access system abstraction Low level file access system abstraction
*/ */
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Access to single file Access to single file
Return pointer to the image of the requested file, Return pointer to the image of the requested file,
write image length to 'FileLength' write image length to 'FileLength'
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void *xdiLoadFile (char *FileName, dword *FileLength, unsigned long MaxLoadSize) ; void *xdiLoadFile(char *FileName, dword *FileLength, unsigned long MaxLoadSize);
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Dependent on the protocol settings does read return pointer Dependent on the protocol settings does read return pointer
to the image of appropriate protocol file to the image of appropriate protocol file
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void *xdiLoadArchive (PISDN_ADAPTER IoAdapter, dword *FileLength, unsigned long MaxLoadSize) ; void *xdiLoadArchive(PISDN_ADAPTER IoAdapter, dword *FileLength, unsigned long MaxLoadSize);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Free all system resources accessed by xdiLoadFile and xdiLoadArchive Free all system resources accessed by xdiLoadFile and xdiLoadArchive
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
void xdiFreeFile (void* handle); void xdiFreeFile(void *handle);
#endif #endif

View File

@@ -58,7 +58,7 @@ static diva_os_spin_lock_t ll_lock;
/* /*
* find card in list * find card in list
*/ */
static udiva_card *find_card_in_list(DESCRIPTOR * d) static udiva_card *find_card_in_list(DESCRIPTOR *d)
{ {
udiva_card *card; udiva_card *card;
struct list_head *tmp; struct list_head *tmp;
@@ -80,7 +80,7 @@ static udiva_card *find_card_in_list(DESCRIPTOR * d)
/* /*
* new card * new card
*/ */
static void um_new_card(DESCRIPTOR * d) static void um_new_card(DESCRIPTOR *d)
{ {
int adapter_nr = 0; int adapter_nr = 0;
udiva_card *card = NULL; udiva_card *card = NULL;
@@ -95,7 +95,7 @@ static void um_new_card(DESCRIPTOR * d)
sync_req.xdi_logical_adapter_number.Req = 0; sync_req.xdi_logical_adapter_number.Req = 0;
sync_req.xdi_logical_adapter_number.Rc = sync_req.xdi_logical_adapter_number.Rc =
IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER; IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER;
card->d.request((ENTITY *) & sync_req); card->d.request((ENTITY *)&sync_req);
adapter_nr = adapter_nr =
sync_req.xdi_logical_adapter_number.info.logical_adapter_number; sync_req.xdi_logical_adapter_number.info.logical_adapter_number;
card->Id = adapter_nr; card->Id = adapter_nr;
@@ -113,7 +113,7 @@ static void um_new_card(DESCRIPTOR * d)
/* /*
* remove card * remove card
*/ */
static void um_remove_card(DESCRIPTOR * d) static void um_remove_card(DESCRIPTOR *d)
{ {
diva_os_spin_lock_magic_t old_irql; diva_os_spin_lock_magic_t old_irql;
udiva_card *card = NULL; udiva_card *card = NULL;
@@ -154,7 +154,7 @@ rescan:
/* /*
* DIDD notify callback * DIDD notify callback
*/ */
static void *didd_callback(void *context, DESCRIPTOR * adapter, static void *didd_callback(void *context, DESCRIPTOR *adapter,
int removal) int removal)
{ {
if (adapter->type == IDI_DADAPTER) { if (adapter->type == IDI_DADAPTER) {
@@ -199,7 +199,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
req.didd_notify.info.callback = (void *)didd_callback; req.didd_notify.info.callback = (void *)didd_callback;
req.didd_notify.info.context = NULL; req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
if (req.didd_notify.e.Rc != 0xff) { if (req.didd_notify.e.Rc != 0xff) {
stop_dbg(); stop_dbg();
return (0); return (0);
@@ -234,7 +234,7 @@ static void DIVA_EXIT_FUNCTION disconnect_didd(void)
req.didd_notify.e.Req = 0; req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY; req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY;
req.didd_notify.info.handle = notify_handle; req.didd_notify.info.handle = notify_handle;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
} }
/* /*

View File

@@ -33,16 +33,16 @@
#include "di.h" #include "di.h"
#include "mi_pc.h" #include "mi_pc.h"
#include "io.h" #include "io.h"
extern ADAPTER * adapter[MAX_ADAPTER]; extern ADAPTER *adapter[MAX_ADAPTER];
extern PISDN_ADAPTER IoAdapters[MAX_ADAPTER]; extern PISDN_ADAPTER IoAdapters[MAX_ADAPTER];
void request (PISDN_ADAPTER, ENTITY *); void request(PISDN_ADAPTER, ENTITY *);
static void pcm_req (PISDN_ADAPTER, ENTITY *); static void pcm_req(PISDN_ADAPTER, ENTITY *);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
local functions local functions
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#define ReqFunc(N) \ #define ReqFunc(N) \
static void Request##N(ENTITY *e) \ static void Request##N(ENTITY *e) \
{ if ( IoAdapters[N] ) (* IoAdapters[N]->DIRequest)(IoAdapters[N], e) ; } { if (IoAdapters[N]) (*IoAdapters[N]->DIRequest)(IoAdapters[N], e); }
ReqFunc(0) ReqFunc(0)
ReqFunc(1) ReqFunc(1)
ReqFunc(2) ReqFunc(2)
@@ -69,8 +69,8 @@ IDI_CALL Requests[MAX_ADAPTER] =
/* /*
This array should indicate all new services, that this version of XDI This array should indicate all new services, that this version of XDI
is able to provide to his clients is able to provide to his clients
*/ */
static byte extended_xdi_features[DIVA_XDI_EXTENDED_FEATURES_MAX_SZ+1] = { static byte extended_xdi_features[DIVA_XDI_EXTENDED_FEATURES_MAX_SZ + 1] = {
(DIVA_XDI_EXTENDED_FEATURES_VALID | (DIVA_XDI_EXTENDED_FEATURES_VALID |
DIVA_XDI_EXTENDED_FEATURE_SDRAM_BAR | DIVA_XDI_EXTENDED_FEATURE_SDRAM_BAR |
DIVA_XDI_EXTENDED_FEATURE_CAPI_PRMS | DIVA_XDI_EXTENDED_FEATURE_CAPI_PRMS |
@@ -84,39 +84,39 @@ static byte extended_xdi_features[DIVA_XDI_EXTENDED_FEATURES_MAX_SZ+1] = {
}; };
/*****************************************************************************/ /*****************************************************************************/
void void
dump_xlog_buffer (PISDN_ADAPTER IoAdapter, Xdesc *xlogDesc) dump_xlog_buffer(PISDN_ADAPTER IoAdapter, Xdesc *xlogDesc)
{ {
dword logLen ; dword logLen;
word *Xlog = xlogDesc->buf ; word *Xlog = xlogDesc->buf;
word logCnt = xlogDesc->cnt ; word logCnt = xlogDesc->cnt;
word logOut = xlogDesc->out / sizeof(*Xlog) ; word logOut = xlogDesc->out / sizeof(*Xlog);
DBG_FTL(("%s: ************* XLOG recovery (%d) *************", DBG_FTL(("%s: ************* XLOG recovery (%d) *************",
&IoAdapter->Name[0], (int)logCnt)) &IoAdapter->Name[0], (int)logCnt))
DBG_FTL(("Microcode: %s", &IoAdapter->ProtocolIdString[0])) DBG_FTL(("Microcode: %s", &IoAdapter->ProtocolIdString[0]))
for ( ; logCnt > 0 ; --logCnt ) for (; logCnt > 0; --logCnt)
{ {
if ( !GET_WORD(&Xlog[logOut]) ) if (!GET_WORD(&Xlog[logOut]))
{ {
if ( --logCnt == 0 ) if (--logCnt == 0)
break ; break;
logOut = 0 ; logOut = 0;
} }
if ( GET_WORD(&Xlog[logOut]) <= (logOut * sizeof(*Xlog)) ) if (GET_WORD(&Xlog[logOut]) <= (logOut * sizeof(*Xlog)))
{ {
if ( logCnt > 2 ) if (logCnt > 2)
{ {
DBG_FTL(("Possibly corrupted XLOG: %d entries left", DBG_FTL(("Possibly corrupted XLOG: %d entries left",
(int)logCnt)) (int)logCnt))
} }
break ; break;
} }
logLen = (dword)(GET_WORD(&Xlog[logOut]) - (logOut * sizeof(*Xlog))) ; logLen = (dword)(GET_WORD(&Xlog[logOut]) - (logOut * sizeof(*Xlog)));
DBG_FTL_MXLOG(( (char *)&Xlog[logOut + 1], (dword)(logLen - 2) )) DBG_FTL_MXLOG(((char *)&Xlog[logOut + 1], (dword)(logLen - 2)))
logOut = (GET_WORD(&Xlog[logOut]) + 1) / sizeof(*Xlog) ; logOut = (GET_WORD(&Xlog[logOut]) + 1) / sizeof(*Xlog);
} }
DBG_FTL(("%s: ***************** end of XLOG *****************", DBG_FTL(("%s: ***************** end of XLOG *****************",
&IoAdapter->Name[0])) &IoAdapter->Name[0]))
} }
/*****************************************************************************/ /*****************************************************************************/
#if defined(XDI_USE_XLOG) #if defined(XDI_USE_XLOG)
static char *(ExceptionCauseTable[]) = static char *(ExceptionCauseTable[]) =
@@ -153,14 +153,14 @@ static char *(ExceptionCauseTable[]) =
"Reserved 29", "Reserved 29",
"Reserved 30", "Reserved 30",
"VCED" "VCED"
} ; };
#endif #endif
void void
dump_trap_frame (PISDN_ADAPTER IoAdapter, byte __iomem *exceptionFrame) dump_trap_frame(PISDN_ADAPTER IoAdapter, byte __iomem *exceptionFrame)
{ {
MP_XCPTC __iomem *xcept = (MP_XCPTC __iomem *)exceptionFrame ; MP_XCPTC __iomem *xcept = (MP_XCPTC __iomem *)exceptionFrame;
dword __iomem *regs; dword __iomem *regs;
regs = &xcept->regs[0] ; regs = &xcept->regs[0];
DBG_FTL(("%s: ***************** CPU TRAPPED *****************", DBG_FTL(("%s: ***************** CPU TRAPPED *****************",
&IoAdapter->Name[0])) &IoAdapter->Name[0]))
DBG_FTL(("Microcode: %s", &IoAdapter->ProtocolIdString[0])) DBG_FTL(("Microcode: %s", &IoAdapter->ProtocolIdString[0]))
@@ -170,13 +170,13 @@ dump_trap_frame (PISDN_ADAPTER IoAdapter, byte __iomem *exceptionFrame)
READ_DWORD(&xcept->sr), READ_DWORD(&xcept->cr), READ_DWORD(&xcept->sr), READ_DWORD(&xcept->cr),
READ_DWORD(&xcept->epc), READ_DWORD(&xcept->vaddr))) READ_DWORD(&xcept->epc), READ_DWORD(&xcept->vaddr)))
DBG_FTL(("zero 0x%08x at 0x%08x v0 0x%08x v1 0x%08x", DBG_FTL(("zero 0x%08x at 0x%08x v0 0x%08x v1 0x%08x",
READ_DWORD(&regs[ 0]), READ_DWORD(&regs[ 1]), READ_DWORD(&regs[0]), READ_DWORD(&regs[1]),
READ_DWORD(&regs[ 2]), READ_DWORD(&regs[ 3]))) READ_DWORD(&regs[2]), READ_DWORD(&regs[3])))
DBG_FTL(("a0 0x%08x a1 0x%08x a2 0x%08x a3 0x%08x", DBG_FTL(("a0 0x%08x a1 0x%08x a2 0x%08x a3 0x%08x",
READ_DWORD(&regs[ 4]), READ_DWORD(&regs[ 5]), READ_DWORD(&regs[4]), READ_DWORD(&regs[5]),
READ_DWORD(&regs[ 6]), READ_DWORD(&regs[ 7]))) READ_DWORD(&regs[6]), READ_DWORD(&regs[7])))
DBG_FTL(("t0 0x%08x t1 0x%08x t2 0x%08x t3 0x%08x", DBG_FTL(("t0 0x%08x t1 0x%08x t2 0x%08x t3 0x%08x",
READ_DWORD(&regs[ 8]), READ_DWORD(&regs[ 9]), READ_DWORD(&regs[8]), READ_DWORD(&regs[9]),
READ_DWORD(&regs[10]), READ_DWORD(&regs[11]))) READ_DWORD(&regs[10]), READ_DWORD(&regs[11])))
DBG_FTL(("t4 0x%08x t5 0x%08x t6 0x%08x t7 0x%08x", DBG_FTL(("t4 0x%08x t5 0x%08x t6 0x%08x t7 0x%08x",
READ_DWORD(&regs[12]), READ_DWORD(&regs[13]), READ_DWORD(&regs[12]), READ_DWORD(&regs[13]),
@@ -196,11 +196,11 @@ dump_trap_frame (PISDN_ADAPTER IoAdapter, byte __iomem *exceptionFrame)
DBG_FTL(("md 0x%08x|%08x resvd 0x%08x class 0x%08x", DBG_FTL(("md 0x%08x|%08x resvd 0x%08x class 0x%08x",
READ_DWORD(&xcept->mdhi), READ_DWORD(&xcept->mdlo), READ_DWORD(&xcept->mdhi), READ_DWORD(&xcept->mdlo),
READ_DWORD(&xcept->reseverd), READ_DWORD(&xcept->xclass))) READ_DWORD(&xcept->reseverd), READ_DWORD(&xcept->xclass)))
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Real XDI Request function Real XDI Request function
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
void request(PISDN_ADAPTER IoAdapter, ENTITY * e) void request(PISDN_ADAPTER IoAdapter, ENTITY *e)
{ {
byte i; byte i;
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
@@ -208,29 +208,29 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
* if the Req field in the entity structure is 0, * if the Req field in the entity structure is 0,
* we treat this request as a special function call * we treat this request as a special function call
*/ */
if ( !e->Req ) if (!e->Req)
{ {
IDI_SYNC_REQ *syncReq = (IDI_SYNC_REQ *)e ; IDI_SYNC_REQ *syncReq = (IDI_SYNC_REQ *)e;
switch (e->Rc) switch (e->Rc)
{ {
#if defined(DIVA_IDI_RX_DMA) #if defined(DIVA_IDI_RX_DMA)
case IDI_SYNC_REQ_DMA_DESCRIPTOR_OPERATION: { case IDI_SYNC_REQ_DMA_DESCRIPTOR_OPERATION: {
diva_xdi_dma_descriptor_operation_t* pI = \ diva_xdi_dma_descriptor_operation_t *pI = \
&syncReq->xdi_dma_descriptor_operation.info; &syncReq->xdi_dma_descriptor_operation.info;
if (!IoAdapter->dma_map) { if (!IoAdapter->dma_map) {
pI->operation = -1; pI->operation = -1;
pI->descriptor_number = -1; pI->descriptor_number = -1;
return; return;
} }
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, &irql, "dma_op"); diva_os_enter_spin_lock(&IoAdapter->data_spin_lock, &irql, "dma_op");
if (pI->operation == IDI_SYNC_REQ_DMA_DESCRIPTOR_ALLOC) { if (pI->operation == IDI_SYNC_REQ_DMA_DESCRIPTOR_ALLOC) {
pI->descriptor_number = diva_alloc_dma_map_entry (\ pI->descriptor_number = diva_alloc_dma_map_entry(\
(struct _diva_dma_map_entry*)IoAdapter->dma_map); (struct _diva_dma_map_entry *)IoAdapter->dma_map);
if (pI->descriptor_number >= 0) { if (pI->descriptor_number >= 0) {
dword dma_magic; dword dma_magic;
void* local_addr; void *local_addr;
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,
&local_addr, &dma_magic); &local_addr, &dma_magic);
pI->descriptor_address = local_addr; pI->descriptor_address = local_addr;
@@ -241,7 +241,7 @@ 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)) {
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;
pI->operation = 0; pI->operation = 0;
@@ -249,7 +249,7 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
pI->descriptor_number = -1; pI->descriptor_number = -1;
pI->operation = -1; pI->operation = -1;
} }
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock, &irql, "dma_op"); diva_os_leave_spin_lock(&IoAdapter->data_spin_lock, &irql, "dma_op");
} return; } return;
#endif #endif
case IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER: { case IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER: {
@@ -261,25 +261,25 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
} 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;
memset (&prms, 0x00, sizeof(prms)); memset(&prms, 0x00, sizeof(prms));
prms.structure_length = min_t(size_t, sizeof(prms), pI->structure_length); prms.structure_length = min_t(size_t, sizeof(prms), pI->structure_length);
memset (pI, 0x00, pI->structure_length); memset(pI, 0x00, pI->structure_length);
prms.flag_dynamic_l1_down = (IoAdapter->capi_cfg.cfg_1 & \ prms.flag_dynamic_l1_down = (IoAdapter->capi_cfg.cfg_1 & \
DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON) ? 1 : 0; DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON) ? 1 : 0;
prms.group_optimization_enabled = (IoAdapter->capi_cfg.cfg_1 & \ prms.group_optimization_enabled = (IoAdapter->capi_cfg.cfg_1 & \
DIVA_XDI_CAPI_CFG_1_GROUP_POPTIMIZATION_ON) ? 1 : 0; DIVA_XDI_CAPI_CFG_1_GROUP_POPTIMIZATION_ON) ? 1 : 0;
memcpy (pI, &prms, prms.structure_length); memcpy(pI, &prms, prms.structure_length);
} return; } return;
case IDI_SYNC_REQ_XDI_GET_ADAPTER_SDRAM_BAR: case IDI_SYNC_REQ_XDI_GET_ADAPTER_SDRAM_BAR:
syncReq->xdi_sdram_bar.info.bar = IoAdapter->sdram_bar; syncReq->xdi_sdram_bar.info.bar = IoAdapter->sdram_bar;
return; return;
case IDI_SYNC_REQ_XDI_GET_EXTENDED_FEATURES: { case IDI_SYNC_REQ_XDI_GET_EXTENDED_FEATURES: {
dword i; dword i;
diva_xdi_get_extended_xdi_features_t* pI =\ diva_xdi_get_extended_xdi_features_t *pI =\
&syncReq->xdi_extended_features.info; &syncReq->xdi_extended_features.info;
pI->buffer_length_in_bytes &= ~0x80000000; pI->buffer_length_in_bytes &= ~0x80000000;
if (pI->buffer_length_in_bytes && pI->features) { if (pI->buffer_length_in_bytes && pI->features) {
memset (pI->features, 0x00, pI->buffer_length_in_bytes); memset(pI->features, 0x00, pI->buffer_length_in_bytes);
} }
for (i = 0; ((pI->features) && (i < pI->buffer_length_in_bytes) && for (i = 0; ((pI->features) && (i < pI->buffer_length_in_bytes) &&
(i < DIVA_XDI_EXTENDED_FEATURES_MAX_SZ)); i++) { (i < DIVA_XDI_EXTENDED_FEATURES_MAX_SZ)); i++) {
@@ -293,122 +293,122 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
} return; } return;
case IDI_SYNC_REQ_XDI_GET_STREAM: case IDI_SYNC_REQ_XDI_GET_STREAM:
if (IoAdapter) { if (IoAdapter) {
diva_xdi_provide_istream_info (&IoAdapter->a, diva_xdi_provide_istream_info(&IoAdapter->a,
&syncReq->xdi_stream_info.info); &syncReq->xdi_stream_info.info);
} else { } else {
syncReq->xdi_stream_info.info.provided_service = 0; syncReq->xdi_stream_info.info.provided_service = 0;
} }
return; return;
case IDI_SYNC_REQ_GET_NAME: case IDI_SYNC_REQ_GET_NAME:
if ( IoAdapter ) if (IoAdapter)
{ {
strcpy (&syncReq->GetName.name[0], IoAdapter->Name) ; strcpy(&syncReq->GetName.name[0], IoAdapter->Name);
DBG_TRC(("xdi: Adapter %d / Name '%s'", DBG_TRC(("xdi: Adapter %d / Name '%s'",
IoAdapter->ANum, IoAdapter->Name)) IoAdapter->ANum, IoAdapter->Name))
return ; return;
} }
syncReq->GetName.name[0] = '\0' ; syncReq->GetName.name[0] = '\0';
break ; break;
case IDI_SYNC_REQ_GET_SERIAL: case IDI_SYNC_REQ_GET_SERIAL:
if ( IoAdapter ) if (IoAdapter)
{ {
syncReq->GetSerial.serial = IoAdapter->serialNo ; syncReq->GetSerial.serial = IoAdapter->serialNo;
DBG_TRC(("xdi: Adapter %d / SerialNo %ld", DBG_TRC(("xdi: Adapter %d / SerialNo %ld",
IoAdapter->ANum, IoAdapter->serialNo)) IoAdapter->ANum, IoAdapter->serialNo))
return ; return;
} }
syncReq->GetSerial.serial = 0 ; syncReq->GetSerial.serial = 0;
break ; break;
case IDI_SYNC_REQ_GET_CARDTYPE: case IDI_SYNC_REQ_GET_CARDTYPE:
if ( IoAdapter ) if (IoAdapter)
{ {
syncReq->GetCardType.cardtype = IoAdapter->cardType ; syncReq->GetCardType.cardtype = IoAdapter->cardType;
DBG_TRC(("xdi: Adapter %d / CardType %ld", DBG_TRC(("xdi: Adapter %d / CardType %ld",
IoAdapter->ANum, IoAdapter->cardType)) IoAdapter->ANum, IoAdapter->cardType))
return ; return;
} }
syncReq->GetCardType.cardtype = 0 ; syncReq->GetCardType.cardtype = 0;
break ; break;
case IDI_SYNC_REQ_GET_XLOG: case IDI_SYNC_REQ_GET_XLOG:
if ( IoAdapter ) if (IoAdapter)
{ {
pcm_req (IoAdapter, e) ; pcm_req(IoAdapter, e);
return ; return;
} }
e->Ind = 0 ; e->Ind = 0;
break ; break;
case IDI_SYNC_REQ_GET_DBG_XLOG: case IDI_SYNC_REQ_GET_DBG_XLOG:
if ( IoAdapter ) if (IoAdapter)
{ {
pcm_req (IoAdapter, e) ; pcm_req(IoAdapter, e);
return ; return;
} }
e->Ind = 0 ; e->Ind = 0;
break ; break;
case IDI_SYNC_REQ_GET_FEATURES: case IDI_SYNC_REQ_GET_FEATURES:
if ( IoAdapter ) if (IoAdapter)
{ {
syncReq->GetFeatures.features = syncReq->GetFeatures.features =
(unsigned short)IoAdapter->features ; (unsigned short)IoAdapter->features;
return ; return;
} }
syncReq->GetFeatures.features = 0 ; syncReq->GetFeatures.features = 0;
break ; break;
case IDI_SYNC_REQ_PORTDRV_HOOK: case IDI_SYNC_REQ_PORTDRV_HOOK:
if ( IoAdapter ) if (IoAdapter)
{ {
DBG_TRC(("Xdi:IDI_SYNC_REQ_PORTDRV_HOOK - ignored")) DBG_TRC(("Xdi:IDI_SYNC_REQ_PORTDRV_HOOK - ignored"))
return ; return;
} }
break; break;
} }
if ( IoAdapter ) if (IoAdapter)
{ {
return ; return;
} }
} }
DBG_TRC(("xdi: Id 0x%x / Req 0x%x / Rc 0x%x", e->Id, e->Req, e->Rc)) DBG_TRC(("xdi: Id 0x%x / Req 0x%x / Rc 0x%x", e->Id, e->Req, e->Rc))
if ( !IoAdapter ) if (!IoAdapter)
{ {
DBG_FTL(("xdi: uninitialized Adapter used - ignore request")) DBG_FTL(("xdi: uninitialized Adapter used - ignore request"))
return ; return;
} }
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_req"); diva_os_enter_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_req");
/* /*
* assign an entity * assign an entity
*/ */
if ( !(e->Id &0x1f) ) if (!(e->Id & 0x1f))
{ {
if ( IoAdapter->e_count >= IoAdapter->e_max ) if (IoAdapter->e_count >= IoAdapter->e_max)
{ {
DBG_FTL(("xdi: all Ids in use (max=%d) --> Req ignored", DBG_FTL(("xdi: all Ids in use (max=%d) --> Req ignored",
IoAdapter->e_max)) IoAdapter->e_max))
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_req"); diva_os_leave_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_req");
return ; return;
} }
/* /*
* find a new free id * find a new free id
*/ */
for ( i = 1 ; IoAdapter->e_tbl[i].e ; ++i ) ; for (i = 1; IoAdapter->e_tbl[i].e; ++i);
IoAdapter->e_tbl[i].e = e ; IoAdapter->e_tbl[i].e = e;
IoAdapter->e_count++ ; IoAdapter->e_count++;
e->No = (byte)i ; e->No = (byte)i;
e->More = 0 ; e->More = 0;
e->RCurrent = 0xff ; e->RCurrent = 0xff;
} }
else else
{ {
i = e->No ; i = e->No;
} }
/* /*
* if the entity is still busy, ignore the request call * if the entity is still busy, ignore the request call
*/ */
if ( e->More & XBUSY ) if (e->More & XBUSY)
{ {
DBG_FTL(("xdi: Id 0x%x busy --> Req 0x%x ignored", e->Id, e->Req)) DBG_FTL(("xdi: Id 0x%x busy --> Req 0x%x ignored", e->Id, e->Req))
if ( !IoAdapter->trapped && IoAdapter->trapFnc ) if (!IoAdapter->trapped && IoAdapter->trapFnc)
{ {
IoAdapter->trapFnc (IoAdapter) ; IoAdapter->trapFnc(IoAdapter);
/* /*
Firs trap, also notify user if supported Firs trap, also notify user if supported
*/ */
@@ -416,79 +416,79 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
(*(IoAdapter->os_trap_nfy_Fnc))(IoAdapter, IoAdapter->ANum); (*(IoAdapter->os_trap_nfy_Fnc))(IoAdapter, IoAdapter->ANum);
} }
} }
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_req"); diva_os_leave_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_req");
return ; return;
} }
/* /*
* initialize transmit status variables * initialize transmit status variables
*/ */
e->More |= XBUSY ; e->More |= XBUSY;
e->More &= ~XMOREF ; e->More &= ~XMOREF;
e->XCurrent = 0 ; e->XCurrent = 0;
e->XOffset = 0 ; e->XOffset = 0;
/* /*
* queue this entity in the adapter request queue * queue this entity in the adapter request queue
*/ */
IoAdapter->e_tbl[i].next = 0 ; IoAdapter->e_tbl[i].next = 0;
if ( IoAdapter->head ) if (IoAdapter->head)
{ {
IoAdapter->e_tbl[IoAdapter->tail].next = i ; IoAdapter->e_tbl[IoAdapter->tail].next = i;
IoAdapter->tail = i ; IoAdapter->tail = i;
} }
else else
{ {
IoAdapter->head = i ; IoAdapter->head = i;
IoAdapter->tail = i ; IoAdapter->tail = i;
} }
/* /*
* queue the DPC to process the request * queue the DPC to process the request
*/ */
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, &irql, "data_req"); diva_os_leave_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_req");
} }
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
Main DPC routine Main DPC routine
--------------------------------------------------------------------- */ --------------------------------------------------------------------- */
void DIDpcRoutine (struct _diva_os_soft_isr* psoft_isr, void* Context) { void DIDpcRoutine(struct _diva_os_soft_isr *psoft_isr, void *Context) {
PISDN_ADAPTER IoAdapter = (PISDN_ADAPTER)Context ; PISDN_ADAPTER IoAdapter = (PISDN_ADAPTER)Context;
ADAPTER* a = &IoAdapter->a ; ADAPTER *a = &IoAdapter->a;
diva_os_atomic_t* pin_dpc = &IoAdapter->in_dpc; diva_os_atomic_t *pin_dpc = &IoAdapter->in_dpc;
if (diva_os_atomic_increment (pin_dpc) == 1) { if (diva_os_atomic_increment(pin_dpc) == 1) {
do { do {
if ( IoAdapter->tst_irq (a) ) if (IoAdapter->tst_irq(a))
{ {
if ( !IoAdapter->Unavailable ) if (!IoAdapter->Unavailable)
IoAdapter->dpc (a) ; IoAdapter->dpc(a);
IoAdapter->clr_irq (a) ; IoAdapter->clr_irq(a);
} }
IoAdapter->out (a) ; IoAdapter->out(a);
} while (diva_os_atomic_decrement (pin_dpc) > 0); } while (diva_os_atomic_decrement(pin_dpc) > 0);
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
Look for XLOG request (cards with indirect addressing) Look for XLOG request (cards with indirect addressing)
---------------------------------------------------------------- */ ---------------------------------------------------------------- */
if (IoAdapter->pcm_pending) { if (IoAdapter->pcm_pending) {
struct pc_maint *pcm; struct pc_maint *pcm;
diva_os_spin_lock_magic_t OldIrql ; diva_os_spin_lock_magic_t OldIrql;
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, diva_os_enter_spin_lock(&IoAdapter->data_spin_lock,
&OldIrql, &OldIrql,
"data_dpc"); "data_dpc");
pcm = (struct pc_maint *)IoAdapter->pcm_data; pcm = (struct pc_maint *)IoAdapter->pcm_data;
switch (IoAdapter->pcm_pending) { switch (IoAdapter->pcm_pending) {
case 1: /* ask card for XLOG */ case 1: /* ask card for XLOG */
a->ram_out (a, &IoAdapter->pcm->rc, 0) ; a->ram_out(a, &IoAdapter->pcm->rc, 0);
a->ram_out (a, &IoAdapter->pcm->req, pcm->req) ; a->ram_out(a, &IoAdapter->pcm->req, pcm->req);
IoAdapter->pcm_pending = 2; IoAdapter->pcm_pending = 2;
break; break;
case 2: /* Try to get XLOG from the card */ case 2: /* Try to get XLOG from the card */
if ((int)(a->ram_in (a, &IoAdapter->pcm->rc))) { if ((int)(a->ram_in(a, &IoAdapter->pcm->rc))) {
a->ram_in_buffer (a, IoAdapter->pcm, pcm, sizeof(*pcm)) ; a->ram_in_buffer(a, IoAdapter->pcm, pcm, sizeof(*pcm));
IoAdapter->pcm_pending = 3; IoAdapter->pcm_pending = 3;
} }
break; break;
case 3: /* let XDI recovery XLOG */ case 3: /* let XDI recovery XLOG */
break; break;
} }
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock, diva_os_leave_spin_lock(&IoAdapter->data_spin_lock,
&OldIrql, &OldIrql,
"data_dpc"); "data_dpc");
} }
@@ -499,80 +499,80 @@ void DIDpcRoutine (struct _diva_os_soft_isr* psoft_isr, void* Context) {
XLOG interface XLOG interface
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void static void
pcm_req (PISDN_ADAPTER IoAdapter, ENTITY *e) pcm_req(PISDN_ADAPTER IoAdapter, ENTITY *e)
{ {
diva_os_spin_lock_magic_t OldIrql ; diva_os_spin_lock_magic_t OldIrql;
int i, rc ; int i, rc;
ADAPTER *a = &IoAdapter->a ; ADAPTER *a = &IoAdapter->a;
struct pc_maint *pcm = (struct pc_maint *)&e->Ind ; struct pc_maint *pcm = (struct pc_maint *)&e->Ind;
/* /*
* special handling of I/O based card interface * special handling of I/O based card interface
* the memory access isn't an atomic operation ! * the memory access isn't an atomic operation !
*/ */
if ( IoAdapter->Properties.Card == CARD_MAE ) if (IoAdapter->Properties.Card == CARD_MAE)
{ {
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 = (void *)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,
&OldIrql, &OldIrql,
"data_pcm_1"); "data_pcm_1");
for ( rc = 0, i = (IoAdapter->trapped ? 3000 : 250) ; !rc && (i > 0) ; --i ) for (rc = 0, i = (IoAdapter->trapped ? 3000 : 250); !rc && (i > 0); --i)
{ {
diva_os_sleep (1) ; diva_os_sleep(1);
if (IoAdapter->pcm_pending == 3) { if (IoAdapter->pcm_pending == 3) {
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, diva_os_enter_spin_lock(&IoAdapter->data_spin_lock,
&OldIrql, &OldIrql,
"data_pcm_3"); "data_pcm_3");
IoAdapter->pcm_pending = 0; IoAdapter->pcm_pending = 0;
IoAdapter->pcm_data = NULL ; 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");
return ; return;
} }
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, diva_os_enter_spin_lock(&IoAdapter->data_spin_lock,
&OldIrql, &OldIrql,
"data_pcm_2"); "data_pcm_2");
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,
&OldIrql, &OldIrql,
"data_pcm_2"); "data_pcm_2");
} }
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, diva_os_enter_spin_lock(&IoAdapter->data_spin_lock,
&OldIrql, &OldIrql,
"data_pcm_4"); "data_pcm_4");
IoAdapter->pcm_pending = 0; IoAdapter->pcm_pending = 0;
IoAdapter->pcm_data = NULL ; 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");
goto Trapped ; goto Trapped;
} }
/* /*
* memory based shared ram is accessible from different * memory based shared ram is accessible from different
* processors without disturbing concurrent processes. * processors without disturbing concurrent processes.
*/ */
a->ram_out (a, &IoAdapter->pcm->rc, 0) ; a->ram_out(a, &IoAdapter->pcm->rc, 0);
a->ram_out (a, &IoAdapter->pcm->req, pcm->req) ; a->ram_out(a, &IoAdapter->pcm->req, pcm->req);
for ( i = (IoAdapter->trapped ? 3000 : 250) ; --i > 0 ; ) for (i = (IoAdapter->trapped ? 3000 : 250); --i > 0;)
{ {
diva_os_sleep (1) ; diva_os_sleep(1);
rc = (int)(a->ram_in (a, &IoAdapter->pcm->rc)) ; rc = (int)(a->ram_in(a, &IoAdapter->pcm->rc));
if ( rc ) if (rc)
{ {
a->ram_in_buffer (a, IoAdapter->pcm, pcm, sizeof(*pcm)) ; a->ram_in_buffer(a, IoAdapter->pcm, pcm, sizeof(*pcm));
return ; return;
} }
} }
Trapped: Trapped:
if ( IoAdapter->trapFnc ) if (IoAdapter->trapFnc)
{ {
int trapped = IoAdapter->trapped; int trapped = IoAdapter->trapped;
IoAdapter->trapFnc (IoAdapter) ; IoAdapter->trapFnc(IoAdapter);
/* /*
Firs trap, also notify user if supported Firs trap, also notify user if supported
*/ */
@@ -584,7 +584,7 @@ Trapped:
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* ram access functions for memory mapped cards */ /* ram access functions for memory mapped cards */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
byte mem_in (ADAPTER *a, void *addr) byte mem_in(ADAPTER *a, void *addr)
{ {
byte val; byte val;
volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io); volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io);
@@ -592,7 +592,7 @@ byte mem_in (ADAPTER *a, void *addr)
DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base); DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base);
return (val); return (val);
} }
word mem_inw (ADAPTER *a, void *addr) word mem_inw(ADAPTER *a, void *addr)
{ {
word val; word val;
volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io); volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io);
@@ -600,58 +600,58 @@ word mem_inw (ADAPTER *a, void *addr)
DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base); DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base);
return (val); return (val);
} }
void mem_in_dw (ADAPTER *a, void *addr, dword* data, int dwords) void mem_in_dw(ADAPTER *a, void *addr, dword *data, int dwords)
{ {
volatile byte __iomem * Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io); volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io);
while (dwords--) { while (dwords--) {
*data++ = READ_DWORD((Base + (unsigned long)addr)); *data++ = READ_DWORD((Base + (unsigned long)addr));
addr+=4; addr += 4;
} }
DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base); DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base);
} }
void mem_in_buffer (ADAPTER *a, void *addr, void *buffer, word length) void mem_in_buffer(ADAPTER *a, void *addr, void *buffer, word length)
{ {
volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io); volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io);
memcpy_fromio(buffer, (Base + (unsigned long)addr), length); memcpy_fromio(buffer, (Base + (unsigned long)addr), length);
DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base); DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base);
} }
void mem_look_ahead (ADAPTER *a, PBUFFER *RBuffer, ENTITY *e) void mem_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e)
{ {
PISDN_ADAPTER IoAdapter = (PISDN_ADAPTER)a->io ; PISDN_ADAPTER IoAdapter = (PISDN_ADAPTER)a->io;
IoAdapter->RBuffer.length = mem_inw (a, &RBuffer->length) ; IoAdapter->RBuffer.length = mem_inw(a, &RBuffer->length);
mem_in_buffer (a, RBuffer->P, IoAdapter->RBuffer.P, mem_in_buffer(a, RBuffer->P, IoAdapter->RBuffer.P,
IoAdapter->RBuffer.length) ; IoAdapter->RBuffer.length);
e->RBuffer = (DBUFFER *)&IoAdapter->RBuffer ; e->RBuffer = (DBUFFER *)&IoAdapter->RBuffer;
} }
void mem_out (ADAPTER *a, void *addr, byte data) void mem_out(ADAPTER *a, void *addr, byte data)
{ {
volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io); volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io);
WRITE_BYTE(Base + (unsigned long)addr, data); WRITE_BYTE(Base + (unsigned long)addr, data);
DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base); DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base);
} }
void mem_outw (ADAPTER *a, void *addr, word data) void mem_outw(ADAPTER *a, void *addr, word data)
{ {
volatile byte __iomem * Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io); volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io);
WRITE_WORD((Base + (unsigned long)addr), data); WRITE_WORD((Base + (unsigned long)addr), data);
DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base); DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base);
} }
void mem_out_dw (ADAPTER *a, void *addr, const dword* data, int dwords) void mem_out_dw(ADAPTER *a, void *addr, const dword *data, int dwords)
{ {
volatile byte __iomem * Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io); volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io);
while (dwords--) { while (dwords--) {
WRITE_DWORD((Base + (unsigned long)addr), *data); WRITE_DWORD((Base + (unsigned long)addr), *data);
addr+=4; addr += 4;
data++; data++;
} }
DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base); DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base);
} }
void mem_out_buffer (ADAPTER *a, void *addr, void *buffer, word length) void mem_out_buffer(ADAPTER *a, void *addr, void *buffer, word length)
{ {
volatile byte __iomem * Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io); volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io);
memcpy_toio((Base + (unsigned long)addr), buffer, length) ; memcpy_toio((Base + (unsigned long)addr), buffer, length);
DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base); DIVA_OS_MEM_DETACH_RAM((PISDN_ADAPTER)a->io, Base);
} }
void mem_inc (ADAPTER *a, void *addr) void mem_inc(ADAPTER *a, void *addr)
{ {
volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io); volatile byte __iomem *Base = DIVA_OS_MEM_ATTACH_RAM((PISDN_ADAPTER)a->io);
byte x = READ_BYTE(Base + (unsigned long)addr); byte x = READ_BYTE(Base + (unsigned long)addr);
@@ -661,30 +661,30 @@ void mem_inc (ADAPTER *a, void *addr)
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* ram access functions for io-mapped cards */ /* ram access functions for io-mapped cards */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
byte io_in(ADAPTER * a, void * adr) byte io_in(ADAPTER *a, void *adr)
{ {
byte val; byte val;
byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io); byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io);
outppw(Port + 4, (word)(unsigned long)adr); outppw(Port + 4, (word)(unsigned long)adr);
val = inpp(Port); val = inpp(Port);
DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port); DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port);
return(val); return (val);
} }
word io_inw(ADAPTER * a, void * adr) word io_inw(ADAPTER *a, void *adr)
{ {
word val; word val;
byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io); byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io);
outppw(Port + 4, (word)(unsigned long)adr); outppw(Port + 4, (word)(unsigned long)adr);
val = inppw(Port); val = inppw(Port);
DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port); DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port);
return(val); return (val);
} }
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 __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io); byte __iomem *Port = 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);
P++; P++;
adr = ((byte *) adr) + 1; adr = ((byte *) adr) + 1;
@@ -694,39 +694,39 @@ void io_in_buffer(ADAPTER * a, void * adr, void * buffer, word len)
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);
DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port); DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port);
} }
void io_look_ahead(ADAPTER * a, PBUFFER * RBuffer, ENTITY * e) void io_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e)
{ {
byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io); byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io);
outppw(Port+4, (word)(unsigned long)RBuffer); outppw(Port + 4, (word)(unsigned long)RBuffer);
((PISDN_ADAPTER)a->io)->RBuffer.length = inppw(Port); ((PISDN_ADAPTER)a->io)->RBuffer.length = inppw(Port);
inppw_buffer (Port, ((PISDN_ADAPTER)a->io)->RBuffer.P, ((PISDN_ADAPTER)a->io)->RBuffer.length + 1); inppw_buffer(Port, ((PISDN_ADAPTER)a->io)->RBuffer.P, ((PISDN_ADAPTER)a->io)->RBuffer.length + 1);
e->RBuffer = (DBUFFER *) &(((PISDN_ADAPTER)a->io)->RBuffer); e->RBuffer = (DBUFFER *) &(((PISDN_ADAPTER)a->io)->RBuffer);
DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port); DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port);
} }
void io_out(ADAPTER * a, void * adr, byte data) void io_out(ADAPTER *a, void *adr, byte data)
{ {
byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io); byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io);
outppw(Port+4, (word)(unsigned long)adr); outppw(Port + 4, (word)(unsigned long)adr);
outpp(Port, data); outpp(Port, data);
DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port); DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port);
} }
void io_outw(ADAPTER * a, void * adr, word data) void io_outw(ADAPTER *a, void *adr, word data)
{ {
byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io); byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io);
outppw(Port+4, (word)(unsigned long)adr); outppw(Port + 4, (word)(unsigned long)adr);
outppw(Port, data); outppw(Port, data);
DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port); DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port);
} }
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 __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io); byte __iomem *Port = 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);
P++; P++;
adr = ((byte *) adr) + 1; adr = ((byte *) adr) + 1;
@@ -736,69 +736,69 @@ void io_out_buffer(ADAPTER * a, void * adr, void * buffer, word len)
return; return;
} }
} }
outppw(Port+4, (word)(unsigned long)adr); outppw(Port + 4, (word)(unsigned long)adr);
outppw_buffer (Port, P, len+1); outppw_buffer(Port, P, len + 1);
DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port); DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port);
} }
void io_inc(ADAPTER * a, void * adr) void io_inc(ADAPTER *a, void *adr)
{ {
byte x; byte x;
byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io); byte __iomem *Port = DIVA_OS_MEM_ATTACH_PORT((PISDN_ADAPTER)a->io);
outppw(Port+4, (word)(unsigned long)adr); outppw(Port + 4, (word)(unsigned long)adr);
x = inpp(Port); x = inpp(Port);
outppw(Port+4, (word)(unsigned long)adr); outppw(Port + 4, (word)(unsigned long)adr);
outpp(Port, x+1); outpp(Port, x + 1);
DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port); DIVA_OS_MEM_DETACH_PORT((PISDN_ADAPTER)a->io, Port);
} }
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* OS specific functions related to queuing of entities */ /* OS specific functions related to queuing of entities */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
void free_entity(ADAPTER * a, byte e_no) void free_entity(ADAPTER *a, byte e_no)
{ {
PISDN_ADAPTER IoAdapter; PISDN_ADAPTER IoAdapter;
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
IoAdapter = (PISDN_ADAPTER) a->io; IoAdapter = (PISDN_ADAPTER) a->io;
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_free"); diva_os_enter_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_free");
IoAdapter->e_tbl[e_no].e = NULL; IoAdapter->e_tbl[e_no].e = NULL;
IoAdapter->e_count--; IoAdapter->e_count--;
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_free"); diva_os_leave_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_free");
} }
void assign_queue(ADAPTER * a, byte e_no, word ref) void assign_queue(ADAPTER *a, byte e_no, word ref)
{ {
PISDN_ADAPTER IoAdapter; PISDN_ADAPTER IoAdapter;
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
IoAdapter = (PISDN_ADAPTER) a->io; IoAdapter = (PISDN_ADAPTER) a->io;
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_assign"); diva_os_enter_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_assign");
IoAdapter->e_tbl[e_no].assign_ref = ref; IoAdapter->e_tbl[e_no].assign_ref = ref;
IoAdapter->e_tbl[e_no].next = (byte)IoAdapter->assign; IoAdapter->e_tbl[e_no].next = (byte)IoAdapter->assign;
IoAdapter->assign = e_no; IoAdapter->assign = e_no;
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_assign"); diva_os_leave_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_assign");
} }
byte get_assign(ADAPTER * a, word ref) byte get_assign(ADAPTER *a, word ref)
{ {
PISDN_ADAPTER IoAdapter; PISDN_ADAPTER IoAdapter;
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
byte e_no; byte e_no;
IoAdapter = (PISDN_ADAPTER) a->io; IoAdapter = (PISDN_ADAPTER) a->io;
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, diva_os_enter_spin_lock(&IoAdapter->data_spin_lock,
&irql, &irql,
"data_assign_get"); "data_assign_get");
for(e_no = (byte)IoAdapter->assign; for (e_no = (byte)IoAdapter->assign;
e_no && IoAdapter->e_tbl[e_no].assign_ref!=ref; e_no && IoAdapter->e_tbl[e_no].assign_ref != ref;
e_no = IoAdapter->e_tbl[e_no].next); e_no = IoAdapter->e_tbl[e_no].next);
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock, diva_os_leave_spin_lock(&IoAdapter->data_spin_lock,
&irql, &irql,
"data_assign_get"); "data_assign_get");
return e_no; return e_no;
} }
void req_queue(ADAPTER * a, byte e_no) void req_queue(ADAPTER *a, byte e_no)
{ {
PISDN_ADAPTER IoAdapter; PISDN_ADAPTER IoAdapter;
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
IoAdapter = (PISDN_ADAPTER) a->io; IoAdapter = (PISDN_ADAPTER) a->io;
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_req_q"); diva_os_enter_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_req_q");
IoAdapter->e_tbl[e_no].next = 0; IoAdapter->e_tbl[e_no].next = 0;
if(IoAdapter->head) { if (IoAdapter->head) {
IoAdapter->e_tbl[IoAdapter->tail].next = e_no; IoAdapter->e_tbl[IoAdapter->tail].next = e_no;
IoAdapter->tail = e_no; IoAdapter->tail = e_no;
} }
@@ -806,47 +806,47 @@ void req_queue(ADAPTER * a, byte e_no)
IoAdapter->head = e_no; IoAdapter->head = e_no;
IoAdapter->tail = e_no; IoAdapter->tail = e_no;
} }
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_req_q"); diva_os_leave_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_req_q");
} }
byte look_req(ADAPTER * a) byte look_req(ADAPTER *a)
{ {
PISDN_ADAPTER IoAdapter; PISDN_ADAPTER IoAdapter;
IoAdapter = (PISDN_ADAPTER) a->io; IoAdapter = (PISDN_ADAPTER) a->io;
return ((byte)IoAdapter->head) ; return ((byte)IoAdapter->head);
} }
void next_req(ADAPTER * a) void next_req(ADAPTER *a)
{ {
PISDN_ADAPTER IoAdapter; PISDN_ADAPTER IoAdapter;
diva_os_spin_lock_magic_t irql; diva_os_spin_lock_magic_t irql;
IoAdapter = (PISDN_ADAPTER) a->io; IoAdapter = (PISDN_ADAPTER) a->io;
diva_os_enter_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_req_next"); diva_os_enter_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_req_next");
IoAdapter->head = IoAdapter->e_tbl[IoAdapter->head].next; IoAdapter->head = IoAdapter->e_tbl[IoAdapter->head].next;
if(!IoAdapter->head) IoAdapter->tail = 0; if (!IoAdapter->head) IoAdapter->tail = 0;
diva_os_leave_spin_lock (&IoAdapter->data_spin_lock, &irql, "data_req_next"); diva_os_leave_spin_lock(&IoAdapter->data_spin_lock, &irql, "data_req_next");
} }
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* memory map functions */ /* memory map functions */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
ENTITY * entity_ptr(ADAPTER * a, byte e_no) ENTITY *entity_ptr(ADAPTER *a, byte e_no)
{ {
PISDN_ADAPTER IoAdapter; PISDN_ADAPTER IoAdapter;
IoAdapter = (PISDN_ADAPTER) a->io; IoAdapter = (PISDN_ADAPTER)a->io;
return (IoAdapter->e_tbl[e_no].e); return (IoAdapter->e_tbl[e_no].e);
} }
void * PTR_X(ADAPTER * a, ENTITY * e) void *PTR_X(ADAPTER *a, ENTITY *e)
{ {
return ((void *) e->X); return ((void *) e->X);
} }
void * PTR_R(ADAPTER * a, ENTITY * e) void *PTR_R(ADAPTER *a, ENTITY *e)
{ {
return ((void *) e->R); return ((void *) e->R);
} }
void * PTR_P(ADAPTER * a, ENTITY * e, void * P) void *PTR_P(ADAPTER *a, ENTITY *e, void *P)
{ {
return P; return P;
} }
void CALLBACK(ADAPTER * a, ENTITY * e) void CALLBACK(ADAPTER *a, ENTITY *e)
{ {
if ( e && e->callback ) if (e && e->callback)
e->callback (e) ; e->callback(e);
} }

View File

@@ -27,7 +27,7 @@
#define __DIVA_XDI_COMMON_IO_H_INC__ #define __DIVA_XDI_COMMON_IO_H_INC__
/* /*
maximum = 16 adapters maximum = 16 adapters
*/ */
#define DI_MAX_LINKS MAX_ADAPTER #define DI_MAX_LINKS MAX_ADAPTER
#define ISDN_MAX_NUM_LEN 60 #define ISDN_MAX_NUM_LEN 60
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
@@ -35,18 +35,18 @@
systems that do provide per card load event) systems that do provide per card load event)
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
typedef struct { typedef struct {
dword Num ; dword Num;
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 Special OS memory support structures
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#define MAX_MAPPED_ENTRIES 8 #define MAX_MAPPED_ENTRIES 8
typedef struct { typedef struct {
void * Address; void *Address;
dword Length; dword Length;
} ADAPTER_MEMORY ; } ADAPTER_MEMORY;
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Configuration of XDI clients carried by XDI Configuration of XDI clients carried by XDI
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
@@ -59,105 +59,105 @@ typedef struct _diva_xdi_capi_cfg {
Main data structure kept per adapter Main data structure kept per adapter
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
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 achievement */ int State; /* from NT4 1.srv, a good idea, but a poor achievement */
int Initialized ; int Initialized;
int RegisteredWithDidd ; int RegisteredWithDidd;
int Unavailable ; /* callback function possible? */ int Unavailable; /* callback function possible? */
int ResourcesClaimed ; int ResourcesClaimed;
int PnpBiosConfigUsed ; int PnpBiosConfigUsed;
dword Logging ; dword Logging;
dword features ; dword features;
char ProtocolIdString[80] ; char ProtocolIdString[80];
/* /*
remember mapped memory areas remember mapped memory areas
*/ */
ADAPTER_MEMORY MappedMemory[MAX_MAPPED_ENTRIES] ; 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 */
char protocol_name[8] ; /* readable name of protocol */ char protocol_name[8]; /* readable name of protocol */
dword BusType ; dword BusType;
dword BusNumber ; dword BusNumber;
dword slotNumber ; dword slotNumber;
dword slotId ; dword slotId;
dword ControllerNumber ; /* for QUADRO cards only */ dword ControllerNumber; /* for QUADRO cards only */
PISDN_ADAPTER MultiMaster ; /* for 4-BRI card only - use MultiMaster or QuadroList */ PISDN_ADAPTER MultiMaster; /* for 4-BRI card only - use MultiMaster or QuadroList */
PADAPTER_LIST_ENTRY QuadroList ; /* for QUADRO card only */ PADAPTER_LIST_ENTRY QuadroList; /* for QUADRO card only */
PDEVICE_OBJECT DeviceObject ; PDEVICE_OBJECT DeviceObject;
dword DeviceId ; dword DeviceId;
diva_os_adapter_irq_info_t irq_info; diva_os_adapter_irq_info_t irq_info;
dword volatile IrqCount ; dword volatile IrqCount;
int trapped ; int trapped;
dword DspCodeBaseAddr ; dword DspCodeBaseAddr;
dword MaxDspCodeSize ; dword MaxDspCodeSize;
dword downloadAddr ; dword downloadAddr;
dword DspCodeBaseAddrTable[4] ; /* add. for MultiMaster */ dword DspCodeBaseAddrTable[4]; /* add. for MultiMaster */
dword MaxDspCodeSizeTable[4] ; /* add. for MultiMaster */ dword MaxDspCodeSizeTable[4]; /* add. for MultiMaster */
dword downloadAddrTable[4] ; /* add. for MultiMaster */ dword downloadAddrTable[4]; /* add. for MultiMaster */
dword MemoryBase ; dword MemoryBase;
dword MemorySize ; dword MemorySize;
byte __iomem *Address ; byte __iomem *Address;
byte __iomem *Config ; byte __iomem *Config;
byte __iomem *Control ; byte __iomem *Control;
byte __iomem *reset ; byte __iomem *reset;
byte __iomem *port ; byte __iomem *port;
byte __iomem *ram ; byte __iomem *ram;
byte __iomem *cfg ; byte __iomem *cfg;
byte __iomem *prom ; byte __iomem *prom;
byte __iomem *ctlReg ; byte __iomem *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];
dword serialNo ; dword serialNo;
dword ANum ; dword ANum;
dword ArchiveType ; /* ARCHIVE_TYPE_NONE ..._SINGLE ..._USGEN ..._MULTI */ dword ArchiveType; /* ARCHIVE_TYPE_NONE ..._SINGLE ..._USGEN ..._MULTI */
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 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];
char Osa2[ISDN_MAX_NUM_LEN] ; char Osa2[ISDN_MAX_NUM_LEN];
char Spid1[ISDN_MAX_NUM_LEN] ; char Spid1[ISDN_MAX_NUM_LEN];
char Spid2[ISDN_MAX_NUM_LEN] ; char Spid2[ISDN_MAX_NUM_LEN];
byte nosig ; byte nosig;
byte BriLayer2LinkCount ; /* amount of TEI's that adapter will support in P2MP mode */ byte BriLayer2LinkCount; /* amount of TEI's that adapter will support in P2MP mode */
dword Channels ; dword Channels;
dword tei ; dword tei;
dword nt2 ; dword nt2;
dword TerminalCount ; dword TerminalCount;
dword WatchDog ; dword WatchDog;
dword Permanent ; dword Permanent;
dword BChMask ; /* B channel mask for unchannelized modes */ dword BChMask; /* B channel mask for unchannelized modes */
dword StableL2 ; dword StableL2;
dword DidLen ; dword DidLen;
dword NoOrderCheck ; dword NoOrderCheck;
dword ForceLaw; /* VoiceCoding - default:0, a-law: 1, my-law: 2 */ dword ForceLaw; /* VoiceCoding - default:0, a-law: 1, my-law: 2 */
dword SigFlags ; dword SigFlags;
dword LowChannel ; dword LowChannel;
dword NoHscx30 ; dword NoHscx30;
dword ProtVersion ; dword ProtVersion;
dword crc4 ; dword crc4;
dword L1TristateOrQsig ; /* enable Layer 1 Tristate (bit 2)Or Qsig params (bit 0,1)*/ dword L1TristateOrQsig; /* enable Layer 1 Tristate (bit 2)Or Qsig params (bit 0,1)*/
dword InitialDspInfo ; dword InitialDspInfo;
dword ModemGuardTone ; dword ModemGuardTone;
dword ModemMinSpeed ; dword ModemMinSpeed;
dword ModemMaxSpeed ; dword ModemMaxSpeed;
dword ModemOptions ; dword ModemOptions;
dword ModemOptions2 ; dword ModemOptions2;
dword ModemNegotiationMode ; dword ModemNegotiationMode;
dword ModemModulationsMask ; dword ModemModulationsMask;
dword ModemTransmitLevel ; dword ModemTransmitLevel;
dword FaxOptions ; dword FaxOptions;
dword FaxMaxSpeed ; dword FaxMaxSpeed;
dword Part68LevelLimiter ; dword Part68LevelLimiter;
dword UsEktsNumCallApp ; dword UsEktsNumCallApp;
byte UsEktsFeatAddConf ; byte UsEktsFeatAddConf;
byte UsEktsFeatRemoveConf ; byte UsEktsFeatRemoveConf;
byte UsEktsFeatCallTransfer ; byte UsEktsFeatCallTransfer;
byte UsEktsFeatMsgWaiting ; byte UsEktsFeatMsgWaiting;
byte QsigDialect; byte QsigDialect;
byte ForceVoiceMailAlert; byte ForceVoiceMailAlert;
byte DisableAutoSpid; byte DisableAutoSpid;
@@ -168,7 +168,7 @@ struct _ISDN_ADAPTER {
byte AniDniLimiter[3]; byte AniDniLimiter[3];
byte TxAttenuation; /* PRI/E1 only: attenuate TX signal */ byte TxAttenuation; /* PRI/E1 only: attenuate TX signal */
word QsigFeatures; word QsigFeatures;
dword GenerateRingtone ; dword GenerateRingtone;
dword SupplementaryServicesFeatures; dword SupplementaryServicesFeatures;
dword R2Dialect; dword R2Dialect;
dword R2CasOptions; dword R2CasOptions;
@@ -181,9 +181,9 @@ struct _ISDN_ADAPTER {
byte R2CtryLength; byte R2CtryLength;
byte CCBSRelTimer; byte CCBSRelTimer;
byte *PcCfgBufferFile;/* flexible parameter via file */ byte *PcCfgBufferFile;/* flexible parameter via file */
byte *PcCfgBuffer ; /* flexible parameter via multistring */ byte *PcCfgBuffer; /* flexible parameter via multistring */
diva_os_dump_file_t dump_file; /* dump memory to file at lowest irq level */ 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_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;
@@ -196,40 +196,40 @@ struct _ISDN_ADAPTER {
word assign; /* list of pending ASSIGNs */ word assign; /* list of pending ASSIGNs */
word head; /* head of request queue */ word head; /* head of request queue */
word tail; /* tail of request queue */ word tail; /* tail of request queue */
ADAPTER a ; /* not a separate structure */ ADAPTER a; /* not a separate structure */
void (* out)(ADAPTER * a) ; void (*out)(ADAPTER *a);
byte (* dpc)(ADAPTER * a) ; byte (*dpc)(ADAPTER *a);
byte (* tst_irq)(ADAPTER * a) ; byte (*tst_irq)(ADAPTER *a);
void (* clr_irq)(ADAPTER * a) ; void (*clr_irq)(ADAPTER *a);
int (* load)(PISDN_ADAPTER) ; int (*load)(PISDN_ADAPTER);
int (* mapmem)(PISDN_ADAPTER) ; int (*mapmem)(PISDN_ADAPTER);
int (* chkIrq)(PISDN_ADAPTER) ; int (*chkIrq)(PISDN_ADAPTER);
void (* disIrq)(PISDN_ADAPTER) ; void (*disIrq)(PISDN_ADAPTER);
void (* start)(PISDN_ADAPTER) ; void (*start)(PISDN_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) ; 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; /* must be 32 bit */ dword sdram_bar; /* must be 32 bit */
dword fpga_features; dword fpga_features;
volatile int pcm_pending; volatile int pcm_pending;
volatile void * 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); int (*DivaAdapterTestProc)(PISDN_ADAPTER);
void *AdapterTestMemoryStart; void *AdapterTestMemoryStart;
dword AdapterTestMemoryLength; dword AdapterTestMemoryLength;
const byte* cfg_lib_memory_init; const byte *cfg_lib_memory_init;
dword cfg_lib_memory_init_length; dword cfg_lib_memory_init_length;
}; };
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
Entity table Entity table
--------------------------------------------------------------------- */ --------------------------------------------------------------------- */
struct e_info_s { struct e_info_s {
ENTITY * e; ENTITY *e;
byte next; /* chaining index */ byte next; /* chaining index */
word assign_ref; /* assign reference */ word assign_ref; /* assign reference */
}; };
@@ -254,55 +254,55 @@ struct s_load {
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
platform specific conversions platform specific conversions
--------------------------------------------------------------------- */ --------------------------------------------------------------------- */
extern void * PTR_P(ADAPTER * a, ENTITY * e, void * P); extern void *PTR_P(ADAPTER *a, ENTITY *e, void *P);
extern void * PTR_X(ADAPTER * a, ENTITY * e); extern void *PTR_X(ADAPTER *a, ENTITY *e);
extern void * PTR_R(ADAPTER * a, ENTITY * e); extern void *PTR_R(ADAPTER *a, ENTITY *e);
extern void CALLBACK(ADAPTER * a, ENTITY * e); extern void CALLBACK(ADAPTER *a, ENTITY *e);
extern void set_ram(void * * adr_ptr); extern void set_ram(void **adr_ptr);
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
ram access functions for io mapped cards ram access functions for io mapped cards
--------------------------------------------------------------------- */ --------------------------------------------------------------------- */
byte io_in(ADAPTER * a, void * adr); byte io_in(ADAPTER *a, void *adr);
word io_inw(ADAPTER * a, void * adr); word io_inw(ADAPTER *a, void *adr);
void io_in_buffer(ADAPTER * a, void * adr, void * P, word length); void io_in_buffer(ADAPTER *a, void *adr, void *P, word length);
void io_look_ahead(ADAPTER * a, PBUFFER * RBuffer, ENTITY * e); void io_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
void io_out(ADAPTER * a, void * adr, byte data); 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 bri_in_buffer(PISDN_ADAPTER IoAdapter, dword Pos,
void *Buf, dword Len); void *Buf, dword Len);
int bri_out_buffer (PISDN_ADAPTER IoAdapter, dword Pos, int bri_out_buffer(PISDN_ADAPTER IoAdapter, dword Pos,
void *Buf, dword Len, int Verify); void *Buf, dword Len, int Verify);
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
ram access functions for memory mapped cards ram access functions for memory mapped cards
--------------------------------------------------------------------- */ --------------------------------------------------------------------- */
byte mem_in(ADAPTER * a, void * adr); byte mem_in(ADAPTER *a, void *adr);
word mem_inw(ADAPTER * a, void * adr); word mem_inw(ADAPTER *a, void *adr);
void mem_in_buffer(ADAPTER * a, void * adr, void * P, word length); void mem_in_buffer(ADAPTER *a, void *adr, void *P, word length);
void mem_look_ahead(ADAPTER * a, PBUFFER * RBuffer, ENTITY * e); void mem_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
void mem_out(ADAPTER * a, void * adr, byte data); void mem_out(ADAPTER *a, void *adr, byte data);
void mem_outw(ADAPTER * a, void * adr, word data); void mem_outw(ADAPTER *a, void *adr, word data);
void mem_out_buffer(ADAPTER * a, void * adr, void * P, word length); void mem_out_buffer(ADAPTER *a, void *adr, void *P, word length);
void mem_inc(ADAPTER * a, void * adr); void mem_inc(ADAPTER *a, void *adr);
void mem_in_dw (ADAPTER *a, void *addr, dword* data, int dwords); void mem_in_dw(ADAPTER *a, void *addr, dword *data, int dwords);
void mem_out_dw (ADAPTER *a, void *addr, const dword* data, int dwords); void mem_out_dw(ADAPTER *a, void *addr, const dword *data, int dwords);
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
functions exported by io.c functions exported by io.c
--------------------------------------------------------------------- */ --------------------------------------------------------------------- */
extern IDI_CALL Requests[MAX_ADAPTER] ; extern IDI_CALL Requests[MAX_ADAPTER];
extern void DIDpcRoutine (struct _diva_os_soft_isr* psoft_isr, extern void DIDpcRoutine(struct _diva_os_soft_isr *psoft_isr,
void* context); void *context);
extern void request (PISDN_ADAPTER, ENTITY *) ; extern void request(PISDN_ADAPTER, ENTITY *);
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
trapFn helpers, used to recover debug trace from dead card trapFn helpers, used to recover debug trace from dead card
--------------------------------------------------------------------- */ --------------------------------------------------------------------- */
typedef struct { typedef struct {
word *buf ; word *buf;
word cnt ; word cnt;
word out ; word out;
} Xdesc ; } Xdesc;
extern void dump_trap_frame (PISDN_ADAPTER IoAdapter, byte __iomem *exception) ; extern void dump_trap_frame(PISDN_ADAPTER IoAdapter, byte __iomem *exception);
extern void dump_xlog_buffer (PISDN_ADAPTER IoAdapter, Xdesc *xlogDesc) ; extern void dump_xlog_buffer(PISDN_ADAPTER IoAdapter, Xdesc *xlogDesc);
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
#endif /* } __DIVA_XDI_COMMON_IO_H_INC__ */ #endif /* } __DIVA_XDI_COMMON_IO_H_INC__ */

View File

@@ -31,30 +31,30 @@
#include "divasync.h" #include "divasync.h"
#include "di.h" #include "di.h"
#if !defined USE_EXTENDED_DEBUGS #if !defined USE_EXTENDED_DEBUGS
#include "dimaint.h" #include "dimaint.h"
#else #else
#define dprintf #define dprintf
#endif #endif
#include "dfifo.h" #include "dfifo.h"
int diva_istream_write (void* context, int diva_istream_write(void *context,
int Id, int Id,
void* data, void *data,
int length, int length,
int final, int final,
byte usr1, byte usr1,
byte usr2); byte usr2);
int diva_istream_read (void* context, int diva_istream_read(void *context,
int Id, int Id,
void* data, void *data,
int max_length, int max_length,
int* final, int *final,
byte* usr1, byte *usr1,
byte* usr2); byte *usr2);
/* ------------------------------------------------------------------- /* -------------------------------------------------------------------
Does provide iStream interface to the client Does provide iStream interface to the client
------------------------------------------------------------------- */ ------------------------------------------------------------------- */
void diva_xdi_provide_istream_info (ADAPTER* a, void diva_xdi_provide_istream_info(ADAPTER *a,
diva_xdi_stream_interface_t* pi) { diva_xdi_stream_interface_t *pi) {
pi->provided_service = 0; pi->provided_service = 0;
} }
/* ------------------------------------------------------------------ /* ------------------------------------------------------------------
@@ -67,25 +67,25 @@ void diva_xdi_provide_istream_info (ADAPTER* a,
return 0 if zero lengh packet was written return 0 if zero lengh packet was written
return -1 if stream is full return -1 if stream is full
------------------------------------------------------------------ */ ------------------------------------------------------------------ */
int diva_istream_write (void* context, int diva_istream_write(void *context,
int Id, int Id,
void* data, void *data,
int length, int length,
int final, int final,
byte usr1, byte usr1,
byte usr2) { byte usr2) {
ADAPTER* a = (ADAPTER*)context; ADAPTER *a = (ADAPTER *)context;
int written = 0, to_write = -1; int written = 0, to_write = -1;
char tmp[4]; char tmp[4];
byte* data_ptr = (byte*)data; byte *data_ptr = (byte *)data;
for (;;) { for (;;) {
a->ram_in_dw (a, a->ram_in_dw(a,
#ifdef PLATFORM_GT_32BIT #ifdef PLATFORM_GT_32BIT
ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id]), ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id]),
#else #else
(void*)(a->tx_stream[Id] + a->tx_pos[Id]), (void *)(a->tx_stream[Id] + a->tx_pos[Id]),
#endif #endif
(dword*)&tmp[0], (dword *)&tmp[0],
1); 1);
if (tmp[0] & DIVA_DFIFO_READY) { /* No free blocks more */ if (tmp[0] & DIVA_DFIFO_READY) { /* No free blocks more */
if (to_write < 0) if (to_write < 0)
@@ -94,11 +94,11 @@ int diva_istream_write (void* context,
} }
to_write = min(length, DIVA_DFIFO_DATA_SZ); to_write = min(length, DIVA_DFIFO_DATA_SZ);
if (to_write) { if (to_write) {
a->ram_out_buffer (a, a->ram_out_buffer(a,
#ifdef PLATFORM_GT_32BIT #ifdef PLATFORM_GT_32BIT
ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id]+4), ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id] + 4),
#else #else
(void*)(a->tx_stream[Id] + a->tx_pos[Id] + 4), (void *)(a->tx_stream[Id] + a->tx_pos[Id] + 4),
#endif #endif
data_ptr, data_ptr,
(word)to_write); (word)to_write);
@@ -114,13 +114,13 @@ int diva_istream_write (void* context,
tmp[2] = usr1; tmp[2] = usr1;
tmp[3] = usr2; tmp[3] = usr2;
} }
a->ram_out_dw (a, a->ram_out_dw(a,
#ifdef PLATFORM_GT_32BIT #ifdef PLATFORM_GT_32BIT
ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id]), ULongToPtr(a->tx_stream[Id] + a->tx_pos[Id]),
#else #else
(void*)(a->tx_stream[Id] + a->tx_pos[Id]), (void *)(a->tx_stream[Id] + a->tx_pos[Id]),
#endif #endif
(dword*)&tmp[0], (dword *)&tmp[0],
1); 1);
if (tmp[0] & DIVA_DFIFO_WRAP) { if (tmp[0] & DIVA_DFIFO_WRAP) {
a->tx_pos[Id] = 0; a->tx_pos[Id] = 0;
@@ -145,26 +145,26 @@ int diva_istream_write (void* context,
to accommodate entire segment to accommodate entire segment
max_length should be at least 68 bytes max_length should be at least 68 bytes
------------------------------------------------------------------- */ ------------------------------------------------------------------- */
int diva_istream_read (void* context, int diva_istream_read(void *context,
int Id, int Id,
void* data, void *data,
int max_length, int max_length,
int* final, int *final,
byte* usr1, byte *usr1,
byte* usr2) { byte *usr2) {
ADAPTER* a = (ADAPTER*)context; ADAPTER *a = (ADAPTER *)context;
int read = 0, to_read = -1; int read = 0, to_read = -1;
char tmp[4]; char tmp[4];
byte* data_ptr = (byte*)data; byte *data_ptr = (byte *)data;
*final = 0; *final = 0;
for (;;) { for (;;) {
a->ram_in_dw (a, a->ram_in_dw(a,
#ifdef PLATFORM_GT_32BIT #ifdef PLATFORM_GT_32BIT
ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id]), ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id]),
#else #else
(void*)(a->rx_stream[Id] + a->rx_pos[Id]), (void *)(a->rx_stream[Id] + a->rx_pos[Id]),
#endif #endif
(dword*)&tmp[0], (dword *)&tmp[0],
1); 1);
if (tmp[1] > max_length) { if (tmp[1] > max_length) {
if (to_read < 0) if (to_read < 0)
@@ -182,7 +182,7 @@ int diva_istream_read (void* context,
#ifdef PLATFORM_GT_32BIT #ifdef PLATFORM_GT_32BIT
ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id] + 4), ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id] + 4),
#else #else
(void*)(a->rx_stream[Id] + a->rx_pos[Id] + 4), (void *)(a->rx_stream[Id] + a->rx_pos[Id] + 4),
#endif #endif
data_ptr, data_ptr,
(word)to_read); (word)to_read);
@@ -198,9 +198,9 @@ int diva_istream_read (void* context,
#ifdef PLATFORM_GT_32BIT #ifdef PLATFORM_GT_32BIT
ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id]), ULongToPtr(a->rx_stream[Id] + a->rx_pos[Id]),
#else #else
(void*)(a->rx_stream[Id] + a->rx_pos[Id]), (void *)(a->rx_stream[Id] + a->rx_pos[Id]),
#endif #endif
(dword*)&tmp[0], (dword *)&tmp[0],
1); 1);
if (tmp[0] & DIVA_DFIFO_WRAP) { if (tmp[0] & DIVA_DFIFO_WRAP) {
a->rx_pos[Id] = 0; a->rx_pos[Id] = 0;
@@ -221,6 +221,6 @@ int diva_istream_read (void* context,
Does check if one of streams had caused interrupt and does Does check if one of streams had caused interrupt and does
wake up corresponding application wake up corresponding application
--------------------------------------------------------------------- */ --------------------------------------------------------------------- */
void pr_stream (ADAPTER * a) { void pr_stream(ADAPTER *a) {
} }
#endif /* } */ #endif /* } */

View File

@@ -37,7 +37,7 @@ typedef struct _diva_trace_ie {
/* /*
Structure used to represent "State\\BX\\Modem" directory Structure used to represent "State\\BX\\Modem" directory
to user. to user.
*/ */
typedef struct _diva_trace_modem_state { typedef struct _diva_trace_modem_state {
dword ChannelNumber; dword ChannelNumber;
@@ -71,7 +71,7 @@ typedef struct _diva_trace_modem_state {
/* /*
Representation of "State\\BX\\FAX" directory Representation of "State\\BX\\FAX" directory
*/ */
typedef struct _diva_trace_fax_state { typedef struct _diva_trace_fax_state {
dword ChannelNumber; dword ChannelNumber;
dword Event; dword Event;
@@ -92,7 +92,7 @@ typedef struct _diva_trace_fax_state {
/* /*
Structure used to represent Interface State in the abstract Structure used to represent Interface State in the abstract
and interface/D-channel protocol independent form. and interface/D-channel protocol independent form.
*/ */
typedef struct _diva_trace_interface_state { typedef struct _diva_trace_interface_state {
char Layer1[DIVA_TRACE_LINE_TYPE_LEN]; char Layer1[DIVA_TRACE_LINE_TYPE_LEN];
char Layer2[DIVA_TRACE_LINE_TYPE_LEN]; char Layer2[DIVA_TRACE_LINE_TYPE_LEN];
@@ -175,7 +175,7 @@ typedef struct _diva_ifc_statistics {
/* /*
Structure used to represent "State\\BX" directory Structure used to represent "State\\BX" directory
to user. to user.
*/ */
typedef struct _diva_trace_line_state { typedef struct _diva_trace_line_state {
dword ChannelNumber; dword ChannelNumber;
@@ -207,9 +207,9 @@ typedef struct _diva_trace_line_state {
diva_trace_modem_state_t modem; diva_trace_modem_state_t modem;
diva_trace_fax_state_t fax; diva_trace_fax_state_t fax;
diva_trace_interface_state_t* pInterface; diva_trace_interface_state_t *pInterface;
diva_ifc_statistics_t* pInterfaceStat; diva_ifc_statistics_t *pInterfaceStat;
} diva_trace_line_state_t; } diva_trace_line_state_t;
@@ -222,23 +222,23 @@ typedef struct _diva_trace_line_state {
#define DIVA_SUPER_TRACE_NOTIFY_FAX_STAT_CHANGE ('F') #define DIVA_SUPER_TRACE_NOTIFY_FAX_STAT_CHANGE ('F')
struct _diva_strace_library_interface; struct _diva_strace_library_interface;
typedef void (*diva_trace_channel_state_change_proc_t)(void* user_context, typedef void (*diva_trace_channel_state_change_proc_t)(void *user_context,
struct _diva_strace_library_interface* hLib, struct _diva_strace_library_interface *hLib,
int Adapter, int Adapter,
diva_trace_line_state_t* channel, int notify_subject); diva_trace_line_state_t *channel, int notify_subject);
typedef void (*diva_trace_channel_trace_proc_t)(void* user_context, typedef void (*diva_trace_channel_trace_proc_t)(void *user_context,
struct _diva_strace_library_interface* hLib, struct _diva_strace_library_interface *hLib,
int Adapter, void* xlog_buffer, int length); int Adapter, void *xlog_buffer, int length);
typedef void (*diva_trace_error_proc_t)(void* user_context, typedef void (*diva_trace_error_proc_t)(void *user_context,
struct _diva_strace_library_interface* hLib, struct _diva_strace_library_interface *hLib,
int Adapter, int Adapter,
int error, const char* file, int line); int error, const char *file, int line);
/* /*
This structure creates interface from user to library This structure creates interface from user to library
*/ */
typedef struct _diva_trace_library_user_interface { typedef struct _diva_trace_library_user_interface {
void* user_context; void *user_context;
diva_trace_channel_state_change_proc_t notify_proc; diva_trace_channel_state_change_proc_t notify_proc;
diva_trace_channel_trace_proc_t trace_proc; diva_trace_channel_trace_proc_t trace_proc;
diva_trace_error_proc_t error_notify_proc; diva_trace_error_proc_t error_notify_proc;
@@ -246,23 +246,23 @@ typedef struct _diva_trace_library_user_interface {
/* /*
Interface from Library to User Interface from Library to User
*/ */
typedef int (*DivaSTraceLibraryStart_proc_t)(void* hLib); typedef int (*DivaSTraceLibraryStart_proc_t)(void *hLib);
typedef int (*DivaSTraceLibraryFinit_proc_t)(void* hLib); typedef int (*DivaSTraceLibraryFinit_proc_t)(void *hLib);
typedef int (*DivaSTraceMessageInput_proc_t)(void* hLib); typedef int (*DivaSTraceMessageInput_proc_t)(void *hLib);
typedef void* (*DivaSTraceGetHandle_proc_t)(void* hLib); typedef void* (*DivaSTraceGetHandle_proc_t)(void *hLib);
/* /*
Turn Audio Tap trace on/off Turn Audio Tap trace on/off
Channel should be in the range 1 ... Number of Channels Channel should be in the range 1 ... Number of Channels
*/ */
typedef int (*DivaSTraceSetAudioTap_proc_t)(void* hLib, int Channel, int on); typedef int (*DivaSTraceSetAudioTap_proc_t)(void *hLib, int Channel, int on);
/* /*
Turn B-channel trace on/off Turn B-channel trace on/off
Channel should be in the range 1 ... Number of Channels Channel should be in the range 1 ... Number of Channels
*/ */
typedef int (*DivaSTraceSetBChannel_proc_t)(void* hLib, int Channel, int on); typedef int (*DivaSTraceSetBChannel_proc_t)(void *hLib, int Channel, int on);
/* /*
Turn D-channel (Layer1/Layer2/Layer3) trace on/off Turn D-channel (Layer1/Layer2/Layer3) trace on/off
@@ -271,28 +271,28 @@ typedef int (*DivaSTraceSetBChannel_proc_t)(void* hLib, int Channel, int on);
Layer2 - Events from LAPD protocol instance with SAPI of signalling protocol Layer2 - Events from LAPD protocol instance with SAPI of signalling protocol
Layer3 - All D-channel frames addressed to assigned to the card TEI and Layer3 - All D-channel frames addressed to assigned to the card TEI and
SAPI of signalling protocol, and signalling protocol events. SAPI of signalling protocol, and signalling protocol events.
*/ */
typedef int (*DivaSTraceSetDChannel_proc_t)(void* hLib, int on); typedef int (*DivaSTraceSetDChannel_proc_t)(void *hLib, int on);
/* /*
Get overall card statistics Get overall card statistics
*/ */
typedef int (*DivaSTraceGetOutgoingCallStatistics_proc_t)(void* hLib); typedef int (*DivaSTraceGetOutgoingCallStatistics_proc_t)(void *hLib);
typedef int (*DivaSTraceGetIncomingCallStatistics_proc_t)(void* hLib); typedef int (*DivaSTraceGetIncomingCallStatistics_proc_t)(void *hLib);
typedef int (*DivaSTraceGetModemStatistics_proc_t)(void* hLib); typedef int (*DivaSTraceGetModemStatistics_proc_t)(void *hLib);
typedef int (*DivaSTraceGetFaxStatistics_proc_t)(void* hLib); typedef int (*DivaSTraceGetFaxStatistics_proc_t)(void *hLib);
typedef int (*DivaSTraceGetBLayer1Statistics_proc_t)(void* hLib); typedef int (*DivaSTraceGetBLayer1Statistics_proc_t)(void *hLib);
typedef int (*DivaSTraceGetBLayer2Statistics_proc_t)(void* hLib); typedef int (*DivaSTraceGetBLayer2Statistics_proc_t)(void *hLib);
typedef int (*DivaSTraceGetDLayer1Statistics_proc_t)(void* hLib); typedef int (*DivaSTraceGetDLayer1Statistics_proc_t)(void *hLib);
typedef int (*DivaSTraceGetDLayer2Statistics_proc_t)(void* hLib); typedef int (*DivaSTraceGetDLayer2Statistics_proc_t)(void *hLib);
/* /*
Call control Call control
*/ */
typedef int (*DivaSTraceClearCall_proc_t)(void* hLib, int Channel); typedef int (*DivaSTraceClearCall_proc_t)(void *hLib, int Channel);
typedef struct _diva_strace_library_interface { typedef struct _diva_strace_library_interface {
void* hLib; void *hLib;
DivaSTraceLibraryStart_proc_t DivaSTraceLibraryStart; DivaSTraceLibraryStart_proc_t DivaSTraceLibraryStart;
DivaSTraceLibraryStart_proc_t DivaSTraceLibraryStop; DivaSTraceLibraryStart_proc_t DivaSTraceLibraryStop;
DivaSTraceLibraryFinit_proc_t DivaSTraceLibraryFinit; DivaSTraceLibraryFinit_proc_t DivaSTraceLibraryFinit;
@@ -323,14 +323,13 @@ typedef struct _diva_strace_library_interface {
/* /*
Create and return Library interface Create and return Library interface
*/ */
diva_strace_library_interface_t* DivaSTraceLibraryCreateInstance (int Adapter, diva_strace_library_interface_t *DivaSTraceLibraryCreateInstance(int Adapter,
const diva_trace_library_user_interface_t* user_proc, const diva_trace_library_user_interface_t *user_proc,
byte* pmem); byte *pmem);
dword DivaSTraceGetMemotyRequirement (int channels); dword DivaSTraceGetMemotyRequirement(int channels);
#define DIVA_MAX_ADAPTERS 64 #define DIVA_MAX_ADAPTERS 64
#define DIVA_MAX_LINES 32 #define DIVA_MAX_LINES 32
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@@ -25,28 +25,28 @@
#ifndef __DIVA_EICON_TRACE_IDI_IFC_H__ #ifndef __DIVA_EICON_TRACE_IDI_IFC_H__
#define __DIVA_EICON_TRACE_IDI_IFC_H__ #define __DIVA_EICON_TRACE_IDI_IFC_H__
void* SuperTraceOpenAdapter (int AdapterNumber); void *SuperTraceOpenAdapter(int AdapterNumber);
int SuperTraceCloseAdapter (void* AdapterHandle); int SuperTraceCloseAdapter(void *AdapterHandle);
int SuperTraceWrite (void* AdapterHandle, int SuperTraceWrite(void *AdapterHandle,
const void* data, int length); const void *data, int length);
int SuperTraceReadRequest (void* AdapterHandle,const char* name,byte* data); int SuperTraceReadRequest(void *AdapterHandle, const char *name, byte *data);
int SuperTraceGetNumberOfChannels (void* AdapterHandle); int SuperTraceGetNumberOfChannels(void *AdapterHandle);
int SuperTraceASSIGN (void* AdapterHandle, byte* data); int SuperTraceASSIGN(void *AdapterHandle, byte *data);
int SuperTraceREMOVE (void* AdapterHandle); int SuperTraceREMOVE(void *AdapterHandle);
int SuperTraceTraceOnRequest(void* hAdapter, const char* name, byte* data); int SuperTraceTraceOnRequest(void *hAdapter, const char *name, byte *data);
int SuperTraceWriteVar (void* AdapterHandle, int SuperTraceWriteVar(void *AdapterHandle,
byte* data, byte *data,
const char* name, const char *name,
void* var, void *var,
byte type, byte type,
byte var_length); byte var_length);
int SuperTraceExecuteRequest (void* AdapterHandle, int SuperTraceExecuteRequest(void *AdapterHandle,
const char* name, const char *name,
byte* data); byte *data);
typedef struct _diva_strace_path2action { typedef struct _diva_strace_path2action {
char path[64]; /* Full path to variable */ char path[64]; /* Full path to variable */
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 #define DIVA_MAX_MANAGEMENT_TRANSFER_SIZE 4096
@@ -55,7 +55,7 @@ typedef struct _diva_strace_context {
diva_strace_library_interface_t instance; diva_strace_library_interface_t instance;
int Adapter; int Adapter;
void* hAdapter; void *hAdapter;
int Channels; int Channels;
int req_busy; int req_busy;
@@ -112,7 +112,7 @@ typedef struct _diva_strace_context {
int parse_entries; int parse_entries;
int cur_parse_entry; int cur_parse_entry;
diva_strace_path2action_t* parse_table; diva_strace_path2action_t *parse_table;
diva_trace_library_user_interface_t user_proc_table; diva_trace_library_user_interface_t user_proc_table;
@@ -169,4 +169,3 @@ typedef struct _diva_man_var_header {
} diva_man_var_header_t; } diva_man_var_header_t;
#endif #endif

View File

@@ -30,9 +30,9 @@
#define DSP_UDATA_INDICATION_CTS_OFF 0x03 #define DSP_UDATA_INDICATION_CTS_OFF 0x03
#define DSP_UDATA_INDICATION_CTS_ON 0x04 #define DSP_UDATA_INDICATION_CTS_ON 0x04
/* ===================================================================== /* =====================================================================
DCD_OFF Message: DCD_OFF Message:
<word> time of DCD off (sampled from counter at 8kHz) <word> time of DCD off (sampled from counter at 8kHz)
DCD_ON Message: DCD_ON Message:
<word> time of DCD on (sampled from counter at 8kHz) <word> time of DCD on (sampled from counter at 8kHz)
<byte> connected norm <byte> connected norm
<word> connected options <word> connected options
@@ -129,14 +129,14 @@ DCD_ON Message:
#define DSP_CONNECTED_OPTION_MASK_COMPRESSION 0x0320 #define DSP_CONNECTED_OPTION_MASK_COMPRESSION 0x0320
#define DSP_UDATA_INDICATION_DISCONNECT 5 #define DSP_UDATA_INDICATION_DISCONNECT 5
/* /*
returns: returns:
<byte> cause <byte> cause
*/ */
/* ========================================================== /* ==========================================================
DLC: B2 modem configuration DLC: B2 modem configuration
========================================================== */ ========================================================== */
/* /*
Fields in assign DLC information element for modem protocol V.42/MNP: Fields in assign DLC information element for modem protocol V.42/MNP:
<byte> length of information element <byte> length of information element
<word> information field length <word> information field length
<byte> address A (not used, default 3) <byte> address A (not used, default 3)
@@ -175,7 +175,7 @@ Fields in assign DLC information element for modem protocol V.42/MNP:
CAI parameters used for the modem L1 configuration CAI parameters used for the modem L1 configuration
========================================================== */ ========================================================== */
/* /*
Fields in assign CAI information element: Fields in assign CAI information element:
<byte> length of information element <byte> length of information element
<byte> info field and B-channel hardware <byte> info field and B-channel hardware
<byte> rate adaptation bit rate <byte> rate adaptation bit rate

File diff suppressed because it is too large Load Diff

View File

@@ -89,7 +89,7 @@ struct mp_load {
dword volatile TrapId; /* has value 0x999999XX on a CPU trap */ dword volatile TrapId; /* has value 0x999999XX on a CPU trap */
dword volatile res2[0x03]; dword volatile res2[0x03];
MP_XCPTC volatile xcpt; /* contains register dump */ MP_XCPTC volatile xcpt; /* contains register dump */
dword volatile rest[((0x1020>>2)-6) - 0x1b - 1 - 0x03 - (sizeof(MP_XCPTC)>>2)]; dword volatile rest[((0x1020 >> 2) - 6) - 0x1b - 1 - 0x03 - (sizeof(MP_XCPTC) >> 2)];
dword volatile signature; dword volatile signature;
dword data[60000]; /* real interface description */ dword data[60000]; /* real interface description */
}; };
@@ -154,7 +154,7 @@ struct mp_load {
/* /*
* GT64010 internal registers * GT64010 internal registers
*/ */
/* DRAM device coding */ /* DRAM device coding */
#define LOW_RAS0_DREG 0x0400 /*Ras0 low decode address*/ #define LOW_RAS0_DREG 0x0400 /*Ras0 low decode address*/
#define HI_RAS0_DREG 0x0404 /*Ras0 high decode address*/ #define HI_RAS0_DREG 0x0404 /*Ras0 high decode address*/
#define LOW_RAS1_DREG 0x0408 /*Ras1 low decode address*/ #define LOW_RAS1_DREG 0x0408 /*Ras1 low decode address*/
@@ -163,7 +163,7 @@ struct mp_load {
#define HI_RAS2_DREG 0x0414 /*Ras2 high decode address*/ #define HI_RAS2_DREG 0x0414 /*Ras2 high decode address*/
#define LOW_RAS3_DREG 0x0418 /*Ras3 low decode address*/ #define LOW_RAS3_DREG 0x0418 /*Ras3 low decode address*/
#define HI_RAS3_DREG 0x041c /*Ras3 high decode address*/ #define HI_RAS3_DREG 0x041c /*Ras3 high decode address*/
/* I/O CS device coding */ /* I/O CS device coding */
#define LOW_CS0_DREG 0x0420 /* CS0* low decode register */ #define LOW_CS0_DREG 0x0420 /* CS0* low decode register */
#define HI_CS0_DREG 0x0424 /* CS0* high decode register */ #define HI_CS0_DREG 0x0424 /* CS0* high decode register */
#define LOW_CS1_DREG 0x0428 /* CS1* low decode register */ #define LOW_CS1_DREG 0x0428 /* CS1* low decode register */
@@ -172,20 +172,20 @@ struct mp_load {
#define HI_CS2_DREG 0x0434 /* CS2* high decode register */ #define HI_CS2_DREG 0x0434 /* CS2* high decode register */
#define LOW_CS3_DREG 0x0438 /* CS3* low decode register */ #define LOW_CS3_DREG 0x0438 /* CS3* low decode register */
#define HI_CS3_DREG 0x043c /* CS3* high decode register */ #define HI_CS3_DREG 0x043c /* CS3* high decode register */
/* Boot PROM device coding */ /* Boot PROM device coding */
#define LOW_BOOTCS_DREG 0x0440 /* Boot CS low decode register */ #define LOW_BOOTCS_DREG 0x0440 /* Boot CS low decode register */
#define HI_BOOTCS_DREG 0x0444 /* Boot CS High decode register */ #define HI_BOOTCS_DREG 0x0444 /* Boot CS High decode register */
/* DRAM group coding (for CPU) */ /* DRAM group coding (for CPU) */
#define LO_RAS10_GREG 0x0008 /*Ras1..0 group low decode address*/ #define LO_RAS10_GREG 0x0008 /*Ras1..0 group low decode address*/
#define HI_RAS10_GREG 0x0010 /*Ras1..0 group high decode address*/ #define HI_RAS10_GREG 0x0010 /*Ras1..0 group high decode address*/
#define LO_RAS32_GREG 0x0018 /*Ras3..2 group low decode address */ #define LO_RAS32_GREG 0x0018 /*Ras3..2 group low decode address */
#define HI_RAS32_GREG 0x0020 /*Ras3..2 group high decode address */ #define HI_RAS32_GREG 0x0020 /*Ras3..2 group high decode address */
/* I/O CS group coding for (CPU) */ /* I/O CS group coding for (CPU) */
#define LO_CS20_GREG 0x0028 /* CS2..0 group low decode register */ #define LO_CS20_GREG 0x0028 /* CS2..0 group low decode register */
#define HI_CS20_GREG 0x0030 /* CS2..0 group high decode register */ #define HI_CS20_GREG 0x0030 /* CS2..0 group high decode register */
#define LO_CS3B_GREG 0x0038 /* CS3 & PROM group low decode register */ #define LO_CS3B_GREG 0x0038 /* CS3 & PROM group low decode register */
#define HI_CS3B_GREG 0x0040 /* CS3 & PROM group high decode register */ #define HI_CS3B_GREG 0x0040 /* CS3 & PROM group high decode register */
/* Galileo specific PCI config. */ /* Galileo specific PCI config. */
#define PCI_TIMEOUT_RET 0x0c04 /* Time Out and retry register */ #define PCI_TIMEOUT_RET 0x0c04 /* Time Out and retry register */
#define RAS10_BANKSIZE 0x0c08 /* RAS 1..0 group PCI bank size */ #define RAS10_BANKSIZE 0x0c08 /* RAS 1..0 group PCI bank size */
#define RAS32_BANKSIZE 0x0c0c /* RAS 3..2 group PCI bank size */ #define RAS32_BANKSIZE 0x0c0c /* RAS 3..2 group PCI bank size */

View File

@@ -27,7 +27,7 @@ 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 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);
@@ -44,7 +44,7 @@ static void no_printf(unsigned char *x, ...)
/* /*
* DIDD callback function * DIDD callback function
*/ */
static void *didd_callback(void *context, DESCRIPTOR * adapter, static void *didd_callback(void *context, DESCRIPTOR *adapter,
int removal) int removal)
{ {
if (adapter->type == IDI_DADAPTER) { if (adapter->type == IDI_DADAPTER) {
@@ -90,7 +90,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
req.didd_notify.info.callback = (void *)didd_callback; req.didd_notify.info.callback = (void *)didd_callback;
req.didd_notify.info.context = NULL; req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
if (req.didd_notify.e.Rc != 0xff) if (req.didd_notify.e.Rc != 0xff)
return (0); return (0);
notify_handle = req.didd_notify.info.handle; notify_handle = req.didd_notify.info.handle;
@@ -100,7 +100,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
IDI_SYNC_REQ_DIDD_ADD_ADAPTER; IDI_SYNC_REQ_DIDD_ADD_ADAPTER;
req.didd_add_adapter.info.descriptor = req.didd_add_adapter.info.descriptor =
(void *) &MaintDescriptor; (void *) &MaintDescriptor;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
if (req.didd_add_adapter.e.Rc != 0xff) if (req.didd_add_adapter.e.Rc != 0xff)
return (0); return (0);
} else if ((DIDD_Table[x].type > 0) } else if ((DIDD_Table[x].type > 0)
@@ -121,13 +121,13 @@ static void DIVA_EXIT_FUNCTION disconnect_didd(void)
req.didd_notify.e.Req = 0; req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY; req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY;
req.didd_notify.info.handle = notify_handle; req.didd_notify.info.handle = notify_handle;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
req.didd_remove_adapter.e.Req = 0; req.didd_remove_adapter.e.Req = 0;
req.didd_remove_adapter.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER; req.didd_remove_adapter.e.Rc = IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER;
req.didd_remove_adapter.info.p_request = req.didd_remove_adapter.info.p_request =
(IDI_CALL) MaintDescriptor.request; (IDI_CALL) MaintDescriptor.request;
DAdapter.request((ENTITY *) & req); DAdapter.request((ENTITY *)&req);
} }
/* /*
@@ -147,9 +147,9 @@ int maint_read_write(void __user *buf, int count)
return (-EFAULT); return (-EFAULT);
} }
cmd = *(dword *) & data[0]; /* command */ cmd = *(dword *)&data[0]; /* command */
id = *(dword *) & data[4]; /* driver id */ id = *(dword *)&data[4]; /* driver id */
mask = *(dword *) & data[8]; /* mask or size */ mask = *(dword *)&data[8]; /* mask or size */
switch (cmd) { switch (cmd) {
case DITRACE_CMD_GET_DRIVER_INFO: case DITRACE_CMD_GET_DRIVER_INFO:
@@ -185,12 +185,12 @@ int maint_read_write(void __user *buf, int count)
*/ */
case DITRACE_WRITE_SELECTIVE_TRACE_FILTER: case DITRACE_WRITE_SELECTIVE_TRACE_FILTER:
if (!mask) { if (!mask) {
ret = diva_set_trace_filter (1, "*"); ret = diva_set_trace_filter(1, "*");
} else if (mask < sizeof(data)) { } else if (mask < sizeof(data)) {
if (diva_os_copy_from_user(NULL, data, (char __user *)buf+12, mask)) { if (diva_os_copy_from_user(NULL, data, (char __user *)buf + 12, mask)) {
ret = -EFAULT; ret = -EFAULT;
} else { } else {
ret = diva_set_trace_filter ((int)mask, data); ret = diva_set_trace_filter((int)mask, data);
} }
} else { } else {
ret = -EINVAL; ret = -EINVAL;
@@ -198,8 +198,8 @@ int maint_read_write(void __user *buf, int count)
break; break;
case DITRACE_READ_SELECTIVE_TRACE_FILTER: case DITRACE_READ_SELECTIVE_TRACE_FILTER:
if ((ret = diva_get_trace_filter (sizeof(data), data)) > 0) { if ((ret = diva_get_trace_filter(sizeof(data), data)) > 0) {
if (diva_os_copy_to_user (NULL, buf, data, ret)) if (diva_os_copy_to_user(NULL, buf, data, ret))
ret = -EFAULT; ret = -EFAULT;
} else { } else {
ret = -ENODEV; ret = -ENODEV;
@@ -216,7 +216,7 @@ int maint_read_write(void __user *buf, int count)
return (-ENOMEM); return (-ENOMEM);
} }
for(;;) { for (;;) {
if (!(pmsg = if (!(pmsg =
diva_maint_get_message(&size, &old_irql))) { diva_maint_get_message(&size, &old_irql))) {
break; break;
@@ -230,7 +230,7 @@ int maint_read_write(void __user *buf, int count)
memcpy(pbuf, pmsg, size); memcpy(pbuf, pmsg, size);
diva_maint_ack_message(1, &old_irql); diva_maint_ack_message(1, &old_irql);
if ((count < size) || if ((count < size) ||
diva_os_copy_to_user (NULL, buf, (void *) pbuf, size)) diva_os_copy_to_user(NULL, buf, (void *) pbuf, size))
ret = -EFAULT; ret = -EFAULT;
break; break;
} }
@@ -316,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 (0, *buffer_length)))) { (!(*buffer = diva_os_malloc(0, *buffer_length)))) {
*buffer_length -= 1024; *buffer_length -= 1024;
} }
@@ -328,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 (0, *buffer); diva_os_free(0, *buffer);
} }
DBG_ERR(("init: maint init failed")); DBG_ERR(("init: maint init failed"));
return (0); return (0);
@@ -338,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 (0, *buffer); diva_os_free(0, *buffer);
} }
return (0); return (0);
} }
@@ -362,7 +362,7 @@ void DIVA_EXIT_FUNCTION mntfunc_finit(void)
disconnect_didd(); disconnect_didd();
if ((buffer = diva_maint_finit())) { if ((buffer = diva_maint_finit())) {
diva_os_free (0, buffer); diva_os_free(0, buffer);
} }
memset(&MAdapter, 0, sizeof(MAdapter)); memset(&MAdapter, 0, sizeof(MAdapter));

View File

@@ -27,12 +27,12 @@ static dword diva_xdiLoadFileLength = 0;
extern void prepare_qBri_functions(PISDN_ADAPTER IoAdapter); extern void prepare_qBri_functions(PISDN_ADAPTER IoAdapter);
extern void prepare_qBri2_functions(PISDN_ADAPTER IoAdapter); extern void prepare_qBri2_functions(PISDN_ADAPTER IoAdapter);
extern void diva_xdi_display_adapter_features(int card); extern void diva_xdi_display_adapter_features(int card);
extern void diva_add_slave_adapter(diva_os_xdi_adapter_t * a); extern void diva_add_slave_adapter(diva_os_xdi_adapter_t *a);
extern int qBri_FPGA_download(PISDN_ADAPTER IoAdapter); extern int qBri_FPGA_download(PISDN_ADAPTER IoAdapter);
extern void start_qBri_hardware(PISDN_ADAPTER IoAdapter); extern void start_qBri_hardware(PISDN_ADAPTER IoAdapter);
extern int diva_card_read_xlog(diva_os_xdi_adapter_t * a); extern int diva_card_read_xlog(diva_os_xdi_adapter_t *a);
/* /*
** LOCALS ** LOCALS
@@ -57,23 +57,23 @@ static unsigned long _4bri_v2_bri_bar_length[4] = {
}; };
static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a); static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t *a);
static int _4bri_get_serial_number(diva_os_xdi_adapter_t * a); static int _4bri_get_serial_number(diva_os_xdi_adapter_t *a);
static int diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a, static int diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
diva_xdi_um_cfg_cmd_t * cmd, diva_xdi_um_cfg_cmd_t *cmd,
int length); int length);
static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t * a); static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t *a);
static int diva_4bri_write_fpga_image(diva_os_xdi_adapter_t * a, static int diva_4bri_write_fpga_image(diva_os_xdi_adapter_t *a,
byte * data, dword length); byte *data, dword length);
static int diva_4bri_reset_adapter(PISDN_ADAPTER IoAdapter); static int diva_4bri_reset_adapter(PISDN_ADAPTER IoAdapter);
static int diva_4bri_write_sdram_block(PISDN_ADAPTER IoAdapter, static int diva_4bri_write_sdram_block(PISDN_ADAPTER IoAdapter,
dword address, dword address,
const byte * data, const byte *data,
dword length, dword limit); dword length, dword limit);
static int diva_4bri_start_adapter(PISDN_ADAPTER IoAdapter, static int diva_4bri_start_adapter(PISDN_ADAPTER IoAdapter,
dword start_address, dword features); dword start_address, dword features);
static int check_qBri_interrupt(PISDN_ADAPTER IoAdapter); static int check_qBri_interrupt(PISDN_ADAPTER IoAdapter);
static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t * a); static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t *a);
static int _4bri_is_rev_2_card(int card_ordinal) static int _4bri_is_rev_2_card(int card_ordinal)
{ {
@@ -141,7 +141,7 @@ static void diva_4bri_set_addresses(diva_os_xdi_adapter_t *a)
** **
** Called by master adapter, that will initialize and add slave adapters ** Called by master adapter, that will initialize and add slave adapters
*/ */
int diva_4bri_init_card(diva_os_xdi_adapter_t * a) int diva_4bri_init_card(diva_os_xdi_adapter_t *a)
{ {
int bar, i; int bar, i;
byte __iomem *p; byte __iomem *p;
@@ -370,7 +370,7 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
strcpy(diva_current->xdi_adapter.req_soft_isr. dpc_thread_name, "kdivas4brid"); strcpy(diva_current->xdi_adapter.req_soft_isr. dpc_thread_name, "kdivas4brid");
if (diva_os_initialize_soft_isr (&diva_current->xdi_adapter.req_soft_isr, DIDpcRoutine, if (diva_os_initialize_soft_isr(&diva_current->xdi_adapter.req_soft_isr, DIDpcRoutine,
&diva_current->xdi_adapter)) { &diva_current->xdi_adapter)) {
diva_4bri_cleanup_slave_adapters(a); diva_4bri_cleanup_slave_adapters(a);
diva_4bri_cleanup_adapter(a); diva_4bri_cleanup_adapter(a);
@@ -466,7 +466,7 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
** this is guaranteed by design: cleanup callback is set ** this is guaranteed by design: cleanup callback is set
** by master adapter only ** by master adapter only
*/ */
static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a) static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t *a)
{ {
int bar; int bar;
@@ -526,7 +526,7 @@ static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
return (0); return (0);
} }
static int _4bri_get_serial_number(diva_os_xdi_adapter_t * a) static int _4bri_get_serial_number(diva_os_xdi_adapter_t *a)
{ {
dword data[64]; dword data[64];
dword serNo; dword serNo;
@@ -578,7 +578,7 @@ static int _4bri_get_serial_number(diva_os_xdi_adapter_t * a)
/* /*
** Release resources of slave adapters ** Release resources of slave adapters
*/ */
static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t * a) static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t *a)
{ {
diva_os_xdi_adapter_t *adapter_list[4]; diva_os_xdi_adapter_t *adapter_list[4];
diva_os_xdi_adapter_t *diva_current; diva_os_xdi_adapter_t *diva_current;
@@ -625,7 +625,7 @@ static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t * a)
static int static int
diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a, diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
diva_xdi_um_cfg_cmd_t * cmd, int length) diva_xdi_um_cfg_cmd_t *cmd, int length)
{ {
int ret = -1; int ret = -1;
@@ -710,7 +710,7 @@ diva_4bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
if (!a->xdi_adapter.ControllerNumber) { if (!a->xdi_adapter.ControllerNumber) {
ret = ret =
diva_4bri_write_fpga_image(a, diva_4bri_write_fpga_image(a,
(byte *) & cmd[1], (byte *)&cmd[1],
cmd->command_data. cmd->command_data.
write_fpga. write_fpga.
image_length); image_length);
@@ -838,7 +838,7 @@ void diva_os_set_qBri2_functions(PISDN_ADAPTER IoAdapter)
} }
static int static int
diva_4bri_write_fpga_image(diva_os_xdi_adapter_t * a, byte * data, diva_4bri_write_fpga_image(diva_os_xdi_adapter_t *a, byte *data,
dword length) dword length)
{ {
int ret; int ret;
@@ -908,7 +908,7 @@ static int diva_4bri_reset_adapter(PISDN_ADAPTER IoAdapter)
static int static int
diva_4bri_write_sdram_block(PISDN_ADAPTER IoAdapter, diva_4bri_write_sdram_block(PISDN_ADAPTER IoAdapter,
dword address, dword address,
const byte * data, dword length, dword limit) const byte *data, dword length, dword limit)
{ {
byte __iomem *p = DIVA_OS_MEM_ATTACH_ADDRESS(IoAdapter); byte __iomem *p = DIVA_OS_MEM_ATTACH_ADDRESS(IoAdapter);
byte __iomem *mem = p; byte __iomem *mem = p;
@@ -1056,7 +1056,7 @@ static int check_qBri_interrupt(PISDN_ADAPTER IoAdapter)
#endif /* SUPPORT_INTERRUPT_TEST_ON_4BRI */ #endif /* SUPPORT_INTERRUPT_TEST_ON_4BRI */
} }
static void diva_4bri_clear_interrupts(diva_os_xdi_adapter_t * a) static void diva_4bri_clear_interrupts(diva_os_xdi_adapter_t *a)
{ {
PISDN_ADAPTER IoAdapter = &a->xdi_adapter; PISDN_ADAPTER IoAdapter = &a->xdi_adapter;
@@ -1076,7 +1076,7 @@ static void diva_4bri_clear_interrupts(diva_os_xdi_adapter_t * a)
diva_os_cancel_soft_isr(&IoAdapter->isr_soft_isr); diva_os_cancel_soft_isr(&IoAdapter->isr_soft_isr);
} }
static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t * a) static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t *a)
{ {
PISDN_ADAPTER IoAdapter = &a->xdi_adapter; PISDN_ADAPTER IoAdapter = &a->xdi_adapter;
int i; int i;

View File

@@ -3,6 +3,6 @@
#ifndef __DIVA_OS_4_BRI_H__ #ifndef __DIVA_OS_4_BRI_H__
#define __DIVA_OS_4_BRI_H__ #define __DIVA_OS_4_BRI_H__
int diva_4bri_init_card(diva_os_xdi_adapter_t * a); int diva_4bri_init_card(diva_os_xdi_adapter_t *a);
#endif #endif

View File

@@ -23,7 +23,7 @@
*/ */
extern void prepare_maestra_functions(PISDN_ADAPTER IoAdapter); extern void prepare_maestra_functions(PISDN_ADAPTER IoAdapter);
extern void diva_xdi_display_adapter_features(int card); extern void diva_xdi_display_adapter_features(int card);
extern int diva_card_read_xlog(diva_os_xdi_adapter_t * a); extern int diva_card_read_xlog(diva_os_xdi_adapter_t *a);
/* /*
** LOCALS ** LOCALS
@@ -33,20 +33,20 @@ static int bri_bar_length[3] = {
0x80, 0x80,
0x20 0x20
}; };
static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t * a); static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t *a);
static dword diva_bri_get_serial_number(diva_os_xdi_adapter_t * a); static dword diva_bri_get_serial_number(diva_os_xdi_adapter_t *a);
static int diva_bri_cmd_card_proc(struct _diva_os_xdi_adapter *a, static int diva_bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
diva_xdi_um_cfg_cmd_t * cmd, int length); diva_xdi_um_cfg_cmd_t *cmd, int length);
static int diva_bri_reregister_io(diva_os_xdi_adapter_t * a); static int diva_bri_reregister_io(diva_os_xdi_adapter_t *a);
static int diva_bri_reset_adapter(PISDN_ADAPTER IoAdapter); static int diva_bri_reset_adapter(PISDN_ADAPTER IoAdapter);
static int diva_bri_write_sdram_block(PISDN_ADAPTER IoAdapter, static int diva_bri_write_sdram_block(PISDN_ADAPTER IoAdapter,
dword address, dword address,
const byte * data, dword length); const byte *data, dword length);
static int diva_bri_start_adapter(PISDN_ADAPTER IoAdapter, static int diva_bri_start_adapter(PISDN_ADAPTER IoAdapter,
dword start_address, dword features); dword start_address, dword features);
static int diva_bri_stop_adapter(diva_os_xdi_adapter_t * a); static int diva_bri_stop_adapter(diva_os_xdi_adapter_t *a);
static void diva_bri_set_addresses(diva_os_xdi_adapter_t * a) static void diva_bri_set_addresses(diva_os_xdi_adapter_t *a)
{ {
a->resources.pci.mem_type_id[MEM_TYPE_RAM] = 0; a->resources.pci.mem_type_id[MEM_TYPE_RAM] = 0;
a->resources.pci.mem_type_id[MEM_TYPE_CFG] = 1; a->resources.pci.mem_type_id[MEM_TYPE_CFG] = 1;
@@ -72,7 +72,7 @@ static void diva_bri_set_addresses(diva_os_xdi_adapter_t * a)
** BAR1 - I/O Addr - 0x80 ** BAR1 - I/O Addr - 0x80
** BAR2 - I/O Addr - 0x20 ** BAR2 - I/O Addr - 0x20
*/ */
int diva_bri_init_card(diva_os_xdi_adapter_t * a) int diva_bri_init_card(diva_os_xdi_adapter_t *a)
{ {
int bar; int bar;
dword bar2 = 0, bar2_length = 0xffffffff; dword bar2 = 0, bar2_length = 0xffffffff;
@@ -265,7 +265,7 @@ int diva_bri_init_card(diva_os_xdi_adapter_t * a)
} }
static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t * a) static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t *a)
{ {
int i; int i;
@@ -329,7 +329,7 @@ void diva_os_prepare_maestra_functions(PISDN_ADAPTER IoAdapter)
/* /*
** Get serial number ** Get serial number
*/ */
static dword diva_bri_get_serial_number(diva_os_xdi_adapter_t * a) static dword diva_bri_get_serial_number(diva_os_xdi_adapter_t *a)
{ {
dword serNo = 0; dword serNo = 0;
byte __iomem *confIO; byte __iomem *confIO;
@@ -361,7 +361,7 @@ static dword diva_bri_get_serial_number(diva_os_xdi_adapter_t * a)
** Unregister I/O and register it with new name, ** Unregister I/O and register it with new name,
** based on Serial Number ** based on Serial Number
*/ */
static int diva_bri_reregister_io(diva_os_xdi_adapter_t * a) static int diva_bri_reregister_io(diva_os_xdi_adapter_t *a)
{ {
int i; int i;
@@ -394,7 +394,7 @@ static int diva_bri_reregister_io(diva_os_xdi_adapter_t * a)
*/ */
static int static int
diva_bri_cmd_card_proc(struct _diva_os_xdi_adapter *a, diva_bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
diva_xdi_um_cfg_cmd_t * cmd, int length) diva_xdi_um_cfg_cmd_t *cmd, int length)
{ {
int ret = -1; int ret = -1;
@@ -474,7 +474,7 @@ diva_bri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
ret = diva_bri_write_sdram_block(&a->xdi_adapter, ret = diva_bri_write_sdram_block(&a->xdi_adapter,
cmd->command_data. cmd->command_data.
write_sdram.offset, write_sdram.offset,
(byte *) & cmd[1], (byte *)&cmd[1],
cmd->command_data. cmd->command_data.
write_sdram.length); write_sdram.length);
break; break;
@@ -602,7 +602,7 @@ static int diva_bri_reset_adapter(PISDN_ADAPTER IoAdapter)
static int static int
diva_bri_write_sdram_block(PISDN_ADAPTER IoAdapter, diva_bri_write_sdram_block(PISDN_ADAPTER IoAdapter,
dword address, const byte * data, dword length) dword address, const byte *data, dword length)
{ {
byte __iomem *addrHi, *addrLo, *ioaddr; byte __iomem *addrHi, *addrLo, *ioaddr;
byte __iomem *Port; byte __iomem *Port;
@@ -745,7 +745,7 @@ diva_bri_start_adapter(PISDN_ADAPTER IoAdapter,
return (0); return (0);
} }
static void diva_bri_clear_interrupts(diva_os_xdi_adapter_t * a) static void diva_bri_clear_interrupts(diva_os_xdi_adapter_t *a)
{ {
PISDN_ADAPTER IoAdapter = &a->xdi_adapter; PISDN_ADAPTER IoAdapter = &a->xdi_adapter;
@@ -768,7 +768,7 @@ static void diva_bri_clear_interrupts(diva_os_xdi_adapter_t * a)
/* /*
** Stop card ** Stop card
*/ */
static int diva_bri_stop_adapter(diva_os_xdi_adapter_t * a) static int diva_bri_stop_adapter(diva_os_xdi_adapter_t *a)
{ {
PISDN_ADAPTER IoAdapter = &a->xdi_adapter; PISDN_ADAPTER IoAdapter = &a->xdi_adapter;
int i = 100; int i = 100;

View File

@@ -3,6 +3,6 @@
#ifndef __DIVA_OS_BRI_REV_1_H__ #ifndef __DIVA_OS_BRI_REV_1_H__
#define __DIVA_OS_BRI_REV_1_H__ #define __DIVA_OS_BRI_REV_1_H__
int diva_bri_init_card(diva_os_xdi_adapter_t * a); int diva_bri_init_card(diva_os_xdi_adapter_t *a);
#endif #endif

View File

@@ -24,11 +24,11 @@
OS Dependent part of XDI driver for DIVA PRI Adapter OS Dependent part of XDI driver for DIVA PRI Adapter
DSP detection/validation by Anthony Booth (Eicon Networks, www.eicon.com) DSP detection/validation by Anthony Booth (Eicon Networks, www.eicon.com)
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#define DIVA_PRI_NO_PCI_BIOS_WORKAROUND 1 #define DIVA_PRI_NO_PCI_BIOS_WORKAROUND 1
extern int diva_card_read_xlog(diva_os_xdi_adapter_t * a); extern int diva_card_read_xlog(diva_os_xdi_adapter_t *a);
/* /*
** IMPORTS ** IMPORTS
@@ -37,12 +37,12 @@ extern void prepare_pri_functions(PISDN_ADAPTER IoAdapter);
extern void prepare_pri2_functions(PISDN_ADAPTER IoAdapter); extern void prepare_pri2_functions(PISDN_ADAPTER IoAdapter);
extern void diva_xdi_display_adapter_features(int card); extern void diva_xdi_display_adapter_features(int card);
static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t * a); static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t *a);
static int diva_pri_cmd_card_proc(struct _diva_os_xdi_adapter *a, static int diva_pri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
diva_xdi_um_cfg_cmd_t * cmd, int length); diva_xdi_um_cfg_cmd_t *cmd, int length);
static int pri_get_serial_number(diva_os_xdi_adapter_t * a); static int pri_get_serial_number(diva_os_xdi_adapter_t *a);
static int diva_pri_stop_adapter(diva_os_xdi_adapter_t * a); static int diva_pri_stop_adapter(diva_os_xdi_adapter_t *a);
static dword diva_pri_detect_dsps(diva_os_xdi_adapter_t * a); static dword diva_pri_detect_dsps(diva_os_xdi_adapter_t *a);
/* /*
** Check card revision ** Check card revision
@@ -57,7 +57,7 @@ static int pri_is_rev_2_card(int card_ordinal)
return (0); return (0);
} }
static void diva_pri_set_addresses(diva_os_xdi_adapter_t * a) static void diva_pri_set_addresses(diva_os_xdi_adapter_t *a)
{ {
a->resources.pci.mem_type_id[MEM_TYPE_ADDRESS] = 0; a->resources.pci.mem_type_id[MEM_TYPE_ADDRESS] = 0;
a->resources.pci.mem_type_id[MEM_TYPE_CONTROL] = 2; a->resources.pci.mem_type_id[MEM_TYPE_CONTROL] = 2;
@@ -92,7 +92,7 @@ static void diva_pri_set_addresses(diva_os_xdi_adapter_t * a)
** BAR3 - FLASH (REG), 0x8000 ** BAR3 - FLASH (REG), 0x8000
** BAR4 - CONFIG (CFG), 0x1000 ** BAR4 - CONFIG (CFG), 0x1000
*/ */
int diva_pri_init_card(diva_os_xdi_adapter_t * a) int diva_pri_init_card(diva_os_xdi_adapter_t *a)
{ {
int bar = 0; int bar = 0;
int pri_rev_2; int pri_rev_2;
@@ -257,7 +257,7 @@ int diva_pri_init_card(diva_os_xdi_adapter_t * a)
return (0); return (0);
} }
static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t * a) static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t *a)
{ {
int bar = 0; int bar = 0;
@@ -407,7 +407,7 @@ static int diva_pri_reset_adapter(PISDN_ADAPTER IoAdapter)
static int static int
diva_pri_write_sdram_block(PISDN_ADAPTER IoAdapter, diva_pri_write_sdram_block(PISDN_ADAPTER IoAdapter,
dword address, dword address,
const byte * data, dword length, dword limit) const byte *data, dword length, dword limit)
{ {
byte __iomem *p = DIVA_OS_MEM_ATTACH_ADDRESS(IoAdapter); byte __iomem *p = DIVA_OS_MEM_ATTACH_ADDRESS(IoAdapter);
byte __iomem *mem = p; byte __iomem *mem = p;
@@ -494,7 +494,7 @@ diva_pri_start_adapter(PISDN_ADAPTER IoAdapter,
*/ */
IoAdapter->IrqCount = 0; IoAdapter->IrqCount = 0;
p = DIVA_OS_MEM_ATTACH_CFG(IoAdapter); p = DIVA_OS_MEM_ATTACH_CFG(IoAdapter);
WRITE_DWORD(p, (dword) ~ 0x03E00000); WRITE_DWORD(p, (dword)~0x03E00000);
DIVA_OS_MEM_DETACH_CFG(IoAdapter, p); DIVA_OS_MEM_DETACH_CFG(IoAdapter, p);
a->ReadyInt = 1; a->ReadyInt = 1;
a->ram_out(a, &PR_RAM->ReadyInt, 1); a->ram_out(a, &PR_RAM->ReadyInt, 1);
@@ -522,7 +522,7 @@ diva_pri_start_adapter(PISDN_ADAPTER IoAdapter,
return (0); return (0);
} }
static void diva_pri_clear_interrupts(diva_os_xdi_adapter_t * a) static void diva_pri_clear_interrupts(diva_os_xdi_adapter_t *a)
{ {
PISDN_ADAPTER IoAdapter = &a->xdi_adapter; PISDN_ADAPTER IoAdapter = &a->xdi_adapter;
@@ -546,7 +546,7 @@ static void diva_pri_clear_interrupts(diva_os_xdi_adapter_t * a)
** Stop Adapter, but do not unmap/unregister - adapter ** Stop Adapter, but do not unmap/unregister - adapter
** will be restarted later ** will be restarted later
*/ */
static int diva_pri_stop_adapter(diva_os_xdi_adapter_t * a) static int diva_pri_stop_adapter(diva_os_xdi_adapter_t *a)
{ {
PISDN_ADAPTER IoAdapter = &a->xdi_adapter; PISDN_ADAPTER IoAdapter = &a->xdi_adapter;
int i = 100; int i = 100;
@@ -600,7 +600,7 @@ static int diva_pri_stop_adapter(diva_os_xdi_adapter_t * a)
*/ */
static int static int
diva_pri_cmd_card_proc(struct _diva_os_xdi_adapter *a, diva_pri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
diva_xdi_um_cfg_cmd_t * cmd, int length) diva_xdi_um_cfg_cmd_t *cmd, int length)
{ {
int ret = -1; int ret = -1;
@@ -660,7 +660,7 @@ diva_pri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
ret = diva_pri_write_sdram_block(&a->xdi_adapter, ret = diva_pri_write_sdram_block(&a->xdi_adapter,
cmd->command_data. cmd->command_data.
write_sdram.offset, write_sdram.offset,
(byte *) & cmd[1], (byte *)&cmd[1],
cmd->command_data. cmd->command_data.
write_sdram.length, write_sdram.length,
pri_is_rev_2_card(a-> pri_is_rev_2_card(a->
@@ -761,7 +761,7 @@ diva_pri_cmd_card_proc(struct _diva_os_xdi_adapter *a,
/* /*
** Get Serial Number ** Get Serial Number
*/ */
static int pri_get_serial_number(diva_os_xdi_adapter_t * a) static int pri_get_serial_number(diva_os_xdi_adapter_t *a)
{ {
byte data[64]; byte data[64];
int i; int i;
@@ -909,7 +909,7 @@ void diva_os_prepare_pri_functions(PISDN_ADAPTER IoAdapter)
** Checks presence of DSP on board ** Checks presence of DSP on board
*/ */
static int static int
dsp_check_presence(volatile byte __iomem * addr, volatile byte __iomem * data, int dsp) dsp_check_presence(volatile byte __iomem *addr, volatile byte __iomem *data, int dsp)
{ {
word pattern; word pattern;
@@ -931,9 +931,9 @@ dsp_check_presence(volatile byte __iomem * addr, volatile byte __iomem * data, i
WRITE_WORD(addr, 0x4000); WRITE_WORD(addr, 0x4000);
pattern = READ_WORD(data); pattern = READ_WORD(data);
if (pattern != (word) ~ DSP_SIGNATURE_PROBE_WORD) { if (pattern != (word)~DSP_SIGNATURE_PROBE_WORD) {
DBG_ERR(("A: DSP[%d] %04x(is) != %04x(should)", DBG_ERR(("A: DSP[%d] %04x(is) != %04x(should)",
dsp, pattern, (word) ~ DSP_SIGNATURE_PROBE_WORD)) dsp, pattern, (word)~DSP_SIGNATURE_PROBE_WORD))
return (-2); return (-2);
} }
@@ -952,7 +952,7 @@ dsp_check_presence(volatile byte __iomem * addr, volatile byte __iomem * data, i
** ... ** ...
** Bit 29 - DSP30 ** Bit 29 - DSP30
*/ */
static dword diva_pri_detect_dsps(diva_os_xdi_adapter_t * a) static dword diva_pri_detect_dsps(diva_os_xdi_adapter_t *a)
{ {
byte __iomem *base; byte __iomem *base;
byte __iomem *p; byte __iomem *p;

View File

@@ -3,6 +3,6 @@
#ifndef __DIVA_OS_PRI_REV_1_H__ #ifndef __DIVA_OS_PRI_REV_1_H__
#define __DIVA_OS_PRI_REV_1_H__ #define __DIVA_OS_PRI_REV_1_H__
int diva_pri_init_card(diva_os_xdi_adapter_t * a); int diva_pri_init_card(diva_os_xdi_adapter_t *a);
#endif #endif

View File

@@ -64,7 +64,7 @@ struct dual
/* SWReg Values (0 means no command) */ /* SWReg Values (0 means no command) */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
#define SWREG_DIE_WITH_LEDON 0x01 #define SWREG_DIE_WITH_LEDON 0x01
#define SWREG_HALT_CPU 0x02 /* Push CPU into a while(1) loop */ #define SWREG_HALT_CPU 0x02 /* Push CPU into a while (1) loop */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* Id Fields Coding */ /* Id Fields Coding */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
@@ -273,7 +273,7 @@ struct dual
#define MORE 0xa0 /* more data */ #define MORE 0xa0 /* more data */
#define SDNCMPL 0xa1 /* sending complete */ #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 */
#define BC 0x04 /* Bearer Capability */ #define BC 0x04 /* Bearer Capability */
#define CAU 0x08 /* cause */ #define CAU 0x08 /* cause */
@@ -307,7 +307,7 @@ struct dual
#define NLC 0x21 /* network layer configuration */ #define NLC 0x21 /* network layer configuration */
#define REDIRECT_IE 0x22 /* redirection request/indication data */ #define REDIRECT_IE 0x22 /* redirection request/indication data */
#define REDIRECT_NET_IE 0x23 /* redirection network override 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 */
#define DATE 0x03 /* date */ #define DATE 0x03 /* date */
@@ -439,9 +439,9 @@ struct dual
#define PIAFS_UDATA_ABILITY_DCDON 0x01 #define PIAFS_UDATA_ABILITY_DCDON 0x01
#define PIAFS_UDATA_ABILITY_DDI 0x80 #define PIAFS_UDATA_ABILITY_DDI 0x80
/* /*
DLC of PIAFS : DLC of PIAFS :
Byte | 8 7 6 5 4 3 2 1 Byte | 8 7 6 5 4 3 2 1
-----+-------------------------------------------------------- -----+--------------------------------------------------------
0 | 0 0 1 0 0 0 0 0 Data Link Configuration 0 | 0 0 1 0 0 0 0 0 Data Link Configuration
1 | X X X X X X X X Length of IE (at least 15 Bytes) 1 | X X X X X X X X Length of IE (at least 15 Bytes)
2 | 0 0 0 0 0 0 0 0 max. information field, LOW byte (not used, fix 73 Bytes) 2 | 0 0 0 0 0 0 0 0 max. information field, LOW byte (not used, fix 73 Bytes)
@@ -476,57 +476,57 @@ Byte | 8 7 6 5 4 3 2 1
| D - signal DCD ON | D - signal DCD ON
| U - use extensive UDATA control communication | U - use extensive UDATA control communication
| for DDI test application | for DDI test application
+ Note (1): ----------+------+-----------------------------------------+ + Note (1): ----------+------+-----------------------------------------+
| PIAFS Protocol | Bit | | | PIAFS Protocol | Bit | |
| Speed configuration | S | Bit 1 - Protocol Speed | | Speed configuration | S | Bit 1 - Protocol Speed |
| | | 0 - 32K | | | | 0 - 32K |
| | | 1 - 64K (default) | | | | 1 - 64K (default) |
| | V | Bit 2 - Variable Protocol Speed | | | V | Bit 2 - Variable Protocol Speed |
| | | 0 - Speed is fix | | | | 0 - Speed is fix |
| | | 1 - Speed is variable (default) | | | | 1 - Speed is variable (default) |
| | | OVERWRITES 32k Bit 1 | | | | OVERWRITES 32k Bit 1 |
| | C | Bit 3 0 - Speed Settings according to | | | C | Bit 3 0 - Speed Settings according to |
| | | PIAFS specification | | | | PIAFS specification |
| | | 1 - Speed setting for chinese | | | | 1 - Speed setting for chinese |
| | | PIAFS implementation | | | | PIAFS implementation |
| | | Explanation for chinese speed settings: | | | | Explanation for chinese speed settings: |
| | | if Bit 3 is set the following | | | | if Bit 3 is set the following |
| | | rules apply: | | | | rules apply: |
| | | Bit1=0 Bit2=0: 32k fix | | | | Bit1=0 Bit2=0: 32k fix |
| | | Bit1=1 Bit2=0: 64k fix | | | | Bit1=1 Bit2=0: 64k fix |
| | | Bit1=0 Bit2=1: PIAFS is trying | | | | Bit1=0 Bit2=1: PIAFS is trying |
| | | to negotiate 32k is that is | | | | to negotiate 32k is that is |
| | | not possible it tries to | | | | not possible it tries to |
| | | negotiate 64k | | | | negotiate 64k |
| | | Bit1=1 Bit2=1: PIAFS is trying | | | | Bit1=1 Bit2=1: PIAFS is trying |
| | | to negotiate 64k is that is | | | | to negotiate 64k is that is |
| | | not possible it tries to | | | | not possible it tries to |
| | | negotiate 32k | | | | negotiate 32k |
+ Note (2): ----------+------+-----------------------------------------+ + Note (2): ----------+------+-----------------------------------------+
| PIAFS | Bit | this byte defines the usage of UDATA | | PIAFS | Bit | this byte defines the usage of UDATA |
| Implementation | | control communication | | Implementation | | control communication |
| UDATA usage | D | Bit 1 - DCD-ON signalling | | UDATA usage | D | Bit 1 - DCD-ON signalling |
| | | 0 - no DCD-ON is signalled | | | | 0 - no DCD-ON is signalled |
| | | (default) | | | | (default) |
| | | 1 - DCD-ON will be signalled | | | | 1 - DCD-ON will be signalled |
| | U | Bit 8 - DDI test application UDATA | | | U | Bit 8 - DDI test application UDATA |
| | | control communication | | | | control communication |
| | | 0 - no UDATA control | | | | 0 - no UDATA control |
| | | communication (default) | | | | communication (default) |
| | | sets as well the DCD-ON | | | | sets as well the DCD-ON |
| | | signalling | | | | signalling |
| | | 1 - UDATA control communication | | | | 1 - UDATA control communication |
| | | ATTENTION: Do not use these | | | | ATTENTION: Do not use these |
| | | setting if you | | | | setting if you |
| | | are not really | | | | are not really |
| | | that you need it | | | | that you need it |
| | | and you know | | | | and you know |
| | | exactly what you | | | | exactly what you |
| | | are doing. | | | | are doing. |
| | | You can easily | | | | You can easily |
| | | disable any | | | | disable any |
| | | data transfer. | | | | data transfer. |
+---------------------+------+-----------------------------------------+ +---------------------+------+-----------------------------------------+
*/ */
/* ------------------------------------------------------ /* ------------------------------------------------------
LISTENER DLC DEFINITIONS LISTENER DLC DEFINITIONS
@@ -712,11 +712,11 @@ Byte | 8 7 6 5 4 3 2 1
/*#define RESERVED85 0x85*/ /*#define RESERVED85 0x85*/
#define ADVICE_OF_CHARGE 0x86 #define ADVICE_OF_CHARGE 0x86
/*1111 0001 /*1111 0001
to to
1111 1111 1111 1111
F1H - Reserved for network operator use F1H - Reserved for network operator use
to to
FFH*/ FFH*/
/* Parameter Types */ /* Parameter Types */
#define DATE_AND_TIME 1 #define DATE_AND_TIME 1
#define CLI_PARAMETER_TYPE 2 #define CLI_PARAMETER_TYPE 2

View File

@@ -108,9 +108,9 @@ typedef union
struct L2Struc L2Stats; struct L2Struc L2Stats;
struct OSStruc OSStats; struct OSStruc OSStats;
byte b[BUFFER_SZ]; byte b[BUFFER_SZ];
word w[BUFFER_SZ>>1]; word w[BUFFER_SZ >> 1];
word l[BUFFER_SZ>>2]; /* word is wrong, do not use! Use 'd' instead. */ word l[BUFFER_SZ >> 2]; /* word is wrong, do not use! Use 'd' instead. */
dword d[BUFFER_SZ>>2]; dword d[BUFFER_SZ >> 2];
} BUFFER; } BUFFER;
typedef union typedef union
{ {
@@ -119,9 +119,9 @@ typedef union
struct L2Struc L2Stats; struct L2Struc L2Stats;
struct OSStruc OSStats; struct OSStruc OSStats;
byte b[MIPS_BUFFER_SZ]; byte b[MIPS_BUFFER_SZ];
word w[MIPS_BUFFER_SZ>>1]; word w[MIPS_BUFFER_SZ >> 1];
word l[BUFFER_SZ>>2]; /* word is wrong, do not use! Use 'd' instead. */ word l[BUFFER_SZ >> 2]; /* word is wrong, do not use! Use 'd' instead. */
dword d[MIPS_BUFFER_SZ>>2]; dword d[MIPS_BUFFER_SZ >> 2];
} MIPS_BUFFER; } MIPS_BUFFER;
#if !defined(MIPS_SCOM) #if !defined(MIPS_SCOM)
struct pc_maint struct pc_maint

View File

@@ -34,11 +34,10 @@
With microsoft compile it is done by "pshpack1.h" and With microsoft compile it is done by "pshpack1.h" and
after is restored by "poppack.h" after is restored by "poppack.h"
*/ */
#include "pc_maint.h" #include "pc_maint.h"
#endif #endif

View File

@@ -112,40 +112,40 @@
#define DIVA_OS_MEM_ATTACH_CONFIG(a) ((a)->Config) #define DIVA_OS_MEM_ATTACH_CONFIG(a) ((a)->Config)
#define DIVA_OS_MEM_ATTACH_CONTROL(a) ((a)->Control) #define DIVA_OS_MEM_ATTACH_CONTROL(a) ((a)->Control)
#define DIVA_OS_MEM_DETACH_RAM(a, x) do { } while(0) #define DIVA_OS_MEM_DETACH_RAM(a, x) do { } while (0)
#define DIVA_OS_MEM_DETACH_PORT(a, x) do { } while(0) #define DIVA_OS_MEM_DETACH_PORT(a, x) do { } while (0)
#define DIVA_OS_MEM_DETACH_PROM(a, x) do { } while(0) #define DIVA_OS_MEM_DETACH_PROM(a, x) do { } while (0)
#define DIVA_OS_MEM_DETACH_CTLREG(a, x) do { } while(0) #define DIVA_OS_MEM_DETACH_CTLREG(a, x) do { } while (0)
#define DIVA_OS_MEM_DETACH_RESET(a, x) do { } while(0) #define DIVA_OS_MEM_DETACH_RESET(a, x) do { } while (0)
#define DIVA_OS_MEM_DETACH_CFG(a, x) do { } while(0) #define DIVA_OS_MEM_DETACH_CFG(a, x) do { } while (0)
#define DIVA_OS_MEM_DETACH_ADDRESS(a, x) do { } while(0) #define DIVA_OS_MEM_DETACH_ADDRESS(a, x) do { } while (0)
#define DIVA_OS_MEM_DETACH_CONFIG(a, x) do { } while(0) #define DIVA_OS_MEM_DETACH_CONFIG(a, x) do { } while (0)
#define DIVA_OS_MEM_DETACH_CONTROL(a, x) do { } while(0) #define DIVA_OS_MEM_DETACH_CONTROL(a, x) do { } while (0)
#define DIVA_INVALID_FILE_HANDLE ((dword)(-1)) #define DIVA_INVALID_FILE_HANDLE ((dword)(-1))
#define DIVAS_CONTAINING_RECORD(address, type, field) \ #define DIVAS_CONTAINING_RECORD(address, type, field) \
((type *)((char*)(address) - (char*)(&((type *)0)->field))) ((type *)((char *)(address) - (char *)(&((type *)0)->field)))
extern int sprintf(char *, const char*, ...); extern int sprintf(char *, const char *, ...);
typedef void* LIST_ENTRY; typedef void *LIST_ENTRY;
typedef char DEVICE_NAME[64]; typedef char DEVICE_NAME[64];
typedef struct _ISDN_ADAPTER ISDN_ADAPTER; typedef struct _ISDN_ADAPTER ISDN_ADAPTER;
typedef struct _ISDN_ADAPTER* PISDN_ADAPTER; typedef struct _ISDN_ADAPTER *PISDN_ADAPTER;
typedef void (* DIVA_DI_PRINTF) (unsigned char *, ...); typedef void (*DIVA_DI_PRINTF)(unsigned char *, ...);
#include "debuglib.h" #include "debuglib.h"
#define dtrc(p) DBG_PRV0(p) #define dtrc(p) DBG_PRV0(p)
#define dbug(a,p) DBG_PRV1(p) #define dbug(a, p) DBG_PRV1(p)
typedef struct e_info_s E_INFO ; typedef struct e_info_s E_INFO;
typedef char diva_os_dependent_devica_name_t[64]; typedef char diva_os_dependent_devica_name_t[64];
typedef void* PDEVICE_OBJECT; typedef void *PDEVICE_OBJECT;
struct _diva_os_soft_isr; struct _diva_os_soft_isr;
struct _diva_os_timer; struct _diva_os_timer;
@@ -156,13 +156,13 @@ void diva_log_info(unsigned char *, ...);
/* /*
** XDI DIDD Interface ** XDI DIDD Interface
*/ */
void diva_xdi_didd_register_adapter (int card); void diva_xdi_didd_register_adapter(int card);
void diva_xdi_didd_remove_adapter (int card); void diva_xdi_didd_remove_adapter(int card);
/* /*
** memory allocation ** memory allocation
*/ */
static __inline__ void* diva_os_malloc (unsigned long flags, unsigned long size) static __inline__ void *diva_os_malloc(unsigned long flags, unsigned long size)
{ {
void *ret = NULL; void *ret = NULL;
@@ -171,7 +171,7 @@ static __inline__ void* diva_os_malloc (unsigned long flags, unsigned long size)
} }
return (ret); return (ret);
} }
static __inline__ void diva_os_free (unsigned long flags, void* ptr) static __inline__ void diva_os_free(unsigned long flags, void *ptr)
{ {
vfree(ptr); vfree(ptr);
} }
@@ -200,23 +200,23 @@ static __inline__ void diva_os_wait(dword mSec)
/* /*
** PCI Configuration space access ** PCI Configuration space access
*/ */
void PCIwrite (byte bus, byte func, int offset, void* data, int length, void* pci_dev_handle); void PCIwrite(byte bus, byte func, int offset, void *data, int length, void *pci_dev_handle);
void PCIread (byte bus, byte func, int offset, void* data, int length, void* pci_dev_handle); void PCIread(byte bus, byte func, int offset, void *data, int length, void *pci_dev_handle);
/* /*
** I/O Port utilities ** I/O Port utilities
*/ */
int diva_os_register_io_port (void *adapter, int register, unsigned long port, int diva_os_register_io_port(void *adapter, int register, unsigned long port,
unsigned long length, const char* name, int id); unsigned long length, const char *name, int id);
/* /*
** I/O port access abstraction ** I/O port access abstraction
*/ */
byte inpp (void __iomem *); byte inpp(void __iomem *);
word inppw (void __iomem *); word inppw(void __iomem *);
void inppw_buffer (void __iomem *, void*, int); void inppw_buffer(void __iomem *, void *, int);
void outppw (void __iomem *, word); void outppw(void __iomem *, word);
void outppw_buffer (void __iomem * , void*, int); void outppw_buffer(void __iomem * , void*, int);
void outpp (void __iomem *, word); void outpp(void __iomem *, word);
/* /*
** IRQ ** IRQ
@@ -226,8 +226,8 @@ typedef struct _diva_os_adapter_irq_info {
int registered; int registered;
char irq_name[24]; char irq_name[24];
} diva_os_adapter_irq_info_t; } diva_os_adapter_irq_info_t;
int diva_os_register_irq (void* context, byte irq, const char* name); int diva_os_register_irq(void *context, byte irq, const char *name);
void diva_os_remove_irq (void* context, byte irq); void diva_os_remove_irq(void *context, byte irq);
#define diva_os_in_irq() in_irq() #define diva_os_in_irq() in_irq()
@@ -236,52 +236,52 @@ void diva_os_remove_irq (void* context, byte irq);
*/ */
typedef long diva_os_spin_lock_magic_t; typedef long diva_os_spin_lock_magic_t;
typedef spinlock_t diva_os_spin_lock_t; typedef spinlock_t diva_os_spin_lock_t;
static __inline__ int diva_os_initialize_spin_lock (spinlock_t *lock, void * unused) { \ static __inline__ int diva_os_initialize_spin_lock(spinlock_t *lock, void *unused) { \
spin_lock_init (lock); return(0); } spin_lock_init(lock); return (0); }
static __inline__ void diva_os_enter_spin_lock (diva_os_spin_lock_t* a, \ static __inline__ void diva_os_enter_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_lock_bh(a); } void *dbg) { spin_lock_bh(a); }
static __inline__ void diva_os_leave_spin_lock (diva_os_spin_lock_t* a, \ 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); }
#define diva_os_destroy_spin_lock(a,b) do { } while(0) #define diva_os_destroy_spin_lock(a, b) do { } while (0)
/* /*
** Deffered processing framework ** Deffered processing framework
*/ */
typedef int (*diva_os_isr_callback_t)(struct _ISDN_ADAPTER*); typedef int (*diva_os_isr_callback_t)(struct _ISDN_ADAPTER *);
typedef void (*diva_os_soft_isr_callback_t)(struct _diva_os_soft_isr* psoft_isr, void* context); typedef void (*diva_os_soft_isr_callback_t)(struct _diva_os_soft_isr *psoft_isr, void *context);
typedef struct _diva_os_soft_isr { typedef struct _diva_os_soft_isr {
void* object; void *object;
diva_os_soft_isr_callback_t callback; diva_os_soft_isr_callback_t callback;
void* callback_context; void *callback_context;
char dpc_thread_name[24]; char dpc_thread_name[24];
} diva_os_soft_isr_t; } diva_os_soft_isr_t;
int diva_os_initialize_soft_isr (diva_os_soft_isr_t* psoft_isr, diva_os_soft_isr_callback_t callback, void* callback_context); int diva_os_initialize_soft_isr(diva_os_soft_isr_t *psoft_isr, diva_os_soft_isr_callback_t callback, void *callback_context);
int diva_os_schedule_soft_isr (diva_os_soft_isr_t* psoft_isr); int diva_os_schedule_soft_isr(diva_os_soft_isr_t *psoft_isr);
int diva_os_cancel_soft_isr (diva_os_soft_isr_t* psoft_isr); int diva_os_cancel_soft_isr(diva_os_soft_isr_t *psoft_isr);
void diva_os_remove_soft_isr (diva_os_soft_isr_t* psoft_isr); void diva_os_remove_soft_isr(diva_os_soft_isr_t *psoft_isr);
/* /*
Get time service Get time service
*/ */
void diva_os_get_time (dword* sec, dword* usec); void diva_os_get_time(dword *sec, dword *usec);
/* /*
** atomic operation, fake because we use threads ** atomic operation, fake because we use threads
*/ */
typedef int diva_os_atomic_t; typedef int diva_os_atomic_t;
static diva_os_atomic_t __inline__ static diva_os_atomic_t __inline__
diva_os_atomic_increment(diva_os_atomic_t* pv) diva_os_atomic_increment(diva_os_atomic_t *pv)
{ {
*pv += 1; *pv += 1;
return (*pv); return (*pv);
} }
static diva_os_atomic_t __inline__ static diva_os_atomic_t __inline__
diva_os_atomic_decrement(diva_os_atomic_t* pv) diva_os_atomic_decrement(diva_os_atomic_t *pv)
{ {
*pv -= 1; *pv -= 1;
return (*pv); return (*pv);
@@ -319,9 +319,9 @@ diva_os_atomic_decrement(diva_os_atomic_t* pv)
#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_BYTE(addr,v) writeb(v,addr) #define WRITE_BYTE(addr, v) writeb(v, 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)
static inline __u16 GET_WORD(void *addr) static inline __u16 GET_WORD(void *addr)
{ {
@@ -344,10 +344,10 @@ static inline void PUT_DWORD(void *addr, __u32 v)
** 32/64 bit macors ** 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
#define ULongToPtr(x) (void *)(unsigned long)(x) #define ULongToPtr(x) (void *)(unsigned long)(x)
#endif #endif
#endif #endif
/* /*
@@ -362,7 +362,7 @@ static inline void PUT_DWORD(void *addr, __u32 v)
*/ */
#define diva_os_dump_file_t char #define diva_os_dump_file_t char
#define diva_os_board_trace_t char #define diva_os_board_trace_t char
#define diva_os_dump_file(__x__) do { } while(0) #define diva_os_dump_file(__x__) do { } while (0)
/* /*
** size of internal arrays ** size of internal arrays

View File

@@ -44,11 +44,11 @@
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Recovery XLOG from QBRI Card Recovery XLOG from QBRI Card
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void qBri_cpu_trapped (PISDN_ADAPTER IoAdapter) { static void qBri_cpu_trapped(PISDN_ADAPTER IoAdapter) {
byte __iomem *base ; byte __iomem *base;
word *Xlog ; word *Xlog;
dword regs[4], TrapID, offset, size ; dword regs[4], TrapID, offset, size;
Xdesc xlogDesc ; Xdesc xlogDesc;
int factor = (IoAdapter->tasks == 1) ? 1 : 2; int factor = (IoAdapter->tasks == 1) ? 1 : 2;
/* /*
@@ -56,40 +56,40 @@ static void qBri_cpu_trapped (PISDN_ADAPTER IoAdapter) {
*/ */
base = DIVA_OS_MEM_ATTACH_CONTROL(IoAdapter); base = DIVA_OS_MEM_ATTACH_CONTROL(IoAdapter);
offset = IoAdapter->ControllerNumber * (IoAdapter->MemorySize >> factor) ; offset = IoAdapter->ControllerNumber * (IoAdapter->MemorySize >> factor);
TrapID = READ_DWORD(&base[0x80]) ; TrapID = READ_DWORD(&base[0x80]);
if ( (TrapID == 0x99999999) || (TrapID == 0x99999901) ) if ((TrapID == 0x99999999) || (TrapID == 0x99999901))
{ {
dump_trap_frame (IoAdapter, &base[0x90]) ; dump_trap_frame(IoAdapter, &base[0x90]);
IoAdapter->trapped = 1 ; IoAdapter->trapped = 1;
} }
regs[0] = READ_DWORD((base + offset) + 0x70); regs[0] = READ_DWORD((base + offset) + 0x70);
regs[1] = READ_DWORD((base + offset) + 0x74); regs[1] = READ_DWORD((base + offset) + 0x74);
regs[2] = READ_DWORD((base + offset) + 0x78); regs[2] = READ_DWORD((base + offset) + 0x78);
regs[3] = READ_DWORD((base + offset) + 0x7c); regs[3] = READ_DWORD((base + offset) + 0x7c);
regs[0] &= IoAdapter->MemorySize - 1 ; regs[0] &= IoAdapter->MemorySize - 1;
if ( (regs[0] >= offset) if ((regs[0] >= offset)
&& (regs[0] < offset + (IoAdapter->MemorySize >> factor) - 1) ) && (regs[0] < offset + (IoAdapter->MemorySize >> factor) - 1))
{ {
if ( !(Xlog = (word *)diva_os_malloc (0, MAX_XLOG_SIZE)) ) { if (!(Xlog = (word *)diva_os_malloc(0, MAX_XLOG_SIZE))) {
DIVA_OS_MEM_DETACH_CONTROL(IoAdapter, base); DIVA_OS_MEM_DETACH_CONTROL(IoAdapter, base);
return ; return;
} }
size = offset + (IoAdapter->MemorySize >> factor) - regs[0] ; size = offset + (IoAdapter->MemorySize >> factor) - regs[0];
if ( size > MAX_XLOG_SIZE ) if (size > MAX_XLOG_SIZE)
size = MAX_XLOG_SIZE ; size = MAX_XLOG_SIZE;
memcpy_fromio (Xlog, &base[regs[0]], size) ; memcpy_fromio(Xlog, &base[regs[0]], size);
xlogDesc.buf = Xlog ; xlogDesc.buf = Xlog;
xlogDesc.cnt = READ_WORD(&base[regs[1] & (IoAdapter->MemorySize - 1)]) ; xlogDesc.cnt = READ_WORD(&base[regs[1] & (IoAdapter->MemorySize - 1)]);
xlogDesc.out = READ_WORD(&base[regs[2] & (IoAdapter->MemorySize - 1)]) ; xlogDesc.out = READ_WORD(&base[regs[2] & (IoAdapter->MemorySize - 1)]);
dump_xlog_buffer (IoAdapter, &xlogDesc) ; dump_xlog_buffer(IoAdapter, &xlogDesc);
diva_os_free (0, Xlog) ; diva_os_free(0, Xlog);
IoAdapter->trapped = 2 ; IoAdapter->trapped = 2;
} }
DIVA_OS_MEM_DETACH_CONTROL(IoAdapter, base); DIVA_OS_MEM_DETACH_CONTROL(IoAdapter, base);
} }
@@ -97,72 +97,72 @@ static void qBri_cpu_trapped (PISDN_ADAPTER IoAdapter) {
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Reset QBRI Hardware Reset QBRI Hardware
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void reset_qBri_hardware (PISDN_ADAPTER IoAdapter) { static void reset_qBri_hardware(PISDN_ADAPTER IoAdapter) {
word volatile __iomem *qBriReset ; word volatile __iomem *qBriReset;
byte volatile __iomem *qBriCntrl ; byte volatile __iomem *qBriCntrl;
byte volatile __iomem *p ; byte volatile __iomem *p;
qBriReset = (word volatile __iomem *)DIVA_OS_MEM_ATTACH_PROM(IoAdapter); qBriReset = (word volatile __iomem *)DIVA_OS_MEM_ATTACH_PROM(IoAdapter);
WRITE_WORD(qBriReset, READ_WORD(qBriReset) | PLX9054_SOFT_RESET) ; WRITE_WORD(qBriReset, READ_WORD(qBriReset) | PLX9054_SOFT_RESET);
diva_os_wait (1) ; diva_os_wait(1);
WRITE_WORD(qBriReset, READ_WORD(qBriReset) & ~PLX9054_SOFT_RESET) ; WRITE_WORD(qBriReset, READ_WORD(qBriReset) & ~PLX9054_SOFT_RESET);
diva_os_wait (1); diva_os_wait(1);
WRITE_WORD(qBriReset, READ_WORD(qBriReset) | PLX9054_RELOAD_EEPROM) ; WRITE_WORD(qBriReset, READ_WORD(qBriReset) | PLX9054_RELOAD_EEPROM);
diva_os_wait (1) ; diva_os_wait(1);
WRITE_WORD(qBriReset, READ_WORD(qBriReset) & ~PLX9054_RELOAD_EEPROM) ; WRITE_WORD(qBriReset, READ_WORD(qBriReset) & ~PLX9054_RELOAD_EEPROM);
diva_os_wait (1); diva_os_wait(1);
DIVA_OS_MEM_DETACH_PROM(IoAdapter, qBriReset); DIVA_OS_MEM_DETACH_PROM(IoAdapter, qBriReset);
qBriCntrl = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); qBriCntrl = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
p = &qBriCntrl[DIVA_4BRI_REVISION(IoAdapter) ? (MQ2_BREG_RISC) : (MQ_BREG_RISC)]; p = &qBriCntrl[DIVA_4BRI_REVISION(IoAdapter) ? (MQ2_BREG_RISC) : (MQ_BREG_RISC)];
WRITE_DWORD(p, 0) ; WRITE_DWORD(p, 0);
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, qBriCntrl); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, qBriCntrl);
DBG_TRC(("resetted board @ reset addr 0x%08lx", qBriReset)) DBG_TRC(("resetted board @ reset addr 0x%08lx", qBriReset))
DBG_TRC(("resetted board @ cntrl addr 0x%08lx", p)) DBG_TRC(("resetted board @ cntrl addr 0x%08lx", p))
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Start Card CPU Start Card CPU
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
void start_qBri_hardware (PISDN_ADAPTER IoAdapter) { void start_qBri_hardware(PISDN_ADAPTER IoAdapter) {
byte volatile __iomem *qBriReset ; byte volatile __iomem *qBriReset;
byte volatile __iomem *p ; byte volatile __iomem *p;
p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
qBriReset = &p[(DIVA_4BRI_REVISION(IoAdapter)) ? (MQ2_BREG_RISC) : (MQ_BREG_RISC)]; qBriReset = &p[(DIVA_4BRI_REVISION(IoAdapter)) ? (MQ2_BREG_RISC) : (MQ_BREG_RISC)];
WRITE_DWORD(qBriReset, MQ_RISC_COLD_RESET_MASK) ; WRITE_DWORD(qBriReset, MQ_RISC_COLD_RESET_MASK);
diva_os_wait (2) ; diva_os_wait(2);
WRITE_DWORD(qBriReset, MQ_RISC_WARM_RESET_MASK | MQ_RISC_COLD_RESET_MASK) ; WRITE_DWORD(qBriReset, MQ_RISC_WARM_RESET_MASK | MQ_RISC_COLD_RESET_MASK);
diva_os_wait (10) ; diva_os_wait(10);
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
DBG_TRC(("started processor @ addr 0x%08lx", qBriReset)) DBG_TRC(("started processor @ addr 0x%08lx", qBriReset))
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Stop Card CPU Stop Card CPU
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void stop_qBri_hardware (PISDN_ADAPTER IoAdapter) { static void stop_qBri_hardware(PISDN_ADAPTER IoAdapter) {
byte volatile __iomem *p ; byte volatile __iomem *p;
dword volatile __iomem *qBriReset ; dword volatile __iomem *qBriReset;
dword volatile __iomem *qBriIrq ; dword volatile __iomem *qBriIrq;
dword volatile __iomem *qBriIsacDspReset ; dword volatile __iomem *qBriIsacDspReset;
int rev2 = DIVA_4BRI_REVISION(IoAdapter); int rev2 = DIVA_4BRI_REVISION(IoAdapter);
int reset_offset = rev2 ? (MQ2_BREG_RISC) : (MQ_BREG_RISC); int reset_offset = rev2 ? (MQ2_BREG_RISC) : (MQ_BREG_RISC);
int irq_offset = rev2 ? (MQ2_BREG_IRQ_TEST) : (MQ_BREG_IRQ_TEST); int irq_offset = rev2 ? (MQ2_BREG_IRQ_TEST) : (MQ_BREG_IRQ_TEST);
int hw_offset = rev2 ? (MQ2_ISAC_DSP_RESET) : (MQ_ISAC_DSP_RESET); int hw_offset = rev2 ? (MQ2_ISAC_DSP_RESET) : (MQ_ISAC_DSP_RESET);
if ( IoAdapter->ControllerNumber > 0 ) if (IoAdapter->ControllerNumber > 0)
return ; return;
p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
qBriReset = (dword volatile __iomem *)&p[reset_offset]; qBriReset = (dword volatile __iomem *)&p[reset_offset];
qBriIsacDspReset = (dword volatile __iomem *)&p[hw_offset]; qBriIsacDspReset = (dword volatile __iomem *)&p[hw_offset];
/* /*
* clear interrupt line (reset Local Interrupt Test Register) * clear interrupt line (reset Local Interrupt Test Register)
*/ */
WRITE_DWORD(qBriReset, 0) ; WRITE_DWORD(qBriReset, 0);
WRITE_DWORD(qBriIsacDspReset, 0) ; WRITE_DWORD(qBriIsacDspReset, 0);
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter); p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter);
@@ -171,96 +171,96 @@ static void stop_qBri_hardware (PISDN_ADAPTER IoAdapter) {
p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
qBriIrq = (dword volatile __iomem *)&p[irq_offset]; qBriIrq = (dword volatile __iomem *)&p[irq_offset];
WRITE_DWORD(qBriIrq, MQ_IRQ_REQ_OFF) ; WRITE_DWORD(qBriIrq, MQ_IRQ_REQ_OFF);
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
DBG_TRC(("stopped processor @ addr 0x%08lx", qBriReset)) DBG_TRC(("stopped processor @ addr 0x%08lx", qBriReset))
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
FPGA download FPGA download
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#define FPGA_NAME_OFFSET 0x10 #define FPGA_NAME_OFFSET 0x10
static byte * qBri_check_FPGAsrc (PISDN_ADAPTER IoAdapter, char *FileName, static byte *qBri_check_FPGAsrc(PISDN_ADAPTER IoAdapter, char *FileName,
dword *Length, dword *code) { dword *Length, dword *code) {
byte *File ; byte *File;
char *fpgaFile, *fpgaType, *fpgaDate, *fpgaTime ; char *fpgaFile, *fpgaType, *fpgaDate, *fpgaTime;
dword fpgaFlen, fpgaTlen, fpgaDlen, cnt, year, i ; dword fpgaFlen, fpgaTlen, fpgaDlen, cnt, year, i;
if (!(File = (byte *)xdiLoadFile (FileName, Length, 0))) { if (!(File = (byte *)xdiLoadFile(FileName, Length, 0))) {
return (NULL) ; return (NULL);
} }
/* /*
* scan file until FF and put id string into buffer * scan file until FF and put id string into buffer
*/ */
for ( i = 0 ; File[i] != 0xff ; ) for (i = 0; File[i] != 0xff;)
{ {
if ( ++i >= *Length ) if (++i >= *Length)
{ {
DBG_FTL(("FPGA download: start of data header not found")) DBG_FTL(("FPGA download: start of data header not found"))
xdiFreeFile (File) ; xdiFreeFile(File);
return (NULL) ; return (NULL);
} }
} }
*code = i++ ; *code = i++;
if ( (File[i] & 0xF0) != 0x20 ) if ((File[i] & 0xF0) != 0x20)
{ {
DBG_FTL(("FPGA download: data header corrupted")) DBG_FTL(("FPGA download: data header corrupted"))
xdiFreeFile (File) ; xdiFreeFile(File);
return (NULL) ; return (NULL);
} }
fpgaFlen = (dword) File[FPGA_NAME_OFFSET - 1] ; fpgaFlen = (dword)File[FPGA_NAME_OFFSET - 1];
if ( fpgaFlen == 0 ) if (fpgaFlen == 0)
fpgaFlen = 12 ; fpgaFlen = 12;
fpgaFile = (char *)&File[FPGA_NAME_OFFSET] ; fpgaFile = (char *)&File[FPGA_NAME_OFFSET];
fpgaTlen = (dword) fpgaFile[fpgaFlen + 2] ; fpgaTlen = (dword)fpgaFile[fpgaFlen + 2];
if ( fpgaTlen == 0 ) if (fpgaTlen == 0)
fpgaTlen = 10 ; fpgaTlen = 10;
fpgaType = (char *)&fpgaFile[fpgaFlen + 3] ; fpgaType = (char *)&fpgaFile[fpgaFlen + 3];
fpgaDlen = (dword) fpgaType[fpgaTlen + 2] ; fpgaDlen = (dword) fpgaType[fpgaTlen + 2];
if ( fpgaDlen == 0 ) if (fpgaDlen == 0)
fpgaDlen = 11 ; fpgaDlen = 11;
fpgaDate = (char *)&fpgaType[fpgaTlen + 3] ; fpgaDate = (char *)&fpgaType[fpgaTlen + 3];
fpgaTime = (char *)&fpgaDate[fpgaDlen + 3] ; fpgaTime = (char *)&fpgaDate[fpgaDlen + 3];
cnt = (dword)(((File[ i ] & 0x0F) << 20) + (File[i + 1] << 12) cnt = (dword)(((File[i] & 0x0F) << 20) + (File[i + 1] << 12)
+ (File[i + 2] << 4) + (File[i + 3] >> 4)) ; + (File[i + 2] << 4) + (File[i + 3] >> 4));
if ( (dword)(i + (cnt / 8)) > *Length ) if ((dword)(i + (cnt / 8)) > *Length)
{ {
DBG_FTL(("FPGA download: '%s' file too small (%ld < %ld)", DBG_FTL(("FPGA download: '%s' file too small (%ld < %ld)",
FileName, *Length, code + ((cnt + 7) / 8) )) FileName, *Length, code + ((cnt + 7) / 8)))
xdiFreeFile (File) ; xdiFreeFile(File);
return (NULL) ; return (NULL);
} }
i = 0 ; i = 0;
do do
{ {
while ( (fpgaDate[i] != '\0') while ((fpgaDate[i] != '\0')
&& ((fpgaDate[i] < '0') || (fpgaDate[i] > '9')) ) && ((fpgaDate[i] < '0') || (fpgaDate[i] > '9')))
{ {
i++; i++;
} }
year = 0 ; year = 0;
while ( (fpgaDate[i] >= '0') && (fpgaDate[i] <= '9') ) while ((fpgaDate[i] >= '0') && (fpgaDate[i] <= '9'))
year = year * 10 + (fpgaDate[i++] - '0') ; year = year * 10 + (fpgaDate[i++] - '0');
} while ( (year < 2000) && (fpgaDate[i] != '\0') ); } while ((year < 2000) && (fpgaDate[i] != '\0'));
switch (IoAdapter->cardType) { switch (IoAdapter->cardType) {
case CARDTYPE_DIVASRV_B_2F_PCI: case CARDTYPE_DIVASRV_B_2F_PCI:
break; break;
default: default:
if ( year >= 2001 ) { if (year >= 2001) {
IoAdapter->fpga_features |= PCINIT_FPGA_PLX_ACCESS_SUPPORTED ; IoAdapter->fpga_features |= PCINIT_FPGA_PLX_ACCESS_SUPPORTED;
} }
} }
DBG_LOG(("FPGA[%s] file %s (%s %s) len %d", DBG_LOG(("FPGA[%s] file %s (%s %s) len %d",
fpgaType, fpgaFile, fpgaDate, fpgaTime, cnt)) fpgaType, fpgaFile, fpgaDate, fpgaTime, cnt))
return (File) ; return (File);
} }
/******************************************************************************/ /******************************************************************************/
@@ -272,18 +272,18 @@ static byte * qBri_check_FPGAsrc (PISDN_ADAPTER IoAdapter, char *FileName,
#define FPGA_DOUT 0x0400 #define FPGA_DOUT 0x0400
#define FPGA_DIN FPGA_DOUT /* bidirectional I/O */ #define FPGA_DIN FPGA_DOUT /* bidirectional I/O */
int qBri_FPGA_download (PISDN_ADAPTER IoAdapter) { int qBri_FPGA_download(PISDN_ADAPTER IoAdapter) {
int bit ; int bit;
byte *File ; byte *File;
dword code, FileLength ; dword code, FileLength;
word volatile __iomem *addr = (word volatile __iomem *)DIVA_OS_MEM_ATTACH_PROM(IoAdapter); word volatile __iomem *addr = (word volatile __iomem *)DIVA_OS_MEM_ATTACH_PROM(IoAdapter);
word val, baseval = FPGA_CS | FPGA_PROG ; word val, baseval = FPGA_CS | FPGA_PROG;
if (DIVA_4BRI_REVISION(IoAdapter)) if (DIVA_4BRI_REVISION(IoAdapter))
{ {
char* name; char *name;
switch (IoAdapter->cardType) { switch (IoAdapter->cardType) {
case CARDTYPE_DIVASRV_B_2F_PCI: case CARDTYPE_DIVASRV_B_2F_PCI:
@@ -299,87 +299,87 @@ int qBri_FPGA_download (PISDN_ADAPTER IoAdapter) {
name = "ds4bri2.bit"; name = "ds4bri2.bit";
} }
File = qBri_check_FPGAsrc (IoAdapter, name, File = qBri_check_FPGAsrc(IoAdapter, name,
&FileLength, &code); &FileLength, &code);
} }
else else
{ {
File = qBri_check_FPGAsrc (IoAdapter, "ds4bri.bit", File = qBri_check_FPGAsrc(IoAdapter, "ds4bri.bit",
&FileLength, &code) ; &FileLength, &code);
} }
if ( !File ) { if (!File) {
DIVA_OS_MEM_DETACH_PROM(IoAdapter, addr); DIVA_OS_MEM_DETACH_PROM(IoAdapter, addr);
return (0) ; return (0);
} }
/* /*
* prepare download, pulse PROGRAM pin down. * prepare download, pulse PROGRAM pin down.
*/ */
WRITE_WORD(addr, baseval & ~FPGA_PROG) ; /* PROGRAM low pulse */ WRITE_WORD(addr, baseval & ~FPGA_PROG); /* PROGRAM low pulse */
WRITE_WORD(addr, baseval) ; /* release */ WRITE_WORD(addr, baseval); /* release */
diva_os_wait (50) ; /* wait until FPGA finished internal memory clear */ diva_os_wait(50); /* wait until FPGA finished internal memory clear */
/* /*
* check done pin, must be low * check done pin, must be low
*/ */
if ( READ_WORD(addr) & FPGA_BUSY ) if (READ_WORD(addr) & FPGA_BUSY)
{ {
DBG_FTL(("FPGA download: acknowledge for FPGA memory clear missing")) DBG_FTL(("FPGA download: acknowledge for FPGA memory clear missing"))
xdiFreeFile (File) ; xdiFreeFile(File);
DIVA_OS_MEM_DETACH_PROM(IoAdapter, addr); DIVA_OS_MEM_DETACH_PROM(IoAdapter, addr);
return (0) ; return (0);
} }
/* /*
* put data onto the FPGA * put data onto the FPGA
*/ */
while ( code < FileLength ) while (code < FileLength)
{ {
val = ((word)File[code++]) << 3 ; val = ((word)File[code++]) << 3;
for ( bit = 8 ; bit-- > 0 ; val <<= 1 ) /* put byte onto FPGA */ for (bit = 8; bit-- > 0; val <<= 1) /* put byte onto FPGA */
{ {
baseval &= ~FPGA_DOUT ; /* clr data bit */ baseval &= ~FPGA_DOUT; /* clr data bit */
baseval |= (val & FPGA_DOUT) ; /* copy data bit */ baseval |= (val & FPGA_DOUT); /* copy data bit */
WRITE_WORD(addr, baseval) ; WRITE_WORD(addr, baseval);
WRITE_WORD(addr, baseval | FPGA_CCLK) ; /* set CCLK hi */ WRITE_WORD(addr, baseval | FPGA_CCLK); /* set CCLK hi */
WRITE_WORD(addr, baseval | FPGA_CCLK) ; /* set CCLK hi */ WRITE_WORD(addr, baseval | FPGA_CCLK); /* set CCLK hi */
WRITE_WORD(addr, baseval) ; /* set CCLK lo */ WRITE_WORD(addr, baseval); /* set CCLK lo */
} }
} }
xdiFreeFile (File) ; xdiFreeFile(File);
diva_os_wait (100) ; diva_os_wait(100);
val = READ_WORD(addr) ; val = READ_WORD(addr);
DIVA_OS_MEM_DETACH_PROM(IoAdapter, addr); DIVA_OS_MEM_DETACH_PROM(IoAdapter, addr);
if ( !(val & FPGA_BUSY) ) if (!(val & FPGA_BUSY))
{ {
DBG_FTL(("FPGA download: chip remains in busy state (0x%04x)", val)) DBG_FTL(("FPGA download: chip remains in busy state (0x%04x)", val))
return (0) ; return (0);
} }
return (1) ; return (1);
} }
static int load_qBri_hardware (PISDN_ADAPTER IoAdapter) { static int load_qBri_hardware(PISDN_ADAPTER IoAdapter) {
return (0); return (0);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Card ISR Card ISR
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static int qBri_ISR (struct _ISDN_ADAPTER* IoAdapter) { static int qBri_ISR(struct _ISDN_ADAPTER *IoAdapter) {
dword volatile __iomem *qBriIrq ; dword volatile __iomem *qBriIrq;
PADAPTER_LIST_ENTRY QuadroList = IoAdapter->QuadroList ; PADAPTER_LIST_ENTRY QuadroList = IoAdapter->QuadroList;
word i ; word i;
int serviced = 0 ; int serviced = 0;
byte __iomem *p; byte __iomem *p;
p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter); p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter);
if ( !(READ_BYTE(&p[PLX9054_INTCSR]) & 0x80) ) { if (!(READ_BYTE(&p[PLX9054_INTCSR]) & 0x80)) {
DIVA_OS_MEM_DETACH_RESET(IoAdapter, p); DIVA_OS_MEM_DETACH_RESET(IoAdapter, p);
return (0) ; return (0);
} }
DIVA_OS_MEM_DETACH_RESET(IoAdapter, p); DIVA_OS_MEM_DETACH_RESET(IoAdapter, p);
@@ -388,34 +388,34 @@ static int qBri_ISR (struct _ISDN_ADAPTER* IoAdapter) {
*/ */
p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
qBriIrq = (dword volatile __iomem *)(&p[DIVA_4BRI_REVISION(IoAdapter) ? (MQ2_BREG_IRQ_TEST) : (MQ_BREG_IRQ_TEST)]); qBriIrq = (dword volatile __iomem *)(&p[DIVA_4BRI_REVISION(IoAdapter) ? (MQ2_BREG_IRQ_TEST) : (MQ_BREG_IRQ_TEST)]);
WRITE_DWORD(qBriIrq, MQ_IRQ_REQ_OFF) ; WRITE_DWORD(qBriIrq, MQ_IRQ_REQ_OFF);
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
for ( i = 0 ; i < IoAdapter->tasks; ++i ) for (i = 0; i < IoAdapter->tasks; ++i)
{ {
IoAdapter = QuadroList->QuadroAdapter[i] ; IoAdapter = QuadroList->QuadroAdapter[i];
if ( IoAdapter && IoAdapter->Initialized if (IoAdapter && IoAdapter->Initialized
&& IoAdapter->tst_irq (&IoAdapter->a) ) && IoAdapter->tst_irq(&IoAdapter->a))
{ {
IoAdapter->IrqCount++ ; IoAdapter->IrqCount++;
serviced = 1 ; serviced = 1;
diva_os_schedule_soft_isr (&IoAdapter->isr_soft_isr); diva_os_schedule_soft_isr(&IoAdapter->isr_soft_isr);
} }
} }
return (serviced) ; return (serviced);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Does disable the interrupt on the card Does disable the interrupt on the card
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void disable_qBri_interrupt (PISDN_ADAPTER IoAdapter) { static void disable_qBri_interrupt(PISDN_ADAPTER IoAdapter) {
dword volatile __iomem *qBriIrq ; dword volatile __iomem *qBriIrq;
byte __iomem *p; byte __iomem *p;
if ( IoAdapter->ControllerNumber > 0 ) if (IoAdapter->ControllerNumber > 0)
return ; return;
/* /*
* clear interrupt line (reset Local Interrupt Test Register) * clear interrupt line (reset Local Interrupt Test Register)
*/ */
@@ -425,84 +425,84 @@ static void disable_qBri_interrupt (PISDN_ADAPTER IoAdapter) {
p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
qBriIrq = (dword volatile __iomem *)(&p[DIVA_4BRI_REVISION(IoAdapter) ? (MQ2_BREG_IRQ_TEST) : (MQ_BREG_IRQ_TEST)]); qBriIrq = (dword volatile __iomem *)(&p[DIVA_4BRI_REVISION(IoAdapter) ? (MQ2_BREG_IRQ_TEST) : (MQ_BREG_IRQ_TEST)]);
WRITE_DWORD(qBriIrq, MQ_IRQ_REQ_OFF) ; WRITE_DWORD(qBriIrq, MQ_IRQ_REQ_OFF);
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Install Adapter Entry Points Install Adapter Entry Points
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void set_common_qBri_functions (PISDN_ADAPTER IoAdapter) { static void set_common_qBri_functions(PISDN_ADAPTER IoAdapter) {
ADAPTER *a; ADAPTER *a;
a = &IoAdapter->a ; a = &IoAdapter->a;
a->ram_in = mem_in ; a->ram_in = mem_in;
a->ram_inw = mem_inw ; a->ram_inw = mem_inw;
a->ram_in_buffer = mem_in_buffer ; a->ram_in_buffer = mem_in_buffer;
a->ram_look_ahead = mem_look_ahead ; a->ram_look_ahead = mem_look_ahead;
a->ram_out = mem_out ; a->ram_out = mem_out;
a->ram_outw = mem_outw ; a->ram_outw = mem_outw;
a->ram_out_buffer = mem_out_buffer ; a->ram_out_buffer = mem_out_buffer;
a->ram_inc = mem_inc ; a->ram_inc = mem_inc;
IoAdapter->out = pr_out ; IoAdapter->out = pr_out;
IoAdapter->dpc = pr_dpc ; IoAdapter->dpc = pr_dpc;
IoAdapter->tst_irq = scom_test_int ; IoAdapter->tst_irq = scom_test_int;
IoAdapter->clr_irq = scom_clear_int ; IoAdapter->clr_irq = scom_clear_int;
IoAdapter->pcm = (struct pc_maint *)MIPS_MAINT_OFFS ; IoAdapter->pcm = (struct pc_maint *)MIPS_MAINT_OFFS;
IoAdapter->load = load_qBri_hardware ; IoAdapter->load = load_qBri_hardware;
IoAdapter->disIrq = disable_qBri_interrupt ; IoAdapter->disIrq = disable_qBri_interrupt;
IoAdapter->rstFnc = reset_qBri_hardware ; IoAdapter->rstFnc = reset_qBri_hardware;
IoAdapter->stop = stop_qBri_hardware ; IoAdapter->stop = stop_qBri_hardware;
IoAdapter->trapFnc = qBri_cpu_trapped ; IoAdapter->trapFnc = qBri_cpu_trapped;
IoAdapter->diva_isr_handler = qBri_ISR; IoAdapter->diva_isr_handler = qBri_ISR;
IoAdapter->a.io = (void*)IoAdapter ; IoAdapter->a.io = (void *)IoAdapter;
} }
static void set_qBri_functions (PISDN_ADAPTER IoAdapter) { static void set_qBri_functions(PISDN_ADAPTER IoAdapter) {
if (!IoAdapter->tasks) { if (!IoAdapter->tasks) {
IoAdapter->tasks = MQ_INSTANCE_COUNT; IoAdapter->tasks = MQ_INSTANCE_COUNT;
} }
IoAdapter->MemorySize = MQ_MEMORY_SIZE ; IoAdapter->MemorySize = MQ_MEMORY_SIZE;
set_common_qBri_functions (IoAdapter) ; set_common_qBri_functions(IoAdapter);
diva_os_set_qBri_functions (IoAdapter) ; diva_os_set_qBri_functions(IoAdapter);
} }
static void set_qBri2_functions (PISDN_ADAPTER IoAdapter) { static void set_qBri2_functions(PISDN_ADAPTER IoAdapter) {
if (!IoAdapter->tasks) { if (!IoAdapter->tasks) {
IoAdapter->tasks = MQ_INSTANCE_COUNT; IoAdapter->tasks = MQ_INSTANCE_COUNT;
} }
IoAdapter->MemorySize = (IoAdapter->tasks == 1) ? BRI2_MEMORY_SIZE : MQ2_MEMORY_SIZE; IoAdapter->MemorySize = (IoAdapter->tasks == 1) ? BRI2_MEMORY_SIZE : MQ2_MEMORY_SIZE;
set_common_qBri_functions (IoAdapter) ; set_common_qBri_functions(IoAdapter);
diva_os_set_qBri2_functions (IoAdapter) ; diva_os_set_qBri2_functions(IoAdapter);
} }
/******************************************************************************/ /******************************************************************************/
void prepare_qBri_functions (PISDN_ADAPTER IoAdapter) { void prepare_qBri_functions(PISDN_ADAPTER IoAdapter) {
set_qBri_functions (IoAdapter->QuadroList->QuadroAdapter[0]) ; set_qBri_functions(IoAdapter->QuadroList->QuadroAdapter[0]);
set_qBri_functions (IoAdapter->QuadroList->QuadroAdapter[1]) ; set_qBri_functions(IoAdapter->QuadroList->QuadroAdapter[1]);
set_qBri_functions (IoAdapter->QuadroList->QuadroAdapter[2]) ; set_qBri_functions(IoAdapter->QuadroList->QuadroAdapter[2]);
set_qBri_functions (IoAdapter->QuadroList->QuadroAdapter[3]) ; set_qBri_functions(IoAdapter->QuadroList->QuadroAdapter[3]);
} }
void prepare_qBri2_functions (PISDN_ADAPTER IoAdapter) { void prepare_qBri2_functions(PISDN_ADAPTER IoAdapter) {
if (!IoAdapter->tasks) { if (!IoAdapter->tasks) {
IoAdapter->tasks = MQ_INSTANCE_COUNT; IoAdapter->tasks = MQ_INSTANCE_COUNT;
} }
set_qBri2_functions (IoAdapter->QuadroList->QuadroAdapter[0]) ; set_qBri2_functions(IoAdapter->QuadroList->QuadroAdapter[0]);
if (IoAdapter->tasks > 1) { if (IoAdapter->tasks > 1) {
set_qBri2_functions (IoAdapter->QuadroList->QuadroAdapter[1]) ; set_qBri2_functions(IoAdapter->QuadroList->QuadroAdapter[1]);
set_qBri2_functions (IoAdapter->QuadroList->QuadroAdapter[2]) ; set_qBri2_functions(IoAdapter->QuadroList->QuadroAdapter[2]);
set_qBri2_functions (IoAdapter->QuadroList->QuadroAdapter[3]) ; set_qBri2_functions(IoAdapter->QuadroList->QuadroAdapter[3]);
} }
} }

View File

@@ -40,152 +40,152 @@
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Investigate card state, recovery trace buffer Investigate card state, recovery trace buffer
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void bri_cpu_trapped (PISDN_ADAPTER IoAdapter) { static void bri_cpu_trapped(PISDN_ADAPTER IoAdapter) {
byte __iomem *addrHi, *addrLo, *ioaddr ; byte __iomem *addrHi, *addrLo, *ioaddr;
word *Xlog ; word *Xlog;
dword regs[4], i, size ; dword regs[4], i, size;
Xdesc xlogDesc ; Xdesc xlogDesc;
byte __iomem *Port; byte __iomem *Port;
/* /*
* first read pointers and trap frame * first read pointers and trap frame
*/ */
if ( !(Xlog = (word *)diva_os_malloc (0, MAX_XLOG_SIZE)) ) if (!(Xlog = (word *)diva_os_malloc(0, MAX_XLOG_SIZE)))
return ; return;
Port = DIVA_OS_MEM_ATTACH_PORT(IoAdapter); Port = DIVA_OS_MEM_ATTACH_PORT(IoAdapter);
addrHi = Port + ((IoAdapter->Properties.Bus == BUS_PCI) ? M_PCI_ADDRH : ADDRH) ; addrHi = Port + ((IoAdapter->Properties.Bus == BUS_PCI) ? M_PCI_ADDRH : ADDRH);
addrLo = Port + ADDR ; addrLo = Port + ADDR;
ioaddr = Port + DATA ; ioaddr = Port + DATA;
outpp (addrHi, 0) ; outpp(addrHi, 0);
outppw (addrLo, 0) ; outppw(addrLo, 0);
for ( i = 0 ; i < 0x100 ; Xlog[i++] = inppw(ioaddr) ) ; for (i = 0; i < 0x100; Xlog[i++] = inppw(ioaddr));
/* /*
* check for trapped MIPS 3xxx CPU, dump only exception frame * check for trapped MIPS 3xxx CPU, dump only exception frame
*/ */
if ( GET_DWORD(&Xlog[0x80 / sizeof(Xlog[0])]) == 0x99999999 ) if (GET_DWORD(&Xlog[0x80 / sizeof(Xlog[0])]) == 0x99999999)
{ {
dump_trap_frame (IoAdapter, &((byte *)Xlog)[0x90]) ; dump_trap_frame(IoAdapter, &((byte *)Xlog)[0x90]);
IoAdapter->trapped = 1 ; IoAdapter->trapped = 1;
} }
regs[0] = GET_DWORD(&((byte *)Xlog)[0x70]); regs[0] = GET_DWORD(&((byte *)Xlog)[0x70]);
regs[1] = GET_DWORD(&((byte *)Xlog)[0x74]); regs[1] = GET_DWORD(&((byte *)Xlog)[0x74]);
regs[2] = GET_DWORD(&((byte *)Xlog)[0x78]); regs[2] = GET_DWORD(&((byte *)Xlog)[0x78]);
regs[3] = GET_DWORD(&((byte *)Xlog)[0x7c]); regs[3] = GET_DWORD(&((byte *)Xlog)[0x7c]);
outpp (addrHi, (regs[1] >> 16) & 0x7F) ; outpp(addrHi, (regs[1] >> 16) & 0x7F);
outppw (addrLo, regs[1] & 0xFFFF) ; outppw(addrLo, regs[1] & 0xFFFF);
xlogDesc.cnt = inppw(ioaddr) ; xlogDesc.cnt = inppw(ioaddr);
outpp (addrHi, (regs[2] >> 16) & 0x7F) ; outpp(addrHi, (regs[2] >> 16) & 0x7F);
outppw (addrLo, regs[2] & 0xFFFF) ; outppw(addrLo, regs[2] & 0xFFFF);
xlogDesc.out = inppw(ioaddr) ; xlogDesc.out = inppw(ioaddr);
xlogDesc.buf = Xlog ; xlogDesc.buf = Xlog;
regs[0] &= IoAdapter->MemorySize - 1 ; regs[0] &= IoAdapter->MemorySize - 1;
if ( (regs[0] < IoAdapter->MemorySize - 1) ) if ((regs[0] < IoAdapter->MemorySize - 1))
{ {
size = IoAdapter->MemorySize - regs[0] ; size = IoAdapter->MemorySize - regs[0];
if ( size > MAX_XLOG_SIZE ) if (size > MAX_XLOG_SIZE)
size = MAX_XLOG_SIZE ; size = MAX_XLOG_SIZE;
for ( i = 0 ; i < (size / sizeof(*Xlog)) ; regs[0] += 2 ) for (i = 0; i < (size / sizeof(*Xlog)); regs[0] += 2)
{ {
outpp (addrHi, (regs[0] >> 16) & 0x7F) ; outpp(addrHi, (regs[0] >> 16) & 0x7F);
outppw (addrLo, regs[0] & 0xFFFF) ; outppw(addrLo, regs[0] & 0xFFFF);
Xlog[i++] = inppw(ioaddr) ; Xlog[i++] = inppw(ioaddr);
} }
dump_xlog_buffer (IoAdapter, &xlogDesc) ; dump_xlog_buffer(IoAdapter, &xlogDesc);
diva_os_free (0, Xlog) ; diva_os_free(0, Xlog);
IoAdapter->trapped = 2 ; IoAdapter->trapped = 2;
} }
outpp (addrHi, (byte)((BRI_UNCACHED_ADDR (IoAdapter->MemoryBase + IoAdapter->MemorySize - outpp(addrHi, (byte)((BRI_UNCACHED_ADDR(IoAdapter->MemoryBase + IoAdapter->MemorySize -
BRI_SHARED_RAM_SIZE)) >> 16)) ; BRI_SHARED_RAM_SIZE)) >> 16));
outppw (addrLo, 0x00) ; outppw(addrLo, 0x00);
DIVA_OS_MEM_DETACH_PORT(IoAdapter, Port); DIVA_OS_MEM_DETACH_PORT(IoAdapter, Port);
} }
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
Reset hardware Reset hardware
--------------------------------------------------------------------- */ --------------------------------------------------------------------- */
static void reset_bri_hardware (PISDN_ADAPTER IoAdapter) { static void reset_bri_hardware(PISDN_ADAPTER IoAdapter) {
byte __iomem *p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); byte __iomem *p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
outpp (p, 0x00) ; outpp(p, 0x00);
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
} }
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
Halt system Halt system
--------------------------------------------------------------------- */ --------------------------------------------------------------------- */
static void stop_bri_hardware (PISDN_ADAPTER IoAdapter) { static void stop_bri_hardware(PISDN_ADAPTER IoAdapter) {
byte __iomem *p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter); byte __iomem *p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter);
if (p) { if (p) {
outpp (p, 0x00) ; /* disable interrupts ! */ outpp(p, 0x00); /* disable interrupts ! */
} }
DIVA_OS_MEM_DETACH_RESET(IoAdapter, p); DIVA_OS_MEM_DETACH_RESET(IoAdapter, p);
p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
outpp (p, 0x00) ; /* clear int, halt cpu */ outpp(p, 0x00); /* clear int, halt cpu */
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
} }
static int load_bri_hardware (PISDN_ADAPTER IoAdapter) { static int load_bri_hardware(PISDN_ADAPTER IoAdapter) {
return (0); return (0);
} }
/******************************************************************************/ /******************************************************************************/
static int bri_ISR (struct _ISDN_ADAPTER* IoAdapter) { static int bri_ISR(struct _ISDN_ADAPTER *IoAdapter) {
byte __iomem *p; byte __iomem *p;
p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
if ( !(inpp (p) & 0x01) ) { if (!(inpp(p) & 0x01)) {
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
return (0) ; return (0);
} }
/* /*
clear interrupt line clear interrupt line
*/ */
outpp (p, 0x08) ; outpp(p, 0x08);
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
IoAdapter->IrqCount++ ; IoAdapter->IrqCount++;
if ( IoAdapter->Initialized ) { if (IoAdapter->Initialized) {
diva_os_schedule_soft_isr (&IoAdapter->isr_soft_isr); diva_os_schedule_soft_isr(&IoAdapter->isr_soft_isr);
} }
return (1) ; return (1);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Disable IRQ in the card hardware Disable IRQ in the card hardware
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void disable_bri_interrupt (PISDN_ADAPTER IoAdapter) { static void disable_bri_interrupt(PISDN_ADAPTER IoAdapter) {
byte __iomem *p; byte __iomem *p;
p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter); p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter);
if ( p ) if (p)
{ {
outpp (p, 0x00) ; /* disable interrupts ! */ outpp(p, 0x00); /* disable interrupts ! */
} }
DIVA_OS_MEM_DETACH_RESET(IoAdapter, p); DIVA_OS_MEM_DETACH_RESET(IoAdapter, p);
p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter); p = DIVA_OS_MEM_ATTACH_CTLREG(IoAdapter);
outpp (p, 0x00) ; /* clear int, halt cpu */ outpp(p, 0x00); /* clear int, halt cpu */
DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p); DIVA_OS_MEM_DETACH_CTLREG(IoAdapter, p);
} }
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Fill card entry points Fill card entry points
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void prepare_maestra_functions (PISDN_ADAPTER IoAdapter) { void prepare_maestra_functions(PISDN_ADAPTER IoAdapter) {
ADAPTER *a = &IoAdapter->a ; ADAPTER *a = &IoAdapter->a;
a->ram_in = io_in ; a->ram_in = io_in;
a->ram_inw = io_inw ; a->ram_inw = io_inw;
a->ram_in_buffer = io_in_buffer ; a->ram_in_buffer = io_in_buffer;
a->ram_look_ahead = io_look_ahead ; a->ram_look_ahead = io_look_ahead;
a->ram_out = io_out ; a->ram_out = io_out;
a->ram_outw = io_outw ; a->ram_outw = io_outw;
a->ram_out_buffer = io_out_buffer ; a->ram_out_buffer = io_out_buffer;
a->ram_inc = io_inc ; a->ram_inc = io_inc;
IoAdapter->MemoryBase = BRI_MEMORY_BASE ; IoAdapter->MemoryBase = BRI_MEMORY_BASE;
IoAdapter->MemorySize = BRI_MEMORY_SIZE ; IoAdapter->MemorySize = BRI_MEMORY_SIZE;
IoAdapter->out = pr_out ; IoAdapter->out = pr_out;
IoAdapter->dpc = pr_dpc ; IoAdapter->dpc = pr_dpc;
IoAdapter->tst_irq = scom_test_int ; IoAdapter->tst_irq = scom_test_int;
IoAdapter->clr_irq = scom_clear_int ; IoAdapter->clr_irq = scom_clear_int;
IoAdapter->pcm = (struct pc_maint *)MIPS_MAINT_OFFS ; IoAdapter->pcm = (struct pc_maint *)MIPS_MAINT_OFFS;
IoAdapter->load = load_bri_hardware ; IoAdapter->load = load_bri_hardware;
IoAdapter->disIrq = disable_bri_interrupt ; IoAdapter->disIrq = disable_bri_interrupt;
IoAdapter->rstFnc = reset_bri_hardware ; IoAdapter->rstFnc = reset_bri_hardware;
IoAdapter->stop = stop_bri_hardware ; IoAdapter->stop = stop_bri_hardware;
IoAdapter->trapFnc = bri_cpu_trapped ; IoAdapter->trapFnc = bri_cpu_trapped;
IoAdapter->diva_isr_handler = bri_ISR; IoAdapter->diva_isr_handler = bri_ISR;
/* /*
Prepare OS dependent functions Prepare OS dependent functions
*/ */
diva_os_prepare_maestra_functions (IoAdapter); diva_os_prepare_maestra_functions(IoAdapter);
} }
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */

View File

@@ -40,166 +40,166 @@
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Does return offset between ADAPTER->ram and real begin of memory Does return offset between ADAPTER->ram and real begin of memory
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
static dword pri_ram_offset (ADAPTER* a) { static dword pri_ram_offset(ADAPTER *a) {
return ((dword)MP_SHARED_RAM_OFFSET); return ((dword)MP_SHARED_RAM_OFFSET);
} }
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Recovery XLOG buffer from the card Recovery XLOG buffer from the card
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
static void pri_cpu_trapped (PISDN_ADAPTER IoAdapter) { static void pri_cpu_trapped(PISDN_ADAPTER IoAdapter) {
byte __iomem *base ; byte __iomem *base;
word *Xlog ; word *Xlog;
dword regs[4], TrapID, size ; dword regs[4], TrapID, size;
Xdesc xlogDesc ; Xdesc xlogDesc;
/* /*
* check for trapped MIPS 46xx CPU, dump exception frame * check for trapped MIPS 46xx CPU, dump exception frame
*/ */
base = DIVA_OS_MEM_ATTACH_ADDRESS(IoAdapter); base = DIVA_OS_MEM_ATTACH_ADDRESS(IoAdapter);
TrapID = READ_DWORD(&base[0x80]) ; TrapID = READ_DWORD(&base[0x80]);
if ( (TrapID == 0x99999999) || (TrapID == 0x99999901) ) if ((TrapID == 0x99999999) || (TrapID == 0x99999901))
{ {
dump_trap_frame (IoAdapter, &base[0x90]) ; dump_trap_frame(IoAdapter, &base[0x90]);
IoAdapter->trapped = 1 ; IoAdapter->trapped = 1;
} }
regs[0] = READ_DWORD(&base[MP_PROTOCOL_OFFSET + 0x70]); regs[0] = READ_DWORD(&base[MP_PROTOCOL_OFFSET + 0x70]);
regs[1] = READ_DWORD(&base[MP_PROTOCOL_OFFSET + 0x74]); regs[1] = READ_DWORD(&base[MP_PROTOCOL_OFFSET + 0x74]);
regs[2] = READ_DWORD(&base[MP_PROTOCOL_OFFSET + 0x78]); regs[2] = READ_DWORD(&base[MP_PROTOCOL_OFFSET + 0x78]);
regs[3] = READ_DWORD(&base[MP_PROTOCOL_OFFSET + 0x7c]); regs[3] = READ_DWORD(&base[MP_PROTOCOL_OFFSET + 0x7c]);
regs[0] &= IoAdapter->MemorySize - 1 ; regs[0] &= IoAdapter->MemorySize - 1;
if ( (regs[0] < IoAdapter->MemorySize - 1) ) if ((regs[0] < IoAdapter->MemorySize - 1))
{ {
if ( !(Xlog = (word *)diva_os_malloc (0, MAX_XLOG_SIZE)) ) { if (!(Xlog = (word *)diva_os_malloc(0, MAX_XLOG_SIZE))) {
DIVA_OS_MEM_DETACH_ADDRESS(IoAdapter, base); DIVA_OS_MEM_DETACH_ADDRESS(IoAdapter, base);
return ; return;
} }
size = IoAdapter->MemorySize - regs[0] ; size = IoAdapter->MemorySize - regs[0];
if ( size > MAX_XLOG_SIZE ) if (size > MAX_XLOG_SIZE)
size = MAX_XLOG_SIZE ; size = MAX_XLOG_SIZE;
memcpy_fromio(Xlog, &base[regs[0]], size) ; memcpy_fromio(Xlog, &base[regs[0]], size);
xlogDesc.buf = Xlog ; xlogDesc.buf = Xlog;
xlogDesc.cnt = READ_WORD(&base[regs[1] & (IoAdapter->MemorySize - 1)]) ; xlogDesc.cnt = READ_WORD(&base[regs[1] & (IoAdapter->MemorySize - 1)]);
xlogDesc.out = READ_WORD(&base[regs[2] & (IoAdapter->MemorySize - 1)]) ; xlogDesc.out = READ_WORD(&base[regs[2] & (IoAdapter->MemorySize - 1)]);
dump_xlog_buffer (IoAdapter, &xlogDesc) ; dump_xlog_buffer(IoAdapter, &xlogDesc);
diva_os_free (0, Xlog) ; diva_os_free(0, Xlog);
IoAdapter->trapped = 2 ; IoAdapter->trapped = 2;
} }
DIVA_OS_MEM_DETACH_ADDRESS(IoAdapter, base); DIVA_OS_MEM_DETACH_ADDRESS(IoAdapter, base);
} }
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Hardware reset of PRI card Hardware reset of PRI card
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
static void reset_pri_hardware (PISDN_ADAPTER IoAdapter) { static void reset_pri_hardware(PISDN_ADAPTER IoAdapter) {
byte __iomem *p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter); byte __iomem *p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter);
WRITE_BYTE(p, _MP_RISC_RESET | _MP_LED1 | _MP_LED2); WRITE_BYTE(p, _MP_RISC_RESET | _MP_LED1 | _MP_LED2);
diva_os_wait (50) ; diva_os_wait(50);
WRITE_BYTE(p, 0x00); WRITE_BYTE(p, 0x00);
diva_os_wait (50) ; diva_os_wait(50);
DIVA_OS_MEM_DETACH_RESET(IoAdapter, p); DIVA_OS_MEM_DETACH_RESET(IoAdapter, p);
} }
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Stop Card Hardware Stop Card Hardware
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
static void stop_pri_hardware (PISDN_ADAPTER IoAdapter) { static void stop_pri_hardware(PISDN_ADAPTER IoAdapter) {
dword i; dword i;
byte __iomem *p; byte __iomem *p;
dword volatile __iomem *cfgReg = (void __iomem *)DIVA_OS_MEM_ATTACH_CFG(IoAdapter); dword volatile __iomem *cfgReg = (void __iomem *)DIVA_OS_MEM_ATTACH_CFG(IoAdapter);
WRITE_DWORD(&cfgReg[3], 0); WRITE_DWORD(&cfgReg[3], 0);
WRITE_DWORD(&cfgReg[1], 0); WRITE_DWORD(&cfgReg[1], 0);
DIVA_OS_MEM_DETACH_CFG(IoAdapter, cfgReg); DIVA_OS_MEM_DETACH_CFG(IoAdapter, cfgReg);
IoAdapter->a.ram_out (&IoAdapter->a, &RAM->SWReg, SWREG_HALT_CPU) ; IoAdapter->a.ram_out(&IoAdapter->a, &RAM->SWReg, SWREG_HALT_CPU);
i = 0 ; i = 0;
while ( (i < 100) && (IoAdapter->a.ram_in (&IoAdapter->a, &RAM->SWReg) != 0) ) while ((i < 100) && (IoAdapter->a.ram_in(&IoAdapter->a, &RAM->SWReg) != 0))
{ {
diva_os_wait (1) ; diva_os_wait(1);
i++ ; i++;
} }
DBG_TRC(("%s: PRI stopped (%d)", IoAdapter->Name, i)) DBG_TRC(("%s: PRI stopped (%d)", IoAdapter->Name, i))
cfgReg = (void __iomem *)DIVA_OS_MEM_ATTACH_CFG(IoAdapter); cfgReg = (void __iomem *)DIVA_OS_MEM_ATTACH_CFG(IoAdapter);
WRITE_DWORD(&cfgReg[0],((dword)(~0x03E00000))); WRITE_DWORD(&cfgReg[0], ((dword)(~0x03E00000)));
DIVA_OS_MEM_DETACH_CFG(IoAdapter, cfgReg); DIVA_OS_MEM_DETACH_CFG(IoAdapter, cfgReg);
diva_os_wait (1) ; diva_os_wait(1);
p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter); p = DIVA_OS_MEM_ATTACH_RESET(IoAdapter);
WRITE_BYTE(p, _MP_RISC_RESET | _MP_LED1 | _MP_LED2); WRITE_BYTE(p, _MP_RISC_RESET | _MP_LED1 | _MP_LED2);
DIVA_OS_MEM_DETACH_RESET(IoAdapter, p); DIVA_OS_MEM_DETACH_RESET(IoAdapter, p);
} }
static int load_pri_hardware (PISDN_ADAPTER IoAdapter) { static int load_pri_hardware(PISDN_ADAPTER IoAdapter) {
return (0); return (0);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
PRI Adapter interrupt Service Routine PRI Adapter interrupt Service Routine
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static int pri_ISR (struct _ISDN_ADAPTER* IoAdapter) { static int pri_ISR(struct _ISDN_ADAPTER *IoAdapter) {
byte __iomem *cfg = DIVA_OS_MEM_ATTACH_CFG(IoAdapter); byte __iomem *cfg = DIVA_OS_MEM_ATTACH_CFG(IoAdapter);
if ( !(READ_DWORD(cfg) & 0x80000000) ) { if (!(READ_DWORD(cfg) & 0x80000000)) {
DIVA_OS_MEM_DETACH_CFG(IoAdapter, cfg); DIVA_OS_MEM_DETACH_CFG(IoAdapter, cfg);
return (0) ; return (0);
} }
/* /*
clear interrupt line clear interrupt line
*/ */
WRITE_DWORD(cfg, (dword)~0x03E00000) ; WRITE_DWORD(cfg, (dword)~0x03E00000);
DIVA_OS_MEM_DETACH_CFG(IoAdapter, cfg); DIVA_OS_MEM_DETACH_CFG(IoAdapter, cfg);
IoAdapter->IrqCount++ ; IoAdapter->IrqCount++;
if ( IoAdapter->Initialized ) if (IoAdapter->Initialized)
{ {
diva_os_schedule_soft_isr (&IoAdapter->isr_soft_isr); diva_os_schedule_soft_isr(&IoAdapter->isr_soft_isr);
} }
return (1) ; return (1);
} }
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Disable interrupt in the card hardware Disable interrupt in the card hardware
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
static void disable_pri_interrupt (PISDN_ADAPTER IoAdapter) { static void disable_pri_interrupt(PISDN_ADAPTER IoAdapter) {
dword volatile __iomem *cfgReg = (dword volatile __iomem *)DIVA_OS_MEM_ATTACH_CFG(IoAdapter) ; dword volatile __iomem *cfgReg = (dword volatile __iomem *)DIVA_OS_MEM_ATTACH_CFG(IoAdapter);
WRITE_DWORD(&cfgReg[3], 0); WRITE_DWORD(&cfgReg[3], 0);
WRITE_DWORD(&cfgReg[1], 0); WRITE_DWORD(&cfgReg[1], 0);
WRITE_DWORD(&cfgReg[0], (dword)(~0x03E00000)) ; WRITE_DWORD(&cfgReg[0], (dword)(~0x03E00000));
DIVA_OS_MEM_DETACH_CFG(IoAdapter, cfgReg); DIVA_OS_MEM_DETACH_CFG(IoAdapter, cfgReg);
} }
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Install entry points for PRI Adapter Install entry points for PRI Adapter
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
static void prepare_common_pri_functions (PISDN_ADAPTER IoAdapter) { static void prepare_common_pri_functions(PISDN_ADAPTER IoAdapter) {
ADAPTER *a = &IoAdapter->a ; ADAPTER *a = &IoAdapter->a;
a->ram_in = mem_in ; a->ram_in = mem_in;
a->ram_inw = mem_inw ; a->ram_inw = mem_inw;
a->ram_in_buffer = mem_in_buffer ; a->ram_in_buffer = mem_in_buffer;
a->ram_look_ahead = mem_look_ahead ; a->ram_look_ahead = mem_look_ahead;
a->ram_out = mem_out ; a->ram_out = mem_out;
a->ram_outw = mem_outw ; a->ram_outw = mem_outw;
a->ram_out_buffer = mem_out_buffer ; a->ram_out_buffer = mem_out_buffer;
a->ram_inc = mem_inc ; a->ram_inc = mem_inc;
a->ram_offset = pri_ram_offset ; a->ram_offset = pri_ram_offset;
a->ram_out_dw = mem_out_dw; a->ram_out_dw = mem_out_dw;
a->ram_in_dw = mem_in_dw; a->ram_in_dw = mem_in_dw;
a->istream_wakeup = pr_stream; a->istream_wakeup = pr_stream;
IoAdapter->out = pr_out ; IoAdapter->out = pr_out;
IoAdapter->dpc = pr_dpc ; IoAdapter->dpc = pr_dpc;
IoAdapter->tst_irq = scom_test_int ; IoAdapter->tst_irq = scom_test_int;
IoAdapter->clr_irq = scom_clear_int ; IoAdapter->clr_irq = scom_clear_int;
IoAdapter->pcm = (struct pc_maint *)(MIPS_MAINT_OFFS IoAdapter->pcm = (struct pc_maint *)(MIPS_MAINT_OFFS
- MP_SHARED_RAM_OFFSET) ; - MP_SHARED_RAM_OFFSET);
IoAdapter->load = load_pri_hardware ; IoAdapter->load = load_pri_hardware;
IoAdapter->disIrq = disable_pri_interrupt ; IoAdapter->disIrq = disable_pri_interrupt;
IoAdapter->rstFnc = reset_pri_hardware ; IoAdapter->rstFnc = reset_pri_hardware;
IoAdapter->stop = stop_pri_hardware ; IoAdapter->stop = stop_pri_hardware;
IoAdapter->trapFnc = pri_cpu_trapped ; IoAdapter->trapFnc = pri_cpu_trapped;
IoAdapter->diva_isr_handler = pri_ISR; IoAdapter->diva_isr_handler = pri_ISR;
} }
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Install entry points for PRI Adapter Install entry points for PRI Adapter
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void prepare_pri_functions (PISDN_ADAPTER IoAdapter) { void prepare_pri_functions(PISDN_ADAPTER IoAdapter) {
IoAdapter->MemorySize = MP_MEMORY_SIZE ; IoAdapter->MemorySize = MP_MEMORY_SIZE;
prepare_common_pri_functions (IoAdapter) ; prepare_common_pri_functions(IoAdapter);
diva_os_prepare_pri_functions (IoAdapter); diva_os_prepare_pri_functions(IoAdapter);
} }
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
Install entry points for PRI Rev.2 Adapter Install entry points for PRI Rev.2 Adapter
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void prepare_pri2_functions (PISDN_ADAPTER IoAdapter) { void prepare_pri2_functions(PISDN_ADAPTER IoAdapter) {
IoAdapter->MemorySize = MP2_MEMORY_SIZE ; IoAdapter->MemorySize = MP2_MEMORY_SIZE;
prepare_common_pri_functions (IoAdapter) ; prepare_common_pri_functions(IoAdapter);
diva_os_prepare_pri2_functions (IoAdapter); diva_os_prepare_pri2_functions(IoAdapter);
} }
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */

View File

@@ -28,8 +28,8 @@
/* /*
The soft DSP image is described by binary header contained on begin of this The soft DSP image is described by binary header contained on begin of this
image: image:
OFFSET FROM IMAGE START | VARIABLE OFFSET FROM IMAGE START | VARIABLE
------------------------------------------------------------------------ ------------------------------------------------------------------------
DIVA_MIPS_TASK_IMAGE_LINK_OFFS | link to the next image DIVA_MIPS_TASK_IMAGE_LINK_OFFS | link to the next image
---------------------------------------------------------------------- ----------------------------------------------------------------------
DIVA_MIPS_TASK_IMAGE_GP_OFFS | image gp register value, void* DIVA_MIPS_TASK_IMAGE_GP_OFFS | image gp register value, void*
@@ -42,7 +42,7 @@ OFFSET FROM IMAGE START | VARIABLE
---------------------------------------------------------------------- ----------------------------------------------------------------------
DIVA_MIPS_TASK_IMAGE_ID_STRING_OFFS | image id string char[...]; DIVA_MIPS_TASK_IMAGE_ID_STRING_OFFS | image id string char[...];
---------------------------------------------------------------------- ----------------------------------------------------------------------
*/ */
#define DIVA_MIPS_TASK_IMAGE_LINK_OFFS 0x6C #define DIVA_MIPS_TASK_IMAGE_LINK_OFFS 0x6C
#define DIVA_MIPS_TASK_IMAGE_GP_OFFS 0x70 #define DIVA_MIPS_TASK_IMAGE_GP_OFFS 0x70
#define DIVA_MIPS_TASK_IMAGE_ENTRY_OFFS 0x74 #define DIVA_MIPS_TASK_IMAGE_ENTRY_OFFS 0x74
@@ -53,38 +53,38 @@ OFFSET FROM IMAGE START | VARIABLE
This function is called in order to set GP register of this task This function is called in order to set GP register of this task
This function should be always called before any function of the This function should be always called before any function of the
task is called task is called
*/ */
typedef void (*diva_task_set_prog_gp_proc_t)(void* new_gp); typedef void (*diva_task_set_prog_gp_proc_t)(void *new_gp);
/* /*
This function is called to clear .bss at task initialization step This function is called to clear .bss at task initialization step
*/ */
typedef void (*diva_task_sys_reset_proc_t)(void); typedef void (*diva_task_sys_reset_proc_t)(void);
/* /*
This function is called in order to provide GP of master call to This function is called in order to provide GP of master call to
task, that will be used by calls from the task to the master task, that will be used by calls from the task to the master
*/ */
typedef void (*diva_task_set_main_gp_proc_t)(void* main_gp); typedef void (*diva_task_set_main_gp_proc_t)(void *main_gp);
/* /*
This function is called to provide address of 'dprintf' function This function is called to provide address of 'dprintf' function
to the task to the task
*/ */
typedef word (*diva_prt_proc_t)(char *, ...); typedef word (*diva_prt_proc_t)(char *, ...);
typedef void (*diva_task_set_prt_proc_t)(diva_prt_proc_t fn); typedef void (*diva_task_set_prt_proc_t)(diva_prt_proc_t fn);
/* /*
This function is called to set task PID This function is called to set task PID
*/ */
typedef void (*diva_task_set_pid_proc_t)(dword id); typedef void (*diva_task_set_pid_proc_t)(dword id);
/* /*
This function is called for run-time task init This function is called for run-time task init
*/ */
typedef int (*diva_task_run_time_init_proc_t)(void*, dword); typedef int (*diva_task_run_time_init_proc_t)(void*, dword);
/* /*
This function is called from system scheduler or from timer This function is called from system scheduler or from timer
*/ */
typedef void (*diva_task_callback_proc_t)(void); typedef void (*diva_task_callback_proc_t)(void);
/* /*
This callback is used by task to get current time im mS This callback is used by task to get current time im mS
*/ */
typedef dword (*diva_task_get_tick_count_proc_t)(void); typedef dword (*diva_task_get_tick_count_proc_t)(void);
typedef void (*diva_task_set_get_time_proc_t)(\ typedef void (*diva_task_set_get_time_proc_t)(\
diva_task_get_tick_count_proc_t fn); diva_task_get_tick_count_proc_t fn);
@@ -98,15 +98,15 @@ typedef struct _diva_mips_sdp_task_entry {
diva_task_callback_proc_t task_callback_proc; diva_task_callback_proc_t task_callback_proc;
diva_task_callback_proc_t timer_callback_proc; diva_task_callback_proc_t timer_callback_proc;
diva_task_set_get_time_proc_t set_get_time_proc; diva_task_set_get_time_proc_t set_get_time_proc;
void* last_entry_proc; void *last_entry_proc;
} diva_mips_sdp_task_entry_t; } diva_mips_sdp_task_entry_t;
/* /*
'last_entry_proc' should be set to zero and is used for future extensuios 'last_entry_proc' should be set to zero and is used for future extensuios
*/ */
typedef struct _diva_mips_sw_task { typedef struct _diva_mips_sw_task {
diva_mips_sdp_task_entry_t sdp_entry; diva_mips_sdp_task_entry_t sdp_entry;
void* sdp_gp_reg; void *sdp_gp_reg;
void* own_gp_reg; void *own_gp_reg;
} diva_mips_sw_task_t; } diva_mips_sw_task_t;
#if !defined(DIVA_BRI2F_SDP_1_NAME) #if !defined(DIVA_BRI2F_SDP_1_NAME)
#define DIVA_BRI2F_SDP_1_NAME "sdp0.2q0" #define DIVA_BRI2F_SDP_1_NAME "sdp0.2q0"

View File

@@ -25,16 +25,16 @@ static LIST_HEAD(adapter_q);
static diva_os_spin_lock_t adapter_lock; static diva_os_spin_lock_t adapter_lock;
static diva_um_idi_adapter_t *diva_um_idi_find_adapter(dword nr); static diva_um_idi_adapter_t *diva_um_idi_find_adapter(dword nr);
static void cleanup_adapter(diva_um_idi_adapter_t * a); static void cleanup_adapter(diva_um_idi_adapter_t *a);
static void cleanup_entity(divas_um_idi_entity_t * e); static void cleanup_entity(divas_um_idi_entity_t *e);
static int diva_user_mode_idi_adapter_features(diva_um_idi_adapter_t * a, static int diva_user_mode_idi_adapter_features(diva_um_idi_adapter_t *a,
diva_um_idi_adapter_features_t diva_um_idi_adapter_features_t
* features); *features);
static int process_idi_request(divas_um_idi_entity_t * e, static int process_idi_request(divas_um_idi_entity_t *e,
const diva_um_idi_req_hdr_t * req); const diva_um_idi_req_hdr_t *req);
static int process_idi_rc(divas_um_idi_entity_t * e, byte rc); static int process_idi_rc(divas_um_idi_entity_t *e, byte rc);
static int process_idi_ind(divas_um_idi_entity_t * e, byte ind); static int process_idi_ind(divas_um_idi_entity_t *e, byte ind);
static int write_return_code(divas_um_idi_entity_t * e, byte rc); static int write_return_code(divas_um_idi_entity_t *e, byte rc);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
MAIN MAIN
@@ -49,7 +49,7 @@ int diva_user_mode_idi_init(void)
Copy adapter features to user supplied buffer Copy adapter features to user supplied buffer
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static int static int
diva_user_mode_idi_adapter_features(diva_um_idi_adapter_t * a, diva_user_mode_idi_adapter_features(diva_um_idi_adapter_t *a,
diva_um_idi_adapter_features_t * diva_um_idi_adapter_features_t *
features) features)
{ {
@@ -63,14 +63,14 @@ diva_user_mode_idi_adapter_features(diva_um_idi_adapter_t * a,
sync_req.GetName.Req = 0; sync_req.GetName.Req = 0;
sync_req.GetName.Rc = IDI_SYNC_REQ_GET_NAME; sync_req.GetName.Rc = IDI_SYNC_REQ_GET_NAME;
(*(a->d.request)) ((ENTITY *) & sync_req); (*(a->d.request)) ((ENTITY *)&sync_req);
strlcpy(features->name, sync_req.GetName.name, strlcpy(features->name, sync_req.GetName.name,
sizeof(features->name)); sizeof(features->name));
sync_req.GetSerial.Req = 0; sync_req.GetSerial.Req = 0;
sync_req.GetSerial.Rc = IDI_SYNC_REQ_GET_SERIAL; sync_req.GetSerial.Rc = IDI_SYNC_REQ_GET_SERIAL;
sync_req.GetSerial.serial = 0; sync_req.GetSerial.serial = 0;
(*(a->d.request)) ((ENTITY *) & sync_req); (*(a->d.request))((ENTITY *)&sync_req);
features->serial_number = sync_req.GetSerial.serial; features->serial_number = sync_req.GetSerial.serial;
} }
@@ -118,7 +118,7 @@ void diva_user_mode_idi_finit(void)
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
CREATE AND INIT IDI ADAPTER CREATE AND INIT IDI ADAPTER
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
int diva_user_mode_idi_create_adapter(const DESCRIPTOR * d, int adapter_nr) int diva_user_mode_idi_create_adapter(const DESCRIPTOR *d, int adapter_nr)
{ {
diva_os_spin_lock_magic_t old_irql; diva_os_spin_lock_magic_t old_irql;
diva_um_idi_adapter_t *a = diva_um_idi_adapter_t *a =
@@ -159,14 +159,14 @@ static diva_um_idi_adapter_t *diva_um_idi_find_adapter(dword nr)
break; break;
a = NULL; a = NULL;
} }
return(a); return (a);
} }
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
Cleanup this adapter and cleanup/delete all entities assigned Cleanup this adapter and cleanup/delete all entities assigned
to this adapter to this adapter
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
static void cleanup_adapter(diva_um_idi_adapter_t * a) static void cleanup_adapter(diva_um_idi_adapter_t *a)
{ {
struct list_head *tmp, *safe; struct list_head *tmp, *safe;
divas_um_idi_entity_t *e; divas_um_idi_entity_t *e;
@@ -186,7 +186,7 @@ static void cleanup_adapter(diva_um_idi_adapter_t * a)
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
Cleanup, but NOT delete this entity Cleanup, but NOT delete this entity
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
static void cleanup_entity(divas_um_idi_entity_t * e) static void cleanup_entity(divas_um_idi_entity_t *e)
{ {
e->os_ref = NULL; e->os_ref = NULL;
e->status = 0; e->status = 0;
@@ -426,7 +426,7 @@ int diva_um_idi_write(void *entity,
return (ret); return (ret);
} }
req = (diva_um_idi_req_hdr_t *) & e->buffer[0]; req = (diva_um_idi_req_hdr_t *)&e->buffer[0];
switch (req->type) { switch (req->type) {
case DIVA_UM_IDI_GET_FEATURES:{ case DIVA_UM_IDI_GET_FEATURES:{
@@ -488,7 +488,7 @@ int diva_um_idi_write(void *entity,
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
CALLBACK FROM XDI CALLBACK FROM XDI
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static void diva_um_idi_xdi_callback(ENTITY * entity) static void diva_um_idi_xdi_callback(ENTITY *entity)
{ {
divas_um_idi_entity_t *e = DIVAS_CONTAINING_RECORD(entity, divas_um_idi_entity_t *e = DIVAS_CONTAINING_RECORD(entity,
divas_um_idi_entity_t, divas_um_idi_entity_t,
@@ -529,8 +529,8 @@ static void diva_um_idi_xdi_callback(ENTITY * entity)
} }
} }
static int process_idi_request(divas_um_idi_entity_t * e, static int process_idi_request(divas_um_idi_entity_t *e,
const diva_um_idi_req_hdr_t * req) const diva_um_idi_req_hdr_t *req)
{ {
int assign = 0; int assign = 0;
byte Req = (byte) req->Req; byte Req = (byte) req->Req;
@@ -579,7 +579,7 @@ static int process_idi_request(divas_um_idi_entity_t * e,
e->e.Req = Req; e->e.Req = Req;
e->e.ReqCh = (byte) req->ReqCh; e->e.ReqCh = (byte) req->ReqCh;
e->e.X->PLength = (word) req->data_length; e->e.X->PLength = (word) req->data_length;
e->e.X->P = (byte *) & req[1]; /* Our buffer is safe */ e->e.X->P = (byte *)&req[1]; /* Our buffer is safe */
DBG_TRC(("A(%d) E(%08x) request(%02x-%02x-%02x (%d))", DBG_TRC(("A(%d) E(%08x) request(%02x-%02x-%02x (%d))",
e->adapter->adapter_nr, e, e->e.Id, e->e.Req, e->adapter->adapter_nr, e, e->e.Id, e->e.Req,
@@ -621,7 +621,7 @@ static int process_idi_request(divas_um_idi_entity_t * e,
return (0); return (0);
} }
static int process_idi_rc(divas_um_idi_entity_t * e, byte rc) static int process_idi_rc(divas_um_idi_entity_t *e, byte rc)
{ {
DBG_TRC(("A(%d) E(%08x) rc(%02x-%02x-%02x)", DBG_TRC(("A(%d) E(%08x) rc(%02x-%02x-%02x)",
e->adapter->adapter_nr, e, e->e.Id, rc, e->e.RcCh)); e->adapter->adapter_nr, e, e->e.Id, rc, e->e.RcCh));
@@ -674,7 +674,7 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc)
return (1); return (1);
} }
static int process_idi_ind(divas_um_idi_entity_t * e, byte ind) static int process_idi_ind(divas_um_idi_entity_t *e, byte ind)
{ {
int do_wakeup = 0; int do_wakeup = 0;
@@ -684,7 +684,7 @@ static int process_idi_ind(divas_um_idi_entity_t * e, byte ind)
diva_data_q_get_segment4write(&e->data); diva_data_q_get_segment4write(&e->data);
if (pind) { if (pind) {
e->e.RNum = 1; e->e.RNum = 1;
e->e.R->P = (byte *) & pind[1]; e->e.R->P = (byte *)&pind[1];
e->e.R->PLength = e->e.R->PLength =
(word) (diva_data_q_get_max_length(&e->data) - (word) (diva_data_q_get_max_length(&e->data) -
sizeof(*pind)); sizeof(*pind));
@@ -730,7 +730,7 @@ static int process_idi_ind(divas_um_idi_entity_t * e, byte ind)
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Write return code to the return code queue of entity Write return code to the return code queue of entity
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
static int write_return_code(divas_um_idi_entity_t * e, byte rc) static int write_return_code(divas_um_idi_entity_t *e, byte rc)
{ {
diva_um_idi_ind_hdr_t *prc; diva_um_idi_ind_hdr_t *prc;

View File

@@ -6,7 +6,7 @@
/* /*
interface between UM IDI core and OS dependent part interface between UM IDI core and OS dependent part
*/ */
int diva_user_mode_idi_init(void); int diva_user_mode_idi_init(void);
void diva_user_mode_idi_finit(void); void diva_user_mode_idi_finit(void);
void *divas_um_idi_create_entity(dword adapter_nr, void *file); void *divas_um_idi_create_entity(dword adapter_nr, void *file);

View File

@@ -24,11 +24,11 @@ typedef union _divas_card_resources {
} divas_card_resources_t; } divas_card_resources_t;
struct _diva_os_xdi_adapter; struct _diva_os_xdi_adapter;
typedef int (*diva_init_card_proc_t) (struct _diva_os_xdi_adapter * a); typedef int (*diva_init_card_proc_t)(struct _diva_os_xdi_adapter *a);
typedef int (*diva_cmd_card_proc_t) (struct _diva_os_xdi_adapter * a, typedef int (*diva_cmd_card_proc_t)(struct _diva_os_xdi_adapter *a,
diva_xdi_um_cfg_cmd_t * data, diva_xdi_um_cfg_cmd_t *data,
int length); int length);
typedef void (*diva_xdi_clear_interrupts_proc_t) (struct typedef void (*diva_xdi_clear_interrupts_proc_t)(struct
_diva_os_xdi_adapter *); _diva_os_xdi_adapter *);
#define DIVA_XDI_MBOX_BUSY 1 #define DIVA_XDI_MBOX_BUSY 1

Some files were not shown because too many files have changed in this diff Show More