Lines Matching +full:dma +full:- +full:mem

1 // SPDX-License-Identifier: GPL-2.0
3 * interface.c - contains everything related to the user interface
7 * Copyright (C) 2008 Hewlett-Packard Development Company, L.P.
42 if (buffer->stop || buffer->error) in pnp_printf()
45 res = vsnprintf(buffer->curr, buffer->len - buffer->size, fmt, args); in pnp_printf()
47 if (buffer->size + res >= buffer->len) { in pnp_printf()
48 buffer->stop = 1; in pnp_printf()
51 buffer->curr += res; in pnp_printf()
52 buffer->size += res; in pnp_printf()
59 pnp_printf(buffer, "%sport %#llx-%#llx, align %#llx, size %#llx, " in pnp_print_port()
60 "%i-bit address decoding\n", space, in pnp_print_port()
61 (unsigned long long) port->min, in pnp_print_port()
62 (unsigned long long) port->max, in pnp_print_port()
63 port->align ? ((unsigned long long) port->align - 1) : 0, in pnp_print_port()
64 (unsigned long long) port->size, in pnp_print_port()
65 port->flags & IORESOURCE_IO_16BIT_ADDR ? 16 : 10); in pnp_print_port()
75 if (test_bit(i, irq->map.bits)) { in pnp_print_irq()
86 if (bitmap_empty(irq->map.bits, PNP_IRQ_NR)) in pnp_print_irq()
88 if (irq->flags & IORESOURCE_IRQ_HIGHEDGE) in pnp_print_irq()
89 pnp_printf(buffer, " High-Edge"); in pnp_print_irq()
90 if (irq->flags & IORESOURCE_IRQ_LOWEDGE) in pnp_print_irq()
91 pnp_printf(buffer, " Low-Edge"); in pnp_print_irq()
92 if (irq->flags & IORESOURCE_IRQ_HIGHLEVEL) in pnp_print_irq()
93 pnp_printf(buffer, " High-Level"); in pnp_print_irq()
94 if (irq->flags & IORESOURCE_IRQ_LOWLEVEL) in pnp_print_irq()
95 pnp_printf(buffer, " Low-Level"); in pnp_print_irq()
96 if (irq->flags & IORESOURCE_IRQ_OPTIONAL) in pnp_print_irq()
102 struct pnp_dma *dma) in pnp_print_dma() argument
109 if (dma->map & (1 << i)) { in pnp_print_dma()
117 if (!dma->map) in pnp_print_dma()
119 switch (dma->flags & IORESOURCE_DMA_TYPE_MASK) { in pnp_print_dma()
121 s = "8-bit"; in pnp_print_dma()
124 s = "8-bit&16-bit"; in pnp_print_dma()
127 s = "16-bit"; in pnp_print_dma()
130 if (dma->flags & IORESOURCE_DMA_MASTER) in pnp_print_dma()
132 if (dma->flags & IORESOURCE_DMA_BYTE) in pnp_print_dma()
133 pnp_printf(buffer, " byte-count"); in pnp_print_dma()
134 if (dma->flags & IORESOURCE_DMA_WORD) in pnp_print_dma()
135 pnp_printf(buffer, " word-count"); in pnp_print_dma()
136 switch (dma->flags & IORESOURCE_DMA_SPEED_MASK) { in pnp_print_dma()
138 s = "type-A"; in pnp_print_dma()
141 s = "type-B"; in pnp_print_dma()
144 s = "type-F"; in pnp_print_dma()
154 struct pnp_mem *mem) in pnp_print_mem() argument
158 pnp_printf(buffer, "%sMemory %#llx-%#llx, align %#llx, size %#llx", in pnp_print_mem()
159 space, (unsigned long long) mem->min, in pnp_print_mem()
160 (unsigned long long) mem->max, in pnp_print_mem()
161 (unsigned long long) mem->align, in pnp_print_mem()
162 (unsigned long long) mem->size); in pnp_print_mem()
163 if (mem->flags & IORESOURCE_MEM_WRITEABLE) in pnp_print_mem()
165 if (mem->flags & IORESOURCE_MEM_CACHEABLE) in pnp_print_mem()
167 if (mem->flags & IORESOURCE_MEM_RANGELENGTH) in pnp_print_mem()
168 pnp_printf(buffer, ", range-length"); in pnp_print_mem()
169 if (mem->flags & IORESOURCE_MEM_SHADOWABLE) in pnp_print_mem()
171 if (mem->flags & IORESOURCE_MEM_EXPANSIONROM) in pnp_print_mem()
173 switch (mem->flags & IORESOURCE_MEM_TYPE_MASK) { in pnp_print_mem()
175 s = "8-bit"; in pnp_print_mem()
178 s = "8-bit&16-bit"; in pnp_print_mem()
181 s = "32-bit"; in pnp_print_mem()
184 s = "16-bit"; in pnp_print_mem()
192 switch (option->type) { in pnp_print_option()
194 pnp_print_port(buffer, space, &option->u.port); in pnp_print_option()
197 pnp_print_mem(buffer, space, &option->u.mem); in pnp_print_option()
200 pnp_print_irq(buffer, space, &option->u.irq); in pnp_print_option()
203 pnp_print_dma(buffer, space, &option->u.dma); in pnp_print_option()
219 return -ENOMEM; in options_show()
221 buffer->len = PAGE_SIZE; in options_show()
222 buffer->buffer = buf; in options_show()
223 buffer->curr = buffer->buffer; in options_show()
225 list_for_each_entry(option, &dev->options, list) { in options_show()
231 pnp_printf(buffer, "Dependent: %02i - " in options_show()
242 ret = (buffer->curr - buf); in options_show()
258 return -EINVAL; in resources_show()
262 return -ENOMEM; in resources_show()
264 buffer->len = PAGE_SIZE; in resources_show()
265 buffer->buffer = buf; in resources_show()
266 buffer->curr = buffer->buffer; in resources_show()
268 pnp_printf(buffer, "state = %s\n", dev->active ? "active" : "disabled"); in resources_show()
270 list_for_each_entry(pnp_res, &dev->resources, list) { in resources_show()
271 res = &pnp_res->res; in resources_show()
275 if (res->flags & IORESOURCE_DISABLED) { in resources_show()
284 pnp_printf(buffer, " %#llx-%#llx%s\n", in resources_show()
285 (unsigned long long) res->start, in resources_show()
286 (unsigned long long) res->end, in resources_show()
287 res->flags & IORESOURCE_WINDOW ? in resources_show()
293 (unsigned long long) res->start); in resources_show()
298 ret = (buffer->curr - buf); in resources_show()
323 if (*buf == '-') { in pnp_get_resource_value()
344 if (dev->status & PNP_ATTACHED) { in resources_store()
345 retval = -EBUSY; in resources_store()
346 dev_info(&dev->dev, "in use; can't configure\n"); in resources_store()
360 if (dev->active) in resources_store()
366 if (dev->active) in resources_store()
373 if (dev->active) in resources_store()
381 dev->protocol->get(dev); in resources_store()
390 if (dev->active) in resources_store()
403 } else if (!strncasecmp(buf, "mem", 3)) { in resources_store()
415 } else if (!strncasecmp(buf, "dma", 3)) { in resources_store()
446 struct pnp_id *pos = dev->id; in id_show()
449 str += sprintf(str, "%s\n", pos->id); in id_show()
450 pos = pos->next; in id_show()
452 return (str - buf); in id_show()