diff options
| author | 2003-11-09 19:46:20 +0000 | |
|---|---|---|
| committer | 2003-11-09 19:46:20 +0000 | |
| commit | ff891d604be4d6bb8e7de134292c3246002d42aa (patch) | |
| tree | 65eff2aa291f6215c8f8a3bd4fd66fdc10213b37 /src/arm.c | |
| parent | sync 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.c | 62 |
1 files changed, 62 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; +} + |
