summaryrefslogtreecommitdiffstats
path: root/src/raw1394.h
diff options
context:
space:
mode:
authorGravatar aeb 2001-05-14 01:05:58 +0000
committerGravatar aeb 2001-05-14 01:05:58 +0000
commite02dee488a2c3c3ea8374e7bd49e59176eab32dd (patch)
treeaacc99ac9584e29b2477db7acc3f5e27d54803c3 /src/raw1394.h
parentFix macros so that they actually work. (diff)
Handle generation number is not automatically advanced with bus reset.
Function raw1394_update_generation() added for manual update. Bus reset handler get current generation number as argument. Default bus reset handler calls raw1394_update_generation(). git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@60 53a565d1-3bb7-0310-b661-cf11e63c67ab
Diffstat (limited to 'src/raw1394.h')
-rw-r--r--src/raw1394.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/raw1394.h b/src/raw1394.h
index 4661cb1..5314409 100644
--- a/src/raw1394.h
+++ b/src/raw1394.h
@@ -45,7 +45,6 @@ int raw1394_get_fd(raw1394handle_t handle);
void *raw1394_get_userdata(raw1394handle_t handle);
void raw1394_set_userdata(raw1394handle_t handle, void *data);
-unsigned int raw1394_get_generation(raw1394handle_t handle);
nodeid_t raw1394_get_local_id(raw1394handle_t handle);
nodeid_t raw1394_get_irm_id(raw1394handle_t handle);
@@ -92,13 +91,26 @@ int raw1394_loop_iterate(raw1394handle_t handle);
/*
* Set the handler that will be called when a bus reset message is encountered.
- * The default action is to do nothing. Returns old handler.
+ * The default action is to just call raw1394_update_generation(). Returns old
+ * handler.
*/
-typedef int (*bus_reset_handler_t)(raw1394handle_t);
+typedef int (*bus_reset_handler_t)(raw1394handle_t, unsigned int generation);
bus_reset_handler_t raw1394_set_bus_reset_handler(raw1394handle_t handle,
bus_reset_handler_t new_h);
/*
+ * Since node IDs may change during a bus reset, generation numbers incremented
+ * every bus reset are used to verify if a transaction request is intended for
+ * this configuration. If numbers don't match, they will fail immediately.
+ *
+ * raw1394_get_generation() returns the generation number in use by the handle,
+ * not the current generation number. The current generation number is passed
+ * to the bus reset handler.
+ */
+unsigned int raw1394_get_generation(raw1394handle_t handle);
+void raw1394_update_generation(raw1394handle_t handle, unsigned int generation);
+
+/*
* Set the handler that will be called when an async read/write/lock returns.
* The default action is to call the callback in the raw1394_reqhandle pointed
* to by tag. Returns old handler.