Lines Matching refs:rsc
209 struct fw_rsc_vdev *rsc; in rproc_alloc_vring() local
257 rsc = (void *)rproc->table_ptr + rvdev->rsc_offset; in rproc_alloc_vring()
258 rsc->vring[i].da = dma; in rproc_alloc_vring()
259 rsc->vring[i].notifyid = notifyid; in rproc_alloc_vring()
264 rproc_parse_vring(struct rproc_vdev *rvdev, struct fw_rsc_vdev *rsc, int i) in rproc_parse_vring() argument
268 struct fw_rsc_vdev_vring *vring = &rsc->vring[i]; in rproc_parse_vring()
293 struct fw_rsc_vdev *rsc; in rproc_free_vring() local
299 rsc = (void *)rproc->table_ptr + rvring->rvdev->rsc_offset; in rproc_free_vring()
300 rsc->vring[idx].da = 0; in rproc_free_vring()
301 rsc->vring[idx].notifyid = -1; in rproc_free_vring()
345 static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, in rproc_handle_vdev() argument
353 if (sizeof(*rsc) + rsc->num_of_vrings * sizeof(struct fw_rsc_vdev_vring) in rproc_handle_vdev()
354 + rsc->config_len > avail) { in rproc_handle_vdev()
360 if (rsc->reserved[0] || rsc->reserved[1]) { in rproc_handle_vdev()
366 rsc->id, rsc->dfeatures, rsc->config_len, rsc->num_of_vrings); in rproc_handle_vdev()
369 if (rsc->num_of_vrings > ARRAY_SIZE(rvdev->vring)) { in rproc_handle_vdev()
370 dev_err(dev, "too many vrings: %d\n", rsc->num_of_vrings); in rproc_handle_vdev()
380 rvdev->id = rsc->id; in rproc_handle_vdev()
384 for (i = 0; i < rsc->num_of_vrings; i++) { in rproc_handle_vdev()
385 ret = rproc_parse_vring(rvdev, rsc, i); in rproc_handle_vdev()
394 for (i = 0; i < rsc->num_of_vrings; i++) { in rproc_handle_vdev()
453 static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, in rproc_handle_trace() argument
461 if (sizeof(*rsc) > avail) { in rproc_handle_trace()
467 if (rsc->reserved) { in rproc_handle_trace()
473 ptr = rproc_da_to_va(rproc, rsc->da, rsc->len); in rproc_handle_trace()
484 trace->len = rsc->len; in rproc_handle_trace()
503 name, ptr, rsc->da, rsc->len); in rproc_handle_trace()
533 static int rproc_handle_devmem(struct rproc *rproc, struct fw_rsc_devmem *rsc, in rproc_handle_devmem() argument
544 if (sizeof(*rsc) > avail) { in rproc_handle_devmem()
550 if (rsc->reserved) { in rproc_handle_devmem()
559 ret = iommu_map(rproc->domain, rsc->da, rsc->pa, rsc->len, rsc->flags); in rproc_handle_devmem()
572 mapping->da = rsc->da; in rproc_handle_devmem()
573 mapping->len = rsc->len; in rproc_handle_devmem()
577 rsc->pa, rsc->da, rsc->len); in rproc_handle_devmem()
605 struct fw_rsc_carveout *rsc, in rproc_handle_carveout() argument
614 if (sizeof(*rsc) > avail) { in rproc_handle_carveout()
620 if (rsc->reserved) { in rproc_handle_carveout()
626 rsc->name, rsc->da, rsc->pa, rsc->len, rsc->flags); in rproc_handle_carveout()
632 va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL); in rproc_handle_carveout()
635 "failed to allocate dma memory: len 0x%x\n", rsc->len); in rproc_handle_carveout()
641 va, &dma, rsc->len); in rproc_handle_carveout()
667 ret = iommu_map(rproc->domain, rsc->da, dma, rsc->len, in rproc_handle_carveout()
668 rsc->flags); in rproc_handle_carveout()
681 mapping->da = rsc->da; in rproc_handle_carveout()
682 mapping->len = rsc->len; in rproc_handle_carveout()
686 rsc->da, &dma); in rproc_handle_carveout()
706 rsc->pa = dma; in rproc_handle_carveout()
709 carveout->len = rsc->len; in rproc_handle_carveout()
711 carveout->da = rsc->da; in rproc_handle_carveout()
720 dma_free_coherent(dev->parent, rsc->len, va, dma); in rproc_handle_carveout()
752 void *rsc = (void *)hdr + sizeof(*hdr); in rproc_handle_resources() local
771 ret = handler(rproc, rsc, offset + sizeof(*hdr), avail); in rproc_handle_resources()