Changeset 9830


Ignore:
Timestamp:
07/02/08 01:04:39 (5 years ago)
Author:
BrainSlayer
Message:

formating

Location:
src/router/shared
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/router/shared/utils.c

    r9828 r9830  
    10561056      return ROUTER_USR_5461; 
    10571057    } 
    1058      
     1058 
    10591059  if (boardnum == 10500 && nvram_match ("boardtype", "0x456")) 
    10601060    { 
     
    10631063      return ROUTER_USR_5461;   //should work in the same way 
    10641064    } 
    1065      
     1065 
    10661066  if (boardnum == 10506 && nvram_match ("boardtype", "0x456")) 
    10671067    { 
     
    19181918 
    19191919 
    1920 int isListed(char *listname, char *value) 
    1921 { 
    1922 char *next, word[32]; 
    1923 char *list = nvram_get(listname); 
    1924 if (!list) 
     1920int 
     1921isListed (char *listname, char *value) 
     1922{ 
     1923  char *next, word[32]; 
     1924  char *list = nvram_get (listname); 
     1925  if (!list) 
    19251926    return 0; 
    19261927  foreach (word, list, next) 
    19271928  { 
    1928   if (!strcmp(word,value)) 
    1929     return 1; 
     1929    if (!strcmp (word, value)) 
     1930      return 1; 
    19301931  } 
    1931 return 0; 
    1932 } 
    1933  
    1934 void addList(char *listname, char *value) 
    1935 { 
    1936 int listlen=0; 
    1937 if (isListed(listname,value)) 
     1932  return 0; 
     1933} 
     1934 
     1935void 
     1936addList (char *listname, char *value) 
     1937{ 
     1938  int listlen = 0; 
     1939  if (isListed (listname, value)) 
    19381940    return; 
    1939 char *list = nvram_get(listname); 
    1940 char *newlist; 
    1941 if (list) 
    1942     listlen=strlen(list); 
    1943 newlist = malloc(strlen(value+2)+listlen); 
    1944 if (list) 
    1945 sprintf(newlist,"%s %s",list,value);     
    1946 else 
    1947 sprintf(newlist,"%s",value);     
    1948 nvram_set(listname,newlist); 
    1949 free(newlist); 
     1941  char *list = nvram_get (listname); 
     1942  char *newlist; 
     1943  if (list) 
     1944    listlen = strlen (list); 
     1945  newlist = malloc (strlen (value + 2) + listlen); 
     1946  if (list) 
     1947    sprintf (newlist, "%s %s", list, value); 
     1948  else 
     1949    sprintf (newlist, "%s", value); 
     1950  nvram_set (listname, newlist); 
     1951  free (newlist); 
    19501952} 
    19511953 
  • src/router/shared/utils.h

    r9828 r9830  
    602602int endswith (char *str, char *cmp); 
    603603 
    604 int isListed(char *listname, char *value); 
    605 void addList(char *listname, char *value); 
     604int isListed (char *listname, char *value); 
     605void addList (char *listname, char *value); 
    606606 
    607607#endif 
  • src/router/shared/wl.c

    r9828 r9830  
    6363 
    6464int 
    65 wl_getbssid(char *wl, char *mac) 
    66 { 
    67         int ret; 
    68         struct ether_addr ea; 
    69         wl_ioctl(wl,WLC_GET_BSSID,&ea,ETHER_ADDR_LEN); 
    70         ether_etoa(&ea,mac); 
     65wl_getbssid (char *wl, char *mac) 
     66{ 
     67  int ret; 
     68  struct ether_addr ea; 
     69  wl_ioctl (wl, WLC_GET_BSSID, &ea, ETHER_ADDR_LEN); 
     70  ether_etoa (&ea, mac); 
    7171} 
    7272 
     
    10921092  if (!ifexists (name)) 
    10931093    return -1; 
    1094   if (wl_probe(name)) 
     1094  if (wl_probe (name)) 
    10951095    return -1; 
    10961096  ret = wl_ioctl (name, WLC_GET_INSTANCE, &unit, sizeof (unit)); 
     
    11271127{ 
    11281128  int ret, val; 
    1129   if (isListed("probe_blacklist",name)) 
     1129  if (isListed ("probe_blacklist", name)) 
    11301130    return -1; 
    11311131 
     
    11341134  if ((ret = wl_get_dev_type (name, buf, DEV_TYPE_LEN)) < 0) 
    11351135    { 
    1136     addList("probe_blacklist",name); 
    1137     return ret; 
     1136      addList ("probe_blacklist", name); 
     1137      return ret; 
    11381138    } 
    11391139  /* Check interface */ 
    11401140  if (strncmp (buf, "wl", 2)) 
    11411141    { 
    1142     addList("probe_blacklist",name); 
    1143     return -1; 
     1142      addList ("probe_blacklist", name); 
     1143      return -1; 
    11441144    } 
    11451145#else 
     
    11471147  if ((ret = wl_ioctl (name, WLC_GET_MAGIC, &val, sizeof (val)))) 
    11481148    { 
    1149     addList("probe_blacklist",name); 
    1150     return ret; 
     1149      addList ("probe_blacklist", name); 
     1150      return ret; 
    11511151    } 
    11521152#endif 
    11531153  if ((ret = wl_ioctl (name, WLC_GET_VERSION, &val, sizeof (val)))) 
    11541154    { 
    1155     addList("probe_blacklist",name); 
    1156     return ret; 
     1155      addList ("probe_blacklist", name); 
     1156      return ret; 
    11571157    } 
    11581158  if (val > WLC_IOCTL_VERSION) 
    11591159    { 
    1160     addList("probe_blacklist",name); 
    1161     return -1; 
     1160      addList ("probe_blacklist", name); 
     1161      return -1; 
    11621162    } 
    11631163  return ret; 
  • src/router/shared/wlutils.h

    r9819 r9830  
    144144                               int val); 
    145145 
    146 int wl_getbssid(char *wl, char *mac); 
     146int wl_getbssid (char *wl, char *mac); 
    147147 
    148148#endif /* _wlutils_h_ */ 
Note: See TracChangeset for help on using the changeset viewer.