All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [RFC 1/2] nl80211: Add support to configure low ack threshold
Date: Wed, 04 Mar 2015 09:14:39 +0100	[thread overview]
Message-ID: <1425456879.1810.1.camel@sipsolutions.net> (raw)
In-Reply-To: <1425385383-25482-1-git-send-email-rmanohar@qti.qualcomm.com>

On Tue, 2015-03-03 at 17:53 +0530, Rajkumar Manoharan wrote:

> @@ -696,6 +698,7 @@ struct cfg80211_ap_settings {
>  	u8 p2p_ctwindow;
>  	bool p2p_opp_ps;
>  	const struct cfg80211_acl_data *acl;
> +	int low_ack_threshold;

should probably be unsigned?

>  };
>  
>  /**
> diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
> index 68b294e..40df4b1 100644
> --- a/include/uapi/linux/nl80211.h
> +++ b/include/uapi/linux/nl80211.h
> @@ -219,7 +219,8 @@
>   *	%NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
>   *	%NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
>   *	%NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,
> - *	%NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
> + *	%NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS
> + *	%NL80211_ATTR_LOW_ACK_THRESH.
>   *	The channel to use can be set on the interface or be given using the
>   *	%NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
>   * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
> @@ -1740,6 +1741,9 @@ enum nl80211_commands {
>   * @NL80211_ATTR_SCHED_SCAN_DELAY: delay before a scheduled scan (or a
>   *	WoWLAN net-detect scan) is started, u32 in seconds.
>   *
> + * @NL80211_ATTR_LOW_ACK_THRESH: number of consecutive frames that are not ACKed
> + *	by station. This threshold is used to generate low ack event by driver.
> + *
>   * @NUM_NL80211_ATTR: total number of nl80211_attrs available
>   * @NL80211_ATTR_MAX: highest attribute number currently defined
>   * @__NL80211_ATTR_AFTER_LAST: internal use
> @@ -2107,6 +2111,8 @@ enum nl80211_attrs {
>  
>  	NL80211_ATTR_SCHED_SCAN_DELAY,
>  
> +	NL80211_ATTR_LOW_ACK_THRESH,
> +
>  	/* add attributes here, update the policy in nl80211.c */
>  
>  	__NL80211_ATTR_AFTER_LAST,
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index e9ad9d9..80a90c7 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -399,6 +399,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
>  	[NL80211_ATTR_WIPHY_SELF_MANAGED_REG] = { .type = NLA_FLAG },
>  	[NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 },
>  	[NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 },
> +	[NL80211_ATTR_LOW_ACK_THRESH] = { .type = NLA_U16 },
>  };
>  
>  /* policy for the key attributes */
> @@ -3434,6 +3435,11 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
>  		params.smps_mode = NL80211_SMPS_OFF;
>  	}
>  
> +	if (info->attrs[NL80211_ATTR_LOW_ACK_THRESH]) {
> +		params.low_ack_threshold = nla_get_u16(
> +			info->attrs[NL80211_ATTR_LOW_ACK_THRESH]);
> +	}

I think you should provide a sane default value if userspace doesn't
request anything. Also - braces aren't needed here.

johannes


      parent reply	other threads:[~2015-03-04  8:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 12:23 [RFC 1/2] nl80211: Add support to configure low ack threshold Rajkumar Manoharan
2015-03-03 12:23 ` [RFC 2/2] mac80211: store low ack threshold in bss config Rajkumar Manoharan
2015-03-04  8:15   ` Johannes Berg
2015-03-04  8:14 ` Johannes Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425456879.1810.1.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rmanohar@qti.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.