diff --git a/target/linux/generic/hack-5.4/997-add-fibocom-id-and-zeropacket.patch b/target/linux/generic/hack-5.4/997-add-fibocom-id-and-zeropacket.patch new file mode 100644 index 000000000..7121aa153 --- /dev/null +++ b/target/linux/generic/hack-5.4/997-add-fibocom-id-and-zeropacket.patch @@ -0,0 +1,87 @@ +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -616,6 +616,58 @@ static void option_instat_callback(struct urb *urb); + + + static const struct usb_device_id option_ids[] = { ++ /*start add by fibocom*/ ++ /*start FM150/FG150/FM100/FM101/FG101/FM130/FM160/NL95X*/ ++ { USB_DEVICE(0x2cb7, 0x0104) , /* USBMODE = 17 & 32 */ ++ .driver_info = RSVD(4) | RSVD(5)}, ++ { USB_DEVICE(0x2cb7, 0x0105) , /* USBMODE = 18 & 33 */ ++ .driver_info = RSVD(4) | RSVD(5)|RSVD(6)}, ++ { USB_DEVICE(0x2cb7, 0x0106) , /* USBMODE = 19*/ ++ .driver_info = RSVD(3) | RSVD(4)}, ++ { USB_DEVICE(0x2cb7, 0x0109) , /* USBMODE = 22*/ ++ .driver_info = RSVD(2) } , ++ { USB_DEVICE(0x2cb7, 0x010A) , /* USBMODE = 23*/ ++ .driver_info = RSVD(2) | RSVD(3)}, ++ { USB_DEVICE(0x2cb7, 0x010B) , /* USBMODE = 24*/ ++ .driver_info = RSVD(0) | RSVD(1)|RSVD(4)}, ++ { USB_DEVICE(0x2cb7, 0x010C) , /* USBMODE = 25*/ ++ .driver_info = RSVD(4) | RSVD(5)|RSVD(6)}, ++ { USB_DEVICE(0x2cb7, 0x010D) , /* USBMODE = 26*/ ++ .driver_info = RSVD(4) | RSVD(5)|RSVD(6)}, ++ { USB_DEVICE(0x2cb7, 0x010E) , /* USBMODE = 27*/ ++ .driver_info = RSVD(4) | RSVD(5)|RSVD(6)}, ++ { USB_DEVICE(0x2cb7, 0x010F) , /* FG150 USBMODE = 28*/ ++ .driver_info = RSVD(0) | RSVD(1)}, ++ { USB_DEVICE(0x2cb7, 0x0110) , /* FG150 USBMODE = 29*/ ++ .driver_info = RSVD(0) | RSVD(1)}, ++ { USB_DEVICE(0x2cb7, 0x0111) , /* FG150 USBMODE = 30*/ ++ .driver_info = RSVD(0) | RSVD(1)}, ++ /*end FM150/FG150/FM100/FM101/FG101/FM130/FM160/NL95X*/ ++ /*start FG650 & FM650*/ ++ { USB_DEVICE(0x2CB7, 0x0A04) , /* FG650 & FM650 USBMODE = 34*/ ++ .driver_info = RSVD(0) | RSVD(1) }, ++ { USB_DEVICE(0x2CB7, 0x0A04) , /* FG650 & FM650 USBMODE = 35*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(5)}, ++ { USB_DEVICE(0x2CB7, 0x0A05) , /*FG650 & FM650 USBMODE = 36*/ ++ .driver_info = RSVD(0) | RSVD(1) }, ++ { USB_DEVICE(0x2CB7, 0x0A05) , /*FG650 & FM650 USBMODE = 37*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(6)}, ++ { USB_DEVICE(0x2CB7, 0x0A06) , /*FG650 & FM650 USBMODE = 38*/ ++ .driver_info = RSVD(0) | RSVD(1) }, ++ { USB_DEVICE(0x2CB7, 0x0A06) , /*FG650 & FM650 USBMODE = 39*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(6)}, ++ { USB_DEVICE(0x2CB7, 0x0A07) , /*FG650 & FM650 USBMODE = 40*/ ++ .driver_info = RSVD(0) | RSVD(1) }, ++ { USB_DEVICE(0x2CB7, 0x0A07) , /*FG650 & FM650 USBMODE = 41*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(6)}, ++ /*end FG650 & FM650*/ ++ /*start FM350*/ ++ { USB_DEVICE(0x0E8D, 0x7126) , /*FM350 USBMODE = 40*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(7)}, ++ { USB_DEVICE(0x0E8D, 0x7127) , /*FM350 USBMODE = 41*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(7)}, ++ /*end FM350*/ ++ /*end add by fibocom*/ + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, +--- a/drivers/usb/serial/usb_wwan.c ++++ b/drivers/usb/serial/usb_wwan.c +@@ -431,6 +431,23 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, + usb_fill_bulk_urb(urb, serial->dev, + usb_sndbulkpipe(serial->dev, endpoint) | dir, + buf, len, callback, ctx); ++ ++#if 1 //Added by Quectel for zero packet ++ if (dir == USB_DIR_OUT) { ++ struct usb_device_descriptor *desc = &serial->dev->descriptor; ++ if (desc->idVendor == cpu_to_le16(0x2C7C)) ++ urb->transfer_flags |= URB_ZERO_PACKET; ++ } ++#endif ++#if 2 //*start add by fibocom for zero packet* ++ if (dir == USB_DIR_OUT) { ++ struct usb_device_descriptor *desc = &serial->dev->descriptor; ++ if (desc->idVendor == cpu_to_le16(0x2CB7) || cpu_to_le16(0x0E8D) ) ++ { ++ urb->transfer_flags |= URB_ZERO_PACKET; ++ } ++ } ++#endif + + if (intfdata->use_zlp && dir == USB_DIR_OUT) + urb->transfer_flags |= URB_ZERO_PACKET; diff --git a/target/linux/generic/hack-6.1/993-add-fibocom-id-and-zeropacket.patch b/target/linux/generic/hack-6.1/993-add-fibocom-id-and-zeropacket.patch new file mode 100644 index 000000000..7121aa153 --- /dev/null +++ b/target/linux/generic/hack-6.1/993-add-fibocom-id-and-zeropacket.patch @@ -0,0 +1,87 @@ +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -616,6 +616,58 @@ static void option_instat_callback(struct urb *urb); + + + static const struct usb_device_id option_ids[] = { ++ /*start add by fibocom*/ ++ /*start FM150/FG150/FM100/FM101/FG101/FM130/FM160/NL95X*/ ++ { USB_DEVICE(0x2cb7, 0x0104) , /* USBMODE = 17 & 32 */ ++ .driver_info = RSVD(4) | RSVD(5)}, ++ { USB_DEVICE(0x2cb7, 0x0105) , /* USBMODE = 18 & 33 */ ++ .driver_info = RSVD(4) | RSVD(5)|RSVD(6)}, ++ { USB_DEVICE(0x2cb7, 0x0106) , /* USBMODE = 19*/ ++ .driver_info = RSVD(3) | RSVD(4)}, ++ { USB_DEVICE(0x2cb7, 0x0109) , /* USBMODE = 22*/ ++ .driver_info = RSVD(2) } , ++ { USB_DEVICE(0x2cb7, 0x010A) , /* USBMODE = 23*/ ++ .driver_info = RSVD(2) | RSVD(3)}, ++ { USB_DEVICE(0x2cb7, 0x010B) , /* USBMODE = 24*/ ++ .driver_info = RSVD(0) | RSVD(1)|RSVD(4)}, ++ { USB_DEVICE(0x2cb7, 0x010C) , /* USBMODE = 25*/ ++ .driver_info = RSVD(4) | RSVD(5)|RSVD(6)}, ++ { USB_DEVICE(0x2cb7, 0x010D) , /* USBMODE = 26*/ ++ .driver_info = RSVD(4) | RSVD(5)|RSVD(6)}, ++ { USB_DEVICE(0x2cb7, 0x010E) , /* USBMODE = 27*/ ++ .driver_info = RSVD(4) | RSVD(5)|RSVD(6)}, ++ { USB_DEVICE(0x2cb7, 0x010F) , /* FG150 USBMODE = 28*/ ++ .driver_info = RSVD(0) | RSVD(1)}, ++ { USB_DEVICE(0x2cb7, 0x0110) , /* FG150 USBMODE = 29*/ ++ .driver_info = RSVD(0) | RSVD(1)}, ++ { USB_DEVICE(0x2cb7, 0x0111) , /* FG150 USBMODE = 30*/ ++ .driver_info = RSVD(0) | RSVD(1)}, ++ /*end FM150/FG150/FM100/FM101/FG101/FM130/FM160/NL95X*/ ++ /*start FG650 & FM650*/ ++ { USB_DEVICE(0x2CB7, 0x0A04) , /* FG650 & FM650 USBMODE = 34*/ ++ .driver_info = RSVD(0) | RSVD(1) }, ++ { USB_DEVICE(0x2CB7, 0x0A04) , /* FG650 & FM650 USBMODE = 35*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(5)}, ++ { USB_DEVICE(0x2CB7, 0x0A05) , /*FG650 & FM650 USBMODE = 36*/ ++ .driver_info = RSVD(0) | RSVD(1) }, ++ { USB_DEVICE(0x2CB7, 0x0A05) , /*FG650 & FM650 USBMODE = 37*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(6)}, ++ { USB_DEVICE(0x2CB7, 0x0A06) , /*FG650 & FM650 USBMODE = 38*/ ++ .driver_info = RSVD(0) | RSVD(1) }, ++ { USB_DEVICE(0x2CB7, 0x0A06) , /*FG650 & FM650 USBMODE = 39*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(6)}, ++ { USB_DEVICE(0x2CB7, 0x0A07) , /*FG650 & FM650 USBMODE = 40*/ ++ .driver_info = RSVD(0) | RSVD(1) }, ++ { USB_DEVICE(0x2CB7, 0x0A07) , /*FG650 & FM650 USBMODE = 41*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(6)}, ++ /*end FG650 & FM650*/ ++ /*start FM350*/ ++ { USB_DEVICE(0x0E8D, 0x7126) , /*FM350 USBMODE = 40*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(7)}, ++ { USB_DEVICE(0x0E8D, 0x7127) , /*FM350 USBMODE = 41*/ ++ .driver_info = RSVD(0) | RSVD(1) | RSVD(7)}, ++ /*end FM350*/ ++ /*end add by fibocom*/ + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, +--- a/drivers/usb/serial/usb_wwan.c ++++ b/drivers/usb/serial/usb_wwan.c +@@ -431,6 +431,23 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, + usb_fill_bulk_urb(urb, serial->dev, + usb_sndbulkpipe(serial->dev, endpoint) | dir, + buf, len, callback, ctx); ++ ++#if 1 //Added by Quectel for zero packet ++ if (dir == USB_DIR_OUT) { ++ struct usb_device_descriptor *desc = &serial->dev->descriptor; ++ if (desc->idVendor == cpu_to_le16(0x2C7C)) ++ urb->transfer_flags |= URB_ZERO_PACKET; ++ } ++#endif ++#if 2 //*start add by fibocom for zero packet* ++ if (dir == USB_DIR_OUT) { ++ struct usb_device_descriptor *desc = &serial->dev->descriptor; ++ if (desc->idVendor == cpu_to_le16(0x2CB7) || cpu_to_le16(0x0E8D) ) ++ { ++ urb->transfer_flags |= URB_ZERO_PACKET; ++ } ++ } ++#endif + + if (intfdata->use_zlp && dir == USB_DIR_OUT) + urb->transfer_flags |= URB_ZERO_PACKET;