hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/drivers/usb/serial/usb_wwan.c
....@@ -140,10 +140,10 @@
140140 ss->line = port->minor;
141141 ss->port = port->port_number;
142142 ss->baud_base = tty_get_baud_rate(port->port.tty);
143
- ss->close_delay = jiffies_to_msecs(port->port.close_delay) / 10;
143
+ ss->close_delay = port->port.close_delay / 10;
144144 ss->closing_wait = port->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
145145 ASYNC_CLOSING_WAIT_NONE :
146
- jiffies_to_msecs(port->port.closing_wait) / 10;
146
+ port->port.closing_wait / 10;
147147 return 0;
148148 }
149149 EXPORT_SYMBOL(usb_wwan_get_serial_info);
....@@ -155,10 +155,9 @@
155155 unsigned int closing_wait, close_delay;
156156 int retval = 0;
157157
158
- close_delay = msecs_to_jiffies(ss->close_delay * 10);
158
+ close_delay = ss->close_delay * 10;
159159 closing_wait = ss->closing_wait == ASYNC_CLOSING_WAIT_NONE ?
160
- ASYNC_CLOSING_WAIT_NONE :
161
- msecs_to_jiffies(ss->closing_wait * 10);
160
+ ASYNC_CLOSING_WAIT_NONE : ss->closing_wait * 10;
162161
163162 mutex_lock(&port->port.mutex);
164163
....@@ -271,9 +270,7 @@
271270 if (status) {
272271 dev_dbg(dev, "%s: nonzero status: %d on endpoint %02x.\n",
273272 __func__, status, endpoint);
274
-
275
- /* don't resubmit on fatal errors */
276
- if (status == -ESHUTDOWN || status == -ENOENT)
273
+ if (status == -ESHUTDOWN || status == -ENOENT || status == -EPROTO)
277274 return;
278275 } else {
279276 if (urb->actual_length) {
....@@ -435,8 +432,7 @@
435432
436433 /*
437434 * Need to take susp_lock to make sure port is not already being
438
- * resumed, but no need to hold it due to the tty-port initialized
439
- * flag.
435
+ * resumed, but no need to hold it due to initialized
440436 */
441437 spin_lock_irq(&intfdata->susp_lock);
442438 if (--intfdata->open_ports == 0)
....@@ -467,7 +463,6 @@
467463 void (*callback) (struct urb *))
468464 {
469465 struct usb_serial *serial = port->serial;
470
- struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
471466 struct urb *urb;
472467
473468 urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
....@@ -478,8 +473,18 @@
478473 usb_sndbulkpipe(serial->dev, endpoint) | dir,
479474 buf, len, callback, ctx);
480475
481
- if (intfdata->use_zlp && dir == USB_DIR_OUT)
482
- urb->transfer_flags |= URB_ZERO_PACKET;
476
+#if 1 //Added by Quectel for Zero Packet
477
+ if (dir == USB_DIR_OUT) {
478
+ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && serial->dev->descriptor.idProduct == cpu_to_le16(0x9090))
479
+ urb->transfer_flags |= URB_ZERO_PACKET;
480
+ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && serial->dev->descriptor.idProduct == cpu_to_le16(0x9003))
481
+ urb->transfer_flags |= URB_ZERO_PACKET;
482
+ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && serial->dev->descriptor.idProduct == cpu_to_le16(0x9215))
483
+ urb->transfer_flags |= URB_ZERO_PACKET;
484
+ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C))
485
+ urb->transfer_flags |= URB_ZERO_PACKET;
486
+ }
487
+#endif
483488
484489 return urb;
485490 }