From patchwork Wed Sep 27 07:27:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 145231 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2459212vqu; Wed, 27 Sep 2023 00:53:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqyOU7fkQMAL3mo79NLdkJnThePQCeDFbgBe1ifRj12QMULrsdGrBEVRJ2i7Cv+XZfAOD1 X-Received: by 2002:a05:6808:212a:b0:3ab:88a0:78f8 with SMTP id r42-20020a056808212a00b003ab88a078f8mr1956379oiw.23.1695801237644; Wed, 27 Sep 2023 00:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695801237; cv=none; d=google.com; s=arc-20160816; b=FXCmOYX0qs8rI+s1waljhiBk167YclPvfaSg+2KmobPp5YmUETmtIlD7r5C8I45vuf Kt7DDlALpl8ZdM4ZBklyuJOxp0WbTFvFKW53qG3WxlRNmSp/lL5FeHj5b8xO5DXqqwam SIzN0bys+fBp4QfjN9hf0RjWeeiUn+bEQ4T2w8/Oj56UXs4E+oBkzDU0S4/elCsMeZ8J qzh3gY/0toLxqQh7pheexF07qOJFP9Nyg4F9ELk2fEBBexUokkkwhJLIbwjL+AoPVpSi WQs+dJAXHDaOBrqQP7Mk8u86FTo1R13zJocRpq5eXirlbsH1vNeFASc81+Bvuf5V5Ncd 51gg== 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=YJEwHz5zQqxOgpvRlR3+vDJ11t/YDHX3RjoRSMmxB7Y=; fh=Xz1EdoVUu9a6vPcNLulbUrFshvK97XtCMO8IoI5me0Q=; b=ZijfPjCaBW3fnmukw2Zs0R1fWVm2rXxMGwSKNg78jgeumbBN4KPidGSCn2+PJNjuCO YazPgTfOzidAKXNxget2z8b4XuCfQGr0VYaPJj0XZY+8UbpuATg9VRYSVcMqPV+EKhHo 93RiR88jFcz+Eo+4um6/79Bbt+HgVBDY86w+EKXFhEIwDClDzlE12as92JBwFvqZftLn XV48p5Umu5ncbhdym282bguHhL2IlAnG1LJycLBnEsnoSimlmOEWh4ZcZtwSJtPINLWb jDUIVsLB61KSu1z/TDd0bvVlYrCtBJXcHqXjXyKreHqyfe+wZGihjtT0I+QdaDIvRv14 g72A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jebzA6NN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cr8-20020a056a000f0800b00690d8405fe6si9273915pfb.317.2023.09.27.00.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 00:53:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jebzA6NN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 5B5688206D75; Wed, 27 Sep 2023 00:28:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230017AbjI0H1z (ORCPT + 24 others); Wed, 27 Sep 2023 03:27:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbjI0H1x (ORCPT ); Wed, 27 Sep 2023 03:27:53 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD08D11D for ; Wed, 27 Sep 2023 00:27:51 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 679A6C433CA; Wed, 27 Sep 2023 07:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695799671; bh=zf7X1VsM2p6DLshh21G/x4EyyUc9kf8AVM6Iw7AWlMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jebzA6NNsRVeCxS5xU4oegqaX41KTORzsmRaXa/ZOq3WFga7T3Iu8d8nLifKHqOWD BWNqk5VdgD6w058hDo8bMSZp0ZBbBzahvFY8wDiNs3BXLg8GI6ngEDEecWHVt4dZHH 42ghehZ8Rc3lEGF5aiD0BdVOJIEXupddz0gdekkHioz4qqfHs4JV3M9UZ4cNxZrXJo ZyenBb1qjXDedkPxwtL9MXmVdDDys08q2YK1FMaL6aKiW5bnzjGcjD3GjCxVfn5UEP EtG8T6/WZqlxqtlGBuQlKBhosjG3WwCxi5DoEEd79kv12iJxGByhhdLjRnkt52UnsD iMug78dcxuzHA== 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 v5 net-next 1/4] net: ethernet: ti: am65-cpsw: Move code to avoid forward declaration Date: Wed, 27 Sep 2023 10:27:38 +0300 Message-Id: <20230927072741.21221-2-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230927072741.21221-1-rogerq@kernel.org> References: <20230927072741.21221-1-rogerq@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 27 Sep 2023 00:28:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778176478697906934 X-GMAIL-MSGID: 1778176478697906934 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: v5: no change 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; +}