From patchwork Thu May 28 06:25:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 6496261 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 326629F38D for ; Thu, 28 May 2015 06:26:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B4EB206FF for ; Thu, 28 May 2015 06:26:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 29720206B5 for ; Thu, 28 May 2015 06:26:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752303AbbE1G01 (ORCPT ); Thu, 28 May 2015 02:26:27 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:15598 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751772AbbE1G0Y (ORCPT ); Thu, 28 May 2015 02:26:24 -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=1432794385; x=1464330385; h=from:to:cc:subject:date:message-id:mime-version; bh=P0bTcdOJLnWgzxjoQv0VVhd/0qOiM3bETCoPVCTOn5Q=; b=O494yZ57uilWQdb4A/IDEIH7moe5TVCBdS2wCT6NOrmqjMno4D7triTS u5B/s9w4bUknMwyEQeylLGZkOPvBBAL6a3oCYTqWwS1TPctjIbF/DspEb T9UQFs/LOv2uQfS+htdxqPfurhsw4IxpuBTo2jc9ZxRBDqZEXeUAoujpQ w=; X-IronPort-AV: E=McAfee;i="5700,7163,7814"; a="212981629" Received: from ironmsg03-l.qualcomm.com ([172.30.48.18]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 May 2015 23:26:23 -0700 X-IronPort-AV: E=Sophos;i="5.13,511,1427785200"; d="scan'208";a="921045264" Received: from nasanexm02c.na.qualcomm.com ([10.85.0.43]) by Ironmsg03-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 27 May 2015 23:26:22 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM02C.na.qualcomm.com (10.85.0.43) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Wed, 27 May 2015 23:26:21 -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, 28 May 2015 11:56:12 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Thu, 28 May 2015 11:56:03 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH v2 1/2] nl80211: Add support to configure low ack threshold Date: Thu, 28 May 2015 11:55:54 +0530 Message-ID: <1432794355-3639-1-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.4.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm01a.na.qualcomm.com (10.85.0.81) 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 | 9 +++++++++ net/wireless/nl80211.c | 13 +++++++++++++ 3 files changed, 25 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index f8d6813..4e42b09 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -812,6 +812,8 @@ enum station_parameters_apply_mask { * @supported_oper_classes_len: number of supported operating classes * @opmode_notif: operating mode field from Operating Mode Notification * @opmode_notif_used: information if operating mode field is used + * @low_ack_threshold: number of consecutive frames not being ACKed by + * station, used to trigger low_ack event. */ struct station_parameters { const u8 *supported_rates; @@ -837,6 +839,7 @@ struct station_parameters { u8 supported_oper_classes_len; u8 opmode_notif; bool opmode_notif_used; + u16 low_ack_threshold; }; /** diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 241220c..9ab3b01 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -1761,6 +1761,10 @@ enum nl80211_commands { * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device * is operating in an indoor environment. * + * @NL80211_ATTR_STA_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_STA_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..9ca2c18 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_STA_LOW_ACK_THRESH] = { .type = NLA_U16 }, }; /* policy for the key attributes */ @@ -4281,6 +4282,12 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) params.local_pm = pm; } + if (info->attrs[NL80211_ATTR_STA_LOW_ACK_THRESH]) + params.low_ack_threshold = nla_get_u16( + info->attrs[NL80211_ATTR_STA_LOW_ACK_THRESH]); + else + params.low_ack_threshold = NL80211_DEFAULT_LOW_ACK_THRESH; + /* Include parameters for TDLS peer (will check later) */ err = nl80211_set_station_tdls(info, ¶ms); if (err) @@ -4389,6 +4396,12 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) return -EINVAL; } + if (info->attrs[NL80211_ATTR_STA_LOW_ACK_THRESH]) + params.low_ack_threshold = nla_get_u16( + info->attrs[NL80211_ATTR_STA_LOW_ACK_THRESH]); + else + params.low_ack_threshold = NL80211_DEFAULT_LOW_ACK_THRESH; + err = nl80211_parse_sta_channel_info(info, ¶ms); if (err) return err;