imx6ull下移植Air720 4G模块

                imx6ull下移植Air720 4G 模块 一、修改驱动     drivers/usb/serial/option.c:         626 static const struct usb_device_id option_ids[] = {                 627     ...

                imx6ull下移植Air720 4G 模块

一、修改驱动

    drivers/usb/serial/option.c:

         626 static const struct usb_device_id option_ids[] = {        
         627         { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
         628         { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
         629         { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) },
         630         { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_QUAD) },
          ...                       

        1819         #if 1 //Added by Air720                        

        1820         { USB_DEVICE(0x1286, 0x4e3d) },

        1821         #endif
        1822         { } /* Terminating entry */                        
        1823 };

          ...

        1830 static struct usb_serial_driver option_1port_device = {
        1831         .driver = {
        1832                 .owner =        THIS_MODULE,
        1833                 .name =         "option1",
        1834         },
        1835         .description       = "GSM modem (1-port)",
        1836         .id_table          = option_ids,
        1837         .num_ports         = 1,
        1838         .probe             = option_probe,
        1853 #ifdef CONFIG_PM
        1854         .suspend           = usb_wwan_suspend,
        1855         .resume            = usb_wwan_resume,
        1856         #if 1 //Added by Quectel & Air720
        1857         .reset_resume      = usb_wwan_resume,
        1858         #endif
        1859 #endif
        1860 };


    drivers/usb/serial/usb_wwan.c

        458 static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port,
        459                                       int endpoint,
        460                                       int dir, void *ctx, char *buf, int len,
        461                                       void (*callback) (struct urb *))
        462 {
        463         struct usb_serial *serial = port->serial;
        464         struct urb *urb;
        ...
        487         #if 1 //Added by Air720
        488         if(dir == USB_DIR_OUT){
        489                 struct usb_device_descriptor *desc = &serial->dev->descriptor;
        490                 if(desc->idVendor == cpu_to_le16(0x1286) && desc->idProduct == cpu_to_le16(0x4e3d))
        491                 {
        492                         urb->transfer_flags |= URB_ZERO_PACKET;
        493                 }
        494         }
        
495         #endif
        496         return urb;
        497 }

二、配置kernel

      make menuconfig:

        Device Drivers  --->
            [*] USB support  --->
                <*>   USB Serial Converter support  --->
                    <*>   USB driver for GSM and CDMA modems
            [*] Network device support  --->
                <*>   PPP (point-to-point protocol) support
                <*>     PPP BSD-Compress compression
                <*>     PPP Deflate compression
                [*]     PPP filtering
                <*>     PPP MPPE compression (encryption)
                [*]     PPP multilink support
                <*>     PPP over Ethernet
                <*>     PPP support for async serial ports
                <*>     PPP support for sync tty ports   

        当系统启动后,可以看到/dev/目录下产生ttyUSB1-4节点,说明驱动移植成功。

attachments-2020-04-a0mFgYpF5e8468b1340fa.png

二、拨号

    在/etc/ppp/目录下新建peers目录,并在peers目录下新建air720-chat-connect、air720-chat-disconnect、air720-ppp和air720-ppp-kill拨号脚本:

attachments-2020-04-llXAVnCO5e846247c28b4.png    开始拨号:

        pppd call air720-ppp

细节请参考合宙官方教程:https://ask.openluat.com/article/37

附件:移植Air720.zip

  • 发表于 2020-04-01 17:50
  • 阅读 ( 63 )
  • 分类:nxp imx6

0 条评论

请先 登录 后评论
ronnie
ronnie

11 篇文章

作家榜 »

  1. ronnie 11 文章
  2. FU 5 文章
  3. toca 4 文章
  4. 大飞 3 文章
  5. Vivek 3 文章
  6. jack-fang 2 文章
  7. 刘崇凯 0 文章
  8. nanluqiao 0 文章