13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <linux/poll.h>
18 #include <linux/list.h>
19 #include <asm/uaccess.h>
44 static char *divas_proc_name =
"divas";
45 static char *adapter_dir_name =
"adapter";
46 static char *info_proc_name =
"info";
47 static char *grp_opt_proc_name =
"group_optimization";
48 static char *d_l1_down_proc_name =
"dynamic_l1_down";
73 for (cadapter = 0; cadapter <
MAX_ADAPTER; cadapter++) {
74 if (IoAdapters[cadapter]) {
78 "%2d: %-30s Serial:%-10s IRQ:%2d\n",
80 IoAdapters[cadapter]->Properties.
Name,
83 if ((
strlen(tmpbuf) + len) > count)
97 divas_write(
struct file *file,
const char __user *buf,
size_t count, loff_t *off)
102 static unsigned int divas_poll(
struct file *file,
poll_table *
wait)
107 static int divas_open(
struct inode *
inode,
struct file *file)
112 static int divas_close(
struct inode *
inode,
struct file *file)
121 .write = divas_write,
124 .release = divas_close
129 divas_proc_entry = proc_create(divas_proc_name,
S_IFREG |
S_IRUGO,
130 proc_net_eicon, &divas_fops);
131 if (!divas_proc_entry)
139 if (divas_proc_entry) {
141 divas_proc_entry =
NULL;
145 static ssize_t grp_opt_proc_write(
struct file *file,
const char __user *
buffer,
146 size_t count, loff_t *
pos)
151 if ((count == 1) || (count == 2)) {
172 static ssize_t d_l1_down_proc_write(
struct file *file,
const char __user *buffer,
173 size_t count, loff_t *pos)
178 if ((count == 1) || (count == 2)) {
199 static int d_l1_down_proc_show(
struct seq_file *
m,
void *
v)
211 static int d_l1_down_proc_open(
struct inode *inode,
struct file *file)
218 .open = d_l1_down_proc_open,
222 .write = d_l1_down_proc_write,
225 static int grp_opt_proc_show(
struct seq_file *m,
void *v)
237 static int grp_opt_proc_open(
struct inode *inode,
struct file *file)
244 .open = grp_opt_proc_open,
248 .write = grp_opt_proc_write,
251 static ssize_t info_proc_write(
struct file *file,
const char __user *buffer,
252 size_t count, loff_t *pos)
265 if (!
memcmp(c,
"trap", 4)) {
272 static int info_proc_show(
struct seq_file *m,
void *v)
298 for (i = 0; i < 8; i++) {
301 "Mem / I/O %d : 0x%x / mapped : 0x%lx",
322 p =
"out of service";
336 static int info_proc_open(
struct inode *inode,
struct file *file)
343 .open = info_proc_open,
347 .write = info_proc_write,
374 &grp_opt_proc_fops, a);
378 &d_l1_down_proc_fops, a);
382 DBG_TRC((
"proc entry %s created", tmp));
409 DBG_TRC((
"proc entry %s%d removed", adapter_dir_name,