一、EC200T驱动移植
1、添加usb-serial-option usb串口驱动
1.1 修改drivers/usb/serial/option.c
staticconststructusb_device_idoption_ids[] = {
#if 1 //Added by Quectel
{ USB_DEVICE(0x2C7C, 0x0125) }, /* Quectel EC25/EC20 R2.0 */
{ USB_DEVICE(0x2C7C, 0x0121) }, /* Quectel EC21 */
{ USB_DEVICE(0x2C7C, 0x6026) }, /* Quectel EC200T */
#endif
staticintoption_probe(structusb_serial *serial,
conststructusb_device_id *id)
{
structusb_wwan_intf_private *data;
#if 1 //Added by Quectel
//Quectel EC25&EC21 's interface 4 can be used as USB Network device
if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C) && serial->dev->descriptor.idProduct != cpu_to_le16(0x6026)
&& serial->interface->cur_altsetting->desc.bInterfaceNumber>= 4)
return -ENODEV;
if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C) && serial->dev->descriptor.idProduct == cpu_to_le16(0x6026)
&& serial->interface->cur_altsetting->desc.bInterfaceNumber<= 1)
return -ENODEV;
#endif
1.2 添加drivers/usb/serial/usb_wwan.c
/* Fill URB using supplied data. */
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) {
structusb_device_descriptor *desc = &serial->dev->descriptor;
if (desc->idVendor == cpu_to_le16(0x2C7C))
urb->transfer_flags |= URB_ZERO_PACKET;
}
#endif
2、测试驱动加载
2.1 驱动加载流程
4480.389072] usb 1-1: new high-speed USB device number 2 using ehci-pci
[ 4480.724881] usb 1-1: New USB device found, idVendor=2c7c, idProduct=6026
[ 4480.724891] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4480.724945] usb 1-1: Product: Android
[ 4480.724950] usb 1-1: Manufacturer: Android
[ 4480.724953] usb 1-1: SerialNumber: 200806006809080000
[ 4480.880597] usbcore: registered new interface driver usbserial
[ 4480.882143] usbcore: registered new interface driver usbserial_generic
[ 4480.882258] usbserial: USB Serial support registered for generic
[ 4480.900108] usb_wwan: module verification failed: signature and/or required key missing - tainting kernel
[ 4480.904573] cdc_ether 1-1:1.0 eth1: register 'cdc_ether' at usb-0000:02:03.0-1, CDC Ethernet Device, ac:5f:92:e1:e1:7f
[ 4480.907953] usbcore: registered new interface driver cdc_ether
[ 4480.949296] usbcore: registered new interface driver option
[ 4480.949337] usbserial: USB Serial support registered for GSM modem (1-port)
[ 4480.949618] TEST:bInterfaceNumber is 2.
[ 4480.949634] option 1-1:1.2: GSM modem (1-port) converter detected
[ 4480.950765] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 4480.950866] TEST:bInterfaceNumber is 3.
[ 4480.950876] option 1-1:1.3: GSM modem (1-port) converter detected
[ 4480.951768] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 4480.951815] TEST:bInterfaceNumber is 4.
[ 4480.951821] option 1-1:1.4: GSM modem (1-port) converter detected
[ 4480.952507] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
2.2 USB端口设备
/dev/ttyUSB1 is AT Port
/dev/ttyUSB2 is PPP port
3、USB网卡usbnet模式(默认rndis模式)
二、Linux/Android ppp拨号移植
1.Enable CONFIG_PPP_ASYNC CONFIG_PPP_SYNC_TTY CONFIG_PPP_DEFLATE
1.1 modified Makefile
1.2 modified Kconfig