Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libhinawa for openSUSE:Factory checked in at 2021-04-17 00:02:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libhinawa (Old) and /work/SRC/openSUSE:Factory/.libhinawa.new.12324 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libhinawa" Sat Apr 17 00:02:15 2021 rev:4 rq:886058 version:2.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libhinawa/libhinawa.changes 2020-08-29 20:36:00.265305071 +0200 +++ /work/SRC/openSUSE:Factory/.libhinawa.new.12324/libhinawa.changes 2021-04-17 00:02:34.121670128 +0200 @@ -1,0 +2,18 @@ +Thu Apr 15 00:45:14 UTC 2021 - Ferdinand Thiessen <r...@fthiessen.de> + +- Update to version 2.2.0: + * Some symbols are newly available as public API for new features. + * HinawaFwResp::requested2 is added to deprecate HinawaFwResp::requested + * Current implementation of HinawaFwResp::requested signal doesn't deliver + all information in data of struct fw_cdev_event_request2 type. + This is inconvenient for some applications bound to device which + sends transactions to different addresses within a certain space. + At release v2.1.0, nothing was added for error reporting of + HinawaFwResp since it was not necessary. However, it's + convenient to retrieve error reporting at failure of + allocation in 1394 OHCI controller. + * HinawaFwRespError enumeration is added and + hinawa_fw_resp_error_quark() represents the domain of GError + with the code in enumeration. + +------------------------------------------------------------------- Old: ---- libhinawa-2.1.0.tar.xz New: ---- libhinawa-2.2.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libhinawa.spec ++++++ --- /var/tmp/diff_new_pack.7T6yOg/_old 2021-04-17 00:02:34.561670824 +0200 +++ /var/tmp/diff_new_pack.7T6yOg/_new 2021-04-17 00:02:34.565670830 +0200 @@ -17,7 +17,7 @@ Name: libhinawa -Version: 2.1.0 +Version: 2.2.0 Release: 0 Summary: I/O library for IEEE 1394 asynchronous transactions License: LGPL-2.1-or-later ++++++ libhinawa-2.1.0.tar.xz -> libhinawa-2.2.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/README new/libhinawa-2.2.0/README --- old/libhinawa-2.1.0/README 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/README 2020-08-24 09:16:07.000000000 +0200 @@ -1,6 +1,6 @@ # libhinawa -2020/08/17 +2020/08/24 Takashi Sakamoto ## Instruction @@ -111,8 +111,8 @@ ## How to make RPM package -1. archive all source code into libhinawa-2.1.0.tar.gz - $ git archive --format tar.gz --prefix='libhinawa-2.1.0/' 2.1.0 -o ~/rpmbuild/SOURCES/libhinawa-2.1.0.tar.gz +1. archive all source code into libhinawa-2.2.0.tar.gz + $ git archive --format tar.gz --prefix='libhinawa-2.2.0/' 2.2.0 -o ~/rpmbuild/SOURCES/libhinawa-2.2.0.tar.gz 2. rpmbuild -bb libhinawa.spec ## Lose of backward compatibility from v1 release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/libhinawa.spec new/libhinawa-2.2.0/libhinawa.spec --- old/libhinawa-2.1.0/libhinawa.spec 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/libhinawa.spec 2020-08-24 09:16:07.000000000 +0200 @@ -1,5 +1,5 @@ Name: libhinawa -Version: 2.1.0 +Version: 2.2.0 Release: 1%{?dist} Summary: GObject introspection library for devices connected to IEEE 1394 bus @@ -64,6 +64,9 @@ %changelog +* Thu Aug 24 2020 Takashi Sakamoto <o-taka...@sakamocchi.jp> - 2.2.0 +- new upstream release. + * Thu Aug 18 2020 Takashi Sakamoto <o-taka...@sakamocchi.jp> - 2.1.0 - new upstream release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/meson.build new/libhinawa-2.2.0/meson.build --- old/libhinawa-2.1.0/meson.build 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/meson.build 2020-08-24 09:16:07.000000000 +0200 @@ -1,5 +1,5 @@ project('libhinawa', 'c', - version: '2.1.0', + version: '2.2.0', license: 'LGPL-2.1+', meson_version: '>= 0.46.0', ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/samples/gtk3.py new/libhinawa-2.2.0/samples/gtk3.py --- old/libhinawa-2.1.0/samples/gtk3.py 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/samples/gtk3.py 2020-08-24 09:16:07.000000000 +0200 @@ -110,15 +110,14 @@ # create firewire responder resp = Hinawa.FwResp() -def handle_request(resp, tcode): +def handle_request(resp, tcode, offset, src, dst, card, generation, frame, length): print('Requested with tcode: {0}'.format(tcode.value_nick)) - req_frame = resp.get_req_frame() - for i in range(len(req_frame)): - print(' [{0:02d}]: 0x{1:02x}'.format(i, req_frame[i])) + for i in range(len(frame)): + print(' [{0:02d}]: 0x{1:02x}'.format(i, frame[i])) return Hinawa.FwRcode.COMPLETE try: resp.reserve(node, 0xfffff0000d00, 0x100) - resp.connect('requested', handle_request) + resp.connect('requested2', handle_request) except Exception as e: print(e) exit() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/samples/qt5.py new/libhinawa-2.2.0/samples/qt5.py --- old/libhinawa-2.1.0/samples/qt5.py 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/samples/qt5.py 2020-08-24 09:16:07.000000000 +0200 @@ -111,15 +111,14 @@ # create firewire responder resp = Hinawa.FwResp() -def handle_request(resp, tcode): +def handle_request(resp, tcode, offset, src, dst, card, generation, frame, length): print('Requested with tcode: {0}'.format(tcode.value_nick)) - req_frame = resp.get_req_frame() - for i in range(len(req_frame)): - print(' [{0:02d}]: 0x{1:02x}'.format(i, req_frame[i])) + for i in range(len(frame)): + print(' [{0:02d}]: 0x{1:02x}'.format(i, frame[i])) return Hinawa.FwRcode.COMPLETE try: resp.reserve(node, 0xfffff0000d00, 0x100) - resp.connect('requested', handle_request) + resp.connect('requested2', handle_request) except Exception as e: print(e) exit() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/src/fw_fcp.c new/libhinawa-2.2.0/src/fw_fcp.c --- old/libhinawa-2.1.0/src/fw_fcp.c 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/src/fw_fcp.c 2020-08-24 09:16:07.000000000 +0200 @@ -130,13 +130,15 @@ static guint fw_fcp_sigs[FW_FCP_SIG_TYPE_COUNT] = { 0 }; // Define later. -static HinawaFwRcode handle_response(HinawaFwResp *resp, HinawaFwTcode tcode); +static HinawaFwRcode handle_requested2_signal(HinawaFwResp *resp, HinawaFwTcode tcode, guint64 offset, + guint32 src, guint32 dst, guint32 card, guint32 generation, + const guint8 *frame, guint length); static void hinawa_fw_fcp_class_init(HinawaFwFcpClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); - HINAWA_FW_RESP_CLASS(klass)->requested = handle_response; + HINAWA_FW_RESP_CLASS(klass)->requested2 = handle_requested2_signal; gobject_class->get_property = fw_fcp_get_property; gobject_class->set_property = fw_fcp_set_property; @@ -389,20 +391,20 @@ timeout_ms, exception); } -static HinawaFwRcode handle_response(HinawaFwResp *resp, HinawaFwTcode tcode) +static HinawaFwRcode handle_requested2_signal(HinawaFwResp *resp, HinawaFwTcode tcode, guint64 offset, + guint32 src, guint32 dst, guint32 card, guint32 generation, + const guint8 *frame, guint length) { HinawaFwFcp *self = HINAWA_FW_FCP(resp); - const guint8 *req_frame = NULL; - gsize length = 0; + HinawaFwFcpPrivate *priv = hinawa_fw_fcp_get_instance_private(self); + guint32 node_id; - req_frame = NULL; - length = 0; - hinawa_fw_resp_get_req_frame(resp, &req_frame, &length); + g_object_get(priv->node, "node-id", &node_id, NULL); + if (offset == FCP_RESPOND_ADDR && tcode == HINAWA_FW_TCODE_WRITE_BLOCK_REQUEST && src == node_id) + g_signal_emit(self, fw_fcp_sigs[FW_FCP_SIG_TYPE_RESPONDED], 0, frame, length); - g_signal_emit(self, fw_fcp_sigs[FW_FCP_SIG_TYPE_RESPONDED], 0, - req_frame, length); - - /* MEMO: no need to send any data on response frame. */ + // MEMO: Linux firewire subsystem already began respond transaction, thus the rcode is just + // ignored. return HINAWA_FW_RCODE_COMPLETE; } @@ -411,7 +413,7 @@ * hinawa_fw_fcp_bind: * @self: A #HinawaFwFcp. * @node: A #HinawaFwNode. - * @exception: A #GError. + * @exception: A #GError. Error can be generated with domain of #hinawa_fw_resp_error_quark(). * * Start to listen to FCP responses. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/src/fw_node.c new/libhinawa-2.2.0/src/fw_node.c --- old/libhinawa-2.1.0/src/fw_node.c 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/src/fw_node.c 2020-08-24 09:16:07.000000000 +0200 @@ -505,17 +505,17 @@ } // Internal use only. -void hinawa_fw_node_ioctl(HinawaFwNode *self, unsigned long req, void *args, GError **exception) +int hinawa_fw_node_ioctl(HinawaFwNode *self, unsigned long req, void *args, GError **exception) { HinawaFwNodePrivate *priv; - g_return_if_fail(HINAWA_IS_FW_NODE(self)); - g_return_if_fail(exception != NULL); + g_return_val_if_fail(HINAWA_IS_FW_NODE(self), ENXIO); + g_return_val_if_fail(exception != NULL, EINVAL); priv = hinawa_fw_node_get_instance_private(self); if (priv->fd < 0) { generate_local_error(exception, HINAWA_FW_NODE_ERROR_NOT_OPENED); - return; + return ENXIO; } // To invalidate the transaction in a case of timeout. @@ -526,32 +526,12 @@ } if (ioctl(priv->fd, req, args) < 0) { - if (errno == ENODEV) { + if (errno == ENODEV) generate_local_error(exception, HINAWA_FW_NODE_ERROR_DISCONNECTED); - } else { - const char *arg; - - switch (req) { - case FW_CDEV_IOC_SEND_REQUEST: - arg = "FW_CDEV_IOC_SEND_REQUEST"; - break; - case FW_CDEV_IOC_SEND_RESPONSE: - arg = "FW_CDEV_IOC_SEND_RESPONSE"; - break; - case FW_CDEV_IOC_ALLOCATE: - arg = "FW_CDEV_IOC_ALLOCATE"; - break; - case FW_CDEV_IOC_DEALLOCATE: - arg = "FW_CDEV_IOC_DEALLOCATE"; - break; - default: - arg = "Uknown"; - break; - } - - generate_syscall_error(exception, errno, "ioctl(%s)", arg); - } + return errno; } + + return 0; } void hinawa_fw_node_invalidate_transaction(HinawaFwNode *self, HinawaFwReq *req) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/src/fw_req.c new/libhinawa-2.2.0/src/fw_req.c --- old/libhinawa-2.1.0/src/fw_req.c 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/src/fw_req.c 2020-08-24 09:16:07.000000000 +0200 @@ -186,6 +186,7 @@ { struct fw_cdev_send_request req = {0}; guint64 generation; + int err; g_return_if_fail(HINAWA_IS_FW_REQ(self)); g_return_if_fail(length > 0); @@ -239,7 +240,9 @@ req.data = (guint64)(*frame); // Send this transaction. - hinawa_fw_node_ioctl(node, FW_CDEV_IOC_SEND_REQUEST, &req, exception); + err = hinawa_fw_node_ioctl(node, FW_CDEV_IOC_SEND_REQUEST, &req, exception); + if (*exception == NULL && err > 0) + generate_local_error(exception, HINAWA_FW_RCODE_SEND_ERROR); } struct waiter { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/src/fw_resp.c new/libhinawa-2.2.0/src/fw_resp.c --- old/libhinawa-2.1.0/src/fw_resp.c 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/src/fw_resp.c 2020-08-24 09:16:07.000000000 +0200 @@ -19,6 +19,27 @@ * utilize ioctl(2) with subsystem specific request commands. */ +/** + * hinawa_fw_resp_error_quark: + * + * Return the GQuark for error domain of GError which has code in #HinawaFwRespError. + * + * Returns: A #GQuark. + */ +G_DEFINE_QUARK(hinawa-fw-resp-error-quark, hinawa_fw_resp_error) + +static const char *const err_msgs[] = { + [HINAWA_FW_RESP_ERROR_RESERVED] = "Reservation of address space is already done", + [HINAWA_FW_RESP_ERROR_ADDR_SPACE_USED] = "The requested range of address is already used exclusively", +}; + +#define generate_local_error(exception, code) \ + g_set_error_literal(exception, HINAWA_FW_RESP_ERROR, code, err_msgs[code]) + +#define generate_syscall_error(exception, errno, format, arg) \ + g_set_error(exception, HINAWA_FW_RESP_ERROR, HINAWA_FW_RESP_ERROR_FAILED, \ + format " %d(%s)", arg, errno, strerror(errno)) + struct _HinawaFwRespPrivate { HinawaFwNode *node; @@ -42,6 +63,7 @@ // This object has one signal. enum fw_resp_sig_type { FW_RESP_SIG_TYPE_REQ = 0, + FW_RESP_SIG_TYPE_REQ2, FW_RESP_SIG_TYPE_COUNT, }; static guint fw_resp_sigs[FW_RESP_SIG_TYPE_COUNT] = { 0 }; @@ -94,13 +116,17 @@ * @self: A #HinawaFwResp * @tcode: One of #HinawaTcode enumerators * - * When any node transfers requests to the range of address to which - * this object listening. The #HinawaFwResp::requested signal handler can get data - * frame by a call of #hinawa_fw_resp_get_req_frame() and set data frame by a call of - * hinawa_fw_resp_set_resp_frame(), then returns rcode. + * When any node transfers requests to the range of address to which this object listening, + * the #HinawaFwResp::requested signal handler is called with #HinawaFwTcode, without the + * case that #HinawaFwResp::requested2 signal handler is already assigned. + * + * The handler can get data frame by a call of #hinawa_fw_resp_get_req_frame() and set data + * frame by a call of #hinawa_fw_resp_set_resp_frame(), then returns rcode. * - * Returns: One of #HinawaRcode enumerators corresponding to rcodes - * defined in IEEE 1394 specification. + * Returns: One of #HinawaRcode enumerators corresponding to rcodes defined in IEEE 1394 + * specification. + * + * Deprecated: 2.2: Use #HinawaFwResp::requested2, instead. */ fw_resp_sigs[FW_RESP_SIG_TYPE_REQ] = g_signal_new("requested", @@ -110,6 +136,38 @@ NULL, NULL, hinawa_sigs_marshal_ENUM__ENUM, HINAWA_TYPE_FW_RCODE, 1, HINAWA_TYPE_FW_TCODE); + + /** + * HinawaFwResp::requested2: + * @self: A #HinawaFwResp + * @tcode: One of #HinawaTcode enumerations + * @offset: The address offset at which the transaction arrives. + * @src: The node ID of source for the transaction. + * @dst: The node ID of destination for the transaction. + * @card: The index of card corresponding to 1394 OHCI controller. + * @generation: The generation of bus when the transaction is transferred. + * @frame: (element-type guint8)(array length=length): The array with elements for byte + * data. + * @length: The length of bytes for the frame. + * + * When any node transfers request subaction to the range of address to which this object + * listening, the #HinawaFwResp::requested signal handler is called with arrived frame for + * the subaction. The handler is expected to call #hinawa_fw_resp_set_resp_frame() with + * frame and return rcode for response subaction. + * + * Returns: One of #HinawaRcode enumerators corresponding to rcodes defined in IEEE 1394 + * specification. + */ + fw_resp_sigs[FW_RESP_SIG_TYPE_REQ2] = + g_signal_new("requested2", + G_OBJECT_CLASS_TYPE(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(HinawaFwRespClass, requested2), + NULL, NULL, + hinawa_sigs_marshal_ENUM__ENUM_UINT64_UINT_UINT_UINT_UINT_POINTER_UINT, + HINAWA_TYPE_FW_RCODE, 8, HINAWA_TYPE_FW_TCODE, G_TYPE_UINT64, + G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, + G_TYPE_POINTER, G_TYPE_UINT); } static void hinawa_fw_resp_init(HinawaFwResp *self) @@ -136,7 +194,8 @@ * @node: A #HinawaFwNode. * @addr: A start address to listen to in host controller. * @width: The byte width of address to listen to host controller. - * @exception: A #GError. Error can be generated with domain of #hinawa_fw_node_error_quark(). + * @exception: A #GError. Error can be generated with two domain of #hinawa_fw_node_error_quark() + * and #hinawa_fw_resp_error_quark(). * * Start to listen to a range of address in host controller which connects to * the node. @@ -148,22 +207,33 @@ { HinawaFwRespPrivate *priv; struct fw_cdev_allocate allocate = {0}; + int err; g_return_if_fail(HINAWA_IS_FW_RESP(self)); g_return_if_fail(width > 0); g_return_if_fail(exception == NULL || *exception == NULL); priv = hinawa_fw_resp_get_instance_private(self); - g_return_if_fail(priv->node == NULL); + if (priv->node != NULL) { + generate_local_error(exception, HINAWA_FW_RESP_ERROR_RESERVED); + return; + } allocate.offset = addr; allocate.closure = (guint64)self; allocate.length = width; allocate.region_end = addr + width; - hinawa_fw_node_ioctl(node, FW_CDEV_IOC_ALLOCATE, &allocate, exception); + err = hinawa_fw_node_ioctl(node, FW_CDEV_IOC_ALLOCATE, &allocate, exception); if (*exception != NULL) return; + if (err > 0) { + if (err == EBUSY) + generate_local_error(exception, HINAWA_FW_RESP_ERROR_ADDR_SPACE_USED); + else + generate_syscall_error(exception, err, "ioctl(%s)", "FW_CDEV_IOC_ALLOCATE"); + return; + } priv->node = g_object_ref(node); @@ -195,6 +265,7 @@ if (priv->node == NULL) return; + // Ignore ioctl error. deallocate.handle = priv->addr_handle; hinawa_fw_node_ioctl(priv->node, FW_CDEV_IOC_DEALLOCATE, &deallocate, &exception); g_clear_error(&exception); @@ -219,6 +290,9 @@ * @length: (out): The length of bytes for the frame. * * Retrieve byte frame to be requested. + * + * Deprecated: 2.2: handler for #HinawaFwResp::requested2 signal can receive the frame in its + * argument. */ void hinawa_fw_resp_get_req_frame(HinawaFwResp *self, const guint8 **frame, gsize *length) @@ -268,39 +342,44 @@ struct fw_cdev_event_request2 *event) { HinawaFwRespPrivate *priv; + HinawaFwRespClass *klass; struct fw_cdev_send_response resp = {0}; HinawaFwRcode rcode; GError *exception = NULL; g_return_if_fail(HINAWA_IS_FW_RESP(self)); priv = hinawa_fw_resp_get_instance_private(self); + klass = HINAWA_FW_RESP_GET_CLASS(self); - if (!priv->node || event->length > priv->width) { - resp.rcode = RCODE_CONFLICT_ERROR; - resp.handle = event->handle; + memset(priv->resp_frame, 0, priv->width); + priv->resp_length = 0; - hinawa_fw_node_ioctl(priv->node, FW_CDEV_IOC_SEND_RESPONSE, &resp, &exception); - g_clear_error(&exception); - return; + if (!priv->node || event->length > priv->width) { + rcode = RCODE_CONFLICT_ERROR; + } else if (klass->requested2 != NULL || + g_signal_has_handler_pending(self, fw_resp_sigs[FW_RESP_SIG_TYPE_REQ2], 0, TRUE)) { + g_signal_emit(self, fw_resp_sigs[FW_RESP_SIG_TYPE_REQ2], 0, event->tcode, + event->offset, event->source_node_id, event->destination_node_id, + event->card, event->generation, event->data, event->length, &rcode); + } else if (klass->requested != NULL || + g_signal_has_handler_pending(self, fw_resp_sigs[FW_RESP_SIG_TYPE_REQ], 0, TRUE)) { + // For backward compatibility. + memcpy(priv->req_frame, event->data, event->length); + priv->req_length = event->length; + + g_signal_emit(self, fw_resp_sigs[FW_RESP_SIG_TYPE_REQ], 0, event->tcode, &rcode); + } else { + rcode = HINAWA_FW_RCODE_ADDRESS_ERROR; } - memcpy(priv->req_frame, event->data, event->length); - priv->req_length = event->length; - - rcode = HINAWA_FW_RCODE_COMPLETE; - g_signal_emit(self, fw_resp_sigs[FW_RESP_SIG_TYPE_REQ], 0, event->tcode, - &rcode); - resp.rcode = (__u32)rcode; - if (priv->resp_length > 0) { resp.length = priv->resp_length; resp.data = (guint64)priv->resp_frame; } + // Ignore ioctl error. + resp.rcode = (__u32)rcode; resp.handle = event->handle; hinawa_fw_node_ioctl(priv->node, FW_CDEV_IOC_SEND_RESPONSE, &resp, &exception); g_clear_error(&exception); - - memset(priv->resp_frame, 0, priv->width); - priv->resp_length = 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/src/fw_resp.h new/libhinawa-2.2.0/src/fw_resp.h --- old/libhinawa-2.1.0/src/fw_resp.h 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/src/fw_resp.h 2020-08-24 09:16:07.000000000 +0200 @@ -32,6 +32,10 @@ HINAWA_TYPE_FW_RESP, \ HinawaFwRespClass)) +#define HINAWA_FW_RESP_ERROR hinawa_fw_resp_error_quark() + +GQuark hinawa_fw_resp_error_quark(); + typedef struct _HinawaFwResp HinawaFwResp; typedef struct _HinawaFwRespClass HinawaFwRespClass; typedef struct _HinawaFwRespPrivate HinawaFwRespPrivate; @@ -50,15 +54,44 @@ * @self: A #HinawaFwResp * @tcode: One of #HinawaTcode enumerators * - * When any units transfer requests to the range of address to which - * this object listening. The #HinawaFwRespClass::requested signal handler can get data - * frame by a call of #hinawa_fw_resp_get_req_frame() and set data frame by a call of - * #hinawa_fw_resp_set_resp_frame(), then returns rcode. + * When any node transfers requests to the range of address to which this object listening, + * the #HinawaFwRespClass::requested signal handler is called with #HinawaFwTcode, without the + * case that #HinawaFwRespClass::requested2 signal handler is already assigned. + * + * The handler can get data frame by a call of #hinawa_fw_resp_get_req_frame() and set data + * frame by a call of #hinawa_fw_resp_set_resp_frame(), then returns rcode. * - * Returns: One of #HinawaRcode enumerators corresponding to rcodes - * defined in IEEE 1394 specification. + * Returns: One of #HinawaRcode enumerators corresponding to rcodes defined in IEEE 1394 + * specification. + * + * Deprecated: 2.2: Use #HinawaFwRespClass::requested2, instead. */ HinawaFwRcode (*requested)(HinawaFwResp *self, HinawaFwTcode tcode); + + /** + * HinawaFwRespClass::requested2: + * @self: A #HinawaFwResp + * @tcode: One of #HinawaTcode enumerations + * @offset: The address offset at which the transaction arrives. + * @src: The node ID of source for the transaction. + * @dst: The node ID of destination for the transaction. + * @card: The index of card corresponding to 1394 OHCI controller. + * @generation: The generation of bus when the transaction is transferred. + * @frame: (element-type guint8)(array length=length): The array with elements for byte + * data. + * @length: The length of bytes for the frame. + * + * When any node transfers request subaction to the range of address to which this object + * listening, the #HinawaFwResp::requested signal handler is called with arrived frame for + * the subaction. The handler is expected to call #hinawa_fw_resp_set_resp_frame() with + * frame and return rcode for response subaction. + * + * Returns: One of #HinawaRcode enumerators corresponding to rcodes defined in IEEE 1394 + * specification. + */ + HinawaFwRcode (*requested2)(HinawaFwResp *self, HinawaFwTcode tcode, guint64 offset, + guint32 src, guint32 dst, guint32 card, guint32 generation, + const guint8 *frame, guint length); }; GType hinawa_fw_resp_get_type(void) G_GNUC_CONST; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/src/hinawa.map new/libhinawa-2.2.0/src/hinawa.map --- old/libhinawa-2.1.0/src/hinawa.map 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/src/hinawa.map 2020-08-24 09:16:07.000000000 +0200 @@ -118,3 +118,9 @@ "hinawa_fw_fcp_command"; "hinawa_fw_fcp_avc_transaction"; } HINAWA_2_0_0; + +HINAWA_2_2_0 { + global: + "hinawa_fw_resp_error_get_type"; + "hinawa_fw_resp_error_quark"; +} HINAWA_2_1_0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/src/hinawa_enum_types.h new/libhinawa-2.2.0/src/hinawa_enum_types.h --- old/libhinawa-2.1.0/src/hinawa_enum_types.h 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/src/hinawa_enum_types.h 2020-08-24 09:16:07.000000000 +0200 @@ -125,9 +125,25 @@ } HinawaFwNodeError; /** + * HinawaFwRespError: + * @HINAWA_FW_RESP_ERROR_FAILED: The generic system call error. + * @HINAWA_FW_RESP_ERROR_RESERVED: The instance is already associated to reserved address range. + * @HINAWA_FW_RESP_ERROR_ADDR_SPACE_USED: The address space is used exclusively. + * + * A set of error code for GError with domain which equals to #hinawa_fw_resp_error_quark(). + */ +typedef enum { + HINAWA_FW_RESP_ERROR_FAILED = 0, + HINAWA_FW_RESP_ERROR_RESERVED, + HINAWA_FW_RESP_ERROR_ADDR_SPACE_USED, +} HinawaFwRespError; + +/** * HinawaFwFcpError: * @HINAWA_FW_FCP_ERROR_TIMEOUT: The transaction is canceled due to response timeout. * @HINAWA_FW_FCP_ERROR_LARGE_RESP: The size of response is larger than expected. + * + * A set of error code for GError with domain which equals to #hinawa_fw_fcp_error_quark(). */ typedef enum { HINAWA_FW_FCP_ERROR_TIMEOUT, @@ -147,7 +163,7 @@ * @HINAWA_SND_UNIT_ERROR_WRONG_CLASS: The hwdep device is not for the unit expected by the class. * @HINAWA_SND_UNIT_ERROR_FAILED: The system call fails. * - * A set of error code for GError with domain of #HinawaSndUnitError. + * A set of error code for GError with domain which equals to #hinawa_snd_unit_error_quark(). */ typedef enum { HINAWA_SND_UNIT_ERROR_DISCONNECTED, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/src/hinawa_sigs_marshal.list new/libhinawa-2.2.0/src/hinawa_sigs_marshal.list --- old/libhinawa-2.1.0/src/hinawa_sigs_marshal.list 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/src/hinawa_sigs_marshal.list 2020-08-24 09:16:07.000000000 +0200 @@ -3,3 +3,4 @@ VOID:ENUM,POINTER,UINT VOID:ENUM,UINT,UINT,UINT,POINTER,UINT VOID:POINTER,UINT +ENUM:ENUM,UINT64,UINT,UINT,UINT,UINT,POINTER,UINT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/src/internal.h new/libhinawa-2.2.0/src/internal.h --- old/libhinawa-2.1.0/src/internal.h 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/src/internal.h 2020-08-24 09:16:07.000000000 +0200 @@ -19,7 +19,7 @@ #include "snd_motu.h" #include "snd_tscm.h" -void hinawa_fw_node_ioctl(HinawaFwNode *self, unsigned long req, void *args, GError **exception); +int hinawa_fw_node_ioctl(HinawaFwNode *self, unsigned long req, void *args, GError **exception); void hinawa_fw_node_invalidate_transaction(HinawaFwNode *self, HinawaFwReq *req); void hinawa_fw_resp_handle_request(HinawaFwResp *self, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/tests/fw-resp new/libhinawa-2.2.0/tests/fw-resp --- old/libhinawa-2.1.0/tests/fw-resp 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/tests/fw-resp 2020-08-24 09:16:07.000000000 +0200 @@ -22,9 +22,11 @@ ) vmethods = ( 'do_requested', + 'do_requested2', ) signals = ( 'requested', + 'requested2', ) if not test(target, props, methods, vmethods, signals): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhinawa-2.1.0/tests/hinawa-enum new/libhinawa-2.2.0/tests/hinawa-enum --- old/libhinawa-2.1.0/tests/hinawa-enum 2020-08-17 04:54:11.000000000 +0200 +++ new/libhinawa-2.2.0/tests/hinawa-enum 2020-08-24 09:16:07.000000000 +0200 @@ -61,6 +61,12 @@ 'FAILED', ) +fw_resp_error_enumerations = ( + 'FAILED', + 'RESERVED', + 'ADDR_SPACE_USED', +) + fw_fcp_error_enumerators = ( 'TIMEOUT', 'LARGE_RESP', @@ -105,6 +111,7 @@ Hinawa.FwRcode: fw_rcode_enumerators, Hinawa.SndUnitType: snd_unit_type_enumerators, Hinawa.FwNodeError: fw_node_error_enumerators, + Hinawa.FwRespError: fw_resp_error_enumerations, Hinawa.FwFcpError: fw_fcp_error_enumerators, Hinawa.SndUnitError: snd_unit_error_enumerators, Hinawa.SndDiceError: snd_dice_error_enumerators,