summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar B.J. Buchalter 2011-03-24 03:14:27 -0400
committerGravatar Stefan Richter 2012-06-17 22:00:40 +0200
commitf3c9af36c29428caa872fa67f20c958d52a5fb21 (patch)
treedf06f471e52ced337d8a6727806a26cff389bb1c /src
parentconfigure.ac, Changelog, NEWS etc.: update to version 2.0.9 (diff)
Add raw1394_add_config_rom_descriptor() and raw1394_remove_config_rom_descriptor() API
This adds support of the firewire-core (juju) ABI to add and remove config ROM directories or descriptors. The raw1394 ABI supports similar requests, but for now we leave the two functions unimplemented when running on top of raw1394. Signed-off-by: Benjamin Buchalter <bj@mhlabs.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (whitespace changes)
Diffstat (limited to '')
-rw-r--r--src/dispatch.c34
-rw-r--r--src/fw.c35
-rw-r--r--src/fw.h7
-rw-r--r--src/raw1394.h9
4 files changed, 85 insertions, 0 deletions
diff --git a/src/dispatch.c b/src/dispatch.c
index 72a45a4..1cc8e6a 100644
--- a/src/dispatch.c
+++ b/src/dispatch.c
@@ -519,6 +519,40 @@ int raw1394_update_config_rom(raw1394handle_t handle, const quadlet_t
new_rom, size, rom_version);
}
+int raw1394_add_config_rom_descriptor(raw1394handle_t handle,
+ const quadlet_t immediate_key,
+ const quadlet_t key,
+ const quadlet_t *new_rom_directory,
+ size_t size,
+ __u32 *out_token)
+{
+ if (!handle) {
+ errno = EINVAL;
+ return -1;
+ }
+ if (handle->is_fw)
+ return fw_add_config_rom_descriptor(handle->mode.fw,
+ immediate_key, key, new_rom_directory, size, out_token);
+ else {
+ errno = EINVAL;
+ return -1;
+ }
+}
+
+int raw1394_remove_config_rom_descriptor(raw1394handle_t handle, __u32 token)
+{
+ if (!handle) {
+ errno = EINVAL;
+ return -1;
+ }
+ if (handle->is_fw)
+ return fw_remove_config_rom_descriptor(handle->mode.fw, token);
+ else {
+ errno = EINVAL;
+ return -1;
+ }
+}
+
int raw1394_get_config_rom(raw1394handle_t handle, quadlet_t *buffer,
size_t buffersize, size_t *rom_size, unsigned char *rom_version)
{
diff --git a/src/fw.c b/src/fw.c
index 6fae12d..da275c5 100644
--- a/src/fw.c
+++ b/src/fw.c
@@ -1543,6 +1543,41 @@ fw_update_config_rom(fw_handle_t handle, const quadlet_t *new_rom,
}
int
+fw_add_config_rom_descriptor(fw_handle_t handle,
+ const quadlet_t immediate_key,
+ const quadlet_t key,
+ const quadlet_t *new_rom_directory,
+ size_t size,
+ __u32 *out_token)
+{
+ struct fw_cdev_add_descriptor request;
+ int retval;
+
+ request.immediate = immediate_key;
+ request.key = key;
+ request.data = ptr_to_u64(new_rom_directory);
+ request.length = size;
+ request.handle = 0;
+
+ retval = ioctl(handle->local_device->fd, FW_CDEV_IOC_ADD_DESCRIPTOR,
+ &request);
+ if (retval < 0)
+ return -1;
+
+ *out_token = request.handle;
+ return 0;
+}
+
+int
+fw_remove_config_rom_descriptor(fw_handle_t handle, __u32 token)
+{
+ struct fw_cdev_remove_descriptor request = {token};
+
+ return ioctl(handle->local_device->fd, FW_CDEV_IOC_REMOVE_DESCRIPTOR,
+ &request);
+}
+
+int
fw_get_config_rom(fw_handle_t handle, quadlet_t *buffer,
size_t buffersize, size_t *rom_size,
unsigned char *rom_version)
diff --git a/src/fw.h b/src/fw.h
index c8481c2..e64b2f3 100644
--- a/src/fw.h
+++ b/src/fw.h
@@ -202,6 +202,13 @@ int fw_start_fcp_listen(fw_handle_t handle);
int fw_stop_fcp_listen(fw_handle_t handle);
int fw_update_config_rom(fw_handle_t handle, const quadlet_t *new_rom,
size_t size, unsigned char rom_version);
+int fw_add_config_rom_descriptor(fw_handle_t handle,
+ const quadlet_t immediate_key,
+ const quadlet_t key,
+ const quadlet_t *new_rom_directory,
+ size_t size,
+ __u32 *out_token);
+int fw_remove_config_rom_descriptor(fw_handle_t handle, __u32 token);
int fw_get_config_rom(fw_handle_t handle, quadlet_t *buffer,
size_t buffersize, size_t *rom_size,
unsigned char *rom_version);
diff --git a/src/raw1394.h b/src/raw1394.h
index 762276f..7239de3 100644
--- a/src/raw1394.h
+++ b/src/raw1394.h
@@ -1165,6 +1165,15 @@ const char *raw1394_get_libversion(void);
int raw1394_update_config_rom(raw1394handle_t handle, const quadlet_t
*new_rom, size_t size, unsigned char rom_version);
+int raw1394_add_config_rom_descriptor(raw1394handle_t handle,
+ const quadlet_t immediate_key,
+ const quadlet_t key,
+ const quadlet_t *new_rom_directory,
+ size_t size,
+ u_int32_t *out_token);
+
+int raw1394_remove_config_rom_descriptor(raw1394handle_t handle,
+ u_int32_t token);
/**
* raw1394_get_config_rom - reads the current version of the configuration ROM of a host
4.h?h=v2.1.0&id=e753a09b3831ab3f4f1d320d8ec18d4a0c4a0229&follow=1'>Updates for new rawiso ioctl interface.Gravatar bencollins 3-37/+125 2003-01-15add iso_xmit_sync() and iso_xmit_write(); clean up iso handling a bitGravatar dmaas 5-39/+161 2003-01-15implement tag matching for rawiso receptionGravatar dmaas 3-4/+12 2003-01-06back out previous commit - don't drop the legacy API just yetGravatar dmaas 6-173/+130 2003-01-05emulate legacy ISO reception API on top of new rawiso APIGravatar dmaas 7-131/+174 2002-12-24update iso API for multi-channel reception and new packet buffer layoutGravatar dmaas 4-123/+236 2002-12-20oops, irq_interval needs to be signedGravatar anonymous 1-1/+1 2002-12-20dmaas - renamed exported arm definitions into the raw1394_ namespace; brought...Gravatar anonymous 3-124/+48 2002-12-16rawiso updates:Gravatar dmaas 3-18/+25 2002-11-18fix cplusplus extern C blockGravatar ddennedy 1-4/+4 2002-11-18merged rawiso branchGravatar ddennedy 7-6/+488