Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1465239pxk; Mon, 31 Aug 2020 22:02:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX1jIAxci/AojLyeYUXSZThUDPMo9Wr2glgXxN/eVUY/ERIGZNSa5TMA5X7KgoYu+ozFXE X-Received: by 2002:a17:906:b10:: with SMTP id u16mr3807771ejg.179.1598936523698; Mon, 31 Aug 2020 22:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598936523; cv=none; d=google.com; s=arc-20160816; b=pnvthgkmrewJdvb0kOA4FfStsv2Wb3aOIWdZsP3Jc5n9lmInGUS+qP3oa+gprce13I 672L5x+Et/vfAVmGeLnvQ7UE+pjqGivYEiI3kF5HBOvLQZf072CW+17xgnvKC5W/WPvk yDHjTzu+sw1umA3uIZ+mwV5FOwn4J9n7EG6of2Od1lpQcJAFyVl/xlaEwyRTjiogu7Rk +ctDfdYsM2pQ891BNIXqkjID29KNc/J47JQ8jycOVI2mqAuN0iqVKAccQ5+J238tOW7F dMFEh5JoJefinLCP8pmEZvPVrBiqMGIL6R+bfOu5wUnLoMfdACbBfN8ThVpFtATlP0QI WRtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=Adn3oP1AirQjjeccT+74uO87xTiqnou+MinHXnwYG08=; b=i8oCcIdjizcdJrGlTHMk0JQBwN0ykxVXmWR+pDlps0beiIyzXdffRJEoWhweZdaswM 2pNFRsgHguuOGWQRUYkTSpqO/GIvPE6FyaFy439cZY/X8geKx1L+McRNix9j5bZBOdaz dMSYivmXWO7kyU/JGbm6tWf7LaM0uLeZvDMW6mEc1AZuheULLsehstdo+LM0lfdZbSCB 6RZtMEuV6JwG2iewhHakyW/sy7T1/QrmdNMRY/0bvYMBLEf4lw7a0yYl7LNpowO39aen HV8Bsentfipqgs6sszcR7e1k49EMIjLUTkkNlo1HMT8bhX6HBkHaWiIv5BAwJi802wZO cqiA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp16si112772ejc.17.2020.08.31.22.01.40; Mon, 31 Aug 2020 22:02:03 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726183AbgIAFA2 (ORCPT + 99 others); Tue, 1 Sep 2020 01:00:28 -0400 Received: from aclms3.advantech.com.tw ([125.252.70.86]:12092 "EHLO ACLMS3.advantech.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725930AbgIAFA2 (ORCPT ); Tue, 1 Sep 2020 01:00:28 -0400 Received: from taipei09.ADVANTECH.CORP (unverified [172.20.0.236]) by ACLMS3.advantech.com.tw (Clearswift SMTPRS 5.6.0) with ESMTP id ; Tue, 1 Sep 2020 13:00:23 +0800 Received: from localhost (172.16.12.96) by taipei09.ADVANTECH.CORP (172.20.0.236) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Sep 2020 13:00:22 +0800 From: William Sung To: Johan Hovold , Greg Kroah-Hartman , , , William Sung , Campion Kang Subject: [PATCH 2/2] usb: serial: usb_wwan: Fix lackage for Quectel EG95 LTE modem support Date: Tue, 1 Sep 2020 13:00:22 +0800 Message-ID: <20200901050022.3319-2-william.sung@advantech.com.tw> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200901050022.3319-1-william.sung@advantech.com.tw> References: <20200901050022.3319-1-william.sung@advantech.com.tw> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.16.12.96] X-ClientProxiedBy: ACLDAG.ADVANTECH.CORP (172.20.2.88) To taipei09.ADVANTECH.CORP (172.20.0.236) X-StopIT: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As required by the USB protocol, add zero packet support for Quectel EG95 LTE modem module. Fixes: f815dd5cf48b ("net: usb: qmi_wwan: add support for Quectel EG95 LTE modem" Signed-off-by: William Sung --- drivers/usb/serial/usb_wwan.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 4b9845807bee..75495c939ac6 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -467,6 +467,7 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, struct usb_serial *serial = port->serial; struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial); struct urb *urb; + struct usb_device_descriptor *desc = &serial->dev->descriptor; urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ if (!urb) @@ -476,8 +477,15 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, usb_sndbulkpipe(serial->dev, endpoint) | dir, buf, len, callback, ctx); - if (intfdata->use_zlp && dir == USB_DIR_OUT) - urb->transfer_flags |= URB_ZERO_PACKET; + if (dir == USB_DIR_OUT) { + if (intfdata->use_zlp) + urb->transfer_flags |= URB_ZERO_PACKET; + + /* Add zero packet support for Quectel EG95 */ + if (desc->idVendor == cpu_to_le16(0x2C7C) && + desc->idProduct == cpu_to_le16(0x0195)) + urb->transfer_flags |= URB_ZERO_PACKET; + } return urb; } -- 2.17.1