From: Jouni Malinen Date: Mon, 18 Nov 2013 15:57:07 +0000 (+0200) Subject: P2P: Prefer HT40 channels for initial pick X-Git-Tag: hostap_2_1~524 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a30d50b324bc50f27a341016faeb4949afdedaff;p=thirdparty%2Fhostap.git P2P: Prefer HT40 channels for initial pick If there are no other preferences from local configuration or driver, prefer a random HT40 channel instead of falling back to the fixed pre-configured channel or 5 GHz channel preference. Signed-hostap: Jouni Malinen --- diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 31a4819d6..94d57b5dd 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -1181,6 +1181,7 @@ static void p2p_prepare_channel_best(struct p2p_data *p2p) { u8 op_class, op_channel; const int op_classes_5ghz[] = { 115, 124, 0 }; + const int op_classes_ht40[] = { 116, 117, 126, 127, 0 }; p2p_dbg(p2p, "Prepare channel best"); @@ -1212,6 +1213,11 @@ static void p2p_prepare_channel_best(struct p2p_data *p2p) p2p_dbg(p2p, "Select first pref_chan entry as operating channel preference"); p2p->op_reg_class = p2p->cfg->pref_chan[0].op_class; p2p->op_channel = p2p->cfg->pref_chan[0].chan; + } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_ht40, + &p2p->op_reg_class, &p2p->op_channel) == + 0) { + p2p_dbg(p2p, "Select possible HT40 channel (op_class %u channel %u) as operating channel preference", + p2p->op_reg_class, p2p->op_channel); } else if (p2p_channel_select(&p2p->cfg->channels, op_classes_5ghz, &p2p->op_reg_class, &p2p->op_channel) == 0) {