From patchwork Mon Mar 4 21:06:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Pedersen X-Patchwork-Id: 2214541 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 64718DF2F2 for ; Mon, 4 Mar 2013 21:08:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932481Ab3CDVIB (ORCPT ); Mon, 4 Mar 2013 16:08:01 -0500 Received: from mail-pb0-f48.google.com ([209.85.160.48]:37307 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932328Ab3CDVIA (ORCPT ); Mon, 4 Mar 2013 16:08:00 -0500 Received: by mail-pb0-f48.google.com with SMTP id wy12so3404999pbc.7 for ; Mon, 04 Mar 2013 13:07:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=fP65/LSF3vck0T1y1Am0KqGtlZLkrUqKWlOJouuFmf4=; b=Q1lertYMEna3UGXYTbslsmcSObK8ng2KdIZTtsfjM424mBiby79b4pagjpFQrzTLYX iNYiNgjYhgtrwOlH6nbkyjkcUury2hCbsVKpkK39nFhwAsPsgSKb5pemXJME+tuNg+fH cuLO4UHPWbKEF3Kb1re4q20ZorFzsBVCvmWF8JrVYx1OoS0+xj2UUa6cXVPSOCJ44pom mN87IMEJG09cVRX1RSgI00CXNpvlDKfFFag9XiZHEHCIIJ/KF822ZXUUXJk+WIz8J6jc cZyCmTwq2HRIpKmEST3NTv6yFsQdnhI3D6NzJXmiAs0Q9cI5rgQ9oeatE2Cz07ALgdgg IUgQ== X-Received: by 10.68.241.102 with SMTP id wh6mr31485067pbc.150.1362431279297; Mon, 04 Mar 2013 13:07:59 -0800 (PST) Received: from cable.lan (70-35-43-50.static.wiline.com. [70.35.43.50]) by mx.google.com with ESMTPS id tm1sm23643807pbc.11.2013.03.04.13.07.57 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Mar 2013 13:07:58 -0800 (PST) From: Thomas Pedersen To: johannes@sipsolution.net Cc: linux-wireless@vger.kernel.org, Thomas Pedersen Subject: [PATCH v2 4/5] nl80211: user_mpm overrides auto_open_plinks Date: Mon, 4 Mar 2013 13:06:13 -0800 Message-Id: <1362431174-4747-4-git-send-email-thomas@cozybit.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1362431174-4747-1-git-send-email-thomas@cozybit.com> References: <1362431174-4747-1-git-send-email-thomas@cozybit.com> X-Gm-Message-State: ALoCoQls7sixLaQN/wO4MEumxVOBr0jw4vOJL6mS4hEwrd+rACBZ11De0fjQ3zFtDKYZZjFf0VJ9 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If the user requested a userspace MPM, automatically disable auto_open_plinks to fully disable the kernel MPM. Signed-off-by: Thomas Pedersen --- include/uapi/linux/nl80211.h | 6 ++++-- net/wireless/nl80211.c | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 8134c6a..79da871 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -2467,8 +2467,10 @@ enum nl80211_mesh_power_mode { * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh * point. * - * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically - * open peer links when we detect compatible mesh peers. + * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically open + * peer links when we detect compatible mesh peers. Disabled if + * @NL80211_MESH_SETUP_USERSPACE_MPM or @NL80211_MESH_SETUP_USERSPACE_AMPE are + * set. * * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames * containing a PREQ that an MP can send to a particular destination (path diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index eca897a..ddd251b 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -7427,6 +7427,9 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info) return err; } + if (setup.user_mpm) + cfg.auto_open_plinks = false; + if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) { err = nl80211_parse_chandef(rdev, info, &setup.chandef); if (err)