Lines Matching refs:rsc

206 	struct fw_rsc_vdev *rsc;  in rproc_alloc_vring()  local
250 rsc = (void *)rproc->table_ptr + rvdev->rsc_offset; in rproc_alloc_vring()
251 rsc->vring[i].da = dma; in rproc_alloc_vring()
252 rsc->vring[i].notifyid = notifyid; in rproc_alloc_vring()
257 rproc_parse_vring(struct rproc_vdev *rvdev, struct fw_rsc_vdev *rsc, int i) in rproc_parse_vring() argument
261 struct fw_rsc_vdev_vring *vring = &rsc->vring[i]; in rproc_parse_vring()
292 struct fw_rsc_vdev *rsc; in rproc_free_vring() local
298 rsc = (void *)rproc->table_ptr + rvring->rvdev->rsc_offset; in rproc_free_vring()
299 rsc->vring[idx].da = 0; in rproc_free_vring()
300 rsc->vring[idx].notifyid = -1; in rproc_free_vring()
330 static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, in rproc_handle_vdev() argument
338 if (sizeof(*rsc) + rsc->num_of_vrings * sizeof(struct fw_rsc_vdev_vring) in rproc_handle_vdev()
339 + rsc->config_len > avail) { in rproc_handle_vdev()
345 if (rsc->reserved[0] || rsc->reserved[1]) { in rproc_handle_vdev()
351 rsc->id, rsc->dfeatures, rsc->config_len, rsc->num_of_vrings); in rproc_handle_vdev()
354 if (rsc->num_of_vrings > ARRAY_SIZE(rvdev->vring)) { in rproc_handle_vdev()
355 dev_err(dev, "too many vrings: %d\n", rsc->num_of_vrings); in rproc_handle_vdev()
366 for (i = 0; i < rsc->num_of_vrings; i++) { in rproc_handle_vdev()
367 ret = rproc_parse_vring(rvdev, rsc, i); in rproc_handle_vdev()
378 ret = rproc_add_virtio_dev(rvdev, rsc->id); in rproc_handle_vdev()
407 static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, in rproc_handle_trace() argument
415 if (sizeof(*rsc) > avail) { in rproc_handle_trace()
421 if (rsc->reserved) { in rproc_handle_trace()
427 ptr = rproc_da_to_va(rproc, rsc->da, rsc->len); in rproc_handle_trace()
438 trace->len = rsc->len; in rproc_handle_trace()
457 rsc->da, rsc->len); in rproc_handle_trace()
487 static int rproc_handle_devmem(struct rproc *rproc, struct fw_rsc_devmem *rsc, in rproc_handle_devmem() argument
498 if (sizeof(*rsc) > avail) { in rproc_handle_devmem()
504 if (rsc->reserved) { in rproc_handle_devmem()
513 ret = iommu_map(rproc->domain, rsc->da, rsc->pa, rsc->len, rsc->flags); in rproc_handle_devmem()
526 mapping->da = rsc->da; in rproc_handle_devmem()
527 mapping->len = rsc->len; in rproc_handle_devmem()
531 rsc->pa, rsc->da, rsc->len); in rproc_handle_devmem()
559 struct fw_rsc_carveout *rsc, in rproc_handle_carveout() argument
569 if (sizeof(*rsc) > avail) { in rproc_handle_carveout()
575 if (rsc->reserved) { in rproc_handle_carveout()
581 rsc->da, rsc->pa, rsc->len, rsc->flags); in rproc_handle_carveout()
587 va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL); in rproc_handle_carveout()
589 dev_err(dev->parent, "dma_alloc_coherent err: %d\n", rsc->len); in rproc_handle_carveout()
595 (unsigned long long)dma, rsc->len); in rproc_handle_carveout()
622 ret = iommu_map(rproc->domain, rsc->da, dma, rsc->len, in rproc_handle_carveout()
623 rsc->flags); in rproc_handle_carveout()
636 mapping->da = rsc->da; in rproc_handle_carveout()
637 mapping->len = rsc->len; in rproc_handle_carveout()
641 rsc->da, (unsigned long long)dma); in rproc_handle_carveout()
661 rsc->pa = dma; in rproc_handle_carveout()
664 carveout->len = rsc->len; in rproc_handle_carveout()
666 carveout->da = rsc->da; in rproc_handle_carveout()
675 dma_free_coherent(dev->parent, rsc->len, va, dma); in rproc_handle_carveout()
681 static int rproc_count_vrings(struct rproc *rproc, struct fw_rsc_vdev *rsc, in rproc_count_vrings() argument
685 rproc->max_notifyid += rsc->num_of_vrings; in rproc_count_vrings()
721 void *rsc = (void *)hdr + sizeof(*hdr); in rproc_handle_resources() local
740 ret = handler(rproc, rsc, offset + sizeof(*hdr), avail); in rproc_handle_resources()