From mboxrd@z Thu Jan 1 00:00:00 1970 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.0 required=3.0 tests=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 EDBB3C10F13 for ; Mon, 8 Apr 2019 23:26:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B65CD20863 for ; Mon, 8 Apr 2019 23:26:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726988AbfDHX0Q (ORCPT ); Mon, 8 Apr 2019 19:26:16 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:41952 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726799AbfDHX0Q (ORCPT ); Mon, 8 Apr 2019 19:26:16 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 8E2851456F28D; Mon, 8 Apr 2019 16:26:15 -0700 (PDT) Date: Mon, 08 Apr 2019 16:26:14 -0700 (PDT) Message-Id: <20190408.162614.1081558072311986562.davem@davemloft.net> To: kristian.evensen@gmail.com Cc: netdev@vger.kernel.org, bjorn@mork.no Subject: Re: [PATCH net-next] qmi_wwan: Add quirk for Quectel dynamic config From: David Miller In-Reply-To: <20190407133909.31294-1-kristian.evensen@gmail.com> References: <20190407133909.31294-1-kristian.evensen@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 08 Apr 2019 16:26:15 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Kristian Evensen Date: Sun, 7 Apr 2019 15:39:09 +0200 > 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 Applied.