From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09AAEC43462 for ; Wed, 31 Mar 2021 14:18:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCA4D6100C for ; Wed, 31 Mar 2021 14:18:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236047AbhCaOS0 (ORCPT ); Wed, 31 Mar 2021 10:18:26 -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