Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

Commit

Permalink
Fix nvram corruption introduced in GPL 1779 that would lead to wl1_nb…
Browse files Browse the repository at this point in the history
…and to contain an invalid value, causing all sort of weird 5GHz-related issues
  • Loading branch information
RMerl committed Jul 29, 2014
1 parent 52b7ec4 commit a53b967
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions release/src/router/rc/sysdeps/init-broadcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -3792,7 +3792,7 @@ void generate_wl_para(int unit, int subunit)
nvram_set(strcat_r(prefix, "nreqd", tmp), "1");
#endif
nvram_set(strcat_r(prefix, "vreqd", tmp), "0");
nvram_set(strcat_r(prefix, "gmode", tmp), nvram_match(strcat_r(prefix, "nband", tmp), "2") ? "1" : "-1");
nvram_set(strcat_r(prefix, "gmode", tmp), nvram_match(strcat_r(prefix, "nband", tmp2), "2") ? "1" : "-1");
nvram_set(strcat_r(prefix, "rate", tmp), "0");
#ifdef RTCONFIG_BCMWL6
nvram_set(strcat_r(prefix, "bss_opmode_cap_reqd", tmp), "2"); // devices must advertise HT (11n) capabilities to be allowed to associate
Expand All @@ -3806,7 +3806,7 @@ void generate_wl_para(int unit, int subunit)
nvram_set(strcat_r(prefix, "nreqd", tmp), "0");
#endif
nvram_set(strcat_r(prefix, "vreqd", tmp), "0");
nvram_set(strcat_r(prefix, "gmode", tmp), nvram_match(strcat_r(prefix, "nband", tmp), "2") ? "1" : "-1");
nvram_set(strcat_r(prefix, "gmode", tmp), nvram_match(strcat_r(prefix, "nband", tmp2), "2") ? "1" : "-1");
nvram_set(strcat_r(prefix, "rate", tmp), "0");
#ifdef RTCONFIG_BCMWL6
if (nvram_match(strcat_r(prefix, "nband", tmp), "2"))
Expand All @@ -3823,7 +3823,7 @@ void generate_wl_para(int unit, int subunit)
nvram_set(strcat_r(prefix, "nreqd", tmp), "0");
#endif
nvram_set(strcat_r(prefix, "vreqd", tmp), "0");
nvram_set(strcat_r(prefix, "gmode", tmp), nvram_match(strcat_r(prefix, "nband", tmp), "2") ? "2" : "-1");
nvram_set(strcat_r(prefix, "gmode", tmp), nvram_match(strcat_r(prefix, "nband", tmp2), "2") ? "2" : "-1");
nvram_set(strcat_r(prefix, "rate", tmp), "0");
#ifdef RTCONFIG_BCMWL6
nvram_set(strcat_r(prefix, "bss_opmode_cap_reqd", tmp), "1"); // devices must advertise ERP (11g) capabilities to be allowed to associate
Expand All @@ -3837,7 +3837,7 @@ void generate_wl_para(int unit, int subunit)
nvram_set(strcat_r(prefix, "nreqd", tmp), "0");
#endif
nvram_set(strcat_r(prefix, "vreqd", tmp), "0");
nvram_set(strcat_r(prefix, "gmode", tmp), nvram_match(strcat_r(prefix, "nband", tmp), "2") ? "0" : "-1");
nvram_set(strcat_r(prefix, "gmode", tmp), nvram_match(strcat_r(prefix, "nband", tmp2), "2") ? "0" : "-1");
nvram_set(strcat_r(prefix, "rate", tmp), "0");
#ifdef RTCONFIG_BCMWL6
nvram_set(strcat_r(prefix, "bss_opmode_cap_reqd", tmp), "0"); // no requirements on joining devices
Expand Down Expand Up @@ -3869,7 +3869,7 @@ void generate_wl_para(int unit, int subunit)
nvram_set(strcat_r(prefix, "nreqd", tmp), "0");
#endif
nvram_set(strcat_r(prefix, "vreqd", tmp), "0");
nvram_set(strcat_r(prefix, "gmode", tmp), nvram_match(strcat_r(prefix, "nband", tmp), "2") ? "1" : "-1");
nvram_set(strcat_r(prefix, "gmode", tmp), nvram_match(strcat_r(prefix, "nband", tmp2), "2") ? "1" : "-1");
nvram_set(strcat_r(prefix, "rate", tmp), "0");
#ifdef RTCONFIG_BCMWL6
nvram_set(strcat_r(prefix, "bss_opmode_cap_reqd", tmp), "0"); // no requirements on joining devices
Expand Down Expand Up @@ -4018,7 +4018,7 @@ void generate_wl_para(int unit, int subunit)
nvram_set_int(strcat_r(prefix, "wmf_igmpq_filter", tmp), /*i ? 1 :*/ 0);
#endif
#endif
nvram_set_int(strcat_r(prefix, "acs_fcs_mode", tmp), i && nvram_match(strcat_r(prefix, "nband", tmp), "1") ? 1 : 0);
nvram_set_int(strcat_r(prefix, "acs_fcs_mode", tmp), i && nvram_match(strcat_r(prefix, "nband", tmp2), "1") ? 1 : 0);
nvram_set_int(strcat_r(prefix, "dcs_csa_unicast", tmp), i ? 1 : 0);
#endif
#else
Expand Down

0 comments on commit a53b967

Please sign in to comment.