OpenWrt – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
4 | office | 1 | --- a/drivers/net/usb/qmi_wwan.c |
2 | +++ b/drivers/net/usb/qmi_wwan.c |
||
3 | @@ -155,6 +155,24 @@ static const u8 default_modem_addr[ETH_A |
||
4 | |||
5 | static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00}; |
||
6 | |||
7 | +#if 1 //Added by Quectel |
||
8 | +#include <linux/etherdevice.h> |
||
9 | +struct sk_buff *qmi_wwan_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) |
||
10 | +{ |
||
11 | + if (dev->udev->descriptor.idVendor != cpu_to_le16(0x2C7C)) |
||
12 | + return skb; |
||
13 | + // Skip Ethernet header from message |
||
14 | + if (skb_pull(skb, ETH_HLEN)) { |
||
15 | + return skb; |
||
16 | + } else { |
||
17 | + dev_err(&dev->intf->dev, "Packet Dropped "); |
||
18 | + } |
||
19 | + // Filter the packet out, release it |
||
20 | + dev_kfree_skb_any(skb); |
||
21 | + return NULL; |
||
22 | +} |
||
23 | +#endif |
||
24 | + |
||
25 | /* Make up an ethernet header if the packet doesn't have one. |
||
26 | * |
||
27 | * A firmware bug common among several devices cause them to send raw |
||
28 | @@ -445,6 +463,20 @@ static int qmi_wwan_bind(struct usbnet * |
||
29 | } |
||
30 | dev->net->netdev_ops = &qmi_wwan_netdev_ops; |
||
31 | dev->net->sysfs_groups[0] = &qmi_wwan_sysfs_attr_group; |
||
32 | +#if 1 //Added by Quectel |
||
33 | + if (dev->udev->descriptor.idVendor == cpu_to_le16(0x2C7C)) { |
||
34 | + dev_info(&intf->dev, "QuectelEC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96&AG35 work on RawIP mode\n"); |
||
35 | + dev->net->flags |= IFF_NOARP; |
||
36 | + usb_control_msg( |
||
37 | + interface_to_usbdev(intf), |
||
38 | + usb_sndctrlpipe(interface_to_usbdev(intf), 0), |
||
39 | + 0x22, //USB_CDC_REQ_SET_CONTROL_LINE_STATE |
||
40 | + 0x21, //USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE |
||
41 | + 1, //active CDC DTR |
||
42 | + intf->cur_altsetting->desc.bInterfaceNumber, |
||
43 | + NULL, 0, 100); |
||
44 | + } |
||
45 | +#endif |
||
46 | err: |
||
47 | return status; |
||
48 | } |
||
49 | @@ -535,7 +567,10 @@ static const struct driver_info qmi_wwan |
||
50 | .bind = qmi_wwan_bind, |
||
51 | .unbind = qmi_wwan_unbind, |
||
52 | .manage_power = qmi_wwan_manage_power, |
||
53 | - .rx_fixup = qmi_wwan_rx_fixup, |
||
54 | + #if 1 //Added by Quectel |
||
55 | + .tx_fixup = qmi_wwan_tx_fixup, |
||
56 | + .rx_fixup = qmi_wwan_rx_fixup, |
||
57 | + #endif |
||
58 | }; |
||
59 | |||
60 | static const struct driver_info qmi_wwan_info_quirk_dtr = { |
||
61 | @@ -569,6 +604,17 @@ static const struct driver_info qmi_wwan |
||
62 | QMI_FIXED_INTF(vend, prod, 0) |
||
63 | |||
64 | static const struct usb_device_id products[] = { |
||
65 | +#if 1 //Added by Quectel |
||
66 | + { QMI_FIXED_INTF(0x05C6, 0x9003, 4) }, /* Quectel UC20 */ |
||
67 | + { QMI_FIXED_INTF(0x2C7C, 0x0125, 4) }, /* Quectel EC25 */ |
||
68 | + { QMI_FIXED_INTF(0x2C7C, 0x0121, 4) }, /* Quectel EC21 */ |
||
69 | + { QMI_FIXED_INTF(0x05C6, 0x9215, 4) }, /* Quectel EC20 */ |
||
70 | + { QMI_FIXED_INTF(0x2C7C, 0x0191, 4) }, /* Quectel EG91 */ |
||
71 | + { QMI_FIXED_INTF(0x2C7C, 0x0195, 4) }, /* Quectel EG95 */ |
||
72 | + { QMI_FIXED_INTF(0x2C7C, 0x0306, 4) }, /* Quectel EG06/EP06/EM06 */ |
||
73 | + { QMI_FIXED_INTF(0x2C7C, 0x0296, 4) }, /* Quectel BG96 */ |
||
74 | + { QMI_FIXED_INTF(0x2C7C, 0x0435, 4) }, /* Quectel AG35 */ |
||
75 | +#endif |
||
76 | /* 1. CDC ECM like devices match on the control interface */ |
||
77 | { /* Huawei E392, E398 and possibly others sharing both device id and more... */ |
||
78 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 9), |
||
79 | @@ -985,7 +1031,6 @@ static const struct usb_device_id produc |
||
80 | {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ |
||
81 | {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ |
||
82 | {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ |
||
83 | - {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */ |
||
84 | {QMI_FIXED_INTF(0x05c6, 0x9215, 4)}, /* Quectel EC20 Mini PCIe */ |
||
85 | {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ |
||
86 | {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */ |
||
87 | --- a/drivers/usb/serial/option.c |
||
88 | +++ b/drivers/usb/serial/option.c |
||
89 | @@ -553,6 +553,22 @@ static void option_instat_callback(struc |
||
90 | #define WETELECOM_PRODUCT_6802 0x6802 |
||
91 | #define WETELECOM_PRODUCT_WMD300 0x6803 |
||
92 | |||
93 | +#define LONGSUNG_PRODUCT_U9300C 0x9b3c |
||
94 | + |
||
95 | +/* FORGE PRODUCT */ |
||
96 | +#define FORGE_VENDOR_ID 0x05c6 |
||
97 | + |
||
98 | +#define FORGE_PRODUCT_SLM750 0xf601 |
||
99 | + |
||
100 | +/* NODECOM PRODUCT */ |
||
101 | +#define NODECOM_VENDOR_ID 0x1508 |
||
102 | + |
||
103 | +#define NODECOM_PRODUCT_NL660 0x1001 |
||
104 | + |
||
105 | +/* NEOWAY PRODUCT */ |
||
106 | +#define NEOWAY_VENDOR_ID 0x2949 |
||
107 | + |
||
108 | +#define NEOWAY_PRODUCT_N720 0x8243 |
||
109 | |||
110 | /* Device flags */ |
||
111 | |||
112 | @@ -564,6 +580,24 @@ static void option_instat_callback(struc |
||
113 | |||
114 | |||
115 | static const struct usb_device_id option_ids[] = { |
||
116 | +#if 1 //Added by Quectel |
||
117 | + { USB_DEVICE(0x05C6, 0x9090) }, /* Quectel UC15 */ |
||
118 | + { USB_DEVICE(0x05C6, 0x9003) }, /* Quectel UC20 */ |
||
119 | + { USB_DEVICE(0x2C7C, 0x0125) }, /* Quectel EC25 */ |
||
120 | + { USB_DEVICE(0x2C7C, 0x0121) }, /* Quectel EC21 */ |
||
121 | + { USB_DEVICE(0x05C6, 0x9215) }, /* Quectel EC20 */ |
||
122 | + { USB_DEVICE(0x2C7C, 0x0191) }, /* Quectel EG91 */ |
||
123 | + { USB_DEVICE(0x2C7C, 0x0195) }, /* Quectel EG95 */ |
||
124 | + { USB_DEVICE(0x2C7C, 0x0306) }, /* Quectel EG06/EP06/EM06 */ |
||
125 | + { USB_DEVICE(0x2C7C, 0x0296) }, /* Quectel BG96 */ |
||
126 | + { USB_DEVICE(0x2C7C, 0x0435) }, /* Quectel AG35 */ |
||
127 | +#endif |
||
128 | + { USB_DEVICE(0x19d2, 0x0536) },/* MZ386 */ |
||
129 | + { USB_DEVICE(LONGCHEER_VENDOR_ID, LONGSUNG_PRODUCT_U9300C) }, |
||
130 | + { USB_DEVICE(FORGE_VENDOR_ID, FORGE_PRODUCT_SLM750) }, |
||
131 | + { USB_DEVICE(NODECOM_VENDOR_ID, NODECOM_PRODUCT_NL660) }, |
||
132 | + { USB_DEVICE(NEOWAY_VENDOR_ID, NEOWAY_PRODUCT_N720) }, |
||
133 | + |
||
134 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, |
||
135 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, |
||
136 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, |
||
137 | @@ -1972,6 +2006,9 @@ static struct usb_serial_driver option_1 |
||
138 | #ifdef CONFIG_PM |
||
139 | .suspend = usb_wwan_suspend, |
||
140 | .resume = usb_wwan_resume, |
||
141 | +#if 1 //Added by Quectel |
||
142 | + .reset_resume = usb_wwan_resume, |
||
143 | +#endif |
||
144 | #endif |
||
145 | }; |
||
146 | |||
147 | @@ -2005,12 +2042,67 @@ static int option_probe(struct usb_seria |
||
148 | * a separate module. |
||
149 | */ |
||
150 | if (dev_desc->idVendor == cpu_to_le16(SAMSUNG_VENDOR_ID) && |
||
151 | - dev_desc->idProduct == cpu_to_le16(SAMSUNG_PRODUCT_GT_B3730) && |
||
152 | - iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) |
||
153 | + dev_desc->idProduct == cpu_to_le16(SAMSUNG_PRODUCT_GT_B3730) && |
||
154 | + iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) |
||
155 | return -ENODEV; |
||
156 | |||
157 | - /* Store the device flags so we can use them during attach. */ |
||
158 | - usb_set_serial_data(serial, (void *)device_flags); |
||
159 | +#if 1 //Added by Quectel |
||
160 | + //Quectel UC20's interface 4 can be used as USB network device |
||
161 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && \ |
||
162 | + serial->dev->descriptor.idProduct == cpu_to_le16(0x9003) \ |
||
163 | + && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) |
||
164 | + return -ENODEV; |
||
165 | + //Quectel EC20's interface 4 can be used as USB network device |
||
166 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && \ |
||
167 | + serial->dev->descriptor.idProduct == cpu_to_le16(0x9215) \ |
||
168 | + && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) |
||
169 | + return -ENODEV; |
||
170 | + //Quectel EC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96/AG35's interface 4 can be used as USB network device |
||
171 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C) \ |
||
172 | + && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) |
||
173 | + return -ENODEV; |
||
174 | +#endif |
||
175 | +#if 1 //Added by Quectel |
||
176 | + //For USB Auto Suspend |
||
177 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && |
||
178 | + serial->dev->descriptor.idProduct == cpu_to_le16(0x9090)) { |
||
179 | + pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); |
||
180 | + usb_enable_autosuspend(serial->dev); |
||
181 | + } |
||
182 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && |
||
183 | + serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)) { |
||
184 | + pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); |
||
185 | + usb_enable_autosuspend(serial->dev); |
||
186 | + } |
||
187 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && |
||
188 | + serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)) { |
||
189 | + pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); |
||
190 | + usb_set_serial_data(serial, (void *)device_flags); |
||
191 | + usb_enable_autosuspend(serial->dev); |
||
192 | + } |
||
193 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) { |
||
194 | + pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); |
||
195 | + usb_enable_autosuspend(serial->dev); |
||
196 | + } |
||
197 | +#endif |
||
198 | +#if 1 //Added by Quectel |
||
199 | + //For USB Remote Wakeup |
||
200 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && |
||
201 | + serial->dev->descriptor.idProduct == cpu_to_le16(0x9090)) { |
||
202 | + device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup |
||
203 | + } |
||
204 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && |
||
205 | + serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)) { |
||
206 | + device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup |
||
207 | + } |
||
208 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && |
||
209 | + serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)) { |
||
210 | + device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup |
||
211 | + } |
||
212 | + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) { |
||
213 | + device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup |
||
214 | + } |
||
215 | +#endif |
||
216 | |||
217 | return 0; |
||
218 | } |
||
219 | --- a/drivers/usb/serial/qcserial.c |
||
220 | +++ b/drivers/usb/serial/qcserial.c |
||
221 | @@ -92,7 +92,6 @@ static const struct usb_device_id id_tab |
||
222 | {USB_DEVICE(0x03f0, 0x241d)}, /* HP Gobi 2000 QDL device (VP412) */ |
||
223 | {USB_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ |
||
224 | {USB_DEVICE(0x05c6, 0x9214)}, /* Acer Gobi 2000 QDL device (VP413) */ |
||
225 | - {USB_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */ |
||
226 | {USB_DEVICE(0x05c6, 0x9264)}, /* Asus Gobi 2000 QDL device (VR305) */ |
||
227 | {USB_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ |
||
228 | {USB_DEVICE(0x05c6, 0x9234)}, /* Top Global Gobi 2000 QDL device (VR306) */ |
||
229 | --- a/drivers/usb/serial/usb_wwan.c |
||
230 | +++ b/drivers/usb/serial/usb_wwan.c |
||
231 | @@ -504,6 +504,19 @@ static struct urb *usb_wwan_setup_urb(st |
||
232 | usb_fill_bulk_urb(urb, serial->dev, |
||
233 | usb_sndbulkpipe(serial->dev, endpoint) | dir, |
||
234 | buf, len, callback, ctx); |
||
235 | +#if 1 //Added by Quectel for zero packet |
||
236 | + if (dir == USB_DIR_OUT) { |
||
237 | + struct usb_device_descriptor *desc = &serial->dev->descriptor; |
||
238 | + if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9090)) |
||
239 | + urb->transfer_flags |= URB_ZERO_PACKET; |
||
240 | + if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9003)) |
||
241 | + urb->transfer_flags |= URB_ZERO_PACKET; |
||
242 | + if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9215)) |
||
243 | + urb->transfer_flags |= URB_ZERO_PACKET; |
||
244 | + if (desc->idVendor == cpu_to_le16(0x2C7C)) |
||
245 | + urb->transfer_flags |= URB_ZERO_PACKET; |
||
246 | + } |
||
247 | +#endif |
||
248 | |||
249 | return urb; |
||
250 | } |