Changeset 13603


Ignore:
Timestamp:
01/12/10 23:14:13 (3 years ago)
Author:
BrainSlayer
Message:

reset channel after sitesurvey!

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

Legend:

Unmodified
Added
Removed
  • src/router/services/tools/site_survey_madwifi.c

    r13227 r13603  
    203203        eval("iwlist", sta, "scan"); 
    204204        len = do80211priv(sta, IEEE80211_IOCTL_SCAN_RESULTS, buf, 24 * 1024); 
     205        char channel[16]; 
     206        char wl[16]; 
     207        sprintf(channel, "ath%s_channel", sta); 
     208        sprintf(wl, "ath%s_mode", sta); 
     209        char *apm = nvram_default_get(wl, "ap"); 
     210        if (strcmp(apm, "sta") && strcmp(apm, "wdssta") && strcmp(apm, "wet")) { 
     211                cprintf("set channel\n"); 
     212                char *ch = nvram_default_get(channel, "0"); 
     213 
     214                if (strcmp(ch, "0") == 0) { 
     215                        sysprintf("iwconfig %s channel 0", sta); 
     216                } else { 
     217                        sysprintf("iwconfig %s freq %sM", sta, ch); 
     218                } 
     219        } 
    205220 
    206221        if (len == -1) { 
  • src/router/services/tools/site_survey_madwifi_11n.c

    r13227 r13603  
    196196        len = do80211priv(sta, IEEE80211_IOCTL_SCAN_RESULTS, buf, 24 * 1024); 
    197197 
     198        char channel[16]; 
     199        char wl[16]; 
     200        sprintf(channel, "ath%s_channel", sta); 
     201        sprintf(wl, "ath%s_mode", sta); 
     202        char *apm = nvram_default_get(wl, "ap"); 
     203        if (strcmp(apm, "sta") && strcmp(apm, "wdssta") && strcmp(apm, "wet")) { 
     204                cprintf("set channel\n"); 
     205                char *ch = nvram_default_get(channel, "0"); 
     206 
     207                if (strcmp(ch, "0") == 0) { 
     208                        sysprintf("iwconfig %s channel 0", sta); 
     209                } else { 
     210                        sysprintf("iwconfig %s freq %sM", sta, ch); 
     211                } 
     212        } 
     213 
    198214        if (len == -1) { 
    199215                fprintf(stderr, "unable to get scan results"); 
Note: See TracChangeset for help on using the changeset viewer.