summaryrefslogtreecommitdiffstats
path: root/src/dispatch.c
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2022-09-20 00:53:10 -0400
committerGravatar Peter McGoron 2022-09-20 00:58:16 -0400
commit48b2af0507fa99bad3b771325b232ad89e60de0a (patch)
treed87f8679fc40e6448430e9a4c913821bc9aa9f39 /src/dispatch.c
parentconfigure.ac, Changelog, NEWS: update to version 2.1.2 (diff)
Implement virtual memory for ARM manager
Instead of allocating memory for address range mappings (ARM) and handling all reads and writes to said memory, the new ARM manager calls a function for each received request with the data, transaction code, and allocation information. The ARM tag manager now must handle validation of memory accesses and retreive/write the data. This allows implementations to use network resources or generated data as memory. The ARM manager no longer automatically sends response packets. It is the responsibility of the user to send response packets using raw1394_send_rw_response(). The interface is not implemented for raw1394 and will probably never be implemented for raw1394. It is for firewire-cdev (modern Linux) only.
Diffstat (limited to 'src/dispatch.c')
-rw-r--r--src/dispatch.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/dispatch.c b/src/dispatch.c
index 0edfd6d..beb031a 100644
--- a/src/dispatch.c
+++ b/src/dispatch.c
@@ -229,7 +229,7 @@ int raw1394_loop_iterate(raw1394handle_t handle)
}
int raw1394_arm_register(raw1394handle_t handle, nodeaddr_t start,
- size_t length, byte_t *initial_value,
+ size_t length,
octlet_t arm_tag, arm_options_t access_rights,
arm_options_t notification_options,
arm_options_t client_transactions)
@@ -239,12 +239,13 @@ int raw1394_arm_register(raw1394handle_t handle, nodeaddr_t start,
return -1;
}
if (handle->is_fw)
- return fw_arm_register(handle->mode.fw, start, length, initial_value,
+ return fw_arm_register(handle->mode.fw, start, length,
arm_tag, access_rights, notification_options, client_transactions);
- else
- return ieee1394_arm_register(handle->mode.ieee1394, start, length,
- initial_value, arm_tag, access_rights, notification_options,
- client_transactions);
+ else {
+ /* FIXME: implement for raw1394 */
+ errno = ENOSYS;
+ return -1;
+ }
}
int raw1394_arm_unregister(raw1394handle_t handle, nodeaddr_t start)
@@ -259,30 +260,21 @@ int raw1394_arm_unregister(raw1394handle_t handle, nodeaddr_t start)
return ieee1394_arm_unregister(handle->mode.ieee1394, start);
}
-int raw1394_arm_set_buf (raw1394handle_t handle, nodeaddr_t start,
- size_t length, void *buf)
+int
+raw1394_send_rw_response(raw1394handle_t handle, int tcode, void *data, size_t len,
+ unsigned kernel_handle)
{
if (!handle) {
errno = EINVAL;
return -1;
}
if (handle->is_fw)
- return fw_arm_set_buf(handle->mode.fw, start, length, buf);
- else
- return ieee1394_arm_set_buf(handle->mode.ieee1394, start, length, buf);
-}
-
-int raw1394_arm_get_buf (raw1394handle_t handle, nodeaddr_t start,
- size_t length, void *buf)
-{
- if (!handle) {
- errno = EINVAL;
+ return fw_send_rw_response(handle->mode.fw, tcode, data, len, kernel_handle);
+ else {
+ /* FIXME: implement for raw1394 */
+ errno = ENOSYS;
return -1;
}
- if (handle->is_fw)
- return fw_arm_get_buf(handle->mode.fw, start, length, buf);
- else
- return ieee1394_arm_get_buf(handle->mode.ieee1394, start, length, buf);
}
int raw1394_echo_request(raw1394handle_t handle, quadlet_t data)