aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rpmsg.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-03rpmsg: Switch to SPDX license identifierSuman Anna1-26/+1
Use the appropriate SPDX license identifier in the rpmsg core source files and drop the previous boilerplate license text. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-11-28the rest of drivers/*: annotate ->poll() instancesAl Viro1-2/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-01-18rpmsg: Introduce "poll" to endpoint opsBjorn Andersson1-0/+13
This allows rpmsg backends to implement polling of the outgoing buffer, which provides poll support to user space when using the rpmsg character device. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-10-31rpmsg: Provide function stubs for APIBjorn Andersson1-10/+113
Provide function stubs for the rpmsg API to allow clients to be compile tested without having CONFIG_RPMSG enabled. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-10-31rpmsg: Introduce a driver override mechanismBjorn Andersson1-0/+2
Similar to other subsystems it's useful to provide a mechanism to force a specific driver match on a device, so introduce this. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: Allow callback to return errorsBjorn Andersson1-2/+2
Some rpmsg backends support holding on to and redelivering messages upon failed handling of them, so provide a way for the callback to report and error and allow the backends to handle this. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: Move virtio specifics from public headerBjorn Andersson1-52/+0
Move virtio rpmsg implementation details from the public header file to the virtio rpmsg implementation. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: virtio: Hide vrp pointer from the public APIBjorn Andersson1-3/+0
Create a container struct virtio_rpmsg_channel around the rpmsg_channel to keep virtio backend information separate from the rpmsg and public API. This makes the public structures independant of virtio. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: Hide rpmsg indirection tablesBjorn Andersson1-47/+0
Move the device and endpoint indirection tables to the rpmsg internal header file, to hide them from the public API. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: Move endpoint related interface to rpmsg coreBjorn Andersson1-142/+6
Move the rpmsg_send() and rpmsg_destroy_ept() interface to the rpmsg core, so that we eventually can hide the rpmsg_endpoint ops from the public API. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: Indirection table for rpmsg_endpoint operationsBjorn Andersson1-24/+38
Add indirection table for rpmsg_endpoint related operations and move virtio implementation behind this, this finishes of the decoupling of the virtio implementation from the public API. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: Introduce indirection table for rpmsg_device operationsBjorn Andersson1-0/+23
To allow for multiple backend implementations add an indireection table for rpmsg_device related operations and move the virtio implementation behind this table. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: Clean up rpmsg device vs channel namingBjorn Andersson1-15/+17
The rpmsg device representing struct is called rpmsg_channel and the variable name used throughout is rpdev, with the communication happening on endpoints it's clearer to just call this a "device" in a public API. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: Make rpmsg_create_ept() take channel_info structBjorn Andersson1-1/+14
As we introduce support for additional rpmsg backends, some of these only supports point-to-point "links" represented by a name. By making rpmsg_create_ept() take a channel_info struct we allow for these backends to either be passed a source address, a destination address or a name identifier. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-09-08rpmsg: rpmsg_send() operations takes rpmsg_endpointBjorn Andersson1-30/+40
The rpmsg_send() operations has been taking a rpmsg_device, but this forces users of secondary rpmsg_endpoints to use the rpmsg_sendto() interface - by extracting source and destination from the given data structures. If we instead pass the rpmsg_endpoint to these functions a service can use rpmsg_sendto() to respond to messages, even on secondary endpoints. In addition this would allow us to support operations on multiple channels in future backends that does not support off-channel operations. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-08-12rpmsg: Drop prototypes for non-existing functionsBjorn Andersson1-2/+0
The (un)register_rpmsg_device() functions never made it to mainline, so drop them for now. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-08-12rpmsg: align code with open parenthesisAnna, Suman1-3/+3
This patch fixes most of the existing alignment checkpatch check warnings of the type "Alignment should match open parenthesis" in the virtio rpmsg bus code. A couple of them have been left as is to not exceed the 80-char limit. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-05-06rpmsg: add helper macro module_rpmsg_driverAndrew F. Davis1-0/+12
This patch introduces the module_rpmsg_driver macro which is a convenience macro for rpmsg driver modules similar to module_platform_driver. It is intended to be used by drivers which init/exit section does nothing but register/unregister the rpmsg driver. By using this macro it is possible to eliminate a few lines of boilerplate code per rpmsg driver. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-05-06rpmsg: add THIS_MODULE to rpmsg_driver in rpmsg coreAndrew F. Davis1-1/+5
Add register_rpmsg_driver helper macro that adds THIS_MODULE to rpmsg_driver for the registering driver. We rename and modify the existing register_rpmsg_driver to enable this. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2012-07-04rpmsg: make sure inflight messages don't invoke just-removed callbacksOhad Ben-Cohen1-0/+3
When inbound messages arrive, rpmsg core looks up their associated endpoint (by destination address) and then invokes their callback. We've made sure that endpoints will never be de-allocated after they were found by rpmsg core, but we also need to protect against the (rare) scenario where the rpmsg driver was just removed, and its callback function isn't available anymore. This is achieved by introducing a callback mutex, which must be taken before the callback is invoked, and, obviously, before it is removed. Cc: stable <stable@vger.kernel.org> Reported-by: Fernando Guzman Lugo <fernando.lugo@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
2012-07-04rpmsg: avoid premature deallocation of endpointsOhad Ben-Cohen1-0/+3
When an inbound message arrives, the rpmsg core looks up its associated endpoint and invokes the registered callback. If a message arrives while its endpoint is being removed (because the rpmsg driver was removed, or a recovery of a remote processor has kicked in) we must ensure atomicity, i.e.: - Either the ept is removed before it is found or - The ept is found but will not be freed until the callback returns This is achieved by maintaining a per-ept reference count, which, when drops to zero, will trigger deallocation of the ept. With this in hand, it is now forbidden to directly deallocate epts once they have been added to the endpoints idr. Cc: stable <stable@vger.kernel.org> Reported-by: Fernando Guzman Lugo <fernando.lugo@ti.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
2012-02-08rpmsg: add virtio-based remote processor messaging busOhad Ben-Cohen1-0/+326
Add a virtio-based inter-processor communication bus, which enables kernel drivers to communicate with entities, running on remote processors, over shared memory using a simple messaging protocol. Every pair of AMP processors share two vrings, which are used to send and receive the messages over shared memory. The header of every message sent on the rpmsg bus contains src and dst addresses, which make it possible to multiplex several rpmsg channels on the same vring. Every rpmsg channel is a device on this bus. When a channel is added, and an appropriate rpmsg driver is found and probed, it is also assigned a local rpmsg address, which is then bound to the driver's callback. When inbound messages carry the local address of a bound driver, its callback is invoked by the bus. This patch provides a kernel interface only; user space interfaces will be later exposed by kernel users of this rpmsg bus. Designed with Brian Swetland <swetland@google.com>. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> (virtio_ids.h) Cc: Brian Swetland <swetland@google.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Tony Lindgren <tony@atomide.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Greg KH <greg@kroah.com> Cc: Stephen Boyd <sboyd@codeaurora.org>