diff mbox

P2P : Add Operating class 125 for P2P supported channels

Message ID BA412E2CCAFCC2409FA4427242F6732A1F3B5C9A@IRSMSX108.ger.corp.intel.com
State Accepted
Headers show

Commit Message

Ben Abdessalem, AmrX April 2, 2015, 4:37 p.m. UTC
Hi Jouni,

Could you please consider the attached patch for merging ?
It's about adding operating class 125 for P2P supported channels list.

Thanks,
Amr.

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Comments

Jouni Malinen April 3, 2015, 8:06 a.m. UTC | #1
On Thu, Apr 02, 2015 at 04:37:35PM +0000, Ben Abdessalem, AmrX wrote:
> Could you please consider the attached patch for merging ?
> It's about adding operating class 125 for P2P supported channels list.

Could you please clarify why this should be allowed for P2P use cases?
Class 124 covers the channels 149-161 that have been defined with the
NomadicBehavior behavior limits set while Class 125 channels
149-165(169) have LicenseExemptBehavior behavior limits set that
is for "some fixed stations [that] can be operated without a license at
a higher radiated transmit power than permitted for nomadic use". For
me, that reads as something that is not really suitable for P2P.

> diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
> @@ -612,6 +612,10 @@ static int ieee80211_chan_to_freq_us(u8 op_class, u8 chan)
> +	case 5: /* channels 149,153,157,169 */
> +		if (chan < 149 || chan > 169)
> +			return -1;
> +		return 5000 + 5 * chan;
> @@ -764,12 +768,15 @@ static int ieee80211_chan_to_freq_global(u8 op_class, u8 chan)
> +	case 125: /* channels 149,153,157,161,165,169 */
> +		if (chan < 149 || chan > 169)
> +			return -1;
> +		return 5000 + 5 * chan;

I'm fine with these in the generic (not specific to P2P) helper
functions, but rest of the changes are P2P specific and need clearer
justification on the applicability of LicenseExemptBehavior for P2P use
cases.
Ben Abdessalem, AmrX April 3, 2015, 9:03 a.m. UTC | #2
Hi,

This patch adds the opportunity to use channel 165  for example in P2P operations, depending of the wifi chip capabilities and also depending of the country code,
For "us" country code, the list is rather :
> ieee80211_chan_to_freq_us(u8 op_class, u8 chan)
> +	case 5: /* channels 149,153,157,161,165 */
I'm attaching the rectified patch, sorry for the mistake,
I didn't understand why it's not suitable to use LicenseExemptBehavior behavior for P2P, I think we are already using operating class 81, which is also LicenseExemptBehavior behavior (for Europe and United states,  but we are excluding some channels [12,13] ).
For 125 operating class, it's LicenseExemptBehavior behavior as global operating class, but not for Europe,

Regards,
Amr.

-----Original Message-----
From: Jouni Malinen [mailto:j@w1.fi] 
Sent: Friday, April 03, 2015 10:07 AM
To: Ben Abdessalem, AmrX
Cc: hostap@lists.shmoo.com; Bachot, Jean-michel
Subject: Re: [PATCH] P2P : Add Operating class 125 for P2P supported channels

On Thu, Apr 02, 2015 at 04:37:35PM +0000, Ben Abdessalem, AmrX wrote:
> Could you please consider the attached patch for merging ?
> It's about adding operating class 125 for P2P supported channels list.

Could you please clarify why this should be allowed for P2P use cases?
Class 124 covers the channels 149-161 that have been defined with the NomadicBehavior behavior limits set while Class 125 channels
149-165(169) have LicenseExemptBehavior behavior limits set that is for "some fixed stations [that] can be operated without a license at a higher radiated transmit power than permitted for nomadic use". For me, that reads as something that is not really suitable for P2P.

> diff --git a/src/common/ieee802_11_common.c 
> b/src/common/ieee802_11_common.c @@ -612,6 +612,10 @@ static int 
> ieee80211_chan_to_freq_us(u8 op_class, u8 chan)
> +	case 5: /* channels 149,153,157,169 */
> +		if (chan < 149 || chan > 169)
> +			return -1;
> +		return 5000 + 5 * chan;
> @@ -764,12 +768,15 @@ static int ieee80211_chan_to_freq_global(u8 
> op_class, u8 chan)
> +	case 125: /* channels 149,153,157,161,165,169 */
> +		if (chan < 149 || chan > 169)
> +			return -1;
> +		return 5000 + 5 * chan;

I'm fine with these in the generic (not specific to P2P) helper functions, but rest of the changes are P2P specific and need clearer justification on the applicability of LicenseExemptBehavior for P2P use cases.
Jouni Malinen June 12, 2015, 6:56 p.m. UTC | #3
On Fri, Apr 03, 2015 at 09:03:23AM +0000, Ben Abdessalem, AmrX wrote:
> This patch adds the opportunity to use channel 165  for example in P2P operations, depending of the wifi chip capabilities and also depending of the country code,
> For "us" country code, the list is rather :
> > ieee80211_chan_to_freq_us(u8 op_class, u8 chan)
> > +	case 5: /* channels 149,153,157,161,165 */
> I'm attaching the rectified patch, sorry for the mistake,

Thanks, applied.
diff mbox

Patch

From 6997d36c1f8556416e8086432f92b872c9a16c50 Mon Sep 17 00:00:00 2001
From: Amr BEN ABDESSALEM <amrx.ben.abdessalem@intel.com>
Date: Thu, 2 Apr 2015 18:22:58 +0200
Subject: [PATCH] P2P : Add Operating class 125 for P2P supported channels

Add operating class 125 (channels 149 .. 169) to the list of P2P supported channels,

Signed-off-by: Amr BEN ABDESSALEM <amrx.ben.abdessalem@intel.com>
---
 src/common/ieee802_11_common.c  |    9 ++++++++-
 src/p2p/p2p.c                   |    2 +-
 src/p2p/p2p_go_neg.c            |    2 +-
 src/p2p/p2p_utils.c             |    9 +++++++++
 wpa_supplicant/p2p_supplicant.c |    2 ++
 5 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
index aca0b73..bcc3059 100644
--- a/src/common/ieee802_11_common.c
+++ b/src/common/ieee802_11_common.c
@@ -612,6 +612,10 @@  static int ieee80211_chan_to_freq_us(u8 op_class, u8 chan)
 		if (chan < 149 || chan > 161)
 			return -1;
 		return 5000 + 5 * chan;
+	case 5: /* channels 149,153,157,169 */
+		if (chan < 149 || chan > 169)
+			return -1;
+		return 5000 + 5 * chan;
 	case 34: /* 60 GHz band, channels 1..3 */
 		if (chan < 1 || chan > 3)
 			return -1;
@@ -764,12 +768,15 @@  static int ieee80211_chan_to_freq_global(u8 op_class, u8 chan)
 			return -1;
 		return 5000 + 5 * chan;
 	case 124: /* channels 149,153,157,161 */
-	case 125: /* channels 149,153,157,161,165,169 */
 	case 126: /* channels 149,157; 40 MHz */
 	case 127: /* channels 153,161; 40 MHz */
 		if (chan < 149 || chan > 161)
 			return -1;
 		return 5000 + 5 * chan;
+	case 125: /* channels 149,153,157,161,165,169 */
+		if (chan < 149 || chan > 169)
+			return -1;
+		return 5000 + 5 * chan;
 	case 128: /* center freqs 42, 58, 106, 122, 138, 155; 80 MHz */
 	case 130: /* center freqs 42, 58, 106, 122, 138, 155; 80 MHz */
 		if (chan < 36 || chan > 161)
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index f584fae..3ee5d6f 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -1380,7 +1380,7 @@  static int p2p_prepare_channel_pref(struct p2p_data *p2p,
 static void p2p_prepare_channel_best(struct p2p_data *p2p)
 {
 	u8 op_class, op_channel;
-	const int op_classes_5ghz[] = { 124, 115, 0 };
+	const int op_classes_5ghz[] = { 124, 125, 115, 0 };
 	const int op_classes_ht40[] = { 126, 127, 116, 117, 0 };
 	const int op_classes_vht[] = { 128, 0 };
 
diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index 98abf9d..926d1cc 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -379,7 +379,7 @@  void p2p_reselect_channel(struct p2p_data *p2p,
 	int freq;
 	u8 op_reg_class, op_channel;
 	unsigned int i;
-	const int op_classes_5ghz[] = { 124, 115, 0 };
+	const int op_classes_5ghz[] = { 124, 125, 115, 0 };
 	const int op_classes_ht40[] = { 126, 127, 116, 117, 0 };
 	const int op_classes_vht[] = { 128, 0 };
 
diff --git a/src/p2p/p2p_utils.c b/src/p2p/p2p_utils.c
index f32751d..eee3c5a 100644
--- a/src/p2p/p2p_utils.c
+++ b/src/p2p/p2p_utils.c
@@ -101,6 +101,15 @@  int p2p_freq_to_channel(unsigned int freq, u8 *op_class, u8 *channel)
 		return 0;
 	}
 
+	if (freq >= 5745 && freq <= 5845) {
+		if ((freq - 5000) % 5)
+			return -1;
+
+		*op_class = 125; /* 5 GHz, channels 149..169 */
+		*channel = (freq - 5000) / 5;
+		return 0;
+	}
+
 	if (freq >= 58320 && freq <= 64800) {
 		if ((freq - 58320) % 2160)
 			return -1;
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 4c71ef4..88cd16e 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -3107,6 +3107,7 @@  static struct p2p_oper_class_map op_class[] = {
 #endif
 	{ HOSTAPD_MODE_IEEE80211A, 115, 36, 48, 4, BW20 },
 	{ HOSTAPD_MODE_IEEE80211A, 124, 149, 161, 4, BW20 },
+	{ HOSTAPD_MODE_IEEE80211A, 125, 149, 169, 4, BW20 },
 	{ HOSTAPD_MODE_IEEE80211A, 116, 36, 44, 8, BW40PLUS },
 	{ HOSTAPD_MODE_IEEE80211A, 117, 40, 48, 8, BW40MINUS },
 	{ HOSTAPD_MODE_IEEE80211A, 126, 149, 157, 8, BW40PLUS },
@@ -5218,6 +5219,7 @@  static int wpas_p2p_init_go_params(struct wpa_supplicant *wpa_s,
 		    wpa_s->conf->p2p_oper_reg_class == 116 ||
 		    wpa_s->conf->p2p_oper_reg_class == 117 ||
 		    wpa_s->conf->p2p_oper_reg_class == 124 ||
+		    wpa_s->conf->p2p_oper_reg_class == 125 ||
 		    wpa_s->conf->p2p_oper_reg_class == 126 ||
 		    wpa_s->conf->p2p_oper_reg_class == 127) &&
 		   freq_included(channels,
-- 
1.7.9.5