From patchwork Wed Jan 25 12:02:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 48130 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp238941wrn; Wed, 25 Jan 2023 04:09:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXtFD0jVEG7vd0NQM6GHo7ZaA33g0ANw9FV6QcnGalIFhKxryKChtwzxtCI6QNIyNejTyFFH X-Received: by 2002:a17:906:1851:b0:7b8:882d:43ef with SMTP id w17-20020a170906185100b007b8882d43efmr41248568eje.0.1674648570410; Wed, 25 Jan 2023 04:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674648570; cv=none; d=google.com; s=arc-20160816; b=YFgUdqpA7Hc8cJXNi9NVSFBYpcYxfWpcbF59TPKPtsSFMzJ6Uw01ZXEwTWl2vJdDA+ zX7mJfQKHJ/i9YCggE0VD/LxwHd8o9VgzxcPRXn8oVxPN9AHVRpiO0ku+uck0pt+vYHp otzO161f5cgv9P9yDevWkZthjMnIxU4vdIJcoQDlg+qNCA3TpwnUpvqB7LZzPHNk4IeE SDqGuvPtgzlIgZh04+3KAEXTtRuhtKn/dIh70lhBTMTgG3rSyLbGpcRadFQwybQEakeT wDcBZ0mrsv3SLSXzLh8j3IeNkC2XTT25L0CfmacKoi6ORuSQjI3kIuZqESjr6IcSKPXx B/Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=vxkfReO71prrNWdj/ls9FxWUEiwc8tsI0fkpO1vRHYI=; b=oJvJEgR0tBdq2XDr68CDHQMjMgBuPEFp1R3gcqv4/4Wdrbza1Pq/nlbc8qd2kx2Bhf RpTdbfAdY1luW/K7YGm2867cuYrDAYM3VpL8JIxBJ5iWbQivUMCoVZ2VggQvUcou5RMz 5DlsL+p1DBuvIt/pnvHYqLpRItqELtkhCcFr7TR4uQLs9XzGcxwqKdecbQLag3aX4WcC ZOZPmV5x5WawqsfdCDsUClUDypKydtxcQ7RlCzGnXNNTnty0M4hcWQz3Z1HLeIN1HkTA fwnKPSF8i+wkN4vwPc4njqrud3MxyqRCNiHAnt4SHwqUhOyjWQzrHEBN7U8YXaKklEKU LM7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b=gCcUsXMh; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=mX6CP2QG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ft38-20020a170907802600b008327270a79dsi6746208ejc.423.2023.01.25.04.09.05; Wed, 25 Jan 2023 04:09:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b=gCcUsXMh; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=mX6CP2QG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235522AbjAYMDT (ORCPT + 99 others); Wed, 25 Jan 2023 07:03:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235247AbjAYMDM (ORCPT ); Wed, 25 Jan 2023 07:03:12 -0500 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D95CB5689F for ; Wed, 25 Jan 2023 04:03:11 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 50F5A5C01B0; Wed, 25 Jan 2023 07:03:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 25 Jan 2023 07:03:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1674648191; x= 1674734591; bh=vxkfReO71prrNWdj/ls9FxWUEiwc8tsI0fkpO1vRHYI=; b=g CcUsXMhP/iS0ZOgXVGbyoru3SKvETDxPDdO5Ehqp8ekpRZheA6+4TarNidxmBu0y vqpCRqBvfSOfCV5TNmKVutRDatHnzP0DjsCK2Pb79iilVJ8K9OTCfI10F7h42qw+ FMZqZVPJqkW1UNku6VtxOPXZMsYaci47IBfA4zS8Q8IJNx00aspL6/3qBOulcPtu BWb/zRjuvjttyt+05hugR9LU0c/RgPxp1BCIzcJU2b+3/UjuUC2smT69uWlSqPL7 ku5MYIoaoTX0UW4mPyhvdW6EwOPi0dfJpsLPiaOaz8twX4LN6h5qrqMRpLP4BXqV rCo8PYYfjRwpiKYPN4tAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1674648191; x=1674734591; bh=vxkfReO71prrN Wdj/ls9FxWUEiwc8tsI0fkpO1vRHYI=; b=mX6CP2QGKCJkbigXCYDQZXaVHQfZj AzXuA6i81ltjT2vf/dnG1WMPG2kGki7ljhKcGdpiuGe4TUox5LbV6eisuZVj3xvn NenozAQQkdAnZWDgPnIHQSqw3DiRdP79XMIrUbKY8enIL2UANxXfEWlJwZYlepsE FZL1Xh6/TkWiAB1GnPK9ANHHJrn7TLOSR06xkou/cm3kuwiGxEG0VMcPuVWy0aO1 gNlRcy9DIk9vptIStQ+5KhS35zhI5SfDzMkCHU7GhMcG2QhkxIwvH/wIFKL2jiWu m/D9jzeQuPGckLGzKezl4qSRVfOk3xzAZkPTC6d2vtEoNxiR5okZnQdFg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddvvddgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 25 Jan 2023 07:03:09 -0500 (EST) From: Takashi Sakamoto To: stefanr@s5r6.in-berlin.de Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, tiwai@suse.de Subject: [PATCH 03/11] firewire: cdev: implement new event to notify request subaction with time stamp Date: Wed, 25 Jan 2023 21:02:53 +0900 Message-Id: <20230125120301.51585-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230125120301.51585-1-o-takashi@sakamocchi.jp> References: <20230125120301.51585-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755996299373906449?= X-GMAIL-MSGID: =?utf-8?q?1755996299373906449?= In 1394 OHCI, the trailer quadlet of descriptor in Asynchronous Receive (AR) request context has timeStamp field, in which the 1394 OHCI controller record the isochronous cycle when the packet arrived. Current implementation of 1394 OHCI controller driver stores the value of field to internal structure as time stamp, while the implementation of FireWire character device doesn't have a field for the time stamp, thus it is not available in user space. The time stamp is convenient to some kind of application in which data from several sources are compared in isochronous cycle unit. This commit implement the new event, fw_cdev_event_request3, with an additional field, tstamp. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-cdev.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 88c8b5fac5e5..5a9446d30447 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -178,6 +178,7 @@ struct inbound_transaction_event { union { struct fw_cdev_event_request request; struct fw_cdev_event_request2 request2; + struct fw_cdev_event_request3 with_tstamp; } req; }; @@ -709,7 +710,7 @@ static void handle_request(struct fw_card *card, struct fw_request *request, req->handle = r->resource.handle; req->closure = handler->closure; event_size0 = sizeof(*req); - } else { + } else if (handler->client->version < FW_CDEV_VERSION_EVENT_ASYNC_TSTAMP) { struct fw_cdev_event_request2 *req = &e->req.request2; req->type = FW_CDEV_EVENT_REQUEST2; @@ -723,6 +724,21 @@ static void handle_request(struct fw_card *card, struct fw_request *request, req->handle = r->resource.handle; req->closure = handler->closure; event_size0 = sizeof(*req); + } else { + struct fw_cdev_event_request3 *req = &e->req.with_tstamp; + + req->type = FW_CDEV_EVENT_REQUEST3; + req->tcode = tcode; + req->offset = offset; + req->source_node_id = source; + req->destination_node_id = destination; + req->card = card->index; + req->generation = generation; + req->length = length; + req->handle = r->resource.handle; + req->closure = handler->closure; + req->tstamp = fw_request_get_timestamp(request); + event_size0 = sizeof(*req); } queue_event(handler->client, &e->event,