11 #include <linux/string.h>
12 #include <linux/errno.h>
13 #include <linux/list.h>
14 #include <linux/types.h>
15 #include <linux/stat.h>
16 #include <linux/ctype.h>
17 #include <linux/slab.h>
20 #include <asm/uaccess.h>
45 if (buffer->
size + res >= buffer->
len) {
57 pnp_printf(buffer,
"%sport %#llx-%#llx, align %#llx, size %#llx, "
58 "%i-bit address decoding\n", space,
59 (
unsigned long long) port->
min,
60 (
unsigned long long) port->
max,
61 port->
align ? ((
unsigned long long) port->
align - 1) : 0,
62 (
unsigned long long) port->
size,
71 pnp_printf(buffer,
"%sirq ", space);
75 pnp_printf(buffer,
",");
80 pnp_printf(buffer,
"2/9");
82 pnp_printf(buffer,
"%i",
i);
84 if (bitmap_empty(irq->
map.bits, PNP_IRQ_NR))
85 pnp_printf(buffer,
"<none>");
87 pnp_printf(buffer,
" High-Edge");
89 pnp_printf(buffer,
" Low-Edge");
91 pnp_printf(buffer,
" High-Level");
93 pnp_printf(buffer,
" Low-Level");
95 pnp_printf(buffer,
" (optional)");
96 pnp_printf(buffer,
"\n");
105 pnp_printf(buffer,
"%sdma ", space);
106 for (
i = 0;
i < 8;
i++)
107 if (dma->
map & (1 <<
i)) {
109 pnp_printf(buffer,
",");
113 pnp_printf(buffer,
"%i",
i);
116 pnp_printf(buffer,
"<none>");
127 pnp_printf(buffer,
" %s", s);
129 pnp_printf(buffer,
" master");
131 pnp_printf(buffer,
" byte-count");
133 pnp_printf(buffer,
" word-count");
148 pnp_printf(buffer,
" %s\n", s);
156 pnp_printf(buffer,
"%sMemory %#llx-%#llx, align %#llx, size %#llx",
157 space, (
unsigned long long) mem->
min,
158 (
unsigned long long) mem->
max,
159 (
unsigned long long) mem->
align,
160 (
unsigned long long) mem->
size);
162 pnp_printf(buffer,
", writeable");
164 pnp_printf(buffer,
", cacheable");
166 pnp_printf(buffer,
", range-length");
168 pnp_printf(buffer,
", shadowable");
170 pnp_printf(buffer,
", expansion ROM");
184 pnp_printf(buffer,
", %s\n", s);
190 switch (option->
type) {
192 pnp_print_port(buffer, space, &option->
u.
port);
195 pnp_print_mem(buffer, space, &option->
u.
mem);
198 pnp_print_irq(buffer, space, &option->
u.
irq);
201 pnp_print_dma(buffer, space, &option->
u.
dma);
212 int ret, dep = 0,
set = 0;
224 if (pnp_option_is_dependent(option)) {
226 if (!dep || pnp_option_set(option) !=
set) {
227 set = pnp_option_set(option);
229 pnp_printf(buffer,
"Dependent: %02i - "
230 "Priority %s\n",
set,
237 pnp_print_option(buffer, indent, option);
245 static ssize_t pnp_show_current_resources(
struct device *dmdev,
266 pnp_printf(buffer,
"state = %s\n", dev->
active ?
"active" :
"disabled");
274 pnp_printf(buffer,
" disabled\n");
282 pnp_printf(buffer,
" %#llx-%#llx%s\n",
283 (
unsigned long long) res->
start,
284 (
unsigned long long) res->
end,
290 pnp_printf(buffer,
" %lld\n",
291 (
unsigned long long) res->
start);
301 static ssize_t pnp_set_current_resources(
struct device *dmdev,
303 const char *ubuf,
size_t count)
306 char *buf = (
void *)ubuf;
321 if (!
strnicmp(buf,
"activate", 8)) {
423 pnp_show_current_resources,
424 pnp_set_current_resources),