Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp389603pxb; Wed, 27 Jan 2021 10:05:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxg6glhTe2AHJMWKA+AfwIE14vOMxqIP07+NfTFBDEHmuqap3QgXw5X5zYClUn/aNUW6xSY X-Received: by 2002:a05:6402:438d:: with SMTP id o13mr10007010edc.135.1611770700999; Wed, 27 Jan 2021 10:05:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611770700; cv=none; d=google.com; s=arc-20160816; b=VOvBvkFpdjWAnZibIMYy82fv5nInQ8TztvqIVxiJTVSjZ3lELprchfTj8cmUddqunG u07Jvfq5TazLu2ef2+MIEejMavWeUgZ1yXS48c05e36JSnRdBZr4JzDylxFF9OqyGBw9 +qXqqI2QjHQAq0bhM7MXS31dyw1XZy6MMMZitNW1c62l2NiyE777Tpaff1c5/S64XUF9 w3YMfjPsknWDnWYn+zvkneoBLwAxDXGXjuRAkiM77p0TNY2/pVOhVmWTNi3P3H/a98v8 8Oa73F3HChwgvguMXbS3ujpGx90mN5jKjxGpVGQaHWEGWLNrp8FpeL/6poPt+jhN5EwR MFyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dmarc-filter:sender :dkim-signature; bh=Aa8Yz4TOcxxy5SMMiNekghF7jVfm6er9unCPcWAijYw=; b=NwyZW7UFCt6jOiCmSKpOJZxE2FRryiEmtMVJOBP057WDTxj8PKK6X58JQCnuVbLqdO 46JBsngKZqoxXWwodQ1nCGdbm7tWIKfM4ZQdIVX+de4gwa85xyJms85plfwIEIRWsbtn 1lvV2BnVGKo8tv/IvCFqLyY7s1cTCXHwoGoGJKLZhoy3IxvTfM1o8Tf0LAKxv3ssUM4N Kok870e+WdyQcTXn/H1MB/stdM0yCS28XE7BSoLhDwmf4CBB2FY4fr+40Yo475aw2b6S +lF0pT1MmybFKe29y1qAEapEY6jgpJIGqctVnduToFOEH/6HA9Pf3C7U9UeFchkHsEzV nB9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=vgVGXoPr; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si1360030edn.332.2021.01.27.10.04.29; Wed, 27 Jan 2021 10:05:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=vgVGXoPr; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344044AbhA0SDM (ORCPT + 99 others); Wed, 27 Jan 2021 13:03:12 -0500 Received: from m42-8.mailgun.net ([69.72.42.8]:36766 "EHLO m42-8.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344062AbhA0SDI (ORCPT ); Wed, 27 Jan 2021 13:03:08 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1611770564; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=Aa8Yz4TOcxxy5SMMiNekghF7jVfm6er9unCPcWAijYw=; b=vgVGXoPrb5CtNzUWA9X6p1MHnoM/KywJjuyC1OQeauHUwcJ2Gk9Kqoqhxjq61TkX8W3/dAwV SelLT9hk7F9cZBbvNQ8wwYX1o0/pEBihBoPpdAfDgpP/LbvnykMGbDlxYyoOrCYmM25Pokoe vF03/zvG8Qo0mLeXkQWono/fZJE= X-Mailgun-Sending-Ip: 69.72.42.8 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-east-1.postgun.com with SMTP id 6011aaa5d75e1218e3047678 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 27 Jan 2021 18:02:13 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B4105C433CA; Wed, 27 Jan 2021 18:02:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 41DC6C433ED; Wed, 27 Jan 2021 18:02:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 41DC6C433ED Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Venkateswara Naralasetty Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Subject: Re: [PATCHv2 2/2] ath11k: Add ap power save support References: <1598257589-19091-1-git-send-email-vnaralas@codeaurora.org> <1598257589-19091-2-git-send-email-vnaralas@codeaurora.org> Date: Wed, 27 Jan 2021 20:02:08 +0200 In-Reply-To: <1598257589-19091-2-git-send-email-vnaralas@codeaurora.org> (Venkateswara Naralasetty's message of "Mon, 24 Aug 2020 13:56:29 +0530") Message-ID: <87h7n28di7.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Venkateswara Naralasetty writes: > AP power save where AP goes to power save mode when no stations associate > to it and come out of power save when any station associate to AP. > > This AP power save capability can be used to save power with the drawback > of reduced range or delayed discovery of the AP > > This patch also porvides user configuration to enable/disable > this feature using vendor command. This feature is disabled by default. > > Tested-on: IPQ8074 WLAN.HK.2.1.0.1-01228-QCAHKSWPL_SILICONZ-1 > > Signed-off-by: Venkateswara Naralasetty [...] > +static int ath11k_vendor_set_wifi_config(struct wiphy *wihpy, s/wihpy/wiphy/ > + struct wireless_dev *wdev, > + const void *data, > + int data_len) > +{ > + struct ieee80211_vif *vif; > + struct ath11k_vif *arvif; > + struct ath11k *ar; > + struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1]; > + int ret = 0; > + > + if (!wdev) > + return -EINVAL; > + > + vif = wdev_to_ieee80211_vif(wdev); > + if (!vif) > + return -EINVAL; > + > + arvif = (struct ath11k_vif *)vif->drv_priv; > + if (!arvif) > + return -EINVAL; > + > + ar = arvif->ar; > + > + mutex_lock(&ar->conf_mutex); > + > + ret = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX, data, data_len, > + ath11k_vendor_set_wifi_config_policy, NULL); > + if (ret) { > + ath11k_warn(ar->ab, "invalid set wifi config policy attribute\n"); > + goto exit; > + } > + > + ar->ap_ps_enabled = nla_get_flag(tb[QCA_WLAN_VENDOR_ATTR_CONFIG_GTX]); > + ret = ath11k_mac_ap_ps_recalc(ar); > + if (ret) { > + ath11k_warn(ar->ab, "failed to send ap ps ret %d\n", ret); > + goto exit; > + } > + > +exit: > + mutex_unlock(&ar->conf_mutex); > + return ret; > +} Something which I find awkward here is that this is per pdev (=all vdevs), even though the vendor command is per vif. So if you change the config on one vif, all other vifs will change as well. And there's no way to check if the state from user space as there's only a set command and no equivalent get command. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches