summaryrefslogtreecommitdiffstats
path: root/src/arm.c
diff options
context:
space:
mode:
authorGravatar weihs 2003-11-09 19:46:20 +0000
committerGravatar weihs 2003-11-09 19:46:20 +0000
commitff891d604be4d6bb8e7de134292c3246002d42aa (patch)
tree65eff2aa291f6215c8f8a3bd4fd66fdc10213b37 /src/arm.c
parentsync with driver version of this file (diff)
sync with driver
(addition of functions raw1394_arm_get_buf raw1394_arm_set_buf to get and set buffers of mapped address ranges) git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@137 53a565d1-3bb7-0310-b661-cf11e63c67ab
Diffstat (limited to 'src/arm.c')
-rw-r--r--src/arm.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/arm.c b/src/arm.c
index 546374b..f185495 100644
--- a/src/arm.c
+++ b/src/arm.c
@@ -91,3 +91,65 @@ int raw1394_arm_unregister (struct raw1394_handle *handle, nodeaddr_t start)
retval = write(handle->fd, &req, sizeof(req));
return (retval == sizeof(req)) ? 0:-1;
}
+
+
+/*
+ * AdressRangeMapping SET BUFFER:
+ * start, length .... identifies addressrange
+ * buf .............. pointer to buffer
+ *
+ * This function copies 'length' bytes from user memory area 'buf'
+ * to one ARM block in kernel memory area
+ * with start offset 'start'.
+ *
+ * returnvalue: 0 ... success
+ * <0 ... failure, and errno - error code
+ */
+int raw1394_arm_set_buf (struct raw1394_handle *handle, nodeaddr_t start,
+ size_t length, void *buf)
+{
+ struct raw1394_request req;
+ int status;
+
+ CLEAR_REQ(&req);
+
+ req.type = RAW1394_REQ_ARM_SET_BUF;
+ req.sendb = ptr2int(buf);
+ req.length = length;
+ req.address = start;
+
+ if (write(handle->fd, &req, sizeof(req)) < 0) return -1;
+
+ return 0;
+}
+
+/*
+ * AdressRangeMapping GET BUFFER:
+ * start, length .... identifies addressrange
+ * buf .............. pointer to buffer
+ *
+ * This function copies 'length' bytes from one
+ * ARM block in kernel memory area with start offset `start`
+ * to user memory area 'buf'
+ *
+ * returnvalue: 0 ... success
+ * <0 ... failure, and errno - error code
+ */
+int raw1394_arm_get_buf (struct raw1394_handle *handle, nodeaddr_t start,
+ size_t length, void *buf)
+{
+ struct raw1394_request req;
+ int status;
+
+ CLEAR_REQ(&req);
+
+ req.type = RAW1394_REQ_ARM_GET_BUF;
+ req.recvb = ptr2int(buf);
+ req.length = length;
+ req.address = start;
+
+ if (write(handle->fd, &req, sizeof(req)) < 0) return -1;
+
+ return 0;
+}
+