Message ID | 1401089962-10720-1-git-send-email-chaitanya.mgit@gmail.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Mon, 2014-05-26 at 13:09 +0530, chaitanya.mgit@gmail.com wrote: > @@ -74,7 +74,7 @@ function parse_reg_rule() > power = 23 > } else if (power == 500) { > power = 27 > - } else if (power == 1000) { > + } else if ((power == 1000) || (power == 2000)) { > power = 30 This seems like a pretty sick thing to do to start with, and certainly power=30 isn't right for 2000mW... Can't awk calculate the logarithm? johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, May 26, 2014 at 3:08 PM, Johannes Berg <johannes@sipsolutions.net> wrote: > On Mon, 2014-05-26 at 13:09 +0530, chaitanya.mgit@gmail.com wrote: > >> @@ -74,7 +74,7 @@ function parse_reg_rule() >> power = 23 >> } else if (power == 500) { >> power = 27 >> - } else if (power == 1000) { >> + } else if ((power == 1000) || (power == 2000)) { >> power = 30 > > This seems like a pretty sick thing to do to start with, and certainly Agree. > power=30 isn't right for 2000mW... Sorry, typo. Its supposed to be 33. > Can't awk calculate the logarithm? Does kernel support log arithmetic/Float operations.? -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, 2014-05-26 at 15:16 +0530, Krishna Chaitanya wrote: > On Mon, May 26, 2014 at 3:08 PM, Johannes Berg > <johannes@sipsolutions.net> wrote: > > On Mon, 2014-05-26 at 13:09 +0530, chaitanya.mgit@gmail.com wrote: > > > >> @@ -74,7 +74,7 @@ function parse_reg_rule() > >> power = 23 > >> } else if (power == 500) { > >> power = 27 > >> - } else if (power == 1000) { > >> + } else if ((power == 1000) || (power == 2000)) { > >> power = 30 > > > > This seems like a pretty sick thing to do to start with, and certainly > > Agree. > > > power=30 isn't right for 2000mW... > > Sorry, typo. Its supposed to be 33. > > > Can't awk calculate the logarithm? > Does kernel support log arithmetic/Float operations.? This script runs at build time. johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, May 26, 2014 at 3:24 PM, Johannes Berg <johannes@sipsolutions.net> wrote: > On Mon, 2014-05-26 at 15:16 +0530, Krishna Chaitanya wrote: >> On Mon, May 26, 2014 at 3:08 PM, Johannes Berg >> <johannes@sipsolutions.net> wrote: >> > On Mon, 2014-05-26 at 13:09 +0530, chaitanya.mgit@gmail.com wrote: >> > >> >> @@ -74,7 +74,7 @@ function parse_reg_rule() >> >> power = 23 >> >> } else if (power == 500) { >> >> power = 27 >> >> - } else if (power == 1000) { >> >> + } else if ((power == 1000) || (power == 2000)) { >> >> power = 30 >> > >> > This seems like a pretty sick thing to do to start with, and certainly >> >> Agree. >> >> > power=30 isn't right for 2000mW... >> >> Sorry, typo. Its supposed to be 33. >> >> > Can't awk calculate the logarithm? >> Does kernel support log arithmetic/Float operations.? > > This script runs at build time. Ok, understood. I will send in V2 with the algo after some testing. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, May 26, 2014 at 11:38:06AM +0200, Johannes Berg wrote: > On Mon, 2014-05-26 at 13:09 +0530, chaitanya.mgit@gmail.com wrote: > > > @@ -74,7 +74,7 @@ function parse_reg_rule() > > power = 23 > > } else if (power == 500) { > > power = 27 > > - } else if (power == 1000) { > > + } else if ((power == 1000) || (power == 2000)) { > > power = 30 > > This seems like a pretty sick thing to do to start with, and certainly > power=30 isn't right for 2000mW... Heh...it was like that in my original version! > Can't awk calculate the logarithm? I probably didn't know how to compute it in awk. I still don't OTOH... John
diff --git a/net/wireless/genregdb.awk b/net/wireless/genregdb.awk index 4119833..0f2b53a 100644 --- a/net/wireless/genregdb.awk +++ b/net/wireless/genregdb.awk @@ -74,7 +74,7 @@ function parse_reg_rule() power = 23 } else if (power == 500) { power = 27 - } else if (power == 1000) { + } else if ((power == 1000) || (power == 2000)) { power = 30 } else { print "Unknown power value in database!"
CC [M] net/wireless/wext-sme.o CC [M] net/wireless/regdb.o net/wireless/regdb.c:1130:1: error: Unknown undeclared here (not in a function) net/wireless/regdb.c:1130:9: error: expected } before power make[2]: *** [net/wireless/regdb.o] Error 1 make[1]: *** [net/wireless] Error 2 make: *** [net] Error 2 Reported-By: John Walker <john@x109.net> Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com> --- net/wireless/genregdb.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html