Async stream support from Jim Radford.

git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@130 53a565d1-3bb7-0310-b661-cf11e63c67ab
This commit is contained in:
bencollins 2003-09-11 02:47:22 +00:00
parent 2d36fc10b2
commit e89e0feee4
3 changed files with 42 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#define RAW1394_REQ_LOCK64 103
#define RAW1394_REQ_ISO_SEND 104
#define RAW1394_REQ_ASYNC_SEND 105
#define RAW1394_REQ_ASYNC_STREAM 106
#define RAW1394_REQ_ISO_LISTEN 200
#define RAW1394_REQ_FCP_LISTEN 201

View File

@ -423,6 +423,10 @@ int raw1394_start_iso_write(raw1394handle_t handle, unsigned int channel,
unsigned int tag, unsigned int sy,
unsigned int speed, size_t length, quadlet_t *data,
unsigned long rawtag);
int raw1394_start_async_stream(raw1394handle_t handle, unsigned int channel,
unsigned int tag, unsigned int sy,
unsigned int speed, size_t length, quadlet_t *data,
unsigned long rawtag);
/* This starts sending an arbitrary async packet. It gets an array of quadlets consisting of
@ -458,6 +462,9 @@ int raw1394_lock64(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr,
int raw1394_iso_write(raw1394handle_t handle, unsigned int channel,
unsigned int tag, unsigned int sy, unsigned int speed,
size_t length, quadlet_t *data);
int raw1394_async_stream(raw1394handle_t handle, unsigned int channel,
unsigned int tag, unsigned int sy, unsigned int speed,
size_t length, quadlet_t *data);
int raw1394_async_send(raw1394handle_t handle,
size_t length, size_t header_length, unsigned int expect_response,
quadlet_t *data);

View File

@ -249,6 +249,28 @@ int raw1394_start_iso_write(struct raw1394_handle *handle, unsigned int channel,
return (int)write(handle->fd, &req, sizeof(req));
}
int raw1394_start_async_stream(struct raw1394_handle *handle,
unsigned int channel,
unsigned int tag, unsigned int sy,
unsigned int speed, size_t length, quadlet_t *data,
unsigned long rawtag)
{
struct raw1394_request *req = &handle->req;
CLEAR_REQ(req);
req->type = RAW1394_REQ_ASYNC_STREAM;
req->generation = handle->generation;
req->tag = rawtag;
req->address = ((__u64)channel << 48) | speed;
req->misc = (tag << 16) | sy;
req->length = length;
req->sendb = ptr2int(data);
return (int)write(handle->fd, req, sizeof(*req));
}
int raw1394_start_async_send(struct raw1394_handle *handle,
size_t length, size_t header_length, unsigned int expect_response,
quadlet_t *data, unsigned long rawtag)
@ -343,6 +365,18 @@ int raw1394_iso_write(struct raw1394_handle *handle, unsigned int channel,
SYNCFUNC_BODY;
}
int raw1394_async_stream(struct raw1394_handle *handle, unsigned int channel,
unsigned int tag, unsigned int sy, unsigned int speed,
size_t length, quadlet_t *data)
{
SYNCFUNC_VARS;
err = raw1394_start_async_stream(handle, channel, tag, sy, speed, length,
data, (unsigned long)&rh);
SYNCFUNC_BODY;
}
int raw1394_async_send(struct raw1394_handle *handle ,
size_t length, size_t header_length, unsigned int expect_response,
quadlet_t *data)