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 */
37 static int pnp_printf(pnp_info_buffer_t * buffer, char *fmt, ...)
42 if (buffer->stop || buffer->error)
45 res = vsnprintf(buffer->curr, buffer->len - buffer->size, fmt, args);
47 if (buffer->size + res >= buffer->len) {
48 buffer->stop = 1;
51 buffer->curr += res;
52 buffer->size += res;
56 static void pnp_print_port(pnp_info_buffer_t * buffer, char *space,
59 pnp_printf(buffer, "%sport %#llx-%#llx, align %#llx, size %#llx, "
68 static void pnp_print_irq(pnp_info_buffer_t * buffer, char *space,
73 pnp_printf(buffer, "%sirq ", space);
77 pnp_printf(buffer, ",");
82 pnp_printf(buffer, "2/9");
84 pnp_printf(buffer, "%i", i);
87 pnp_printf(buffer, "<none>");
89 pnp_printf(buffer, " High-Edge");
91 pnp_printf(buffer, " Low-Edge");
93 pnp_printf(buffer, " High-Level");
95 pnp_printf(buffer, " Low-Level");
97 pnp_printf(buffer, " (optional)");
98 pnp_printf(buffer, "\n");
101 static void pnp_print_dma(pnp_info_buffer_t * buffer, char *space,
107 pnp_printf(buffer, "%sdma ", space);
111 pnp_printf(buffer, ",");
115 pnp_printf(buffer, "%i", i);
118 pnp_printf(buffer, "<none>");
129 pnp_printf(buffer, " %s", s);
131 pnp_printf(buffer, " master");
133 pnp_printf(buffer, " byte-count");
135 pnp_printf(buffer, " word-count");
150 pnp_printf(buffer, " %s\n", s);
153 static void pnp_print_mem(pnp_info_buffer_t * buffer, char *space,
158 pnp_printf(buffer, "%sMemory %#llx-%#llx, align %#llx, size %#llx",
164 pnp_printf(buffer, ", writeable");
166 pnp_printf(buffer, ", cacheable");
168 pnp_printf(buffer, ", range-length");
170 pnp_printf(buffer, ", shadowable");
172 pnp_printf(buffer, ", expansion ROM");
186 pnp_printf(buffer, ", %s\n", s);
189 static void pnp_print_option(pnp_info_buffer_t * buffer, char *space,
194 pnp_print_port(buffer, space, &option->u.port);
197 pnp_print_mem(buffer, space, &option->u.mem);
200 pnp_print_irq(buffer, space, &option->u.irq);
203 pnp_print_dma(buffer, space, &option->u.dma);
212 pnp_info_buffer_t *buffer;
217 buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
218 if (!buffer)
221 buffer->len = PAGE_SIZE;
222 buffer->buffer = buf;
223 buffer->curr = buffer->buffer;
231 pnp_printf(buffer, "Dependent: %02i - "
239 pnp_print_option(buffer, indent, option);
242 ret = (buffer->curr - buf);
243 kfree(buffer);
252 pnp_info_buffer_t *buffer;
260 buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
261 if (!buffer)
264 buffer->len = PAGE_SIZE;
265 buffer->buffer = buf;
266 buffer->curr = buffer->buffer;
268 pnp_printf(buffer, "state = %s\n", dev->active ? "active" : "disabled");
273 pnp_printf(buffer, pnp_resource_type_name(res));
276 pnp_printf(buffer, " disabled\n");
284 pnp_printf(buffer, " %#llx-%#llx%s\n",
292 pnp_printf(buffer, " %lld\n",
298 ret = (buffer->curr - buf);
299 kfree(buffer);