Linux 4g模块NL660驱动

文章介绍了如何进行硬件和软件设计,特别是针对特定USB设备ID的配置。通过在drivers/net/usb目录下添加Fibocom_Linux_GobiNet_Driver并修改makefile来编译生成GobiNet.ko模块。之后,进行了拨号测试,使用ltemanage工具,在遇到udhcpc分配IP的问题时,通过杀掉相关进程并重试,最终成功ping通了外网。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 1、硬件设计

 

2、 软件设计

 

 

 

 

option.c  option_ids 添加如下

    { USB_DEVICE(0x1508, 0x1001) }, 
    { USB_DEVICE(0x1508, 0x1000) }, 

 

     { USB_DEVICE(0x1508, 0x1001),                        /* Fibocom NL668 (IOT version) */
      .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, 
    { USB_DEVICE(0x1508, 0x1000),                        /* Fibocom NL668 (IOT version)*/
      .driver_info = RSVD(4) | RSVD(5) | RSVD(6) },

   

 if (serial->dev->descriptor.idVendor == cpu_to_le16(0x1508) &&
        serial->dev->descriptor.idProduct == cpu_to_le16(0x1000) &&
        serial->interface->cur_altsetting->desc.bInterfaceNumber >= 2)
        return -ENODEV;

    if (((serial->dev->descriptor.idVendor == cpu_to_le16(0x1c9e) && serial->dev->descriptor.idProduct == cpu_to_le16(0x9b05))
    || (serial->dev->descriptor.idVendor == cpu_to_le16(0x161c) && serial->dev->descriptor.idProduct == cpu_to_le16(0x9115))
    ||(serial->dev->descriptor.idVendor == cpu_to_le16(0x05c6) && serial->dev->descriptor.idProduct == cpu_to_le16(0xf601))
    ||  (serial->dev->descriptor.idVendor == cpu_to_le16(0x1c9e) && serial->dev->descriptor.idProduct == cpu_to_le16(0x9b3c))
    ||  (serial->dev->descriptor.idVendor == cpu_to_le16(0x1508) && serial->dev->descriptor.idProduct == cpu_to_le16(0x1001))
    || (serial->dev->descriptor.idVendor == 0x2cb7 && (serial->dev->descriptor.idProduct == 0x0104 
                              || serial->dev->descriptor.idProduct == 0x0105||serial->dev->descriptor.idProduct == 0x010b
                              ))) &&
        serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
        return -ENODEV;

 

 

在目录 drives/net/usb 添加Fibocom_Linux_GobiNet_Driver文件夹

下载

https://download.youkuaiyun.com/download/u011425939/87910747

 修改makefile

编译生成 GobiNet.ko

 

 

 

 拨号测试代码

ltemanage

下载

https://download.youkuaiyun.com/download/u011425939/87910764

udhcpc 分配不到ip出现如下情况

 解决办法 找到下面进程杀死

 重新执行测试代码

 

 测试结果

 能成功ping 外网

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值