diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-01-11 22:44:11 +0100 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-05-30 10:17:43 +0200 |
commit | da5156af5a5b779b6713ab7dff569a10927ed188 (patch) | |
tree | b7c0e9e66c4c75721801c9a11347ebba5c2ddf57 | |
parent | babed1e589012862a7a42ab74a586928ff9184fe (diff) | |
download | libraw1394-da5156af5a5b779b6713ab7dff569a10927ed188.tar.gz |
Use new broadcast request ioctl
This implements broadcast transactions on juju.
(Broadcast transactions are write transactions to PHY ID 63,
not to be confused with isochronous or asynchronous streams.)
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | src/fw.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -935,7 +935,17 @@ send_request(fw_handle_t handle, int tcode, { struct fw_cdev_send_request *request; struct request_closure *closure; - int i; + int ioctl_nr = FW_CDEV_IOC_SEND_REQUEST; + int fd, i; + +#ifdef FW_CDEV_IOC_SEND_BROADCAST_REQUEST /* added in kernel 2.6.30 */ + if (node == 0xffff) { + ioctl_nr = FW_CDEV_IOC_SEND_BROADCAST_REQUEST; + fd = handle->ioctl_fd; + } +#endif + if (ioctl_nr != FW_CDEV_IOC_SEND_REQUEST) + goto node_id_ok; if (node > handle->reset.root_node_id) { handle->err = -RCODE_NO_ACK; @@ -955,6 +965,9 @@ send_request(fw_handle_t handle, int tcode, errno = fw_errcode_to_errno(handle->err); return -1; } + fd = handle->devices[i].fd; + +node_id_ok: closure = malloc(sizeof *closure); if (closure == NULL) { @@ -975,7 +988,7 @@ send_request(fw_handle_t handle, int tcode, request->closure = ptr_to_u64(closure); request->data = ptr_to_u64(in); - return ioctl(handle->devices[i].fd, FW_CDEV_IOC_SEND_REQUEST, request); + return ioctl(fd, ioctl_nr, request); } int |