From: Johan Hovold <johan@kernel.org>
To: Daniele Palmas <dnlplm@gmail.com>
Cc: Johan Hovold <johan@kernel.org>, linux-usb@vger.kernel.org
Subject: Re: [PATCH V2 1/1] usb: serial: option: add ZLP support for 0x1bc7/0x9010
Date: Fri, 6 Dec 2019 16:45:37 +0100 [thread overview]
Message-ID: <20191206154537.GQ10631@localhost> (raw)
In-Reply-To: <20191206153732.2451-1-dnlplm@gmail.com>
On Fri, Dec 06, 2019 at 04:37:32PM +0100, Daniele Palmas wrote:
> Telit FN980 flashing device 0x1bc7/0x9010 requires zero packet
> to be sent if out data size is equal to the endpoint max size.
>
> Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
> ---
> V2: removed transfer_length calculations
> diff --git a/drivers/usb/serial/usb-wwan.h b/drivers/usb/serial/usb-wwan.h
> index 1c120eaf4091..934e9361cf6b 100644
> --- a/drivers/usb/serial/usb-wwan.h
> +++ b/drivers/usb/serial/usb-wwan.h
> @@ -38,6 +38,7 @@ struct usb_wwan_intf_private {
> spinlock_t susp_lock;
> unsigned int suspended:1;
> unsigned int use_send_setup:1;
> + unsigned int use_zlp:1;
> int in_flight;
> unsigned int open_ports;
> void *private;
> diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
> index 7e855c87e4f7..5e5a284a4ba3 100644
> --- a/drivers/usb/serial/usb_wwan.c
> +++ b/drivers/usb/serial/usb_wwan.c
> @@ -228,6 +228,8 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
> } else {
> intfdata->in_flight++;
> spin_unlock_irqrestore(&intfdata->susp_lock, flags);
> + if (intfdata->use_zlp)
> + this_urb->transfer_flags |= URB_ZERO_PACKET;
Just set it once when allocating the URBs at port_probe.
> err = usb_submit_urb(this_urb, GFP_ATOMIC);
> if (err) {
> dev_err(&port->dev,
Johan
prev parent reply other threads:[~2019-12-06 15:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-06 15:37 [PATCH V2 1/1] usb: serial: option: add ZLP support for 0x1bc7/0x9010 Daniele Palmas
2019-12-06 15:45 ` Johan Hovold [this message]
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=20191206154537.GQ10631@localhost \
--to=johan@kernel.org \
--cc=dnlplm@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.