Lines Matching defs:rcdev

191 dpaa2_rc_get_resource_list(device_t rcdev, device_t child)
199 dpaa2_rc_delete_resource(device_t rcdev, device_t child, int type, int rid)
205 if (device_get_parent(child) != rcdev)
217 device_printf(rcdev, "%s: resource still owned by "
222 resource_list_unreserve(rl, rcdev, child, type, rid);
228 dpaa2_rc_alloc_multi_resource(device_t rcdev, device_t child, int type, int *rid,
249 return (resource_list_alloc(rl, rcdev, child, type, rid,
254 dpaa2_rc_alloc_resource(device_t rcdev, device_t child, int type, int *rid,
257 if (device_get_parent(child) != rcdev)
258 return (BUS_ALLOC_RESOURCE(device_get_parent(rcdev), child,
261 return (dpaa2_rc_alloc_multi_resource(rcdev, child, type, rid, start,
266 dpaa2_rc_release_resource(device_t rcdev, device_t child, struct resource *r)
271 if (device_get_parent(child) != rcdev)
272 return (BUS_RELEASE_RESOURCE(device_get_parent(rcdev), child,
277 return (resource_list_release(rl, rcdev, child, r));
281 dpaa2_rc_child_deleted(device_t rcdev, device_t child)
302 resource_list_unreserve(rl, rcdev, child, rle->type,
313 dpaa2_rc_child_detached(device_t rcdev, device_t child)
321 if (resource_list_release_active(rl, rcdev, child, SYS_RES_IRQ) != 0)
326 PCI_RELEASE_MSI(rcdev, child);
328 if (resource_list_release_active(rl, rcdev, child, SYS_RES_MEMORY) != 0)
333 dpaa2_rc_setup_intr(device_t rcdev, device_t child, struct resource *irq,
343 error = bus_generic_setup_intr(rcdev, child, irq, flags, filter, intr,
346 device_printf(rcdev, "%s: bus_generic_setup_intr() failed: "
352 if (device_get_parent(child) != rcdev) {
360 device_printf(rcdev, "%s: cannot setup interrupt with "
374 error = PCIB_MAP_MSI(device_get_parent(rcdev), child,
377 device_printf(rcdev, "%s: PCIB_MAP_MSI failed: "
379 (void)bus_generic_teardown_intr(rcdev, child, irq,
385 error = dpaa2_rc_configure_irq(rcdev, child, rid, addr, data);
387 device_printf(rcdev, "%s: failed to configure IRQ for "
400 dpaa2_rc_teardown_intr(device_t rcdev, device_t child, struct resource *irq,
411 if (device_get_parent(child) != rcdev)
412 return(bus_generic_teardown_intr(rcdev, child, irq, cookie));
417 device_printf(rcdev, "%s: cannot teardown interrupt "
429 error = bus_generic_teardown_intr(rcdev, child, irq, cookie);
437 dpaa2_rc_print_child(device_t rcdev, device_t child)
443 retval += bus_print_child_header(rcdev, child);
457 retval += bus_print_child_domain(rcdev, child);
458 retval += bus_print_child_footer(rcdev, child);
475 dpaa2_rc_alloc_msi(device_t rcdev, device_t child, int *count)
477 struct dpaa2_devinfo *rcinfo = device_get_ivars(rcdev);
505 error = PCIB_ALLOC_MSI(device_get_parent(rcdev), child, actual,
572 dpaa2_rc_release_msi(device_t rcdev, device_t child)
574 struct dpaa2_devinfo *rcinfo = device_get_ivars(rcdev);
601 PCIB_RELEASE_MSI(device_get_parent(rcdev), child, dinfo->msi.msi_alloc,
615 dpaa2_rc_msi_count(device_t rcdev, device_t child)
623 dpaa2_rc_get_id(device_t rcdev, device_t child, enum pci_id_type type,
626 struct dpaa2_devinfo *rcinfo = device_get_ivars(rcdev);
631 return (PCIB_GET_ID(device_get_parent(rcdev), child, type, id));
2743 device_t rcdev = sc->dev;
2745 struct dpaa2_devinfo *rcinfo = device_get_ivars(rcdev);
2756 rc = DPAA2_CMD_MNG_GET_VERSION(rcdev, child, &cmd, &major, &minor, &rev);
2758 device_printf(rcdev, "%s: failed to get MC firmware version: "
2762 device_printf(rcdev, "MC firmware version: %u.%u.%u\n", major, minor,
2766 rc = DPAA2_CMD_MNG_GET_CONTAINER_ID(rcdev, child, &cmd, &sc->cont_id);
2768 device_printf(rcdev, "%s: failed to get container id: "
2773 device_printf(rcdev, "Resource container ID: %u\n", sc->cont_id);
2777 rc = DPAA2_CMD_RC_OPEN(rcdev, child, &cmd, sc->cont_id, &rc_token);
2779 device_printf(rcdev, "%s: failed to open container: cont_id=%u, "
2785 rc = DPAA2_CMD_RC_GET_OBJ_COUNT(rcdev, child, &cmd, &obj_count);
2787 device_printf(rcdev, "%s: failed to count objects in container: "
2789 (void)DPAA2_CMD_RC_CLOSE(rcdev, child, &cmd);
2793 device_printf(rcdev, "Objects in container: %u\n", obj_count);
2796 rc = DPAA2_CMD_RC_GET_ATTRIBUTES(rcdev, child, &cmd, &dprc_attr);
2798 device_printf(rcdev, "%s: failed to get attributes of the "
2801 DPAA2_CMD_RC_CLOSE(rcdev, child, &cmd);
2805 device_printf(rcdev, "Isolation context ID: %u\n",
2819 rc = DPAA2_CMD_RC_GET_OBJ(rcdev, child, &cmd, i, &obj);
2829 bus_identify_children(rcdev);
2830 bus_attach_children(rcdev);
2834 rc = DPAA2_CMD_RC_GET_OBJ(rcdev, child, &cmd, i, &obj);
2837 device_printf(rcdev, "%s: skip unsupported "
2841 device_printf(rcdev, "%s: failed to get "
2853 bus_identify_children(rcdev);
2854 bus_attach_children(rcdev);
2858 rc = DPAA2_CMD_RC_GET_OBJ(rcdev, child, &cmd, i, &obj);
2860 device_printf(rcdev, "%s: skip unsupported DPAA2 "
2864 device_printf(rcdev, "%s: failed to get object: "
2871 DPAA2_CMD_RC_CLOSE(rcdev, child, &cmd);
2874 bus_identify_children(rcdev);
2875 bus_attach_children(rcdev);
2886 device_t rcdev, dev;
2895 rcdev = sc->dev;
2896 rcinfo = device_get_ivars(rcdev);
2908 dev = device_add_child(rcdev, devclass, -1);
2910 device_printf(rcdev, "%s: failed to add a device for DPAA2 "
2920 device_printf(rcdev, "%s: failed to allocate dpaa2_devinfo "
2927 dinfo->pdev = rcdev;
2959 error = dpaa2_rc_add_res(rcdev, dev, res_spec->type, &rid,
2962 device_printf(rcdev, "%s: dpaa2_rc_add_res() failed: "
2989 device_t rcdev, dev, child;
2998 rcdev = sc->dev;
3000 rcinfo = device_get_ivars(rcdev);
3034 dev = device_add_child(rcdev, devclass, -1);
3036 device_printf(rcdev, "%s: failed to add a device for DPAA2 "
3046 device_printf(rcdev, "%s: failed to allocate dpaa2_devinfo "
3053 dinfo->pdev = rcdev;
3071 error = DPAA2_CMD_RC_GET_OBJ_REGION(rcdev, child, cmd, obj->id,
3074 device_printf(rcdev, "%s: failed to obtain memory "
3093 error = dpaa2_rc_add_res(rcdev, dev, res_spec->type, &rid,
3096 device_printf(rcdev, "%s: dpaa2_rc_add_res() failed: "
3101 error = DPAA2_MC_MANAGE_DEV(rcdev, dev, flags);
3103 device_printf(rcdev, "%s: failed to add a managed DPAA2 device: "
3116 dpaa2_rc_configure_irq(device_t rcdev, device_t child, int rid, uint64_t addr,
3127 if (device_get_parent(child) == rcdev && rid >= 1) {
3128 rcinfo = device_get_ivars(rcdev);
3131 rc = DPAA2_CMD_RC_OPEN(rcdev, child, &cmd, rcinfo->id,
3134 device_printf(rcdev, "%s: failed to open DPRC: "
3139 rc = DPAA2_CMD_RC_SET_OBJ_IRQ(rcdev, child, &cmd, rid - 1, addr,
3142 device_printf(rcdev, "%s: failed to setup IRQ: "
3147 rc = DPAA2_CMD_RC_CLOSE(rcdev, child, &cmd);
3149 device_printf(rcdev, "%s: failed to close DPRC: "
3287 dpaa2_rc_add_res(device_t rcdev, device_t child, enum dpaa2_dev_type devtype,
3297 error = DPAA2_MC_GET_FREE_DEV(rcdev, &dpaa2_dev, devtype);
3299 device_printf(rcdev, "%s: failed to obtain a free %s (rid=%d) "
3307 error = DPAA2_MC_GET_SHARED_DEV(rcdev, &dpaa2_dev, devtype);
3309 device_printf(rcdev, "%s: failed to obtain a shared "
3323 res = resource_list_reserve(&dinfo->resources, rcdev, child, devtype,
3327 device_printf(rcdev, "%s: failed to reserve %s (rid=%d) for: %s "
3335 error = DPAA2_MC_RESERVE_DEV(rcdev, dpaa2_dev, devtype);
3337 device_printf(rcdev, "%s: failed to reserve a shared "