From e3e234fa359803611845dc1aa1aa01340aa6a705 Mon Sep 17 00:00:00 2001 From: Wei-Jen Lin Date: Tue, 28 Aug 2012 19:31:58 +0300 Subject: [PATCH] nl80211: Set P2P multichan concurrency based on interface combinations Use the NL80211_IFACE_COMB_NUM_CHANNELS value > 1 as a trigger for enabling support for P2P multichannel channel concurrency. This does not handle all possible details of enforcing driver capabilities, but it is a good first step for allowing nl80211 drivers to enable multichannel concurrency. Signed-hostap: Jouni Malinen --- src/drivers/driver_nl80211.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 513293ed0..47e9b7869 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2377,7 +2377,7 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); struct wiphy_info_data *info = arg; int p2p_go_supported = 0, p2p_client_supported = 0; - int p2p_concurrent = 0; + int p2p_concurrent = 0, p2p_multichan_concurrent = 0; int auth_supported = 0, connect_supported = 0; struct wpa_driver_capa *capa = info->capa; static struct nla_policy @@ -2478,6 +2478,8 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) if (combination_has_p2p && combination_has_mgd) { p2p_concurrent = 1; + if (nla_get_u32(tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]) > 1) + p2p_multichan_concurrent = 1; break; } @@ -2545,6 +2547,13 @@ broken_combination: "interface (driver advertised support)"); capa->flags |= WPA_DRIVER_FLAGS_P2P_CONCURRENT; capa->flags |= WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P; + + if (p2p_multichan_concurrent) { + wpa_printf(MSG_DEBUG, "nl80211: Enable multi-channel " + "concurrent (driver advertised support)"); + capa->flags |= + WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT; + } } if (tb[NL80211_ATTR_TDLS_SUPPORT]) {