dm9000

添加选项:

make  menuconfig

[*] Networking support  --->
    Networking options  --->
    [*] TCP/IP networking                                           
  │ │    [*]   IP: multicasting                                          
  │ │    [*]   IP: advanced router                                       
  │ │    [*]     FIB TRIE statistics                                    
  │ │    [*]     IP: policy routing                                      
  │ │    [*]     IP: equal cost multipath                              
  │ │    [*]     IP: verbose route monitoring           
    [*]   IP: kernel level autoconfiguration                         │ │  
  │ │    [*]     IP: DHCP support                                         │ │  
  │ │    [*]     IP: BOOTP support                                        │ │  
  │ │    [*]     IP: RARP support                                         │ │  
  │ │    <*>   IP: tunneling                                              │ │  
  │ │    <*>   IP: GRE demultiplexer                                      │ │  
  │ │    <M>     IP: GRE tunnels over IP                                  │ │  
  │ │    [ ]       IP: broadcast GRE over IP                              │ │  
  │ │    [*]   IP: multicast routing                                      │ │  
  │ │    [*]     IP: multicast policy routing   
    [*]     IP: PIM-SM version 1 support                             │ │  
  │ │    [*]     IP: PIM-SM version 2 support                             │ │  
  │ │    [*]   IP: ARP daemon support                                     │ │  
  │ │    [*]   IP: TCP syncookie support                                  │ │  
  │ │    <*>   IP: AH transformation                                      │ │  
  │ │    <*>   IP: ESP transformation                                     │ │  
  │ │    <*>   IP: IPComp transformation                                  │ │  
  │ │    <*>   IP: IPsec transport mode                                   │ │  
  │ │    <*>   IP: IPsec tunnel mode                                      │ │  

  │ │    <*>   IP: IPsec BEET mode  

    <*>   Large Receive Offload (ipv4/tcp)                           │ │  
  │ │    <*>   INET: socket monitoring interface  



Device Drivers  ---> 

 [*] Network device support  --->
  [*]   Ethernet driver support  --->
   <*>   DM9000 support


2.添加dm9000的代码,在arch/arm/mach-s3c64xx/mach-s3c6410.c

添加头文件

#include <linux/dm9000.h>


添加初始化代码。分配资源

/*
  dm9000
  add by fatfish
*/
/* DM9000AEP 10/100 ethernet controller */

#define SMDK6410_PA_DM9000      (0x18000000)

 

#define SMDK6410_VA_EXTDEV    S3C_ADDR(0x02000000)

#define SMDK6410_PA_EXTDEV    (0x30000000)

 

#define SMDK6410_EN_DM9000     (1<<14)

 

static __u32 smdk6410_extdev_status;

static void __init smdk6410_dm9000_enable(void)

{

       smdk6410_extdev_status |= (SMDK6410_EN_DM9000 << 16);

       __raw_writel(smdk6410_extdev_status, SMDK6410_VA_EXTDEV);

}

 

static struct resource smdk6410_dm9000_resource[] = {

       [0] = {

              .start = SMDK6410_PA_DM9000,

              .end   = SMDK6410_PA_DM9000 + 3,

              .flags = IORESOURCE_MEM,

       },

       [1] = {

              .start = SMDK6410_PA_DM9000 + 4,

              .end   = SMDK6410_PA_DM9000 + 4 + 500,

              .flags = IORESOURCE_MEM,

       },

       [2] = {

              .start = IRQ_EINT(7),            /*根据电路图来的*/

              .end   = IRQ_EINT(7),

              .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,

       },

};

 

static struct dm9000_plat_data smdk6410_dm9000_pdata = {

       .flags        = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),

       .dev_addr       = { 0x08, 0x90, 0x90, 0x90, 0x90, 0x90 },     /* MAC addr*/

       /* dev_addr can be set to provide hwaddr. */

};

 

static struct platform_device smdk6410_device_eth = {

       .name      = "dm9000",

       .id   = -1,

       .num_resources      = ARRAY_SIZE(smdk6410_dm9000_resource),

       .resource = smdk6410_dm9000_resource,

       .dev = {

              .platform_data  = &smdk6410_dm9000_pdata,

       },

};

 

static struct map_desc smdk6410_iodesc[] __initdata = {

       {

              .virtual    = (unsigned long)SMDK6410_VA_EXTDEV,

              .pfn        = __phys_to_pfn(SMDK6410_PA_EXTDEV),

              .length           = SZ_64K,

              .type              = MT_DEVICE,

       },

};



static struct platform_device *smdk6410_devices[] __initdata中添加

&smdk6410_device_eth,



static void __init smdk6410_machine_init(void)中添加

smdk6410_dm9000_enable();


你可能感兴趣的:(struct,NetWork,resources,transformation,statistics,networking)