Patchwork [3/3] P2P: prefer operating channels where HT40 is possible

login
register
mail settings
Submitter Arik Nemtsov
Date Sept. 4, 2012, 5:52 p.m.
Message ID <1346781171-16854-3-git-send-email-arik@wizery.com>
Download mbox | patch
Permalink /patch/181648/
State Accepted
Commit 62120d59b4d674e02c519aeac8ffac1adaa34a9b
Headers show

Comments

Arik Nemtsov - Sept. 4, 2012, 5:52 p.m.
When no other user preference is specified, opt to use an operating
channel that allows HT40 operation. This way, if driver capabilities
and regulatory constraints allow, we might enjoy increased bandwidth.

Signed-hostap: Arik Nemtsov <arik@wizery.com>
---
 src/p2p/p2p_go_neg.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
Jouni Malinen - Dec. 25, 2012, 5:59 p.m.
On Tue, Sep 04, 2012 at 08:52:51PM +0300, Arik Nemtsov wrote:
> When no other user preference is specified, opt to use an operating
> channel that allows HT40 operation. This way, if driver capabilities
> and regulatory constraints allow, we might enjoy increased bandwidth.

Thanks, applied.

Patch

diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index e1ba466..7837d3b 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -390,6 +390,21 @@  static void p2p_reselect_channel(struct p2p_data *p2p,
 		}
 	}
 
+	/* Try a channel where we might be able to use HT40 */
+	for (i = 0; i < intersection->reg_classes; i++) {
+		struct p2p_reg_class *c = &intersection->reg_class[i];
+		if (c->reg_class == 116 || c->reg_class == 117 ||
+		    c->reg_class == 126 || c->reg_class == 127) {
+			wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
+				"P2P: Pick possible HT40 channel (reg_class "
+				"%u channel %u) from intersection",
+				c->reg_class, c->channel[0]);
+			p2p->op_reg_class = c->reg_class;
+			p2p->op_channel = c->channel[0];
+			return;
+		}
+	}
+
 	/*
 	 * Try to see if the original channel is in the intersection. If
 	 * so, no need to change anything, as it already contains some