Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6309369rdb; Thu, 14 Dec 2023 14:39:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqN/gUZ+D2dGrR+eMcMBuGFO7lxqDpHrYW9ZvrpEgQkFQCSgmRYC0eUHKdIHkG2Q3T5NBD X-Received: by 2002:a05:6870:468a:b0:203:3c0c:8fde with SMTP id a10-20020a056870468a00b002033c0c8fdemr2879083oap.28.1702593547510; Thu, 14 Dec 2023 14:39:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702593547; cv=none; d=google.com; s=arc-20160816; b=QzWYxnVgXmn1OVcOcDNZguM1CvY310lkkWzOt7t2JGJ5Ksmsg6nsCpinZpDNalY3J4 2oUtWF1VQRM0QcwnWNilkTKKDEz68FUgd/aeNQlprmkrv4IYu87dkKZu8c6YtzBM0yrg gXKSPnHGUKform+87cBkWamlTt2ZxvMoRFITBFZaRANQhZgu6iu4Ye15ctmDRBcm9HX0 D/6/RWuTpV80LRMrRcqr7T6zS9ZpGB5W2QQh9wkXNddtBhRDA41biEE8IfvG+l74EZJ2 XiLLsKoqMpPAbVdQoCNpfPQyfYU6qKaNWs4OhPvbkn8qAPX/TUZN9TTmvFRR4kXDR7Mh iNbA== ARC-Message-Signature: i=1; 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:dkim-signature; bh=qO4xPzkioMy0PzT4rWB2kh7NbLXNeuluzCFbqlXn2HQ=; fh=utmrxdkgikAlLxVfQI1kldUG+rNjhrLN+3fAlOYj01s=; b=VHlMUYMPNb7bffVaB2nDE2qM6NOYr4s2B8J6FGE7xuYpdztXm4+rDYEVt7Ylz6A0s4 CPUtMrkCeUpTA5sQNva2w+6bWGP9ZvL0JAms5GEsy26NJDnc5ZqUNTs1nCbnlLNrKAuS M2Kk/fKWvNMfw8OJxf/KSnBxEBx5kj3h8RpsyWBZSBeHW+h5Rzgj1NbIfEL0v/kU+Qfa ZXRBUnOYLvrHYZ6rnhXDKyhQwrRA1C+8BeH5/YcXlMq7bL+1zKKtI9vmlSHY+3ERba5W BDYDgtep9/oxdZbJoIFsKOs168eECukBhjrDN5rIt4myjSXP3gw8RU79LYlYiJlhZaqu 8nQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=c89FoXZc; spf=pass (google.com: domain of linux-kernel+bounces-199-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l22-20020a656816000000b005c626128e67si12136800pgt.494.2023.12.14.14.39.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 14:39:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=c89FoXZc; spf=pass (google.com: domain of linux-kernel+bounces-199-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2A2B7281414 for ; Thu, 14 Dec 2023 22:39:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB7B16D1DE; Thu, 14 Dec 2023 22:38:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c89FoXZc" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55D11697B7; Thu, 14 Dec 2023 22:38:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40c69403b3eso498495e9.3; Thu, 14 Dec 2023 14:38:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702593513; x=1703198313; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qO4xPzkioMy0PzT4rWB2kh7NbLXNeuluzCFbqlXn2HQ=; b=c89FoXZcyfqrWfKDOGF7TUCkQnLCe/FVUgos/W63Ss4G8eN9oPk2dbGai5CiERa6nz 4CMqELW8zbkJ9Z0JUxqJTOOfcw9h6cFi9fQrePNOsXY2NwsxIMYCG+wkZzMyWtO2aPuP NGZVKJNTQ0/UQxsnmJFzPgNLxV9bd39YlmgT44qIDu7uEGlHU2o7ScT3fHDY3JiD5mUQ 2XGc1ttKGx4KpnsLoEKtYifyCT6ra4G7WJbPG8JX0GWVVLNgGeR7gSiGmQY78oZapshd wrsXhNW0usNH4672bO7a0IJSRG4tiiHeOkrvhHH7yCZSQmjSt0+5HEG250iq+65Q5cZb MnZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702593513; x=1703198313; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qO4xPzkioMy0PzT4rWB2kh7NbLXNeuluzCFbqlXn2HQ=; b=YZc+pzpPhAQSCDmg9soF7qEB3HBbSttQplYskn0+diE1egz8OXRZpSlGpXZL1mfvid 7f98lCBPH72nbi1u/J28VS/5jSCb+EbK8PzT/1q+TZPkBcsJFhadLO0Ck2J4taBCmKI2 w+Jhl8s5FyHPcs1uUUZOnL9hKhfAF/7q3Wk4m5VokKzdDT/33x8N73k4MO88vm6OhliN EpFgxYFFbBxUNqmnOtQMTmYWWT2RXObqsc0AUvz2iyakHqMPepIAtRyJ67TUkcuIKLGl 0xdysN/d5943FhmCyEu27uCxRfsznMZm7fLwR1zzMOb86Utv0BqCBzTP5JIKYgC+pAzI 2SCg== X-Gm-Message-State: AOJu0YyxhDGb3HuWC8Ao0k46FdnmVrXKt9XWRQ+iktVOH32pD45YN+5o qNHJwcIBxzmw1079mFSc2JU= X-Received: by 2002:a05:600c:1f1a:b0:40c:31f1:145c with SMTP id bd26-20020a05600c1f1a00b0040c31f1145cmr5011841wmb.169.1702593512901; Thu, 14 Dec 2023 14:38:32 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id n41-20020a05600c3ba900b0040c61ee0816sm54746wms.0.2023.12.14.14.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 14:38:32 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [net-next PATCH v2 0/3] net: add define to describe link speed modes Date: Thu, 14 Dec 2023 16:49:03 +0100 Message-Id: <20231214154906.29436-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is a simple series to add a way to describe link speed modes number. An additional helper is added and the phy_speeds is better documented and expanded to return just the modes number. This is also needed in the upcoming changes in the netdev trigger for LEDs where phy_speeds functions is used to declare a more compact array instead of using a "big enough" approach. Changes v2: - Drop stupid enum-define hack - Introduce helper function - Document phy_speeds function - Extent phy_speeds function Christian Marangi (3): net: phy: refactor and better document phy_speeds function net: phy: add simple helper to return count of supported speeds net: phy: led: dynamically allocate speed modes array drivers/net/phy/phy-core.c | 50 +++++++++++++++++++++++++++--- drivers/net/phy/phy.c | 12 +++++++ drivers/net/phy/phy_led_triggers.c | 16 ++++++++-- 3 files changed, 70 insertions(+), 8 deletions(-) -- 2.40.1