Lines Matching defs:entry

172 static int cardbus_isa_bridge_ranges(dev_info_t *dip, cardbus_phdl_t *entry,
323 * This entry point is called to configure a device (and
516 cardbus_phdl_t *entry;
519 for (entry = cardbus_phdl_list; entry != NULL; entry = entry->next) {
520 if (entry->dip == dip) {
522 return (entry);
528 * Did'nt find entry - create one
554 cardbus_phdl_t *entry;
559 for (entry = cardbus_phdl_list; entry != NULL; follow = entry,
560 entry = entry->next) {
561 if (entry->dip == dip) {
562 if (entry == cardbus_phdl_list) {
563 cardbus_phdl_list = entry->next;
565 follow->next = entry->next;
568 * If this entry has any allocated memory
572 if (entry->memory_len > 0) {
573 res.ra_addr_lo = entry->memory_base;
574 res.ra_len = entry->memory_len;
575 (void) pcmcia_free_mem(entry->res_dip, &res);
580 entry->memory_base, entry->memory_len);
585 entry->memory_base, entry->memory_len);
588 if (entry->io_len > 0) {
589 res.ra_addr_lo = entry->io_base;
590 res.ra_len = entry->io_len;
591 (void) pcmcia_free_io(entry->res_dip, &res);
595 entry->io_base, entry->io_len);
598 * Destroy this entry
600 kmem_free((caddr_t)entry, sizeof (cardbus_phdl_t));
609 * Didn't find the entry
681 cardbus_topbridge_assign(dev_info_t *dip, cardbus_phdl_t *entry)
702 (void) cardbus_bridge_ranges(dip, entry, handle);
708 cardbus_bridge_ranges(dev_info_t *dip, cardbus_phdl_t *entry,
720 (void) cardbus_setup_bridge(dip, entry, handle);
723 range[0].child_lo = range[0].parent_lo = entry->io_last;
726 range[1].child_lo = range[1].parent_lo = entry->memory_last;
729 ddi_walk_devs(ddi_get_child(dip), cardbus_bridge_assign, (void *)entry);
732 (void) cardbus_update_bridge(dip, entry, handle);
759 entry->error = PCICFG_FAILURE;
764 if (entry->io_len > 0) {
765 range[0].size_lo = entry->io_last - entry->io_base;
768 entry->error = PCICFG_FAILURE;
772 if (entry->memory_len > 0) {
773 range[1].size_lo = entry->memory_last - entry->memory_base;
777 entry->error = PCICFG_FAILURE;
796 cardbus_phdl_t *entry = (cardbus_phdl_t *)hdl;
810 if (entry == NULL) {
811 cardbus_err(dip, 1, "Failed to get entry\n");
817 entry->error = PCICFG_FAILURE;
837 i = cardbus_bridge_ranges(dip, entry, handle);
844 i = cardbus_isa_bridge_ranges(dip, entry, handle);
882 entry->error = PCICFG_FAILURE;
897 entry, reg[i].pci_size_low, &mem_answer);
918 entry, reg[i].pci_size_low, &mem_answer);
955 entry, reg[i].pci_size_low, &io_answer);
967 entry->error = PCICFG_FAILURE;
979 entry->error = PCICFG_FAILURE;
997 cardbus_isa_bridge_ranges(dev_info_t *dip, cardbus_phdl_t *entry,
1032 entry->error = PCICFG_FAILURE;
1045 entry, reg[i].pci_size_low, &io_answer);
1063 entry->error = PCICFG_FAILURE;
1180 * This should not find an existing entry - so
1353 cardbus_setup_bridge(dev_info_t *dip, cardbus_phdl_t *entry,
1362 entry->highest_bus, entry->memory_last, entry->io_last);
1367 entry->highest_bus, entry->memory_last, entry->io_last);
1377 pci_config_put8(handle, PCI_BCNF_SUBBUS, entry->highest_bus);
1379 uval = PCICFG_ROUND_UP(entry->memory_last, PCICFG_MEMGRAN);
1380 if (uval != entry->memory_last) {
1384 uval - entry->memory_last);
1388 uval - entry->memory_last);
1390 (void) cardbus_get_mem(ddi_get_parent(dip), entry,
1391 uval - entry->memory_last, NULL);
1402 entry->memory_last);
1407 entry->memory_last);
1412 uval = PCICFG_ROUND_UP(entry->io_last, PCICFG_IOGRAN);
1413 if (uval != entry->io_last) {
1416 uval - entry->io_last);
1417 (void) cardbus_get_io(ddi_get_parent(dip), entry,
1418 uval - entry->io_last, NULL);
1425 entry->io_last);
1468 entry->highest_bus);
1478 PCICFG_LOADDR(entry->memory_last), entry->memory_last,
1479 entry->memory_len);
1484 PCICFG_LOADDR(entry->memory_last), entry->memory_last,
1485 entry->memory_len);
1489 PCICFG_LOADDR(entry->memory_last));
1496 PCICFG_LOADDR(entry->io_last),
1497 entry->io_len);
1500 PCICFG_LOADDR(entry->io_last));
1536 cardbus_update_bridge(dev_info_t *dip, cardbus_phdl_t *entry,
1558 entry->memory_base, entry->memory_len,
1559 entry->memory_last, entry->memory_gran,
1560 PCICFG_ROUND_UP(entry->memory_last, entry->memory_gran));
1565 entry->memory_base, entry->memory_len,
1566 entry->memory_last, entry->memory_gran,
1567 PCICFG_ROUND_UP(entry->memory_last, entry->memory_gran));
1574 length = PCICFG_ROUND_UP(entry->memory_last + cardbus_min_spare_mem,
1575 bridge_gran) - entry->memory_last;
1583 (void) cardbus_get_mem(dip, entry, length, NULL);
1588 if (entry->memory_len) {
1590 rlval = PCICFG_ROUND_DOWN(entry->memory_last - 1,
1604 rlval = PCICFG_ROUND_DOWN(entry->memory_last - 1,
1626 entry->io_base, entry->io_len, entry->io_last, entry->io_gran,
1627 PCICFG_ROUND_UP(entry->io_last, entry->io_gran));
1640 length = PCICFG_ROUND_UP(entry->io_last + cardbus_min_spare_io,
1641 bridge_gran) - entry->io_last;
1643 (void) cardbus_get_io(dip, entry, length, NULL);
1651 if (entry->io_len) {
1653 rlval = PCICFG_ROUND_DOWN(entry->io_last - 1,
1664 rlval = PCICFG_ROUND_DOWN(entry->io_last - 1,
1694 cardbus_get_mem(dev_info_t *dip, cardbus_phdl_t *entry,
1703 entry->memory_last, length,
1704 entry->memory_base, entry->memory_len, (void *) ans);
1709 entry->memory_last, length,
1710 entry->memory_base, entry->memory_len, (void *) ans);
1717 hole = PCICFG_ROUND_UP(entry->memory_last, length)
1718 - entry->memory_last;
1722 entry->memory_last,
1724 entry->memory_last += hole;
1730 hole, entry->memory_last);
1735 hole, entry->memory_last);
1740 entry->memory_last,
1748 if ((entry->memory_last + length) >
1749 (entry->memory_base + entry->memory_len))
1759 entry->memory_last + length,
1760 entry->memory_base + entry->memory_len,
1761 entry->memory_last,
1763 entry->memory_base,
1764 entry->memory_len);
1766 ASSERT((entry->memory_last + length) <=
1767 (entry->memory_base + entry->memory_len));
1773 *ans = entry->memory_last;
1778 entry->memory_last += length;
1782 cardbus_get_io(dev_info_t *dip, cardbus_phdl_t *entry,
1790 entry->io_last, length,
1791 entry->io_base, entry->io_len, (void *) ans);
1797 hole = PCICFG_ROUND_UP(entry->io_last, length) - entry->io_last;
1800 (uint64_t)entry->io_last,
1802 entry->io_last += hole;
1807 hole, entry->io_last);
1811 (uint64_t)entry->io_last,
1818 ASSERT((entry->io_last + length) <=
1819 (entry->io_base + entry->io_len));
1826 *ans = entry->io_last;
1831 entry->io_last += length;
1837 cardbus_phdl_t *entry = (cardbus_phdl_t *)hdl;
1856 mem_request = &entry->mem_req;
1857 io_request = &entry->io_req;
1862 entry->error = PCICFG_FAILURE;
1883 if (entry->highest_bus < pci_config_get8(handle,
1885 entry->highest_bus = pci_config_get8(
1956 if (entry->memory_gran < PCICFG_MEMGRAN)
1957 entry->memory_gran = PCICFG_MEMGRAN;
1958 if (entry->io_gran < PCICFG_IOGRAN)
1959 entry->io_gran = PCICFG_IOGRAN;
1962 (void *)entry);
2077 entry->memory_len = 0;
2078 entry->io_len = 0;
2079 entry->error = PCICFG_FAILURE;
2109 if (pci_rp[i].pci_size_low > entry->memory_gran)
2110 entry->memory_gran = pci_rp[i].pci_size_low;
2123 if (pci_rp[i].pci_size_low > entry->memory_gran)
2124 entry->memory_gran = pci_rp[i].pci_size_low;
2137 if (pci_rp[i].pci_size_low > entry->io_gran)
2138 entry->io_gran = pci_rp[i].pci_size_low;
2163 entry->memory_gran, entry->io_gran);
2169 entry->memory_gran, entry->io_gran);
2268 * For each "assigned-addresses" property entry with a length,
3483 /* nrange is one higher for new entry */