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:
@@ -164,7 +164,7 @@ static int capiminor_del_ack(struct capiminor *mp, u16 datahandle)
|
||||
|
||||
spin_lock_bh(&mp->ackqlock);
|
||||
list_for_each_entry_safe(p, tmp, &mp->ackqueue, list) {
|
||||
if (p->datahandle == datahandle) {
|
||||
if (p->datahandle == datahandle) {
|
||||
list_del(&p->list);
|
||||
mp->nack--;
|
||||
spin_unlock_bh(&mp->ackqlock);
|
||||
@@ -199,8 +199,8 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
|
||||
unsigned int minor;
|
||||
|
||||
mp = kzalloc(sizeof(*mp), GFP_KERNEL);
|
||||
if (!mp) {
|
||||
printk(KERN_ERR "capi: can't alloc capiminor\n");
|
||||
if (!mp) {
|
||||
printk(KERN_ERR "capi: can't alloc capiminor\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
|
||||
struct sk_buff *nskb;
|
||||
nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_KERNEL);
|
||||
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);
|
||||
capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN);
|
||||
capimsg_setu16(s, 2, mp->ap->applid);
|
||||
@@ -418,7 +418,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
|
||||
pr_debug("capi: currently no receiver\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
ld = tty_ldisc_ref(tty);
|
||||
if (!ld) {
|
||||
/* fatal error, do not requeue */
|
||||
@@ -459,7 +459,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
|
||||
ld->ops->receive_buf(tty, skb->data, NULL, skb->len);
|
||||
} else {
|
||||
printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n",
|
||||
errcode);
|
||||
errcode);
|
||||
kfree_skb(nskb);
|
||||
|
||||
if (errcode == CAPI_SENDQUEUEFULL)
|
||||
@@ -618,7 +618,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
|
||||
goto unlock_out;
|
||||
}
|
||||
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",
|
||||
datahandle, skb->len-CAPIMSG_LEN(skb->data));
|
||||
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) {
|
||||
|
||||
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",
|
||||
datahandle,
|
||||
CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+2));
|
||||
CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 2));
|
||||
kfree_skb(skb);
|
||||
capiminor_del_ack(mp, datahandle);
|
||||
tty = tty_port_tty_get(&mp->port);
|
||||
@@ -669,7 +669,7 @@ capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||
if (file->f_flags & O_NONBLOCK)
|
||||
return -EAGAIN;
|
||||
err = wait_event_interruptible(cdev->recvwait,
|
||||
(skb = skb_dequeue(&cdev->recvqueue)));
|
||||
(skb = skb_dequeue(&cdev->recvqueue)));
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
@@ -736,7 +736,7 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
|
||||
}
|
||||
|
||||
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;
|
||||
unsigned int mask = 0;
|
||||
@@ -786,75 +786,75 @@ register_out:
|
||||
return retval;
|
||||
|
||||
case CAPI_GET_VERSION:
|
||||
{
|
||||
if (copy_from_user(&data.contr, argp,
|
||||
sizeof(data.contr)))
|
||||
return -EFAULT;
|
||||
cdev->errcode = capi20_get_version(data.contr, &data.version);
|
||||
if (cdev->errcode)
|
||||
return -EIO;
|
||||
if (copy_to_user(argp, &data.version,
|
||||
sizeof(data.version)))
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
{
|
||||
if (copy_from_user(&data.contr, argp,
|
||||
sizeof(data.contr)))
|
||||
return -EFAULT;
|
||||
cdev->errcode = capi20_get_version(data.contr, &data.version);
|
||||
if (cdev->errcode)
|
||||
return -EIO;
|
||||
if (copy_to_user(argp, &data.version,
|
||||
sizeof(data.version)))
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case CAPI_GET_SERIAL:
|
||||
{
|
||||
if (copy_from_user(&data.contr, argp,
|
||||
sizeof(data.contr)))
|
||||
return -EFAULT;
|
||||
cdev->errcode = capi20_get_serial (data.contr, data.serial);
|
||||
{
|
||||
if (copy_from_user(&data.contr, argp,
|
||||
sizeof(data.contr)))
|
||||
return -EFAULT;
|
||||
cdev->errcode = capi20_get_serial(data.contr, data.serial);
|
||||
if (cdev->errcode)
|
||||
return -EIO;
|
||||
if (copy_to_user(argp, data.serial,
|
||||
sizeof(data.serial)))
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
case CAPI_GET_PROFILE:
|
||||
{
|
||||
if (copy_from_user(&data.contr, argp,
|
||||
sizeof(data.contr)))
|
||||
return -EFAULT;
|
||||
|
||||
if (data.contr == 0) {
|
||||
cdev->errcode = capi20_get_profile(data.contr, &data.profile);
|
||||
if (cdev->errcode)
|
||||
return -EIO;
|
||||
if (copy_to_user(argp, data.serial,
|
||||
sizeof(data.serial)))
|
||||
return -EFAULT;
|
||||
|
||||
retval = copy_to_user(argp,
|
||||
&data.profile.ncontroller,
|
||||
sizeof(data.profile.ncontroller));
|
||||
|
||||
} else {
|
||||
cdev->errcode = capi20_get_profile(data.contr, &data.profile);
|
||||
if (cdev->errcode)
|
||||
return -EIO;
|
||||
|
||||
retval = copy_to_user(argp, &data.profile,
|
||||
sizeof(data.profile));
|
||||
}
|
||||
return 0;
|
||||
case CAPI_GET_PROFILE:
|
||||
{
|
||||
if (copy_from_user(&data.contr, argp,
|
||||
sizeof(data.contr)))
|
||||
return -EFAULT;
|
||||
|
||||
if (data.contr == 0) {
|
||||
cdev->errcode = capi20_get_profile(data.contr, &data.profile);
|
||||
if (cdev->errcode)
|
||||
return -EIO;
|
||||
|
||||
retval = copy_to_user(argp,
|
||||
&data.profile.ncontroller,
|
||||
sizeof(data.profile.ncontroller));
|
||||
|
||||
} else {
|
||||
cdev->errcode = capi20_get_profile(data.contr, &data.profile);
|
||||
if (cdev->errcode)
|
||||
return -EIO;
|
||||
|
||||
retval = copy_to_user(argp, &data.profile,
|
||||
sizeof(data.profile));
|
||||
}
|
||||
if (retval)
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
if (retval)
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case CAPI_GET_MANUFACTURER:
|
||||
{
|
||||
if (copy_from_user(&data.contr, argp,
|
||||
sizeof(data.contr)))
|
||||
return -EFAULT;
|
||||
cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer);
|
||||
if (cdev->errcode)
|
||||
return -EIO;
|
||||
{
|
||||
if (copy_from_user(&data.contr, argp,
|
||||
sizeof(data.contr)))
|
||||
return -EFAULT;
|
||||
cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer);
|
||||
if (cdev->errcode)
|
||||
return -EIO;
|
||||
|
||||
if (copy_to_user(argp, data.manufacturer,
|
||||
sizeof(data.manufacturer)))
|
||||
return -EFAULT;
|
||||
if (copy_to_user(argp, data.manufacturer,
|
||||
sizeof(data.manufacturer)))
|
||||
return -EFAULT;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
case CAPI_GET_ERRCODE:
|
||||
data.errcode = cdev->errcode;
|
||||
cdev->errcode = CAPI_NOERROR;
|
||||
@@ -871,15 +871,15 @@ register_out:
|
||||
return -ENXIO;
|
||||
|
||||
case CAPI_MANUFACTURER_CMD:
|
||||
{
|
||||
struct capi_manufacturer_cmd mcmd;
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
if (copy_from_user(&mcmd, argp, sizeof(mcmd)))
|
||||
return -EFAULT;
|
||||
return capi20_manufacturer(mcmd.cmd, mcmd.data);
|
||||
}
|
||||
return 0;
|
||||
{
|
||||
struct capi_manufacturer_cmd mcmd;
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
if (copy_from_user(&mcmd, argp, sizeof(mcmd)))
|
||||
return -EFAULT;
|
||||
return capi20_manufacturer(mcmd.cmd, mcmd.data);
|
||||
}
|
||||
return 0;
|
||||
|
||||
case CAPI_SET_FLAGS:
|
||||
case CAPI_CLR_FLAGS: {
|
||||
@@ -1070,7 +1070,7 @@ static int capinc_tty_write(struct tty_struct *tty,
|
||||
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) {
|
||||
printk(KERN_ERR "capinc_tty_write: alloc_skb failed\n");
|
||||
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;
|
||||
}
|
||||
|
||||
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) {
|
||||
skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
|
||||
*(skb_put(skb, 1)) = ch;
|
||||
@@ -1175,12 +1175,12 @@ static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
|
||||
}
|
||||
|
||||
static int capinc_tty_ioctl(struct tty_struct *tty,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
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");
|
||||
}
|
||||
@@ -1344,18 +1344,18 @@ static inline void capinc_tty_exit(void) { }
|
||||
*/
|
||||
static int capi20_proc_show(struct seq_file *m, void *v)
|
||||
{
|
||||
struct capidev *cdev;
|
||||
struct capidev *cdev;
|
||||
struct list_head *l;
|
||||
|
||||
mutex_lock(&capidev_list_lock);
|
||||
list_for_each(l, &capidev_list) {
|
||||
cdev = list_entry(l, struct capidev, list);
|
||||
seq_printf(m, "0 %d %lu %lu %lu %lu\n",
|
||||
cdev->ap.applid,
|
||||
cdev->ap.nrecvctlpkt,
|
||||
cdev->ap.nrecvdatapkt,
|
||||
cdev->ap.nsentctlpkt,
|
||||
cdev->ap.nsentdatapkt);
|
||||
cdev->ap.applid,
|
||||
cdev->ap.nrecvctlpkt,
|
||||
cdev->ap.nrecvdatapkt,
|
||||
cdev->ap.nsentctlpkt,
|
||||
cdev->ap.nsentdatapkt);
|
||||
}
|
||||
mutex_unlock(&capidev_list_lock);
|
||||
return 0;
|
||||
@@ -1450,9 +1450,9 @@ static int __init capi_init(void)
|
||||
proc_init();
|
||||
|
||||
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
|
||||
compileinfo = " (middleware)";
|
||||
compileinfo = " (middleware)";
|
||||
#else
|
||||
compileinfo = " (no middleware)";
|
||||
compileinfo = " (no middleware)";
|
||||
#endif
|
||||
printk(KERN_NOTICE "CAPI 2.0 started up with major %d%s\n",
|
||||
capi_major, compileinfo);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,7 @@
|
||||
* per plci state machine
|
||||
*/
|
||||
#define ST_PLCI_NONE 0 /* P-0 */
|
||||
#define ST_PLCI_OUTGOING 1 /* P-0.1 */
|
||||
#define ST_PLCI_OUTGOING 1 /* P-0.1 */
|
||||
#define ST_PLCI_ALLOCATED 2 /* P-1 */
|
||||
#define ST_PLCI_ACTIVE 3 /* P-ACT */
|
||||
#define ST_PLCI_INCOMING 4 /* P-2 */
|
||||
@@ -47,20 +47,20 @@
|
||||
#define ST_PLCI_HELD 11 /* P-HELD */
|
||||
|
||||
#define EV_PLCI_CONNECT_REQ 1 /* P-0 -> P-0.1
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_CONNECT_CONF_ERROR 2 /* P-0.1 -> P-0
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_CONNECT_CONF_OK 3 /* P-0.1 -> P-1
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_FACILITY_IND_UP 4 /* P-0 -> P-1
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_CONNECT_IND 5 /* P-0 -> P-2
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_CONNECT_ACTIVE_IND 6 /* P-1 -> P-ACT
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_CONNECT_REJECT 7 /* P-2 -> P-5
|
||||
P-3 -> P-5
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_DISCONNECT_REQ 8 /* P-1 -> P-5
|
||||
P-2 -> P-5
|
||||
P-3 -> P-5
|
||||
@@ -68,7 +68,7 @@
|
||||
P-ACT -> P-5
|
||||
P-Res -> P-5 (*)
|
||||
P-HELD -> P-5 (*)
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_DISCONNECT_IND 9 /* P-1 -> P-6
|
||||
P-2 -> P-6
|
||||
P-3 -> P-6
|
||||
@@ -77,35 +77,35 @@
|
||||
P-ACT -> P-6
|
||||
P-Res -> P-6 (*)
|
||||
P-HELD -> P-6 (*)
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_FACILITY_IND_DOWN 10 /* P-0.1 -> P-5
|
||||
P-1 -> P-5
|
||||
P-ACT -> P-5
|
||||
P-2 -> P-5
|
||||
P-3 -> P-5
|
||||
P-4 -> P-5
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_DISCONNECT_RESP 11 /* P-6 -> P-0
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_CONNECT_RESP 12 /* P-6 -> P-0
|
||||
*/
|
||||
*/
|
||||
|
||||
#define EV_PLCI_RESUME_REQ 13 /* P-0 -> P-0.Res
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_RESUME_CONF_OK 14 /* P-0.Res -> P-Res
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_RESUME_CONF_ERROR 15 /* P-0.Res -> P-0
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_RESUME_IND 16 /* P-Res -> P-ACT
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_HOLD_IND 17 /* P-ACT -> P-HELD
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_RETRIEVE_IND 18 /* P-HELD -> P-ACT
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_SUSPEND_IND 19 /* P-ACT -> P-5
|
||||
*/
|
||||
*/
|
||||
#define EV_PLCI_CD_IND 20 /* P-2 -> P-5
|
||||
*/
|
||||
*/
|
||||
|
||||
/*
|
||||
* per ncci state machine
|
||||
|
@@ -4,9 +4,9 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/isdn/capilli.h>
|
||||
|
||||
#define DBG(format, arg...) do { \
|
||||
printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
|
||||
} while (0)
|
||||
#define DBG(format, arg...) do { \
|
||||
printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
|
||||
} while (0)
|
||||
|
||||
struct capilib_msgidqueue {
|
||||
struct capilib_msgidqueue *next;
|
||||
@@ -28,7 +28,7 @@ struct capilib_ncci {
|
||||
// ---------------------------------------------------------------------------
|
||||
// NCCI Handling
|
||||
|
||||
static inline void mq_init(struct capilib_ncci * np)
|
||||
static inline void mq_init(struct capilib_ncci *np)
|
||||
{
|
||||
u_int i;
|
||||
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;
|
||||
if ((mq = np->msgidfree) == NULL)
|
||||
@@ -59,7 +59,7 @@ static inline int mq_enqueue(struct capilib_ncci * np, u16 msgid)
|
||||
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;
|
||||
for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) {
|
||||
@@ -165,7 +165,7 @@ u16 capilib_data_b3_req(struct list_head *head, u16 applid, u32 ncci, u16 msgid)
|
||||
continue;
|
||||
if (np->ncci != ncci)
|
||||
continue;
|
||||
|
||||
|
||||
if (mq_enqueue(np, msgid) == 0)
|
||||
return CAPI_SENDQUEUEFULL;
|
||||
|
||||
@@ -188,7 +188,7 @@ void capilib_data_b3_conf(struct list_head *head, u16 applid, u32 ncci, u16 msgi
|
||||
continue;
|
||||
if (np->ncci != ncci)
|
||||
continue;
|
||||
|
||||
|
||||
if (mq_dequeue(np, msgid) == 0) {
|
||||
printk(KERN_ERR "kcapi: msgid %hu ncci 0x%x not on queue\n",
|
||||
msgid, ncci);
|
||||
|
@@ -25,149 +25,149 @@
|
||||
#ifndef CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON
|
||||
char *capi_info2str(u16 reason)
|
||||
{
|
||||
return "..";
|
||||
return "..";
|
||||
}
|
||||
#else
|
||||
char *capi_info2str(u16 reason)
|
||||
{
|
||||
switch (reason) {
|
||||
switch (reason) {
|
||||
|
||||
/*-- informative values (corresponding message was processed) -----*/
|
||||
case 0x0001:
|
||||
return "NCPI not supported by current protocol, NCPI ignored";
|
||||
return "NCPI not supported by current protocol, NCPI ignored";
|
||||
case 0x0002:
|
||||
return "Flags not supported by current protocol, flags ignored";
|
||||
return "Flags not supported by current protocol, flags ignored";
|
||||
case 0x0003:
|
||||
return "Alert already sent by another application";
|
||||
return "Alert already sent by another application";
|
||||
|
||||
/*-- error information concerning CAPI_REGISTER -----*/
|
||||
case 0x1001:
|
||||
return "Too many applications";
|
||||
return "Too many applications";
|
||||
case 0x1002:
|
||||
return "Logical block size too small, must be at least 128 Bytes";
|
||||
return "Logical block size too small, must be at least 128 Bytes";
|
||||
case 0x1003:
|
||||
return "Buffer exceeds 64 kByte";
|
||||
return "Buffer exceeds 64 kByte";
|
||||
case 0x1004:
|
||||
return "Message buffer size too small, must be at least 1024 Bytes";
|
||||
return "Message buffer size too small, must be at least 1024 Bytes";
|
||||
case 0x1005:
|
||||
return "Max. number of logical connections not supported";
|
||||
return "Max. number of logical connections not supported";
|
||||
case 0x1006:
|
||||
return "Reserved";
|
||||
return "Reserved";
|
||||
case 0x1007:
|
||||
return "The message could not be accepted because of an internal busy condition";
|
||||
return "The message could not be accepted because of an internal busy condition";
|
||||
case 0x1008:
|
||||
return "OS resource error (no memory ?)";
|
||||
return "OS resource error (no memory ?)";
|
||||
case 0x1009:
|
||||
return "CAPI not installed";
|
||||
return "CAPI not installed";
|
||||
case 0x100A:
|
||||
return "Controller does not support external equipment";
|
||||
return "Controller does not support external equipment";
|
||||
case 0x100B:
|
||||
return "Controller does only support external equipment";
|
||||
return "Controller does only support external equipment";
|
||||
|
||||
/*-- error information concerning message exchange functions -----*/
|
||||
case 0x1101:
|
||||
return "Illegal application number";
|
||||
return "Illegal application number";
|
||||
case 0x1102:
|
||||
return "Illegal command or subcommand or message length less than 12 bytes";
|
||||
return "Illegal command or subcommand or message length less than 12 bytes";
|
||||
case 0x1103:
|
||||
return "The message could not be accepted because of a queue full condition !! The error code does not imply that CAPI cannot receive messages directed to another controller, PLCI or NCCI";
|
||||
return "The message could not be accepted because of a queue full condition !! The error code does not imply that CAPI cannot receive messages directed to another controller, PLCI or NCCI";
|
||||
case 0x1104:
|
||||
return "Queue is empty";
|
||||
return "Queue is empty";
|
||||
case 0x1105:
|
||||
return "Queue overflow, a message was lost !! This indicates a configuration error. The only recovery from this error is to perform a CAPI_RELEASE";
|
||||
return "Queue overflow, a message was lost !! This indicates a configuration error. The only recovery from this error is to perform a CAPI_RELEASE";
|
||||
case 0x1106:
|
||||
return "Unknown notification parameter";
|
||||
return "Unknown notification parameter";
|
||||
case 0x1107:
|
||||
return "The Message could not be accepted because of an internal busy condition";
|
||||
return "The Message could not be accepted because of an internal busy condition";
|
||||
case 0x1108:
|
||||
return "OS Resource error (no memory ?)";
|
||||
return "OS Resource error (no memory ?)";
|
||||
case 0x1109:
|
||||
return "CAPI not installed";
|
||||
return "CAPI not installed";
|
||||
case 0x110A:
|
||||
return "Controller does not support external equipment";
|
||||
return "Controller does not support external equipment";
|
||||
case 0x110B:
|
||||
return "Controller does only support external equipment";
|
||||
return "Controller does only support external equipment";
|
||||
|
||||
/*-- error information concerning resource / coding problems -----*/
|
||||
case 0x2001:
|
||||
return "Message not supported in current state";
|
||||
return "Message not supported in current state";
|
||||
case 0x2002:
|
||||
return "Illegal Controller / PLCI / NCCI";
|
||||
return "Illegal Controller / PLCI / NCCI";
|
||||
case 0x2003:
|
||||
return "Out of PLCI";
|
||||
return "Out of PLCI";
|
||||
case 0x2004:
|
||||
return "Out of NCCI";
|
||||
return "Out of NCCI";
|
||||
case 0x2005:
|
||||
return "Out of LISTEN";
|
||||
return "Out of LISTEN";
|
||||
case 0x2006:
|
||||
return "Out of FAX resources (protocol T.30)";
|
||||
return "Out of FAX resources (protocol T.30)";
|
||||
case 0x2007:
|
||||
return "Illegal message parameter coding";
|
||||
return "Illegal message parameter coding";
|
||||
|
||||
/*-- error information concerning requested services -----*/
|
||||
case 0x3001:
|
||||
return "B1 protocol not supported";
|
||||
case 0x3002:
|
||||
return "B2 protocol not supported";
|
||||
case 0x3003:
|
||||
return "B3 protocol not supported";
|
||||
case 0x3004:
|
||||
return "B1 protocol parameter not supported";
|
||||
case 0x3005:
|
||||
return "B2 protocol parameter not supported";
|
||||
case 0x3006:
|
||||
return "B3 protocol parameter not supported";
|
||||
case 0x3007:
|
||||
return "B protocol combination not supported";
|
||||
case 0x3008:
|
||||
return "NCPI not supported";
|
||||
case 0x3009:
|
||||
return "CIP Value unknown";
|
||||
case 0x300A:
|
||||
return "Flags not supported (reserved bits)";
|
||||
case 0x300B:
|
||||
return "Facility not supported";
|
||||
case 0x300C:
|
||||
return "Data length not supported by current protocol";
|
||||
case 0x300D:
|
||||
return "Reset procedure not supported by current protocol";
|
||||
return "B1 protocol not supported";
|
||||
case 0x3002:
|
||||
return "B2 protocol not supported";
|
||||
case 0x3003:
|
||||
return "B3 protocol not supported";
|
||||
case 0x3004:
|
||||
return "B1 protocol parameter not supported";
|
||||
case 0x3005:
|
||||
return "B2 protocol parameter not supported";
|
||||
case 0x3006:
|
||||
return "B3 protocol parameter not supported";
|
||||
case 0x3007:
|
||||
return "B protocol combination not supported";
|
||||
case 0x3008:
|
||||
return "NCPI not supported";
|
||||
case 0x3009:
|
||||
return "CIP Value unknown";
|
||||
case 0x300A:
|
||||
return "Flags not supported (reserved bits)";
|
||||
case 0x300B:
|
||||
return "Facility not supported";
|
||||
case 0x300C:
|
||||
return "Data length not supported by current protocol";
|
||||
case 0x300D:
|
||||
return "Reset procedure not supported by current protocol";
|
||||
|
||||
/*-- informations about the clearing of a physical connection -----*/
|
||||
case 0x3301:
|
||||
return "Protocol error layer 1 (broken line or B-channel removed by signalling protocol)";
|
||||
case 0x3302:
|
||||
return "Protocol error layer 2";
|
||||
case 0x3303:
|
||||
return "Protocol error layer 3";
|
||||
case 0x3304:
|
||||
return "Another application got that call";
|
||||
case 0x3301:
|
||||
return "Protocol error layer 1 (broken line or B-channel removed by signalling protocol)";
|
||||
case 0x3302:
|
||||
return "Protocol error layer 2";
|
||||
case 0x3303:
|
||||
return "Protocol error layer 3";
|
||||
case 0x3304:
|
||||
return "Another application got that call";
|
||||
/*-- T.30 specific reasons -----*/
|
||||
case 0x3311:
|
||||
return "Connecting not successful (remote station is no FAX G3 machine)";
|
||||
case 0x3312:
|
||||
return "Connecting not successful (training error)";
|
||||
case 0x3313:
|
||||
return "Disconnected before transfer (remote station does not support transfer mode, e.g. resolution)";
|
||||
case 0x3314:
|
||||
return "Disconnected during transfer (remote abort)";
|
||||
case 0x3315:
|
||||
return "Disconnected during transfer (remote procedure error, e.g. unsuccessful repetition of T.30 commands)";
|
||||
case 0x3316:
|
||||
return "Disconnected during transfer (local tx data underrun)";
|
||||
case 0x3317:
|
||||
return "Disconnected during transfer (local rx data overflow)";
|
||||
case 0x3318:
|
||||
return "Disconnected during transfer (local abort)";
|
||||
case 0x3319:
|
||||
return "Illegal parameter coding (e.g. SFF coding error)";
|
||||
case 0x3311:
|
||||
return "Connecting not successful (remote station is no FAX G3 machine)";
|
||||
case 0x3312:
|
||||
return "Connecting not successful (training error)";
|
||||
case 0x3313:
|
||||
return "Disconnected before transfer (remote station does not support transfer mode, e.g. resolution)";
|
||||
case 0x3314:
|
||||
return "Disconnected during transfer (remote abort)";
|
||||
case 0x3315:
|
||||
return "Disconnected during transfer (remote procedure error, e.g. unsuccessful repetition of T.30 commands)";
|
||||
case 0x3316:
|
||||
return "Disconnected during transfer (local tx data underrun)";
|
||||
case 0x3317:
|
||||
return "Disconnected during transfer (local rx data overflow)";
|
||||
case 0x3318:
|
||||
return "Disconnected during transfer (local abort)";
|
||||
case 0x3319:
|
||||
return "Illegal parameter coding (e.g. SFF coding error)";
|
||||
|
||||
/*-- disconnect causes from the network according to ETS 300 102-1/Q.931 -----*/
|
||||
case 0x3481: return "Unallocated (unassigned) number";
|
||||
case 0x3482: return "No route to specified transit network";
|
||||
case 0x3483: return "No route to destination";
|
||||
case 0x3486: return "Channel unacceptable";
|
||||
case 0x3487:
|
||||
return "Call awarded and being delivered in an established channel";
|
||||
case 0x3487:
|
||||
return "Call awarded and being delivered in an established channel";
|
||||
case 0x3490: return "Normal call clearing";
|
||||
case 0x3491: return "User busy";
|
||||
case 0x3492: return "No user responding";
|
||||
@@ -217,7 +217,7 @@ char *capi_info2str(u16 reason)
|
||||
case 0x34FF: return "Interworking, unspecified";
|
||||
|
||||
default: return "No additional information";
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -235,169 +235,169 @@ typedef struct {
|
||||
|
||||
static _cdef cdef[] =
|
||||
{
|
||||
/*00 */
|
||||
{_CEND},
|
||||
/*01 */
|
||||
{_CEND},
|
||||
/*02 */
|
||||
{_CEND},
|
||||
/*03 */
|
||||
{_CDWORD, offsetof(_cmsg, adr.adrController)},
|
||||
/*04 */
|
||||
{_CMSTRUCT, offsetof(_cmsg, AdditionalInfo)},
|
||||
/*05 */
|
||||
{_CSTRUCT, offsetof(_cmsg, B1configuration)},
|
||||
/*06 */
|
||||
{_CWORD, offsetof(_cmsg, B1protocol)},
|
||||
/*07 */
|
||||
{_CSTRUCT, offsetof(_cmsg, B2configuration)},
|
||||
/*08 */
|
||||
{_CWORD, offsetof(_cmsg, B2protocol)},
|
||||
/*09 */
|
||||
{_CSTRUCT, offsetof(_cmsg, B3configuration)},
|
||||
/*0a */
|
||||
{_CWORD, offsetof(_cmsg, B3protocol)},
|
||||
/*0b */
|
||||
{_CSTRUCT, offsetof(_cmsg, BC)},
|
||||
/*0c */
|
||||
{_CSTRUCT, offsetof(_cmsg, BChannelinformation)},
|
||||
/*0d */
|
||||
{_CMSTRUCT, offsetof(_cmsg, BProtocol)},
|
||||
/*0e */
|
||||
{_CSTRUCT, offsetof(_cmsg, CalledPartyNumber)},
|
||||
/*0f */
|
||||
{_CSTRUCT, offsetof(_cmsg, CalledPartySubaddress)},
|
||||
/*10 */
|
||||
{_CSTRUCT, offsetof(_cmsg, CallingPartyNumber)},
|
||||
/*11 */
|
||||
{_CSTRUCT, offsetof(_cmsg, CallingPartySubaddress)},
|
||||
/*12 */
|
||||
{_CDWORD, offsetof(_cmsg, CIPmask)},
|
||||
/*13 */
|
||||
{_CDWORD, offsetof(_cmsg, CIPmask2)},
|
||||
/*14 */
|
||||
{_CWORD, offsetof(_cmsg, CIPValue)},
|
||||
/*15 */
|
||||
{_CDWORD, offsetof(_cmsg, Class)},
|
||||
/*16 */
|
||||
{_CSTRUCT, offsetof(_cmsg, ConnectedNumber)},
|
||||
/*17 */
|
||||
{_CSTRUCT, offsetof(_cmsg, ConnectedSubaddress)},
|
||||
/*18 */
|
||||
{_CDWORD, offsetof(_cmsg, Data)},
|
||||
/*19 */
|
||||
{_CWORD, offsetof(_cmsg, DataHandle)},
|
||||
/*1a */
|
||||
{_CWORD, offsetof(_cmsg, DataLength)},
|
||||
/*1b */
|
||||
{_CSTRUCT, offsetof(_cmsg, FacilityConfirmationParameter)},
|
||||
/*1c */
|
||||
{_CSTRUCT, offsetof(_cmsg, Facilitydataarray)},
|
||||
/*1d */
|
||||
{_CSTRUCT, offsetof(_cmsg, FacilityIndicationParameter)},
|
||||
/*1e */
|
||||
{_CSTRUCT, offsetof(_cmsg, FacilityRequestParameter)},
|
||||
/*1f */
|
||||
{_CWORD, offsetof(_cmsg, FacilitySelector)},
|
||||
/*20 */
|
||||
{_CWORD, offsetof(_cmsg, Flags)},
|
||||
/*21 */
|
||||
{_CDWORD, offsetof(_cmsg, Function)},
|
||||
/*22 */
|
||||
{_CSTRUCT, offsetof(_cmsg, HLC)},
|
||||
/*23 */
|
||||
{_CWORD, offsetof(_cmsg, Info)},
|
||||
/*24 */
|
||||
{_CSTRUCT, offsetof(_cmsg, InfoElement)},
|
||||
/*25 */
|
||||
{_CDWORD, offsetof(_cmsg, InfoMask)},
|
||||
/*26 */
|
||||
{_CWORD, offsetof(_cmsg, InfoNumber)},
|
||||
/*27 */
|
||||
{_CSTRUCT, offsetof(_cmsg, Keypadfacility)},
|
||||
/*28 */
|
||||
{_CSTRUCT, offsetof(_cmsg, LLC)},
|
||||
/*29 */
|
||||
{_CSTRUCT, offsetof(_cmsg, ManuData)},
|
||||
/*2a */
|
||||
{_CDWORD, offsetof(_cmsg, ManuID)},
|
||||
/*2b */
|
||||
{_CSTRUCT, offsetof(_cmsg, NCPI)},
|
||||
/*2c */
|
||||
{_CWORD, offsetof(_cmsg, Reason)},
|
||||
/*2d */
|
||||
{_CWORD, offsetof(_cmsg, Reason_B3)},
|
||||
/*2e */
|
||||
{_CWORD, offsetof(_cmsg, Reject)},
|
||||
/*2f */
|
||||
{_CSTRUCT, offsetof(_cmsg, Useruserdata)}
|
||||
/*00 */
|
||||
{_CEND},
|
||||
/*01 */
|
||||
{_CEND},
|
||||
/*02 */
|
||||
{_CEND},
|
||||
/*03 */
|
||||
{_CDWORD, offsetof(_cmsg, adr.adrController)},
|
||||
/*04 */
|
||||
{_CMSTRUCT, offsetof(_cmsg, AdditionalInfo)},
|
||||
/*05 */
|
||||
{_CSTRUCT, offsetof(_cmsg, B1configuration)},
|
||||
/*06 */
|
||||
{_CWORD, offsetof(_cmsg, B1protocol)},
|
||||
/*07 */
|
||||
{_CSTRUCT, offsetof(_cmsg, B2configuration)},
|
||||
/*08 */
|
||||
{_CWORD, offsetof(_cmsg, B2protocol)},
|
||||
/*09 */
|
||||
{_CSTRUCT, offsetof(_cmsg, B3configuration)},
|
||||
/*0a */
|
||||
{_CWORD, offsetof(_cmsg, B3protocol)},
|
||||
/*0b */
|
||||
{_CSTRUCT, offsetof(_cmsg, BC)},
|
||||
/*0c */
|
||||
{_CSTRUCT, offsetof(_cmsg, BChannelinformation)},
|
||||
/*0d */
|
||||
{_CMSTRUCT, offsetof(_cmsg, BProtocol)},
|
||||
/*0e */
|
||||
{_CSTRUCT, offsetof(_cmsg, CalledPartyNumber)},
|
||||
/*0f */
|
||||
{_CSTRUCT, offsetof(_cmsg, CalledPartySubaddress)},
|
||||
/*10 */
|
||||
{_CSTRUCT, offsetof(_cmsg, CallingPartyNumber)},
|
||||
/*11 */
|
||||
{_CSTRUCT, offsetof(_cmsg, CallingPartySubaddress)},
|
||||
/*12 */
|
||||
{_CDWORD, offsetof(_cmsg, CIPmask)},
|
||||
/*13 */
|
||||
{_CDWORD, offsetof(_cmsg, CIPmask2)},
|
||||
/*14 */
|
||||
{_CWORD, offsetof(_cmsg, CIPValue)},
|
||||
/*15 */
|
||||
{_CDWORD, offsetof(_cmsg, Class)},
|
||||
/*16 */
|
||||
{_CSTRUCT, offsetof(_cmsg, ConnectedNumber)},
|
||||
/*17 */
|
||||
{_CSTRUCT, offsetof(_cmsg, ConnectedSubaddress)},
|
||||
/*18 */
|
||||
{_CDWORD, offsetof(_cmsg, Data)},
|
||||
/*19 */
|
||||
{_CWORD, offsetof(_cmsg, DataHandle)},
|
||||
/*1a */
|
||||
{_CWORD, offsetof(_cmsg, DataLength)},
|
||||
/*1b */
|
||||
{_CSTRUCT, offsetof(_cmsg, FacilityConfirmationParameter)},
|
||||
/*1c */
|
||||
{_CSTRUCT, offsetof(_cmsg, Facilitydataarray)},
|
||||
/*1d */
|
||||
{_CSTRUCT, offsetof(_cmsg, FacilityIndicationParameter)},
|
||||
/*1e */
|
||||
{_CSTRUCT, offsetof(_cmsg, FacilityRequestParameter)},
|
||||
/*1f */
|
||||
{_CWORD, offsetof(_cmsg, FacilitySelector)},
|
||||
/*20 */
|
||||
{_CWORD, offsetof(_cmsg, Flags)},
|
||||
/*21 */
|
||||
{_CDWORD, offsetof(_cmsg, Function)},
|
||||
/*22 */
|
||||
{_CSTRUCT, offsetof(_cmsg, HLC)},
|
||||
/*23 */
|
||||
{_CWORD, offsetof(_cmsg, Info)},
|
||||
/*24 */
|
||||
{_CSTRUCT, offsetof(_cmsg, InfoElement)},
|
||||
/*25 */
|
||||
{_CDWORD, offsetof(_cmsg, InfoMask)},
|
||||
/*26 */
|
||||
{_CWORD, offsetof(_cmsg, InfoNumber)},
|
||||
/*27 */
|
||||
{_CSTRUCT, offsetof(_cmsg, Keypadfacility)},
|
||||
/*28 */
|
||||
{_CSTRUCT, offsetof(_cmsg, LLC)},
|
||||
/*29 */
|
||||
{_CSTRUCT, offsetof(_cmsg, ManuData)},
|
||||
/*2a */
|
||||
{_CDWORD, offsetof(_cmsg, ManuID)},
|
||||
/*2b */
|
||||
{_CSTRUCT, offsetof(_cmsg, NCPI)},
|
||||
/*2c */
|
||||
{_CWORD, offsetof(_cmsg, Reason)},
|
||||
/*2d */
|
||||
{_CWORD, offsetof(_cmsg, Reason_B3)},
|
||||
/*2e */
|
||||
{_CWORD, offsetof(_cmsg, Reject)},
|
||||
/*2f */
|
||||
{_CSTRUCT, offsetof(_cmsg, Useruserdata)}
|
||||
};
|
||||
|
||||
static unsigned char *cpars[] =
|
||||
{
|
||||
/* ALERT_REQ */ [0x01] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* CONNECT_REQ */ [0x02] = "\x03\x14\x0e\x10\x0f\x11\x0d\x06\x08\x0a\x05\x07\x09\x01\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* DISCONNECT_REQ */ [0x04] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* LISTEN_REQ */ [0x05] = "\x03\x25\x12\x13\x10\x11\x01",
|
||||
/* INFO_REQ */ [0x08] = "\x03\x0e\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* FACILITY_REQ */ [0x09] = "\x03\x1f\x1e\x01",
|
||||
/* SELECT_B_PROTOCOL_REQ */ [0x0a] = "\x03\x0d\x06\x08\x0a\x05\x07\x09\x01\x01",
|
||||
/* CONNECT_B3_REQ */ [0x0b] = "\x03\x2b\x01",
|
||||
/* DISCONNECT_B3_REQ */ [0x0d] = "\x03\x2b\x01",
|
||||
/* DATA_B3_REQ */ [0x0f] = "\x03\x18\x1a\x19\x20\x01",
|
||||
/* RESET_B3_REQ */ [0x10] = "\x03\x2b\x01",
|
||||
/* ALERT_CONF */ [0x13] = "\x03\x23\x01",
|
||||
/* CONNECT_CONF */ [0x14] = "\x03\x23\x01",
|
||||
/* DISCONNECT_CONF */ [0x16] = "\x03\x23\x01",
|
||||
/* LISTEN_CONF */ [0x17] = "\x03\x23\x01",
|
||||
/* MANUFACTURER_REQ */ [0x18] = "\x03\x2a\x15\x21\x29\x01",
|
||||
/* INFO_CONF */ [0x1a] = "\x03\x23\x01",
|
||||
/* FACILITY_CONF */ [0x1b] = "\x03\x23\x1f\x1b\x01",
|
||||
/* SELECT_B_PROTOCOL_CONF */ [0x1c] = "\x03\x23\x01",
|
||||
/* CONNECT_B3_CONF */ [0x1d] = "\x03\x23\x01",
|
||||
/* DISCONNECT_B3_CONF */ [0x1f] = "\x03\x23\x01",
|
||||
/* DATA_B3_CONF */ [0x21] = "\x03\x19\x23\x01",
|
||||
/* RESET_B3_CONF */ [0x22] = "\x03\x23\x01",
|
||||
/* CONNECT_IND */ [0x26] = "\x03\x14\x0e\x10\x0f\x11\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* CONNECT_ACTIVE_IND */ [0x27] = "\x03\x16\x17\x28\x01",
|
||||
/* DISCONNECT_IND */ [0x28] = "\x03\x2c\x01",
|
||||
/* MANUFACTURER_CONF */ [0x2a] = "\x03\x2a\x15\x21\x29\x01",
|
||||
/* INFO_IND */ [0x2c] = "\x03\x26\x24\x01",
|
||||
/* FACILITY_IND */ [0x2d] = "\x03\x1f\x1d\x01",
|
||||
/* CONNECT_B3_IND */ [0x2f] = "\x03\x2b\x01",
|
||||
/* CONNECT_B3_ACTIVE_IND */ [0x30] = "\x03\x2b\x01",
|
||||
/* DISCONNECT_B3_IND */ [0x31] = "\x03\x2d\x2b\x01",
|
||||
/* DATA_B3_IND */ [0x33] = "\x03\x18\x1a\x19\x20\x01",
|
||||
/* RESET_B3_IND */ [0x34] = "\x03\x2b\x01",
|
||||
/* CONNECT_B3_T90_ACTIVE_IND */ [0x35] = "\x03\x2b\x01",
|
||||
/* CONNECT_RESP */ [0x38] = "\x03\x2e\x0d\x06\x08\x0a\x05\x07\x09\x01\x16\x17\x28\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* CONNECT_ACTIVE_RESP */ [0x39] = "\x03\x01",
|
||||
/* DISCONNECT_RESP */ [0x3a] = "\x03\x01",
|
||||
/* MANUFACTURER_IND */ [0x3c] = "\x03\x2a\x15\x21\x29\x01",
|
||||
/* INFO_RESP */ [0x3e] = "\x03\x01",
|
||||
/* FACILITY_RESP */ [0x3f] = "\x03\x1f\x01",
|
||||
/* CONNECT_B3_RESP */ [0x41] = "\x03\x2e\x2b\x01",
|
||||
/* CONNECT_B3_ACTIVE_RESP */ [0x42] = "\x03\x01",
|
||||
/* DISCONNECT_B3_RESP */ [0x43] = "\x03\x01",
|
||||
/* DATA_B3_RESP */ [0x45] = "\x03\x19\x01",
|
||||
/* RESET_B3_RESP */ [0x46] = "\x03\x01",
|
||||
/* CONNECT_B3_T90_ACTIVE_RESP */ [0x47] = "\x03\x01",
|
||||
/* MANUFACTURER_RESP */ [0x4e] = "\x03\x2a\x15\x21\x29\x01",
|
||||
/* ALERT_REQ */ [0x01] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* CONNECT_REQ */ [0x02] = "\x03\x14\x0e\x10\x0f\x11\x0d\x06\x08\x0a\x05\x07\x09\x01\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* DISCONNECT_REQ */ [0x04] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* LISTEN_REQ */ [0x05] = "\x03\x25\x12\x13\x10\x11\x01",
|
||||
/* INFO_REQ */ [0x08] = "\x03\x0e\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* FACILITY_REQ */ [0x09] = "\x03\x1f\x1e\x01",
|
||||
/* SELECT_B_PROTOCOL_REQ */ [0x0a] = "\x03\x0d\x06\x08\x0a\x05\x07\x09\x01\x01",
|
||||
/* CONNECT_B3_REQ */ [0x0b] = "\x03\x2b\x01",
|
||||
/* DISCONNECT_B3_REQ */ [0x0d] = "\x03\x2b\x01",
|
||||
/* DATA_B3_REQ */ [0x0f] = "\x03\x18\x1a\x19\x20\x01",
|
||||
/* RESET_B3_REQ */ [0x10] = "\x03\x2b\x01",
|
||||
/* ALERT_CONF */ [0x13] = "\x03\x23\x01",
|
||||
/* CONNECT_CONF */ [0x14] = "\x03\x23\x01",
|
||||
/* DISCONNECT_CONF */ [0x16] = "\x03\x23\x01",
|
||||
/* LISTEN_CONF */ [0x17] = "\x03\x23\x01",
|
||||
/* MANUFACTURER_REQ */ [0x18] = "\x03\x2a\x15\x21\x29\x01",
|
||||
/* INFO_CONF */ [0x1a] = "\x03\x23\x01",
|
||||
/* FACILITY_CONF */ [0x1b] = "\x03\x23\x1f\x1b\x01",
|
||||
/* SELECT_B_PROTOCOL_CONF */ [0x1c] = "\x03\x23\x01",
|
||||
/* CONNECT_B3_CONF */ [0x1d] = "\x03\x23\x01",
|
||||
/* DISCONNECT_B3_CONF */ [0x1f] = "\x03\x23\x01",
|
||||
/* DATA_B3_CONF */ [0x21] = "\x03\x19\x23\x01",
|
||||
/* RESET_B3_CONF */ [0x22] = "\x03\x23\x01",
|
||||
/* CONNECT_IND */ [0x26] = "\x03\x14\x0e\x10\x0f\x11\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* CONNECT_ACTIVE_IND */ [0x27] = "\x03\x16\x17\x28\x01",
|
||||
/* DISCONNECT_IND */ [0x28] = "\x03\x2c\x01",
|
||||
/* MANUFACTURER_CONF */ [0x2a] = "\x03\x2a\x15\x21\x29\x01",
|
||||
/* INFO_IND */ [0x2c] = "\x03\x26\x24\x01",
|
||||
/* FACILITY_IND */ [0x2d] = "\x03\x1f\x1d\x01",
|
||||
/* CONNECT_B3_IND */ [0x2f] = "\x03\x2b\x01",
|
||||
/* CONNECT_B3_ACTIVE_IND */ [0x30] = "\x03\x2b\x01",
|
||||
/* DISCONNECT_B3_IND */ [0x31] = "\x03\x2d\x2b\x01",
|
||||
/* DATA_B3_IND */ [0x33] = "\x03\x18\x1a\x19\x20\x01",
|
||||
/* RESET_B3_IND */ [0x34] = "\x03\x2b\x01",
|
||||
/* CONNECT_B3_T90_ACTIVE_IND */ [0x35] = "\x03\x2b\x01",
|
||||
/* CONNECT_RESP */ [0x38] = "\x03\x2e\x0d\x06\x08\x0a\x05\x07\x09\x01\x16\x17\x28\x04\x0c\x27\x2f\x1c\x01\x01",
|
||||
/* CONNECT_ACTIVE_RESP */ [0x39] = "\x03\x01",
|
||||
/* DISCONNECT_RESP */ [0x3a] = "\x03\x01",
|
||||
/* MANUFACTURER_IND */ [0x3c] = "\x03\x2a\x15\x21\x29\x01",
|
||||
/* INFO_RESP */ [0x3e] = "\x03\x01",
|
||||
/* FACILITY_RESP */ [0x3f] = "\x03\x1f\x01",
|
||||
/* CONNECT_B3_RESP */ [0x41] = "\x03\x2e\x2b\x01",
|
||||
/* CONNECT_B3_ACTIVE_RESP */ [0x42] = "\x03\x01",
|
||||
/* DISCONNECT_B3_RESP */ [0x43] = "\x03\x01",
|
||||
/* DATA_B3_RESP */ [0x45] = "\x03\x19\x01",
|
||||
/* RESET_B3_RESP */ [0x46] = "\x03\x01",
|
||||
/* CONNECT_B3_T90_ACTIVE_RESP */ [0x47] = "\x03\x01",
|
||||
/* MANUFACTURER_RESP */ [0x4e] = "\x03\x2a\x15\x21\x29\x01",
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------*/
|
||||
|
||||
#define byteTLcpy(x,y) *(u8 *)(x)=*(u8 *)(y);
|
||||
#define wordTLcpy(x,y) *(u16 *)(x)=*(u16 *)(y);
|
||||
#define dwordTLcpy(x,y) memcpy(x,y,4);
|
||||
#define structTLcpy(x,y,l) memcpy (x,y,l)
|
||||
#define structTLcpyovl(x,y,l) memmove (x,y,l)
|
||||
#define byteTLcpy(x, y) *(u8 *)(x) = *(u8 *)(y);
|
||||
#define wordTLcpy(x, y) *(u16 *)(x) = *(u16 *)(y);
|
||||
#define dwordTLcpy(x, y) memcpy(x, y, 4);
|
||||
#define structTLcpy(x, y, l) memcpy(x, y, l)
|
||||
#define structTLcpyovl(x, y, l) memmove(x, y, l)
|
||||
|
||||
#define byteTRcpy(x,y) *(u8 *)(y)=*(u8 *)(x);
|
||||
#define wordTRcpy(x,y) *(u16 *)(y)=*(u16 *)(x);
|
||||
#define dwordTRcpy(x,y) memcpy(y,x,4);
|
||||
#define structTRcpy(x,y,l) memcpy (y,x,l)
|
||||
#define structTRcpyovl(x,y,l) memmove (y,x,l)
|
||||
#define byteTRcpy(x, y) *(u8 *)(y) = *(u8 *)(x);
|
||||
#define wordTRcpy(x, y) *(u16 *)(y) = *(u16 *)(x);
|
||||
#define dwordTRcpy(x, y) memcpy(y, x, 4);
|
||||
#define structTRcpy(x, y, l) memcpy(y, x, l)
|
||||
#define structTRcpyovl(x, y, l) memmove(y, x, l)
|
||||
|
||||
/*-------------------------------------------------------*/
|
||||
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 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;
|
||||
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++) {
|
||||
@@ -499,7 +499,7 @@ static void pars_2_message(_cmsg * cmsg)
|
||||
* Return value: 0 for success
|
||||
*/
|
||||
|
||||
unsigned capi_cmsg2message(_cmsg * cmsg, u8 * msg)
|
||||
unsigned capi_cmsg2message(_cmsg *cmsg, u8 *msg)
|
||||
{
|
||||
cmsg->m = msg;
|
||||
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++) {
|
||||
|
||||
@@ -569,7 +569,7 @@ static void message_2_pars(_cmsg * cmsg)
|
||||
* Return value: 0 for success
|
||||
*/
|
||||
|
||||
unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg)
|
||||
unsigned capi_message2cmsg(_cmsg *cmsg, u8 *msg)
|
||||
{
|
||||
memset(cmsg, 0, sizeof(_cmsg));
|
||||
cmsg->m = msg;
|
||||
@@ -600,7 +600,7 @@ unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg)
|
||||
* 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,
|
||||
u16 _Messagenumber, u32 _Controller)
|
||||
{
|
||||
@@ -689,54 +689,54 @@ char *capi_cmd2str(u8 cmd, u8 subcmd)
|
||||
|
||||
static char *pnames[] =
|
||||
{
|
||||
/*00 */ NULL,
|
||||
/*01 */ NULL,
|
||||
/*02 */ NULL,
|
||||
/*03 */ "Controller/PLCI/NCCI",
|
||||
/*04 */ "AdditionalInfo",
|
||||
/*05 */ "B1configuration",
|
||||
/*06 */ "B1protocol",
|
||||
/*07 */ "B2configuration",
|
||||
/*08 */ "B2protocol",
|
||||
/*09 */ "B3configuration",
|
||||
/*0a */ "B3protocol",
|
||||
/*0b */ "BC",
|
||||
/*0c */ "BChannelinformation",
|
||||
/*0d */ "BProtocol",
|
||||
/*0e */ "CalledPartyNumber",
|
||||
/*0f */ "CalledPartySubaddress",
|
||||
/*10 */ "CallingPartyNumber",
|
||||
/*11 */ "CallingPartySubaddress",
|
||||
/*12 */ "CIPmask",
|
||||
/*13 */ "CIPmask2",
|
||||
/*14 */ "CIPValue",
|
||||
/*15 */ "Class",
|
||||
/*16 */ "ConnectedNumber",
|
||||
/*17 */ "ConnectedSubaddress",
|
||||
/*18 */ "Data32",
|
||||
/*19 */ "DataHandle",
|
||||
/*1a */ "DataLength",
|
||||
/*1b */ "FacilityConfirmationParameter",
|
||||
/*1c */ "Facilitydataarray",
|
||||
/*1d */ "FacilityIndicationParameter",
|
||||
/*1e */ "FacilityRequestParameter",
|
||||
/*1f */ "FacilitySelector",
|
||||
/*20 */ "Flags",
|
||||
/*21 */ "Function",
|
||||
/*22 */ "HLC",
|
||||
/*23 */ "Info",
|
||||
/*24 */ "InfoElement",
|
||||
/*25 */ "InfoMask",
|
||||
/*26 */ "InfoNumber",
|
||||
/*27 */ "Keypadfacility",
|
||||
/*28 */ "LLC",
|
||||
/*29 */ "ManuData",
|
||||
/*2a */ "ManuID",
|
||||
/*2b */ "NCPI",
|
||||
/*2c */ "Reason",
|
||||
/*2d */ "Reason_B3",
|
||||
/*2e */ "Reject",
|
||||
/*2f */ "Useruserdata"
|
||||
/*00 */ NULL,
|
||||
/*01 */ NULL,
|
||||
/*02 */ NULL,
|
||||
/*03 */ "Controller/PLCI/NCCI",
|
||||
/*04 */ "AdditionalInfo",
|
||||
/*05 */ "B1configuration",
|
||||
/*06 */ "B1protocol",
|
||||
/*07 */ "B2configuration",
|
||||
/*08 */ "B2protocol",
|
||||
/*09 */ "B3configuration",
|
||||
/*0a */ "B3protocol",
|
||||
/*0b */ "BC",
|
||||
/*0c */ "BChannelinformation",
|
||||
/*0d */ "BProtocol",
|
||||
/*0e */ "CalledPartyNumber",
|
||||
/*0f */ "CalledPartySubaddress",
|
||||
/*10 */ "CallingPartyNumber",
|
||||
/*11 */ "CallingPartySubaddress",
|
||||
/*12 */ "CIPmask",
|
||||
/*13 */ "CIPmask2",
|
||||
/*14 */ "CIPValue",
|
||||
/*15 */ "Class",
|
||||
/*16 */ "ConnectedNumber",
|
||||
/*17 */ "ConnectedSubaddress",
|
||||
/*18 */ "Data32",
|
||||
/*19 */ "DataHandle",
|
||||
/*1a */ "DataLength",
|
||||
/*1b */ "FacilityConfirmationParameter",
|
||||
/*1c */ "Facilitydataarray",
|
||||
/*1d */ "FacilityIndicationParameter",
|
||||
/*1e */ "FacilityRequestParameter",
|
||||
/*1f */ "FacilitySelector",
|
||||
/*20 */ "Flags",
|
||||
/*21 */ "Function",
|
||||
/*22 */ "HLC",
|
||||
/*23 */ "Info",
|
||||
/*24 */ "InfoElement",
|
||||
/*25 */ "InfoMask",
|
||||
/*26 */ "InfoNumber",
|
||||
/*27 */ "Keypadfacility",
|
||||
/*28 */ "LLC",
|
||||
/*29 */ "ManuData",
|
||||
/*2a */ "ManuID",
|
||||
/*2b */ "NCPI",
|
||||
/*2c */ "Reason",
|
||||
/*2d */ "Reason_B3",
|
||||
/*2e */ "Reject",
|
||||
/*2f */ "Useruserdata"
|
||||
};
|
||||
|
||||
|
||||
@@ -744,10 +744,10 @@ static char *pnames[] =
|
||||
#include <stdarg.h>
|
||||
|
||||
/*-------------------------------------------------------*/
|
||||
static _cdebbuf *bufprint(_cdebbuf *cdb, char *fmt,...)
|
||||
static _cdebbuf *bufprint(_cdebbuf *cdb, char *fmt, ...)
|
||||
{
|
||||
va_list f;
|
||||
size_t n,r;
|
||||
size_t n, r;
|
||||
|
||||
if (!cdb)
|
||||
return NULL;
|
||||
@@ -783,7 +783,7 @@ static _cdebbuf *bufprint(_cdebbuf *cdb, char *fmt,...)
|
||||
return cdb;
|
||||
}
|
||||
|
||||
static _cdebbuf *printstructlen(_cdebbuf *cdb, u8 * m, unsigned len)
|
||||
static _cdebbuf *printstructlen(_cdebbuf *cdb, u8 *m, unsigned len)
|
||||
{
|
||||
unsigned hex = 0;
|
||||
|
||||
@@ -807,7 +807,7 @@ static _cdebbuf *printstructlen(_cdebbuf *cdb, u8 * m, unsigned len)
|
||||
return cdb;
|
||||
}
|
||||
|
||||
static _cdebbuf *printstruct(_cdebbuf *cdb, u8 * m)
|
||||
static _cdebbuf *printstruct(_cdebbuf *cdb, u8 *m)
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
_cdebbuf *capi_message2str(u8 * msg)
|
||||
_cdebbuf *capi_message2str(u8 *msg)
|
||||
{
|
||||
_cdebbuf *cdb;
|
||||
_cmsg *cmsg;
|
||||
@@ -964,10 +964,10 @@ _cdebbuf *capi_message2str(u8 * msg)
|
||||
cmsg->par = cpars[command_2_index(cmsg->Command, cmsg->Subcommand)];
|
||||
|
||||
cdb = bufprint(cdb, "%-26s ID=%03d #0x%04x LEN=%04d\n",
|
||||
mnames[command_2_index(cmsg->Command, cmsg->Subcommand)],
|
||||
((unsigned short *) msg)[1],
|
||||
((unsigned short *) msg)[3],
|
||||
((unsigned short *) msg)[0]);
|
||||
mnames[command_2_index(cmsg->Command, cmsg->Subcommand)],
|
||||
((unsigned short *) msg)[1],
|
||||
((unsigned short *) msg)[3],
|
||||
((unsigned short *) msg)[0]);
|
||||
|
||||
cdb = protocol_message_2_pars(cdb, cmsg, 1);
|
||||
if (unlikely(cmsg != g_cmsg))
|
||||
@@ -986,7 +986,7 @@ _cdebbuf *capi_message2str(u8 * msg)
|
||||
* 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;
|
||||
|
||||
@@ -998,17 +998,17 @@ _cdebbuf *capi_cmsg2str(_cmsg * cmsg)
|
||||
cmsg->l = 8;
|
||||
cmsg->p = 0;
|
||||
cdb = bufprint(cdb, "%s ID=%03d #0x%04x LEN=%04d\n",
|
||||
mnames[command_2_index(cmsg->Command, cmsg->Subcommand)],
|
||||
((u16 *) cmsg->m)[1],
|
||||
((u16 *) cmsg->m)[3],
|
||||
((u16 *) cmsg->m)[0]);
|
||||
mnames[command_2_index(cmsg->Command, cmsg->Subcommand)],
|
||||
((u16 *) cmsg->m)[1],
|
||||
((u16 *) cmsg->m)[3],
|
||||
((u16 *) cmsg->m)[0]);
|
||||
cdb = protocol_message_2_pars(cdb, cmsg, 1);
|
||||
return cdb;
|
||||
}
|
||||
|
||||
int __init cdebug_init(void)
|
||||
{
|
||||
g_cmsg= kmalloc(sizeof(_cmsg), GFP_KERNEL);
|
||||
g_cmsg = kmalloc(sizeof(_cmsg), GFP_KERNEL);
|
||||
if (!g_cmsg)
|
||||
return -ENOMEM;
|
||||
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};
|
||||
|
||||
_cdebbuf *capi_message2str(u8 * msg)
|
||||
_cdebbuf *capi_message2str(u8 *msg)
|
||||
{
|
||||
return &g_debbuf;
|
||||
}
|
||||
|
||||
_cdebbuf *capi_cmsg2str(_cmsg * cmsg)
|
||||
_cdebbuf *capi_cmsg2str(_cmsg *cmsg)
|
||||
{
|
||||
return &g_debbuf;
|
||||
}
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: kcapi.c,v 1.1.2.8 2004/03/26 19:57:20 armin Exp $
|
||||
*
|
||||
*
|
||||
* Kernel CAPI 2.0 Module
|
||||
*
|
||||
*
|
||||
* Copyright 1999 by Carsten Paeth <calle@calle.de>
|
||||
* Copyright 2002 by Kai Germaschewski <kai@germaschewski.name>
|
||||
*
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
@@ -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 capi_manufakturer[64] = "AVM Berlin";
|
||||
|
||||
@@ -172,7 +172,7 @@ register_appl(struct capi_ctr *ctr, u16 applid, capi_register_params *rparam)
|
||||
static void release_appl(struct capi_ctr *ctr, u16 applid)
|
||||
{
|
||||
DBG("applid %#x", applid);
|
||||
|
||||
|
||||
ctr->release_appl(ctr, applid);
|
||||
capi_ctr_put(ctr);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ static void notify_up(u32 contr)
|
||||
mutex_lock(&capi_controller_lock);
|
||||
|
||||
if (showcapimsgs & 1)
|
||||
printk(KERN_DEBUG "kcapi: notify up contr %d\n", contr);
|
||||
printk(KERN_DEBUG "kcapi: notify up contr %d\n", contr);
|
||||
|
||||
ctr = get_capi_ctr_by_nr(contr);
|
||||
if (ctr) {
|
||||
@@ -352,16 +352,16 @@ void capi_ctr_handle_message(struct capi_ctr *ctr, u16 appl,
|
||||
cdb = capi_message2str(skb->data);
|
||||
if (cdb) {
|
||||
printk(KERN_INFO "kcapi: controller [%03d] not active, got: %s",
|
||||
ctr->cnr, cdb->buf);
|
||||
ctr->cnr, cdb->buf);
|
||||
cdebbuf_free(cdb);
|
||||
} else
|
||||
printk(KERN_INFO "kcapi: controller [%03d] not active, cannot trace\n",
|
||||
ctr->cnr);
|
||||
ctr->cnr);
|
||||
goto error;
|
||||
}
|
||||
|
||||
cmd = CAPIMSG_COMMAND(skb->data);
|
||||
subcmd = CAPIMSG_SUBCOMMAND(skb->data);
|
||||
subcmd = CAPIMSG_SUBCOMMAND(skb->data);
|
||||
if (cmd == CAPI_DATA_B3 && subcmd == CAPI_IND) {
|
||||
ctr->nrecvdatapkt++;
|
||||
if (ctr->traceflag > 2)
|
||||
@@ -382,13 +382,13 @@ void capi_ctr_handle_message(struct capi_ctr *ctr, u16 appl,
|
||||
cdb = capi_message2str(skb->data);
|
||||
if (cdb) {
|
||||
printk(KERN_DEBUG "kcapi: got [%03d] %s\n",
|
||||
ctr->cnr, cdb->buf);
|
||||
ctr->cnr, cdb->buf);
|
||||
cdebbuf_free(cdb);
|
||||
} else
|
||||
printk(KERN_DEBUG "kcapi: got [%03d] id#%d %s len=%u, cannot trace\n",
|
||||
ctr->cnr, CAPIMSG_APPID(skb->data),
|
||||
capi_cmd2str(cmd, subcmd),
|
||||
CAPIMSG_LEN(skb->data));
|
||||
ctr->cnr, CAPIMSG_APPID(skb->data),
|
||||
capi_cmd2str(cmd, subcmd),
|
||||
CAPIMSG_LEN(skb->data));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -400,12 +400,12 @@ void capi_ctr_handle_message(struct capi_ctr *ctr, u16 appl,
|
||||
cdb = capi_message2str(skb->data);
|
||||
if (cdb) {
|
||||
printk(KERN_ERR "kcapi: handle_message: applid %d state released (%s)\n",
|
||||
CAPIMSG_APPID(skb->data), cdb->buf);
|
||||
CAPIMSG_APPID(skb->data), cdb->buf);
|
||||
cdebbuf_free(cdb);
|
||||
} else
|
||||
printk(KERN_ERR "kcapi: handle_message: applid %d state released (%s) cannot trace\n",
|
||||
CAPIMSG_APPID(skb->data),
|
||||
capi_cmd2str(cmd, subcmd));
|
||||
CAPIMSG_APPID(skb->data),
|
||||
capi_cmd2str(cmd, subcmd));
|
||||
goto error;
|
||||
}
|
||||
skb_queue_tail(&ap->recv_queue, skb);
|
||||
@@ -519,7 +519,7 @@ int attach_capi_ctr(struct capi_ctr *ctr)
|
||||
if (i == CAPI_MAXCONTR) {
|
||||
mutex_unlock(&capi_controller_lock);
|
||||
printk(KERN_ERR "kcapi: out of controller slots\n");
|
||||
return -EBUSY;
|
||||
return -EBUSY;
|
||||
}
|
||||
capi_controller[i] = ctr;
|
||||
|
||||
@@ -541,7 +541,7 @@ int attach_capi_ctr(struct capi_ctr *ctr)
|
||||
mutex_unlock(&capi_controller_lock);
|
||||
|
||||
printk(KERN_NOTICE "kcapi: controller [%03d]: %s attached\n",
|
||||
ctr->cnr, ctr->name);
|
||||
ctr->cnr, ctr->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -772,7 +772,7 @@ u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb)
|
||||
u8 cmd, subcmd;
|
||||
|
||||
DBG("applid %#x", ap->applid);
|
||||
|
||||
|
||||
if (ncontrollers == 0)
|
||||
return CAPI_REGNOTINSTALLED;
|
||||
if ((ap->applid == 0) || ap->release_in_progress)
|
||||
@@ -794,9 +794,9 @@ u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb)
|
||||
return CAPI_SENDQUEUEFULL;
|
||||
|
||||
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++;
|
||||
ap->nsentdatapkt++;
|
||||
if (ctr->traceflag > 2)
|
||||
@@ -819,15 +819,15 @@ u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb)
|
||||
_cdebbuf *cdb = capi_message2str(skb->data);
|
||||
if (cdb) {
|
||||
printk(KERN_DEBUG "kcapi: put [%03d] %s\n",
|
||||
CAPIMSG_CONTROLLER(skb->data),
|
||||
cdb->buf);
|
||||
CAPIMSG_CONTROLLER(skb->data),
|
||||
cdb->buf);
|
||||
cdebbuf_free(cdb);
|
||||
} else
|
||||
printk(KERN_DEBUG "kcapi: put [%03d] id#%d %s len=%u cannot trace\n",
|
||||
CAPIMSG_CONTROLLER(skb->data),
|
||||
CAPIMSG_APPID(skb->data),
|
||||
capi_cmd2str(cmd, subcmd),
|
||||
CAPIMSG_LEN(skb->data));
|
||||
CAPIMSG_CONTROLLER(skb->data),
|
||||
CAPIMSG_APPID(skb->data),
|
||||
capi_cmd2str(cmd, subcmd),
|
||||
CAPIMSG_LEN(skb->data));
|
||||
}
|
||||
}
|
||||
return ctr->send_message(ctr, skb);
|
||||
@@ -1028,14 +1028,14 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
|
||||
case AVMB1_ADDCARD:
|
||||
case AVMB1_ADDCARD_WITH_TYPE:
|
||||
if (cmd == AVMB1_ADDCARD) {
|
||||
if ((retval = copy_from_user(&cdef, data,
|
||||
sizeof(avmb1_carddef))))
|
||||
return -EFAULT;
|
||||
cdef.cardtype = AVM_CARDTYPE_B1;
|
||||
if ((retval = copy_from_user(&cdef, data,
|
||||
sizeof(avmb1_carddef))))
|
||||
return -EFAULT;
|
||||
cdef.cardtype = AVM_CARDTYPE_B1;
|
||||
} else {
|
||||
if ((retval = copy_from_user(&cdef, data,
|
||||
sizeof(avmb1_extcarddef))))
|
||||
return -EFAULT;
|
||||
if ((retval = copy_from_user(&cdef, data,
|
||||
sizeof(avmb1_extcarddef))))
|
||||
return -EFAULT;
|
||||
}
|
||||
cparams.port = cdef.port;
|
||||
cparams.irq = cdef.irq;
|
||||
@@ -1043,24 +1043,24 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
|
||||
|
||||
mutex_lock(&capi_drivers_lock);
|
||||
|
||||
switch (cdef.cardtype) {
|
||||
case AVM_CARDTYPE_B1:
|
||||
list_for_each(l, &capi_drivers) {
|
||||
driver = list_entry(l, struct capi_driver, list);
|
||||
if (strcmp(driver->name, "b1isa") == 0)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case AVM_CARDTYPE_T1:
|
||||
list_for_each(l, &capi_drivers) {
|
||||
driver = list_entry(l, struct capi_driver, list);
|
||||
if (strcmp(driver->name, "t1isa") == 0)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
driver = NULL;
|
||||
break;
|
||||
switch (cdef.cardtype) {
|
||||
case AVM_CARDTYPE_B1:
|
||||
list_for_each(l, &capi_drivers) {
|
||||
driver = list_entry(l, struct capi_driver, list);
|
||||
if (strcmp(driver->name, "b1isa") == 0)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case AVM_CARDTYPE_T1:
|
||||
list_for_each(l, &capi_drivers) {
|
||||
driver = list_entry(l, struct capi_driver, list);
|
||||
if (strcmp(driver->name, "t1isa") == 0)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
driver = NULL;
|
||||
break;
|
||||
}
|
||||
if (!driver) {
|
||||
printk(KERN_ERR "kcapi: driver not loaded.\n");
|
||||
@@ -1136,7 +1136,7 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
|
||||
|
||||
retval = wait_on_ctr_state(ctr, CAPI_CTR_RUNNING);
|
||||
|
||||
load_unlock_out:
|
||||
load_unlock_out:
|
||||
mutex_unlock(&capi_controller_lock);
|
||||
return retval;
|
||||
|
||||
@@ -1167,7 +1167,7 @@ load_unlock_out:
|
||||
|
||||
retval = wait_on_ctr_state(ctr, CAPI_CTR_DETECTED);
|
||||
|
||||
reset_unlock_out:
|
||||
reset_unlock_out:
|
||||
mutex_unlock(&capi_controller_lock);
|
||||
return retval;
|
||||
}
|
||||
@@ -1235,7 +1235,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data)
|
||||
cparams.membase = cdef.membase;
|
||||
cparams.cardnr = cdef.cardnr;
|
||||
cparams.cardtype = 0;
|
||||
cdef.driver[sizeof(cdef.driver)-1] = 0;
|
||||
cdef.driver[sizeof(cdef.driver) - 1] = 0;
|
||||
|
||||
mutex_lock(&capi_drivers_lock);
|
||||
|
||||
@@ -1246,7 +1246,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data)
|
||||
}
|
||||
if (driver == NULL) {
|
||||
printk(KERN_ERR "kcapi: driver \"%s\" not loaded.\n",
|
||||
cdef.driver);
|
||||
cdef.driver);
|
||||
retval = -ESRCH;
|
||||
} else if (!driver->add_card) {
|
||||
printk(KERN_ERR "kcapi: driver \"%s\" has no add card function.\n", cdef.driver);
|
||||
@@ -1260,7 +1260,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data)
|
||||
|
||||
default:
|
||||
printk(KERN_ERR "kcapi: manufacturer command %d unknown.\n",
|
||||
cmd);
|
||||
cmd);
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -1305,7 +1305,7 @@ static int __init kcapi_init(void)
|
||||
|
||||
static void __exit kcapi_exit(void)
|
||||
{
|
||||
kcapi_proc_exit();
|
||||
kcapi_proc_exit();
|
||||
|
||||
unregister_capictr_notifier(&capictr_nb);
|
||||
cdebug_exit();
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Kernel CAPI 2.0 Module
|
||||
*
|
||||
*
|
||||
* Copyright 1999 by Carsten Paeth <calle@calle.de>
|
||||
* Copyright 2002 by Kai Germaschewski <kai@germaschewski.name>
|
||||
*
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
@@ -16,9 +16,9 @@
|
||||
#include <linux/isdn/capilli.h>
|
||||
|
||||
#ifdef KCAPI_DEBUG
|
||||
#define DBG(format, arg...) do { \
|
||||
printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
|
||||
} while (0)
|
||||
#define DBG(format, arg...) do { \
|
||||
printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
|
||||
} while (0)
|
||||
#else
|
||||
#define DBG(format, arg...) /* */
|
||||
#endif
|
||||
@@ -49,4 +49,3 @@ static inline void kcapi_proc_init(void) { };
|
||||
static inline void kcapi_proc_exit(void) { };
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Kernel CAPI 2.0 Module - /proc/capi handling
|
||||
*
|
||||
*
|
||||
* Copyright 1999 by Carsten Paeth <calle@calle.de>
|
||||
* Copyright 2002 by Kai Germaschewski <kai@germaschewski.name>
|
||||
*
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
@@ -29,7 +29,7 @@ static char *state2str(unsigned short state)
|
||||
// /proc/capi
|
||||
// ===========================================================================
|
||||
|
||||
// /proc/capi/controller:
|
||||
// /proc/capi/controller:
|
||||
// cnr driver cardstate name driverinfo
|
||||
// /proc/capi/contrstats:
|
||||
// cnr nrecvctlpkt nrecvdatapkt nsentctlpkt nsentdatapkt
|
||||
@@ -85,7 +85,7 @@ static int contrstats_show(struct seq_file *seq, void *v)
|
||||
return 0;
|
||||
|
||||
seq_printf(seq, "%d %lu %lu %lu %lu\n",
|
||||
ctr->cnr,
|
||||
ctr->cnr,
|
||||
ctr->nrecvctlpkt,
|
||||
ctr->nrecvdatapkt,
|
||||
ctr->nsentctlpkt,
|
||||
@@ -134,9 +134,9 @@ static const struct file_operations proc_contrstats_ops = {
|
||||
.release = seq_release,
|
||||
};
|
||||
|
||||
// /proc/capi/applications:
|
||||
// /proc/capi/applications:
|
||||
// applid l3cnt dblkcnt dblklen #ncci recvqueuelen
|
||||
// /proc/capi/applstats:
|
||||
// /proc/capi/applstats:
|
||||
// applid nrecvctlpkt nrecvdatapkt nsentctlpkt nsentdatapkt
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -297,7 +297,7 @@ static const struct file_operations proc_driver_ops = {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void __init
|
||||
void __init
|
||||
kcapi_proc_init(void)
|
||||
{
|
||||
proc_mkdir("capi", NULL);
|
||||
|
Reference in New Issue
Block a user