aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-16 11:18:00 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-16 11:32:28 +0200
commite6ac4164aff16fce8aabce1f8cb7af84b77c738a (patch)
treec103a7383d446b92f4f70d4b13d61c47e35b3480
parent824406de01cc81c08f5c20942b744cc4f5af63eb (diff)
ccid: Add comments clarifying msgb ownership on Rx/Tx */
-rw-r--r--ccid/ccid_device.c4
-rw-r--r--ccid/ccid_device.h3
2 files changed, 6 insertions, 1 deletions
diff --git a/ccid/ccid_device.c b/ccid/ccid_device.c
index ffcbacc..f91abb8 100644
--- a/ccid/ccid_device.c
+++ b/ccid/ccid_device.c
@@ -617,7 +617,9 @@ static int ccid_handle_set_rate_and_clock(struct ccid_slot *cs, struct msgb *msg
/*! Handle data arriving from the host on the OUT endpoint.
* \param[in] cs CCID Instance on which to operate
- * \param[in] msgb received message buffer containing one CCID OUT EP message from the host
+ * \param[in] msgb received message buffer containing one CCID OUT EP message from the host.
+ * Ownership of message buffer is transferred, i.e. it's our job to msgb_free()
+ * it eventually, after we're done with it (could be asynchronously).
* \returns 0 on success; negative on error */
int ccid_handle_out(struct ccid_instance *ci, struct msgb *msg)
{
diff --git a/ccid/ccid_device.h b/ccid/ccid_device.h
index bc69523..d0fcdc0 100644
--- a/ccid/ccid_device.h
+++ b/ccid/ccid_device.h
@@ -59,6 +59,9 @@ struct ccid_slot {
/* CCID operations */
struct ccid_ops {
+ /* msgb ownership in below functions is transferred, i.e. whoever
+ * provides the callback function must make sure to msgb_free() them
+ * once transmission on IN or INT EP has completed. */
int (*send_in)(struct ccid_instance *ci, struct msgb *msg);
int (*send_int)(struct ccid_instance *ci, struct msgb *msg);
};