Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp712389lqa; Sun, 28 Apr 2024 00:14:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7pNMrCpExghTqiktdD1l22g0KAmKAcjDV0R9H85TpNyw33gfay5w2fj+Uo2ycT6ZxVwieJ5Q5hNdoyNUUC0MMxAcy9IV3fEzC7FJeQQ== X-Google-Smtp-Source: AGHT+IFJssNJ5BTJNawp96ahcDfJ4dwkOzNY+8dotPlxNPdh0X/aEYBkOq2+xJgpIcj7OknTPkym X-Received: by 2002:a50:8d4f:0:b0:572:4041:5637 with SMTP id t15-20020a508d4f000000b0057240415637mr2667020edt.19.1714288443665; Sun, 28 Apr 2024 00:14:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714288443; cv=pass; d=google.com; s=arc-20160816; b=h3ivEQq6VEYNUwwVj86CpB5srCNcZokdBoEc/i9opJsDiX3+tjV/DAJ+69PTjpwAIM 6fk1Ab/5vl/DwaqDBMLdrtuMu/NSRakbcS/s7W2vdVM6VDVmVjY6x8x1hH4KtSqoAoor TDAtnpEbYPyOuQ2+ymzgpNexPe8U9XqaDvK+8FBEx6LmEo8/JcHccUF4tKFlLr1acZEh M44Gu2pEriQMgkiM4qMFru+twXNaJFq9MmpWzHerRB/bRDqyR6H6VF4nPqiofFDfLJyp qUnuhXHxQYuqdW6JvRuq75oCe6dG41Lu5+Wv0wIRMFw2d4KRC6O0P2F99Soy7rs5f86w Y3Xg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:feedback-id:dkim-signature:dkim-signature; bh=KDmNy1AVOzmB9RMGBkgjMaqD0qRXGqGIyc3NwAF6bY8=; fh=5EQyDiYgg+kua2A2AF9eJME8jasrrRA/Pgg86y+lzvY=; b=NqjV7CiWoRS+7CE2PVp54t5cHf15WWLREfPJJvrQ6CLpG59o9uILimQ4k+ek3JYcqs WudQUu9sTXM7DWTfeo0zq2yGSeRdMyTiDR1GQH/1pk7cxD+8ZXrLVI7GqlpIiCdHm8n7 Urnv5OBuPu1TmtVAhfUJ+3XY0js82qCRHtKtVjn1+AqoR2g5fY65/w/Khqk8i/+bbdm2 zTe9KRgVzXxFzAlCr3ctiXQmVSFaXIVMXZJOBrponw6RbS67YhjC8JjIFL3pjqD/iWCX U3S/k2Mx+MZgCssnNKJE4gN5zsLkcdhWlAleL4GnDjGA5EU2ZBwu0LAWz7RLp0XqXxkM Ornw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b="iZBE7t/v"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Arzk1BJj; arc=pass (i=1 spf=pass spfdomain=sakamocchi.jp dkim=pass dkdomain=sakamocchi.jp dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=sakamocchi.jp); spf=pass (google.com: domain of linux-kernel+bounces-161296-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161296-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sakamocchi.jp Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v19-20020a50d593000000b00572345ed93csi4801952edi.485.2024.04.28.00.14.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 00:14:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161296-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@sakamocchi.jp header.s=fm3 header.b="iZBE7t/v"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Arzk1BJj; arc=pass (i=1 spf=pass spfdomain=sakamocchi.jp dkim=pass dkdomain=sakamocchi.jp dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=sakamocchi.jp); spf=pass (google.com: domain of linux-kernel+bounces-161296-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161296-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sakamocchi.jp Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6078E1F21AE6 for ; Sun, 28 Apr 2024 07:14:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85F335026C; Sun, 28 Apr 2024 07:13:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="iZBE7t/v"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Arzk1BJj" Received: from wfout2-smtp.messagingengine.com (wfout2-smtp.messagingengine.com [64.147.123.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 175464F889 for ; Sun, 28 Apr 2024 07:13:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.145 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714288435; cv=none; b=mJS0AsUGoDHjS5xYG32bdBRc9ueCKkYaM1LZVnz+VcCk7d1XEpKxLbXBgeG2a6ZENovq4063Zkv8Cr5Xvgp8jxrXuV6FYe36pIfF2l7x9g2FZFI0hdzrHpQ+oQ7i4+XIszvBhIH6MOuWsuMOU5ja/EPN+cX8ZHjrdb5oMv5L6E0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714288435; c=relaxed/simple; bh=zyQaPcFnCFxP5JA0dX1mIbA1AFWwAOuBdTMIvUywo8o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=r+guJ3aXrV5riUKJOyT3UZrA1EOY3IY/rszR4jWtYnq02+VsxWnoOTRupELCusH4NIQ69squGl86reI14rXVsE03XioNZnzYb4teKFx8gckrRYn2HpXEfUEMOM1fZpAIqN7wvNgOyvCAoihyLZl5/rdYC0lLA875HvSu+89wuOM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=iZBE7t/v; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Arzk1BJj; arc=none smtp.client-ip=64.147.123.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id 00F441C0010E; Sun, 28 Apr 2024 03:13:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 28 Apr 2024 03:13:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm3; t=1714288431; x=1714374831; bh=KDmNy1AVOz mB9RMGBkgjMaqD0qRXGqGIyc3NwAF6bY8=; b=iZBE7t/veACqUYIZXmHq2/Kw9v 817wcnRjHcUqdrRHfF3zZ4Vu+DARQpPTzwt2L4IT/I51+hbI0sk5Gsf6okI8IeHM P9slcgucOn1hB3KpzhtwUfMzwhlpcRGFPQfeN/GWsF0W+dhtTHiJE5qh8QaoNA0O 9VhtxBtfLtBv2pxqq2sDXanYbjVVqXoyDkImbGBnCBFVELI/xgZDsAxnzJ8xmA4q h9ZWiq3h31u0oOlAli8lAMKPRwpli+af5vZMbhWUtdQrAOKll7wwUcIqPL19/A+s Wpu8E8G9EoYqdkquGOS1V+UkGnd066zN8XFa+FYahUHCz7ci8YE+Mh6V79Fg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1714288431; x=1714374831; bh=KDmNy1AVOzmB9RMGBkgjMaqD0qRX GqGIyc3NwAF6bY8=; b=Arzk1BJj5F89lDd80+be6Imx6Fu872tbOrCYk9tpTrS1 NioyYQ11YQdzU1645a0ow5zUomW98/uqZWBHpIuuypjq43SM+opocw95fIUQPurV AktMB8aSTiO63NYPKDeGYZIYOSpuahDNyEwjN68RWjAPrWrRRYdlpbPlKdQ7tkGY NdLQSemzAj0NJ2rHT5EM5gIePlxA7LVX70wMAb9iniRXOHWpON52sOPndsnn/arJ H1pAiWJ9hvJGwsKXjZANQTsvT30iI7TTZ/R8X3oRMInx6bJdv3MsbqRDAo4/0HVe tfpGvG91Y/bkSt0SNCuSPa2ygORJ+aTv43f6Lh8jHg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddtgedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpeffvdeuleffve ekudfhteejudffgefhtedtgfeutdfgvdfgueefudehveehveekkeenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehsrg hkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 28 Apr 2024 03:13:50 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 0/8] firewire: core/ohci: add inline helper functions to serialize/deserialize header of asynchronous packet Date: Sun, 28 Apr 2024 16:13:38 +0900 Message-ID: <20240428071347.409202-1-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, Between core and 1394 ohci driver modules, the data of 'struct fw_packet' is utilized to deliver data of asynchronous packet. Especially, its 'header' array member is for the parameters of packet. However, the serialization/deserialization are done by local hard-coded macro in each module. It is inconvenient. This series of changes adds some inline helper functions to replace them. A KUnit test is also added to check them. Takashi Sakamoto (8): firewire: core: add common inline functions to serialize/deserialize asynchronous packet header firewire: core: replace local macros with common inline functions for asynchronous packet header firewire: ohci: replace local macros with common inline functions for asynchronous packet header firewire: ohci: replace hard-coded values with inline functions for asynchronous packet header firewire: ohci: replace hard-coded values with common macros firewire: core: obsolete tcode check macros with inline functions firewire: core: add common macro to serialize/deserialize isochronous packet header firewire: core: replace local macros with common inline functions for isochronous packet header drivers/firewire/.kunitconfig | 1 + drivers/firewire/Kconfig | 16 + drivers/firewire/Makefile | 3 + drivers/firewire/core-transaction.c | 152 ++--- drivers/firewire/core.h | 21 +- drivers/firewire/ohci.c | 78 +-- drivers/firewire/packet-header-definitions.h | 234 ++++++++ drivers/firewire/packet-serdes-test.c | 582 +++++++++++++++++++ 8 files changed, 952 insertions(+), 135 deletions(-) create mode 100644 drivers/firewire/packet-header-definitions.h create mode 100644 drivers/firewire/packet-serdes-test.c -- 2.43.0