Changeset 9301


Ignore:
Timestamp:
03/12/08 14:04:09 (5 years ago)
Author:
BrainSlayer
Message:

compile fix

Location:
src/router/services/sysinit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/router/services/sysinit/switchlib/admtek.c

    r9263 r9301  
    4646#include <net/if.h> 
    4747 
     48#include <arpa/inet.h> 
     49#include <sys/socket.h> 
     50#include <linux/sockios.h> 
     51#include <linux/mii.h> 
     52 
    4853#define SIOCGMIIREG     0x8948  /* Read MII PHY register.       */ 
    4954#define SIOCSMIIREG     0x8949  /* Write MII PHY register.      */ 
     
    5459#include <cymac.h> 
    5560 
    56 #include <arpa/inet.h> 
    57 #include <sys/socket.h> 
    58 #include <linux/if.h> 
    59 #include <linux/sockios.h> 
    60 #include <linux/mii.h> 
    6161 
    6262 
  • src/router/services/sysinit/sysinit-dir300.c

    r9282 r9301  
    5555#include <shutils.h> 
    5656#include <utils.h> 
     57#include <cymac.h> 
    5758 
    5859extern void vlan_init (int num); 
     
    100101 
    101102#ifndef HAVE_DIR400 
    102   FILE *fp = fopen (getMTD ("board_config"), "rb"); 
     103  int mtd = getMTD ("board_config"); 
     104  char mtdpath[64]; 
     105  sprintf(mtdpath,"/dev/mtdblock/%d",mtd); 
     106  FILE *fp = fopen (mtdpath, "rb"); 
    103107  if (fp) 
    104108    { 
     
    106110      unsigned int test; 
    107111      fread (&test, 4, 1, fp); 
     112      fprintf(stderr,"test pattern is %X\n",test); 
    108113      if (test != 0xffffffff) 
    109114        { 
     
    196201 
    197202} 
     203 
     204void start_fixboard(void) 
     205{ 
     206  int mtd = getMTD ("board_config"); 
     207  char mtdpath[64]; 
     208  sprintf(mtdpath,"/dev/mtdblock/%d",mtd); 
     209  fprintf(stderr,"board config path = %s\n",mtdpath); 
     210  FILE *fp = fopen (mtdpath, "rb"); 
     211  if (fp) 
     212    { 
     213      fseek (fp, 0x1000, SEEK_SET); 
     214      unsigned int test; 
     215      fread (&test, 4, 1, fp); 
     216      fprintf(stderr,"test pattern is %X\n",test); 
     217      if (test != 0xffffffff) 
     218        { 
     219          fprintf (stderr, 
     220                   "radio config fixup is required to clean bad stuff out of memory, otherwise the radio config cannot be detected\n"); 
     221          fseek (fp, 0, SEEK_SET); 
     222          char *block = (char *) malloc (65536); 
     223          fread (block, 65536, 1, fp); 
     224          fclose (fp); 
     225          int i; 
     226          for (i = 0x1000; i < 65536; i++) 
     227            block[i] = 0xff; 
     228          fp = fopen ("/tmp/radio", "wb"); 
     229          fwrite (block, 65536, 1, fp); 
     230          eval ("mtd", "-f", "write", "/tmp/radio", "board_config");    //writes back new config and reboots 
     231          eval ("event", "5", "1", "15"); 
     232        } 
     233      fclose (fp); 
     234    } 
     235 
     236 
     237} 
Note: See TracChangeset for help on using the changeset viewer.