diff mbox

[4/6] nl80211: user_mpm overrides auto_open_plinks

Message ID 1362204172-28307-4-git-send-email-thomas@cozybit.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Thomas Pedersen March 2, 2013, 6:02 a.m. UTC
If the user requested a userspace MPM, automatically
disable auto_open_plinks to fully disable the kernel MPM.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
 include/uapi/linux/nl80211.h |    6 ++++--
 net/wireless/nl80211.c       |    3 +++
 2 files changed, 7 insertions(+), 2 deletions(-)

Comments

Johannes Berg March 4, 2013, 3:10 p.m. UTC | #1
On Fri, 2013-03-01 at 22:02 -0800, Thomas Pedersen wrote:
> If the user requested a userspace MPM, automatically
> disable auto_open_plinks to fully disable the kernel MPM.
> 
> Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
> ---
>  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 e3f2489..bd73231 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -7422,6 +7422,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;

Maybe you should reject the invalid configuration instead?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Pedersen March 4, 2013, 8:04 p.m. UTC | #2
On Mon, Mar 4, 2013 at 7:10 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Fri, 2013-03-01 at 22:02 -0800, Thomas Pedersen wrote:
>> If the user requested a userspace MPM, automatically
>> disable auto_open_plinks to fully disable the kernel MPM.
>>
>> Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
>> ---
>>  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 e3f2489..bd73231 100644
>> --- a/net/wireless/nl80211.c
>> +++ b/net/wireless/nl80211.c
>> @@ -7422,6 +7422,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;
>
> Maybe you should reject the invalid configuration instead?

But then if the user wants "userspace MPM" they have to select that
and disable auto_open_plinks as well. I think if the user wants his
own MPM, the kernel should be smart enough to completely disable its
own.
Johannes Berg March 4, 2013, 8:07 p.m. UTC | #3
On Mon, 2013-03-04 at 12:04 -0800, Thomas Pedersen wrote:

> >> +     if (setup.user_mpm)
> >> +             cfg.auto_open_plinks = false;
> >
> > Maybe you should reject the invalid configuration instead?
> 
> But then if the user wants "userspace MPM" they have to select that
> and disable auto_open_plinks as well. I think if the user wants his
> own MPM, the kernel should be smart enough to completely disable its
> own.

Ok, fair enough.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 e3f2489..bd73231 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7422,6 +7422,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)