From 9812e4136b6c88978cc47605da9d660a355ea009 Mon Sep 17 00:00:00 2001 From: aeb Date: Sat, 15 Apr 2000 00:33:26 +0000 Subject: [PATCH] Fixed lock transaction to actually return response value. git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@24 53a565d1-3bb7-0310-b661-cf11e63c67ab --- NEWS | 3 +++ src/raw1394.h | 5 +++-- src/readwrite.c | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 178aa2e..8a10f4f 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ Version 0.7: +- fixed lock transaction to actually return the required response; these + functions are actually useful now, prototypes for raw1394_start_lock and + raw1394_lock changed - a void pointer can now be stored as user data with a handle Version 0.6: diff --git a/src/raw1394.h b/src/raw1394.h index 1c17172..2e38a4b 100644 --- a/src/raw1394.h +++ b/src/raw1394.h @@ -143,7 +143,7 @@ int raw1394_start_write(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr, size_t length, quadlet_t *data, unsigned long tag); int raw1394_start_lock(struct raw1394_handle *handle, nodeid_t node, nodeaddr_t addr, unsigned int extcode, quadlet_t data, - quadlet_t arg, unsigned long tag); + quadlet_t arg, quadlet_t *result, unsigned long tag); /* * This does the complete transaction and will return when it's finished. It @@ -155,7 +155,8 @@ int raw1394_read(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr, int raw1394_write(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr, size_t length, quadlet_t *data); int raw1394_lock(struct raw1394_handle *handle, nodeid_t node, nodeaddr_t addr, - unsigned int extcode, quadlet_t data, quadlet_t arg); + unsigned int extcode, quadlet_t data, quadlet_t arg, + quadlet_t *result); /* * Start and stop receiving a certain isochronous channel. You have to set an diff --git a/src/readwrite.c b/src/readwrite.c index 9e01d39..dac0653 100644 --- a/src/readwrite.c +++ b/src/readwrite.c @@ -47,7 +47,7 @@ int raw1394_start_write(struct raw1394_handle *handle, nodeid_t node, int raw1394_start_lock(struct raw1394_handle *handle, nodeid_t node, nodeaddr_t addr, unsigned int extcode, quadlet_t data, - quadlet_t arg, unsigned long tag) + quadlet_t arg, quadlet_t *result, unsigned long tag) { struct raw1394_request *req = &handle->req; quadlet_t sendbuf[2]; @@ -65,6 +65,7 @@ int raw1394_start_lock(struct raw1394_handle *handle, nodeid_t node, req->address = ((u_int64_t)node << 48) | addr; req->sendb = sendbuf; + req->recvb = result; switch (extcode) { case 3: /* EXTCODE_FETCH_ADD */ @@ -119,11 +120,12 @@ int raw1394_write(struct raw1394_handle *handle, nodeid_t node, nodeaddr_t addr, } int raw1394_lock(struct raw1394_handle *handle, nodeid_t node, nodeaddr_t addr, - unsigned int extcode, quadlet_t data, quadlet_t arg) + unsigned int extcode, quadlet_t data, quadlet_t arg, + quadlet_t *result) { SYNCFUNC_VARS; - err = raw1394_start_lock(handle, node, addr, extcode, data, arg, + err = raw1394_start_lock(handle, node, addr, extcode, data, arg, result, (unsigned long)&rh); SYNCFUNC_BODY;