merge in klp-release history after reset to klp-dev
diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index 8740ed5..17fb329 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -416,6 +416,27 @@
}
}
+ /* Prefer a 5 GHz channel */
+ for (i = 0; i < intersection->reg_classes; i++) {
+ struct p2p_reg_class *c = &intersection->reg_class[i];
+ if ((c->reg_class == 115 || c->reg_class == 124) &&
+ c->channels) {
+ unsigned int r;
+
+ /*
+ * Pick one of the available channels in the operating
+ * class at random.
+ */
+ os_get_random((u8 *) &r, sizeof(r));
+ r %= c->channels;
+ p2p_dbg(p2p, "Pick possible 5 GHz channel (op_class %u channel %u) from intersection",
+ c->reg_class, c->channel[r]);
+ p2p->op_reg_class = c->reg_class;
+ p2p->op_channel = c->channel[r];
+ return;
+ }
+ }
+
/*
* Try to see if the original channel is in the intersection. If
* so, no need to change anything, as it already contains some
diff --git a/src/p2p/p2p_utils.c b/src/p2p/p2p_utils.c
index e0d3756..0769ede 100644
--- a/src/p2p/p2p_utils.c
+++ b/src/p2p/p2p_utils.c
@@ -249,8 +249,7 @@
u8 op_reg_class, op_channel;
#ifdef ANDROID_P2P
- if ((freq >= 5170 && freq < 5745) &&
- (os_strncasecmp(p2p->cfg->country, "US", 2) == 0))
+ if (freq >= 5170 && freq < 5745)
return 0;
#endif
if (p2p_freq_to_channel(freq, &op_reg_class, &op_channel) < 0)