Lines Matching refs:rsc

186 	struct fw_rsc_vdev *rsc;  in rproc_alloc_vring()  local
230 rsc = (void *)rproc->table_ptr + rvdev->rsc_offset; in rproc_alloc_vring()
231 rsc->vring[i].da = dma; in rproc_alloc_vring()
232 rsc->vring[i].notifyid = notifyid; in rproc_alloc_vring()
237 rproc_parse_vring(struct rproc_vdev *rvdev, struct fw_rsc_vdev *rsc, int i) in rproc_parse_vring() argument
241 struct fw_rsc_vdev_vring *vring = &rsc->vring[i]; in rproc_parse_vring()
272 struct fw_rsc_vdev *rsc; in rproc_free_vring() local
278 rsc = (void *)rproc->table_ptr + rvring->rvdev->rsc_offset; in rproc_free_vring()
279 rsc->vring[idx].da = 0; in rproc_free_vring()
280 rsc->vring[idx].notifyid = -1; in rproc_free_vring()
310 static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, in rproc_handle_vdev() argument
318 if (sizeof(*rsc) + rsc->num_of_vrings * sizeof(struct fw_rsc_vdev_vring) in rproc_handle_vdev()
319 + rsc->config_len > avail) { in rproc_handle_vdev()
325 if (rsc->reserved[0] || rsc->reserved[1]) { in rproc_handle_vdev()
331 rsc->id, rsc->dfeatures, rsc->config_len, rsc->num_of_vrings); in rproc_handle_vdev()
334 if (rsc->num_of_vrings > ARRAY_SIZE(rvdev->vring)) { in rproc_handle_vdev()
335 dev_err(dev, "too many vrings: %d\n", rsc->num_of_vrings); in rproc_handle_vdev()
346 for (i = 0; i < rsc->num_of_vrings; i++) { in rproc_handle_vdev()
347 ret = rproc_parse_vring(rvdev, rsc, i); in rproc_handle_vdev()
358 ret = rproc_add_virtio_dev(rvdev, rsc->id); in rproc_handle_vdev()
387 static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, in rproc_handle_trace() argument
395 if (sizeof(*rsc) > avail) { in rproc_handle_trace()
401 if (rsc->reserved) { in rproc_handle_trace()
407 ptr = rproc_da_to_va(rproc, rsc->da, rsc->len); in rproc_handle_trace()
420 trace->len = rsc->len; in rproc_handle_trace()
439 rsc->da, rsc->len); in rproc_handle_trace()
469 static int rproc_handle_devmem(struct rproc *rproc, struct fw_rsc_devmem *rsc, in rproc_handle_devmem() argument
480 if (sizeof(*rsc) > avail) { in rproc_handle_devmem()
486 if (rsc->reserved) { in rproc_handle_devmem()
497 ret = iommu_map(rproc->domain, rsc->da, rsc->pa, rsc->len, rsc->flags); in rproc_handle_devmem()
510 mapping->da = rsc->da; in rproc_handle_devmem()
511 mapping->len = rsc->len; in rproc_handle_devmem()
515 rsc->pa, rsc->da, rsc->len); in rproc_handle_devmem()
543 struct fw_rsc_carveout *rsc, in rproc_handle_carveout() argument
553 if (sizeof(*rsc) > avail) { in rproc_handle_carveout()
559 if (rsc->reserved) { in rproc_handle_carveout()
565 rsc->da, rsc->pa, rsc->len, rsc->flags); in rproc_handle_carveout()
573 va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL); in rproc_handle_carveout()
575 dev_err(dev->parent, "dma_alloc_coherent err: %d\n", rsc->len); in rproc_handle_carveout()
581 (unsigned long long)dma, rsc->len); in rproc_handle_carveout()
608 ret = iommu_map(rproc->domain, rsc->da, dma, rsc->len, in rproc_handle_carveout()
609 rsc->flags); in rproc_handle_carveout()
622 mapping->da = rsc->da; in rproc_handle_carveout()
623 mapping->len = rsc->len; in rproc_handle_carveout()
627 rsc->da, (unsigned long long)dma); in rproc_handle_carveout()
647 rsc->pa = dma; in rproc_handle_carveout()
650 carveout->len = rsc->len; in rproc_handle_carveout()
652 carveout->da = rsc->da; in rproc_handle_carveout()
661 dma_free_coherent(dev->parent, rsc->len, va, dma); in rproc_handle_carveout()
667 static int rproc_count_vrings(struct rproc *rproc, struct fw_rsc_vdev *rsc, in rproc_count_vrings() argument
671 rproc->max_notifyid += rsc->num_of_vrings; in rproc_count_vrings()
707 void *rsc = (void *)hdr + sizeof(*hdr); in rproc_handle_resources() local
726 ret = handler(rproc, rsc, offset + sizeof(*hdr), avail); in rproc_handle_resources()