Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp447601pxf; Wed, 31 Mar 2021 07:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVgoztIWFxWX6tpNQUBI9qh3TNlPVXtzaHDUPVA5i0u6NkvWaEAZFnULFgQlQ/FonSZeLF X-Received: by 2002:aa7:cc98:: with SMTP id p24mr3995635edt.187.1617200739430; Wed, 31 Mar 2021 07:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617200739; cv=none; d=google.com; s=arc-20160816; b=ssOLg4j14S77h7trJPb/ATSNtltmhQ2hVNv6zDlf0EbuEae/Fk9pCWFptHv4H/VxK5 UImLBkkohuzF8IsSYDlyDQKBiY2R/A6xxtVkSkwotw6IKIQgT0G6P5FYDQGcJrp+o6uQ hx2T0KXFQ7g++b3aW+YD8MDhk895md3Yz0OowZAVV4gw9MjuX9T0Fs7UQpdHP9ymemYe 3RUIejAo3khwYS5kNSpVlnx5k7hYYQgG2nM4u0dSjDDW634P4+XiaebHAhVPxYyl8H5p elYL5j2gNwfXBIP6gNGYMUKEfCAK/ZWGGikdve33Nisn2rxBPku3erazkLh4FI/kAcBn lslw== 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 :message-id:date:subject:cc:to:from; bh=PTZ3elTrg8C/x/UJe+17zBrCulpE7USR9iyAJXPL7gE=; b=SbrpXzQVczgezTw+dZM9puGHEoMM45uoMMM9b3HM0HuB90qLL+0f9U6XQzpV8TyoC9 2N0FAsJsv0NUNlPLD8pb/kXTg8bg5zh+Qnj89GrpJuS8aXevD0DFhXCmHcYu7BVv1fm/ fbHk2/Xz6hWq5OnIhT3Qbj7GtbS5H5z+GQ9VpO2wbWyWi+H9UGyI7/2hNOvveAAfQVpE lkfV04W8rfYq+tb3bHrP4QYT07gSdc/9+q3JbYI/x87RCPh6+FRD++qRo/9wfx6r/GdM Cv4NOCKZTFWLb+4MrKLUkZfNMdKBxZjZqR9N0OBPlxcYxsp9x2JWLppFjENfwqaDnwGT fj0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si1875808ejj.228.2021.03.31.07.25.15; Wed, 31 Mar 2021 07:25:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235968AbhCaOYT (ORCPT + 99 others); Wed, 31 Mar 2021 10:24:19 -0400 Received: from hs01.dk-develop.de ([173.249.23.66]:50312 "EHLO hs01.dk-develop.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235114AbhCaOX4 (ORCPT ); Wed, 31 Mar 2021 10:23:56 -0400 X-Greylist: delayed 505 seconds by postgrey-1.27 at vger.kernel.org; Wed, 31 Mar 2021 10:23:55 EDT From: Danilo Krummrich To: linux@armlinux.org.uk, davem@davemloft.net, andrew@lunn.ch, hkallweit1@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jeremy.linton@arm.com Subject: net: mdio: support c45 peripherals on c22 only capable mdio controllers Date: Wed, 31 Mar 2021 16:14:48 +0200 Message-Id: <20210331141449.125692-1-danilokrummrich@dk-develop.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series adds support for clause 45 peripherals on busses driven by an mdio controller that is only capable of clause 22 frame format messages by indirect bus accesses. In order to do so we - change the name of the field probe_capabilities to capabilities in struct mii_bus to represent the bus capabilities in general (not only for probing) - add functions mdiobus_*_mmd() and mdiobus_indirect_mmd() to handle indirect bus accesses - let mdiobus_c45_*() functions check the bus capabilities in order to decide whether a real clause 45 bus transfer or indirect access should be performed - use the new functions to simplify existing code a little bit - and finally allow probing for clause 45 peripherals on busses that are not capable of cause 45 frame format