2011-12-20 20:24:07

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 0/3] cfg80211: reliense the rest of regulatory to ISC

From: Luis R. Rodriguez <[email protected]>

I'm working on a regulatory revamp of the kernel's regulatory code. In
this pursuit I've started working on code loosely based on what I had
originally written but starting in userspace [1] to help easily
simulate, and test new designs, and run the code through some test
cases. Additionally given some recent interest and a lot of
development from the FreeBSD in wireless *and* me getting tired of
dealing with crap proprietary code in this area I'm inclined to help
try to unify architecture design and code between other OSes as much
as possible. I may even be able to convince a few folks to consider
using this code for usage in some other OSes as well but my focus for
now is at least Linux and seeing if FreeBSD might be interest in
collaboration.

I have obtained ACKs from all the contributors except two entities who
have died, but made single minor contributions. These patches deal with
those few minor contributions and relicense the remaining regulatory
code on cfg80211 to ISC.

[0] git://github.com/mcgrof/regsim.git

Luis R. Rodriguez (3):
cfg80211: replace reg.c Nokia commit c4c32294
cfg80211: replace reg.c Nokia commit 269ac5
cfg80211: relicense reg.c reg.h and genregdb.awk to ISC

net/wireless/genregdb.awk | 13 ++++++++++---
net/wireless/reg.c | 35 ++++++++++++++++++++++-------------
net/wireless/reg.h | 15 +++++++++++++++
net/wireless/regdb.h | 16 ++++++++++++++++
4 files changed, 63 insertions(+), 16 deletions(-)

--
1.7.4.15.g7811d



2011-12-20 20:23:53

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 1/3] cfg80211: replace reg.c Nokia commit c4c32294

From: Luis R. Rodriguez <[email protected]>

Nokia hasn't gotten back to me in over 1 month for a relicense
change request. There are only a few changes that they contributed,
so just reverting their changes but replacing with another set.
This change replaces this commit:

commit c4c322941ce0d7e2b7b8794ad70683123d9cb26a
Author: Yuri Ershov <[email protected]>
Date: Tue Jun 29 15:08:08 2010 +0400

cfg80211: Update of regulatory request initiator handling

In some cases there could be possible dereferencing freed pointer. The
update is intended to avoid this issue.

Signed-off-by: Yuri Ershov <[email protected]>
Signed-off-by: John W. Linville <[email protected]>

Cc: Petri Karhula <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
net/wireless/reg.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index c45c8b7..a7d252e 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1480,18 +1480,18 @@ new_request:
}

/* This processes *all* regulatory hints */
-static void reg_process_hint(struct regulatory_request *reg_request)
+static void reg_process_hint(struct regulatory_request *reg_request,
+ enum nl80211_reg_initiator reg_initiator)
{
int r = 0;
struct wiphy *wiphy = NULL;
- enum nl80211_reg_initiator initiator = reg_request->initiator;

BUG_ON(!reg_request->alpha2);

if (wiphy_idx_valid(reg_request->wiphy_idx))
wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx);

- if (reg_request->initiator == NL80211_REGDOM_SET_BY_DRIVER &&
+ if (reg_initiator == NL80211_REGDOM_SET_BY_DRIVER &&
!wiphy) {
kfree(reg_request);
return;
@@ -1501,7 +1501,7 @@ static void reg_process_hint(struct regulatory_request *reg_request)
/* This is required so that the orig_* parameters are saved */
if (r == -EALREADY && wiphy &&
wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) {
- wiphy_update_regulatory(wiphy, initiator);
+ wiphy_update_regulatory(wiphy, reg_initiator);
return;
}

@@ -1510,7 +1510,7 @@ static void reg_process_hint(struct regulatory_request *reg_request)
* source of bogus requests.
*/
if (r != -EALREADY &&
- reg_request->initiator == NL80211_REGDOM_SET_BY_USER)
+ reg_initiator == NL80211_REGDOM_SET_BY_USER)
schedule_delayed_work(&reg_timeout, msecs_to_jiffies(3142));
}

@@ -1547,7 +1547,7 @@ static void reg_process_pending_hints(void)

spin_unlock(&reg_requests_lock);

- reg_process_hint(reg_request);
+ reg_process_hint(reg_request, reg_request->initiator);

out:
mutex_unlock(&reg_mutex);
--
1.7.4.15.g7811d


2011-12-20 20:24:08

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 2/3] cfg80211: replace reg.c Nokia commit 269ac5

From: Luis R. Rodriguez <[email protected]>

Nokia hasn't gotten back to me in over 1 month for a relicense
change request. There are only a few changes that they contributed,
so just reverting their changes but replacing with another set.
This change replaces this commit:

commit 269ac5fd2d75b118d76a2291e28796527db2f3f8
Author: Kalle Valo <[email protected]>
Date: Tue Dec 1 10:47:15 2009 +0200

cfg80211: indent regulatory messages with spaces

The regulatory messages in syslog look weird:

kernel: cfg80211: Regulatory domain: US
kernel: ^I(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
kernel: ^I(2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
kernel: ^I(5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
kernel: ^I(5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
kernel: ^I(5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
kernel: ^I(5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
kernel: ^I(5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)

Indent them with four spaces instead of the tab character to get prettier
output.

Signed-off-by: Kalle Valo <[email protected]>
Acked: Luis R. Rodriguez <[email protected]>
Signed-off-by: John W. Linville <[email protected]>

Cc: Petri Karhula <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
net/wireless/reg.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index a7d252e..c0e0e42 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1987,7 +1987,7 @@ static void print_rd_rules(const struct ieee80211_regdomain *rd)
const struct ieee80211_freq_range *freq_range = NULL;
const struct ieee80211_power_rule *power_rule = NULL;

- pr_info(" (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)\n");
+ pr_info(" (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)\n");

for (i = 0; i < rd->n_reg_rules; i++) {
reg_rule = &rd->reg_rules[i];
@@ -1999,14 +1999,14 @@ static void print_rd_rules(const struct ieee80211_regdomain *rd)
* in certain regions
*/
if (power_rule->max_antenna_gain)
- pr_info(" (%d KHz - %d KHz @ %d KHz), (%d mBi, %d mBm)\n",
+ pr_info(" (%d KHz - %d KHz @ %d KHz), (%d mBi, %d mBm)\n",
freq_range->start_freq_khz,
freq_range->end_freq_khz,
freq_range->max_bandwidth_khz,
power_rule->max_antenna_gain,
power_rule->max_eirp);
else
- pr_info(" (%d KHz - %d KHz @ %d KHz), (N/A, %d mBm)\n",
+ pr_info(" (%d KHz - %d KHz @ %d KHz), (N/A, %d mBm)\n",
freq_range->start_freq_khz,
freq_range->end_freq_khz,
freq_range->max_bandwidth_khz,
--
1.7.4.15.g7811d


2011-12-20 20:25:25

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 3/3] cfg80211: relicense reg.c reg.h and genregdb.awk to ISC

From: Luis R. Rodriguez <[email protected]>

Following the tradition we have had with ath5k, ath9k, CRDA,
wireless-regdb I'd like to license this code under the permissive ISC
license for the code sharing purposes with other OSes, it'd sure be nice
to help the landscape in this area. Although I am %82.89 owner of the
regulatory code I have asked every contributor to the regulatory code
and have receieved positive Acked-bys from everyone except two deceased
entities:

o Frans Pop RIP 2010 [0]
- Frans Pop <[email protected]>
- Frans Pop <[email protected]>
o Nokia RIP February, 11, 2011 [1], [2]
- [email protected]
- [email protected]

Frans Pop's contribution was a simple patch 55f98938, titled,
"wireless: remove trailing space in messages" which just add a \n
to some printk lines. I'm going to treat these additions as
uncopyrightable.

As for the contributions made by employees on behalf of Nokia
my contact point was Petri Karhula <[email protected]> but
after one month he noted he had not been able to get traction from the
legal department on this request, as such it I proceeded by replacing
their contributions in previous patches.

The end goal is to help a clean rewrite that starts in userspace
that is shared under ISC license which currently is taking place with
the regulatory simulator [3].

[0] http://lists.debian.org/debian-devel/2011/12/msg00263.html
[1] http://press.nokia.com/2011/02/11/nokia-outlines-new-strategy-introduces-new-leadership-operational-structure/
[2] http://NokiaPlanB.com
[3] git://github.com/mcgrof/regsim.git

Acked-by: Thadeu Lima de Souza Cascardo <[email protected]>
Acked-by: Dan Carpenter <[email protected]>
Acked-by: Mihai Moldovan <[email protected]>
Acked-by: Uwe Kleine-König <[email protected]>
Acked-by: Sven Neumann <[email protected]>
Acked-by: Johannes Berg <[email protected]>
Acked-by: Tomas Winkler <[email protected]>
Acked-by: Tony Vroon <[email protected]>
Acked-by: Pavel Roskin <[email protected]>
Acked-by: Bob Copeland <[email protected]>
Acked-by: Lucas De Marchi <[email protected]>
Acked-by: Pat Erley <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Acked-by: John W. Linville <[email protected]>
Acked-by: Chris Wright <[email protected]>
Acked-by: Joe Perches <[email protected]>
Acked-by: Paul Gortmaker <[email protected]>
Acked-by: John Gordon <[email protected]>
Acked-by: Simon Barber <[email protected]>
Acked-by: Rajkumar Manoharan <[email protected]>
Acked-by: Jiri Benc <[email protected]>
Acked-by: Bruno Randolf <[email protected]>
Acked-by: Scott James Remnant <[email protected]>
Acked-by: Roel Kluin <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
net/wireless/genregdb.awk | 13 ++++++++++---
net/wireless/reg.c | 17 +++++++++++++----
net/wireless/reg.h | 15 +++++++++++++++
net/wireless/regdb.h | 16 ++++++++++++++++
4 files changed, 54 insertions(+), 7 deletions(-)

diff --git a/net/wireless/genregdb.awk b/net/wireless/genregdb.awk
index 53c143f..9392f8c 100644
--- a/net/wireless/genregdb.awk
+++ b/net/wireless/genregdb.awk
@@ -7,10 +7,17 @@
#
# Copyright 2009 John W. Linville <[email protected]>
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

BEGIN {
active = 0
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index c0e0e42..b65c0e9 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2,13 +2,22 @@
* Copyright 2002-2005, Instant802 Networks, Inc.
* Copyright 2005-2006, Devicescape Software, Inc.
* Copyright 2007 Johannes Berg <[email protected]>
- * Copyright 2008 Luis R. Rodriguez <[email protected]>
+ * Copyright 2008-2011 Luis R. Rodriguez <[email protected]>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

+
/**
* DOC: Wireless regulatory infrastructure
*
diff --git a/net/wireless/reg.h b/net/wireless/reg.h
index 786e414..e2aaaf5 100644
--- a/net/wireless/reg.h
+++ b/net/wireless/reg.h
@@ -1,5 +1,20 @@
#ifndef __NET_WIRELESS_REG_H
#define __NET_WIRELESS_REG_H
+/*
+ * Copyright 2008-2011 Luis R. Rodriguez <[email protected]>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */

extern const struct ieee80211_regdomain *cfg80211_regdomain;

diff --git a/net/wireless/regdb.h b/net/wireless/regdb.h
index 818222c..3279cfc 100644
--- a/net/wireless/regdb.h
+++ b/net/wireless/regdb.h
@@ -1,6 +1,22 @@
#ifndef __REGDB_H__
#define __REGDB_H__

+/*
+ * Copyright 2009 John W. Linville <[email protected]>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
extern const struct ieee80211_regdomain *reg_regdb[];
extern int reg_regdb_size;

--
1.7.4.15.g7811d