From patchwork Thu Nov 3 09:59:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 9410661 X-Patchwork-Delegate: johannes@sipsolutions.net 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 548D660585 for ; Thu, 3 Nov 2016 09:59:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4030E2A8CE for ; Thu, 3 Nov 2016 09:59:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34BFC2A8E3; Thu, 3 Nov 2016 09:59:47 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 243F72A8CE for ; Thu, 3 Nov 2016 09:59:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754627AbcKCJ7o (ORCPT ); Thu, 3 Nov 2016 05:59:44 -0400 Received: from nbd.name ([46.4.11.11]:48734 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252AbcKCJ7n (ORCPT ); Thu, 3 Nov 2016 05:59:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Message-Id:Date:Subject:Cc:To:From; bh=mxbGQOnEf88G5aiYv0if7tjAA5VfHMS87Nv4mfuAWtY=; b=jhL3w2nO35LmR0kQva0KxY+YhIKBX/9TUc0JcLmrkt0Gv0Za5cGymt40xyADs1RsSKXMyxeu4EVfMzON5NistHo6pxuGG5WSM1nyLd250m/vhNHQ4uujlTWaWgLU6ZUB+0rpLMzkwaGoUIz85q0e5lemGYjnEJbXAQY4rmzLN5Q=; Received: by nf-4.local (Postfix, from userid 501) id 439DD16905301; Thu, 3 Nov 2016 10:59:38 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, emmanuel.grumbach@intel.com Subject: [PATCH] mac80211: fix broken AP mode handling of powersave clients Date: Thu, 3 Nov 2016 10:59:38 +0100 Message-Id: <20161103095938.84054-1-nbd@nbd.name> X-Mailer: git-send-email 2.10.1 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 Commit c68df2e7be0c ("mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE") introduced a logic error, where __sta_info_recalc_tim turns into a no-op if local->ops->set_tim is not set. This prevents the beacon TIM bit from being set for all drivers that do not implement this op (almost all of them), thus thoroughly essential AP mode powersave functionality. Cc: Emmanuel Grumbach Fixes: c68df2e7be0c ("mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE") Signed-off-by: Felix Fietkau --- net/mac80211/sta_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 236d47e..621734e 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -688,7 +688,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending) } /* No need to do anything if the driver does all */ - if (!local->ops->set_tim) + if (local->ops->set_tim) return; if (sta->dead)