summaryrefslogtreecommitdiff
path: root/drivers/isdn/pcbit/drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/pcbit/drv.c')
-rw-r--r--drivers/isdn/pcbit/drv.c248
1 files changed, 124 insertions, 124 deletions
diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c
index 1507d2e83fbb..1eaf62273903 100644
--- a/drivers/isdn/pcbit/drv.c
+++ b/drivers/isdn/pcbit/drv.c
@@ -2,10 +2,10 @@
* PCBIT-D interface with isdn4linux
*
* Copyright (C) 1996 Universidade de Lisboa
- *
+ *
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
- * This software may be used and distributed according to the terms of
+ * This software may be used and distributed according to the terms of
* the GNU General Public License, incorporated herein by reference.
*/
@@ -14,7 +14,7 @@
*
* Nuno Grilo <l38486@alfa.ist.utl.pt>
* fixed msn_list NULL pointer dereference.
- *
+ *
*/
#include <linux/module.h>
@@ -43,9 +43,9 @@
extern ushort last_ref_num;
-static int pcbit_ioctl(isdn_ctrl* ctl);
+static int pcbit_ioctl(isdn_ctrl *ctl);
-static char* pcbit_devname[MAX_PCBIT_CARDS] = {
+static char *pcbit_devname[MAX_PCBIT_CARDS] = {
"pcbit0",
"pcbit1",
"pcbit2",
@@ -56,12 +56,12 @@ static char* pcbit_devname[MAX_PCBIT_CARDS] = {
* prototypes
*/
-static int pcbit_command(isdn_ctrl* ctl);
-static int pcbit_stat(u_char __user * buf, int len, int, int);
+static int pcbit_command(isdn_ctrl *ctl);
+static int pcbit_stat(u_char __user *buf, int len, int, int);
static int pcbit_xmit(int driver, int chan, int ack, struct sk_buff *skb);
static int pcbit_writecmd(const u_char __user *, int, int, int);
-static int set_protocol_running(struct pcbit_dev * dev);
+static int set_protocol_running(struct pcbit_dev *dev);
static void pcbit_clear_msn(struct pcbit_dev *dev);
static void pcbit_set_msn(struct pcbit_dev *dev, char *list);
@@ -73,7 +73,7 @@ int pcbit_init_dev(int board, int mem_base, int irq)
struct pcbit_dev *dev;
isdn_if *dev_if;
- if ((dev=kzalloc(sizeof(struct pcbit_dev), GFP_KERNEL)) == NULL)
+ if ((dev = kzalloc(sizeof(struct pcbit_dev), GFP_KERNEL)) == NULL)
{
printk("pcbit_init: couldn't malloc pcbit_dev struct\n");
return -ENOMEM;
@@ -83,19 +83,19 @@ int pcbit_init_dev(int board, int mem_base, int irq)
init_waitqueue_head(&dev->set_running_wq);
spin_lock_init(&dev->lock);
- if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF ) {
+ if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF) {
dev->ph_mem = mem_base;
if (!request_mem_region(dev->ph_mem, 4096, "PCBIT mem")) {
printk(KERN_WARNING
- "PCBIT: memory region %lx-%lx already in use\n",
- dev->ph_mem, dev->ph_mem + 4096);
+ "PCBIT: memory region %lx-%lx already in use\n",
+ dev->ph_mem, dev->ph_mem + 4096);
kfree(dev);
dev_pcbit[board] = NULL;
return -EACCES;
}
dev->sh_mem = ioremap(dev->ph_mem, 4096);
}
- else
+ else
{
printk("memory address invalid");
kfree(dev);
@@ -111,7 +111,7 @@ int pcbit_init_dev(int board, int mem_base, int irq)
kfree(dev);
return -ENOMEM;
}
-
+
dev->b2 = kzalloc(sizeof(struct pcbit_chan), GFP_KERNEL);
if (!dev->b2) {
printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
@@ -130,7 +130,7 @@ int pcbit_init_dev(int board, int mem_base, int irq)
* interrupts
*/
- if (request_irq(irq, &pcbit_irq_handler, 0, pcbit_devname[board], dev) != 0)
+ if (request_irq(irq, &pcbit_irq_handler, 0, pcbit_devname[board], dev) != 0)
{
kfree(dev->b1);
kfree(dev->b2);
@@ -168,16 +168,16 @@ int pcbit_init_dev(int board, int mem_base, int irq)
dev_if->owner = THIS_MODULE;
dev_if->channels = 2;
-
- dev_if->features = (ISDN_FEATURE_P_EURO | ISDN_FEATURE_L3_TRANS |
- ISDN_FEATURE_L2_HDLC | ISDN_FEATURE_L2_TRANS );
+
+ dev_if->features = (ISDN_FEATURE_P_EURO | ISDN_FEATURE_L3_TRANS |
+ ISDN_FEATURE_L2_HDLC | ISDN_FEATURE_L2_TRANS);
dev_if->writebuf_skb = pcbit_xmit;
dev_if->hl_hdrlen = 16;
dev_if->maxbufsize = MAXBUFSIZE;
dev_if->command = pcbit_command;
-
+
dev_if->writecmd = pcbit_writecmd;
dev_if->readstat = pcbit_stat;
@@ -211,12 +211,12 @@ int pcbit_init_dev(int board, int mem_base, int irq)
#ifdef MODULE
void pcbit_terminate(int board)
{
- struct pcbit_dev * dev;
+ struct pcbit_dev *dev;
dev = dev_pcbit[board];
if (dev) {
- /* unregister_isdn(dev->dev_if); */
+ /* unregister_isdn(dev->dev_if); */
free_irq(dev->irq, dev);
pcbit_clear_msn(dev);
kfree(dev->dev_if);
@@ -233,9 +233,9 @@ void pcbit_terminate(int board)
}
#endif
-static int pcbit_command(isdn_ctrl* ctl)
+static int pcbit_command(isdn_ctrl *ctl)
{
- struct pcbit_dev *dev;
+ struct pcbit_dev *dev;
struct pcbit_chan *chan;
struct callb_data info;
@@ -250,7 +250,7 @@ static int pcbit_command(isdn_ctrl* ctl)
chan = (ctl->arg & 0x0F) ? dev->b2 : dev->b1;
- switch(ctl->command) {
+ switch (ctl->command) {
case ISDN_CMD_IOCTL:
return pcbit_ioctl(ctl);
break;
@@ -299,10 +299,10 @@ static int pcbit_command(isdn_ctrl* ctl)
static void pcbit_block_timer(unsigned long data)
{
struct pcbit_chan *chan;
- struct pcbit_dev * dev;
+ struct pcbit_dev *dev;
isdn_ctrl ictl;
- chan = (struct pcbit_chan *) data;
+ chan = (struct pcbit_chan *)data;
dev = chan2dev(chan);
@@ -316,12 +316,12 @@ static void pcbit_block_timer(unsigned long data)
#ifdef DEBUG
printk(KERN_DEBUG "pcbit_block_timer\n");
-#endif
+#endif
chan->queued = 0;
ictl.driver = dev->id;
ictl.command = ISDN_STAT_BSENT;
ictl.arg = chan->id;
- dev->dev_if->statcallb(&ictl);
+ dev->dev_if->statcallb(&ictl);
}
#endif
@@ -329,7 +329,7 @@ static int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb)
{
ushort hdrlen;
int refnum, len;
- struct pcbit_chan * chan;
+ struct pcbit_chan *chan;
struct pcbit_dev *dev;
dev = finddev(driver);
@@ -345,10 +345,10 @@ static int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb)
if (chan->fsm_state != ST_ACTIVE)
return -1;
- if (chan->queued >= MAX_QUEUED )
+ if (chan->queued >= MAX_QUEUED)
{
#ifdef DEBUG_QUEUE
- printk(KERN_DEBUG
+ printk(KERN_DEBUG
"pcbit: %d packets already in queue - write fails\n",
chan->queued);
#endif
@@ -365,14 +365,14 @@ static int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb)
chan->block_timer.expires = jiffies + 1 * HZ;
add_timer(&chan->block_timer);
}
-#endif
- return 0;
+#endif
+ return 0;
}
chan->queued++;
-
- len = skb->len;
+
+ len = skb->len;
hdrlen = capi_tdata_req(chan, skb);
@@ -386,10 +386,10 @@ static int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb)
static int pcbit_writecmd(const u_char __user *buf, int len, int driver, int channel)
{
- struct pcbit_dev * dev;
+ struct pcbit_dev *dev;
int i, j;
- const u_char * loadbuf;
- u_char * ptr = NULL;
+ const u_char *loadbuf;
+ u_char *ptr = NULL;
u_char *cbuf;
int errstat;
@@ -402,7 +402,7 @@ static int pcbit_writecmd(const u_char __user *buf, int len, int driver, int cha
return -ENODEV;
}
- switch(dev->l2_state) {
+ switch (dev->l2_state) {
case L2_LWMODE:
/* check (size <= rdp_size); write buf into board */
if (len < 0 || len > BANK4 + 1 || len > 1024)
@@ -422,19 +422,19 @@ static int pcbit_writecmd(const u_char __user *buf, int len, int driver, int cha
/* this is the hard part */
/* dumb board */
/* get it into kernel space */
- if ((ptr = kmalloc(len, GFP_KERNEL))==NULL)
+ if ((ptr = kmalloc(len, GFP_KERNEL)) == NULL)
return -ENOMEM;
if (copy_from_user(ptr, buf, len)) {
kfree(ptr);
return -EFAULT;
}
loadbuf = ptr;
-
+
errstat = 0;
- for (i=0; i < len; i++)
+ for (i = 0; i < len; i++)
{
- for(j=0; j < LOAD_RETRY; j++)
+ for (j = 0; j < LOAD_RETRY; j++)
if (!(readb(dev->sh_mem + dev->loadptr)))
break;
@@ -464,9 +464,9 @@ static int pcbit_writecmd(const u_char __user *buf, int len, int driver, int cha
*
*/
-void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
- struct sk_buff * skb,
- ushort hdr_len, ushort refnum)
+void pcbit_l3_receive(struct pcbit_dev *dev, ulong msg,
+ struct sk_buff *skb,
+ ushort hdr_len, ushort refnum)
{
struct pcbit_chan *chan;
struct sk_buff *skb2;
@@ -475,11 +475,11 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
int complete, err;
isdn_ctrl ictl;
- switch(msg) {
+ switch (msg) {
case MSG_TDATA_IND:
if (!(chan = capi_channel(dev, skb))) {
- printk(KERN_WARNING
+ printk(KERN_WARNING
"CAPI header: unknown channel id\n");
break;
}
@@ -488,30 +488,30 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
dev->dev_if->rcvcallb_skb(dev->id, chan->id, skb);
- if (capi_tdata_resp(chan, &skb2) > 0)
- pcbit_l2_write(dev, MSG_TDATA_RESP, refnum,
+ if (capi_tdata_resp(chan, &skb2) > 0)
+ pcbit_l2_write(dev, MSG_TDATA_RESP, refnum,
skb2, skb2->len);
return;
- break;
+ break;
case MSG_TDATA_CONF:
if (!(chan = capi_channel(dev, skb))) {
- printk(KERN_WARNING
+ printk(KERN_WARNING
"CAPI header: unknown channel id\n");
break;
}
#ifdef DEBUG
- if ( (*((ushort *) (skb->data + 2) )) != 0) {
- printk(KERN_DEBUG "TDATA_CONF error\n");
+ if ((*((ushort *)(skb->data + 2))) != 0) {
+ printk(KERN_DEBUG "TDATA_CONF error\n");
}
#endif
#ifdef BLOCK_TIMER
- if (chan->queued == MAX_QUEUED) {
- del_timer(&chan->block_timer);
+ if (chan->queued == MAX_QUEUED) {
+ del_timer(&chan->block_timer);
chan->block_timer.function = NULL;
}
-
-#endif
+
+#endif
chan->queued--;
ictl.driver = dev->id;
@@ -523,7 +523,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
case MSG_CONN_IND:
/*
* channel: 1st not used will do
- * if both are used we're in trouble
+ * if both are used we're in trouble
*/
if (!dev->b1->fsm_state)
@@ -531,12 +531,12 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
else if (!dev->b2->fsm_state)
chan = dev->b2;
else {
- printk(KERN_INFO
+ printk(KERN_INFO
"Incoming connection: no channels available");
- if ((len = capi_disc_req(*(ushort*)(skb->data), &skb2, CAUSE_NOCHAN)) > 0)
+ if ((len = capi_disc_req(*(ushort *)(skb->data), &skb2, CAUSE_NOCHAN)) > 0)
pcbit_l2_write(dev, MSG_DISC_REQ, refnum, skb2, len);
- break;
+ break;
}
cbdata.data.setup.CalledPN = NULL;
@@ -547,7 +547,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
pcbit_fsm_event(dev, chan, EV_NET_SETUP, NULL);
- if (pcbit_check_msn(dev, cbdata.data.setup.CallingPN))
+ if (pcbit_check_msn(dev, cbdata.data.setup.CallingPN))
pcbit_fsm_event(dev, chan, EV_USR_PROCED_REQ, &cbdata);
else
pcbit_fsm_event(dev, chan, EV_USR_RELEASE_REQ, NULL);
@@ -555,26 +555,26 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
kfree(cbdata.data.setup.CalledPN);
kfree(cbdata.data.setup.CallingPN);
break;
-
+
case MSG_CONN_CONF:
- /*
+ /*
* We should be able to find the channel by the message
* reference number. The current version of the firmware
* doesn't sent the ref number correctly.
*/
#ifdef DEBUG
- printk(KERN_DEBUG "refnum=%04x b1=%04x b2=%04x\n", refnum,
- dev->b1->s_refnum,
+ printk(KERN_DEBUG "refnum=%04x b1=%04x b2=%04x\n", refnum,
+ dev->b1->s_refnum,
dev->b2->s_refnum);
#endif
/* We just try to find a channel in the right state */
if (dev->b1->fsm_state == ST_CALL_INIT)
chan = dev->b1;
- else {
+ else {
if (dev->b2->s_refnum == ST_CALL_INIT)
chan = dev->b2;
- else {
+ else {
chan = NULL;
printk(KERN_WARNING "Connection Confirm - no channel in Call Init state\n");
break;
@@ -589,18 +589,18 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
pcbit_fsm_event(dev, chan, EV_NET_CALL_PROC, NULL);
else
pcbit_fsm_event(dev, chan, EV_NET_SETUP_ACK, NULL);
- break;
+ break;
case MSG_CONN_ACTV_IND:
if (!(chan = capi_channel(dev, skb))) {
- printk(KERN_WARNING
+ printk(KERN_WARNING
"CAPI header: unknown channel id\n");
break;
}
-
+
if (capi_decode_conn_actv_ind(chan, skb)) {
printk("error in capi_decode_conn_actv_ind\n");
- /* pcbit_fsm_event(dev, chan, EV_ERROR, NULL); */
+ /* pcbit_fsm_event(dev, chan, EV_ERROR, NULL); */
break;
}
chan->r_refnum = refnum;
@@ -609,14 +609,14 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
case MSG_CONN_ACTV_CONF:
if (!(chan = capi_channel(dev, skb))) {
- printk(KERN_WARNING
+ printk(KERN_WARNING
"CAPI header: unknown channel id\n");
break;
}
if (capi_decode_conn_actv_conf(chan, skb) == 0)
pcbit_fsm_event(dev, chan, EV_NET_CONN_ACK, NULL);
-
+
else
printk(KERN_DEBUG "decode_conn_actv_conf failed\n");
break;
@@ -624,7 +624,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
case MSG_SELP_CONF:
if (!(chan = capi_channel(dev, skb))) {
- printk(KERN_WARNING
+ printk(KERN_WARNING
"CAPI header: unknown channel id\n");
break;
}
@@ -638,7 +638,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
break;
case MSG_ACT_TRANSP_CONF:
if (!(chan = capi_channel(dev, skb))) {
- printk(KERN_WARNING
+ printk(KERN_WARNING
"CAPI header: unknown channel id\n");
break;
}
@@ -650,7 +650,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
case MSG_DISC_IND:
if (!(chan = capi_channel(dev, skb))) {
- printk(KERN_WARNING
+ printk(KERN_WARNING
"CAPI header: unknown channel id\n");
break;
}
@@ -662,7 +662,7 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
break;
case MSG_DISC_CONF:
if (!(chan = capi_channel(dev, skb))) {
- printk(KERN_WARNING
+ printk(KERN_WARNING
"CAPI header: unknown channel id\n");
break;
}
@@ -711,24 +711,24 @@ static int pcbit_stat(u_char __user *buf, int len, int driver, int channel)
stat_count = STATBUF_LEN - stat_st + stat_end;
/* FIXME: should we sleep and wait for more cookies ? */
- if (len > stat_count)
+ if (len > stat_count)
len = stat_count;
if (stat_st < stat_end)
{
if (copy_to_user(buf, statbuf + stat_st, len))
return -EFAULT;
- stat_st += len;
+ stat_st += len;
}
else
{
if (len > STATBUF_LEN - stat_st)
{
if (copy_to_user(buf, statbuf + stat_st,
- STATBUF_LEN - stat_st))
+ STATBUF_LEN - stat_st))
return -EFAULT;
if (copy_to_user(buf, statbuf,
- len - (STATBUF_LEN - stat_st)))
+ len - (STATBUF_LEN - stat_st)))
return -EFAULT;
stat_st = len - (STATBUF_LEN - stat_st);
@@ -739,7 +739,7 @@ static int pcbit_stat(u_char __user *buf, int len, int driver, int channel)
return -EFAULT;
stat_st += len;
-
+
if (stat_st == STATBUF_LEN)
stat_st = 0;
}
@@ -756,27 +756,27 @@ static void pcbit_logstat(struct pcbit_dev *dev, char *str)
int i;
isdn_ctrl ictl;
- for (i=stat_end; i<strlen(str); i++)
+ for (i = stat_end; i < strlen(str); i++)
{
- statbuf[i]=str[i];
+ statbuf[i] = str[i];
stat_end = (stat_end + 1) % STATBUF_LEN;
if (stat_end == stat_st)
stat_st = (stat_st + 1) % STATBUF_LEN;
}
- ictl.command=ISDN_STAT_STAVAIL;
- ictl.driver=dev->id;
- ictl.arg=strlen(str);
+ ictl.command = ISDN_STAT_STAVAIL;
+ ictl.driver = dev->id;
+ ictl.arg = strlen(str);
dev->dev_if->statcallb(&ictl);
}
-
-void pcbit_state_change(struct pcbit_dev * dev, struct pcbit_chan * chan,
+
+void pcbit_state_change(struct pcbit_dev *dev, struct pcbit_chan *chan,
unsigned short i, unsigned short ev, unsigned short f)
{
char buf[256];
-
+
sprintf(buf, "change on device: %d channel:%d\n%s -> %s -> %s\n",
- dev->id, chan->id,
+ dev->id, chan->id,
isdn_state_table[i], strisdnevent(ev), isdn_state_table[f]
);
@@ -789,7 +789,7 @@ void pcbit_state_change(struct pcbit_dev * dev, struct pcbit_chan * chan,
static void set_running_timeout(unsigned long ptr)
{
- struct pcbit_dev * dev;
+ struct pcbit_dev *dev;
#ifdef DEBUG
printk(KERN_DEBUG "set_running_timeout\n");
@@ -799,7 +799,7 @@ static void set_running_timeout(unsigned long ptr)
wake_up_interruptible(&dev->set_running_wq);
}
-static int set_protocol_running(struct pcbit_dev * dev)
+static int set_protocol_running(struct pcbit_dev *dev)
{
isdn_ctrl ctl;
@@ -813,7 +813,7 @@ static int set_protocol_running(struct pcbit_dev * dev)
dev->l2_state = L2_STARTING;
- writeb((0x80U | ((dev->rcv_seq & 0x07) << 3) | (dev->send_seq & 0x07)),
+ writeb((0x80U | ((dev->rcv_seq & 0x07) << 3) | (dev->send_seq & 0x07)),
dev->sh_mem + BANK4);
add_timer(&dev->set_running_timer);
@@ -830,8 +830,8 @@ static int set_protocol_running(struct pcbit_dev * dev)
dev->writeptr = dev->sh_mem;
dev->readptr = dev->sh_mem + BANK2;
-
- /* tell the good news to the upper layer */
+
+ /* tell the good news to the upper layer */
ctl.driver = dev->id;
ctl.command = ISDN_STAT_RUN;
@@ -845,7 +845,7 @@ static int set_protocol_running(struct pcbit_dev * dev)
dev->l2_state = L2_DOWN;
#ifdef DEBUG
- printk(KERN_DEBUG "Bank3 = %02x\n",
+ printk(KERN_DEBUG "Bank3 = %02x\n",
readb(dev->sh_mem + BANK3));
#endif
writeb(0x40, dev->sh_mem + BANK4);
@@ -862,13 +862,13 @@ static int set_protocol_running(struct pcbit_dev * dev)
return 0;
}
-static int pcbit_ioctl(isdn_ctrl* ctl)
+static int pcbit_ioctl(isdn_ctrl *ctl)
{
- struct pcbit_dev * dev;
+ struct pcbit_dev *dev;
struct pcbit_ioctl *cmd;
dev = finddev(ctl->driver);
-
+
if (!dev)
{
printk(KERN_DEBUG "pcbit_ioctl: unknown device\n");
@@ -877,7 +877,7 @@ static int pcbit_ioctl(isdn_ctrl* ctl)
cmd = (struct pcbit_ioctl *) ctl->parm.num;
- switch(ctl->arg) {
+ switch (ctl->arg) {
case PCBIT_IOCTL_GETSTAT:
cmd->info.l2_status = dev->l2_state;
break;
@@ -890,7 +890,7 @@ static int pcbit_ioctl(isdn_ctrl* ctl)
dev->writeptr = dev->sh_mem;
dev->readptr = dev->sh_mem + BANK2;
-
+
dev->l2_state = L2_LOADING;
break;
@@ -907,21 +907,21 @@ static int pcbit_ioctl(isdn_ctrl* ctl)
dev->loadptr = LOAD_ZONE_START;
dev->l2_state = L2_FWMODE;
- break;
+ break;
case PCBIT_IOCTL_ENDLOAD:
if (dev->l2_state == L2_RUNNING)
return -EBUSY;
dev->l2_state = L2_DOWN;
- break;
+ break;
- case PCBIT_IOCTL_SETBYTE:
+ case PCBIT_IOCTL_SETBYTE:
if (dev->l2_state == L2_RUNNING)
return -EBUSY;
/* check addr */
if (cmd->info.rdp_byte.addr > BANK4)
return -EFAULT;
-
+
writeb(cmd->info.rdp_byte.value, dev->sh_mem + cmd->info.rdp_byte.addr);
break;
case PCBIT_IOCTL_GETBYTE:
@@ -935,10 +935,10 @@ static int pcbit_ioctl(isdn_ctrl* ctl)
printk("getbyte: invalid addr %04x\n", cmd->info.rdp_byte.addr);
return -EFAULT;
}
-
- cmd->info.rdp_byte.value = readb(dev->sh_mem + cmd->info.rdp_byte.addr);
+
+ cmd->info.rdp_byte.value = readb(dev->sh_mem + cmd->info.rdp_byte.addr);
break;
- case PCBIT_IOCTL_RUNNING:
+ case PCBIT_IOCTL_RUNNING:
if (dev->l2_state == L2_RUNNING)
return -EBUSY;
return set_protocol_running(dev);
@@ -972,25 +972,25 @@ static int pcbit_ioctl(isdn_ctrl* ctl)
return 0;
}
-/*
+/*
* MSN list handling
*
* if null reject all calls
- * if first entry has null MSN accept all calls
+ * if first entry has null MSN accept all calls
*/
static void pcbit_clear_msn(struct pcbit_dev *dev)
{
struct msn_entry *ptr, *back;
- for (ptr=dev->msn_list; ptr; )
+ for (ptr = dev->msn_list; ptr;)
{
back = ptr->next;
kfree(ptr);
ptr = back;
}
- dev->msn_list = NULL;
+ dev->msn_list = NULL;
}
static void pcbit_set_msn(struct pcbit_dev *dev, char *list)
@@ -1016,12 +1016,12 @@ static void pcbit_set_msn(struct pcbit_dev *dev, char *list)
}
if (dev->msn_list)
- for (back=dev->msn_list; back->next; back=back->next);
-
+ for (back = dev->msn_list; back->next; back = back->next);
+
sp = list;
do {
- cp=strchr(sp, ',');
+ cp = strchr(sp, ',');
if (cp)
len = cp - sp;
else
@@ -1034,7 +1034,7 @@ static void pcbit_set_msn(struct pcbit_dev *dev, char *list)
return;
}
ptr->next = NULL;
-
+
ptr->msn = kmalloc(len, GFP_ATOMIC);
if (!ptr->msn) {
printk(KERN_WARNING "kmalloc failed\n");
@@ -1054,7 +1054,7 @@ static void pcbit_set_msn(struct pcbit_dev *dev, char *list)
back->next = ptr;
back = ptr;
sp += len;
- } while(cp);
+ } while (cp);
}
/*
@@ -1063,12 +1063,12 @@ static void pcbit_set_msn(struct pcbit_dev *dev, char *list)
static int pcbit_check_msn(struct pcbit_dev *dev, char *msn)
{
struct msn_entry *ptr;
-
- for (ptr=dev->msn_list; ptr; ptr=ptr->next) {
- if (ptr->msn == NULL)
+ for (ptr = dev->msn_list; ptr; ptr = ptr->next) {
+
+ if (ptr->msn == NULL)
return 1;
-
+
if (strcmp(ptr->msn, msn) == 0)
return 1;
}