Ignore:
Timestamp:
02/27/08 02:27:17 (5 years ago)
Author:
BrainSlayer
Message:

t-home/t-online vdsl support for gigabit routers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/router/services/sysinit/sysinit-gateworx.c

    r9114 r9124  
    9797  if (res == 1) 
    9898    { 
    99       in = popen ("/bin/cat /dev/mtdblock/0|/bin/grep \"2\\.03\"|wc -l", "rb"); 
     99      in = 
     100        popen ("/bin/cat /dev/mtdblock/0|/bin/grep \"2\\.03\"|wc -l", "rb"); 
    100101      fscanf (in, "%d", &res2); 
    101102      pclose (in); 
     
    196197#ifndef HAVE_TONZE 
    197198#ifndef HAVE_NOP8670 
    198  checkupdate (); 
     199  checkupdate (); 
    199200#endif 
    200201#endif 
     
    272273  FILE *file = fopen (filename, "r"); 
    273274  if (file) 
    274   { 
    275   unsigned char buf[16]; 
    276   fseek(file,0x422,SEEK_SET); 
    277   fread (&buf[0], 6, 1, file); 
    278   char mac[16]; 
    279   sprintf (mac, "%02x:%02x:%02x:%02x:%02x:%02x", buf[0], buf[1], buf[2], 
    280            buf[3], buf[4], buf[5]); 
    281   eval ("ifconfig", "ixp0", "hw", "ether", mac); 
    282   fseek(file,0x43b,SEEK_SET); 
    283   fread (&buf[6], 6, 1, file); 
    284   sprintf (mac, "%02x:%02x:%02x:%02x:%02x:%02x", buf[6], buf[7], buf[8], 
    285            buf[9], buf[10], buf[11]); 
    286   eval ("ifconfig", "ixp1", "hw", "ether", mac); 
    287   fclose (file); 
    288   } 
     275    { 
     276      unsigned char buf[16]; 
     277      fseek (file, 0x422, SEEK_SET); 
     278      fread (&buf[0], 6, 1, file); 
     279      char mac[16]; 
     280      sprintf (mac, "%02x:%02x:%02x:%02x:%02x:%02x", buf[0], buf[1], buf[2], 
     281               buf[3], buf[4], buf[5]); 
     282      eval ("ifconfig", "ixp0", "hw", "ether", mac); 
     283      fseek (file, 0x43b, SEEK_SET); 
     284      fread (&buf[6], 6, 1, file); 
     285      sprintf (mac, "%02x:%02x:%02x:%02x:%02x:%02x", buf[6], buf[7], buf[8], 
     286               buf[9], buf[10], buf[11]); 
     287      eval ("ifconfig", "ixp1", "hw", "ether", mac); 
     288      fclose (file); 
     289    } 
    289290#else 
    290291  char *filename = "/sys/devices/platform/IXP4XX-I2C.0/i2c-adapter:i2c-0/0-0051/eeprom";        /* bank2=0x100 */ 
    291292  FILE *file = fopen (filename, "r"); 
    292293  if (file) 
    293   { 
    294   unsigned char buf[16]; 
    295   fread (&buf[0], 16, 1, file); 
    296   char mac[16]; 
    297   sprintf (mac, "%02x:%02x:%02x:%02x:%02x:%02x", buf[0], buf[1], buf[2], 
    298            buf[3], buf[4], buf[5]); 
    299   eval ("ifconfig", "ixp0", "hw", "ether", mac); 
    300   sprintf (mac, "%02x:%02x:%02x:%02x:%02x:%02x", buf[6], buf[7], buf[8], 
    301            buf[9], buf[10], buf[11]); 
    302   eval ("ifconfig", "ixp1", "hw", "ether", mac); 
    303  
    304  
    305   fclose (file); 
    306   } 
     294    { 
     295      unsigned char buf[16]; 
     296      fread (&buf[0], 16, 1, file); 
     297      char mac[16]; 
     298      sprintf (mac, "%02x:%02x:%02x:%02x:%02x:%02x", buf[0], buf[1], buf[2], 
     299               buf[3], buf[4], buf[5]); 
     300      eval ("ifconfig", "ixp0", "hw", "ether", mac); 
     301      sprintf (mac, "%02x:%02x:%02x:%02x:%02x:%02x", buf[6], buf[7], buf[8], 
     302               buf[9], buf[10], buf[11]); 
     303      eval ("ifconfig", "ixp1", "hw", "ether", mac); 
     304 
     305 
     306      fclose (file); 
     307    } 
    307308 
    308309 
     
    357358{ 
    358359} 
    359 void enable_dtag_vlan(int enable) 
    360 { 
    361  
    362 } 
     360void 
     361enable_dtag_vlan (int enable) 
     362{ 
     363 
     364} 
Note: See TracChangeset for help on using the changeset viewer.