From patchwork Tue Mar 3 12:23:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 5921911 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 2CA55BF440 for ; Tue, 3 Mar 2015 12:23:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C55420148 for ; Tue, 3 Mar 2015 12:23:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 457D02008F for ; Tue, 3 Mar 2015 12:23:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756514AbbCCMX3 (ORCPT ); Tue, 3 Mar 2015 07:23:29 -0500 Received: from sabertooth01.qualcomm.com ([65.197.215.72]:39939 "EHLO sabertooth01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756511AbbCCMX2 (ORCPT ); Tue, 3 Mar 2015 07:23:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1425385408; x=1456921408; h=from:to:cc:subject:date:message-id:mime-version; bh=Wei6pyITi4KVzx3vv5s+yRtdhwa8GFpieptrRWYR9AY=; b=Je5+lRsQCGlsvV2WTK3NRTDEUl+39SQs8eX4cfF79mDrgz++JV8V0pCo nYbZeeNm3vdP34+SaCV70FXXYs3r4XJa4rcaRNf8x86qsCwMknxhxK4m2 j1SthRBwvgIVAqpZ7aNLWhePArCYjBZr2qBtaTgiAY/gqoRJ2kCi5gEqg o=; X-IronPort-AV: E=McAfee;i="5600,1067,7728"; a="84146725" Received: from ironmsg01-lv.qualcomm.com ([10.47.202.180]) by sabertooth01.qualcomm.com with ESMTP; 03 Mar 2015 04:23:28 -0800 X-IronPort-AV: E=Sophos;i="5.09,681,1418112000"; d="scan'208";a="32511559" Received: from nasanexm02d.na.qualcomm.com ([10.85.0.44]) by ironmsg01-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 03 Mar 2015 04:23:27 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM02D.na.qualcomm.com (10.85.0.44) with Microsoft SMTP Server (TLS) id 15.0.995.29; Tue, 3 Mar 2015 04:23:26 -0800 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.995.29; Tue, 3 Mar 2015 04:23:17 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Tue, 03 Mar 2015 17:53:07 +0530 From: Rajkumar Manoharan To: CC: , , "Rajkumar Manoharan" Subject: [RFC 1/2] nl80211: Add support to configure low ack threshold Date: Tue, 3 Mar 2015 17:53:02 +0530 Message-ID: <1425385383-25482-1-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.3.1 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 | 8 +++++++- net/wireless/nl80211.c | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 64e09e1..29edb79 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -678,6 +678,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; @@ -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; }; /** 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]); + } + wdev_lock(wdev); err = rdev_start_ap(rdev, dev, ¶ms); if (!err) {