@@ -193,13 +193,14 @@ rpmsg_send_offchannel_raw(struct rpmsg_channel *, u32, u32, void *, int, bool);
193193
194194/**
195195 * rpmsg_send() - send a message across to the remote processor
196- * @rpdev : the rpmsg channel
196+ * @ept : the rpmsg endpoint
197197 * @data: payload of message
198198 * @len: length of payload
199199 *
200- * This function sends @data of length @len on the @rpdev channel.
201- * The message will be sent to the remote processor which the @rpdev
202- * channel belongs to, using @rpdev's source and destination addresses.
200+ * This function sends @data of length @len on the @ept endpoint.
201+ * The message will be sent to the remote processor which the @ept
202+ * endpoint belongs to, using @ept's address and its associated rpmsg
203+ * device destination addresses.
203204 * In case there are no TX buffers available, the function will block until
204205 * one becomes available, or a timeout of 15 seconds elapses. When the latter
205206 * happens, -ERESTARTSYS is returned.
@@ -208,23 +209,24 @@ rpmsg_send_offchannel_raw(struct rpmsg_channel *, u32, u32, void *, int, bool);
208209 *
209210 * Returns 0 on success and an appropriate error value on failure.
210211 */
211- static inline int rpmsg_send (struct rpmsg_channel * rpdev , void * data , int len )
212+ static inline int rpmsg_send (struct rpmsg_endpoint * ept , void * data , int len )
212213{
213- u32 src = rpdev -> src , dst = rpdev -> dst ;
214+ struct rpmsg_channel * rpdev = ept -> rpdev ;
215+ u32 src = ept -> addr , dst = rpdev -> dst ;
214216
215217 return rpmsg_send_offchannel_raw (rpdev , src , dst , data , len , true);
216218}
217219
218220/**
219221 * rpmsg_sendto() - send a message across to the remote processor, specify dst
220- * @rpdev : the rpmsg channel
222+ * @ept : the rpmsg endpoint
221223 * @data: payload of message
222224 * @len: length of payload
223225 * @dst: destination address
224226 *
225227 * This function sends @data of length @len to the remote @dst address.
226- * The message will be sent to the remote processor which the @rpdev
227- * channel belongs to, using @rpdev 's source address.
228+ * The message will be sent to the remote processor which the @ept
229+ * endpoint belongs to, using @ept 's address as source .
228230 * In case there are no TX buffers available, the function will block until
229231 * one becomes available, or a timeout of 15 seconds elapses. When the latter
230232 * happens, -ERESTARTSYS is returned.
@@ -234,25 +236,26 @@ static inline int rpmsg_send(struct rpmsg_channel *rpdev, void *data, int len)
234236 * Returns 0 on success and an appropriate error value on failure.
235237 */
236238static inline
237- int rpmsg_sendto (struct rpmsg_channel * rpdev , void * data , int len , u32 dst )
239+ int rpmsg_sendto (struct rpmsg_endpoint * ept , void * data , int len , u32 dst )
238240{
239- u32 src = rpdev -> src ;
241+ struct rpmsg_channel * rpdev = ept -> rpdev ;
242+ u32 src = ept -> addr ;
240243
241244 return rpmsg_send_offchannel_raw (rpdev , src , dst , data , len , true);
242245}
243246
244247/**
245248 * rpmsg_send_offchannel() - send a message using explicit src/dst addresses
246- * @rpdev : the rpmsg channel
249+ * @ept : the rpmsg endpoint
247250 * @src: source address
248251 * @dst: destination address
249252 * @data: payload of message
250253 * @len: length of payload
251254 *
252255 * This function sends @data of length @len to the remote @dst address,
253256 * and uses @src as the source address.
254- * The message will be sent to the remote processor which the @rpdev
255- * channel belongs to.
257+ * The message will be sent to the remote processor which the @ept
258+ * endpoint belongs to.
256259 * In case there are no TX buffers available, the function will block until
257260 * one becomes available, or a timeout of 15 seconds elapses. When the latter
258261 * happens, -ERESTARTSYS is returned.
@@ -262,21 +265,24 @@ int rpmsg_sendto(struct rpmsg_channel *rpdev, void *data, int len, u32 dst)
262265 * Returns 0 on success and an appropriate error value on failure.
263266 */
264267static inline
265- int rpmsg_send_offchannel (struct rpmsg_channel * rpdev , u32 src , u32 dst ,
268+ int rpmsg_send_offchannel (struct rpmsg_endpoint * ept , u32 src , u32 dst ,
266269 void * data , int len )
267270{
271+ struct rpmsg_channel * rpdev = ept -> rpdev ;
272+
268273 return rpmsg_send_offchannel_raw (rpdev , src , dst , data , len , true);
269274}
270275
271276/**
272277 * rpmsg_send() - send a message across to the remote processor
273- * @rpdev : the rpmsg channel
278+ * @ept : the rpmsg endpoint
274279 * @data: payload of message
275280 * @len: length of payload
276281 *
277- * This function sends @data of length @len on the @rpdev channel.
278- * The message will be sent to the remote processor which the @rpdev
279- * channel belongs to, using @rpdev's source and destination addresses.
282+ * This function sends @data of length @len on the @ept endpoint.
283+ * The message will be sent to the remote processor which the @ept
284+ * endpoint belongs to, using @ept's address as source and its associated
285+ * rpdev's address as destination.
280286 * In case there are no TX buffers available, the function will immediately
281287 * return -ENOMEM without waiting until one becomes available.
282288 *
@@ -285,23 +291,24 @@ int rpmsg_send_offchannel(struct rpmsg_channel *rpdev, u32 src, u32 dst,
285291 * Returns 0 on success and an appropriate error value on failure.
286292 */
287293static inline
288- int rpmsg_trysend (struct rpmsg_channel * rpdev , void * data , int len )
294+ int rpmsg_trysend (struct rpmsg_endpoint * ept , void * data , int len )
289295{
290- u32 src = rpdev -> src , dst = rpdev -> dst ;
296+ struct rpmsg_channel * rpdev = ept -> rpdev ;
297+ u32 src = ept -> addr , dst = rpdev -> dst ;
291298
292299 return rpmsg_send_offchannel_raw (rpdev , src , dst , data , len , false);
293300}
294301
295302/**
296303 * rpmsg_sendto() - send a message across to the remote processor, specify dst
297- * @rpdev : the rpmsg channel
304+ * @ept : the rpmsg endpoint
298305 * @data: payload of message
299306 * @len: length of payload
300307 * @dst: destination address
301308 *
302309 * This function sends @data of length @len to the remote @dst address.
303- * The message will be sent to the remote processor which the @rpdev
304- * channel belongs to, using @rpdev 's source address.
310+ * The message will be sent to the remote processor which the @ept
311+ * endpoint belongs to, using @ept 's address as source .
305312 * In case there are no TX buffers available, the function will immediately
306313 * return -ENOMEM without waiting until one becomes available.
307314 *
@@ -310,25 +317,26 @@ int rpmsg_trysend(struct rpmsg_channel *rpdev, void *data, int len)
310317 * Returns 0 on success and an appropriate error value on failure.
311318 */
312319static inline
313- int rpmsg_trysendto (struct rpmsg_channel * rpdev , void * data , int len , u32 dst )
320+ int rpmsg_trysendto (struct rpmsg_endpoint * ept , void * data , int len , u32 dst )
314321{
315- u32 src = rpdev -> src ;
322+ struct rpmsg_channel * rpdev = ept -> rpdev ;
323+ u32 src = ept -> addr ;
316324
317325 return rpmsg_send_offchannel_raw (rpdev , src , dst , data , len , false);
318326}
319327
320328/**
321329 * rpmsg_send_offchannel() - send a message using explicit src/dst addresses
322- * @rpdev : the rpmsg channel
330+ * @ept : the rpmsg endpoint
323331 * @src: source address
324332 * @dst: destination address
325333 * @data: payload of message
326334 * @len: length of payload
327335 *
328336 * This function sends @data of length @len to the remote @dst address,
329337 * and uses @src as the source address.
330- * The message will be sent to the remote processor which the @rpdev
331- * channel belongs to.
338+ * The message will be sent to the remote processor which the @ept
339+ * endpoint belongs to.
332340 * In case there are no TX buffers available, the function will immediately
333341 * return -ENOMEM without waiting until one becomes available.
334342 *
@@ -337,9 +345,11 @@ int rpmsg_trysendto(struct rpmsg_channel *rpdev, void *data, int len, u32 dst)
337345 * Returns 0 on success and an appropriate error value on failure.
338346 */
339347static inline
340- int rpmsg_trysend_offchannel (struct rpmsg_channel * rpdev , u32 src , u32 dst ,
348+ int rpmsg_trysend_offchannel (struct rpmsg_endpoint * ept , u32 src , u32 dst ,
341349 void * data , int len )
342350{
351+ struct rpmsg_channel * rpdev = ept -> rpdev ;
352+
343353 return rpmsg_send_offchannel_raw (rpdev , src , dst , data , len , false);
344354}
345355
0 commit comments