From patchwork Wed Sep 20 12:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 142387 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4096455vqi; Wed, 20 Sep 2023 05:24:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQDSW+kjjN1uivwsYaSPXs9YeI/sPi2+yFF2DtPMm6nu6j2PW98Xn1v7l8Zz+AiSwBpzt+ X-Received: by 2002:a05:6a21:3d8b:b0:137:3c67:85d7 with SMTP id bj11-20020a056a213d8b00b001373c6785d7mr2344686pzc.16.1695212646046; Wed, 20 Sep 2023 05:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695212646; cv=none; d=google.com; s=arc-20160816; b=Rn0sjoH8Mt6OmUKshxVHbkxbT+8xcVxXo5eRS+VgauN3Vl8ishnXphWpJkvvB6UbcO gOdgOOdexRUsNET/OSph11Yuz+fb+cVP5jBxT/QjCZpqkQAb/VQlcxKUrF9QVl1ATjum siwQvUIYwQ6ckN0D0gPBT1JtCPvt6roy+EC5aBqUtJE3iOEWw60rL6WbXrHwvuChxsQM kq1yfyZ+Agx+p+MGLty99Nl6KzuQVKqE1/yHjSQfYHdkzm2IQ9Oi2EK4yZdXhkf1aug0 uUyKQGKyPFRQdcs5EZvTOlRrKy2UkDDSNcJBvd8WC0cfxfm3xFXP7jlXMsO4Kt8ujzcq uezQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3c/iEIRq62I0fluyrtlPEJ7Pvvf/IQdAUPtOxoBTMTg=; fh=Xz1EdoVUu9a6vPcNLulbUrFshvK97XtCMO8IoI5me0Q=; b=RSW/DR69YPkq7+lyNDvlBOgDgiUpipO5GOoU9ayC5SwfaB5rImk8UnBv864qCm6sml 8frRTQEjFqT4HehnUtuVmtadVp1Mt0JL6YAkSYl3dS9q2+y2Zq1gZDiyJLdXW+/zpQco lYzt39Kdybkvk/OBLalh3dvhEHH6ZC8qNYcBsSZi9kcfXbTV9w1bYviiMO7MEaOQ0t3o nZe6dlyc5HBeZ+RgIWAq+OMzZyYfOiGi9YNlSn+OgoZU6w2XRnIoPL6f4+3IK8oy1ZkR 1u7zIcmCPN95XuUYEYm1M0oO8JK3I8zA294IiRPBP2xAatsNKQ+brnYXVSxk2u44rueF nALA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WOroctKL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id 66-20020a17090a09c800b00274ac0df61bsi1464733pjo.122.2023.09.20.05.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 05:24:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WOroctKL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id CD299804C531; Wed, 20 Sep 2023 05:16:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235487AbjITMPs (ORCPT + 26 others); Wed, 20 Sep 2023 08:15:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235472AbjITMPq (ORCPT ); Wed, 20 Sep 2023 08:15:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 407B5D3 for ; Wed, 20 Sep 2023 05:15:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFAF2C433C8; Wed, 20 Sep 2023 12:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695212139; bh=1oPS4RXR1qRlYTWkwg8XCNynAbh4/P2cvwtE58r78yY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WOroctKLy1ic9YAW/t8Jr7+dtcE7JjAxchTjScAhKpFa5fcjrkyc/8mKUJie6Pjaf E/HkBMVKG1/1YYkdcKY4drxzyl1vmjadq0kz1ToSDQmsp/0epBgMAVPFks9bbThiKW Q7ko0Zhy21eqRyBtIXvvmGz0DiQTfrZq4dvid1RAUVxdCwKIlh+ozcvk9uKH52MRQC 431yqxU2kXZPU3YMXR5ZDsl4BT1BcDxrzlAKxJ6VzU3381lZTzPxb7LC75RuxiXbHf F6jdCkbkw5ifMQtxQSkwBL+ktLsjTzCuTF12MKNGJIhQVhaCQWT970PGcbHKOoiaob EQRqs5zw5VIew== From: Roger Quadros To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, vladimir.oltean@nxp.com Cc: horms@kernel.org, s-vadapalli@ti.com, srk@ti.com, vigneshr@ti.com, p-varis@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rogerq@kernel.org Subject: [PATCH net-next v4 1/3] net: ethernet: ti: am65-cpsw: Move code to avoid forward declaration Date: Wed, 20 Sep 2023 15:15:28 +0300 Message-Id: <20230920121530.4710-2-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230920121530.4710-1-rogerq@kernel.org> References: <20230920121530.4710-1-rogerq@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 20 Sep 2023 05:16:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777559295389123117 X-GMAIL-MSGID: 1777559295389123117 Move this code to the end to avoid forward declaration. No functional change. Signed-off-by: Roger Quadros --- drivers/net/ethernet/ti/am65-cpsw-qos.c | 78 ++++++++++++------------- 1 file changed, 39 insertions(+), 39 deletions(-) Changelog: v4: initial commit diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.c b/drivers/net/ethernet/ti/am65-cpsw-qos.c index 9ac2ff05d501..f91137d8e73b 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-qos.c +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.c @@ -787,45 +787,6 @@ static int am65_cpsw_qos_setup_tc_block(struct net_device *ndev, struct flow_blo port, port, true); } -int am65_cpsw_qos_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type, - void *type_data) -{ - switch (type) { - case TC_QUERY_CAPS: - return am65_cpsw_tc_query_caps(ndev, type_data); - case TC_SETUP_QDISC_TAPRIO: - return am65_cpsw_setup_taprio(ndev, type_data); - case TC_SETUP_BLOCK: - return am65_cpsw_qos_setup_tc_block(ndev, type_data); - default: - return -EOPNOTSUPP; - } -} - -void am65_cpsw_qos_link_up(struct net_device *ndev, int link_speed) -{ - struct am65_cpsw_port *port = am65_ndev_to_port(ndev); - - if (!IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS)) - return; - - am65_cpsw_est_link_up(ndev, link_speed); - port->qos.link_down_time = 0; -} - -void am65_cpsw_qos_link_down(struct net_device *ndev) -{ - struct am65_cpsw_port *port = am65_ndev_to_port(ndev); - - if (!IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS)) - return; - - if (!port->qos.link_down_time) - port->qos.link_down_time = ktime_get(); - - port->qos.link_speed = SPEED_UNKNOWN; -} - static u32 am65_cpsw_qos_tx_rate_calc(u32 rate_mbps, unsigned long bus_freq) { @@ -937,3 +898,42 @@ void am65_cpsw_qos_tx_p0_rate_init(struct am65_cpsw_common *common) host->port_base + AM65_CPSW_PN_REG_PRI_CIR(tx_ch)); } } + +int am65_cpsw_qos_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type, + void *type_data) +{ + switch (type) { + case TC_QUERY_CAPS: + return am65_cpsw_tc_query_caps(ndev, type_data); + case TC_SETUP_QDISC_TAPRIO: + return am65_cpsw_setup_taprio(ndev, type_data); + case TC_SETUP_BLOCK: + return am65_cpsw_qos_setup_tc_block(ndev, type_data); + default: + return -EOPNOTSUPP; + } +} + +void am65_cpsw_qos_link_up(struct net_device *ndev, int link_speed) +{ + struct am65_cpsw_port *port = am65_ndev_to_port(ndev); + + if (!IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS)) + return; + + am65_cpsw_est_link_up(ndev, link_speed); + port->qos.link_down_time = 0; +} + +void am65_cpsw_qos_link_down(struct net_device *ndev) +{ + struct am65_cpsw_port *port = am65_ndev_to_port(ndev); + + if (!IS_ENABLED(CONFIG_TI_AM65_CPSW_TAS)) + return; + + if (!port->qos.link_down_time) + port->qos.link_down_time = ktime_get(); + + port->qos.link_speed = SPEED_UNKNOWN; +}