From patchwork Tue Dec 11 07:41:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rgen_Storvist?= X-Patchwork-Id: 10723145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 54E7B1751 for ; Tue, 11 Dec 2018 07:41:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 468A52A63B for ; Tue, 11 Dec 2018 07:41:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A89F2A675; Tue, 11 Dec 2018 07:41:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D5A72A63B for ; Tue, 11 Dec 2018 07:41:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726137AbeLKHla (ORCPT ); Tue, 11 Dec 2018 02:41:30 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:41900 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbeLKHla (ORCPT ); Tue, 11 Dec 2018 02:41:30 -0500 Received: by mail-lf1-f67.google.com with SMTP id c16so9988764lfj.8 for ; Mon, 10 Dec 2018 23:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=liQtE7K4RnLemjRTvjCGNXJFX7nKDUGiaTtdD69uyGs=; b=Ix3Bt7jnRsG89XyN0FBdWnoM+BIM9ZTr3Y2aU2yFZvF5ebINnti6yqNQdtDkClQtRy pW4vTv6gvhNX+DhckLDfM83KHdkicmbWtAB6V5qK4k4avAm6sMboGteyuS0afmkDBZsm tCuMiQ2TftXzsuCMuKxvmDFjc6DhfxE8PsxqwrMJzI4ssp+SQXmKRVed5hdOi8rMXjAj Oa5edcR7Vo/TaucezJN7jULDD6/58i5INHcjr6C9DpZyybsaV5GLU+NO7PS07LWuOLdk X1OSvlAJ1tnnKYCciy+nMWGaXjE1aw07FTXjrEiHFdsrYO0AZQqKcZ+4kgh2xMpav0VV A8LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=liQtE7K4RnLemjRTvjCGNXJFX7nKDUGiaTtdD69uyGs=; b=I6W+hUsUsuIAuYjrTFhTua6bReYn/5Uf6obgXugOcxFRDU8INa3GrrT3qp1ddmkB92 uSLR+EgSZasvpH+0G7T/lkV1f5TtKm1HuyYwpaJYIxOQgtOpls4gqAa9bnKZ1Tz1m6Gs Oipfa/QJ1D+4PlJeoY3SGfhk8O8KQEw+8qaUWnH0jPtQGIjormrJbJA/OYQJLc4N1snj RVlyIFS/ymWCNWhIl3FhEGwztRZ9/tY3XdttmEXasnIqRQnkRvhfTujBjATIb5fUPg7E 8kOI11YFeu2XXGFI2CygFs0QQNMUaub6dhJ/0HYug8DuVp0s/+5/FIZlTzmu1PkUi1ED /LQQ== X-Gm-Message-State: AA+aEWYt7INPf0nvPVWGh6b5M8pmaz65rDv3r4KeltGo39qcxJF2FBQi JNU7mo8ddxEthFBZ10q2SsYuswGoxaQdxA== X-Google-Smtp-Source: AFSGD/UuySFSFyVdBY21u6l9CsgPQPzfjVNXyD8t2AMrGTbyYS5zwtaQrTmL05vXArO9c5qZn9sjrg== X-Received: by 2002:a19:7111:: with SMTP id m17mr8259766lfc.64.1544514087489; Mon, 10 Dec 2018 23:41:27 -0800 (PST) Received: from localhost (h-102-249.A137.corp.bahnhof.se. [79.136.102.249]) by smtp.gmail.com with ESMTPSA id q6sm2428531lfh.52.2018.12.10.23.41.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Dec 2018 23:41:27 -0800 (PST) Date: Tue, 11 Dec 2018 08:41:24 +0100 From: =?iso-8859-1?q?J=F6rgen?= Storvist To: Johan Hovold Cc: Lars Melin , linux-usb@vger.kernel.org Subject: [PATCH] USB: serial: option: add Fibocom NL668 series Message-ID: <20181211084124.00005386@gmail.com> In-Reply-To: <20181210083406.GA31358@localhost> References: <20181210002131.0000523a@gmail.com> <20181210083406.GA31358@localhost> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Added USB serial option driver support for Fibocom NL668 series cellular modules. Reserved USB endpoints 4, 5 and 6 for network + ADB interface. Signed-off-by: Jörgen Storvist --- Thanks for feedback! Changes: Removed name declarations for VID/PID Added reserved endpoint for ADB interface usb-devices T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 7 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1508 ProdID=1001 Rev=03.18 S: Manufacturer=Nodecom NL668 Modem S: Product=Nodecom NL668-CN Modem S: SerialNumber=5ced6a52 C: #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 4 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether I: If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+) Den Mon, 10 Dec 2018 09:34:06 +0100 skrev Re: [PATCH] USB: serial: option: add Fibocom NL668 series (fixed line break issue): > On Mon, Dec 10, 2018 at 01:54:14PM +0700, Lars Melin wrote: > > On 12/10/2018 06:21, Jörgen Storvist wrote: > > > > > > Added USB serial option driver support for Fibocom NL668 series cellular module. > > > Reserved USB endpoints 4 and 5 for network interfaces. > > > > > > Signed-off-by: Jörgen Storvist > > > > > > drivers/usb/serial/option.c | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c > > > index e24ff16..f2cc85c 100644 > > > --- a/drivers/usb/serial/option.c > > > +++ b/drivers/usb/serial/option.c > > > @@ -552,6 +552,9 @@ static void option_instat_callback(struct urb *urb); > > > #define WETELECOM_PRODUCT_6802 0x6802 > > > #define WETELECOM_PRODUCT_WMD300 0x6803 > > > > > > +/* Fibocom products */ > > > +#define FIBOCOM_VENDOR_ID 0x1508 > > > +#define FIBOCOM_PRODUCT_NL668 0x1001 > > > > > > /* Device flags */ > > > > > > @@ -1941,6 +1944,8 @@ static const struct usb_device_id option_ids[] = { > > > { USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_6802, 0xff, 0xff, 0xff) }, > > > { USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_WMD300, 0xff, 0xff, 0xff) }, > > > { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x421d, 0xff, 0xff, 0xff) }, /* HP lt2523 (Novatel E371) */ > > > + { USB_DEVICE(FIBOCOM_VENDOR_ID, FIBOCOM_PRODUCT_NL668), /* Fibocom NL668 series */ > > > + .driver_info = RSVD(4) | RSVD(5) }, > > > { } /* Terminating entry */ > > > }; > > > MODULE_DEVICE_TABLE(usb, option_ids); > > > > Listed owner of the 0x1508 VID is "MAATEL" which probably is a customer > > or subsidiary of FIBOCOM (which has the VID 0x2cb7). > > Please don't do this value-to-name conversion, it is completely useless > > and in this case most likely wrong as well. > > Just skip the declaration part and use the VID and PID values directly > > in the device structure list. > > Checkpatch also detects some white space issues, but that should be > taken care of by the above. > > Please also move your changelog comment to after a so called cut-off > line (---, underneath your sign-off); it doesn't belong in the commit > summary (Subject). > > And please provide the output of usb-devices (or lsusb -v) for > reference. > > Thanks, > Johan diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index e24ff16..ca3e398 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -1941,6 +1941,8 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_6802, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_WMD300, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x421d, 0xff, 0xff, 0xff) }, /* HP lt2523 (Novatel E371) */ + { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 series */ + .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, { } /* Terminating entry */ }; MODULE_DEVICE_TABLE(usb, option_ids);