Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5734627ybi; Wed, 31 Jul 2019 02:30:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyowK9AHHD7/X5FP4DWkfcUjsaPIfl+OK1/A/AD1Yo7KjLJJ3+ApSuRaeDOoE6QH6so0zZv X-Received: by 2002:a62:e308:: with SMTP id g8mr48559247pfh.162.1564565409131; Wed, 31 Jul 2019 02:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564565409; cv=none; d=google.com; s=arc-20160816; b=BQELmp3yYxgJr+CZXHEiJTCabJfkL0RtohshRBG0oMuWTiGejvmRx6EKCWE0wvJSfS /T30+lRCL+xb7n6Ajp0dkZZ2XRYOP+XJ2SJbGy+ctQLrC7dPLETNg7QvdNqMqi7Qth5T /AgHzRo7eh4Bq+UsVughMdGHQiwbos3+ahmS6EsmTvfGkFp1MyRjtwOIpQc/C9G2Jbfg Xj/L5qpmYFtGq+N4ISPQzZ247jr4VIaXL8sJqY7J5HvBAdaZYe9S22+uOwxljlukJ7bu BLdwlHWUCHv8FajjVqXpqi7oh59XfoYfzXhq92ElzVAgulDs998Szk9n4GlMcvFAp2BZ /Zyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=rEWHYQsXQnfTPjkoVjzk1pgD7BtvMdcp+rMhtzVvqTo=; b=lRSMeqlHRK+naeD4v7tgmQurcOVMVsBLpmHiJood4shvSOyPsZ/7w5+fRxm8Wn/aAT uxVf/1sUT075B1H7vAYYDanKJESboQDLN2Ad2E0dhqoWg+bbXOdS9/ImWFmhoeuNLU8T 96IM8bWX2c83xXBbYeezmc1NoF5CQoB6SwTpfXa2KJyzSeZeB7gnmog+yAQ4vHun5hY6 uZufYcE2rxMFJW2YXlHEaSFkPJAm/MkeJU6FS5qGK9AYXPx2Gk0iIrGncOssO0eRh2fX x5/OJVCHEVTSGw8t45kT+DNvTwNSKpagWOfgG0IgRtLD3zWr3Lpm73tqQSSlnLUBIAr6 4mMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y21si28238474plp.332.2019.07.31.02.29.54; Wed, 31 Jul 2019 02:30:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727987AbfGaJ2N (ORCPT + 99 others); Wed, 31 Jul 2019 05:28:13 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:55498 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727209AbfGaJ2N (ORCPT ); Wed, 31 Jul 2019 05:28:13 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hsku1-0004eq-4J; Wed, 31 Jul 2019 11:28:09 +0200 Message-ID: <1077c62701b31cfcb4436e6b13be64ade6b1ae1b.camel@sipsolutions.net> Subject: Re: [PATCHv6 3/9] nl80211: Add netlink attribute for AMPDU aggregation enable/disable From: Johannes Berg To: Tamizh chelvam , ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Date: Wed, 31 Jul 2019 11:28:08 +0200 In-Reply-To: <1560835632-17405-4-git-send-email-tamizhr@codeaurora.org> References: <1560835632-17405-1-git-send-email-tamizhr@codeaurora.org> <1560835632-17405-4-git-send-email-tamizhr@codeaurora.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, 2019-06-18 at 10:57 +0530, Tamizh chelvam wrote: > > + if (!wiphy_ext_feature_isset(&rdev->wiphy, > + NL80211_EXT_FEATURE_PER_TID_AMPDU_CTRL)) { > + NL_SET_ERR_MSG_ATTR(extack, > + attrs[NL80211_TID_ATTR_CONFIG_AMPDU_CTRL], > + "TID specific configuration not " > + "supported"); > + return -ENOTSUPP; > + } > + > + if (peer && !wiphy_ext_feature_isset(&rdev->wiphy, > + NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL)) { > + NL_SET_ERR_MSG_ATTR(extack, > + attrs[NL80211_TID_ATTR_CONFIG_AMPDU_CTRL], > + "peer specfic TID configuration not " > + "supported"); > + return -ENOTSUPP; > + } I think you should probably make this be a function to which you pass the attribute pointer and feature flags. err = nl80211_check_tid_config_supported(extack, attrs[NL80211_TID_ATTR_CONFIG_AMPDU_CTRL], NL80211_EXT_FEATURE_PER_TID_AMPDU_CTRL, NL80211_EXT_FEATURE_PER_STA_AMPDU_CTRL); since you have this code a lot? johannes