15 #include <linux/module.h>
16 #include <linux/poll.h>
18 #include <linux/pci.h>
19 #include <linux/slab.h>
27 #define INFO_OUT_LEN 80
32 #define CONF_STATE_DETECT 0
33 #define CONF_STATE_CONF 1
34 #define CONF_STATE_POF 2
35 #define CONF_LINE_LEN 255
67 while ((*cp <=
'9') && (*cp >=
'0'))
68 i = i * 10 + *cp++ -
'0';
94 hysdn_conf_write(
struct file *
file,
const char __user *
buf,
size_t count, loff_t *off)
98 unsigned char ch, *
cp;
167 if ((*cp <
' ') && (*cp != 9))
177 while ((i) && (*cp <
' ') && (*cp != 9)) {
183 if ((i = process_line(cnf)) < 0)
212 hysdn_conf_read(
struct file *file,
char __user *buf,
size_t count, loff_t *off)
229 hysdn_conf_open(
struct inode *
ino,
struct file *filep)
250 hysdn_addlog(card,
"config open for uid=%d gid=%d mode=0x%x",
276 sprintf(tmp,
"id bus slot type irq iobase dp-mem b-chans fax-chans state device");
285 sprintf(cp,
"%d %3d %4d %4d %3d 0x%04x 0x%08lx %7d %9d %3d %s",
315 hysdn_conf_close(
struct inode *ino,
struct file *filep)
336 hysdn_addlog(card,
"config close for uid=%d gid=%d mode=0x%x",
366 .read = hysdn_conf_read,
367 .write = hysdn_conf_write,
368 .open = hysdn_conf_open,
369 .release = hysdn_conf_close,
386 unsigned char conf_name[20];
389 if (!hysdn_proc_entry) {
397 if ((card->
procconf = (
void *) proc_create(conf_name,
400 &conf_fops)) !=
NULL) {
418 unsigned char conf_name[20];