Lines Matching refs:idx

146 unsigned char isapnp_read_byte(unsigned char idx)  in isapnp_read_byte()  argument
148 write_address(idx); in isapnp_read_byte()
152 unsigned short isapnp_read_word(unsigned char idx) in isapnp_read_word() argument
156 val = isapnp_read_byte(idx); in isapnp_read_word()
157 val = (val << 8) + isapnp_read_byte(idx+1); in isapnp_read_word()
161 unsigned int isapnp_read_dword(unsigned char idx) in isapnp_read_dword() argument
165 val = isapnp_read_byte(idx); in isapnp_read_dword()
166 val = (val << 8) + isapnp_read_byte(idx+1); in isapnp_read_dword()
167 val = (val << 8) + isapnp_read_byte(idx+2); in isapnp_read_dword()
168 val = (val << 8) + isapnp_read_byte(idx+3); in isapnp_read_dword()
172 void isapnp_write_byte(unsigned char idx, unsigned char val) in isapnp_write_byte() argument
174 write_address(idx); in isapnp_write_byte()
178 void isapnp_write_word(unsigned char idx, unsigned short val) in isapnp_write_word() argument
180 isapnp_write_byte(idx, val >> 8); in isapnp_write_word()
181 isapnp_write_byte(idx+1, val); in isapnp_write_word()
184 void isapnp_write_dword(unsigned char idx, unsigned int val) in isapnp_write_dword() argument
186 isapnp_write_byte(idx, val >> 24); in isapnp_write_dword()
187 isapnp_write_byte(idx+1, val >> 16); in isapnp_write_dword()
188 isapnp_write_byte(idx+2, val >> 8); in isapnp_write_dword()
189 isapnp_write_byte(idx+3, val); in isapnp_write_dword()
1209 int idx; in isapnp_find_dev() local
1214 for (idx = 0; idx < DEVICE_COUNT_COMPATIBLE; idx++) in isapnp_find_dev()
1215 if (dev->vendor_compatible[idx] == vendor && in isapnp_find_dev()
1216 dev->device_compatible[idx] == function) in isapnp_find_dev()
1230 int idx; in isapnp_find_dev() local
1235 for (idx = 0; idx < DEVICE_COUNT_COMPATIBLE; idx++) in isapnp_find_dev()
1236 if (dev->vendor_compatible[idx] == vendor && in isapnp_find_dev()
1237 dev->device_compatible[idx] == function) in isapnp_find_dev()
1248 int idx; in isapnp_match_card() local
1253 for (idx = 0; idx < ISAPNP_CARD_DEVS; idx++) { in isapnp_match_card()
1254 if (ids->devs[idx].vendor == 0 && in isapnp_match_card()
1255 ids->devs[idx].function == 0) in isapnp_match_card()
1258 ids->devs[idx].vendor, in isapnp_match_card()
1259 ids->devs[idx].function, in isapnp_match_card()
1381 int idx; in isapnp_config_prepare() local
1387 for (idx = 0; idx < DEVICE_COUNT_IRQ; idx++) { in isapnp_config_prepare()
1388 dev->irq_resource[idx].name = NULL; in isapnp_config_prepare()
1389 dev->irq_resource[idx].start = 0; in isapnp_config_prepare()
1390 dev->irq_resource[idx].end = 0; in isapnp_config_prepare()
1391 dev->irq_resource[idx].flags = 0; in isapnp_config_prepare()
1393 for (idx = 0; idx < DEVICE_COUNT_DMA; idx++) { in isapnp_config_prepare()
1394 dev->dma_resource[idx].name = NULL; in isapnp_config_prepare()
1395 dev->dma_resource[idx].start = 0; in isapnp_config_prepare()
1396 dev->dma_resource[idx].end = 0; in isapnp_config_prepare()
1397 dev->dma_resource[idx].flags = 0; in isapnp_config_prepare()
1399 for (idx = 0; idx < DEVICE_COUNT_RESOURCE; idx++) { in isapnp_config_prepare()
1400 dev->resource[idx].name = NULL; in isapnp_config_prepare()
1401 dev->resource[idx].start = 0; in isapnp_config_prepare()
1402 dev->resource[idx].end = 0; in isapnp_config_prepare()
1403 dev->resource[idx].flags = 0; in isapnp_config_prepare()
1409 for (port = resa->port, idx = 0; port; port = port->next, idx++) { in isapnp_config_prepare()
1410 if (dev->resource[port_count + idx].flags == 0) { in isapnp_config_prepare()
1411 dev->resource[port_count + idx].flags = isapnp_port_resource_flags(port); in isapnp_config_prepare()
1412 dev->resource[port_count + idx].end = port->size; in isapnp_config_prepare()
1415 if (port_count1 < idx) in isapnp_config_prepare()
1416 port_count1 = idx; in isapnp_config_prepare()
1417 for (irq = resa->irq, idx = 0; irq; irq = irq->next, idx++) { in isapnp_config_prepare()
1418 int count = irq_count + idx; in isapnp_config_prepare()
1426 if (irq_count1 < idx) in isapnp_config_prepare()
1427 irq_count1 = idx; in isapnp_config_prepare()
1428 for (dma = resa->dma, idx = 0; dma; dma = dma->next, idx++) in isapnp_config_prepare()
1429 if (dev->dma_resource[idx].flags == 0) { in isapnp_config_prepare()
1430 dev->dma_resource[idx].flags = isapnp_dma_resource_flags(dma); in isapnp_config_prepare()
1432 if (dma_count1 < idx) in isapnp_config_prepare()
1433 dma_count1 = idx; in isapnp_config_prepare()
1434 for (mem = resa->mem, idx = 0; mem; mem = mem->next, idx++) in isapnp_config_prepare()
1435 if (dev->resource[mem_count + idx + 8].flags == 0) { in isapnp_config_prepare()
1436 dev->resource[mem_count + idx + 8].flags = isapnp_mem_resource_flags(mem); in isapnp_config_prepare()
1438 if (mem_count1 < idx) in isapnp_config_prepare()
1439 mem_count1 = idx; in isapnp_config_prepare()
1569 static int isapnp_check_port(struct isapnp_cfgtmp *cfg, int port, int size, int idx) in isapnp_check_port() argument
1602 if (i == idx) in isapnp_check_port()
1630 static int isapnp_valid_port(struct isapnp_cfgtmp *cfg, int idx) in isapnp_valid_port() argument
1636 if (!cfg || idx < 0 || idx > 7) in isapnp_valid_port()
1638 if (!(cfg->result.resource[idx].flags & IORESOURCE_AUTO)) /* don't touch */ in isapnp_valid_port()
1641 port = cfg->port[idx]; in isapnp_valid_port()
1644 value1 = &cfg->result.resource[idx].start; in isapnp_valid_port()
1645 value2 = &cfg->result.resource[idx].end; in isapnp_valid_port()
1646 if (cfg->result.resource[idx].flags & IORESOURCE_AUTO) { in isapnp_valid_port()
1647 cfg->result.resource[idx].flags &= ~IORESOURCE_AUTO; in isapnp_valid_port()
1650 if (!isapnp_check_port(cfg, *value1, port->size, idx)) in isapnp_valid_port()
1664 } while (isapnp_check_port(cfg, *value1, port->size, idx)); in isapnp_valid_port()
1672 static int isapnp_check_interrupt(struct isapnp_cfgtmp *cfg, int irq, int idx) in isapnp_check_interrupt() argument
1702 if (i == idx) in isapnp_check_interrupt()
1714 static int isapnp_valid_irq(struct isapnp_cfgtmp *cfg, int idx) in isapnp_valid_irq() argument
1724 if (!cfg || idx < 0 || idx > 1) in isapnp_valid_irq()
1726 if (!(cfg->result.irq_resource[idx].flags & IORESOURCE_AUTO)) in isapnp_valid_irq()
1729 irq = cfg->irq[idx]; in isapnp_valid_irq()
1732 value1 = &cfg->result.irq_resource[idx].start; in isapnp_valid_irq()
1733 value2 = &cfg->result.irq_resource[idx].end; in isapnp_valid_irq()
1734 if (cfg->result.irq_resource[idx].flags & IORESOURCE_AUTO) { in isapnp_valid_irq()
1738 cfg->result.irq_resource[idx].flags &= ~IORESOURCE_AUTO; in isapnp_valid_irq()
1739 if (!isapnp_check_interrupt(cfg, *value1 = *value2 = xtab[i], idx)) in isapnp_valid_irq()
1755 } while (isapnp_check_interrupt(cfg, *value1, idx)); in isapnp_valid_irq()
1759 static int isapnp_check_dma(struct isapnp_cfgtmp *cfg, int dma, int idx) in isapnp_check_dma() argument
1785 if (i == idx) in isapnp_check_dma()
1796 static int isapnp_valid_dma(struct isapnp_cfgtmp *cfg, int idx) in isapnp_valid_dma() argument
1806 if (!cfg || idx < 0 || idx > 1) in isapnp_valid_dma()
1808 if (!(cfg->result.dma_resource[idx].flags & IORESOURCE_AUTO)) /* don't touch */ in isapnp_valid_dma()
1811 dma = cfg->dma[idx]; in isapnp_valid_dma()
1814 value1 = &cfg->result.dma_resource[idx].start; in isapnp_valid_dma()
1815 value2 = &cfg->result.dma_resource[idx].end; in isapnp_valid_dma()
1816 if (cfg->result.dma_resource[idx].flags & IORESOURCE_AUTO) { in isapnp_valid_dma()
1820 cfg->result.dma_resource[idx].flags &= ~IORESOURCE_AUTO; in isapnp_valid_dma()
1821 if (!isapnp_check_dma(cfg, *value1 = *value2 = xtab[i], idx)) in isapnp_valid_dma()
1837 } while (isapnp_check_dma(cfg, *value1, idx)); in isapnp_valid_dma()
1841 …atic int isapnp_check_mem(struct isapnp_cfgtmp *cfg, unsigned int addr, unsigned int size, int idx) in isapnp_check_mem() argument
1874 if (i == idx) in isapnp_check_mem()
1900 static int isapnp_valid_mem(struct isapnp_cfgtmp *cfg, int idx) in isapnp_valid_mem() argument
1906 if (!cfg || idx < 0 || idx > 3) in isapnp_valid_mem()
1908 if (!(cfg->result.resource[idx + 8].flags & IORESOURCE_AUTO)) /* don't touch */ in isapnp_valid_mem()
1911 mem = cfg->mem[idx]; in isapnp_valid_mem()
1914 value1 = &cfg->result.resource[idx + 8].start; in isapnp_valid_mem()
1915 value2 = &cfg->result.resource[idx + 8].end; in isapnp_valid_mem()
1916 if (cfg->result.resource[idx + 8].flags & IORESOURCE_AUTO) { in isapnp_valid_mem()
1917 cfg->result.resource[idx + 8].flags &= ~IORESOURCE_AUTO; in isapnp_valid_mem()
1920 if (!isapnp_check_mem(cfg, *value1, mem->size, idx)) in isapnp_valid_mem()
1934 } while (isapnp_check_mem(cfg, *value1, mem->size, idx)); in isapnp_valid_mem()