From patchwork Thu May 14 10:47:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 6404441 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 23A72BEEE1 for ; Thu, 14 May 2015 10:49:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FBDC20451 for ; Thu, 14 May 2015 10:49:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25CBF203AE for ; Thu, 14 May 2015 10:49:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932877AbbENKtI (ORCPT ); Thu, 14 May 2015 06:49:08 -0400 Received: from sabertooth02.qualcomm.com ([65.197.215.38]:56123 "EHLO sabertooth02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932742AbbENKtE (ORCPT ); Thu, 14 May 2015 06:49:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1431600544; x=1463136544; h=from:to:cc:subject:date:message-id:mime-version; bh=KMiUs2jPYK4CiAAGxL1ASFO9cs0FXFz1d/6BrXF/DS0=; b=K6S0lSBq2wSieuhD8eSepEIaJbbNo8dt+VYft/0qrZfSmoybok6gTTHq rgDKC/mLWv9S6DXQD97yJqTE1ucB6OE7DfKfkJjN3yty0xr0546AeSqIh Kgrjf7jRhwYQ9f+1xrKMNJWMs/XToTUuu4OkQ3aBVKtbWHAW/Sdyd1JOm U=; X-IronPort-AV: E=McAfee;i="5700,7163,7800"; a="89962701" Received: from ironmsg03-l.qualcomm.com ([172.30.48.18]) by sabertooth02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 May 2015 03:48:47 -0700 X-IronPort-AV: E=Sophos;i="5.13,427,1427785200"; d="scan'208";a="910361707" Received: from nasanexm01g.na.qualcomm.com ([10.85.0.33]) by Ironmsg03-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 14 May 2015 03:48:00 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM01G.na.qualcomm.com (10.85.0.33) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Thu, 14 May 2015 03:47:59 -0700 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Thu, 14 May 2015 16:17:50 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Thu, 14 May 2015 16:17:38 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH 1/2] nl80211: Add support to configure low ack threshold Date: Thu, 14 May 2015 16:17:35 +0530 Message-ID: <1431600456-10697-1-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.4.0 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) To aphydexm01b.ap.qualcomm.com (10.252.127.11) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a new nl80211 attribute to configure low ack threshold (number of consecutive frames) not being acked by station. This threshold is used to kickout station by driver through low ack event. This allows user to tune the parameter to improve robustness under noisy environment. Signed-off-by: Rajkumar Manoharan --- include/net/cfg80211.h | 3 +++ include/uapi/linux/nl80211.h | 11 ++++++++++- net/wireless/nl80211.c | 7 +++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index f8d6813..ae55d20 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -711,6 +711,8 @@ struct cfg80211_acl_data { * @p2p_opp_ps: P2P opportunistic PS * @acl: ACL configuration used by the drivers which has support for * MAC address based access control + * @low_ack_threshold: number of consecutive frames not being ACKed by + * station, used to trigger low_ack event. */ struct cfg80211_ap_settings { struct cfg80211_chan_def chandef; @@ -729,6 +731,7 @@ struct cfg80211_ap_settings { u8 p2p_ctwindow; bool p2p_opp_ps; const struct cfg80211_acl_data *acl; + u16 low_ack_threshold; }; /** diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 241220c..0986a98 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -232,7 +232,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 @@ -1761,6 +1762,9 @@ enum nl80211_commands { * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device * is operating in an indoor environment. * + * @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 @@ -2130,6 +2134,8 @@ enum nl80211_attrs { NL80211_ATTR_REG_INDOOR, + NL80211_ATTR_LOW_ACK_THRESH, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, @@ -4585,4 +4591,7 @@ enum nl80211_tdls_peer_capability { NL80211_TDLS_PEER_WMM = 1<<2, }; +/* Default low ack threshold for station kickout event */ +#define NL80211_DEFAULT_LOW_ACK_THRESH 50 + #endif /* __LINUX_NL80211_H */ diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index dd78445..7e7f96f 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -400,6 +400,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 }, [NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 }, [NL80211_ATTR_REG_INDOOR] = { .type = NLA_FLAG }, + [NL80211_ATTR_LOW_ACK_THRESH] = { .type = NLA_U16 }, }; /* policy for the key attributes */ @@ -3436,6 +3437,12 @@ 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]); + else + params.low_ack_threshold = NL80211_DEFAULT_LOW_ACK_THRESH; + wdev_lock(wdev); err = rdev_start_ap(rdev, dev, ¶ms); if (!err) {