From patchwork Wed Dec 30 15:47:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 355488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74F5BC433E9 for ; Wed, 30 Dec 2020 15:49:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D8CA22227 for ; Wed, 30 Dec 2020 15:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726766AbgL3PtC (ORCPT ); Wed, 30 Dec 2020 10:49:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:46698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbgL3PtC (ORCPT ); Wed, 30 Dec 2020 10:49:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8DD8822242; Wed, 30 Dec 2020 15:48:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609343301; bh=xnHEVZDk0ZJjtLvsuNl+eC760CQNHfhFxMLs1isYStA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L2cDiROy3YnSsBiAv3HhjBbtYwRtKUn4Ogyeo5T4BhVSHEkGOXNh6sR4WuMx3CMdx 1S2H49Lp5og5b6E50QOwp4RoaqUDs3g+F1t9iPvSIssQiu7PrjAdo33qTB/xemmlCY u3o8mdPh+1EPNgM0B84zP2InapfwKGUy/I38sRb4L6JsevVrYybFabDBSvK6yK5L+b ASoyFa4OTdtVWCq/LxVpAkutCh0nMeFiKYB/uj2M/q/39bxs3kV77zNeGggniMqj0a WbNM6WjIkyZ7/Kmtkk/8sIxhFSmA8Uywof+BnW4bSvDweQ6qxg7QAk9hCrA1oijLIr mkqfFA3F73lJA== Received: by pali.im (Postfix) id EC92D9F8; Wed, 30 Dec 2020 16:48:19 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , =?utf-8?q?Marek_Beh=C3=BAn?= Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] net: sfp: allow to use also SFP modules which are detected as SFF Date: Wed, 30 Dec 2020 16:47:53 +0100 Message-Id: <20201230154755.14746-3-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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Some GPON SFP modules (e.g. Ubiquiti U-Fiber Instant) have set SFF phys_id in their EEPROM. Kernel SFP subsystem currently does not allow to use modules detected as SFF. This change extends check for SFP modules so also those with SFF phys_id are allowed. With this change also GPON SFP module Ubiquiti U-Fiber Instant is recognized. Signed-off-by: Pali Rohár --- drivers/net/phy/sfp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 490e78a72dd6..73f3ecf15260 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -273,7 +273,8 @@ static const struct sff_data sff_data = { static bool sfp_module_supported(const struct sfp_eeprom_id *id) { - return id->base.phys_id == SFF8024_ID_SFP && + return (id->base.phys_id == SFF8024_ID_SFP || + id->base.phys_id == SFF8024_ID_SFF_8472) && id->base.phys_ext_id == SFP_PHYS_EXT_ID_SFP; }