diff mbox

[RESEND] driver_nl80211: handle multiple interface combinations for p2p

Message ID 1396782713-53047-1-git-send-email-nbd@openwrt.org
State Accepted
Headers show

Commit Message

Felix Fietkau April 6, 2014, 11:11 a.m. UTC
The first combination may allow single-channel concurrency for
p2p + managed, but there may be others that allow multi-channel
concurrency. Parse all of them to find the maximum number of channels.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 src/drivers/driver_nl80211.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Jouni Malinen April 11, 2014, 4:59 p.m. UTC | #1
On Sun, Apr 06, 2014 at 01:11:53PM +0200, Felix Fietkau wrote:
> The first combination may allow single-channel concurrency for
> p2p + managed, but there may be others that allow multi-channel
> concurrency. Parse all of them to find the maximum number of channels.

Thanks, applied.
diff mbox

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 27b4c48..2bf931c 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3444,10 +3444,12 @@  static int wiphy_info_iface_comb_process(struct wiphy_info_data *info,
 	}
 
 	if (combination_has_p2p && combination_has_mgd) {
-		info->p2p_concurrent = 1;
-		info->num_multichan_concurrent =
+		int num_channels =
 			nla_get_u32(tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]);
-		return 1;
+
+		info->p2p_concurrent = 1;
+		if (info->num_multichan_concurrent < num_channels)
+			info->num_multichan_concurrent = num_channels;
 	}
 
 	return 0;