linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniele Palmas <dnlplm@gmail.com>
To: William Sung <william.sung@advantech.com.tw>
Cc: Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb <linux-usb@vger.kernel.org>,
	linux-kernel@vger.kernel.org,
	Campion Kang <campion.kang@advantech.com.tw>
Subject: Re: [PATCH 2/2] usb: serial: usb_wwan: Fix lackage for Quectel EG95 LTE modem support
Date: Tue, 1 Sep 2020 16:23:46 +0200	[thread overview]
Message-ID: <CAGRyCJFw05fB-KDcd8PKEg35rjwDh41=1O4XhjS2BQA61VPeng@mail.gmail.com> (raw)
In-Reply-To: <20200901050022.3319-2-william.sung@advantech.com.tw>

Hi William,

Il giorno mar 1 set 2020 alle ore 07:14 William Sung
<william.sung@advantech.com.tw> ha scritto:
>
> 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"

If I'm not wrong, that commit is just related to qmi_wwan.

>
> 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;
> +       }

Why not simply add the ZLP flag in option for that device?

Regards,
Daniele

>
>         return urb;
>  }
> --
> 2.17.1
>

  reply	other threads:[~2020-09-01 14:26 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 ` [PATCH 2/2] usb: serial: usb_wwan: Fix " William Sung
2020-09-01 14:23   ` Daniele Palmas [this message]
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='CAGRyCJFw05fB-KDcd8PKEg35rjwDh41=1O4XhjS2BQA61VPeng@mail.gmail.com' \
    --to=dnlplm@gmail.com \
    --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 \
    --cc=william.sung@advantech.com.tw \
    /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).