summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2016-02-15 20:12:01 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-21 01:09:14 +0300
commitf8560a9bc76b2cd5c06fa412cb7b5481d70fcf34 (patch)
tree346c88ac941281b11cb465268ddb1dd12eea9685 /include
parent14136e368f909ced74f97cf04199d7288933ad41 (diff)
downloadlinux-f8560a9bc76b2cd5c06fa412cb7b5481d70fcf34.tar.xz
stm class: Use driver's packet callback return value
STM drivers provide a callback to generate/send individual STP packets; it also tells the stm core how many bytes of payload it has consumed. However, we would also need to use the negative space of this return value to communicate errors that occur during the packet generation, in which case the stm core will have to take appropriate action. For now, we need to account for the possibility that the stm driver may not support certain combinations of packet type/flags, in which case it is expected to signal an error. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/stm.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/stm.h b/include/linux/stm.h
index 9d0083d364e6..ab8ceca4f570 100644
--- a/include/linux/stm.h
+++ b/include/linux/stm.h
@@ -67,6 +67,13 @@ struct stm_device;
* description. That is, the lowest master that can be allocated to software
* writers is @sw_start and data from this writer will appear is @sw_start
* master in the STP stream.
+ *
+ * The @packet callback should adhere to the following rules:
+ * 1) it must return the number of bytes it consumed from the payload;
+ * 2) therefore, if it sent a packet that does not have payload (like FLAG),
+ * it must return zero;
+ * 3) if it does not support the requested packet type/flag combination,
+ * it must return -ENOTSUPP.
*/
struct stm_data {
const char *name;