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=-4.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=ham 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 AB458C10F0E for ; Sun, 7 Apr 2019 15:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D5C820880 for ; Sun, 7 Apr 2019 15:28:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mork.no header.i=@mork.no header.b="OCjDcFVr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726366AbfDGP1P (ORCPT ); Sun, 7 Apr 2019 11:27:15 -0400 Received: from canardo.mork.no ([148.122.252.1]:59151 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726246AbfDGP1P (ORCPT ); Sun, 7 Apr 2019 11:27:15 -0400 Received: from miraculix.mork.no (miraculix.mork.no [IPv6:2001:4641:0:2:7627:374e:db74:e353]) (authenticated bits=0) by canardo.mork.no (8.15.2/8.15.2) with ESMTPSA id x37FRCWx031651 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 7 Apr 2019 17:27:12 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1554650833; bh=DCriYeUpiaGua6lIKKj3gW4fiPBM9FOPVB8rwT4lp6o=; h=From:To:Cc:Subject:References:Date:Message-ID:From; b=OCjDcFVrH9Tdya+PRtLWVqPn3uXDDYW2cV3r6BxxUFV2va7ca59KWZC3gqSLWvuTR ldvXZkKQWz4iB4yDrHbC34W+mKsun7JnuprsPgxH9MSEuTx/dhRVJnomXMaDhWtgKm 9SPhrgJnS/4VdEZbPpKz2AugJhbkd7JqPYjMO09c= Received: from bjorn by miraculix.mork.no with local (Exim 4.89) (envelope-from ) id 1hD9hP-0002ud-UE; Sun, 07 Apr 2019 17:27:11 +0200 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Kristian Evensen Cc: netdev@vger.kernel.org Subject: Re: [PATCH net-next] qmi_wwan: Add quirk for Quectel dynamic config Organization: m References: <20190407133909.31294-1-kristian.evensen@gmail.com> Date: Sun, 07 Apr 2019 17:27:11 +0200 In-Reply-To: <20190407133909.31294-1-kristian.evensen@gmail.com> (Kristian Evensen's message of "Sun, 7 Apr 2019 15:39:09 +0200") Message-ID: <87d0lxj0og.fsf@miraculix.mork.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 0.100.3 at canardo X-Virus-Status: Clean Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Kristian Evensen writes: > Most, if not all, Quectel devices use dynamic interface numbers, and > users are able to change the USB configuration at will. Matching on for > example interface number is therefore not possible. > > Instead, the QMI device can be identified by looking at the interface > class, subclass and protocol (all 0xff), as well as the number of > endpoints. The reason we need to look at the number of endpoints, is > that the diagnostic port interface has the same class, subclass and > protocol as QMI. However, the diagnostic port only has two endpoints, > while QMI has three. > > Until now, we have identified the QMI device by combining a match on > class, subclass and protocol, with a call to the function > quectel_diag_detect(). In quectel_diag_detect(), we check if the number > of endpoints matches for known Quectel vendor/product ids. > > Adding new vendor/product ids to quectel_diag_detect() is not a good > long-term solution. This commit replaces the function with a quirk, and > applies the quirk to affected Quectel devices that I have been able to > test the change with (EP06, EM12 and EC25). If the quirk is set and the > number of endpoints equal two, we return from qmi_wwan_probe() with > -ENODEV. > > Signed-off-by: Kristian Evensen Looking really good to me. Thanks for doing this. I guess this has to go to (at least some of) the stable trees eventually, but assume you directed it to net-next for more thorough testing first? Acked-by: Bj=C3=B8rn Mork