Commit b77e092a authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: CAPI: Remove capi_interface_user etc.

It's not used anymore, registering/unregistering just happens
on a per-application basis.
parent 56424fa8
...@@ -1594,10 +1594,6 @@ static int __init alloc_init(void) ...@@ -1594,10 +1594,6 @@ static int __init alloc_init(void)
return 0; return 0;
} }
static struct capi_interface_user cuser = {
name: "capi20",
};
static char rev[32]; static char rev[32];
static int __init capi_init(void) static int __init capi_init(void)
...@@ -1626,11 +1622,8 @@ static int __init capi_init(void) ...@@ -1626,11 +1622,8 @@ static int __init capi_init(void)
&capi_fops, NULL); &capi_fops, NULL);
printk(KERN_NOTICE "capi20: started up with major %d\n", capi_major); printk(KERN_NOTICE "capi20: started up with major %d\n", capi_major);
attach_capi_interface(&cuser);
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
if (capinc_tty_init() < 0) { if (capinc_tty_init() < 0) {
(void) detach_capi_interface(&cuser);
devfs_unregister_chrdev(capi_major, "capi20"); devfs_unregister_chrdev(capi_major, "capi20");
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
return -ENOMEM; return -ENOMEM;
...@@ -1641,7 +1634,6 @@ static int __init capi_init(void) ...@@ -1641,7 +1634,6 @@ static int __init capi_init(void)
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
capinc_tty_exit(); capinc_tty_exit();
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
(void) detach_capi_interface(&cuser);
devfs_unregister_chrdev(capi_major, "capi20"); devfs_unregister_chrdev(capi_major, "capi20");
devfs_unregister(devfs_find_handle(NULL, "capi20", devfs_unregister(devfs_find_handle(NULL, "capi20",
capi_major, 0, capi_major, 0,
...@@ -1679,7 +1671,6 @@ static void __exit capi_exit(void) ...@@ -1679,7 +1671,6 @@ static void __exit capi_exit(void)
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
capinc_tty_exit(); capinc_tty_exit();
#endif #endif
(void) detach_capi_interface(&cuser);
printk(KERN_NOTICE "capi: Rev %s: unloaded\n", rev); printk(KERN_NOTICE "capi: Rev %s: unloaded\n", rev);
} }
......
...@@ -2291,10 +2291,6 @@ static void __exit proc_exit(void) ...@@ -2291,10 +2291,6 @@ static void __exit proc_exit(void)
} }
} }
static struct capi_interface_user cuser = {
name: "capidrv",
};
static int __init capidrv_init(void) static int __init capidrv_init(void)
{ {
struct capi_register_params rparam; struct capi_register_params rparam;
...@@ -2306,8 +2302,6 @@ static int __init capidrv_init(void) ...@@ -2306,8 +2302,6 @@ static int __init capidrv_init(void)
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
attach_capi_interface(&cuser);
if ((p = strchr(revision, ':')) != 0 && p[1]) { if ((p = strchr(revision, ':')) != 0 && p[1]) {
strncpy(rev, p + 2, sizeof(rev)); strncpy(rev, p + 2, sizeof(rev));
rev[sizeof(rev)-1] = 0; rev[sizeof(rev)-1] = 0;
...@@ -2321,7 +2315,6 @@ static int __init capidrv_init(void) ...@@ -2321,7 +2315,6 @@ static int __init capidrv_init(void)
rparam.datablklen = 2048; rparam.datablklen = 2048;
errcode = capi20_register(&rparam, &global.appid); errcode = capi20_register(&rparam, &global.appid);
if (errcode) { if (errcode) {
detach_capi_interface(&cuser);
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
return -EIO; return -EIO;
} }
...@@ -2331,7 +2324,6 @@ static int __init capidrv_init(void) ...@@ -2331,7 +2324,6 @@ static int __init capidrv_init(void)
errcode = capi20_get_profile(0, &profile); errcode = capi20_get_profile(0, &profile);
if (errcode != CAPI_NOERROR) { if (errcode != CAPI_NOERROR) {
capi20_release(global.appid); capi20_release(global.appid);
detach_capi_interface(&cuser);
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
return -EIO; return -EIO;
} }
...@@ -2368,8 +2360,6 @@ static void __exit capidrv_exit(void) ...@@ -2368,8 +2360,6 @@ static void __exit capidrv_exit(void)
capi20_release(global.appid); capi20_release(global.appid);
detach_capi_interface(&cuser);
proc_exit(); proc_exit();
printk(KERN_NOTICE "capidrv: Rev%s: unloaded\n", rev); printk(KERN_NOTICE "capidrv: Rev%s: unloaded\n", rev);
......
...@@ -96,9 +96,6 @@ static struct capi_ctr *cards[CAPI_MAXCONTR]; ...@@ -96,9 +96,6 @@ static struct capi_ctr *cards[CAPI_MAXCONTR];
static int ncards; static int ncards;
static struct sk_buff_head recv_queue; static struct sk_buff_head recv_queue;
static LIST_HEAD(users);
static spinlock_t users_lock = SPIN_LOCK_UNLOCKED;
static LIST_HEAD(drivers); static LIST_HEAD(drivers);
static spinlock_t drivers_lock = SPIN_LOCK_UNLOCKED; static spinlock_t drivers_lock = SPIN_LOCK_UNLOCKED;
...@@ -270,39 +267,6 @@ static int proc_driver_read_proc(char *page, char **start, off_t off, ...@@ -270,39 +267,6 @@ static int proc_driver_read_proc(char *page, char **start, off_t off,
return len; return len;
} }
/*
* /proc/capi/users:
* name
*/
static int proc_users_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
struct list_head *l;
struct capi_interface_user *cp;
int len = 0;
spin_lock(&users_lock);
list_for_each(l, &users) {
cp = list_entry(l, struct capi_interface_user, user_list);
len += sprintf(page+len, "%s\n", cp->name);
if (len <= off) {
off -= len;
len = 0;
} else {
if (len-off > count)
goto endloop;
}
}
endloop:
spin_unlock(&users_lock);
*start = page+off;
if (len < count)
*eof = 1;
if (len>count) len = count;
if (len<0) len = 0;
return len;
}
/* /*
* /proc/capi/controller: * /proc/capi/controller:
* cnr driver cardstate name driverinfo * cnr driver cardstate name driverinfo
...@@ -427,7 +391,6 @@ static struct procfsentries { ...@@ -427,7 +391,6 @@ static struct procfsentries {
{ "capi", S_IFDIR, 0 }, { "capi", S_IFDIR, 0 },
{ "capi/applications", 0 , proc_applications_read_proc }, { "capi/applications", 0 , proc_applications_read_proc },
{ "capi/driver", 0 , proc_driver_read_proc }, { "capi/driver", 0 , proc_driver_read_proc },
{ "capi/users", 0 , proc_users_read_proc },
{ "capi/controller", 0 , proc_controller_read_proc }, { "capi/controller", 0 , proc_controller_read_proc },
{ "capi/applstats", 0 , proc_applstats_read_proc }, { "capi/applstats", 0 , proc_applstats_read_proc },
{ "capi/contrstats", 0 , proc_contrstats_read_proc }, { "capi/contrstats", 0 , proc_contrstats_read_proc },
...@@ -1331,31 +1294,6 @@ void capi20_set_callback(u16 applid, void (*callback) (unsigned int cmd, __u32 c ...@@ -1331,31 +1294,6 @@ void capi20_set_callback(u16 applid, void (*callback) (unsigned int cmd, __u32 c
EXPORT_SYMBOL(capi20_set_callback); EXPORT_SYMBOL(capi20_set_callback);
/* ------------------------------------------------------------- */
/* -------- Exported Functions --------------------------------- */
/* ------------------------------------------------------------- */
void attach_capi_interface(struct capi_interface_user *userp)
{
spin_lock(&users_lock);
list_add_tail(&userp->user_list, &users);
spin_unlock(&users_lock);
printk(KERN_NOTICE "kcapi: %s attached\n", userp->name);
}
EXPORT_SYMBOL(attach_capi_interface);
void detach_capi_interface(struct capi_interface_user *userp)
{
spin_lock(&users_lock);
list_del(&userp->user_list);
spin_unlock(&users_lock);
printk(KERN_NOTICE "kcapi: %s detached\n", userp->name);
}
EXPORT_SYMBOL(detach_capi_interface);
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* -------- Init & Cleanup ------------------------------------- */ /* -------- Init & Cleanup ------------------------------------- */
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
......
...@@ -52,15 +52,6 @@ typedef struct kcapi_carddef { ...@@ -52,15 +52,6 @@ typedef struct kcapi_carddef {
#define KCI_CONTRUP 0 /* struct capi_profile */ #define KCI_CONTRUP 0 /* struct capi_profile */
#define KCI_CONTRDOWN 1 /* NULL */ #define KCI_CONTRDOWN 1 /* NULL */
struct capi_interface_user {
char name[20];
/* internal */
struct list_head user_list;
};
void attach_capi_interface(struct capi_interface_user *);
void detach_capi_interface(struct capi_interface_user *);
u16 capi20_isinstalled(void); u16 capi20_isinstalled(void);
u16 capi20_register(capi_register_params * rparam, u16 * applidp); u16 capi20_register(capi_register_params * rparam, u16 * applidp);
u16 capi20_release(u16 applid); u16 capi20_release(u16 applid);
......
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