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
This commit is contained in:
weihs 2003-11-09 19:46:20 +00:00
parent 30030e14aa
commit ff891d604b
3 changed files with 94 additions and 0 deletions

View File

@ -91,3 +91,65 @@ int raw1394_arm_unregister (struct raw1394_handle *handle, nodeaddr_t start)
retval = write(handle->fd, &req, sizeof(req)); retval = write(handle->fd, &req, sizeof(req));
return (retval == sizeof(req)) ? 0:-1; 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;
}

View File

@ -30,6 +30,8 @@
#define RAW1394_REQ_ARM_REGISTER 300 #define RAW1394_REQ_ARM_REGISTER 300
#define RAW1394_REQ_ARM_UNREGISTER 301 #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 #define RAW1394_REQ_RESET_NOTIFY 400

View File

@ -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); 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 * send an echo request to the driver. the driver then send back the
* same request. raw1394_loop_iterate will return data as return value, * same request. raw1394_loop_iterate will return data as return value,