All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iw: add support to print HT40-/+ on channels
@ 2009-03-19  5:57 Luis R. Rodriguez
  2009-03-19  6:10 ` Luis R. Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2009-03-19  5:57 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Luis R. Rodriguez

You don't have to guess now if your channels support HT40-/+ now.
This also helps with regulatory testing.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 info.c    |   13 +++++++++++++
 nl80211.h |   21 +++++++++++++++++++++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/info.c b/info.c
index f704131..14c88a3 100644
--- a/info.c
+++ b/info.c
@@ -55,6 +55,9 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
 		[NL80211_FREQUENCY_ATTR_RADAR] = { .type = NLA_FLAG },
 		[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
 		[NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH] = { .type = NLA_U32 },
+		[NL80211_FREQUENCY_ATTR_NO_HT40] = { .type = NLA_FLAG },
+		[NL80211_FREQUENCY_ATTR_NO_HT40MINUS] = { .type = NLA_FLAG },
+		[NL80211_FREQUENCY_ATTR_NO_HT40PLUS] = { .type = NLA_FLAG },
 	};
 
 	struct nlattr *tb_rate[NL80211_BITRATE_ATTR_MAX + 1];
@@ -70,6 +73,7 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
 	int bandidx = 1;
 	int rem_band, rem_freq, rem_rate, rem_mode;
 	int open;
+	bool ht_supported_by_dev = false;
 
 	nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
 		  genlmsg_attrlen(gnlh, 0), NULL);
@@ -90,6 +94,7 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
 #ifdef NL80211_BAND_ATTR_HT_CAPA
 		if (tb_band[NL80211_BAND_ATTR_HT_CAPA]) {
 			unsigned short cap = nla_get_u16(tb_band[NL80211_BAND_ATTR_HT_CAPA]);
+			ht_supported_by_dev = true;
 #define PCOM(fmt, args...) do { printf("\t\t\t* " fmt "\n", ##args); } while (0)
 #define PBCOM(bit, args...) if (cap & (bit)) PCOM(args)
 			printf("\t\tHT capabilities: 0x%.4x\n", cap);
@@ -231,6 +236,14 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
 				print_flag("no IBSS", &open);
 			if (tb_freq[NL80211_FREQUENCY_ATTR_RADAR])
 				print_flag("radar detection", &open);
+			if (ht_supported_by_dev) {
+				if (tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40])
+					print_flag("HT40 disallowed", &open);
+				else if (tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40MINUS])
+					print_flag("HT40- disallowed", &open);
+				else if (tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40PLUS])
+					print_flag("HT40+ disallowed", &open);
+			}
  next:
 			if (open)
 				printf(")");
diff --git a/nl80211.h b/nl80211.h
index 9118460..f00ebff 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -349,6 +349,10 @@ enum nl80211_commands {
  * @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently
  * 	set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
  *
+ * @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies
+ *	an array of command numbers (i.e. a mapping index to command number)
+ *	that the driver for the given wiphy supports.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -426,6 +430,8 @@ enum nl80211_attrs {
 	NL80211_ATTR_REG_INITIATOR,
 	NL80211_ATTR_REG_TYPE,
 
+	NL80211_ATTR_SUPPORTED_COMMANDS,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -665,6 +671,15 @@ enum nl80211_band_attr {
  * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
  *	(100 * dBm).
  * @NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH: max bandwidth allowed, given in MHz
+ * @NL80211_FREQUENCY_ATTR_NOHT40: HT40 operation is not permitted on
+ * 	this channel, this is would indicate the regulatory domain did
+ * 	not allow for HT40 operation.
+ * @NL80211_FREQUENCY_ATTR_NO_HT40MINUS: HT40- operation is not permitted on
+ * 	this channel. This could be due to regulatory domain restrictions or
+ * 	when the channel is on a band edge, towards the beginning.
+ * @NL80211_FREQUENCY_ATTR_NO_HT40PLUS: HT40+ operation is not permitted on
+ * 	this channel. This could be due to regulatory domain restrictions or
+ * 	when the channel is on a band edge, towards the end.
  */
 enum nl80211_frequency_attr {
 	__NL80211_FREQUENCY_ATTR_INVALID,
@@ -675,6 +690,9 @@ enum nl80211_frequency_attr {
 	NL80211_FREQUENCY_ATTR_RADAR,
 	NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
 	NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH,
+	NL80211_FREQUENCY_ATTR_NO_HT40,
+	NL80211_FREQUENCY_ATTR_NO_HT40MINUS,
+	NL80211_FREQUENCY_ATTR_NO_HT40PLUS,
 
 	/* keep last */
 	__NL80211_FREQUENCY_ATTR_AFTER_LAST,
@@ -683,6 +701,9 @@ enum nl80211_frequency_attr {
 
 #define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
 #define NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH
+#define NL80211_FREQUENCY_ATTR_NO_HT40 NL80211_FREQUENCY_ATTR_NO_HT40
+#define NL80211_FREQUENCY_ATTR_NO_HT40MINUS NL80211_FREQUENCY_ATTR_NO_HT40MINUS
+#define NL80211_FREQUENCY_ATTR_NO_HT40PLUS NL80211_FREQUENCY_ATTR_NO_HT40PLUS
 
 /**
  * enum nl80211_bitrate_attr - bitrate attributes
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] iw: add support to print HT40-/+ on channels
  2009-03-19  5:57 [PATCH] iw: add support to print HT40-/+ on channels Luis R. Rodriguez
@ 2009-03-19  6:10 ` Luis R. Rodriguez
  2009-03-19  9:19   ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2009-03-19  6:10 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Luis R. Rodriguez

On Wed, Mar 18, 2009 at 10:57 PM, Luis R. Rodriguez
<lrodriguez@atheros.com> wrote:
> You don't have to guess now if your channels support HT40-/+ now.
> This also helps with regulatory testing.

Oh and here's a screenshot:

When a country doesn't allow HT40 at all, you'll see:

                Frequencies:
                        * 2412 MHz [1] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2417 MHz [2] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2422 MHz [3] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2427 MHz [4] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2432 MHz [5] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2437 MHz [6] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2442 MHz [7] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2447 MHz [8] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2452 MHz [9] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2457 MHz [10] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2462 MHz [11] (27.0 dBm / 20 MHz) (HT40 disallowed)
                        * 2467 MHz [12] (disabled)
                        * 2472 MHz [13] (disabled)
                        * 2484 MHz [14] (disabled)

When HT40 is allowed but due to band edges either HT40- or HT4+ is not allowed:

                Frequencies:
                        * 2412 MHz [1] (27.0 dBm / 20 MHz) (HT40- disallowed)
                        * 2417 MHz [2] (27.0 dBm / 20 MHz) (HT40- disallowed)
                        * 2422 MHz [3] (27.0 dBm / 20 MHz) (HT40- disallowed)
                        * 2427 MHz [4] (27.0 dBm / 20 MHz) (HT40- disallowed)
                        * 2432 MHz [5] (27.0 dBm / 20 MHz)
                        * 2437 MHz [6] (27.0 dBm / 20 MHz)
                        * 2442 MHz [7] (27.0 dBm / 20 MHz)
                        * 2447 MHz [8] (27.0 dBm / 20 MHz) (HT40+ disallowed)
                        * 2452 MHz [9] (27.0 dBm / 20 MHz) (HT40+ disallowed)
                        * 2457 MHz [10] (27.0 dBm / 20 MHz) (HT40+ disallowed)
                        * 2462 MHz [11] (27.0 dBm / 20 MHz) (HT40+ disallowed)
                        * 2467 MHz [12] (disabled)
                        * 2472 MHz [13] (disabled)
                        * 2484 MHz [14] (disabled)

  Luis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iw: add support to print HT40-/+ on channels
  2009-03-19  6:10 ` Luis R. Rodriguez
@ 2009-03-19  9:19   ` Johannes Berg
  2009-03-19  9:25     ` Luis R. Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2009-03-19  9:19 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]


>                 Frequencies:
>                         * 2412 MHz [1] (27.0 dBm / 20 MHz) (HT40- disallowed)
>                         * 2417 MHz [2] (27.0 dBm / 20 MHz) (HT40- disallowed)
>                         * 2422 MHz [3] (27.0 dBm / 20 MHz) (HT40- disallowed)
>                         * 2427 MHz [4] (27.0 dBm / 20 MHz) (HT40- disallowed)
>                         * 2432 MHz [5] (27.0 dBm / 20 MHz)
>                         * 2437 MHz [6] (27.0 dBm / 20 MHz)
>                         * 2442 MHz [7] (27.0 dBm / 20 MHz)
>                         * 2447 MHz [8] (27.0 dBm / 20 MHz) (HT40+ disallowed)
>                         * 2452 MHz [9] (27.0 dBm / 20 MHz) (HT40+ disallowed)
>                         * 2457 MHz [10] (27.0 dBm / 20 MHz) (HT40+ disallowed)
>                         * 2462 MHz [11] (27.0 dBm / 20 MHz) (HT40+ disallowed)
>                         * 2467 MHz [12] (disabled)
>                         * 2472 MHz [13] (disabled)
>                         * 2484 MHz [14] (disabled)

Eh, that doesn't look right. What's with 2432-2443 MHz?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iw: add support to print HT40-/+ on channels
  2009-03-19  9:19   ` Johannes Berg
@ 2009-03-19  9:25     ` Luis R. Rodriguez
  2009-03-19  9:36       ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2009-03-19  9:25 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

T24gVGh1LCBNYXIgMTksIDIwMDkgYXQgMjoxOSBBTSwgSm9oYW5uZXMgQmVyZwo8am9oYW5uZXNA
c2lwc29sdXRpb25zLm5ldD4gd3JvdGU6Cj4KPj4gwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgRnJl
cXVlbmNpZXM6Cj4+IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgICogMjQxMiBN
SHogWzFdICgyNy4wIGRCbSAvIDIwIE1IeikgKEhUNDAtIGRpc2FsbG93ZWQpCj4+IMKgIMKgIMKg
IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgICogMjQxNyBNSHogWzJdICgyNy4wIGRCbSAvIDIw
IE1IeikgKEhUNDAtIGRpc2FsbG93ZWQpCj4+IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg
IMKgIMKgICogMjQyMiBNSHogWzNdICgyNy4wIGRCbSAvIDIwIE1IeikgKEhUNDAtIGRpc2FsbG93
ZWQpCj4+IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgICogMjQyNyBNSHogWzRd
ICgyNy4wIGRCbSAvIDIwIE1IeikgKEhUNDAtIG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wqAgwqAgKiAyNDg0IE1IeiBbMTRdIChkaXNhYmxlZCkKPgo+IEVoLCB0aGF0IGRvZXNuJ3Qg
bG9vayByaWdodC4gV2hhdCdzIHdpdGggMjQzMi0yNDQzIE1Iej8KCkl0IG1lYW5zIHlvdSBnZXQg
SFQ0MC0vKyBhbGxvd2VkLiBEbyB3ZSB3YW50IHRvIHNob3cgaWYgd2UgaGF2ZSBpdCBhbGxvd2Vk
PwoKICBMdWlzCg==

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iw: add support to print HT40-/+ on channels
  2009-03-19  9:25     ` Luis R. Rodriguez
@ 2009-03-19  9:36       ` Johannes Berg
  2009-03-19  9:45         ` Luis R. Rodriguez
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2009-03-19  9:36 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

On Thu, 2009-03-19 at 02:25 -0700, Luis R. Rodriguez wrote:

> >>                         * 2432 MHz [5] (27.0 dBm / 20 MHz)
> >>                         * 2437 MHz [6] (27.0 dBm / 20 MHz)
> >>                         * 2442 MHz [7] (27.0 dBm / 20 MHz)

> > Eh, that doesn't look right. What's with 2432-2443 MHz?
> 
> It means you get HT40-/+ allowed. Do we want to show if we have it allowed?

What's with the /20mhz though?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iw: add support to print HT40-/+ on channels
  2009-03-19  9:36       ` Johannes Berg
@ 2009-03-19  9:45         ` Luis R. Rodriguez
  0 siblings, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2009-03-19  9:45 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Thu, Mar 19, 2009 at 2:36 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Thu, 2009-03-19 at 02:25 -0700, Luis R. Rodriguez wrote:
>
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 * 2432 MHz [5] (27.0 dBm / 20 MHz)
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 * 2437 MHz [6] (27.0 dBm / 20 MHz)
>> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 * 2442 MHz [7] (27.0 dBm / 20 MHz)
>
>> > Eh, that doesn't look right. What's with 2432-2443 MHz?
>>
>> It means you get HT40-/+ allowed. Do we want to show if we have it a=
llowed?
>
> What's with the /20mhz though?

Right, so that would mean you're clear regulatory wise to use the
entire 20 MHz for that channel. At a later time perhaps a custom
target bandwidth might be desired, then the regulatory bandwidth check
could be reduced. I'm not sure how we'll do this yet but if we keep
the bandwidth this lets us keep the max per channel and then easily
determine which smaller target bandwidths would be allowed.

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-03-19  9:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-19  5:57 [PATCH] iw: add support to print HT40-/+ on channels Luis R. Rodriguez
2009-03-19  6:10 ` Luis R. Rodriguez
2009-03-19  9:19   ` Johannes Berg
2009-03-19  9:25     ` Luis R. Rodriguez
2009-03-19  9:36       ` Johannes Berg
2009-03-19  9:45         ` Luis R. Rodriguez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.