diff mbox

[regdb] Add support to parse 2000mW tx power

Message ID 1401089962-10720-1-git-send-email-chaitanya.mgit@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Krishna Chaitanya May 26, 2014, 7:39 a.m. UTC
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

Comments

Johannes Berg May 26, 2014, 9:38 a.m. UTC | #1
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
Krishna Chaitanya May 26, 2014, 9:46 a.m. UTC | #2
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
Johannes Berg May 26, 2014, 9:54 a.m. UTC | #3
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
Krishna Chaitanya May 26, 2014, 10:39 a.m. UTC | #4
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
John W. Linville May 27, 2014, 3:23 p.m. UTC | #5
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 mbox

Patch

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!"