Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2238852rdb; Mon, 20 Nov 2023 06:05:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFap7E8qHzAMkkVqh7TaHdCUhM1Pof7syIY5j2/MfMPjFha8K/xRhXoFzA9bKnK8xsy+jac X-Received: by 2002:a17:90b:4c0b:b0:27d:66a9:3462 with SMTP id na11-20020a17090b4c0b00b0027d66a93462mr5250427pjb.3.1700489151553; Mon, 20 Nov 2023 06:05:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700489151; cv=none; d=google.com; s=arc-20160816; b=RW8zIXuHhWzImfiioZfSqpENpkxh3ghETGLRpP4VmgngbnJej8H/II8Hg97keVGW2D DkA2Q8HPaC3+yTHjBdjDfu8/tSV8DeqQ73aY2wpSvJomtbScJsBiS5cCra+HEycCwUY5 xlaYrqSXCKLbu6FKL1iukKpq76+q9f0S93k870OpTf34SEMvtZOS/wV4xbzEeUk1byqN yHICYndPtwh/HDCveQqrnGhoeDJib3SZzEL5LXy4YV6o9+atGk3GsP0tvibktL8a2cKy 8geeeSU+W16g49fauyuT4PY1WTi4/4szkHeCmKuGF4+z1wBO0VWEzQnFunsWbQiGLhll bMWQ== 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=5KHR9WPlZHJ6Zd/GvKiR1uAcF97T30F3ROf5+hX+jGY=; fh=MBzjsNH+995cDer5c3ttekGmovy69MPNXXMQ/0+f14E=; b=iBUAR6eOS8JKzo4CJKJqa+sTvDeU6NTtJ9SMXbAIFSQRYJku7MxqdxnXmSJkDFaO2s 61kGftur0iC/nYBVOtkIBUCR6gDCwM7Gkxl8Gfy/EZE7wCZupt7Jvw99rkE2TFt5mvDs KZVTj4IXsXnkyasWmgF9ZcnM3X8TY8+hsSA7b1y4l1A1JD1dxx/i92isCu5JZa6GQa4A 0Rjpe5TWoNg5mLvCiElrf2yUVgBfdQI8yQCzXc0JHpxbAsqlbvUb9AACe5DmKYCFIezU 8zW7hrATcw+n7wx/pPP7XigXJE3Ms/fXSlLo81sh54TkTReyMiI16Ru0UPtCbhmhV0gY ZMkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtVrLqVD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id z9-20020a17090ad78900b002850e97e25esi5246198pju.2.2023.11.20.06.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 06:05:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtVrLqVD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 8059C80699EB; Mon, 20 Nov 2023 06:02:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233423AbjKTOCU (ORCPT + 99 others); Mon, 20 Nov 2023 09:02:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233226AbjKTOCN (ORCPT ); Mon, 20 Nov 2023 09:02:13 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14532D50 for ; Mon, 20 Nov 2023 06:02:06 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CFE5C433CC; Mon, 20 Nov 2023 14:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700488925; bh=h1+hBG+HHVwQ0RwXweK1TgqeGFms2NK6HBD0zLnfwwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FtVrLqVDoRQZNMQ9wVx0WnuGJ6M2ZsME1xhmJXuK0bQOBParodvp4xe8/8XZP1aAG WzaSG0KmquppWOblUpUtC8v0Ugq3EjSbanIfL3I+5GJl6DwBmMmncdJjkFvXP0Dhxv K17fRcCzwIO9AQFeue1CMitW6qPZ2cL7BZAmVyy2Yj6X4W/PtExKIVbacsVr243vE9 XeNCAYKv0B63iMUN1O89DiuNjYEmnoJUhbU+9BR6iFD/3qSAtpVaxJvKKCdAoyMU7E c+DDguVXakZdb86IGmxP5ThzTQ6V/2kgfkp7H8+ZIkAidJ6NAY9w0XBGex6hY8cApt 8tIzHT5TMrFbA== From: Roger Quadros To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: vladimir.oltean@nxp.com, s-vadapalli@ti.com, r-gunasekaran@ti.com, vigneshr@ti.com, srk@ti.com, horms@kernel.org, p-varis@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Roger Quadros Subject: [PATCH v6 net-next 3/7] net: ethernet: ti: am65-cpsw: Move code to avoid forward declaration Date: Mon, 20 Nov 2023 16:01:43 +0200 Message-Id: <20231120140147.78726-4-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231120140147.78726-1-rogerq@kernel.org> References: <20231120140147.78726-1-rogerq@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Mon, 20 Nov 2023 06:02:37 -0800 (PST) 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 | 66 ++++++++++++------------- 1 file changed, 33 insertions(+), 33 deletions(-) v6: no change 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 3539fb31541b..2d083eaea442 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-qos.c +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.c @@ -772,39 +772,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); - - 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 (!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) { @@ -916,3 +883,36 @@ 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); + + 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 (!port->qos.link_down_time) + port->qos.link_down_time = ktime_get(); + + port->qos.link_speed = SPEED_UNKNOWN; +} -- 2.34.1