Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10645003pxu; Wed, 30 Dec 2020 07:51:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqsOXc+SYduzouuDA+TyvH9DhPe7or6XG1LfgcspfB19VNLCdZj9aOLnLePwRf089m4hc/ X-Received: by 2002:a05:6402:94c:: with SMTP id h12mr51162198edz.268.1609343478147; Wed, 30 Dec 2020 07:51:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609343478; cv=none; d=google.com; s=arc-20160816; b=Pf2JVtNqZofQuJ+NguphuBjqWXhBZlWfp15zoBDBum+KPR13NkacHoqnT4TCa8H852 UGw/abaH1zLzpOCIB+Bt1P1BpeG4Ezh/XzxfCuBXe4W3LQVK6CP9NTdfgsTP32YNaT5h zFKirmC97slarTZcx6/Ob1AVlBgyZKqO66we2OL43efbESawpX/NuOWOhklrqQY9Desq RfEY0rVpjiGZ3mvrTd3Bx64fpPFXqgFdC1zOme++QmXDU/mLb9osIR1CLjMUwJoMbWKt PFL6BVYnIOBCI5SWH7zDKW+mxE/y/JnlI8W91aKfJyZoQtWPmj8fbv6M5+1sMp3T/h3s 9c8Q== 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=wYmndrDQDMgZ6WCW2UTkSMgz1EhPZSIsjXK75w32F6Q=; b=X8yoj9EMzgdcaH57e0JEZUdL88X+q8vEIxZSLOTx2vHLSxmeLTXgPSPlbD+pFETat4 xgOfvjoXeI93NfuhaE7tnkDMgiCtcPV/cPSphNSlWPIaFOzWTJg+lpiopOWFcVyvYxet nz+NQegLo9Fl0YYa7wbWiQg3ZMzs4qU4GuUgO30RNdZwFhLze9rpKcbxX3CeouiuRfFx HnePVxZkxLv0C8P/ueyyv3YFaxIs+j47NJpoGk5Aph60Yye+mwWjL/g8t8AtYXI/gtUd ytPSnqUYv9gnV+BvYa3MnpnlPD/ix6yDqE2OwZOvNguZ9hJgrVG9B0mQaM69dJzQ2iNz K0ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NEV2DHLD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lx6si22144759ejb.550.2020.12.30.07.50.55; Wed, 30 Dec 2020 07:51:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NEV2DHLD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726874AbgL3PtP (ORCPT + 99 others); Wed, 30 Dec 2020 10:49:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:46788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726503AbgL3PtO (ORCPT ); Wed, 30 Dec 2020 10:49:14 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 303CE2226A; Wed, 30 Dec 2020 15:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609343305; bh=Awk7q1ExXD7Z9lZQDOFC5znJcmFblLnxGitRya5UfYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NEV2DHLDRI3LkegT0vlCrbnjjpxF2dgcm59fZM2S8IJArr/SUAN4UV5JbqzpxMDKm yQ5kStEqLo2gssE0Mr8tesfOeh+u2F29N6f/tDLJh40mK4MSCZrTtOjTs2OPVeK2wx Oiz5mKZgvyaVWafCaeIreY5I2uX518j0ClqX6J3nMojixIo+QNu2piItKoJ3q2K2MV dlDVrrKX5w3yzvifN5moebP/DqRcS0AdouTPybVDyYiR4h7wixaxcJ1nxNwJcvfL5d UyvZCI3pf3hNtQgoMEOYEuIFcrw5K0EFNoDCtI+IUkNRE8fB31v4eSCYl3gUod2KcF Z66JFoWJ1iI6w== Received: by pali.im (Postfix) id 891E89F8; Wed, 30 Dec 2020 16:48:23 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , =?UTF-8?q?Marek=20Beh=C3=BAn?= Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] net: sfp: add mode quirk for GPON module Ubiquiti U-Fiber Instant Date: Wed, 30 Dec 2020 16:47:55 +0100 Message-Id: <20201230154755.14746-5-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201230154755.14746-1-pali@kernel.org> References: <20201230154755.14746-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SFP GPON module Ubiquiti U-Fiber Instant has in its EEPROM stored nonsense information. It claims that support all transceiver types including 10G Ethernet which is not truth. So clear all claimed modes and set only one mode which module supports: 1000baseX_Full. This change finally allows to detect and use SFP GPON module Ubiquiti U-Fiber Instant on Linux system. EEPROM content of this SFP module is (where XX is serial number): 00: 02 04 0b ff ff ff ff ff ff ff ff 03 0c 00 14 c8 ???........??.?? 10: 00 00 00 00 55 42 4e 54 20 20 20 20 20 20 20 20 ....UBNT 20: 20 20 20 20 00 18 e8 29 55 46 2d 49 4e 53 54 41 .??)UF-INSTA 30: 4e 54 20 20 20 20 20 20 34 20 20 20 05 1e 00 36 NT 4 ??.6 40: 00 06 00 00 55 42 4e 54 XX XX XX XX XX XX XX XX .?..UBNTXXXXXXXX 50: 20 20 20 20 31 34 30 31 32 33 20 20 60 80 02 41 140123 `??A Signed-off-by: Pali Rohár --- drivers/net/phy/sfp-bus.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c index 20b91f5dfc6e..4cf874fb5c5b 100644 --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c @@ -44,6 +44,17 @@ static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id, phylink_set(modes, 2500baseX_Full); } +static void sfp_quirk_ubnt_uf_instant(const struct sfp_eeprom_id *id, + unsigned long *modes) +{ + /* Ubiquiti U-Fiber Instant module claims that support all transceiver + * types including 10G Ethernet which is not truth. So clear all claimed + * modes and set only one mode which module supports: 1000baseX_Full. + */ + phylink_zero(modes); + phylink_set(modes, 1000baseX_Full); +} + static const struct sfp_quirk sfp_quirks[] = { { // Alcatel Lucent G-010S-P can operate at 2500base-X, but @@ -63,6 +74,10 @@ static const struct sfp_quirk sfp_quirks[] = { .vendor = "HUAWEI", .part = "MA5671A", .modes = sfp_quirk_2500basex, + }, { + .vendor = "UBNT", + .part = "UF-INSTANT", + .modes = sfp_quirk_ubnt_uf_instant, }, }; -- 2.20.1