Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1493685lqo; Sat, 18 May 2024 05:49:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWTKNe6cp7yubsvONU4BpAHU3RVLT7KEvS6N0jQwH0BZ1gtIRqkBZjYM81MK8UAACLPqI3+SrebTN8odG3f6D5WsIOQ4LON1Gdgfreeng== X-Google-Smtp-Source: AGHT+IFL1P1qkpU91Zyd6+ZL/fcdBLeInMttddtgmvGP/7DXfP5N+n/33zjOQJs2/58fg0MYyWqG X-Received: by 2002:a50:aada:0:b0:572:a2ff:9656 with SMTP id 4fb4d7f45d1cf-5734d5c122bmr16953156a12.16.1716036575339; Sat, 18 May 2024 05:49:35 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733bead0fbsi10869689a12.105.2024.05.18.05.49.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 May 2024 05:49:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182869-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b="c/XjHcJS"; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-182869-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182869-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 196191F214B3 for ; Sat, 18 May 2024 12:49:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61FE778B4C; Sat, 18 May 2024 12:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="c/XjHcJS" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F0DE77108; Sat, 18 May 2024 12:44:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716036283; cv=none; b=kLL0KfiGviBrMQomZYu71+hR+ylflYPxvd+xcF6OVqkoC0yI1UWPiajYA+gZKVsdVqeHpbD4x8uzHxNYUNCHzB+1IWKyONqNN/YRfLn6/tjbvJ1sS3DbJtiOR6KzN9KE8pK/nJrhtUuqYalp471Nv8UniQgRtraqqeXhy6RvPsg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716036283; c=relaxed/simple; bh=VLC56HNR23jTHjwxpkGsykAqr5GIFETK1IINEPmsABY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GtAYjjd8otQc9/Y/wX4JJdZCoGp1xBlwO1OP5Q4WEOKsjHNK2zOTw2nRtrfnT/qN00ntunfNXEQ5/pfOUCNSZgD/EUdh3hvpwDRPdFUi43diT64fG2/631z6fhjjmLTm8HHZM2CRD5/uxHQ/zYVarO1a9AdNZ/hNCHwbgMTV32Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=c/XjHcJS; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44IChvhJ055020; Sat, 18 May 2024 07:43:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1716036237; bh=hJFQNo2lpYUFCMV7UOYccAwKmzAIdF5qSN5A6Wrlods=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=c/XjHcJS0R5fwjSfuZHMpxmVko6CwH0yaiOQOvIlB5oxLKvbh+xtXN4WqQH/t4nmJ h2uuy+Mo4jnUr9zXseNAGmV6Ht4yyrr2Ou+XcJfYvZUz037SkC45rm4GlYv/W8tmTG BZue67Zu2k4UYZkCFe9icMzUpm471OviKO32HdI8= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44IChviD051598 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 18 May 2024 07:43:57 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Sat, 18 May 2024 07:43:57 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Sat, 18 May 2024 07:43:57 -0500 Received: from uda0492258.dhcp.ti.com (uda0492258.dhcp.ti.com [172.24.227.9]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44ICgY9X041511; Sat, 18 May 2024 07:43:53 -0500 From: Siddharth Vadapalli To: , , , , , , , CC: , , , , , , , Subject: [RFC PATCH net-next 17/28] net: ethernet: ti: cpsw-proxy-client: implement and register ndo_stop Date: Sat, 18 May 2024 18:12:23 +0530 Message-ID: <20240518124234.2671651-18-s-vadapalli@ti.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240518124234.2671651-1-s-vadapalli@ti.com> References: <20240518124234.2671651-1-s-vadapalli@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Add the function "vport_ndo_stop()" and register it as the driver's ndo_stop callback. Signed-off-by: Siddharth Vadapalli --- drivers/net/ethernet/ti/cpsw-proxy-client.c | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/net/ethernet/ti/cpsw-proxy-client.c b/drivers/net/ethernet/ti/cpsw-proxy-client.c index e643ffb9455a..646eab90832c 100644 --- a/drivers/net/ethernet/ti/cpsw-proxy-client.c +++ b/drivers/net/ethernet/ti/cpsw-proxy-client.c @@ -1354,6 +1354,28 @@ static int vport_open(struct virtual_port *vport, netdev_features_t features) return 0; } +static int vport_ndo_stop(struct net_device *ndev) +{ + struct virtual_port *vport = vport_ndev_to_vport(ndev); + struct cpsw_proxy_priv *proxy_priv = vport->proxy_priv; + int ret; + + netif_tx_stop_all_queues(ndev); + netif_carrier_off(ndev); + + ret = deregister_mac(vport); + if (ret) + netdev_err(ndev, "failed to deregister MAC for port %u\n", + vport->port_id); + + vport_stop(vport); + + dev_info(proxy_priv->dev, "stopped port %u on interface %s\n", + vport->port_id, ndev->name); + + return 0; +} + static int vport_ndo_open(struct net_device *ndev) { struct virtual_port *vport = vport_ndev_to_vport(ndev); @@ -1391,6 +1413,7 @@ static int vport_ndo_open(struct net_device *ndev) static const struct net_device_ops cpsw_proxy_client_netdev_ops = { .ndo_open = vport_ndo_open, + .ndo_stop = vport_ndo_stop, }; static int init_netdev(struct cpsw_proxy_priv *proxy_priv, struct virtual_port *vport) -- 2.40.1