diff options
Diffstat (limited to 'drivers/isdn/hardware/eicon/capimain.c')
-rw-r--r-- | drivers/isdn/hardware/eicon/capimain.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/drivers/isdn/hardware/eicon/capimain.c b/drivers/isdn/hardware/eicon/capimain.c index 98fcdfc7ca55..0f073cd73763 100644 --- a/drivers/isdn/hardware/eicon/capimain.c +++ b/drivers/isdn/hardware/eicon/capimain.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <asm/uaccess.h> | 15 | #include <asm/uaccess.h> |
16 | #include <linux/seq_file.h> | ||
16 | #include <linux/skbuff.h> | 17 | #include <linux/skbuff.h> |
17 | 18 | ||
18 | #include "os_capi.h" | 19 | #include "os_capi.h" |
@@ -75,25 +76,32 @@ void diva_os_free_message_buffer(diva_os_message_buffer_s * dmb) | |||
75 | /* | 76 | /* |
76 | * proc function for controller info | 77 | * proc function for controller info |
77 | */ | 78 | */ |
78 | static int diva_ctl_read_proc(char *page, char **start, off_t off, | 79 | static int diva_ctl_proc_show(struct seq_file *m, void *v) |
79 | int count, int *eof, struct capi_ctr *ctrl) | ||
80 | { | 80 | { |
81 | struct capi_ctr *ctrl = m->private; | ||
81 | diva_card *card = (diva_card *) ctrl->driverdata; | 82 | diva_card *card = (diva_card *) ctrl->driverdata; |
82 | int len = 0; | 83 | |
83 | 84 | seq_printf(m, "%s\n", ctrl->name); | |
84 | len += sprintf(page + len, "%s\n", ctrl->name); | 85 | seq_printf(m, "Serial No. : %s\n", ctrl->serial); |
85 | len += sprintf(page + len, "Serial No. : %s\n", ctrl->serial); | 86 | seq_printf(m, "Id : %d\n", card->Id); |
86 | len += sprintf(page + len, "Id : %d\n", card->Id); | 87 | seq_printf(m, "Channels : %d\n", card->d.channels); |
87 | len += sprintf(page + len, "Channels : %d\n", card->d.channels); | 88 | |
88 | 89 | return 0; | |
89 | if (off + count >= len) | 90 | } |
90 | *eof = 1; | 91 | |
91 | if (len < off) | 92 | static int diva_ctl_proc_open(struct inode *inode, struct file *file) |
92 | return 0; | 93 | { |
93 | *start = page + off; | 94 | return single_open(file, diva_ctl_proc_show, NULL); |
94 | return ((count < len - off) ? count : len - off); | ||
95 | } | 95 | } |
96 | 96 | ||
97 | static const struct file_operations diva_ctl_proc_fops = { | ||
98 | .owner = THIS_MODULE, | ||
99 | .open = diva_ctl_proc_open, | ||
100 | .read = seq_read, | ||
101 | .llseek = seq_lseek, | ||
102 | .release = single_release, | ||
103 | }; | ||
104 | |||
97 | /* | 105 | /* |
98 | * set additional os settings in capi_ctr struct | 106 | * set additional os settings in capi_ctr struct |
99 | */ | 107 | */ |
@@ -102,7 +110,7 @@ void diva_os_set_controller_struct(struct capi_ctr *ctrl) | |||
102 | ctrl->driver_name = DRIVERLNAME; | 110 | ctrl->driver_name = DRIVERLNAME; |
103 | ctrl->load_firmware = NULL; | 111 | ctrl->load_firmware = NULL; |
104 | ctrl->reset_ctr = NULL; | 112 | ctrl->reset_ctr = NULL; |
105 | ctrl->ctr_read_proc = diva_ctl_read_proc; | 113 | ctrl->proc_fops = &diva_ctl_proc_fops; |
106 | ctrl->owner = THIS_MODULE; | 114 | ctrl->owner = THIS_MODULE; |
107 | } | 115 | } |
108 | 116 | ||