Lines Matching refs:buffer
26 char *buffer; /* pointer to begin of buffer */
27 char *curr; /* current position in buffer */
29 unsigned long len; /* total length of buffer */
36 static int pnp_printf(pnp_info_buffer_t * buffer, char *fmt, ...)
41 if (buffer->stop || buffer->error)
44 res = vsnprintf(buffer->curr, buffer->len - buffer->size, fmt, args);
46 if (buffer->size + res >= buffer->len) {
47 buffer->stop = 1;
50 buffer->curr += res;
51 buffer->size += res;
55 static void pnp_print_port(pnp_info_buffer_t * buffer, char *space,
58 pnp_printf(buffer, "%sport %#llx-%#llx, align %#llx, size %#llx, "
67 static void pnp_print_irq(pnp_info_buffer_t * buffer, char *space,
72 pnp_printf(buffer, "%sirq ", space);
76 pnp_printf(buffer, ",");
81 pnp_printf(buffer, "2/9");
83 pnp_printf(buffer, "%i", i);
86 pnp_printf(buffer, "<none>");
88 pnp_printf(buffer, " High-Edge");
90 pnp_printf(buffer, " Low-Edge");
92 pnp_printf(buffer, " High-Level");
94 pnp_printf(buffer, " Low-Level");
96 pnp_printf(buffer, " (optional)");
97 pnp_printf(buffer, "\n");
100 static void pnp_print_dma(pnp_info_buffer_t * buffer, char *space,
106 pnp_printf(buffer, "%sdma ", space);
110 pnp_printf(buffer, ",");
114 pnp_printf(buffer, "%i", i);
117 pnp_printf(buffer, "<none>");
128 pnp_printf(buffer, " %s", s);
130 pnp_printf(buffer, " master");
132 pnp_printf(buffer, " byte-count");
134 pnp_printf(buffer, " word-count");
149 pnp_printf(buffer, " %s\n", s);
152 static void pnp_print_mem(pnp_info_buffer_t * buffer, char *space,
157 pnp_printf(buffer, "%sMemory %#llx-%#llx, align %#llx, size %#llx",
163 pnp_printf(buffer, ", writeable");
165 pnp_printf(buffer, ", cacheable");
167 pnp_printf(buffer, ", range-length");
169 pnp_printf(buffer, ", shadowable");
171 pnp_printf(buffer, ", expansion ROM");
185 pnp_printf(buffer, ", %s\n", s);
188 static void pnp_print_option(pnp_info_buffer_t * buffer, char *space,
193 pnp_print_port(buffer, space, &option->u.port);
196 pnp_print_mem(buffer, space, &option->u.mem);
199 pnp_print_irq(buffer, space, &option->u.irq);
202 pnp_print_dma(buffer, space, &option->u.dma);
211 pnp_info_buffer_t *buffer;
216 buffer = pnp_alloc(sizeof(pnp_info_buffer_t));
217 if (!buffer)
220 buffer->len = PAGE_SIZE;
221 buffer->buffer = buf;
222 buffer->curr = buffer->buffer;
230 pnp_printf(buffer, "Dependent: %02i - "
238 pnp_print_option(buffer, indent, option);
241 ret = (buffer->curr - buf);
242 kfree(buffer);
251 pnp_info_buffer_t *buffer;
259 buffer = pnp_alloc(sizeof(pnp_info_buffer_t));
260 if (!buffer)
263 buffer->len = PAGE_SIZE;
264 buffer->buffer = buf;
265 buffer->curr = buffer->buffer;
267 pnp_printf(buffer, "state = %s\n", dev->active ? "active" : "disabled");
272 pnp_printf(buffer, pnp_resource_type_name(res));
275 pnp_printf(buffer, " disabled\n");
283 pnp_printf(buffer, " %#llx-%#llx%s\n",
291 pnp_printf(buffer, " %lld\n",
297 ret = (buffer->curr - buf);
298 kfree(buffer);