Lines Matching full:rule
23 unsigned char rule, in pnp_find_resource() argument
29 /* when the resource already exists, set its resource bits from rule */ in pnp_find_resource()
32 res->flags |= rule & IORESOURCE_BITS; in pnp_find_resource()
38 static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) in pnp_assign_port() argument
42 res = pnp_find_resource(dev, rule->flags, IORESOURCE_IO, idx); in pnp_assign_port()
51 res->flags = rule->flags | IORESOURCE_AUTO; in pnp_assign_port()
55 if (!rule->size) { in pnp_assign_port()
61 res->start = rule->min; in pnp_assign_port()
62 res->end = res->start + rule->size - 1; in pnp_assign_port()
65 res->start += rule->align; in pnp_assign_port()
66 res->end = res->start + rule->size - 1; in pnp_assign_port()
67 if (res->start > rule->max || !rule->align) { in pnp_assign_port()
70 (unsigned long long) rule->min, in pnp_assign_port()
71 (unsigned long long) rule->max); in pnp_assign_port()
81 static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) in pnp_assign_mem() argument
85 res = pnp_find_resource(dev, rule->flags, IORESOURCE_MEM, idx); in pnp_assign_mem()
94 res->flags = rule->flags | IORESOURCE_AUTO; in pnp_assign_mem()
98 /* ??? rule->flags restricted to 8 bits, all tests bogus ??? */ in pnp_assign_mem()
99 if (!(rule->flags & IORESOURCE_MEM_WRITEABLE)) in pnp_assign_mem()
101 if (rule->flags & IORESOURCE_MEM_RANGELENGTH) in pnp_assign_mem()
103 if (rule->flags & IORESOURCE_MEM_SHADOWABLE) in pnp_assign_mem()
106 if (!rule->size) { in pnp_assign_mem()
112 res->start = rule->min; in pnp_assign_mem()
113 res->end = res->start + rule->size - 1; in pnp_assign_mem()
116 res->start += rule->align; in pnp_assign_mem()
117 res->end = res->start + rule->size - 1; in pnp_assign_mem()
118 if (res->start > rule->max || !rule->align) { in pnp_assign_mem()
121 (unsigned long long) rule->min, in pnp_assign_mem()
122 (unsigned long long) rule->max); in pnp_assign_mem()
132 static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx) in pnp_assign_irq() argument
142 res = pnp_find_resource(dev, rule->flags, IORESOURCE_IRQ, idx); in pnp_assign_irq()
150 res->flags = rule->flags | IORESOURCE_AUTO; in pnp_assign_irq()
154 if (bitmap_empty(rule->map.bits, PNP_IRQ_NR)) { in pnp_assign_irq()
161 res->start = find_next_bit(rule->map.bits, PNP_IRQ_NR, 16); in pnp_assign_irq()
167 if (test_bit(xtab[i], rule->map.bits)) { in pnp_assign_irq()
174 if (rule->flags & IORESOURCE_IRQ_OPTIONAL) { in pnp_assign_irq()
191 static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) in pnp_assign_dma() argument
201 res = pnp_find_resource(dev, rule->flags, IORESOURCE_DMA, idx); in pnp_assign_dma()
209 res->flags = rule->flags | IORESOURCE_AUTO; in pnp_assign_dma()
213 if (!rule->map) { in pnp_assign_dma()
220 if (rule->map & (1 << xtab[i])) { in pnp_assign_dma()