Changeset 9124 for src/router/services/sysinit/sysinit-gateworx.c
- Timestamp:
- 02/27/08 02:27:17 (5 years ago)
- File:
-
- 1 edited
-
src/router/services/sysinit/sysinit-gateworx.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/services/sysinit/sysinit-gateworx.c
r9114 r9124 97 97 if (res == 1) 98 98 { 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"); 100 101 fscanf (in, "%d", &res2); 101 102 pclose (in); … … 196 197 #ifndef HAVE_TONZE 197 198 #ifndef HAVE_NOP8670 198 checkupdate ();199 checkupdate (); 199 200 #endif 200 201 #endif … … 272 273 FILE *file = fopen (filename, "r"); 273 274 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 } 289 290 #else 290 291 char *filename = "/sys/devices/platform/IXP4XX-I2C.0/i2c-adapter:i2c-0/0-0051/eeprom"; /* bank2=0x100 */ 291 292 FILE *file = fopen (filename, "r"); 292 293 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 } 307 308 308 309 … … 357 358 { 358 359 } 359 void enable_dtag_vlan(int enable) 360 { 361 362 } 360 void 361 enable_dtag_vlan (int enable) 362 { 363 364 }
Note: See TracChangeset
for help on using the changeset viewer.
