Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp196385lqg; Fri, 1 Mar 2024 02:22:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXBqQPY4hLK11bnxavD4aIvnEz9OXnKWeRDXRdgSOIyrOevzIweW0p8Rxw2/cD0PYJjWmhnE8FAg3Y7OBEJ9mo1LYXlyK8vXWipZG29wQ== X-Google-Smtp-Source: AGHT+IEPwn3+cDTJqnXoG5M5XiU8Xptx53wMi5ffAXC/mwvCJuEG6yRzbAfPLPXmWGCX4CZR4ZdW X-Received: by 2002:a05:6358:761e:b0:17b:57ee:7b7e with SMTP id r30-20020a056358761e00b0017b57ee7b7emr1317546rwg.26.1709288562030; Fri, 01 Mar 2024 02:22:42 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h14-20020a0562140dae00b00690493ddf90si2797958qvh.429.2024.03.01.02.22.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 02:22:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=lAMTiEsh; dkim=pass header.i=@microchip.com header.s=selector1 header.b=PoiOs93x; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-88248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88248-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7584E1C210C1 for ; Fri, 1 Mar 2024 10:22:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DADA66BB22; Fri, 1 Mar 2024 10:22:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="lAMTiEsh"; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="PoiOs93x" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 C5A096A329; Fri, 1 Mar 2024 10:22:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=68.232.154.123 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709288546; cv=fail; b=kfgDrS6s8ssAlElmHsrlv+f3FuNOCao79/jnrAe6HYgjMjeWDRYBCcRYlAAdHHztJzgX05MGraPTmNqwbvo2JTYt64fshnX2rlXty2h5eU0kygzRr9G1s+UCBnC4DNisHkGq7JROneHCMRRtmiU8vTkXiKsqXlfErJqRV5+kEWo= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709288546; c=relaxed/simple; bh=wUy0Fz+uPKxvqjOQbATv8kfiZCkBdxohnwWlTq8Zjm8=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=I01suJt8sS7RL2Hk/HENiDxwNCubEtTAcLU4YoGcl17GllnIHFqIOWtm6K2qlaOz3irYplC9diGroD6Wcn+bkpenYhd9s7RZrn2AwYXmvnzb7ESA+E3M8lueDXmm32E5L9FjLpPA9oOCMUhbnUZ1I3Ue8US/NXwjKOl9jSCoRfk= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=lAMTiEsh; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=PoiOs93x; arc=fail smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1709288539; x=1740824539; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=wUy0Fz+uPKxvqjOQbATv8kfiZCkBdxohnwWlTq8Zjm8=; b=lAMTiEshtzWdq18DVRGmgdKe2qDE0D68cOajg2C03ggxU2OUo21+zied BMzkDN0w75wL2ChmfRjLs9c7J2WzsKWtsQf+qCa/Ks6yUiXsdGuCRsTj0 0OuzyN5V0vI/1Kh9iCyzxqOtx2TQ+2L1mTtKylBvlF2fKXu6hWXFHU/Vd 8LAS7Jopk7fSrMzgRtJTPU+XE321vXTFpcfMJaE831Pc0HbWwoYGqj193 rBD2xLMDiZ0Q9wXzZrbnpVeU3x8Vn7nXlXifm3Wyxzgba5VnD54DGlCDk cmDhqbTjQaWGBjgaOjC2tI4TrBz3P3yww4QF4bYi/ml+pAfkkCVi7kiBH g==; X-CSE-ConnectionGUID: q0rvypiGREO/8CMLoqAkLQ== X-CSE-MsgGUID: rSDdpkQlTFCCEUHmhx2FBA== X-IronPort-AV: E=Sophos;i="6.06,195,1705388400"; d="c'?scan'208";a="17597368" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 01 Mar 2024 03:22:17 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 1 Mar 2024 03:22:13 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (10.10.215.250) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 1 Mar 2024 03:22:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TQBsFkjpoCNmG6/mOTphgpxxaK+wNpHJn6p0XVbFu+Ys5DHF8Txvqe33twtpxazKSjL760Sn8XD0TEJS4OfKUOn0S9n0XDWKn7CCm7ha9tCnF4Zjy4ZVUnnsHv+kMVy4zqWnPp+YC3DZbSwlmWt8KvgpbCNP4fQVPL45R6IjehOw1c3EQPqSWVMSjdgOA13g0waagy6lMx5FpPHIERaDpKZomE3iM6NVufI2bEPJPBO0oZEMhHd3JBG1kFRK+Tkm3AyLOYl6oJsZR0Wg+hBwF4JbPwz8wOibOsyK2oJBLJo6kCS+wFvuuPJDsx1kFV5kGjA7BmpydnchKjo0cEuL/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RkiM/8MQMyLrBGCNVHK99ljGvm+imT0A/88oduXr9PI=; b=OWReEOoa2p/rc1qZlqmXBlPPnC1MHlS7yG4rj78jDOZGsswJWvSKJzKoDLxqgfQqMNr8++PbV4vUjGI3OiATVLysbVw/Vir68IKrWMdsF2HqZR4RjQSjO/bRoDkVpU91x0wQ5Q9RpvE5yvdq061eVa80x/D0+I3tx8ZJ/sM0z1Hyevrx3p8GJtbk8DpCLjb0ZmzV+xEtuMiabOmSlm+eaaGCqY2lFPYY9pc5h+W6fO1JtJMm3+FvG8BNwNyimDswRjeLAnVi3kx/FBDn8UMsvbjLxwtoGVPZDMPcNZ1FiWr1ZPASNkWEeR2KoU9iS1J3sQ81c10Aq4r1+Ov4KEflgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchip.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RkiM/8MQMyLrBGCNVHK99ljGvm+imT0A/88oduXr9PI=; b=PoiOs93xTidrn/OetGhfSPV2LcJFVDN/BvpylHTbnKAmrH/uEP9KDZu45qolnWCogJYudoudnHhcNDRrX7Bp4KyR7dlx9VZmBidLPThnhEbqTILiOdnGhTqiAIBJksKWgEwhQqKH2YT4DBUEc8PwoypYYvVB/CxwSk4HxPm5OM4bJZoVcNe9aJpptv6mK5oUHDcA3leqoBjZ5vDFd+HuXsgWEcqtC1BH+WTP1/Upcj7FrE0tywrsoBSo5W5vVyJZwLiSY5+Bn5eZeKeGQozPpEQYS097FJw3QUhgqjq64BnnwFwoxRbHVcWEJujPpmNZ/ZKJI+EeuL37k8sdWFYmUA== Received: from LV8PR11MB8700.namprd11.prod.outlook.com (2603:10b6:408:201::22) by DM4PR11MB8089.namprd11.prod.outlook.com (2603:10b6:8:17f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.24; Fri, 1 Mar 2024 10:22:09 +0000 Received: from LV8PR11MB8700.namprd11.prod.outlook.com ([fe80::bef5:e3b9:4214:8eda]) by LV8PR11MB8700.namprd11.prod.outlook.com ([fe80::bef5:e3b9:4214:8eda%6]) with mapi id 15.20.7339.009; Fri, 1 Mar 2024 10:22:09 +0000 From: To: CC: , , , , , , Subject: RE: [PATCH net 3/3] net: lan743x: Address problems with wake option flags configuration sequences Thread-Topic: [PATCH net 3/3] net: lan743x: Address problems with wake option flags configuration sequences Thread-Index: AQHaaIt96K5hsZSvW06kwmptrB0k3LEdb70AgAOX2pCAAGkJgIABOvSQ Date: Fri, 1 Mar 2024 10:22:09 +0000 Message-ID: References: <20240226080934.46003-1-Raju.Lakkaraju@microchip.com> <20240226080934.46003-4-Raju.Lakkaraju@microchip.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microchip.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV8PR11MB8700:EE_|DM4PR11MB8089:EE_ x-ms-office365-filtering-correlation-id: 88a20d2a-cac3-4e04-4800-08dc39d9740f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YmgOyZUP34tXljCfG52u1/2ugzjcivCqxz8IRvwPMGJjd/KxSmA0gvpHvnRi3BybcJua12RTnSNdrNG6f2mHus41OQEWl6lzyDZMMwrD5tJ9YdvDNvygub04jmH3GfV2UcA4XVpMVB9qnSFfVqv/2A2ZbyBIaAX/oAAQLCAbLym/49/Zq9SKmndNyrcEkgUxkdPrC6Ny2vYZYINoIrHpvEnTLg8WB2kxnUCJ8ay3uBdZnuY0rO50THDfQURe6OH2edjEKkzY1zwTeNHQclJAplFEtTChfWVnFXIN8SgoUROmN8wxKJTQ0+VYTbnAdVQZ5NwSMVUnZ+68cie2zXinC1LjNcczLrk9ehDVeUaJR45MyJg76UklWXsD4ZhGjNop0sCpqvVOnYp/nr4LloJCYOBTmYCGbCeXu8Qdd3I0OP3npdyYtZmcm1/ZS8QGp4FNL+SegKzKIX8TmyCUiw6D/lVDkyx8tbc/RVtoLuU+9xFMXsOxC5pp5r6DQEY0Dn5+DklqB5WfKLD9FojTJpEvaxKscUlxOYJGy44XKytMx2w8i9wQ7t0Ne0PK3fi8o/dqhGRgNz1PclEv/IiQc3BaxFjsUh/01oEsugv5a8XdGDKcmyBnNuzQJYPAEtJ7/zH3Ig3p9jzfh5aIvum3OUkqcf/D1sva9DMSbDkjyntu2qENhviX9LwcP3hvVmO8zBfybdVx104jJ9DL0LAPiwzvf25BXdxjhGhs0XoV6Rh8bZA= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV8PR11MB8700.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(38070700009);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?M01mME9OTlVlbFNRazB5V0I0MHVCRkJpQnFZeWQ2TDBSZzdoZDZYZS8ybkNH?= =?utf-8?B?YkR6OXhET1UyVzVjRmxWK1JQdnlzNWE5WktoZnpSeENURldkZm5hL3MydUVV?= =?utf-8?B?VHdYcDE2TVgvaVMvYUVUMm5BL2N4Qm85amlQb1AxbFJ3OWg0R0tpKzJndmJa?= =?utf-8?B?Qjd6SXQwZ3U3U2lHTnljTllJbWIwL0gxZnlYME5ZeXNuaFpRMUJrblB2T2pD?= =?utf-8?B?SVVCRW5NUjRMTUsxZ1owUGlBUklmb1ZkMS9GQ09QTDFpSUkvd1pBaGUwVTdS?= =?utf-8?B?a3E2Vk1QQkFoSkkyQmd1V21JOUlhMTgzRFYwTXlaVXY2b0svcWlDdVZOWTRr?= =?utf-8?B?akVvNVlYcmF0VDA2YmNMRmxQQXBMS3BISkJERnFWYi9BcTNXOEFNZHJkYUxx?= =?utf-8?B?OXNDV0pUZlFMZnpYRWlPekl1eGFlRnNqYTdjVXhpTkwrdnlSWEozQXdlRXdp?= =?utf-8?B?ektGMDFzMDNQRnd2M0V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mg5QUtrb3VEaWRTM3QwOUt2cDZEL21zZUFiREJuemNSanBTckVSUXgyVmdQ?= =?utf-8?B?STMxYnRVZEJNenNIcXVFV2NmUDdKeE5zTEdBaEtVbUdIaHJ1RUpCY2UvRjNt?= =?utf-8?B?U3pGbjEvd0xBbmlFRWx3eTVaQXBzajVjY3NDcFBqZnRDckQ0Zm9MaXdXRDhL?= =?utf-8?B?T3J5aVpJZUw5YVg5ak90MDdxRmh5a3JsWWx1OWhjMTNlSnJrY1dXbkM2d0NI?= =?utf-8?B?Z1VFUUhNbHNQSWI4WkdibWVkY0M4cURveklZaDN0WU1MbUhUQmJnU1VVZ3hE?= =?utf-8?B?L21SU3lMd2g4WENseUkreEkvT3pyTEVaV2s5Sk5mbWJpcUcva05nTDN5UEJK?= =?utf-8?B?TW5iYVR1RWxZckE4YmZYblR3bXNqNkdLdGJ1MGhucmdOWGJUYjMrSUNZMGxa?= =?utf-8?B?NUlHZHZZNGErdWltWHJwcHNSWDlmYllObndCMTI2dUtiaDdHVkJUMDVRYVEy?= =?utf-8?B?WHQyQy9SbEhaYWdOYmF3aWgyWmFtSTFvSnFzSVpEV0hpRlJKVTBUTzlyU2JG?= =?utf-8?B?TnNHVVZ0M0s5elJ6allxZXV6dEcrRkxaTmFxalI2M0FBcWNyRi9pcnhIQm04?= =?utf-8?B?TFlRaHBCb3FoSkNkaFkzaVIwc3pld0tJNGZ4ZUIwR2FGZDhjdlU0dDdGeHRV?= =?utf-8?B?QkZzdmk1bWtWdUNYSm9xcDFEVWMxOHAwMXRMRXNWLzFzaTlJcUQwaE5GQllS?= =?utf-8?B?bVdyYnZTR3hpS3JZZm5FMFVuYUZHZU1yNUJVUTM1RFdhbWdveXluYURtM2hm?= =?utf-8?B?Rmc9PQ==?= Content-Type: multipart/mixed; boundary="_002_LV8PR11MB8700FC048AB32D6E7168855E9F5E2LV8PR11MB8700namp_" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV8PR11MB8700.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88a20d2a-cac3-4e04-4800-08dc39d9740f X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2024 10:22:09.7319 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5WIq/YHnfKvXUaS4c96Opv/wP+IQu4aKAlZIRQpaDUwOyYPnJWrSi767S6PnLZUaVI0ftgyeUbuJPkhEHZ9Oy3GwUPpecRydGi0u+ute3I8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB8089 --_002_LV8PR11MB8700FC048AB32D6E7168855E9F5E2LV8PR11MB8700namp_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SGkgQW5kcmV3LA0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IEFuZHJl dyBMdW5uIDxhbmRyZXdAbHVubi5jaD4NCj4gU2VudDogVGh1cnNkYXksIEZlYnJ1YXJ5IDI5LCAy MDI0IDg6MzYgUE0NCj4gVG86IFJhanUgTGFra2FyYWp1IC0gSTMwNDk5IDxSYWp1Lkxha2thcmFq dUBtaWNyb2NoaXAuY29tPg0KPiBDYzogbmV0ZGV2QHZnZXIua2VybmVsLm9yZzsgZGF2ZW1AZGF2 ZW1sb2Z0Lm5ldDsga3ViYUBrZXJuZWwub3JnOyBsaW51eC0NCj4ga2VybmVsQHZnZXIua2VybmVs Lm9yZzsgQnJ5YW4gV2hpdGVoZWFkIC0gQzIxOTU4DQo+IDxCcnlhbi5XaGl0ZWhlYWRAbWljcm9j aGlwLmNvbT47IHJpY2hhcmRjb2NocmFuQGdtY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YW4gcGFnZS4NCg0KSSBoYXZlIGdvbmUgdGhyb3VnaCB0aGUg ZXRodG9vbCBhcHBsaWNhdGlvbiBjb2RlLg0KKGdpdDovL2dpdC5rZXJuZWwub3JnL3B1Yi9zY20v bmV0d29yay9ldGh0b29sL2V0aHRvb2wuZ2l0KSBhbmQgY2hlY2sgdGhlIFdPTCBvcHRpb25zLg0K DQpJbiBpb2N0bCBtZXRob2QgKE5vdCBuZXRsaW5rKSwgZG9fc3NldCggKSBmdW5jdGlvbiwgYmVm b3JlIHNldCB0aGUgcGFyYW1ldGVycywgZmlyc3QgZ2V0IHRoZSBXT0wgY29uZmlndXJhdGlvbi4N CihpLmUuIGluIGV0aHRvb2wuYyBmaWxlLCBMaW5lIG5vLiAzMjk0KQ0KDQpUaGVuLCBhc3NpZ24v b3ZlcndyaXRlIFdPTCB3YW50ZWQgY29uZmlnIHRvIHdvbG9wdHMgcGFyYW1ldGVyLg0KDQpFeGlz dGluZyBDb2RlOiAgRnJvbSBMaW5lIDMyOTAgLSAgMzMxMg0KIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMNCjMyOTAg ICAgICAgICBpZiAoZ3dvbF9jaGFuZ2VkKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICANCjMyOTEgICAgICAgICAgICAgICAgIHN0cnVjdCBldGh0 b29sX3dvbGluZm8gd29sOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCjMy OTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICANCjMyOTMgICAgICAgICAgICAgICAgIHdvbC5jbWQg PSBFVEhUT09MX0dXT0w7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAN CjMyOTQgICAgICAgICAgICAgICAgIGVyciA9IHNlbmRfaW9jdGwoY3R4LCAmd29sKTsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCjMyOTUgICAgICAgICAgICAgICAgIGlmIChl cnIgPCAwKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICANCjMyOTYgICAgICAgICAgICAgICAgICAgICAgICAgcGVycm9yKCJDYW5ub3QgZ2V0IGN1cnJl bnQgd2FrZS1vbi1sYW4gc2V0dGluZ3MiKTsgICAgICANCjMyOTcgICAgICAgICAgICAgICAgIH0g ZWxzZSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICANCjMyOTggICAgICAgICAgICAgICAgICAgICAgICAgLyogQ2hhbmdlIGV2ZXJ5dGhpbmcg dGhlIHVzZXIgc3BlY2lmaWVkLiAqLyAgICAgICAgICAgICANCjMyOTkgICAgICAgICAgICAgICAg ICAgICAgICAgaWYgKHdvbF9jaGFuZ2UpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICANCjMzMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b2wud29sb3B0 cyA9IHdvbF93YW50ZWQ7ICAgICAgICAgICAgICAgICAgICAgICANCjMzMDEgICAgICAgICAgICAg ICAgICAgICAgICAgaWYgKHNvcGFzc19jaGFuZ2UpIHsgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICANCjMzMDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaTsg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCjMzMDMgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgU09QQVNTX01BWDsgaSsrKSAg ICAgICAgICAgICAgICANCjMzMDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHdvbC5zb3Bhc3NbaV0gPSBzb3Bhc3Nfd2FudGVkW2ldOyAgICAgICANCjMzMDUgICAgICAg ICAgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICANCjMzMDYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCjMzMDcgICAg ICAgICAgICAgICAgICAgICAgICAgLyogVHJ5IHRvIHBlcmZvcm0gdGhlIHVwZGF0ZS4gKi8gICAg ICAgICAgICAgICAgICAgICAgICANCjMzMDggICAgICAgICAgICAgICAgICAgICAgICAgd29sLmNt ZCA9IEVUSFRPT0xfU1dPTDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCjMzMDkg ICAgICAgICAgICAgICAgICAgICAgICAgZXJyID0gc2VuZF9pb2N0bChjdHgsICZ3b2wpOyAgICAg ICAgICAgICAgICAgICAgICAgICAgICANCjMzMTAgICAgICAgICAgICAgICAgICAgICAgICAgaWYg KGVyciA8IDApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCjMz MTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJyb3IoIkNhbm5vdCBzZXQgbmV3 IHdha2Utb24tbGFuIHNldHRpbmdzIik7ICANCjMzMTIgICAgICAgICAgICAgICAgIH0NCiMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjDQpDdXJyZW50IGlzc3VlIGlzIG92ZXJ3cml0aW5nIHdvbG9wdHMgd2l0aCB3b2xf d2FudGVkDQppLmUuDQozMzAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd29sLndv bG9wdHMgPSB3b2xfd2FudGVkOyAgICAgICAgICAgICAgICAgICAgICAgDQoNCkluc3RlYWQgb2Yg b3ZlciB3cml0ZSwgTmVlZCB0byAiT1IiIHRoZSB3b2xvcHRzIGFuZCB3b2xfd2FudGVkDQppLmUu DQozMzAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd29sLndvbG9wdHMgfD0gd29s X3dhbnRlZA0KIA0KRmluYWwgY29kZSBjaGFuZ2VzIHNob3VsZCBiZToNCiMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj DQozMjkwICAgICAgICAgaWYgKGd3b2xfY2hhbmdlZCkgeyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQozMjkxICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZXRodG9vbF93b2xpbmZvIHdvbDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgDQozMjkyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQozMjkzICAgICAgICAgICAgICAgICB3 b2wuY21kID0gRVRIVE9PTF9HV09MOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgDQozMjk0ICAgICAgICAgICAgICAgICBlcnIgPSBzZW5kX2lvY3RsKGN0eCwgJndvbCk7 ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQozMjk1ICAgICAgICAgICAgICAg ICBpZiAoZXJyIDwgMCkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgDQozMjk2ICAgICAgICAgICAgICAgICAgICAgICAgIHBlcnJvcigiQ2Fubm90IGdl dCBjdXJyZW50IHdha2Utb24tbGFuIHNldHRpbmdzIik7ICAgICAgDQozMjk3ICAgICAgICAgICAg ICAgICB9IGVsc2UgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgDQozMjk4ICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENoYW5nZSBldmVy eXRoaW5nIHRoZSB1c2VyIHNwZWNpZmllZC4gKi8gICAgICAgICAgICAgDQozMjk5ICAgICAgICAg ICAgICAgICAgICAgICAgIGlmICh3b2xfY2hhbmdlICAmJiB3b2xfd2FudGVkKSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQozMzAwICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgd29sLndvbG9wdHMgfD0gd29sX3dhbnRlZDsNCgkJICAgICBlbHNlIGlmICh3 b2xfY2hhbmdlICAmJiAhd29sX3dhbnRlZCkNCgkJCXdvbC53b2xvcHRzID0gMCAgICAgICAgICAg ICAgICAgICAgICAgDQozMzAxICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzb3Bhc3NfY2hh bmdlKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQozMzAyICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IGk7ICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgDQozMzAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9y IChpID0gMDsgaSA8IFNPUEFTU19NQVg7IGkrKykgICAgICAgICAgICAgICAgDQozMzA0ICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b2wuc29wYXNzW2ldID0gc29wYXNz X3dhbnRlZFtpXTsgICAgICAgDQozMzA1ICAgICAgICAgICAgICAgICAgICAgICAgIH0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQozMzA2ICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgDQozMzA3ICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFRy eSB0byBwZXJmb3JtIHRoZSB1cGRhdGUuICovICAgICAgICAgICAgICAgICAgICAgICAgDQozMzA4 ICAgICAgICAgICAgICAgICAgICAgICAgIHdvbC5jbWQgPSBFVEhUT09MX1NXT0w7ICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgDQozMzA5ICAgICAgICAgICAgICAgICAgICAgICAgIGVy ciA9IHNlbmRfaW9jdGwoY3R4LCAmd29sKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgDQoz MzEwICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnIgPCAwKSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgDQozMzExICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgcGVycm9yKCJDYW5ub3Qgc2V0IG5ldyB3YWtlLW9uLWxhbiBzZXR0aW5ncyIpOyAg DQozMzEyICAgICAgICAgICAgICAgICB9DQojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIw0KDQpTaW1pbGFyIGNoYW5n ZXMgcmVxdWlyZSBpbiBuZXRsaW5rIGZ1bmN0aW9ucyBhbHNvLiANCg0KPiBMZXRzIGZpcnN0IHVu ZGVyc3RhbmQgaG93IGl0IGlzIGV4cGVjdGVkIHRvIHdvcmsuIFRoZW4gd2UgY2FuIGRlY2lkZWQg aWYgdGhlDQo+IGRyaXZlciBpcyBpbXBsZW1lbnRpbmcgaXQgY29ycmVjdGx5Lg0KPiANCj4gICAg QW5kcmV3DQoNClBsZWFzZSBmaW5kIHRoZSAiZXRodG9vbCIgYXBwbGljYXRpb24gY29kZSBtYWlu IGZpbGUgYXMgYXR0YWNobWVudCBmaWxlLg0KDQpUaGFua3MsDQpSYWp1DQo= --_002_LV8PR11MB8700FC048AB32D6E7168855E9F5E2LV8PR11MB8700namp_ Content-Type: text/plain; name="ethtool.c" Content-Description: ethtool.c Content-Disposition: attachment; filename="ethtool.c"; size=161479; creation-date="Fri, 01 Mar 2024 10:11:52 GMT"; modification-date="Fri, 01 Mar 2024 10:22:09 GMT" Content-Transfer-Encoding: base64 LyoKICogZXRodG9vbC5jOiBMaW51eCBldGhlcm5ldCBkZXZpY2UgY29uZmlndXJhdGlvbiB0b29s LgogKgogKiBDb3B5cmlnaHQgKEMpIDE5OTggRGF2aWQgUy4gTWlsbGVyIChkYXZlbUBkbS5jb2Jh bHRtaWNyby5jb20pCiAqIFBvcnRpb25zIENvcHlyaWdodCAyMDAxIFN1biBNaWNyb3N5c3RlbXMK ICogS2VybmVsIDIuNCB1cGRhdGUgQ29weXJpZ2h0IDIwMDEgSmVmZiBHYXJ6aWsgPGpnYXJ6aWtA bWFuZHJha2Vzb2Z0LmNvbT4KICogV2FrZS1vbi1MQU4sbmF0c2VtaSxtaXNjIHN1cHBvcnQgYnkg VGltIEhvY2tpbiA8dGhvY2tpbkBzdW4uY29tPgogKiBQb3J0aW9ucyBDb3B5cmlnaHQgMjAwMiBJ bnRlbAogKiBQb3J0aW9ucyBDb3B5cmlnaHQgKEMpIFN1biBNaWNyb3N5c3RlbXMgMjAwOAogKiBk b190ZXN0IHN1cHBvcnQgYnkgRWxpIEt1cGVybWFubiA8ZWxpLmt1cGVybWFubkBpbnRlbC5jb20+ CiAqIEVUSFRPT0xfUEhZU19JRCBzdXBwb3J0IGJ5IENocmlzIExlZWNoIDxjaHJpc3RvcGhlci5s ZWVjaEBpbnRlbC5jb20+CiAqIGUxMDAwIHN1cHBvcnQgYnkgU2NvdHQgRmVsZG1hbiA8c2NvdHQu ZmVsZG1hbkBpbnRlbC5jb20+CiAqIGUxMDAgc3VwcG9ydCBieSBXZW4gVGFvIDx3ZW4taHdhLnRh b0BpbnRlbC5jb20+CiAqIGl4Z2Igc3VwcG9ydCBieSBOaWNob2xhcyBOdW5sZXkgPE5pY2hvbGFz LmQubnVubGV5QGludGVsLmNvbT4KICogYW1kODExMWUgc3VwcG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