2014-05-26 07:39:36

by Krishna Chaitanya

[permalink] [raw]
Subject: [regdb] Add support to parse 2000mW tx power

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 <[email protected]>
Signed-off-by: Chaitanya T K <[email protected]>
---
net/wireless/genregdb.awk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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


2014-05-26 09:54:38

by Johannes Berg

[permalink] [raw]
Subject: Re: [regdb] Add support to parse 2000mW tx power

On Mon, 2014-05-26 at 15:16 +0530, Krishna Chaitanya wrote:
> On Mon, May 26, 2014 at 3:08 PM, Johannes Berg
> <[email protected]> wrote:
> > On Mon, 2014-05-26 at 13:09 +0530, [email protected] 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



2014-05-27 15:30:12

by John W. Linville

[permalink] [raw]
Subject: Re: [regdb] Add support to parse 2000mW tx power

On Mon, May 26, 2014 at 11:38:06AM +0200, Johannes Berg wrote:
> On Mon, 2014-05-26 at 13:09 +0530, [email protected] 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
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2014-05-26 09:38:23

by Johannes Berg

[permalink] [raw]
Subject: Re: [regdb] Add support to parse 2000mW tx power

On Mon, 2014-05-26 at 13:09 +0530, [email protected] 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


2014-05-26 10:39:40

by Krishna Chaitanya

[permalink] [raw]
Subject: Re: [regdb] Add support to parse 2000mW tx power

On Mon, May 26, 2014 at 3:24 PM, Johannes Berg
<[email protected]> wrote:
> On Mon, 2014-05-26 at 15:16 +0530, Krishna Chaitanya wrote:
>> On Mon, May 26, 2014 at 3:08 PM, Johannes Berg
>> <[email protected]> wrote:
>> > On Mon, 2014-05-26 at 13:09 +0530, [email protected] 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.

2014-05-26 09:46:50

by Krishna Chaitanya

[permalink] [raw]
Subject: Re: [regdb] Add support to parse 2000mW tx power

On Mon, May 26, 2014 at 3:08 PM, Johannes Berg
<[email protected]> wrote:
> On Mon, 2014-05-26 at 13:09 +0530, [email protected] 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.?