歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

嵌入式Linux教程:移植DM9000網卡

        1,vi include/linux/dm9000.h
28行增加

unsigned char    param_addr[6];

2,復制 友善的 arch/arm/mach-s3c64xx/mach-mini6410.c 到相應目錄下

3,vi drivers/net/dm9000.c

大概1586行
將mac_src = "platform data";
memcpy(ndev->dev_addr, pdata->dev_addr, 6);

改成

  mac_src = "param data";
  memcpy(ndev->dev_addr, pdata->param_addr, 6);

大概1598行
增加
   if (!is_valid_ether_addr(ndev->dev_addr) && pdata != NULL) {
                mac_src = "platform data";
                memcpy(ndev->dev_addr, pdata->dev_addr, 6);
        }

4,make menuconfig
        [*] Networking support  --->
                Networking options  ---> 
               <*> Packet socket                                               
                 <*> Unix domain sockets 
                [*] TCP/IP networking
                  [*]   IP: kernel level autoconfiguration                      
                      [*]     IP: DHCP support                                       
                          [*]     IP: BOOTP support                                       
                      [*]     IP: RARP support
    Device Drivers  --->
        [*] Network device support  --->
            [*]   Ethernet (10 or 100Mbit)  --->
                 <*>   DM9000 support 
            [ ]   Ethernet (1000 Mbit)  --->   去掉
其他的默認  執行make 編譯出來就可以了

Copyright © Linux教程網 All Rights Reserved