summaryrefslogtreecommitdiffstats
path: root/src/raw1394.h
diff options
context:
space:
mode:
authorGravatar Stefan Richter 2012-06-30 18:49:43 +0200
committerGravatar Stefan Richter 2012-06-30 19:02:20 +0200
commitd50f7381b21e6f720b49464de1c2886950115c9c (patch)
tree0c7a0f60a9183956f73143dc52c744ae1eb1c1cd /src/raw1394.h
parentTrivial whitespace normalization in ieee1394.h and raw1394.h (diff)
Add raw1394_get_speed() API
This lets initiators of isochronous streams or asynchronous streams from or to the local node figure out what maximum speed can be configured. Furthermore it can be used to display connection speeds for informative purposes without having to perform topology analysis (in case of 1394a buses) or extensive phy port status queries (in case of 1394b buses). To be in line with other existing libraw1394 APIs which use nodeid_t variables, this API identifies a node only via a card:nodeID tuple which is unsafe against generation changes. A node can only be properly identified by card:generation:nodeID tuples. However, since this new API extension and libraw1394 as a whole is mainly aimed towards existing libraw1394 client code bases rather than new developments, I decided against making this call race free but somewhat more difficult to use in typical existing client code. A unit test for the new call is added to testlibraw as well. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'src/raw1394.h')
-rw-r--r--src/raw1394.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/raw1394.h b/src/raw1394.h
index 486ba65..8787313 100644
--- a/src/raw1394.h
+++ b/src/raw1394.h
@@ -543,6 +543,22 @@ nodeid_t raw1394_get_irm_id(raw1394handle_t handle);
**/
int raw1394_get_nodecount(raw1394handle_t handle);
+/**
+ * raw1394_get_speed - get maximum speed between a node and local node
+ * @handle: libraw1394 handle
+ * @node: node ID
+ *
+ * Returns: The speed code of the maximum possible transmission speed between
+ * the node and the local node, taking both link speeds and all intermediate
+ * phy speeds into account. On error, returns -1 and sets errno.
+ *
+ * Bugs: Like much of the rest of the libraw1394 API, this call is prone to
+ * races with bus resets.
+ *
+ * History: New function in libraw1394 v2.1.0.
+ **/
+int raw1394_get_speed(raw1394handle_t handle, nodeid_t node);
+
struct raw1394_portinfo {
int nodes;
char name[32];