diff options
author | weihs <weihs@53a565d1-3bb7-0310-b661-cf11e63c67ab> | 2003-11-09 19:46:20 +0000 |
---|---|---|
committer | weihs <weihs@53a565d1-3bb7-0310-b661-cf11e63c67ab> | 2003-11-09 19:46:20 +0000 |
commit | ff891d604be4d6bb8e7de134292c3246002d42aa (patch) | |
tree | 65eff2aa291f6215c8f8a3bd4fd66fdc10213b37 | |
parent | 30030e14aabf0fe5e5c35606d906e5fac28c5d03 (diff) | |
download | libraw1394-ff891d604be4d6bb8e7de134292c3246002d42aa.tar.gz |
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
-rw-r--r-- | src/arm.c | 62 | ||||
-rw-r--r-- | src/kernel-raw1394.h | 2 | ||||
-rw-r--r-- | src/raw1394.h | 30 |
3 files changed, 94 insertions, 0 deletions
@@ -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; +} + diff --git a/src/kernel-raw1394.h b/src/kernel-raw1394.h index e178bda..6563c59 100644 --- a/src/kernel-raw1394.h +++ b/src/kernel-raw1394.h @@ -30,6 +30,8 @@ #define RAW1394_REQ_ARM_REGISTER 300 #define RAW1394_REQ_ARM_UNREGISTER 301 +#define RAW1394_REQ_ARM_SET_BUF 302 +#define RAW1394_REQ_ARM_GET_BUF 303 #define RAW1394_REQ_RESET_NOTIFY 400 diff --git a/src/raw1394.h b/src/raw1394.h index 58ebfd2..997a99a 100644 --- a/src/raw1394.h +++ b/src/raw1394.h @@ -377,6 +377,36 @@ int raw1394_arm_register(struct raw1394_handle *handle, nodeaddr_t start, */ int raw1394_arm_unregister(raw1394handle_t handle, nodeaddr_t start); +/* + * 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); + +/* + * 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); + /* * send an echo request to the driver. the driver then send back the * same request. raw1394_loop_iterate will return data as return value, |