Lines Matching refs:p
81 unsigned char *p, in pnpbios_parse_allocated_resource_data()
87 if (!p) in pnpbios_parse_allocated_resource_data()
94 while ((char *)p < (char *)end) { in pnpbios_parse_allocated_resource_data()
97 if (p[0] & LARGE_TAG) { /* large tag */ in pnpbios_parse_allocated_resource_data()
98 len = (p[2] << 8) | p[1]; in pnpbios_parse_allocated_resource_data()
99 tag = p[0]; in pnpbios_parse_allocated_resource_data()
101 len = p[0] & 0x07; in pnpbios_parse_allocated_resource_data()
102 tag = ((p[0] >> 3) & 0x0f); in pnpbios_parse_allocated_resource_data()
110 io = *(short *)&p[4]; in pnpbios_parse_allocated_resource_data()
111 size = *(short *)&p[10]; in pnpbios_parse_allocated_resource_data()
126 io = *(int *)&p[4]; in pnpbios_parse_allocated_resource_data()
127 size = *(int *)&p[16]; in pnpbios_parse_allocated_resource_data()
134 io = *(int *)&p[4]; in pnpbios_parse_allocated_resource_data()
135 size = *(int *)&p[8]; in pnpbios_parse_allocated_resource_data()
144 mask = p[1] + p[2] * 256; in pnpbios_parse_allocated_resource_data()
160 mask = p[1]; in pnpbios_parse_allocated_resource_data()
172 io = p[2] + p[3] * 256; in pnpbios_parse_allocated_resource_data()
173 size = p[7]; in pnpbios_parse_allocated_resource_data()
184 io = p[1] + p[2] * 256; in pnpbios_parse_allocated_resource_data()
185 size = p[3]; in pnpbios_parse_allocated_resource_data()
190 p = p + 2; in pnpbios_parse_allocated_resource_data()
191 return (unsigned char *)p; in pnpbios_parse_allocated_resource_data()
202 if (p[0] & LARGE_TAG) in pnpbios_parse_allocated_resource_data()
203 p += len + 3; in pnpbios_parse_allocated_resource_data()
205 p += len + 1; in pnpbios_parse_allocated_resource_data()
218 unsigned char *p, int size, in pnpbios_parse_mem_option() argument
224 min = ((p[5] << 8) | p[4]) << 8; in pnpbios_parse_mem_option()
225 max = ((p[7] << 8) | p[6]) << 8; in pnpbios_parse_mem_option()
226 align = (p[9] << 8) | p[8]; in pnpbios_parse_mem_option()
227 len = ((p[11] << 8) | p[10]) << 8; in pnpbios_parse_mem_option()
228 flags = p[3]; in pnpbios_parse_mem_option()
234 unsigned char *p, int size, in pnpbios_parse_mem32_option() argument
240 min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; in pnpbios_parse_mem32_option()
241 max = (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | p[8]; in pnpbios_parse_mem32_option()
242 align = (p[15] << 24) | (p[14] << 16) | (p[13] << 8) | p[12]; in pnpbios_parse_mem32_option()
243 len = (p[19] << 24) | (p[18] << 16) | (p[17] << 8) | p[16]; in pnpbios_parse_mem32_option()
244 flags = p[3]; in pnpbios_parse_mem32_option()
250 unsigned char *p, int size, in pnpbios_parse_fixed_mem32_option() argument
256 base = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; in pnpbios_parse_fixed_mem32_option()
257 len = (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | p[8]; in pnpbios_parse_fixed_mem32_option()
258 flags = p[3]; in pnpbios_parse_fixed_mem32_option()
263 unsigned char *p, int size, in pnpbios_parse_irq_option() argument
270 bits = (p[2] << 8) | p[1]; in pnpbios_parse_irq_option()
276 flags = p[3]; in pnpbios_parse_irq_option()
282 unsigned char *p, int size, in pnpbios_parse_dma_option() argument
285 pnp_register_dma_resource(dev, option_flags, p[1], p[2]); in pnpbios_parse_dma_option()
289 unsigned char *p, int size, in pnpbios_parse_port_option() argument
295 min = (p[3] << 8) | p[2]; in pnpbios_parse_port_option()
296 max = (p[5] << 8) | p[4]; in pnpbios_parse_port_option()
297 align = p[6]; in pnpbios_parse_port_option()
298 len = p[7]; in pnpbios_parse_port_option()
299 flags = p[1] ? IORESOURCE_IO_16BIT_ADDR : 0; in pnpbios_parse_port_option()
305 unsigned char *p, int size, in pnpbios_parse_fixed_port_option() argument
310 base = (p[2] << 8) | p[1]; in pnpbios_parse_fixed_port_option()
311 len = p[3]; in pnpbios_parse_fixed_port_option()
317 pnpbios_parse_resource_option_data(unsigned char *p, unsigned char *end, in pnpbios_parse_resource_option_data() argument
324 if (!p) in pnpbios_parse_resource_option_data()
329 while ((char *)p < (char *)end) { in pnpbios_parse_resource_option_data()
332 if (p[0] & LARGE_TAG) { /* large tag */ in pnpbios_parse_resource_option_data()
333 len = (p[2] << 8) | p[1]; in pnpbios_parse_resource_option_data()
334 tag = p[0]; in pnpbios_parse_resource_option_data()
336 len = p[0] & 0x07; in pnpbios_parse_resource_option_data()
337 tag = ((p[0] >> 3) & 0x0f); in pnpbios_parse_resource_option_data()
345 pnpbios_parse_mem_option(dev, p, len, option_flags); in pnpbios_parse_resource_option_data()
351 pnpbios_parse_mem32_option(dev, p, len, option_flags); in pnpbios_parse_resource_option_data()
357 pnpbios_parse_fixed_mem32_option(dev, p, len, in pnpbios_parse_resource_option_data()
364 pnpbios_parse_irq_option(dev, p, len, option_flags); in pnpbios_parse_resource_option_data()
370 pnpbios_parse_dma_option(dev, p, len, option_flags); in pnpbios_parse_resource_option_data()
376 pnpbios_parse_port_option(dev, p, len, option_flags); in pnpbios_parse_resource_option_data()
386 pnpbios_parse_fixed_port_option(dev, p, len, in pnpbios_parse_resource_option_data()
395 priority = p[1]; in pnpbios_parse_resource_option_data()
406 return p + 2; in pnpbios_parse_resource_option_data()
416 if (p[0] & LARGE_TAG) in pnpbios_parse_resource_option_data()
417 p += len + 3; in pnpbios_parse_resource_option_data()
419 p += len + 1; in pnpbios_parse_resource_option_data()
431 static unsigned char *pnpbios_parse_compatible_ids(unsigned char *p, in pnpbios_parse_compatible_ids() argument
440 if (!p) in pnpbios_parse_compatible_ids()
443 while ((char *)p < (char *)end) { in pnpbios_parse_compatible_ids()
446 if (p[0] & LARGE_TAG) { /* large tag */ in pnpbios_parse_compatible_ids()
447 len = (p[2] << 8) | p[1]; in pnpbios_parse_compatible_ids()
448 tag = p[0]; in pnpbios_parse_compatible_ids()
450 len = p[0] & 0x07; in pnpbios_parse_compatible_ids()
451 tag = ((p[0] >> 3) & 0x0f); in pnpbios_parse_compatible_ids()
457 strncpy(dev->name, p + 3, in pnpbios_parse_compatible_ids()
466 eisa_id = p[1] | p[2] << 8 | p[3] << 16 | p[4] << 24; in pnpbios_parse_compatible_ids()
474 p = p + 2; in pnpbios_parse_compatible_ids()
475 return (unsigned char *)p; in pnpbios_parse_compatible_ids()
486 if (p[0] & LARGE_TAG) in pnpbios_parse_compatible_ids()
487 p += len + 3; in pnpbios_parse_compatible_ids()
489 p += len + 1; in pnpbios_parse_compatible_ids()
501 static void pnpbios_encode_mem(struct pnp_dev *dev, unsigned char *p, in pnpbios_encode_mem() argument
515 p[4] = (base >> 8) & 0xff; in pnpbios_encode_mem()
516 p[5] = ((base >> 8) >> 8) & 0xff; in pnpbios_encode_mem()
517 p[6] = (base >> 8) & 0xff; in pnpbios_encode_mem()
518 p[7] = ((base >> 8) >> 8) & 0xff; in pnpbios_encode_mem()
519 p[10] = (len >> 8) & 0xff; in pnpbios_encode_mem()
520 p[11] = ((len >> 8) >> 8) & 0xff; in pnpbios_encode_mem()
525 static void pnpbios_encode_mem32(struct pnp_dev *dev, unsigned char *p, in pnpbios_encode_mem32() argument
539 p[4] = base & 0xff; in pnpbios_encode_mem32()
540 p[5] = (base >> 8) & 0xff; in pnpbios_encode_mem32()
541 p[6] = (base >> 16) & 0xff; in pnpbios_encode_mem32()
542 p[7] = (base >> 24) & 0xff; in pnpbios_encode_mem32()
543 p[8] = base & 0xff; in pnpbios_encode_mem32()
544 p[9] = (base >> 8) & 0xff; in pnpbios_encode_mem32()
545 p[10] = (base >> 16) & 0xff; in pnpbios_encode_mem32()
546 p[11] = (base >> 24) & 0xff; in pnpbios_encode_mem32()
547 p[16] = len & 0xff; in pnpbios_encode_mem32()
548 p[17] = (len >> 8) & 0xff; in pnpbios_encode_mem32()
549 p[18] = (len >> 16) & 0xff; in pnpbios_encode_mem32()
550 p[19] = (len >> 24) & 0xff; in pnpbios_encode_mem32()
555 static void pnpbios_encode_fixed_mem32(struct pnp_dev *dev, unsigned char *p, in pnpbios_encode_fixed_mem32() argument
569 p[4] = base & 0xff; in pnpbios_encode_fixed_mem32()
570 p[5] = (base >> 8) & 0xff; in pnpbios_encode_fixed_mem32()
571 p[6] = (base >> 16) & 0xff; in pnpbios_encode_fixed_mem32()
572 p[7] = (base >> 24) & 0xff; in pnpbios_encode_fixed_mem32()
573 p[8] = len & 0xff; in pnpbios_encode_fixed_mem32()
574 p[9] = (len >> 8) & 0xff; in pnpbios_encode_fixed_mem32()
575 p[10] = (len >> 16) & 0xff; in pnpbios_encode_fixed_mem32()
576 p[11] = (len >> 24) & 0xff; in pnpbios_encode_fixed_mem32()
582 static void pnpbios_encode_irq(struct pnp_dev *dev, unsigned char *p, in pnpbios_encode_irq() argument
592 p[1] = map & 0xff; in pnpbios_encode_irq()
593 p[2] = (map >> 8) & 0xff; in pnpbios_encode_irq()
598 static void pnpbios_encode_dma(struct pnp_dev *dev, unsigned char *p, in pnpbios_encode_dma() argument
608 p[1] = map & 0xff; in pnpbios_encode_dma()
613 static void pnpbios_encode_port(struct pnp_dev *dev, unsigned char *p, in pnpbios_encode_port() argument
627 p[2] = base & 0xff; in pnpbios_encode_port()
628 p[3] = (base >> 8) & 0xff; in pnpbios_encode_port()
629 p[4] = base & 0xff; in pnpbios_encode_port()
630 p[5] = (base >> 8) & 0xff; in pnpbios_encode_port()
631 p[7] = len & 0xff; in pnpbios_encode_port()
636 static void pnpbios_encode_fixed_port(struct pnp_dev *dev, unsigned char *p, in pnpbios_encode_fixed_port() argument
650 p[1] = base & 0xff; in pnpbios_encode_fixed_port()
651 p[2] = (base >> 8) & 0xff; in pnpbios_encode_fixed_port()
652 p[3] = len & 0xff; in pnpbios_encode_fixed_port()
660 unsigned char *p, in pnpbios_encode_allocated_resource_data()
666 if (!p) in pnpbios_encode_allocated_resource_data()
669 while ((char *)p < (char *)end) { in pnpbios_encode_allocated_resource_data()
672 if (p[0] & LARGE_TAG) { /* large tag */ in pnpbios_encode_allocated_resource_data()
673 len = (p[2] << 8) | p[1]; in pnpbios_encode_allocated_resource_data()
674 tag = p[0]; in pnpbios_encode_allocated_resource_data()
676 len = p[0] & 0x07; in pnpbios_encode_allocated_resource_data()
677 tag = ((p[0] >> 3) & 0x0f); in pnpbios_encode_allocated_resource_data()
685 pnpbios_encode_mem(dev, p, in pnpbios_encode_allocated_resource_data()
693 pnpbios_encode_mem32(dev, p, in pnpbios_encode_allocated_resource_data()
701 pnpbios_encode_fixed_mem32(dev, p, in pnpbios_encode_allocated_resource_data()
709 pnpbios_encode_irq(dev, p, in pnpbios_encode_allocated_resource_data()
717 pnpbios_encode_dma(dev, p, in pnpbios_encode_allocated_resource_data()
725 pnpbios_encode_port(dev, p, in pnpbios_encode_allocated_resource_data()
737 pnpbios_encode_fixed_port(dev, p, in pnpbios_encode_allocated_resource_data()
743 p = p + 2; in pnpbios_encode_allocated_resource_data()
744 return (unsigned char *)p; in pnpbios_encode_allocated_resource_data()
755 if (p[0] & LARGE_TAG) in pnpbios_encode_allocated_resource_data()
756 p += len + 3; in pnpbios_encode_allocated_resource_data()
758 p += len + 1; in pnpbios_encode_allocated_resource_data()
773 unsigned char *p = (char *)node->data; in pnpbios_parse_data_stream() local
776 p = pnpbios_parse_allocated_resource_data(dev, p, end); in pnpbios_parse_data_stream()
777 if (!p) in pnpbios_parse_data_stream()
779 p = pnpbios_parse_resource_option_data(p, end, dev); in pnpbios_parse_data_stream()
780 if (!p) in pnpbios_parse_data_stream()
782 p = pnpbios_parse_compatible_ids(p, end, dev); in pnpbios_parse_data_stream()
783 if (!p) in pnpbios_parse_data_stream()
791 unsigned char *p = (char *)node->data; in pnpbios_read_resources_from_node() local
794 p = pnpbios_parse_allocated_resource_data(dev, p, end); in pnpbios_read_resources_from_node()
795 if (!p) in pnpbios_read_resources_from_node()
803 unsigned char *p = (char *)node->data; in pnpbios_write_resources_to_node() local
806 p = pnpbios_encode_allocated_resource_data(dev, p, end); in pnpbios_write_resources_to_node()
807 if (!p) in pnpbios_write_resources_to_node()