#include <linux/kernelcapi.h>
#include <linux/ctype.h>
#include <linux/init.h>
+#include <linux/moduleparam.h>
#include <linux/isdn/capiutil.h>
#include <linux/isdn/capicmd.h>
MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux");
MODULE_AUTHOR("Carsten Paeth");
MODULE_LICENSE("GPL");
-MODULE_PARM(debugmode, "i");
+module_param(debugmode, uint, 0);
/* -------- type definitions ----------------------------------------- */
/* -------- data definitions ----------------------------------------- */
static capidrv_data global;
-static spinlock_t global_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(global_lock);
static void handle_dtrace_data(capidrv_contr *card,
int send, int level2, u8 *data, u16 len);
}
for (p=buf, count=0; count < len; p++, count++) {
- put_user(*card->q931_read++, p);
+ if (put_user(*card->q931_read++, p))
+ return -EFAULT;
if (card->q931_read > card->q931_end)
card->q931_read = card->q931_buf;
}
return -1;
}
card->myid = card->interface.channels;
+ memset(card->bchans, 0, sizeof(capidrv_bchan) * card->nbchan);
+ for (i = 0; i < card->nbchan; i++) {
+ card->bchans[i].contr = card;
+ }
spin_lock_irqsave(&global_lock, flags);
card->next = global.contr_list;
global.ncontr++;
spin_unlock_irqrestore(&global_lock, flags);
- memset(card->bchans, 0, sizeof(capidrv_bchan) * card->nbchan);
- for (i = 0; i < card->nbchan; i++) {
- card->bchans[i].contr = card;
- }
-
cmd.command = ISDN_STAT_RUN;
cmd.driver = card->myid;
card->interface.statcallb(&cmd);
card->cipmask = 0x1FFF03FF; /* any */
card->cipmask2 = 0;
- send_listen(card);
-
card->listentimer.data = (unsigned long)card;
card->listentimer.function = listentimerfunc;
+ send_listen(card);
mod_timer(&card->listentimer, jiffies + 60*HZ);
printk(KERN_INFO "%s: now up (%d B channels)\n",