Message ID | CAB=NE6WfTXiScyXHReEWcpQ9EKpu1YCVQypa-B5BBO6aYXh3fA@mail.gmail.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Mon, Jun 30, 2014 at 11:55 AM, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote: > For the current kernel we > could intake the patch below, and I can port the change to no use > dfs_cac, that would enable older kernels to use new and older versions > of the ASCII database file. Personally I actually rather avoid us accept a patch upstream for a userspace change. The problem here is that we failed to realize the impact of CFG80211_INTERNAL_REGDB at build time with a userspace tool, in this case the db.txt file wireless-regdb provides and its format. If we wanted to avoid a stable patch we could require a match between wireless-regdb input file used for a kernel when CFG80211_INTERNAL_REGDB is used at build time. That would require different ASCII files on wireless-regdb or having the users of CFG80211_INTERNAL_REGDB do the conversion themselves. Upstream would just follow the wireless-regdb latest format. This then would just require upstream a Kconfig update to clarify the requirements. This seems like a rather lazy option but also one that would be rather more fair and honest for upstream, we could deal with a proper fix by reconsidering the implementation of CFG80211_INTERNAL_REGDB completely for future kernels. Luis -- 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, Jun 30, 2014 at 12:19:08PM -0700, Luis R. Rodriguez wrote: > On Mon, Jun 30, 2014 at 11:55 AM, Luis R. Rodriguez > <mcgrof@do-not-panic.com> wrote: > > For the current kernel we > > could intake the patch below, and I can port the change to no use > > dfs_cac, that would enable older kernels to use new and older versions > > of the ASCII database file. > > Personally I actually rather avoid us accept a patch upstream for a > userspace change. The problem here is that we failed to realize the > impact of CFG80211_INTERNAL_REGDB at build time with a userspace tool, > in this case the db.txt file wireless-regdb provides and its format. > > If we wanted to avoid a stable patch we could require a match between > wireless-regdb input file used for a kernel when > CFG80211_INTERNAL_REGDB is used at build time. That would require > different ASCII files on wireless-regdb or having the users of > CFG80211_INTERNAL_REGDB do the conversion themselves. Upstream would > just follow the wireless-regdb latest format. This then would just > require upstream a Kconfig update to clarify the requirements. > > This seems like a rather lazy option but also one that would be rather > more fair and honest for upstream, we could deal with a proper fix by > reconsidering the implementation of CFG80211_INTERNAL_REGDB completely > for future kernels. I'm shocked that anyone actually uses CFG80211_INTERNAL_REGDB... Anyway, I don't see the big deal. We should keep CFG80211_INTERNAL_REGDB (whether implemented in awk or C) up-to-date with current kernels. Anyone wanting to use an old kernel with an updated wireless-regdb file is responsible for ensuring compatibility. If they can't do that, then they should seek support from a vendor. How is this any different from any other kernel support issue? John
On Tue, Jul 01, 2014 at 10:41:49AM -0400, John W. Linville wrote: > On Mon, Jun 30, 2014 at 12:19:08PM -0700, Luis R. Rodriguez wrote: > > On Mon, Jun 30, 2014 at 11:55 AM, Luis R. Rodriguez > > <mcgrof@do-not-panic.com> wrote: > > > For the current kernel we > > > could intake the patch below, and I can port the change to no use > > > dfs_cac, that would enable older kernels to use new and older versions > > > of the ASCII database file. > > > > Personally I actually rather avoid us accept a patch upstream for a > > userspace change. The problem here is that we failed to realize the > > impact of CFG80211_INTERNAL_REGDB at build time with a userspace tool, > > in this case the db.txt file wireless-regdb provides and its format. > > > > If we wanted to avoid a stable patch we could require a match between > > wireless-regdb input file used for a kernel when > > CFG80211_INTERNAL_REGDB is used at build time. That would require > > different ASCII files on wireless-regdb or having the users of > > CFG80211_INTERNAL_REGDB do the conversion themselves. Upstream would > > just follow the wireless-regdb latest format. This then would just > > require upstream a Kconfig update to clarify the requirements. > > > > This seems like a rather lazy option but also one that would be rather > > more fair and honest for upstream, we could deal with a proper fix by > > reconsidering the implementation of CFG80211_INTERNAL_REGDB completely > > for future kernels. > > I'm shocked that anyone actually uses CFG80211_INTERNAL_REGDB... I believe all mobile and APs use it these days. > Anyway, I don't see the big deal. We should keep > CFG80211_INTERNAL_REGDB (whether implemented in awk or C) up-to-date > with current kernels. Anyone wanting to use an old kernel with an > updated wireless-regdb file is responsible for ensuring compatibility. > If they can't do that, then they should seek support from a vendor. Fine by me... I'll update the Kconfig. > How is this any different from any other kernel support issue? This is a build issue that does not cause any errors, users go through with the install just fine and only at run time do they discover the issue. We never documented the expecations nor do I think we expected this before. This is also caused by an input file from userspace, I do consider the issue unexpected. Luis -- 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 Tue, Jul 1, 2014 at 10:17 AM, Luis R. Rodriguez <mcgrof@suse.com> wrote: >> How is this any different from any other kernel support issue? > > This is a build issue that does not cause any errors, users go through with the install > just fine and only at run time do they discover the issue. We never documented > the expecations nor do I think we expected this before. This is also caused by an > input file from userspace, I do consider the issue unexpected. This is a bit more broken given that DFS CAC patches are upstream but we haven't yet even provided the removal of antenna gain on the awk script but for some reason it did add the DFS CAC parsing to the awk script, so upstream has the awk DFS CAC parser options, we don't yet even use it, and the antenna gain wasn't removed. I'll work on that patch but parsing things in awk is getting a bit hairy for the conditionals. We can use the C parser now that we have on but the DFS CAC stuf was not yet ironed out for CRDA and wireless-regdb... Luis -- 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 Tue, Jul 01, 2014 at 11:54:43AM -0700, Luis R. Rodriguez wrote: > On Tue, Jul 1, 2014 at 10:17 AM, Luis R. Rodriguez <mcgrof@suse.com> wrote: > >> How is this any different from any other kernel support issue? > > > > This is a build issue that does not cause any errors, users go through with the install > > just fine and only at run time do they discover the issue. We never documented > > the expecations nor do I think we expected this before. This is also caused by an > > input file from userspace, I do consider the issue unexpected. > > This is a bit more broken given that DFS CAC patches are upstream but > we haven't yet even provided the removal of antenna gain on the awk > script but for some reason it did add the DFS CAC parsing to the awk > script, so upstream has the awk DFS CAC parser options, we don't yet > even use it, and the antenna gain wasn't removed. I'll work on that > patch but parsing things in awk is getting a bit hairy for the > conditionals. We can use the C parser now that we have on but the DFS > CAC stuf was not yet ironed out for CRDA and wireless-regdb... I wrote that awk script years ago so that we could get rid of the old hard-coded rulesets and so I could have something working in RHEL5. I never merged the DFS CAC stuff in wireless-regdb, because of the unresolved issue of supporting multiple formats. It looks to me like the dfs_cac stuff in genregdb.awk is broken, since it doesn't seem to account for flags. I sent a patch that should account for the antenna gain issue. Please give it a review. Obviously, we need to talk more about this in Chicago if not before... John
On Tue, Jul 1, 2014 at 8:11 PM, John W. Linville <linville@tuxdriver.com> wrote: > > On Mon, Jun 30, 2014 at 12:19:08PM -0700, Luis R. Rodriguez wrote: > > On Mon, Jun 30, 2014 at 11:55 AM, Luis R. Rodriguez > > <mcgrof@do-not-panic.com> wrote: > > > For the current kernel we > > > could intake the patch below, and I can port the change to no use > > > dfs_cac, that would enable older kernels to use new and older versions > > > of the ASCII database file. > > > > Personally I actually rather avoid us accept a patch upstream for a > > userspace change. The problem here is that we failed to realize the > > impact of CFG80211_INTERNAL_REGDB at build time with a userspace tool, > > in this case the db.txt file wireless-regdb provides and its format. > > > > If we wanted to avoid a stable patch we could require a match between > > wireless-regdb input file used for a kernel when > > CFG80211_INTERNAL_REGDB is used at build time. That would require > > different ASCII files on wireless-regdb or having the users of > > CFG80211_INTERNAL_REGDB do the conversion themselves. Upstream would > > just follow the wireless-regdb latest format. This then would just > > require upstream a Kconfig update to clarify the requirements. > > > > This seems like a rather lazy option but also one that would be rather > > more fair and honest for upstream, we could deal with a proper fix by > > reconsidering the implementation of CFG80211_INTERNAL_REGDB completely > > for future kernels. > > I'm shocked that anyone actually uses CFG80211_INTERNAL_REGDB... > Lot of embedded devices like ours avoid the pain of cross compiling crda, udev... and resort to internal_regdb as a easy way to get things done. > Anyway, I don't see the big deal. We should keep > CFG80211_INTERNAL_REGDB (whether implemented in awk or C) up-to-date > with current kernels. Anyone wanting to use an old kernel with an > updated wireless-regdb file is responsible for ensuring compatibility. > If they can't do that, then they should seek support from a vendor. > How is this any different from any other kernel support issue? Sounds good to me. -- 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 Wed, 2014-07-02 at 13:03 +0530, Krishna Chaitanya wrote: > Lot of embedded devices like ours avoid the pain of cross compiling > crda, udev... > and resort to internal_regdb as a easy way to get things done. Count me in. The whole crda stuff is crazy for embedded devices with fixed hardware.
diff --git a/net/wireless/genregdb.awk b/net/wireless/genregdb.awk index 40c37fc..8aa73b1 100644 --- a/net/wireless/genregdb.awI +++ b/net/wireless/genregdb.awk @@ -51,32 +51,48 @@ function parse_country_head() { function parse_reg_rule() { + flag_starts_at = 8 + start = $1 sub(/\(/, "", start) end = $3 bw = $5 sub(/\),/, "", bw) + + # We have two ASCII formats, one without the antenna gain gain = $6 - sub(/\(/, "", gain) - sub(/,/, "", gain) power = $7 - sub(/\)/, "", power) + units = $8 + dfs_cac = 0 + + if (gain ~ /)/) { + flag_starts_at = 7 + + gain = 0 + power = $6 + units = $7 + dfs_cac = $9 + if (units != "mW") + dfs_cac = $8 + } else { + sub(/\(/, "", gain) + sub(/,/, "", gain) + } + + sub(/\(/, "", power) sub(/,/, "", power) + sub(/\)/, "", power) # power might be in mW... - units = $8 sub(/\)/, "", units) sub(/,/, "", units) - dfs_cac = $9 if (units == "mW") { power = 10 * log(power)/log(10) - } else { - dfs_cac = $8 } sub(/,/, "", dfs_cac) sub(/\(/, "", dfs_cac) sub(/\)/, "", dfs_cac) flagstr = "" - for (i=8; i<=NF; i++) + for (i=flag_starts_at; i<=NF; i++) flagstr = flagstr $i split(flagstr, flagarray, ",") flags = ""