From: Arik Nemtsov Date: Tue, 25 Dec 2012 17:59:04 +0000 (+0200) Subject: P2P: Prefer operating channels where HT40 is possible X-Git-Tag: hostap_2_0~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62120d59b4d674e02c519aeac8ffac1adaa34a9b;p=thirdparty%2Fhostap.git P2P: Prefer operating channels where HT40 is possible 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 --- diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c index 1b6482bbd..63910c946 100644 --- a/src/p2p/p2p_go_neg.c +++ b/src/p2p/p2p_go_neg.c @@ -390,6 +390,21 @@ 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; + } + } + /* * Fall back to whatever is included in the channel intersection since * no better options seems to be available.