From patchwork Fri Dec 15 13:29:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 18129 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9274287dys; Fri, 15 Dec 2023 05:30:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+ttb0c3WDbuCFw1nC0rjumMtuYyKfK/o0sYEpWxyC/aheI1o/NCMpPmkjch7UXbRGjtL4 X-Received: by 2002:a17:902:e54b:b0:1d0:796c:b06d with SMTP id n11-20020a170902e54b00b001d0796cb06dmr14089464plf.7.1702647038207; Fri, 15 Dec 2023 05:30:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702647038; cv=none; d=google.com; s=arc-20160816; b=EUr7WFanStYDMjGDqPMF/HgidqQXnp8zHki+f8+qYoJpuqjCAADyDMfZHoEhawFtIX pvdu07ihz/+LSAx4TUf8Gxfk4fp+18/sMQxS0V18D7Zp9MhK6Ru4CnaWX4XH+1OcBk3z sE59mckBVaYxJ5GwCbUokXfXt33Bm82p9blt5AczrMnw+14+14QU0QznOIf9pl67EQPK IczJKeYxnbfGAVME2TOYdp12FjdOf6K5B7q8DMfQdCcPTD1eMr24ukTns03MpjCnB62b IzrJlw8Z6lIA+rCJVbaFsG1u2S6CwHHCORYHcqBkRpR3/Kv4ACtp5XjHdFCBNLluYzmr GjEw== 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=jiK3vZ0YhAGGRMudlZG2mTaCFhn6zk+5XFJeIalCQN8=; fh=utmrxdkgikAlLxVfQI1kldUG+rNjhrLN+3fAlOYj01s=; b=ATxLHD2MP9aN03AS4Gwag+DH2CUHobHb3huSF7pgB42i86/8P7bpnLJrV9nBehHYgS Vo3rQBA6xcvPnELdVOuHHmgzpS/hnZvm1fVl/53ZUWuaOtMqdWvK6tGyK2N+c2RBND4k VCOvTHpBMaVwZO+2Wdr6J+7HJCHACghvZjFo0p+F/1sIaTofG9H6C7/Fn4PTO2DNUYFr qp76gadlLkTfN4MMiTWGSzbe4m+r4O51w8JlavfncBZ9dE4XDZSTOwT2D2suZ5wmP4h8 oc5rokr3DjeFDUpaJ+jc9PtqG6ZsDu9l9GK3t0x1ECQU9Ov72rZnWwSkqaDdS94Ha7QH kWbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mh8AHGwe; spf=pass (google.com: domain of linux-kernel+bounces-1014-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1014-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id pv7-20020a17090b3c8700b00286abddfe10si13608183pjb.8.2023.12.15.05.30.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 05:30:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1014-ouuuleilei=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=mh8AHGwe; spf=pass (google.com: domain of linux-kernel+bounces-1014-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1014-ouuuleilei=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 F1D0C285857 for ; Fri, 15 Dec 2023 13:30:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F29ED3034E; Fri, 15 Dec 2023 13:29:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mh8AHGwe" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 BF4AA2DB74; Fri, 15 Dec 2023 13:29:39 +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-f47.google.com with SMTP id 5b1f17b1804b1-40c6736d10fso8167145e9.1; Fri, 15 Dec 2023 05:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702646978; x=1703251778; 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=jiK3vZ0YhAGGRMudlZG2mTaCFhn6zk+5XFJeIalCQN8=; b=mh8AHGweS+r8h0FkrRM6QsJbNPEVL7uv/qteEO8c8GMOO+TPCALD1CKxImLS83qmc4 bEaFceuKHWQaHOGLNdDK+yDc9nOAJ0i68mDFvxCqz3/w2Yy3860gAouyS7eq7T/MhlZ0 nmJq5nzzDGRQmvDV+VC7alFuMztnHZOfdeDaLaHtQjK4/xCgIAWWY5R+7fdDu7llfsf2 98I236paPseDfHC1ekbu5teEmWiTjaIKtUonXU6ubpcwhKaH5Ji0cbq5+gXaZzT3kGMw A86kajGCykZnHBdIRjIk9DCRcOf3GoX5QgBiLnOXknWFVjYTNfVh823Uv32PhJnl/P25 SZbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702646978; x=1703251778; 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=jiK3vZ0YhAGGRMudlZG2mTaCFhn6zk+5XFJeIalCQN8=; b=GG443K62hQZRoN5epu7jNVW97VACn74ZGVznO6SHS/zHHzMmfM+jg0sn+3U3GGsc++ mhUXAVNZMVsJhWgyRN4gwSzMgIPd9reUFST1Gj50MPooDbFz253EcT+O79G7+fAzW7HR UVBvAORHQ+VKu40DOn7w4BNrcxjaUkFlZbnkyf+yMKmhIWmAxdBMXW19P/oD0749Q0Yb IBNHEVrWUHVwZD/SJ4WQzUKQemOanEWPhkB3fCkwKsfaTWeSS7yw9VU9+7Vvx5BvAAtT EF1AI7FJZd5jvxvfEauAgXYXgYgQrWCCxZ+2PZW2mm7wYyQN9pr5kH1+9GkH0Gd+ve0g pvJg== X-Gm-Message-State: AOJu0YyM7x/yp5YUwTKGYlP37b6uWSgyF6tVxH7eHozWVWvJHCLW+Qve yXzG+TWzlEig6dmSFVHhP8w= X-Received: by 2002:a05:600c:3148:b0:40c:6b55:29f1 with SMTP id h8-20020a05600c314800b0040c6b5529f1mr500533wmo.135.1702646977578; Fri, 15 Dec 2023 05:29:37 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id o3-20020a05600c4fc300b004042dbb8925sm31434543wmq.38.2023.12.15.05.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 05:29:37 -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 v3 0/3] net: add define to describe link speed modes Date: Fri, 15 Dec 2023 14:29:18 +0100 Message-Id: <20231215132921.16808-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785354820799081685 X-GMAIL-MSGID: 1785354820799081685 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. Documentation on the additional helper is not added to the phy.h as suggested from another patch where in double documentation define .c is preferred. 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 v3: - Fix various compilation error (wrong revision pushed) 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 ++++++++-- include/linux/phy.h | 2 ++ 4 files changed, 72 insertions(+), 8 deletions(-)