Lines Matching full:bridge
3 * VME Bridge Framework
46 * Find the bridge that the resource is associated with.
89 struct vme_bridge *bridge; in vme_alloc_consistent() local
96 bridge = find_bridge(resource); in vme_alloc_consistent()
97 if (!bridge) { in vme_alloc_consistent()
98 printk(KERN_ERR "Can't find bridge\n"); in vme_alloc_consistent()
102 if (!bridge->parent) { in vme_alloc_consistent()
103 printk(KERN_ERR "Dev entry NULL for bridge %s\n", bridge->name); in vme_alloc_consistent()
107 if (!bridge->alloc_consistent) { in vme_alloc_consistent()
108 printk(KERN_ERR "alloc_consistent not supported by bridge %s\n", in vme_alloc_consistent()
109 bridge->name); in vme_alloc_consistent()
113 return bridge->alloc_consistent(bridge->parent, size, dma); in vme_alloc_consistent()
129 struct vme_bridge *bridge; in vme_free_consistent() local
136 bridge = find_bridge(resource); in vme_free_consistent()
137 if (!bridge) { in vme_free_consistent()
138 printk(KERN_ERR "Can't find bridge\n"); in vme_free_consistent()
142 if (!bridge->parent) { in vme_free_consistent()
143 printk(KERN_ERR "Dev entry NULL for bridge %s\n", bridge->name); in vme_free_consistent()
147 if (!bridge->free_consistent) { in vme_free_consistent()
148 printk(KERN_ERR "free_consistent not supported by bridge %s\n", in vme_free_consistent()
149 bridge->name); in vme_free_consistent()
153 bridge->free_consistent(bridge->parent, size, vaddr, dma); in vme_free_consistent()
293 struct vme_bridge *bridge; in vme_slave_request() local
299 bridge = vdev->bridge; in vme_slave_request()
300 if (!bridge) { in vme_slave_request()
306 list_for_each(slave_pos, &bridge->slave_resources) { in vme_slave_request()
374 struct vme_bridge *bridge = find_bridge(resource); in vme_slave_set() local
385 if (!bridge->slave_set) { in vme_slave_set()
400 return bridge->slave_set(image, enabled, vme_base, size, buf_base, in vme_slave_set()
424 struct vme_bridge *bridge = find_bridge(resource); in vme_slave_get() local
434 if (!bridge->slave_get) { in vme_slave_get()
439 return bridge->slave_get(image, enabled, vme_base, size, buf_base, in vme_slave_get()
494 struct vme_bridge *bridge; in vme_master_request() local
500 bridge = vdev->bridge; in vme_master_request()
501 if (!bridge) { in vme_master_request()
507 list_for_each(master_pos, &bridge->master_resources) { in vme_master_request()
578 struct vme_bridge *bridge = find_bridge(resource); in vme_master_set() local
589 if (!bridge->master_set) { in vme_master_set()
605 return bridge->master_set(image, enabled, vme_base, size, aspace, in vme_master_set()
629 struct vme_bridge *bridge = find_bridge(resource); in vme_master_get() local
639 if (!bridge->master_get) { in vme_master_get()
644 return bridge->master_get(image, enabled, vme_base, size, aspace, in vme_master_get()
667 struct vme_bridge *bridge = find_bridge(resource); in vme_master_read() local
671 if (!bridge->master_read) { in vme_master_read()
693 return bridge->master_read(image, buf, count, offset); in vme_master_read()
716 struct vme_bridge *bridge = find_bridge(resource); in vme_master_write() local
720 if (!bridge->master_write) { in vme_master_write()
742 return bridge->master_write(image, buf, count, offset); in vme_master_write()
768 struct vme_bridge *bridge = find_bridge(resource); in vme_master_rmw() local
771 if (!bridge->master_rmw) { in vme_master_rmw()
783 return bridge->master_rmw(image, mask, compare, swap, offset); in vme_master_rmw()
871 struct vme_bridge *bridge; in vme_dma_request() local
880 bridge = vdev->bridge; in vme_dma_request()
881 if (!bridge) { in vme_dma_request()
887 list_for_each(dma_pos, &bridge->dma_resources) { in vme_dma_request()
1121 struct vme_bridge *bridge = list->parent->parent; in vme_dma_list_add() local
1124 if (!bridge->dma_list_add) { in vme_dma_list_add()
1134 retval = bridge->dma_list_add(list, src, dest, count); in vme_dma_list_add()
1154 struct vme_bridge *bridge = list->parent->parent; in vme_dma_list_exec() local
1157 if (!bridge->dma_list_exec) { in vme_dma_list_exec()
1164 retval = bridge->dma_list_exec(list); in vme_dma_list_exec()
1183 struct vme_bridge *bridge = list->parent->parent; in vme_dma_list_free() local
1186 if (!bridge->dma_list_empty) { in vme_dma_list_free()
1200 retval = bridge->dma_list_empty(list); in vme_dma_list_free()
1254 void vme_bus_error_handler(struct vme_bridge *bridge, in vme_bus_error_handler() argument
1262 list_for_each(handler_pos, &bridge->vme_error_handlers) { in vme_bus_error_handler()
1277 dev_err(bridge->parent, in vme_bus_error_handler()
1284 struct vme_bridge *bridge, u32 aspace, in vme_register_error_handler() argument
1298 list_add_tail(&handler->list, &bridge->vme_error_handlers); in vme_register_error_handler()
1311 void vme_irq_handler(struct vme_bridge *bridge, int level, int statid) in vme_irq_handler() argument
1316 call = bridge->irq[level - 1].callback[statid].func; in vme_irq_handler()
1317 priv_data = bridge->irq[level - 1].callback[statid].priv_data; in vme_irq_handler()
1346 struct vme_bridge *bridge; in vme_irq_request() local
1348 bridge = vdev->bridge; in vme_irq_request()
1349 if (!bridge) { in vme_irq_request()
1359 if (!bridge->irq_set) { in vme_irq_request()
1364 mutex_lock(&bridge->irq_mtx); in vme_irq_request()
1366 if (bridge->irq[level - 1].callback[statid].func) { in vme_irq_request()
1367 mutex_unlock(&bridge->irq_mtx); in vme_irq_request()
1372 bridge->irq[level - 1].count++; in vme_irq_request()
1373 bridge->irq[level - 1].callback[statid].priv_data = priv_data; in vme_irq_request()
1374 bridge->irq[level - 1].callback[statid].func = callback; in vme_irq_request()
1377 bridge->irq_set(bridge, level, 1, 1); in vme_irq_request()
1379 mutex_unlock(&bridge->irq_mtx); in vme_irq_request()
1395 struct vme_bridge *bridge; in vme_irq_free() local
1397 bridge = vdev->bridge; in vme_irq_free()
1398 if (!bridge) { in vme_irq_free()
1408 if (!bridge->irq_set) { in vme_irq_free()
1413 mutex_lock(&bridge->irq_mtx); in vme_irq_free()
1415 bridge->irq[level - 1].count--; in vme_irq_free()
1418 if (bridge->irq[level - 1].count == 0) in vme_irq_free()
1419 bridge->irq_set(bridge, level, 0, 1); in vme_irq_free()
1421 bridge->irq[level - 1].callback[statid].func = NULL; in vme_irq_free()
1422 bridge->irq[level - 1].callback[statid].priv_data = NULL; in vme_irq_free()
1424 mutex_unlock(&bridge->irq_mtx); in vme_irq_free()
1442 struct vme_bridge *bridge; in vme_irq_generate() local
1444 bridge = vdev->bridge; in vme_irq_generate()
1445 if (!bridge) { in vme_irq_generate()
1455 if (!bridge->irq_generate) { in vme_irq_generate()
1460 return bridge->irq_generate(bridge, level, statid); in vme_irq_generate()
1476 struct vme_bridge *bridge; in vme_lm_request() local
1482 bridge = vdev->bridge; in vme_lm_request()
1483 if (!bridge) { in vme_lm_request()
1489 list_for_each(lm_pos, &bridge->lm_resources) { in vme_lm_request()
1575 struct vme_bridge *bridge = find_bridge(resource); in vme_lm_set() local
1585 if (!bridge->lm_set) { in vme_lm_set()
1590 return bridge->lm_set(lm, lm_base, aspace, cycle); in vme_lm_set()
1611 struct vme_bridge *bridge = find_bridge(resource); in vme_lm_get() local
1621 if (!bridge->lm_get) { in vme_lm_get()
1626 return bridge->lm_get(lm, lm_base, aspace, cycle); in vme_lm_get()
1648 struct vme_bridge *bridge = find_bridge(resource); in vme_lm_attach() local
1658 if (!bridge->lm_attach) { in vme_lm_attach()
1663 return bridge->lm_attach(lm, monitor, callback, data); in vme_lm_attach()
1681 struct vme_bridge *bridge = find_bridge(resource); in vme_lm_detach() local
1691 if (!bridge->lm_detach) { in vme_lm_detach()
1696 return bridge->lm_detach(lm, monitor); in vme_lm_detach()
1744 * Return: The slot ID on success, -EINVAL if VME bridge cannot be determined
1750 struct vme_bridge *bridge; in vme_slot_num() local
1752 bridge = vdev->bridge; in vme_slot_num()
1753 if (!bridge) { in vme_slot_num()
1758 if (!bridge->slot_get) { in vme_slot_num()
1763 return bridge->slot_get(bridge); in vme_slot_num()
1773 * Return: The bus number on success, -EINVAL if VME bridge cannot be
1778 struct vme_bridge *bridge; in vme_bus_num() local
1780 bridge = vdev->bridge; in vme_bus_num()
1781 if (!bridge) { in vme_bus_num()
1786 return bridge->num; in vme_bus_num()
1790 /* - Bridge Registration --------------------------------------------------- */
1797 /* Common bridge initialization */
1798 struct vme_bridge *vme_init_bridge(struct vme_bridge *bridge) in vme_init_bridge() argument
1800 INIT_LIST_HEAD(&bridge->vme_error_handlers); in vme_init_bridge()
1801 INIT_LIST_HEAD(&bridge->master_resources); in vme_init_bridge()
1802 INIT_LIST_HEAD(&bridge->slave_resources); in vme_init_bridge()
1803 INIT_LIST_HEAD(&bridge->dma_resources); in vme_init_bridge()
1804 INIT_LIST_HEAD(&bridge->lm_resources); in vme_init_bridge()
1805 mutex_init(&bridge->irq_mtx); in vme_init_bridge()
1807 return bridge; in vme_init_bridge()
1811 int vme_register_bridge(struct vme_bridge *bridge) in vme_register_bridge() argument
1820 bridge->num = i; in vme_register_bridge()
1821 INIT_LIST_HEAD(&bridge->devices); in vme_register_bridge()
1822 list_add_tail(&bridge->bus_list, &vme_bus_list); in vme_register_bridge()
1833 void vme_unregister_bridge(struct vme_bridge *bridge) in vme_unregister_bridge() argument
1839 vme_bus_numbers &= ~(1 << bridge->num); in vme_unregister_bridge()
1840 list_for_each_entry_safe(vdev, tmp, &bridge->devices, bridge_list) { in vme_unregister_bridge()
1845 list_del(&bridge->bus_list); in vme_unregister_bridge()
1853 struct vme_bridge *bridge, unsigned int ndevs) in __vme_register_driver_bus() argument
1867 vdev->bridge = bridge; in __vme_register_driver_bus()
1870 vdev->dev.parent = bridge->parent; in __vme_register_driver_bus()
1872 dev_set_name(&vdev->dev, "%s.%u-%u", drv->name, bridge->num, in __vme_register_driver_bus()
1881 list_add_tail(&vdev->bridge_list, &bridge->devices); in __vme_register_driver_bus()
1900 struct vme_bridge *bridge; in __vme_register_driver() local
1904 list_for_each_entry(bridge, &vme_bus_list, bus_list) { in __vme_register_driver()
1907 * and if the bridge is removed, it will have to go through in __vme_register_driver()
1909 * the bridge which in turn tries to acquire vme_buses_lock and in __vme_register_driver()
1912 err = __vme_register_driver_bus(drv, bridge, ndevs); in __vme_register_driver()