Commit 8de65c2a authored by David S. Miller's avatar David S. Miller

Merge branch '20120221_isdn' of git://repo.or.cz/linux-2.6/trivial-mods

parents fc0d7536 475be4d8
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Author Fritz Elfert * Author Fritz Elfert
* Copyright by Fritz Elfert <fritz@isdn4linux.de> * Copyright by Fritz Elfert <fritz@isdn4linux.de>
* *
* This software may be used and distributed according to the terms * This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference. * of the GNU General Public License, incorporated herein by reference.
* *
...@@ -40,21 +40,21 @@ ...@@ -40,21 +40,21 @@
/* Struct for adding new cards */ /* Struct for adding new cards */
typedef struct act2000_cdef { typedef struct act2000_cdef {
int bus; int bus;
int port; int port;
int irq; int irq;
char id[10]; char id[10];
} act2000_cdef; } act2000_cdef;
/* Struct for downloading firmware */ /* Struct for downloading firmware */
typedef struct act2000_ddef { typedef struct act2000_ddef {
int length; /* Length of code */ int length; /* Length of code */
char __user *buffer; /* Ptr. to code */ char __user *buffer; /* Ptr. to code */
} act2000_ddef; } act2000_ddef;
typedef struct act2000_fwid { typedef struct act2000_fwid {
char isdn[4]; char isdn[4];
char revlen[2]; char revlen[2];
char revision[504]; char revision[504];
} act2000_fwid; } act2000_fwid;
#if defined(__KERNEL__) || defined(__DEBUGVAR__) #if defined(__KERNEL__) || defined(__DEBUGVAR__)
...@@ -128,8 +128,8 @@ typedef struct act2000_chan { ...@@ -128,8 +128,8 @@ typedef struct act2000_chan {
typedef struct msn_entry { typedef struct msn_entry {
char eaz; char eaz;
char msn[16]; char msn[16];
struct msn_entry * next; struct msn_entry *next;
} msn_entry; } msn_entry;
typedef struct irq_data_isa { typedef struct irq_data_isa {
...@@ -183,17 +183,17 @@ typedef struct act2000_card { ...@@ -183,17 +183,17 @@ typedef struct act2000_card {
static inline void act2000_schedule_tx(act2000_card *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) 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) 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); extern char *act2000_find_eaz(act2000_card *, char);
......
This diff is collapsed.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Author Fritz Elfert * Author Fritz Elfert
* Copyright by Fritz Elfert <fritz@isdn4linux.de> * Copyright by Fritz Elfert <fritz@isdn4linux.de>
* *
* This software may be used and distributed according to the terms * This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference. * of the GNU General Public License, incorporated herein by reference.
* *
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
#define ISA_POLL_LOOP 40 /* Try to read-write before give up */ #define ISA_POLL_LOOP 40 /* Try to read-write before give up */
typedef enum { typedef enum {
INT_NO_CHANGE = 0, /* Do not change the Mask */ INT_NO_CHANGE = 0, /* Do not change the Mask */
INT_ON = 1, /* Set to Enable */ INT_ON = 1, /* Set to Enable */
INT_OFF = 2, /* Set to Disable */ INT_OFF = 2, /* Set to Disable */
} ISA_INT_T; } ISA_INT_T;
/**************************************************************************/ /**************************************************************************/
...@@ -114,22 +114,22 @@ typedef enum { ...@@ -114,22 +114,22 @@ typedef enum {
/* Macros for accessing ports */ /* Macros for accessing ports */
#define ISA_PORT_COR (card->port+ISA_COR) #define ISA_PORT_COR (card->port + ISA_COR)
#define ISA_PORT_ISR (card->port+ISA_ISR) #define ISA_PORT_ISR (card->port + ISA_ISR)
#define ISA_PORT_EPR (card->port+ISA_EPR) #define ISA_PORT_EPR (card->port + ISA_EPR)
#define ISA_PORT_EER (card->port+ISA_EER) #define ISA_PORT_EER (card->port + ISA_EER)
#define ISA_PORT_SDI (card->port+ISA_SDI) #define ISA_PORT_SDI (card->port + ISA_SDI)
#define ISA_PORT_SDO (card->port+ISA_SDO) #define ISA_PORT_SDO (card->port + ISA_SDO)
#define ISA_PORT_SIS (card->port+ISA_SIS) #define ISA_PORT_SIS (card->port + ISA_SIS)
#define ISA_PORT_SOS (card->port+ISA_SOS) #define ISA_PORT_SOS (card->port + ISA_SOS)
/* Prototypes */ /* Prototypes */
extern int act2000_isa_detect(unsigned short portbase); extern int act2000_isa_detect(unsigned short portbase);
extern int act2000_isa_config_irq(act2000_card * card, short irq); extern int act2000_isa_config_irq(act2000_card *card, short irq);
extern int act2000_isa_config_port(act2000_card * card, unsigned short portbase); extern int act2000_isa_config_port(act2000_card *card, unsigned short portbase);
extern int act2000_isa_download(act2000_card * card, act2000_ddef __user * cb); extern int act2000_isa_download(act2000_card *card, act2000_ddef __user *cb);
extern void act2000_isa_release(act2000_card * card); extern void act2000_isa_release(act2000_card *card);
extern void act2000_isa_receive(act2000_card *card); extern void act2000_isa_receive(act2000_card *card);
extern void act2000_isa_send(act2000_card *card); extern void act2000_isa_send(act2000_card *card);
......
This diff is collapsed.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Author Fritz Elfert * Author Fritz Elfert
* Copyright by Fritz Elfert <fritz@isdn4linux.de> * Copyright by Fritz Elfert <fritz@isdn4linux.de>
* *
* This software may be used and distributed according to the terms * This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference. * of the GNU General Public License, incorporated herein by reference.
* *
...@@ -46,10 +46,10 @@ typedef struct actcapi_addr { ...@@ -46,10 +46,10 @@ typedef struct actcapi_addr {
typedef union actcapi_infonr { /* info number */ typedef union actcapi_infonr { /* info number */
__u16 mask; /* info-mask field */ __u16 mask; /* info-mask field */
struct bmask { /* bit definitions */ struct bmask { /* bit definitions */
unsigned codes : 3; /* code set */ unsigned codes:3; /* code set */
unsigned rsvd : 5; /* reserved */ unsigned rsvd:5; /* reserved */
unsigned svind : 1; /* single, variable length ind. */ unsigned svind:1; /* single, variable length ind. */
unsigned wtype : 7; /* W-element type */ unsigned wtype:7; /* W-element type */
} bmask; } bmask;
} actcapi_infonr; } actcapi_infonr;
...@@ -59,13 +59,13 @@ typedef union actcapi_infoel { /* info element */ ...@@ -59,13 +59,13 @@ typedef union actcapi_infoel { /* info element */
__u8 display[40]; /* display contents */ __u8 display[40]; /* display contents */
__u8 uuinfo[40]; /* User-user info field */ __u8 uuinfo[40]; /* User-user info field */
struct cause { /* Cause information */ struct cause { /* Cause information */
unsigned ext2 : 1; /* extension */ unsigned ext2:1; /* extension */
unsigned cod : 2; /* coding standard */ unsigned cod:2; /* coding standard */
unsigned spare : 1; /* spare */ unsigned spare:1; /* spare */
unsigned loc : 4; /* location */ unsigned loc:4; /* location */
unsigned ext1 : 1; /* extension */ unsigned ext1:1; /* extension */
unsigned cval : 7; /* Cause value */ unsigned cval:7; /* Cause value */
} cause; } cause;
struct charge { /* Charging information */ struct charge { /* Charging information */
__u8 toc; /* type of charging info */ __u8 toc; /* type of charging info */
__u8 unit[10]; /* charging units */ __u8 unit[10]; /* charging units */
...@@ -111,14 +111,14 @@ typedef struct actcapi_ncpd { ...@@ -111,14 +111,14 @@ typedef struct actcapi_ncpd {
* Bit 5-7 = Controller * Bit 5-7 = Controller
* Bit 8-15 = NCCI * Bit 8-15 = NCCI
*/ */
#define MAKE_NCCI(plci,contr,ncci) \ #define MAKE_NCCI(plci, contr, ncci) \
((plci & 0x1f) | ((contr & 0x7) << 5) | ((ncci & 0xff) << 8)) ((plci & 0x1f) | ((contr & 0x7) << 5) | ((ncci & 0xff) << 8))
#define EVAL_NCCI(fakencci,plci,contr,ncci) { \ #define EVAL_NCCI(fakencci, plci, contr, ncci) { \
plci = fakencci & 0x1f; \ plci = fakencci & 0x1f; \
contr = (fakencci >> 5) & 0x7; \ contr = (fakencci >> 5) & 0x7; \
ncci = (fakencci >> 8) & 0xff; \ ncci = (fakencci >> 8) & 0xff; \
} }
/* /*
* Layout of PLCI field in a B3 DATA CAPI message is different from * Layout of PLCI field in a B3 DATA CAPI message is different from
...@@ -128,13 +128,13 @@ typedef struct actcapi_ncpd { ...@@ -128,13 +128,13 @@ typedef struct actcapi_ncpd {
* Bit 5-7 = Controller * Bit 5-7 = Controller
* Bit 8-15 = reserved (must be 0) * Bit 8-15 = reserved (must be 0)
*/ */
#define MAKE_PLCI(plci,contr) \ #define MAKE_PLCI(plci, contr) \
((plci & 0x1f) | ((contr & 0x7) << 5)) ((plci & 0x1f) | ((contr & 0x7) << 5))
#define EVAL_PLCI(fakeplci,plci,contr) { \ #define EVAL_PLCI(fakeplci, plci, contr) { \
plci = fakeplci & 0x1f; \ plci = fakeplci & 0x1f; \
contr = (fakeplci >> 5) & 0x7; \ contr = (fakeplci >> 5) & 0x7; \
} }
typedef struct actcapi_msg { typedef struct actcapi_msg {
actcapi_msghdr hdr; actcapi_msghdr hdr;
......
This diff is collapsed.
...@@ -164,7 +164,7 @@ static int capiminor_del_ack(struct capiminor *mp, u16 datahandle) ...@@ -164,7 +164,7 @@ static int capiminor_del_ack(struct capiminor *mp, u16 datahandle)
spin_lock_bh(&mp->ackqlock); spin_lock_bh(&mp->ackqlock);
list_for_each_entry_safe(p, tmp, &mp->ackqueue, list) { list_for_each_entry_safe(p, tmp, &mp->ackqueue, list) {
if (p->datahandle == datahandle) { if (p->datahandle == datahandle) {
list_del(&p->list); list_del(&p->list);
mp->nack--; mp->nack--;
spin_unlock_bh(&mp->ackqlock); spin_unlock_bh(&mp->ackqlock);
...@@ -199,8 +199,8 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci) ...@@ -199,8 +199,8 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
unsigned int minor; unsigned int minor;
mp = kzalloc(sizeof(*mp), GFP_KERNEL); mp = kzalloc(sizeof(*mp), GFP_KERNEL);
if (!mp) { if (!mp) {
printk(KERN_ERR "capi: can't alloc capiminor\n"); printk(KERN_ERR "capi: can't alloc capiminor\n");
return NULL; return NULL;
} }
...@@ -391,7 +391,7 @@ gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb) ...@@ -391,7 +391,7 @@ gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
struct sk_buff *nskb; struct sk_buff *nskb;
nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_KERNEL); nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_KERNEL);
if (nskb) { if (nskb) {
u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2); u16 datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 4 + 2);
unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN); unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN);
capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN); capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN);
capimsg_setu16(s, 2, mp->ap->applid); capimsg_setu16(s, 2, mp->ap->applid);
...@@ -418,7 +418,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb) ...@@ -418,7 +418,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
pr_debug("capi: currently no receiver\n"); pr_debug("capi: currently no receiver\n");
return -1; return -1;
} }
ld = tty_ldisc_ref(tty); ld = tty_ldisc_ref(tty);
if (!ld) { if (!ld) {
/* fatal error, do not requeue */ /* fatal error, do not requeue */
...@@ -459,7 +459,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb) ...@@ -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); ld->ops->receive_buf(tty, skb->data, NULL, skb->len);
} else { } else {
printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n", printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n",
errcode); errcode);
kfree_skb(nskb); kfree_skb(nskb);
if (errcode == CAPI_SENDQUEUEFULL) if (errcode == CAPI_SENDQUEUEFULL)
...@@ -618,7 +618,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) ...@@ -618,7 +618,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
goto unlock_out; goto unlock_out;
} }
if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_IND) { if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_IND) {
datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+4+2); datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 4 + 2);
pr_debug("capi_signal: DATA_B3_IND %u len=%d\n", pr_debug("capi_signal: DATA_B3_IND %u len=%d\n",
datahandle, skb->len-CAPIMSG_LEN(skb->data)); datahandle, skb->len-CAPIMSG_LEN(skb->data));
skb_queue_tail(&mp->inqueue, skb); skb_queue_tail(&mp->inqueue, skb);
...@@ -627,10 +627,10 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) ...@@ -627,10 +627,10 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
} else if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_CONF) { } else if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_CONF) {
datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4); datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4);
pr_debug("capi_signal: DATA_B3_CONF %u 0x%x\n", pr_debug("capi_signal: DATA_B3_CONF %u 0x%x\n",
datahandle, datahandle,
CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+2)); CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 2));
kfree_skb(skb); kfree_skb(skb);
capiminor_del_ack(mp, datahandle); capiminor_del_ack(mp, datahandle);
tty = tty_port_tty_get(&mp->port); tty = tty_port_tty_get(&mp->port);
...@@ -669,7 +669,7 @@ capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ...@@ -669,7 +669,7 @@ capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
if (file->f_flags & O_NONBLOCK) if (file->f_flags & O_NONBLOCK)
return -EAGAIN; return -EAGAIN;
err = wait_event_interruptible(cdev->recvwait, err = wait_event_interruptible(cdev->recvwait,
(skb = skb_dequeue(&cdev->recvqueue))); (skb = skb_dequeue(&cdev->recvqueue)));
if (err) if (err)
return err; return err;
} }
...@@ -736,7 +736,7 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos ...@@ -736,7 +736,7 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
} }
static unsigned int static unsigned int
capi_poll(struct file *file, poll_table * wait) capi_poll(struct file *file, poll_table *wait)
{ {
struct capidev *cdev = file->private_data; struct capidev *cdev = file->private_data;
unsigned int mask = 0; unsigned int mask = 0;
...@@ -786,75 +786,75 @@ capi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -786,75 +786,75 @@ capi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return retval; return retval;
case CAPI_GET_VERSION: case CAPI_GET_VERSION:
{ {
if (copy_from_user(&data.contr, argp, if (copy_from_user(&data.contr, argp,
sizeof(data.contr))) sizeof(data.contr)))
return -EFAULT; return -EFAULT;
cdev->errcode = capi20_get_version(data.contr, &data.version); cdev->errcode = capi20_get_version(data.contr, &data.version);
if (cdev->errcode) if (cdev->errcode)
return -EIO; return -EIO;
if (copy_to_user(argp, &data.version, if (copy_to_user(argp, &data.version,
sizeof(data.version))) sizeof(data.version)))
return -EFAULT; return -EFAULT;
} }
return 0; return 0;
case CAPI_GET_SERIAL: case CAPI_GET_SERIAL:
{ {
if (copy_from_user(&data.contr, argp, if (copy_from_user(&data.contr, argp,
sizeof(data.contr))) sizeof(data.contr)))
return -EFAULT; return -EFAULT;
cdev->errcode = capi20_get_serial (data.contr, data.serial); cdev->errcode = capi20_get_serial(data.contr, data.serial);
if (cdev->errcode) if (cdev->errcode)
return -EIO; return -EIO;
if (copy_to_user(argp, data.serial, if (copy_to_user(argp, data.serial,
sizeof(data.serial))) sizeof(data.serial)))
return -EFAULT; return -EFAULT;
} }
return 0; return 0;
case CAPI_GET_PROFILE: case CAPI_GET_PROFILE:
{ {
if (copy_from_user(&data.contr, argp, if (copy_from_user(&data.contr, argp,
sizeof(data.contr))) sizeof(data.contr)))
return -EFAULT; return -EFAULT;
if (data.contr == 0) { if (data.contr == 0) {
cdev->errcode = capi20_get_profile(data.contr, &data.profile); cdev->errcode = capi20_get_profile(data.contr, &data.profile);
if (cdev->errcode) if (cdev->errcode)
return -EIO; return -EIO;
retval = copy_to_user(argp, retval = copy_to_user(argp,
&data.profile.ncontroller, &data.profile.ncontroller,
sizeof(data.profile.ncontroller)); sizeof(data.profile.ncontroller));
} else { } else {
cdev->errcode = capi20_get_profile(data.contr, &data.profile); cdev->errcode = capi20_get_profile(data.contr, &data.profile);
if (cdev->errcode) if (cdev->errcode)
return -EIO; return -EIO;
retval = copy_to_user(argp, &data.profile, retval = copy_to_user(argp, &data.profile,
sizeof(data.profile)); sizeof(data.profile));
}
if (retval)
return -EFAULT;
} }
return 0; if (retval)
return -EFAULT;
}
return 0;
case CAPI_GET_MANUFACTURER: case CAPI_GET_MANUFACTURER:
{ {
if (copy_from_user(&data.contr, argp, if (copy_from_user(&data.contr, argp,
sizeof(data.contr))) sizeof(data.contr)))
return -EFAULT; return -EFAULT;
cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer); cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer);
if (cdev->errcode) if (cdev->errcode)
return -EIO; return -EIO;
if (copy_to_user(argp, data.manufacturer, if (copy_to_user(argp, data.manufacturer,
sizeof(data.manufacturer))) sizeof(data.manufacturer)))
return -EFAULT; return -EFAULT;
} }
return 0; return 0;
case CAPI_GET_ERRCODE: case CAPI_GET_ERRCODE:
data.errcode = cdev->errcode; data.errcode = cdev->errcode;
cdev->errcode = CAPI_NOERROR; cdev->errcode = CAPI_NOERROR;
...@@ -871,15 +871,15 @@ capi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -871,15 +871,15 @@ capi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return -ENXIO; return -ENXIO;
case CAPI_MANUFACTURER_CMD: case CAPI_MANUFACTURER_CMD:
{ {
struct capi_manufacturer_cmd mcmd; struct capi_manufacturer_cmd mcmd;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (copy_from_user(&mcmd, argp, sizeof(mcmd))) if (copy_from_user(&mcmd, argp, sizeof(mcmd)))
return -EFAULT; return -EFAULT;
return capi20_manufacturer(mcmd.cmd, mcmd.data); return capi20_manufacturer(mcmd.cmd, mcmd.data);
} }
return 0; return 0;
case CAPI_SET_FLAGS: case CAPI_SET_FLAGS:
case CAPI_CLR_FLAGS: { case CAPI_CLR_FLAGS: {
...@@ -1070,7 +1070,7 @@ static int capinc_tty_write(struct tty_struct *tty, ...@@ -1070,7 +1070,7 @@ static int capinc_tty_write(struct tty_struct *tty,
mp->outbytes += skb->len; mp->outbytes += skb->len;
} }
skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+count, GFP_ATOMIC); skb = alloc_skb(CAPI_DATA_B3_REQ_LEN + count, GFP_ATOMIC);
if (!skb) { if (!skb) {
printk(KERN_ERR "capinc_tty_write: alloc_skb failed\n"); printk(KERN_ERR "capinc_tty_write: alloc_skb failed\n");
spin_unlock_bh(&mp->outlock); spin_unlock_bh(&mp->outlock);
...@@ -1111,7 +1111,7 @@ static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch) ...@@ -1111,7 +1111,7 @@ static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
invoke_send = true; invoke_send = true;
} }
skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+CAPI_MAX_BLKSIZE, GFP_ATOMIC); skb = alloc_skb(CAPI_DATA_B3_REQ_LEN + CAPI_MAX_BLKSIZE, GFP_ATOMIC);
if (skb) { if (skb) {
skb_reserve(skb, CAPI_DATA_B3_REQ_LEN); skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
*(skb_put(skb, 1)) = ch; *(skb_put(skb, 1)) = ch;
...@@ -1175,12 +1175,12 @@ static int capinc_tty_chars_in_buffer(struct tty_struct *tty) ...@@ -1175,12 +1175,12 @@ static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
} }
static int capinc_tty_ioctl(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; return -ENOIOCTLCMD;
} }
static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios * old) static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
{ {
pr_debug("capinc_tty_set_termios\n"); pr_debug("capinc_tty_set_termios\n");
} }
...@@ -1344,18 +1344,18 @@ static inline void capinc_tty_exit(void) { } ...@@ -1344,18 +1344,18 @@ static inline void capinc_tty_exit(void) { }
*/ */
static int capi20_proc_show(struct seq_file *m, void *v) static int capi20_proc_show(struct seq_file *m, void *v)
{ {
struct capidev *cdev; struct capidev *cdev;
struct list_head *l; struct list_head *l;
mutex_lock(&capidev_list_lock); mutex_lock(&capidev_list_lock);
list_for_each(l, &capidev_list) { list_for_each(l, &capidev_list) {
cdev = list_entry(l, struct capidev, list); cdev = list_entry(l, struct capidev, list);
seq_printf(m, "0 %d %lu %lu %lu %lu\n", seq_printf(m, "0 %d %lu %lu %lu %lu\n",
cdev->ap.applid, cdev->ap.applid,
cdev->ap.nrecvctlpkt, cdev->ap.nrecvctlpkt,
cdev->ap.nrecvdatapkt, cdev->ap.nrecvdatapkt,
cdev->ap.nsentctlpkt, cdev->ap.nsentctlpkt,
cdev->ap.nsentdatapkt); cdev->ap.nsentdatapkt);
} }
mutex_unlock(&capidev_list_lock); mutex_unlock(&capidev_list_lock);
return 0; return 0;
...@@ -1450,9 +1450,9 @@ static int __init capi_init(void) ...@@ -1450,9 +1450,9 @@ static int __init capi_init(void)
proc_init(); proc_init();
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
compileinfo = " (middleware)"; compileinfo = " (middleware)";
#else #else
compileinfo = " (no middleware)"; compileinfo = " (no middleware)";
#endif #endif
printk(KERN_NOTICE "CAPI 2.0 started up with major %d%s\n", printk(KERN_NOTICE "CAPI 2.0 started up with major %d%s\n",
capi_major, compileinfo); capi_major, compileinfo);
......
This diff is collapsed.
This diff is collapsed.
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/isdn/capilli.h> #include <linux/isdn/capilli.h>
#define DBG(format, arg...) do { \ #define DBG(format, arg...) do { \
printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \ printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
} while (0) } while (0)
struct capilib_msgidqueue { struct capilib_msgidqueue {
struct capilib_msgidqueue *next; struct capilib_msgidqueue *next;
...@@ -28,7 +28,7 @@ struct capilib_ncci { ...@@ -28,7 +28,7 @@ struct capilib_ncci {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// NCCI Handling // NCCI Handling
static inline void mq_init(struct capilib_ncci * np) static inline void mq_init(struct capilib_ncci *np)
{ {
u_int i; u_int i;
np->msgidqueue = NULL; np->msgidqueue = NULL;
...@@ -42,7 +42,7 @@ static inline void mq_init(struct capilib_ncci * np) ...@@ -42,7 +42,7 @@ static inline void mq_init(struct capilib_ncci * np)
} }
} }
static inline int mq_enqueue(struct capilib_ncci * np, u16 msgid) static inline int mq_enqueue(struct capilib_ncci *np, u16 msgid)
{ {
struct capilib_msgidqueue *mq; struct capilib_msgidqueue *mq;
if ((mq = np->msgidfree) == NULL) if ((mq = np->msgidfree) == NULL)
...@@ -59,7 +59,7 @@ static inline int mq_enqueue(struct capilib_ncci * np, u16 msgid) ...@@ -59,7 +59,7 @@ static inline int mq_enqueue(struct capilib_ncci * np, u16 msgid)
return 1; return 1;
} }
static inline int mq_dequeue(struct capilib_ncci * np, u16 msgid) static inline int mq_dequeue(struct capilib_ncci *np, u16 msgid)
{ {
struct capilib_msgidqueue **pp; struct capilib_msgidqueue **pp;
for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) { for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) {
...@@ -165,7 +165,7 @@ u16 capilib_data_b3_req(struct list_head *head, u16 applid, u32 ncci, u16 msgid) ...@@ -165,7 +165,7 @@ u16 capilib_data_b3_req(struct list_head *head, u16 applid, u32 ncci, u16 msgid)
continue; continue;
if (np->ncci != ncci) if (np->ncci != ncci)
continue; continue;
if (mq_enqueue(np, msgid) == 0) if (mq_enqueue(np, msgid) == 0)
return CAPI_SENDQUEUEFULL; return CAPI_SENDQUEUEFULL;
...@@ -188,7 +188,7 @@ void capilib_data_b3_conf(struct list_head *head, u16 applid, u32 ncci, u16 msgi ...@@ -188,7 +188,7 @@ void capilib_data_b3_conf(struct list_head *head, u16 applid, u32 ncci, u16 msgi
continue; continue;
if (np->ncci != ncci) if (np->ncci != ncci)
continue; continue;
if (mq_dequeue(np, msgid) == 0) { if (mq_dequeue(np, msgid) == 0) {
printk(KERN_ERR "kcapi: msgid %hu ncci 0x%x not on queue\n", printk(KERN_ERR "kcapi: msgid %hu ncci 0x%x not on queue\n",
msgid, ncci); msgid, ncci);
......
This diff is collapsed.
This diff is collapsed.
/* /*
* Kernel CAPI 2.0 Module * Kernel CAPI 2.0 Module
* *
* Copyright 1999 by Carsten Paeth <calle@calle.de> * Copyright 1999 by Carsten Paeth <calle@calle.de>
* Copyright 2002 by Kai Germaschewski <kai@germaschewski.name> * Copyright 2002 by Kai Germaschewski <kai@germaschewski.name>
* *
* This software may be used and distributed according to the terms * This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference. * of the GNU General Public License, incorporated herein by reference.
* *
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#include <linux/isdn/capilli.h> #include <linux/isdn/capilli.h>
#ifdef KCAPI_DEBUG #ifdef KCAPI_DEBUG
#define DBG(format, arg...) do { \ #define DBG(format, arg...) do { \
printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \ printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
} while (0) } while (0)
#else #else
#define DBG(format, arg...) /* */ #define DBG(format, arg...) /* */
#endif #endif
...@@ -49,4 +49,3 @@ static inline void kcapi_proc_init(void) { }; ...@@ -49,4 +49,3 @@ static inline void kcapi_proc_init(void) { };
static inline void kcapi_proc_exit(void) { }; static inline void kcapi_proc_exit(void) { };
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment