linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Sung <william.sung@advantech.com.tw>
To: Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	William Sung <william.sung@advantech.com.tw>,
	Campion Kang <campion.kang@advantech.com.tw>
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	[thread overview]
Message-ID: <20200901050022.3319-2-william.sung@advantech.com.tw> (raw)
In-Reply-To: <20200901050022.3319-1-william.sung@advantech.com.tw>

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 <william.sung@advantech.com.tw>
---
 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


  reply	other threads:[~2020-09-01  5:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01  5:00 [PATCH 1/2] usb: serial: option: Fix the lackage for Quectel EG95 LTE modem support William Sung
2020-09-01  5:00 ` William Sung [this message]
2020-09-01 14:23   ` [PATCH 2/2] usb: serial: usb_wwan: Fix " Daniele Palmas
2020-09-18  7:52 ` [PATCH 1/2] usb: serial: option: Fix the " Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200901050022.3319-2-william.sung@advantech.com.tw \
    --to=william.sung@advantech.com.tw \
    --cc=campion.kang@advantech.com.tw \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).