最近调通了几个MTK平台添加USB转以太网项目

来源:互联网 发布:广州祺曜互娱 知乎 编辑:程序博客网 时间:2024/06/06 12:50
没有任何的Wi-Fi和3G无线网卡情况下,通过有线网络(以太网)也可以上网,用户还可以通过有线网络(以太网)进行网络连接。以太网是一种基带局域网规范,是当今现有局域网采用的最通用的通信协议标准。以太网络使用CSMA/CD技术,并以较快的速率运行在多种类型的电缆上。

        最近接到许多客户需要增加以太网功能,所以在网上搜集了一下相关USB网卡资讯:发现有几款USB转以太网的芯片可供选择----LAN7500  , DM9621  ,  AX88772   。。。等等

        稍作考量后,最后选择了DM9621这款芯片进行调试;我这边平台为:MT8735M安卓5.1。调试步骤如下:

1,从网上找了该网卡的代理商,并取得相关DM9621demo板以及驱动文件;

=====demo板如下====


=====驱动附件======
 How to Install DM9620 Driver on RMI_AU1250 Platform.pdf (30.06 KB, 下载次数: 10) 
 lnx_dm9620(V2.49.1a_dhcp6).rar (14.35 KB, 下载次数: 4) 
好像上面下载不了?请到网盘下载:

http://pan.baidu.com/s/1c1xAqjQ


https://pan.baidu.com/s/1c96spg


2,软硬件都拿到手了,现在就是开始相关驱动调试:

請參考下列步驟: (“drivers/usb/net” is for old kernel version, “drivers/net/usb” is for the new kernel version )
DM9621 Driver
l Copy DM9621 driver into the kernel source
v Copy “dm9620.c” to “drivers/usb/net” 

l Modify “drivers/usb/net/Kconfig”
   Find the “config USB_NET_CDCETHER” configuration item, add below configuration item
to follow it:
config USB_NET_DM9620
        tristate "Davicom DM9620 based ethernet devices"
        depends on USB_USBNET
        select CRC32
        select MII
        help
          This option adds support for Davicom DM9620 based
           usb-ethernet adapters.

l Modify “drivers/usb/net/Makefile”
Add “dm9620.o” into the object file list:
Obj-$(CONFIG_USB_NET_DM9620)    += dm9620.o

l enable the Multi-purpose USB Networking Framework and then DM9620/21, and save your new
kernel configuration.
    
   Change to BSP directory:
SHELL> cd ~/pxa270/microtime/linux
Start by execute the command:
SHELL> make menuconfig

Track the configure structure as below hierarchy, select Multi-purpose USB Networking
Framework” & “Davicom DM9620 based ethernet devices”:

Device Drivers --->
USB support --->
USB Network Adapters ---> 
  • Multi-purpose USB Networking Framework
                  :
             <*> Davicom DM9620 based ethernet devices




  • 3,加入后刷机,重启。。。

    此时出现一个令我头疼的问题:由于MT8735只有一个USB OTG口,我把网卡驱动添加后,插上DM9621 USB网卡,发现此时我没办法用PC进行ADB调试了。。没有USB口了。。。接SUB hub的话,也是不能进行ADB调试的,因为两者都需要OTG功能。。。。
    最后还是百度了一个办法:平板内下载一个叫“超级终端”的APK,此软件可以模拟adb调试环境。

    打开DHCP,ifconfig eth0 up,接上路由器;此时网卡已经可以正常工作,adb内输入ifconfig 或者 netcfg 即可看到 eth0 已经UP起来,也能看到相关IP地址信息;

    1)ping 路由器 192.168.1.1 ,发现link ok!
    2)此时打开浏览器,输入baidu.com 成功连接。


    至此,底层驱动调试完毕。


    4,目前上层还在设计中。。。
    原创粉丝点击