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@xxxxxxxxx> > --- > 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