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.
41 if (buffer->stop || buffer->error) in pnp_printf()
44 res = vsnprintf(buffer->curr, buffer->len - buffer->size, fmt, args); in pnp_printf()
46 if (buffer->size + res >= buffer->len) { in pnp_printf()
47 buffer->stop = 1; in pnp_printf()
50 buffer->curr += res; in pnp_printf()
51 buffer->size += res; in pnp_printf()
58 pnp_printf(buffer, "%sport %#llx-%#llx, align %#llx, size %#llx, " in pnp_print_port()
59 "%i-bit address decoding\n", space, in pnp_print_port()
60 (unsigned long long) port->min, in pnp_print_port()
61 (unsigned long long) port->max, in pnp_print_port()
62 port->align ? ((unsigned long long) port->align - 1) : 0, in pnp_print_port()
63 (unsigned long long) port->size, in pnp_print_port()
64 port->flags & IORESOURCE_IO_16BIT_ADDR ? 16 : 10); in pnp_print_port()
74 if (test_bit(i, irq->map.bits)) { in pnp_print_irq()
85 if (bitmap_empty(irq->map.bits, PNP_IRQ_NR)) in pnp_print_irq()
87 if (irq->flags & IORESOURCE_IRQ_HIGHEDGE) in pnp_print_irq()
88 pnp_printf(buffer, " High-Edge"); in pnp_print_irq()
89 if (irq->flags & IORESOURCE_IRQ_LOWEDGE) in pnp_print_irq()
90 pnp_printf(buffer, " Low-Edge"); in pnp_print_irq()
91 if (irq->flags & IORESOURCE_IRQ_HIGHLEVEL) in pnp_print_irq()
92 pnp_printf(buffer, " High-Level"); in pnp_print_irq()
93 if (irq->flags & IORESOURCE_IRQ_LOWLEVEL) in pnp_print_irq()
94 pnp_printf(buffer, " Low-Level"); in pnp_print_irq()
95 if (irq->flags & IORESOURCE_IRQ_OPTIONAL) in pnp_print_irq()
101 struct pnp_dma *dma) in pnp_print_dma() argument
108 if (dma->map & (1 << i)) { in pnp_print_dma()
116 if (!dma->map) in pnp_print_dma()
118 switch (dma->flags & IORESOURCE_DMA_TYPE_MASK) { in pnp_print_dma()
120 s = "8-bit"; in pnp_print_dma()
123 s = "8-bit&16-bit"; in pnp_print_dma()
126 s = "16-bit"; in pnp_print_dma()
129 if (dma->flags & IORESOURCE_DMA_MASTER) in pnp_print_dma()
131 if (dma->flags & IORESOURCE_DMA_BYTE) in pnp_print_dma()
132 pnp_printf(buffer, " byte-count"); in pnp_print_dma()
133 if (dma->flags & IORESOURCE_DMA_WORD) in pnp_print_dma()
134 pnp_printf(buffer, " word-count"); in pnp_print_dma()
135 switch (dma->flags & IORESOURCE_DMA_SPEED_MASK) { in pnp_print_dma()
137 s = "type-A"; in pnp_print_dma()
140 s = "type-B"; in pnp_print_dma()
143 s = "type-F"; in pnp_print_dma()
153 struct pnp_mem *mem) in pnp_print_mem() argument
157 pnp_printf(buffer, "%sMemory %#llx-%#llx, align %#llx, size %#llx", in pnp_print_mem()
158 space, (unsigned long long) mem->min, in pnp_print_mem()
159 (unsigned long long) mem->max, in pnp_print_mem()
160 (unsigned long long) mem->align, in pnp_print_mem()
161 (unsigned long long) mem->size); in pnp_print_mem()
162 if (mem->flags & IORESOURCE_MEM_WRITEABLE) in pnp_print_mem()
164 if (mem->flags & IORESOURCE_MEM_CACHEABLE) in pnp_print_mem()
166 if (mem->flags & IORESOURCE_MEM_RANGELENGTH) in pnp_print_mem()
167 pnp_printf(buffer, ", range-length"); in pnp_print_mem()
168 if (mem->flags & IORESOURCE_MEM_SHADOWABLE) in pnp_print_mem()
170 if (mem->flags & IORESOURCE_MEM_EXPANSIONROM) in pnp_print_mem()
172 switch (mem->flags & IORESOURCE_MEM_TYPE_MASK) { in pnp_print_mem()
174 s = "8-bit"; in pnp_print_mem()
177 s = "8-bit&16-bit"; in pnp_print_mem()
180 s = "32-bit"; in pnp_print_mem()
183 s = "16-bit"; in pnp_print_mem()
191 switch (option->type) { in pnp_print_option()
193 pnp_print_port(buffer, space, &option->u.port); in pnp_print_option()
196 pnp_print_mem(buffer, space, &option->u.mem); in pnp_print_option()
199 pnp_print_irq(buffer, space, &option->u.irq); in pnp_print_option()
202 pnp_print_dma(buffer, space, &option->u.dma); in pnp_print_option()
218 return -ENOMEM; in options_show()
220 buffer->len = PAGE_SIZE; in options_show()
221 buffer->buffer = buf; in options_show()
222 buffer->curr = buffer->buffer; in options_show()
224 list_for_each_entry(option, &dev->options, list) { in options_show()
230 pnp_printf(buffer, "Dependent: %02i - " in options_show()
241 ret = (buffer->curr - buf); in options_show()
257 return -EINVAL; in resources_show()
261 return -ENOMEM; in resources_show()
263 buffer->len = PAGE_SIZE; in resources_show()
264 buffer->buffer = buf; in resources_show()
265 buffer->curr = buffer->buffer; in resources_show()
267 pnp_printf(buffer, "state = %s\n", dev->active ? "active" : "disabled"); in resources_show()
269 list_for_each_entry(pnp_res, &dev->resources, list) { in resources_show()
270 res = &pnp_res->res; in resources_show()
274 if (res->flags & IORESOURCE_DISABLED) { in resources_show()
283 pnp_printf(buffer, " %#llx-%#llx%s\n", in resources_show()
284 (unsigned long long) res->start, in resources_show()
285 (unsigned long long) res->end, in resources_show()
286 res->flags & IORESOURCE_WINDOW ? in resources_show()
292 (unsigned long long) res->start); in resources_show()
297 ret = (buffer->curr - buf); in resources_show()
322 if (*buf == '-') { in pnp_get_resource_value()
343 if (dev->status & PNP_ATTACHED) { in resources_store()
344 retval = -EBUSY; in resources_store()
345 dev_info(&dev->dev, "in use; can't configure\n"); in resources_store()
359 if (dev->active) in resources_store()
365 if (dev->active) in resources_store()
372 if (dev->active) in resources_store()
380 dev->protocol->get(dev); in resources_store()
389 if (dev->active) in resources_store()
402 } else if (!strncasecmp(buf, "mem", 3)) { in resources_store()
414 } else if (!strncasecmp(buf, "dma", 3)) { in resources_store()
445 struct pnp_id *pos = dev->id; in id_show()
448 str += sprintf(str, "%s\n", pos->id); in id_show()
449 pos = pos->next; in id_show()
451 return (str - buf); in id_show()