Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10710747pxu; Wed, 30 Dec 2020 09:29:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuPpqXYHTNGjmoelaPWKZV2CRYY8WaiDBEheSfzKWOHUylQK8xO6RlUQqh1XADzIaJh71P X-Received: by 2002:a17:906:8587:: with SMTP id v7mr49077421ejx.381.1609349362036; Wed, 30 Dec 2020 09:29:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609349362; cv=none; d=google.com; s=arc-20160816; b=mUdTcY3II+X7QJqqf+3mJ4mbSKFnNoluseH7h+3oV5QeAPPdQBi5cOdAQfMsw1oTMS hPBdtEWZoUa5g+GysW/kjtXog4B3SMWY5LPdfEZ0BZ3FS0jutZI42lGosBfTURLxELMB d2yILnSnOAU9JnKqkzruHDS8pFMN11l5zB3RckuUYZ/RWt1xTA0GJQ2e5RMd4Xyks+pv hXU2ir3i4eqOCuq7+FluqnHwFdpEgMGyRua8w3BZsHMv435TqTipwDapkeFflb7qOEIP gur1E/18uM3b+O+FuVR7/QPm7u3lEklmZKwSvJv+I5YGYKCN+Fd3jZIo4l2RJ09qzCu/ OCGw== 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:subject:cc:to:from:date :dkim-signature; bh=Zfw7NAoHTiBbmr/+bk/dtuNoZAOXFsLLzeVC1oxbh1k=; b=dMqWJX04rJl1vzA8pZSxUf/ZlaL+EeneZCyOeGeuvt1Ge8n5YHit/yEOOQzoMoMufc PJyRFXye7daS1FPmDxLywsV5wXwtP48mtMC1qGdtbU61vJpMocsu9xvW4mgYw6ktwa+5 c4JtoH89EeVxQJOeZQdinNIISPNw3ffa8Q2g9WqspfZI20/p2yijS1Nz5fT+xV7lgfPE H7nnP6SZ0Q2ymn6CWERbuUZVEqsp5aP8hQfUpuDMWgITu9oN0bOf1dBAi4ILE78heWP7 esJuivc/QprqZJ5dZd4qr8iQkJmGk5HRKMrgVtvgqFrNpRR7GOWabACmtv0FQo327lpz Zi6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IBzbV7Ot; 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 a27si24077318edb.498.2020.12.30.09.28.59; Wed, 30 Dec 2020 09:29:22 -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=IBzbV7Ot; 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 S1726618AbgL3R2N (ORCPT + 99 others); Wed, 30 Dec 2020 12:28:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:36522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726197AbgL3R2M (ORCPT ); Wed, 30 Dec 2020 12:28:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C4D152222A; Wed, 30 Dec 2020 17:27:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609349251; bh=MV5Cg6rH7kPJN6lJ4j65bhqgB9V/LCFS14p7G0G9Pwk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IBzbV7OtsDfHEDy5juE9sFynq9SYn0y7+MolwCRam/y4u38bAkMm78y/dgyXqIGsw UDjcluCyPPe66CvUmJr7zliVYCBgrN6dudHLc3/k1sramZb4F/FIVi9QsOnqzLjYef anPX5MplWnjrUPk3LEilX3RlcFy9TEoTCH0Y0IbJfhb+kXUwYPQsO5oA9DKb2aYYsK v5v2gtliqOH/tYxsKE3icAYQgTLy7NRdIfOlYNwS6rN9fl+57Eb5KrZc0viJB9UD2V uAxzQ5x1eomQF8iNPi//+CmLGbRLCZzo2ULDRCANa4QgpHkaROnVnoPlTuzmVYF1U7 iYyzb3mAFYv3g== Date: Wed, 30 Dec 2020 18:27:07 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Pali =?UTF-8?B?Um9ow6Fy?= Cc: Russell King - ARM Linux admin , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] net: sfp: allow to use also SFP modules which are detected as SFF Message-ID: <20201230182707.4a8b13d0@kernel.org> In-Reply-To: <20201230170652.of3m226tidtunslm@pali> References: <20201230154755.14746-1-pali@kernel.org> <20201230154755.14746-3-pali@kernel.org> <20201230161151.GS1551@shell.armlinux.org.uk> <20201230170652.of3m226tidtunslm@pali> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 30 Dec 2020 18:06:52 +0100 Pali Roh=C3=A1r wrote: > if (!sfp->type->module_supported(&id) && > (memcmp(id.base.vendor_name, "UBNT ", 16) || > memcmp(id.base.vendor_pn, "UF-INSTANT ", 16))) I would rather add a quirk member (bitfield) to the sfp structure and do something like this if (!sfp->type->module_supported(&id) && !(sfp->quirks & SFP_QUIRK_BAD_PHYS_ID)) or maybe put this check into the module_supported method. Marek