Changeset 18915


Ignore:
Timestamp:
04/04/12 15:39:59 (14 months ago)
Author:
BrainSlayer
Message:

disallow ht40 selection if country or regulatory setting does not support these modes

Location:
src/router
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/router/httpd/visuals/dd-wrt.c

    r18888 r18915  
    41764176#if defined(HAVE_MADWIFI_MIMO) || defined(HAVE_ATH9K) 
    41774177        if (is_ath11n(prefix)) { 
     4178         
     4179#if defined(HAVE_ATH9K) 
     4180                if (has_ht40(prefix)) 
     4181#endif 
    41784182                if ((nvram_nmatch("n-only", "%s_net_mode", prefix) 
    41794183                     || nvram_nmatch("ng-only", "%s_net_mode", prefix) 
     
    41974201                    || nvram_nmatch("na-only", "%s_net_mode", prefix)))) 
    41984202#endif 
     4203{ 
     4204#if defined(HAVE_ATH9K) 
     4205                if (has_ht40(prefix)) 
     4206#endif 
    41994207                websWrite(wp, 
    42004208                          "document.write(\"<option value=\\\"40\\\" %s >\" + share.turbo + \"</option>\");\n", 
    42014209                          nvram_match(wl_width, 
    42024210                                      "40") ? "selected=\\\"selected\\\"" : ""); 
     4211} 
    42034212        websWrite(wp, 
    42044213                  "document.write(\"<option value=\\\"20\\\" %s >\" + share.full + \"</option>\");\n", 
    42054214                  nvram_match(wl_width, 
    42064215                              "20") ? "selected=\\\"selected\\\"" : ""); 
    4207 #ifdef HAVE_ATH9K 
    4208 } 
    4209 #endif 
    4210 #ifdef HAVE_ATH9K 
    4211 if (is_ath9k(prefix)) 
    4212 #endif 
    4213     { 
     4216 
     4217#if defined(HAVE_MADWIFI_MIMO) || defined(HAVE_ATH9K) 
     4218} 
     4219#endif 
     4220#if defined(HAVE_MADWIFI) || defined(HAVE_ATH9K) && !defined(HAVE_MADIFI_MIMO) 
     4221{ 
    42144222websWrite(wp, 
    42154223          "document.write(\"<option value=\\\"10\\\" %s >\" + share.half + \"</option>\");\n", 
     
    42274235#endif 
    42284236} 
     4237#endif 
    42294238websWrite(wp, "//]]>\n</script>\n"); 
    42304239websWrite(wp, "</select>\n"); 
     
    48234832#if defined(HAVE_MADWIFI_MIMO) || defined(HAVE_ATH9K) 
    48244833/* limit channel options by mode */ 
     4834#if defined(HAVE_ATH9K) 
     4835                if (has_ht40(prefix)) 
     4836#endif 
    48254837        if (is_ath11n(prefix)) { 
    48264838                if ((nvram_nmatch("n-only", "%s_net_mode", prefix) 
     
    48444856                    || nvram_nmatch("na-only", "%s_net_mode", prefix)))) 
    48454857#endif 
     4858{ 
     4859#if defined(HAVE_ATH9K) 
     4860                if (has_ht40(prefix)) 
     4861#endif 
    48464862                websWrite(wp, 
    48474863                          "document.write(\"<option value=\\\"40\\\" %s >\" + share.turbo + \"</option>\");\n", 
    48484864                          nvram_match(wl_width, 
    48494865                                      "40") ? "selected=\\\"selected\\\"" : ""); 
     4866} 
    48504867        websWrite(wp, 
    48514868                  "document.write(\"<option value=\\\"20\\\" %s >\" + share.full + \"</option>\");\n", 
    48524869                  nvram_match(wl_width, 
    48534870                              "20") ? "selected=\\\"selected\\\"" : ""); 
    4854 #ifdef HAVE_ATH9K 
    4855 if (is_ath9k(prefix)) 
    4856 #endif 
     4871 
     4872#if defined(HAVE_MADWIFI) || defined(HAVE_ATH9K) && !defined(HAVE_MADIFI_MIMO) 
    48574873    { 
    48584874        websWrite(wp, 
     
    48644880                  nvram_match(wl_width, 
    48654881                              "5") ? "selected=\\\"selected\\\"" : ""); 
    4866     } 
    48674882#ifdef HAVE_SUBQUARTER 
    48684883        if(registered_has_subquarter()) { 
     
    48734888                              "2") ? "selected=\\\"selected\\\"" : ""); 
    48744889        } 
     4890#endif 
     4891    } 
    48754892#endif 
    48764893        websWrite(wp, "//]]>\n</script>\n"); 
  • src/router/httpd/visuals/setupassistant.c

    r17673 r18915  
    710710                     || nvram_selnmatch(wp, "n5-only", "%s_net_mode", prefix) 
    711711                     || nvram_selnmatch(wp, "na-only", "%s_net_mode", prefix))) 
     712                    { 
     713#if defined(HAVE_ATH9K) 
     714                if (has_ht40(prefix)) 
     715#endif 
    712716                        websWrite(wp, 
    713717                                  "document.write(\"<option value=\\\"2040\\\" %s >\" + share.dynamicturbo + \"</option>\");\n", 
     
    715719                                                 "2040") ? 
    716720                                  "selected=\\\"selected\\\"" : ""); 
     721                    } 
    717722        } 
    718723        if (!is_ath11n(prefix) 
     
    724729                    || nvram_selnmatch(wp, "na-only", "%s_net_mode", prefix)))) 
    725730#endif 
     731{ 
     732#if defined(HAVE_ATH9K) 
     733                if (has_ht40(prefix)) 
     734#endif 
    726735                websWrite(wp, 
    727736                          "document.write(\"<option value=\\\"40\\\" %s >\" + share.turbo + \"</option>\");\n", 
     
    729738                                         "40") ? "selected=\\\"selected\\\"" : 
    730739                          ""); 
     740} 
    731741        websWrite(wp, 
    732742                  "document.write(\"<option value=\\\"20\\\" %s >\" + share.full + \"</option>\");\n", 
    733743                  nvram_selmatch(wp, wl_width, 
    734744                                 "20") ? "selected=\\\"selected\\\"" : ""); 
    735 #ifdef HAVE_ATH9K 
    736         if (!is_ath9k(prefix)) 
    737 #endif 
     745#if defined(HAVE_MADWIFI) || defined(HAVE_ATH9K) && !defined(HAVE_MADIFI_MIMO) 
    738746        { 
    739747                websWrite(wp, 
     
    756764#endif 
    757765        } 
     766#endif 
    758767        websWrite(wp, "//]]>\n</script>\n"); 
    759768        websWrite(wp, "</select>\n"); 
  • src/router/libutils/mac80211info.c

    r18914 r18915  
    649649} 
    650650 
     651 
     652int has_ht40(char *interface) { 
     653                struct wifi_channels *chan; 
     654                int found=0; 
     655                int i=0; 
     656                char regdomain[32]; 
     657                char *country; 
     658 
     659                sprintf(regdomain, "%s_regdomain", interface); 
     660                country = nvram_default_get(regdomain, "UNITED_STATES"); 
     661 
     662                chan = mac80211_get_channels(interface, getIsoName(country), 40, 0xff); 
     663                if (chan != NULL) 
     664                        while (chan[i].freq != -1) { 
     665                                if (chan[i].ht40plus || chan[i].ht40minus) { 
     666                                        free(chan); 
     667                                        return 1; 
     668                                } 
     669                        i++; 
     670                        } 
     671                if (chan != NULL) 
     672                        free(chan); 
     673                return 0; 
     674} 
     675 
     676 
    651677int mac80211_check_valid_frequency(char *interface, char *country, int freq) { 
    652678                struct wifi_channels *chan; 
  • src/router/shared/wlutils.h

    r18905 r18915  
    9696extern int has_2ghz(char *prefix); 
    9797extern int has_5ghz(char *prefix); 
     98extern int has_ht40(char *prefix); 
    9899 
    99100#define SITE_SURVEY_DB  "/tmp/site_survey" 
Note: See TracChangeset for help on using the changeset viewer.