From nobody Thu Feb 12 22:01:53 2026 Received: from wfout1-smtp.messagingengine.com (wfout1-smtp.messagingengine.com [64.147.123.144]) (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 7CF7C140368 for ; Thu, 6 Jun 2024 23:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717717906; cv=none; b=VNH/G3+XTx1wQsIeih89ozooAlENLMZ2TWFiqenFzLKpeGFYcoM0USgqI6L0DCeW9m3lQhRAxH2S+RQ4Sg3Km0kB8GZT7ykVIOBCZEHi+joljSDrzILpq2dah80eIGv/5Q5RbvXVXVPMAWwTQVSUiSntTqmOxanRYdxwUprFiQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717717906; c=relaxed/simple; bh=6wRulUaHbNwcxXaYzornt+OKK480U+ChQB+7e/cV+Tg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QPQ3Mo1OySU2v6jb/KY3Zb9VKq8lx0ejWaP72gU7W33o0Dc+3/4wLnfSTOV5u9KbO+JO52EUJRuuvHtebayHZbQEWwNfdX6GgSkx6W/v+CLa6VjsJDFUqOo+7fQ90JCw+rx2Npd6zikTpb0+eMVfNaIaui4k/hHmvsnOURJB2SI= 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=YoTiKpUs; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=A6Xot6D9; arc=none smtp.client-ip=64.147.123.144 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="YoTiKpUs"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="A6Xot6D9" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.west.internal (Postfix) with ESMTP id ACF691C000A6; Thu, 6 Jun 2024 19:51:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 06 Jun 2024 19:51:43 -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:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1717717903; x= 1717804303; bh=rc+1mBnu6UDgWW1vu+fZekW80szq7fBM/FdiSLXLXbw=; b=Y oTiKpUslqABHDtoTz3Q7VWHYR/RWX1/8kV21pLQu0MDy+BYc6dgVd2ACVvIVm79K rf2r2pgNEDpF5p6lDmlXSGxduFcDT+VniWM8fDwUG018dO1MPyIb8GcjqGa6HkNK tHiBMF4SwkTuiFK+Wkfw6YbP4Va2GbqLYWAxqxONRAJ60MBzBcrAqriem4c7FTVn ZjSK63jsJU+4YLdgN7vRx4XVlnEFyDQwyZXcsjPlubUoohIhT/BsEeccxOCo5MeA 1QlGNE71Wg6PuIOnCMw87unz1qJSSSIPr33vF+IZuu1tyiRCtlygsOg3kj9I1CQA 0js2ojOotK1LwHnlJhcOg== 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:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717717903; x= 1717804303; bh=rc+1mBnu6UDgWW1vu+fZekW80szq7fBM/FdiSLXLXbw=; b=A 6Xot6D92xdN2RvVoe/JJR/8VnavaDrsL9u37RgPFjOf7zk+Hqce+gokzUdu57wrX x36yvGWGjCmMqh9NmZZiWneUOGJy2t7iBuc3CstjAmK0HJSiZI2rd3+hkE4FmG8n WaEfl7FgGFnFmNklHPuetiudRDnjHl1pbaCZlvcCWNgi+zstANPtWZXMawF1hnq1 WSflNS5U57lhhRA95MzNOkCooQzFrSgl5zu3gM4teeCKAVbVQ4ZGcDL5Zixm/5eD SB3PRFnXAWd5l0sD84FIancKOmvdkQyrHTIxBSdURlHafABO8PUYq6o1897y8dPh l5oVBzPeYXFEqptNHM/EA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelledgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Jun 2024 19:51:41 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] firewire: core: use inline helper functions to serialize phy config packet Date: Fri, 7 Jun 2024 08:51:33 +0900 Message-ID: <20240606235133.231543-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240606235133.231543-1-o-takashi@sakamocchi.jp> References: <20240606235133.231543-1-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This commit uses the added helper functions to obsolete the existing implementation for phy configuration packet. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-transaction.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-tr= ansaction.c index 6868ff17dc10..5b80ca9d6230 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -30,19 +30,12 @@ =20 #include "core.h" #include "packet-header-definitions.h" +#include "phy-packet-definitions.h" #include =20 #define HEADER_DESTINATION_IS_BROADCAST(header) \ ((async_header_get_destination(header) & 0x3f) =3D=3D 0x3f) =20 -#define PHY_PACKET_CONFIG 0x0 -#define PHY_PACKET_LINK_ON 0x1 -#define PHY_PACKET_SELF_ID 0x2 - -#define PHY_CONFIG_GAP_COUNT(gap_count) (((gap_count) << 16) | (1 << 22)) -#define PHY_CONFIG_ROOT_ID(node_id) ((((node_id) & 0x3f) << 24) | (1 << 23= )) -#define PHY_IDENTIFIER(id) ((id) << 30) - /* returns 0 if the split timeout handler is already running */ static int try_cancel_split_timeout(struct fw_transaction *t) { @@ -480,10 +473,14 @@ void fw_send_phy_config(struct fw_card *card, int node_id, int generation, int gap_count) { long timeout =3D DIV_ROUND_UP(HZ, 10); - u32 data =3D PHY_IDENTIFIER(PHY_PACKET_CONFIG); + u32 data =3D 0; =20 - if (node_id !=3D FW_PHY_CONFIG_NO_NODE_ID) - data |=3D PHY_CONFIG_ROOT_ID(node_id); + phy_packet_set_packet_identifier(&data, PHY_PACKET_PACKET_IDENTIFIER_PHY_= CONFIG); + + if (node_id !=3D FW_PHY_CONFIG_NO_NODE_ID) { + phy_packet_phy_config_set_root_id(&data, node_id); + phy_packet_phy_config_set_force_root_node(&data, true); + } =20 if (gap_count =3D=3D FW_PHY_CONFIG_CURRENT_GAP_COUNT) { gap_count =3D card->driver->read_phy_reg(card, 1); @@ -494,7 +491,8 @@ void fw_send_phy_config(struct fw_card *card, if (gap_count =3D=3D 63) return; } - data |=3D PHY_CONFIG_GAP_COUNT(gap_count); + phy_packet_phy_config_set_gap_count(&data, gap_count); + phy_packet_phy_config_set_gap_count_optimization(&data, true); =20 mutex_lock(&phy_config_mutex); =20 --=20 2.43.0