diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2016-09-01 18:28:01 -0400 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2016-09-09 01:15:22 -0400 |
commit | c9bd6f422090b874b5877b4cedcd7757eac33117 (patch) | |
tree | 6ed5722a4f4d050091007a4ff63bb936c85f459a /include/linux/rpmsg.h | |
parent | 8a228ecfe086b84e237a8d78be079e286e1ea67b (diff) |
rpmsg: Move endpoint related interface to rpmsg core
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>
Diffstat (limited to 'include/linux/rpmsg.h')
-rw-r--r-- | include/linux/rpmsg.h | 148 |
1 files changed, 6 insertions, 142 deletions
diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h index d54458effd54..99efd598590e 100644 --- a/include/linux/rpmsg.h +++ b/include/linux/rpmsg.h | |||
@@ -259,150 +259,14 @@ struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *, | |||
259 | module_driver(__rpmsg_driver, register_rpmsg_driver, \ | 259 | module_driver(__rpmsg_driver, register_rpmsg_driver, \ |
260 | unregister_rpmsg_driver) | 260 | unregister_rpmsg_driver) |
261 | 261 | ||
262 | /** | 262 | int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len); |
263 | * rpmsg_send() - send a message across to the remote processor | 263 | int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); |
264 | * @ept: the rpmsg endpoint | ||
265 | * @data: payload of message | ||
266 | * @len: length of payload | ||
267 | * | ||
268 | * This function sends @data of length @len on the @ept endpoint. | ||
269 | * The message will be sent to the remote processor which the @ept | ||
270 | * endpoint belongs to, using @ept's address and its associated rpmsg | ||
271 | * device destination addresses. | ||
272 | * In case there are no TX buffers available, the function will block until | ||
273 | * one becomes available, or a timeout of 15 seconds elapses. When the latter | ||
274 | * happens, -ERESTARTSYS is returned. | ||
275 | * | ||
276 | * Can only be called from process context (for now). | ||
277 | * | ||
278 | * Returns 0 on success and an appropriate error value on failure. | ||
279 | */ | ||
280 | static inline int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len) | ||
281 | { | ||
282 | return ept->ops->send(ept, data, len); | ||
283 | } | ||
284 | |||
285 | /** | ||
286 | * rpmsg_sendto() - send a message across to the remote processor, specify dst | ||
287 | * @ept: the rpmsg endpoint | ||
288 | * @data: payload of message | ||
289 | * @len: length of payload | ||
290 | * @dst: destination address | ||
291 | * | ||
292 | * This function sends @data of length @len to the remote @dst address. | ||
293 | * The message will be sent to the remote processor which the @ept | ||
294 | * endpoint belongs to, using @ept's address as source. | ||
295 | * In case there are no TX buffers available, the function will block until | ||
296 | * one becomes available, or a timeout of 15 seconds elapses. When the latter | ||
297 | * happens, -ERESTARTSYS is returned. | ||
298 | * | ||
299 | * Can only be called from process context (for now). | ||
300 | * | ||
301 | * Returns 0 on success and an appropriate error value on failure. | ||
302 | */ | ||
303 | static inline | ||
304 | int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst) | ||
305 | { | ||
306 | return ept->ops->sendto(ept, data, len, dst); | ||
307 | } | ||
308 | |||
309 | /** | ||
310 | * rpmsg_send_offchannel() - send a message using explicit src/dst addresses | ||
311 | * @ept: the rpmsg endpoint | ||
312 | * @src: source address | ||
313 | * @dst: destination address | ||
314 | * @data: payload of message | ||
315 | * @len: length of payload | ||
316 | * | ||
317 | * This function sends @data of length @len to the remote @dst address, | ||
318 | * and uses @src as the source address. | ||
319 | * The message will be sent to the remote processor which the @ept | ||
320 | * endpoint belongs to. | ||
321 | * In case there are no TX buffers available, the function will block until | ||
322 | * one becomes available, or a timeout of 15 seconds elapses. When the latter | ||
323 | * happens, -ERESTARTSYS is returned. | ||
324 | * | ||
325 | * Can only be called from process context (for now). | ||
326 | * | ||
327 | * Returns 0 on success and an appropriate error value on failure. | ||
328 | */ | ||
329 | static inline | ||
330 | int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, | 264 | int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, |
331 | void *data, int len) | 265 | void *data, int len); |
332 | { | ||
333 | return ept->ops->send_offchannel(ept, src, dst, data, len); | ||
334 | } | ||
335 | 266 | ||
336 | /** | 267 | int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len); |
337 | * rpmsg_send() - send a message across to the remote processor | 268 | int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); |
338 | * @ept: the rpmsg endpoint | ||
339 | * @data: payload of message | ||
340 | * @len: length of payload | ||
341 | * | ||
342 | * This function sends @data of length @len on the @ept endpoint. | ||
343 | * The message will be sent to the remote processor which the @ept | ||
344 | * endpoint belongs to, using @ept's address as source and its associated | ||
345 | * rpdev's address as destination. | ||
346 | * In case there are no TX buffers available, the function will immediately | ||
347 | * return -ENOMEM without waiting until one becomes available. | ||
348 | * | ||
349 | * Can only be called from process context (for now). | ||
350 | * | ||
351 | * Returns 0 on success and an appropriate error value on failure. | ||
352 | */ | ||
353 | static inline | ||
354 | int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len) | ||
355 | { | ||
356 | return ept->ops->trysend(ept, data, len); | ||
357 | } | ||
358 | |||
359 | /** | ||
360 | * rpmsg_sendto() - send a message across to the remote processor, specify dst | ||
361 | * @ept: the rpmsg endpoint | ||
362 | * @data: payload of message | ||
363 | * @len: length of payload | ||
364 | * @dst: destination address | ||
365 | * | ||
366 | * This function sends @data of length @len to the remote @dst address. | ||
367 | * The message will be sent to the remote processor which the @ept | ||
368 | * endpoint belongs to, using @ept's address as source. | ||
369 | * In case there are no TX buffers available, the function will immediately | ||
370 | * return -ENOMEM without waiting until one becomes available. | ||
371 | * | ||
372 | * Can only be called from process context (for now). | ||
373 | * | ||
374 | * Returns 0 on success and an appropriate error value on failure. | ||
375 | */ | ||
376 | static inline | ||
377 | int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst) | ||
378 | { | ||
379 | return ept->ops->trysendto(ept, data, len, dst); | ||
380 | } | ||
381 | |||
382 | /** | ||
383 | * rpmsg_send_offchannel() - send a message using explicit src/dst addresses | ||
384 | * @ept: the rpmsg endpoint | ||
385 | * @src: source address | ||
386 | * @dst: destination address | ||
387 | * @data: payload of message | ||
388 | * @len: length of payload | ||
389 | * | ||
390 | * This function sends @data of length @len to the remote @dst address, | ||
391 | * and uses @src as the source address. | ||
392 | * The message will be sent to the remote processor which the @ept | ||
393 | * endpoint belongs to. | ||
394 | * In case there are no TX buffers available, the function will immediately | ||
395 | * return -ENOMEM without waiting until one becomes available. | ||
396 | * | ||
397 | * Can only be called from process context (for now). | ||
398 | * | ||
399 | * Returns 0 on success and an appropriate error value on failure. | ||
400 | */ | ||
401 | static inline | ||
402 | int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, | 269 | int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, |
403 | void *data, int len) | 270 | void *data, int len); |
404 | { | ||
405 | return ept->ops->trysend_offchannel(ept, src, dst, data, len); | ||
406 | } | ||
407 | 271 | ||
408 | #endif /* _LINUX_RPMSG_H */ | 272 | #endif /* _LINUX_RPMSG_H */ |