You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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:
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Author Fritz Elfert
|
||||
* Copyright by Fritz Elfert <fritz@isdn4linux.de>
|
||||
*
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
@@ -40,21 +40,21 @@
|
||||
/* Struct for adding new cards */
|
||||
typedef struct act2000_cdef {
|
||||
int bus;
|
||||
int port;
|
||||
int irq;
|
||||
char id[10];
|
||||
int port;
|
||||
int irq;
|
||||
char id[10];
|
||||
} act2000_cdef;
|
||||
|
||||
/* Struct for downloading firmware */
|
||||
typedef struct act2000_ddef {
|
||||
int length; /* Length of code */
|
||||
char __user *buffer; /* Ptr. to code */
|
||||
int length; /* Length of code */
|
||||
char __user *buffer; /* Ptr. to code */
|
||||
} act2000_ddef;
|
||||
|
||||
typedef struct act2000_fwid {
|
||||
char isdn[4];
|
||||
char revlen[2];
|
||||
char revision[504];
|
||||
char isdn[4];
|
||||
char revlen[2];
|
||||
char revision[504];
|
||||
} act2000_fwid;
|
||||
|
||||
#if defined(__KERNEL__) || defined(__DEBUGVAR__)
|
||||
@@ -128,8 +128,8 @@ typedef struct act2000_chan {
|
||||
|
||||
typedef struct msn_entry {
|
||||
char eaz;
|
||||
char msn[16];
|
||||
struct msn_entry * next;
|
||||
char msn[16];
|
||||
struct msn_entry *next;
|
||||
} msn_entry;
|
||||
|
||||
typedef struct irq_data_isa {
|
||||
@@ -183,17 +183,17 @@ typedef struct act2000_card {
|
||||
|
||||
static inline void act2000_schedule_tx(act2000_card *card)
|
||||
{
|
||||
schedule_work(&card->snd_tq);
|
||||
schedule_work(&card->snd_tq);
|
||||
}
|
||||
|
||||
static inline void act2000_schedule_rx(act2000_card *card)
|
||||
{
|
||||
schedule_work(&card->rcv_tq);
|
||||
schedule_work(&card->rcv_tq);
|
||||
}
|
||||
|
||||
static inline void act2000_schedule_poll(act2000_card *card)
|
||||
{
|
||||
schedule_work(&card->poll_tq);
|
||||
schedule_work(&card->poll_tq);
|
||||
}
|
||||
|
||||
extern char *act2000_find_eaz(act2000_card *, char);
|
||||
|
||||
+191
-191
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Author Fritz Elfert
|
||||
* Copyright by Fritz Elfert <fritz@isdn4linux.de>
|
||||
*
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
@@ -18,9 +18,9 @@
|
||||
#define ISA_POLL_LOOP 40 /* Try to read-write before give up */
|
||||
|
||||
typedef enum {
|
||||
INT_NO_CHANGE = 0, /* Do not change the Mask */
|
||||
INT_ON = 1, /* Set to Enable */
|
||||
INT_OFF = 2, /* Set to Disable */
|
||||
INT_NO_CHANGE = 0, /* Do not change the Mask */
|
||||
INT_ON = 1, /* Set to Enable */
|
||||
INT_OFF = 2, /* Set to Disable */
|
||||
} ISA_INT_T;
|
||||
|
||||
/**************************************************************************/
|
||||
@@ -114,22 +114,22 @@ typedef enum {
|
||||
|
||||
|
||||
/* Macros for accessing ports */
|
||||
#define ISA_PORT_COR (card->port+ISA_COR)
|
||||
#define ISA_PORT_ISR (card->port+ISA_ISR)
|
||||
#define ISA_PORT_EPR (card->port+ISA_EPR)
|
||||
#define ISA_PORT_EER (card->port+ISA_EER)
|
||||
#define ISA_PORT_SDI (card->port+ISA_SDI)
|
||||
#define ISA_PORT_SDO (card->port+ISA_SDO)
|
||||
#define ISA_PORT_SIS (card->port+ISA_SIS)
|
||||
#define ISA_PORT_SOS (card->port+ISA_SOS)
|
||||
#define ISA_PORT_COR (card->port + ISA_COR)
|
||||
#define ISA_PORT_ISR (card->port + ISA_ISR)
|
||||
#define ISA_PORT_EPR (card->port + ISA_EPR)
|
||||
#define ISA_PORT_EER (card->port + ISA_EER)
|
||||
#define ISA_PORT_SDI (card->port + ISA_SDI)
|
||||
#define ISA_PORT_SDO (card->port + ISA_SDO)
|
||||
#define ISA_PORT_SIS (card->port + ISA_SIS)
|
||||
#define ISA_PORT_SOS (card->port + ISA_SOS)
|
||||
|
||||
/* Prototypes */
|
||||
|
||||
extern int act2000_isa_detect(unsigned short portbase);
|
||||
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_download(act2000_card * card, act2000_ddef __user * cb);
|
||||
extern void act2000_isa_release(act2000_card * card);
|
||||
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_download(act2000_card *card, act2000_ddef __user *cb);
|
||||
extern void act2000_isa_release(act2000_card *card);
|
||||
extern void act2000_isa_receive(act2000_card *card);
|
||||
extern void act2000_isa_send(act2000_card *card);
|
||||
|
||||
|
||||
+502
-502
File diff suppressed because it is too large
Load Diff
+25
-25
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Author Fritz Elfert
|
||||
* Copyright by Fritz Elfert <fritz@isdn4linux.de>
|
||||
*
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
@@ -46,10 +46,10 @@ typedef struct actcapi_addr {
|
||||
typedef union actcapi_infonr { /* info number */
|
||||
__u16 mask; /* info-mask field */
|
||||
struct bmask { /* bit definitions */
|
||||
unsigned codes : 3; /* code set */
|
||||
unsigned rsvd : 5; /* reserved */
|
||||
unsigned svind : 1; /* single, variable length ind. */
|
||||
unsigned wtype : 7; /* W-element type */
|
||||
unsigned codes:3; /* code set */
|
||||
unsigned rsvd:5; /* reserved */
|
||||
unsigned svind:1; /* single, variable length ind. */
|
||||
unsigned wtype:7; /* W-element type */
|
||||
} bmask;
|
||||
} actcapi_infonr;
|
||||
|
||||
@@ -59,13 +59,13 @@ typedef union actcapi_infoel { /* info element */
|
||||
__u8 display[40]; /* display contents */
|
||||
__u8 uuinfo[40]; /* User-user info field */
|
||||
struct cause { /* Cause information */
|
||||
unsigned ext2 : 1; /* extension */
|
||||
unsigned cod : 2; /* coding standard */
|
||||
unsigned spare : 1; /* spare */
|
||||
unsigned loc : 4; /* location */
|
||||
unsigned ext1 : 1; /* extension */
|
||||
unsigned cval : 7; /* Cause value */
|
||||
} cause;
|
||||
unsigned ext2:1; /* extension */
|
||||
unsigned cod:2; /* coding standard */
|
||||
unsigned spare:1; /* spare */
|
||||
unsigned loc:4; /* location */
|
||||
unsigned ext1:1; /* extension */
|
||||
unsigned cval:7; /* Cause value */
|
||||
} cause;
|
||||
struct charge { /* Charging information */
|
||||
__u8 toc; /* type of charging info */
|
||||
__u8 unit[10]; /* charging units */
|
||||
@@ -111,14 +111,14 @@ typedef struct actcapi_ncpd {
|
||||
* Bit 5-7 = Controller
|
||||
* Bit 8-15 = NCCI
|
||||
*/
|
||||
#define MAKE_NCCI(plci,contr,ncci) \
|
||||
((plci & 0x1f) | ((contr & 0x7) << 5) | ((ncci & 0xff) << 8))
|
||||
#define MAKE_NCCI(plci, contr, ncci) \
|
||||
((plci & 0x1f) | ((contr & 0x7) << 5) | ((ncci & 0xff) << 8))
|
||||
|
||||
#define EVAL_NCCI(fakencci,plci,contr,ncci) { \
|
||||
plci = fakencci & 0x1f; \
|
||||
contr = (fakencci >> 5) & 0x7; \
|
||||
ncci = (fakencci >> 8) & 0xff; \
|
||||
}
|
||||
#define EVAL_NCCI(fakencci, plci, contr, ncci) { \
|
||||
plci = fakencci & 0x1f; \
|
||||
contr = (fakencci >> 5) & 0x7; \
|
||||
ncci = (fakencci >> 8) & 0xff; \
|
||||
}
|
||||
|
||||
/*
|
||||
* 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 8-15 = reserved (must be 0)
|
||||
*/
|
||||
#define MAKE_PLCI(plci,contr) \
|
||||
((plci & 0x1f) | ((contr & 0x7) << 5))
|
||||
#define MAKE_PLCI(plci, contr) \
|
||||
((plci & 0x1f) | ((contr & 0x7) << 5))
|
||||
|
||||
#define EVAL_PLCI(fakeplci,plci,contr) { \
|
||||
plci = fakeplci & 0x1f; \
|
||||
contr = (fakeplci >> 5) & 0x7; \
|
||||
}
|
||||
#define EVAL_PLCI(fakeplci, plci, contr) { \
|
||||
plci = fakeplci & 0x1f; \
|
||||
contr = (fakeplci >> 5) & 0x7; \
|
||||
}
|
||||
|
||||
typedef struct actcapi_msg {
|
||||
actcapi_msghdr hdr;
|
||||
|
||||
+401
-401
File diff suppressed because it is too large
Load Diff
+92
-92
@@ -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);
|
||||
|
||||
+477
-477
File diff suppressed because it is too large
Load Diff
+21
-21
@@ -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);
|
||||
|
||||
+314
-314
File diff suppressed because it is too large
Load Diff
+58
-58
@@ -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);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Module init for DSS1 diversion services for i4l.
|
||||
*
|
||||
* Copyright 1999 by Werner Cornelius (werner@isdn4linux.de)
|
||||
*
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
@@ -23,13 +23,13 @@ MODULE_LICENSE("GPL");
|
||||
/* structure containing interface to hl */
|
||||
/****************************************/
|
||||
isdn_divert_if divert_if =
|
||||
{ DIVERT_IF_MAGIC, /* magic value */
|
||||
DIVERT_CMD_REG, /* register cmd */
|
||||
ll_callback, /* callback routine from ll */
|
||||
NULL, /* command still not specified */
|
||||
NULL, /* drv_to_name */
|
||||
NULL, /* name_to_drv */
|
||||
};
|
||||
{ DIVERT_IF_MAGIC, /* magic value */
|
||||
DIVERT_CMD_REG, /* register cmd */
|
||||
ll_callback, /* callback routine from ll */
|
||||
NULL, /* command still not specified */
|
||||
NULL, /* drv_to_name */
|
||||
NULL, /* name_to_drv */
|
||||
};
|
||||
|
||||
/*************************/
|
||||
/* Module interface code */
|
||||
@@ -38,17 +38,17 @@ isdn_divert_if divert_if =
|
||||
static int __init divert_init(void)
|
||||
{ int i;
|
||||
|
||||
if (divert_dev_init())
|
||||
{ printk(KERN_WARNING "dss1_divert: cannot install device, not loaded\n");
|
||||
return(-EIO);
|
||||
}
|
||||
if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR)
|
||||
{ divert_dev_deinit();
|
||||
printk(KERN_WARNING "dss1_divert: error %d registering module, not loaded\n",i);
|
||||
return(-EIO);
|
||||
}
|
||||
printk(KERN_INFO "dss1_divert module successfully installed\n");
|
||||
return(0);
|
||||
if (divert_dev_init())
|
||||
{ printk(KERN_WARNING "dss1_divert: cannot install device, not loaded\n");
|
||||
return (-EIO);
|
||||
}
|
||||
if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR)
|
||||
{ divert_dev_deinit();
|
||||
printk(KERN_WARNING "dss1_divert: error %d registering module, not loaded\n", i);
|
||||
return (-EIO);
|
||||
}
|
||||
printk(KERN_INFO "dss1_divert module successfully installed\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/**********************/
|
||||
@@ -56,27 +56,26 @@ static int __init divert_init(void)
|
||||
/**********************/
|
||||
static void __exit divert_exit(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
int i;
|
||||
unsigned long flags;
|
||||
int i;
|
||||
|
||||
spin_lock_irqsave(&divert_lock, flags);
|
||||
divert_if.cmd = DIVERT_CMD_REL; /* release */
|
||||
if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR)
|
||||
{ printk(KERN_WARNING "dss1_divert: error %d releasing module\n",i);
|
||||
spin_unlock_irqrestore(&divert_lock, flags);
|
||||
return;
|
||||
}
|
||||
if (divert_dev_deinit())
|
||||
{ printk(KERN_WARNING "dss1_divert: device busy, remove cancelled\n");
|
||||
spin_unlock_irqrestore(&divert_lock, flags);
|
||||
return;
|
||||
}
|
||||
spin_unlock_irqrestore(&divert_lock, flags);
|
||||
deleterule(-1); /* delete all rules and free mem */
|
||||
deleteprocs();
|
||||
printk(KERN_INFO "dss1_divert module successfully removed \n");
|
||||
spin_lock_irqsave(&divert_lock, flags);
|
||||
divert_if.cmd = DIVERT_CMD_REL; /* release */
|
||||
if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR)
|
||||
{ printk(KERN_WARNING "dss1_divert: error %d releasing module\n", i);
|
||||
spin_unlock_irqrestore(&divert_lock, flags);
|
||||
return;
|
||||
}
|
||||
if (divert_dev_deinit())
|
||||
{ printk(KERN_WARNING "dss1_divert: device busy, remove cancelled\n");
|
||||
spin_unlock_irqrestore(&divert_lock, flags);
|
||||
return;
|
||||
}
|
||||
spin_unlock_irqrestore(&divert_lock, flags);
|
||||
deleterule(-1); /* delete all rules and free mem */
|
||||
deleteprocs();
|
||||
printk(KERN_INFO "dss1_divert module successfully removed \n");
|
||||
}
|
||||
|
||||
module_init(divert_init);
|
||||
module_exit(divert_exit);
|
||||
|
||||
|
||||
@@ -50,10 +50,10 @@ put_info_buffer(char *cp)
|
||||
if (!*cp)
|
||||
return;
|
||||
if (!(ib = kmalloc(sizeof(struct divert_info) + strlen(cp), GFP_ATOMIC)))
|
||||
return; /* no memory */
|
||||
return; /* no memory */
|
||||
strcpy(ib->info_start, cp); /* set output string */
|
||||
ib->next = NULL;
|
||||
spin_lock_irqsave( &divert_info_lock, flags );
|
||||
spin_lock_irqsave(&divert_info_lock, flags);
|
||||
ib->usage_cnt = if_used;
|
||||
if (!divert_info_head)
|
||||
divert_info_head = ib; /* new head */
|
||||
@@ -71,7 +71,7 @@ put_info_buffer(char *cp)
|
||||
} else
|
||||
break;
|
||||
} /* divert_info_head->next */
|
||||
spin_unlock_irqrestore( &divert_info_lock, flags );
|
||||
spin_unlock_irqrestore(&divert_info_lock, flags);
|
||||
wake_up_interruptible(&(rd_queue));
|
||||
} /* put_info_buffer */
|
||||
|
||||
@@ -81,7 +81,7 @@ put_info_buffer(char *cp)
|
||||
/* deflection device read routine */
|
||||
/**********************************/
|
||||
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;
|
||||
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 */
|
||||
/**********************************/
|
||||
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);
|
||||
} /* 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 */
|
||||
/***************************************/
|
||||
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;
|
||||
|
||||
@@ -139,13 +139,13 @@ isdn_divert_open(struct inode *ino, struct file *filep)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave( &divert_info_lock, flags );
|
||||
if_used++;
|
||||
spin_lock_irqsave(&divert_info_lock, flags);
|
||||
if_used++;
|
||||
if (divert_info_head)
|
||||
filep->private_data = &(divert_info_tail->next);
|
||||
else
|
||||
filep->private_data = &divert_info_head;
|
||||
spin_unlock_irqrestore( &divert_info_lock, flags );
|
||||
spin_unlock_irqrestore(&divert_info_lock, flags);
|
||||
/* start_divert(); */
|
||||
return nonseekable_open(ino, filep);
|
||||
} /* isdn_divert_open */
|
||||
@@ -159,7 +159,7 @@ isdn_divert_close(struct inode *ino, struct file *filep)
|
||||
struct divert_info *inf;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave( &divert_info_lock, flags );
|
||||
spin_lock_irqsave(&divert_info_lock, flags);
|
||||
if_used--;
|
||||
inf = *((struct divert_info **) filep->private_data);
|
||||
while (inf) {
|
||||
@@ -172,7 +172,7 @@ isdn_divert_close(struct inode *ino, struct file *filep)
|
||||
divert_info_head = divert_info_head->next;
|
||||
kfree(inf);
|
||||
}
|
||||
spin_unlock_irqrestore( &divert_info_lock, flags );
|
||||
spin_unlock_irqrestore(&divert_info_lock, flags);
|
||||
return (0);
|
||||
} /* isdn_divert_close */
|
||||
|
||||
@@ -191,75 +191,75 @@ static int isdn_divert_ioctl_unlocked(struct file *file, uint cmd, ulong arg)
|
||||
return -EFAULT;
|
||||
|
||||
switch (cmd) {
|
||||
case IIOCGETVER:
|
||||
dioctl.drv_version = DIVERT_IIOC_VERSION; /* set version */
|
||||
break;
|
||||
case IIOCGETVER:
|
||||
dioctl.drv_version = DIVERT_IIOC_VERSION; /* set version */
|
||||
break;
|
||||
|
||||
case IIOCGETDRV:
|
||||
if ((dioctl.getid.drvid = divert_if.name_to_drv(dioctl.getid.drvnam)) < 0)
|
||||
return (-EINVAL);
|
||||
break;
|
||||
|
||||
case IIOCGETNAM:
|
||||
cp = divert_if.drv_to_name(dioctl.getid.drvid);
|
||||
if (!cp)
|
||||
return (-EINVAL);
|
||||
if (!*cp)
|
||||
return (-EINVAL);
|
||||
strcpy(dioctl.getid.drvnam, cp);
|
||||
break;
|
||||
|
||||
case IIOCGETRULE:
|
||||
if (!(rulep = getruleptr(dioctl.getsetrule.ruleidx)))
|
||||
return (-EINVAL);
|
||||
dioctl.getsetrule.rule = *rulep; /* copy data */
|
||||
break;
|
||||
|
||||
case IIOCMODRULE:
|
||||
if (!(rulep = getruleptr(dioctl.getsetrule.ruleidx)))
|
||||
return (-EINVAL);
|
||||
spin_lock_irqsave(&divert_lock, flags);
|
||||
*rulep = dioctl.getsetrule.rule; /* copy data */
|
||||
spin_unlock_irqrestore(&divert_lock, flags);
|
||||
return (0); /* no copy required */
|
||||
break;
|
||||
|
||||
case IIOCINSRULE:
|
||||
return (insertrule(dioctl.getsetrule.ruleidx, &dioctl.getsetrule.rule));
|
||||
break;
|
||||
|
||||
case IIOCDELRULE:
|
||||
return (deleterule(dioctl.getsetrule.ruleidx));
|
||||
break;
|
||||
|
||||
case IIOCDODFACT:
|
||||
return (deflect_extern_action(dioctl.fwd_ctrl.subcmd,
|
||||
dioctl.fwd_ctrl.callid,
|
||||
dioctl.fwd_ctrl.to_nr));
|
||||
|
||||
case IIOCDOCFACT:
|
||||
case IIOCDOCFDIS:
|
||||
case IIOCDOCFINT:
|
||||
if (!divert_if.drv_to_name(dioctl.cf_ctrl.drvid))
|
||||
return (-EINVAL); /* invalid driver */
|
||||
if (strnlen(dioctl.cf_ctrl.msn, sizeof(dioctl.cf_ctrl.msn)) ==
|
||||
sizeof(dioctl.cf_ctrl.msn))
|
||||
return -EINVAL;
|
||||
if (strnlen(dioctl.cf_ctrl.fwd_nr, sizeof(dioctl.cf_ctrl.fwd_nr)) ==
|
||||
sizeof(dioctl.cf_ctrl.fwd_nr))
|
||||
return -EINVAL;
|
||||
if ((i = cf_command(dioctl.cf_ctrl.drvid,
|
||||
(cmd == IIOCDOCFACT) ? 1 : (cmd == IIOCDOCFDIS) ? 0 : 2,
|
||||
dioctl.cf_ctrl.cfproc,
|
||||
dioctl.cf_ctrl.msn,
|
||||
dioctl.cf_ctrl.service,
|
||||
dioctl.cf_ctrl.fwd_nr,
|
||||
&dioctl.cf_ctrl.procid)))
|
||||
return (i);
|
||||
break;
|
||||
|
||||
default:
|
||||
case IIOCGETDRV:
|
||||
if ((dioctl.getid.drvid = divert_if.name_to_drv(dioctl.getid.drvnam)) < 0)
|
||||
return (-EINVAL);
|
||||
break;
|
||||
|
||||
case IIOCGETNAM:
|
||||
cp = divert_if.drv_to_name(dioctl.getid.drvid);
|
||||
if (!cp)
|
||||
return (-EINVAL);
|
||||
if (!*cp)
|
||||
return (-EINVAL);
|
||||
strcpy(dioctl.getid.drvnam, cp);
|
||||
break;
|
||||
|
||||
case IIOCGETRULE:
|
||||
if (!(rulep = getruleptr(dioctl.getsetrule.ruleidx)))
|
||||
return (-EINVAL);
|
||||
dioctl.getsetrule.rule = *rulep; /* copy data */
|
||||
break;
|
||||
|
||||
case IIOCMODRULE:
|
||||
if (!(rulep = getruleptr(dioctl.getsetrule.ruleidx)))
|
||||
return (-EINVAL);
|
||||
spin_lock_irqsave(&divert_lock, flags);
|
||||
*rulep = dioctl.getsetrule.rule; /* copy data */
|
||||
spin_unlock_irqrestore(&divert_lock, flags);
|
||||
return (0); /* no copy required */
|
||||
break;
|
||||
|
||||
case IIOCINSRULE:
|
||||
return (insertrule(dioctl.getsetrule.ruleidx, &dioctl.getsetrule.rule));
|
||||
break;
|
||||
|
||||
case IIOCDELRULE:
|
||||
return (deleterule(dioctl.getsetrule.ruleidx));
|
||||
break;
|
||||
|
||||
case IIOCDODFACT:
|
||||
return (deflect_extern_action(dioctl.fwd_ctrl.subcmd,
|
||||
dioctl.fwd_ctrl.callid,
|
||||
dioctl.fwd_ctrl.to_nr));
|
||||
|
||||
case IIOCDOCFACT:
|
||||
case IIOCDOCFDIS:
|
||||
case IIOCDOCFINT:
|
||||
if (!divert_if.drv_to_name(dioctl.cf_ctrl.drvid))
|
||||
return (-EINVAL); /* invalid driver */
|
||||
if (strnlen(dioctl.cf_ctrl.msn, sizeof(dioctl.cf_ctrl.msn)) ==
|
||||
sizeof(dioctl.cf_ctrl.msn))
|
||||
return -EINVAL;
|
||||
if (strnlen(dioctl.cf_ctrl.fwd_nr, sizeof(dioctl.cf_ctrl.fwd_nr)) ==
|
||||
sizeof(dioctl.cf_ctrl.fwd_nr))
|
||||
return -EINVAL;
|
||||
if ((i = cf_command(dioctl.cf_ctrl.drvid,
|
||||
(cmd == IIOCDOCFACT) ? 1 : (cmd == IIOCDOCFDIS) ? 0 : 2,
|
||||
dioctl.cf_ctrl.cfproc,
|
||||
dioctl.cf_ctrl.msn,
|
||||
dioctl.cf_ctrl.service,
|
||||
dioctl.cf_ctrl.fwd_nr,
|
||||
&dioctl.cf_ctrl.procid)))
|
||||
return (i);
|
||||
break;
|
||||
|
||||
default:
|
||||
return (-EINVAL);
|
||||
} /* switch cmd */
|
||||
return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0;
|
||||
} /* isdn_divert_ioctl */
|
||||
@@ -284,7 +284,7 @@ static const struct file_operations isdn_fops =
|
||||
.poll = isdn_divert_poll,
|
||||
.unlocked_ioctl = isdn_divert_ioctl,
|
||||
.open = isdn_divert_open,
|
||||
.release = isdn_divert_close,
|
||||
.release = isdn_divert_close,
|
||||
};
|
||||
|
||||
/****************************/
|
||||
|
||||
+687
-688
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
* Header for the diversion supplementary ioctl interface.
|
||||
*
|
||||
* Copyright 1998 by Werner Cornelius (werner@ikt.de)
|
||||
*
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU General Public License, incorporated herein by reference.
|
||||
*
|
||||
@@ -20,13 +20,13 @@
|
||||
#define IIOCGETDRV _IO('I', 2) /* get driver number */
|
||||
#define IIOCGETNAM _IO('I', 3) /* get driver name */
|
||||
#define IIOCGETRULE _IO('I', 4) /* read one rule */
|
||||
#define IIOCMODRULE _IO('I', 5) /* modify/replace a rule */
|
||||
#define IIOCMODRULE _IO('I', 5) /* modify/replace a rule */
|
||||
#define IIOCINSRULE _IO('I', 6) /* insert/append one rule */
|
||||
#define IIOCDELRULE _IO('I', 7) /* delete a rule */
|
||||
#define IIOCDODFACT _IO('I', 8) /* hangup/reject/alert/immediately deflect a call */
|
||||
#define IIOCDOCFACT _IO('I', 9) /* activate 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 IIOCDOCFDIS _IO('I', 10) /* deactivate control forwarding in PBX */
|
||||
#define IIOCDOCFINT _IO('I', 11) /* interrogate control forwarding in PBX */
|
||||
|
||||
/*************************************/
|
||||
/* states reported through interface */
|
||||
@@ -34,65 +34,65 @@
|
||||
#define DEFLECT_IGNORE 0 /* ignore incoming call */
|
||||
#define DEFLECT_REPORT 1 /* only report */
|
||||
#define DEFLECT_PROCEED 2 /* deflect when externally triggered */
|
||||
#define DEFLECT_ALERT 3 /* alert and deflect after delay */
|
||||
#define DEFLECT_ALERT 3 /* alert and deflect after delay */
|
||||
#define DEFLECT_REJECT 4 /* reject immediately */
|
||||
#define DIVERT_ACTIVATE 5 /* diversion activate */
|
||||
#define DIVERT_DEACTIVATE 6 /* diversion deactivate */
|
||||
#define DIVERT_REPORT 7 /* interrogation result */
|
||||
#define DEFLECT_AUTODEL 255 /* only for internal use */
|
||||
#define DIVERT_REPORT 7 /* interrogation result */
|
||||
#define DEFLECT_AUTODEL 255 /* only for internal use */
|
||||
|
||||
#define DEFLECT_ALL_IDS 0xFFFFFFFF /* all drivers selected */
|
||||
|
||||
typedef struct
|
||||
{ ulong drvid; /* driver ids, bit mapped */
|
||||
char my_msn[35]; /* desired msn, subaddr allowed */
|
||||
char caller[35]; /* caller id, partial string with * + subaddr allowed */
|
||||
char to_nr[35]; /* deflected to number incl. subaddress */
|
||||
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 callopt; /* option for call handling:
|
||||
0 = all calls
|
||||
1 = only non waiting calls
|
||||
2 = only waiting calls */
|
||||
u_char action; /* desired action:
|
||||
0 = don't report call -> ignore
|
||||
1 = report call, do not allow/proceed for deflection
|
||||
2 = report call, send proceed, wait max waittime secs
|
||||
3 = report call, alert and deflect after waittime
|
||||
4 = report call, reject immediately
|
||||
actions 1-2 only take place if interface is opened
|
||||
*/
|
||||
u_char waittime; /* maximum wait time for proceeding */
|
||||
} divert_rule;
|
||||
{ ulong drvid; /* driver ids, bit mapped */
|
||||
char my_msn[35]; /* desired msn, subaddr allowed */
|
||||
char caller[35]; /* caller id, partial string with * + subaddr allowed */
|
||||
char to_nr[35]; /* deflected to number incl. subaddress */
|
||||
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 callopt; /* option for call handling:
|
||||
0 = all calls
|
||||
1 = only non waiting calls
|
||||
2 = only waiting calls */
|
||||
u_char action; /* desired action:
|
||||
0 = don't report call -> ignore
|
||||
1 = report call, do not allow/proceed for deflection
|
||||
2 = report call, send proceed, wait max waittime secs
|
||||
3 = report call, alert and deflect after waittime
|
||||
4 = report call, reject immediately
|
||||
actions 1-2 only take place if interface is opened
|
||||
*/
|
||||
u_char waittime; /* maximum wait time for proceeding */
|
||||
} divert_rule;
|
||||
|
||||
typedef union
|
||||
{ int drv_version; /* return of driver version */
|
||||
struct
|
||||
{ int drvid; /* id of driver */
|
||||
char drvnam[30]; /* name of driver */
|
||||
} getid;
|
||||
struct
|
||||
{ int ruleidx; /* index of rule */
|
||||
divert_rule rule; /* rule parms */
|
||||
} getsetrule;
|
||||
struct
|
||||
{ u_char subcmd; /* 0 = hangup/reject,
|
||||
1 = alert,
|
||||
2 = deflect */
|
||||
ulong callid; /* id of call delivered by ascii output */
|
||||
char to_nr[35]; /* destination when deflect,
|
||||
else uus1 string (maxlen 31),
|
||||
data from rule used if empty */
|
||||
} fwd_ctrl;
|
||||
struct
|
||||
{ int drvid; /* id of driver */
|
||||
u_char cfproc; /* cfu = 0, cfb = 1, cfnr = 2 */
|
||||
ulong procid; /* process id returned when no error */
|
||||
u_char service; /* basically coded service, 0 = all */
|
||||
char msn[25]; /* desired msn, empty = all */
|
||||
char fwd_nr[35];/* forwarded to number + subaddress */
|
||||
} cf_ctrl;
|
||||
} divert_ioctl;
|
||||
{ int drv_version; /* return of driver version */
|
||||
struct
|
||||
{ int drvid; /* id of driver */
|
||||
char drvnam[30]; /* name of driver */
|
||||
} getid;
|
||||
struct
|
||||
{ int ruleidx; /* index of rule */
|
||||
divert_rule rule; /* rule parms */
|
||||
} getsetrule;
|
||||
struct
|
||||
{ u_char subcmd; /* 0 = hangup/reject,
|
||||
1 = alert,
|
||||
2 = deflect */
|
||||
ulong callid; /* id of call delivered by ascii output */
|
||||
char to_nr[35]; /* destination when deflect,
|
||||
else uus1 string (maxlen 31),
|
||||
data from rule used if empty */
|
||||
} fwd_ctrl;
|
||||
struct
|
||||
{ int drvid; /* id of driver */
|
||||
u_char cfproc; /* cfu = 0, cfb = 1, cfnr = 2 */
|
||||
ulong procid; /* process id returned when no error */
|
||||
u_char service; /* basically coded service, 0 = all */
|
||||
char msn[25]; /* desired msn, empty = all */
|
||||
char fwd_nr[35];/* forwarded to number + subaddress */
|
||||
} cf_ctrl;
|
||||
} divert_ioctl;
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
@@ -105,10 +105,10 @@ typedef union
|
||||
/* structure keeping ascii info for device output */
|
||||
/**************************************************/
|
||||
struct divert_info
|
||||
{ struct divert_info *next;
|
||||
ulong usage_cnt; /* number of files still to work */
|
||||
char info_start[2]; /* info string start */
|
||||
};
|
||||
{ struct divert_info *next;
|
||||
ulong usage_cnt; /* number of files still to work */
|
||||
char info_start[2]; /* info string start */
|
||||
};
|
||||
|
||||
|
||||
/**************/
|
||||
|
||||
@@ -214,7 +214,7 @@ byte_stuff:
|
||||
} else if (fcs != PPP_GOODFCS) {
|
||||
/* frame check error */
|
||||
dev_err(cs->dev,
|
||||
"Checksum failed, %u bytes corrupted!\n",
|
||||
"Checksum failed, %u bytes corrupted!\n",
|
||||
skb->len);
|
||||
gigaset_isdn_rcv_err(bcs);
|
||||
dev_kfree_skb_any(skb);
|
||||
@@ -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):
|
||||
* 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) {
|
||||
dev_kfree_skb_any(skb);
|
||||
return NULL;
|
||||
|
||||
@@ -410,10 +410,10 @@ static void check_pending(struct bas_cardstate *ucs)
|
||||
if (!(ucs->basstate & BS_RESETTING))
|
||||
ucs->pending = 0;
|
||||
break;
|
||||
/*
|
||||
* HD_READ_ATMESSAGE and HD_WRITE_ATMESSAGE are handled separately
|
||||
* and should never end up here
|
||||
*/
|
||||
/*
|
||||
* HD_READ_ATMESSAGE and HD_WRITE_ATMESSAGE are handled separately
|
||||
* and should never end up here
|
||||
*/
|
||||
default:
|
||||
dev_warn(&ucs->interface->dev,
|
||||
"unknown pending request 0x%02x cleared\n",
|
||||
@@ -491,7 +491,7 @@ static void read_ctrl_callback(struct urb *urb)
|
||||
numbytes = urb->actual_length;
|
||||
if (unlikely(numbytes != ucs->rcvbuf_size)) {
|
||||
dev_warn(cs->dev,
|
||||
"control read: received %d chars, expected %d\n",
|
||||
"control read: received %d chars, expected %d\n",
|
||||
numbytes, ucs->rcvbuf_size);
|
||||
if (numbytes > ucs->rcvbuf_size)
|
||||
numbytes = ucs->rcvbuf_size;
|
||||
@@ -710,7 +710,7 @@ static void read_int_callback(struct urb *urb)
|
||||
}
|
||||
|
||||
l = (unsigned) ucs->int_in_buf[1] +
|
||||
(((unsigned) ucs->int_in_buf[2]) << 8);
|
||||
(((unsigned) ucs->int_in_buf[2]) << 8);
|
||||
|
||||
gig_dbg(DEBUG_USBREQ, "<-------%d: 0x%02x (%u [0x%02x 0x%02x])",
|
||||
urb->actual_length, (int)ucs->int_in_buf[0], l,
|
||||
@@ -770,14 +770,14 @@ static void read_int_callback(struct urb *urb)
|
||||
case HD_RECEIVEATDATA_ACK: /* AT response ready to be received */
|
||||
if (!l) {
|
||||
dev_warn(cs->dev,
|
||||
"HD_RECEIVEATDATA_ACK with length 0 ignored\n");
|
||||
"HD_RECEIVEATDATA_ACK with length 0 ignored\n");
|
||||
break;
|
||||
}
|
||||
spin_lock_irqsave(&cs->lock, flags);
|
||||
if (ucs->basstate & BS_ATRDPEND) {
|
||||
spin_unlock_irqrestore(&cs->lock, flags);
|
||||
dev_warn(cs->dev,
|
||||
"HD_RECEIVEATDATA_ACK(%d) during HD_READ_ATMESSAGE(%d) ignored\n",
|
||||
"HD_RECEIVEATDATA_ACK(%d) during HD_READ_ATMESSAGE(%d) ignored\n",
|
||||
l, ucs->rcvbuf_size);
|
||||
break;
|
||||
}
|
||||
@@ -878,7 +878,7 @@ static void read_iso_callback(struct urb *urb)
|
||||
ubc->isoinlost += urb->iso_frame_desc[i].actual_length;
|
||||
if (unlikely(urb->iso_frame_desc[i].status != 0 &&
|
||||
urb->iso_frame_desc[i].status !=
|
||||
-EINPROGRESS))
|
||||
-EINPROGRESS))
|
||||
ubc->loststatus = urb->iso_frame_desc[i].status;
|
||||
urb->iso_frame_desc[i].status = 0;
|
||||
urb->iso_frame_desc[i].actual_length = 0;
|
||||
@@ -891,7 +891,7 @@ static void read_iso_callback(struct urb *urb)
|
||||
rc = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (unlikely(rc != 0 && rc != -ENODEV)) {
|
||||
dev_err(bcs->cs->dev,
|
||||
"could not resubmit isoc read URB: %s\n",
|
||||
"could not resubmit isoc read URB: %s\n",
|
||||
get_usb_rcmsg(rc));
|
||||
dump_urb(DEBUG_ISO, "isoc read", urb);
|
||||
error_hangup(bcs);
|
||||
@@ -1017,17 +1017,17 @@ static int starturbs(struct bc_state *bcs)
|
||||
}
|
||||
|
||||
/* 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);
|
||||
rc = usb_submit_urb(ubc->isoouturbs[k].urb, GFP_ATOMIC);
|
||||
if (rc != 0)
|
||||
goto error;
|
||||
}
|
||||
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;
|
||||
return 0;
|
||||
error:
|
||||
error:
|
||||
stopurbs(ubc);
|
||||
return rc;
|
||||
}
|
||||
@@ -1229,7 +1229,7 @@ static void write_iso_tasklet(unsigned long data)
|
||||
if (ifd->status ||
|
||||
ifd->actual_length != ifd->length) {
|
||||
dev_warn(cs->dev,
|
||||
"isoc write: frame %d[%d/%d]: %s\n",
|
||||
"isoc write: frame %d[%d/%d]: %s\n",
|
||||
i, ifd->actual_length,
|
||||
ifd->length,
|
||||
get_usb_statmsg(ifd->status));
|
||||
@@ -1316,7 +1316,7 @@ static void read_iso_tasklet(unsigned long data)
|
||||
ubc->isoindone = NULL;
|
||||
if (unlikely(ubc->loststatus != -EINPROGRESS)) {
|
||||
dev_warn(cs->dev,
|
||||
"isoc read overrun, URB dropped (status: %s, %d bytes)\n",
|
||||
"isoc read overrun, URB dropped (status: %s, %d bytes)\n",
|
||||
get_usb_statmsg(ubc->loststatus),
|
||||
ubc->isoinlost);
|
||||
ubc->loststatus = -EINPROGRESS;
|
||||
@@ -1965,7 +1965,7 @@ static int gigaset_write_cmd(struct cardstate *cs, struct cmdbuf_t *cb)
|
||||
int rc;
|
||||
|
||||
gigaset_dbg_buffer(cs->mstate != MS_LOCKED ?
|
||||
DEBUG_TRANSCMD : DEBUG_LOCKCMD,
|
||||
DEBUG_TRANSCMD : DEBUG_LOCKCMD,
|
||||
"CMD Transmit", cb->len, cb->buf);
|
||||
|
||||
/* translate "+++" escape sequence sent as a single separate command
|
||||
@@ -2453,13 +2453,13 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
|
||||
|
||||
/* wait a bit for blocking conditions to go away */
|
||||
rc = wait_event_timeout(ucs->waitqueue,
|
||||
!(ucs->basstate &
|
||||
(BS_B1OPEN|BS_B2OPEN|BS_ATRDPEND|BS_ATWRPEND)),
|
||||
BAS_TIMEOUT*HZ/10);
|
||||
!(ucs->basstate &
|
||||
(BS_B1OPEN | BS_B2OPEN | BS_ATRDPEND | BS_ATWRPEND)),
|
||||
BAS_TIMEOUT * HZ / 10);
|
||||
gig_dbg(DEBUG_SUSPEND, "wait_event_timeout() -> %d", rc);
|
||||
|
||||
/* 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");
|
||||
if (ucs->basstate & BS_B1OPEN)
|
||||
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;
|
||||
}
|
||||
wait_event_timeout(ucs->waitqueue, !ucs->pending,
|
||||
BAS_TIMEOUT*HZ/10);
|
||||
BAS_TIMEOUT * HZ / 10);
|
||||
/* in case of timeout, proceed anyway */
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user