From patchwork Tue Apr 10 15:04:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Rebbagondla X-Patchwork-Id: 10333307 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D18576053B for ; Tue, 10 Apr 2018 15:02:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C195C285C5 for ; Tue, 10 Apr 2018 15:02:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C065128861; Tue, 10 Apr 2018 15:02:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40258285C5 for ; Tue, 10 Apr 2018 15:01:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754313AbeDJPBu (ORCPT ); Tue, 10 Apr 2018 11:01:50 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:46833 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754296AbeDJPBt (ORCPT ); Tue, 10 Apr 2018 11:01:49 -0400 Received: by mail-pl0-f67.google.com with SMTP id 59-v6so7683348plc.13 for ; Tue, 10 Apr 2018 08:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tA+S5+FNlK1z69Ad0y60LzCkRfIPESX+I3ilhGUa7eU=; b=CwhkKsZDyjEvfNwntxrBKnl5+DmJpoKZqGZH3ec3gxvBKtBElUiS1rlsaFUjzXB2B1 n/2WjRw5L1lzfO2KyQyrhczKpED+x63HGFBhu8U+XJNdzbl1kmDPqgkIXO5h9D4hE8oJ 4RXL+c3ks+xt2muZ9+rJ7pC8ri4/fk1wjxfOylbHLyd4RoztuOuRQLX5NCw3ZNOzpQ/a 0qOKdPBgEuvxvMZmZo9xfIZRCaPWV/v0tNpFzOtIZvcSwBvgrbrd4lXGufWXeenlqOdk O0Uh8wu5Z2Z/QhuC7Z4FRFck/lP8BZUQk3/a1QBmREdBYHx8TH/NiQzk9wQgageb2r27 cpIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tA+S5+FNlK1z69Ad0y60LzCkRfIPESX+I3ilhGUa7eU=; b=svEioSRGQIjnRmwbq7mzUMK8S5hCPe7Rp/7CZq8JywoT32nTlkhg95Q2xFMTRb2C9/ uWXcvuSIzRYzybCu4swTuhKYlyqZHLnzFrp8bceYJOMVLyBkfLIRgP+V83ZPdFPnPYhc DAsRrMPYJqcNSHRUKAlJ+G67nqde2MMiZ413Y9FN1Lxi2zB0sjH17RYJcSEYnYZ72x1B 4St1mJKSyo/RYoQeT8VdDzt0qPXI9DGeqNsQOWEpH6Zh4AUL3PdPzx+jM8/zOjLdJv2t hNT9jHGrszRNbisy4VTeZw4i+7Am6azm8OwkfLjqpnxAjc3ksWCZuy63NAAlX6rGxKiJ 3v6A== X-Gm-Message-State: ALQs6tB0PR0G5AcRd4nmXT2PQzGi5ej2MGJjtziRd03bbM4lonrIf6cA wvzlE0sXJozmB67fZvkyWIY= X-Google-Smtp-Source: AIpwx4+aqHp8VWJZ67CIThcngzIjDGLDSvkQDP4FjJ6DtqVWTnhcLOPJHmLf6NpL4g+z5R8AzFmFsw== X-Received: by 2002:a17:902:5a5:: with SMTP id f34-v6mr844585plf.288.1523372508573; Tue, 10 Apr 2018 08:01:48 -0700 (PDT) Received: from cpu459.localdomain ([203.196.161.90]) by smtp.gmail.com with ESMTPSA id a1sm5913864pff.5.2018.04.10.08.01.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Apr 2018 08:01:47 -0700 (PDT) From: Siva Rebbagondla To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Siva Rebbagondla , Sushant Mishra Subject: [v2 3/7] rsi: use appropriate interface for power save configuration Date: Tue, 10 Apr 2018 20:34:13 +0530 Message-Id: <1523372657-6067-4-git-send-email-siva8118@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1523372657-6067-1-git-send-email-siva8118@gmail.com> References: <1523372657-6067-1-git-send-email-siva8118@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Amitkumar Karwar Power save request should be sent on station interface. Virtual interface which is connected should be preferred. This patch resolves device not entering power save problem in certain situations Signed-off-by: Amitkumar Karwar Signed-off-by: Siva Rebbagondla --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index 5edc3a9..77aa3bb 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -614,7 +614,7 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw, /* Power save parameters */ if (changed & IEEE80211_CONF_CHANGE_PS) { - struct ieee80211_vif *vif; + struct ieee80211_vif *vif, *sta_vif = NULL; unsigned long flags; int i, set_ps = 1; @@ -628,13 +628,17 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw, set_ps = 0; break; } + if ((vif->type == NL80211_IFTYPE_STATION || + vif->type == NL80211_IFTYPE_P2P_CLIENT) && + (!sta_vif || vif->bss_conf.assoc)) + sta_vif = vif; } - if (set_ps) { + if (set_ps && sta_vif) { spin_lock_irqsave(&adapter->ps_lock, flags); if (conf->flags & IEEE80211_CONF_PS) - rsi_enable_ps(adapter, vif); + rsi_enable_ps(adapter, sta_vif); else - rsi_disable_ps(adapter, vif); + rsi_disable_ps(adapter, sta_vif); spin_unlock_irqrestore(&adapter->ps_lock, flags); } }