Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp443326pxf; Wed, 31 Mar 2021 07:19:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5R9wlOWhC1m4nxVNWjHe6aZverant8NCJ4lXyKNZzPqkF37wgE0O4oOzfWj1WqeP5nlCK X-Received: by 2002:a17:906:2818:: with SMTP id r24mr3779796ejc.502.1617200381564; Wed, 31 Mar 2021 07:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617200381; cv=none; d=google.com; s=arc-20160816; b=CYaTmWpOc0QEXlJDQBNPiYPCZ5zchPiru5P+0BZ1Vqpanhi4z8kggZkWMOAf1BYqNc /eWKp3nmbEjyLKMDxSqUZbVtlB9C+Q3qEIzje/FLg1zwSHucsMbnnNaTFl3TonIMRQYE 0rcRbAmNSpyrbrS9tla7sl6QaO6c/h1ty93iPaz8ytvn410x9RwimXEMLWsJScW0leUW G7jn1/mppwEx5a7qhrbP2BeKxMa8FW5kDF1eQSPgrdz8pA829+4lcCviNp6bff+xgu9w d2Y6y0aDDs8d6aCmWj7HKM1DiwJKuGs6rVYpzyoYWeQ/9dgAz4r0eSBAMQHFjLRQejhG B9kg== 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=lqRDVAD/1UGFoeCPwAmzbv1ZmcW4rdG5j1q5udhrCMI=; b=CZFqHkfSXeI9fbVVK++GAVDKoAm6+MPrJRsXet+nConhhgZ7tpRMB8WukCcB7Bz3tU RgKBaGSho1fKGKYsSTdZ+buaK1ZTB+XTR0gQ4kt2Uw0VBUwAuPHhoHiw+cvaBYkvKKt6 8EUjIn32ZsynePvhC27FAnFQVKNdd/zW9cAFdJmLX8cJFdKXWJUDhpbsaZahhthW8bt1 g8Ol1CS6Y3FOkRRq3AiWP0aaXJhL7W55XFiljePcLD0qlWiYgtucCtLevogbFQW5gZbS MEeZGzqw3TCA9BfGOjk3EbwPgJZMkwP1asIzdaYna5JHhySstdYtFmzbAPJUpFxKUorh BYgA== 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 w22si1822491edd.295.2021.03.31.07.19.18; Wed, 31 Mar 2021 07:19:41 -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 S236043AbhCaOSZ (ORCPT + 99 others); Wed, 31 Mar 2021 10:18:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235948AbhCaOSJ (ORCPT ); Wed, 31 Mar 2021 10:18:09 -0400 Received: from hs01.dk-develop.de (hs01.dk-develop.de [IPv6:2a02:c207:3002:6234::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C07A5C061574; Wed, 31 Mar 2021 07:18:08 -0700 (PDT) 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:17:53 +0200 Message-Id: <20210331141755.126178-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 the clause 45 frame format