Lines Matching refs:rpdev
125 struct rpmsg_channel *rpdev = to_rpmsg_channel(dev); \
127 return sprintf(buf, format_string, rpdev->path); \
147 struct rpmsg_channel *rpdev = to_rpmsg_channel(dev); in modalias_show() local
149 return sprintf(buf, RPMSG_DEVICE_MODALIAS_FMT "\n", rpdev->id.name); in modalias_show()
162 static inline int rpmsg_id_match(const struct rpmsg_channel *rpdev, in rpmsg_id_match() argument
165 return strncmp(id->name, rpdev->id.name, RPMSG_NAME_SIZE) == 0; in rpmsg_id_match()
171 struct rpmsg_channel *rpdev = to_rpmsg_channel(dev); in rpmsg_dev_match() local
177 if (rpmsg_id_match(rpdev, &ids[i])) in rpmsg_dev_match()
185 struct rpmsg_channel *rpdev = to_rpmsg_channel(dev); in rpmsg_uevent() local
188 rpdev->id.name); in rpmsg_uevent()
213 struct rpmsg_channel *rpdev, rpmsg_rx_cb_t cb, in __rpmsg_create_ept() argument
218 struct device *dev = rpdev ? &rpdev->dev : &vrp->vdev->dev; in __rpmsg_create_ept()
232 ept->rpdev = rpdev; in __rpmsg_create_ept()
308 struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_channel *rpdev, in rpmsg_create_ept() argument
311 return __rpmsg_create_ept(rpdev->vrp, rpdev, cb, priv, addr); in rpmsg_create_ept()
350 __rpmsg_destroy_ept(ept->rpdev->vrp, ept); in rpmsg_destroy_ept()
364 struct rpmsg_channel *rpdev = to_rpmsg_channel(dev); in rpmsg_dev_probe() local
365 struct rpmsg_driver *rpdrv = to_rpmsg_driver(rpdev->dev.driver); in rpmsg_dev_probe()
366 struct virtproc_info *vrp = rpdev->vrp; in rpmsg_dev_probe()
370 ept = rpmsg_create_ept(rpdev, rpdrv->callback, NULL, rpdev->src); in rpmsg_dev_probe()
377 rpdev->ept = ept; in rpmsg_dev_probe()
378 rpdev->src = ept->addr; in rpmsg_dev_probe()
380 err = rpdrv->probe(rpdev); in rpmsg_dev_probe()
388 if (rpdev->announce && in rpmsg_dev_probe()
392 strncpy(nsm.name, rpdev->id.name, RPMSG_NAME_SIZE); in rpmsg_dev_probe()
393 nsm.addr = rpdev->src; in rpmsg_dev_probe()
396 err = rpmsg_sendto(rpdev, &nsm, sizeof(nsm), RPMSG_NS_ADDR); in rpmsg_dev_probe()
407 struct rpmsg_channel *rpdev = to_rpmsg_channel(dev); in rpmsg_dev_remove() local
408 struct rpmsg_driver *rpdrv = to_rpmsg_driver(rpdev->dev.driver); in rpmsg_dev_remove()
409 struct virtproc_info *vrp = rpdev->vrp; in rpmsg_dev_remove()
413 if (rpdev->announce && in rpmsg_dev_remove()
417 strncpy(nsm.name, rpdev->id.name, RPMSG_NAME_SIZE); in rpmsg_dev_remove()
418 nsm.addr = rpdev->src; in rpmsg_dev_remove()
421 err = rpmsg_sendto(rpdev, &nsm, sizeof(nsm), RPMSG_NS_ADDR); in rpmsg_dev_remove()
426 rpdrv->remove(rpdev); in rpmsg_dev_remove()
428 rpmsg_destroy_ept(rpdev->ept); in rpmsg_dev_remove()
469 struct rpmsg_channel *rpdev = to_rpmsg_channel(dev); in rpmsg_release_device() local
471 kfree(rpdev); in rpmsg_release_device()
482 struct rpmsg_channel *rpdev = to_rpmsg_channel(dev); in rpmsg_channel_match() local
484 if (chinfo->src != RPMSG_ADDR_ANY && chinfo->src != rpdev->src) in rpmsg_channel_match()
487 if (chinfo->dst != RPMSG_ADDR_ANY && chinfo->dst != rpdev->dst) in rpmsg_channel_match()
490 if (strncmp(chinfo->name, rpdev->id.name, RPMSG_NAME_SIZE)) in rpmsg_channel_match()
505 struct rpmsg_channel *rpdev; in rpmsg_create_channel() local
519 rpdev = kzalloc(sizeof(struct rpmsg_channel), GFP_KERNEL); in rpmsg_create_channel()
520 if (!rpdev) { in rpmsg_create_channel()
525 rpdev->vrp = vrp; in rpmsg_create_channel()
526 rpdev->src = chinfo->src; in rpmsg_create_channel()
527 rpdev->dst = chinfo->dst; in rpmsg_create_channel()
533 rpdev->announce = rpdev->src != RPMSG_ADDR_ANY ? true : false; in rpmsg_create_channel()
535 strncpy(rpdev->id.name, chinfo->name, RPMSG_NAME_SIZE); in rpmsg_create_channel()
538 dev_set_name(&rpdev->dev, "rpmsg%d", rpmsg_dev_index++); in rpmsg_create_channel()
540 rpdev->dev.parent = &vrp->vdev->dev; in rpmsg_create_channel()
541 rpdev->dev.bus = &rpmsg_bus; in rpmsg_create_channel()
542 rpdev->dev.release = rpmsg_release_device; in rpmsg_create_channel()
544 ret = device_register(&rpdev->dev); in rpmsg_create_channel()
547 put_device(&rpdev->dev); in rpmsg_create_channel()
551 return rpdev; in rpmsg_create_channel()
689 int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst, in rpmsg_send_offchannel_raw() argument
692 struct virtproc_info *vrp = rpdev->vrp; in rpmsg_send_offchannel_raw()
693 struct device *dev = &rpdev->dev; in rpmsg_send_offchannel_raw()
836 ept->cb(ept->rpdev, msg->data, msg->len, ept->priv, in rpmsg_recv_done()
878 static void rpmsg_ns_cb(struct rpmsg_channel *rpdev, void *data, int len, in rpmsg_ns_cb() argument
903 if (rpdev) { in rpmsg_ns_cb()