Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp31127pxf; Tue, 6 Apr 2021 14:05:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJxtBiP7oFzJ9TvS6RKVs4zuh1PGkMyxXu4X15xcZvIPWmUMlOIAIhB/rwJaMyTb0cD6FN X-Received: by 2002:a17:907:1b20:: with SMTP id mp32mr36507750ejc.495.1617743148175; Tue, 06 Apr 2021 14:05:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617743148; cv=none; d=google.com; s=arc-20160816; b=c9nu4NR07c4yMURL46c2fAJUzaSqA8andomnpPQyzBY4KUBvt2GjYnwHR5wzR9JdBk OCV+uSNikBMnJbVPC7Ge8QEYFlIZ4dE2GNtV6Fjf7ldiTfnrPAKU8AiKBwx73q4QV+Lo uFP40wkBBse67M7KuyCOWOKwzHUr8PGX/iQ56RcdJ4LAopowmZNbkJa435BFv7PhMFrn 6VL3mt05+LHG8wylBrvOgUB5sHdWKTLAxOLpMIEdyzPhmCsqna/E9+Z+OU4ESju6oRXM VbinNLsqvBQQJGlj0+/M/SrkCJ8vI/G1FbX+aY0ZZ/FXYfoot07f7ozkoCjq/qIUZXZb 4+Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=FfDwPhAqI5cYlTlL+pwTRkyCM50qxoC+K2QWpKVcqP8=; b=CURRf5mqGdb2Dm6lD5mngIsfwoFtRSLyI9FbmQFq8HIlUbs1JhNmbPjMXaJqo9w1M0 TU2/0TbKKSZ3nl9ABDSrSqU6ehYWOb6KK7135dnV1W5egSIHput9ya2r03TrpixnDnna eneQdBlKL3/DzK7HpkIhOS5NWK3ASkpQyApcXqZ8E0Vjbz1LjYl0bMziXx5l9T9c36tA gaHXFaeIP4TTDH6Jwa9CL7UrR2TSYrfG+g2vaevHcYuaep2694yVfcTIf6Aup0XnMLgF VY8aUfFmOTKZ1VGBoCAUlsbdnh+pQkKs1pQIUCC1/JRtIjeuVg/Ne5RdxvZC2oKrKPef xO9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 m22si5892038ejr.495.2021.04.06.14.05.24; Tue, 06 Apr 2021 14:05:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343689AbhDFMHA (ORCPT + 99 others); Tue, 6 Apr 2021 08:07:00 -0400 Received: from vps-vb.mhejs.net ([37.28.154.113]:41686 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232861AbhDFMG7 (ORCPT ); Tue, 6 Apr 2021 08:06:59 -0400 Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.93.0.4) (envelope-from ) id 1lTkTj-0002Tk-UG; Tue, 06 Apr 2021 14:06:43 +0200 To: Kalle Valo Cc: Ping-Ke Shih , Johannes Berg , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Larry Finger References: <846f6166-c570-01fc-6bbc-3e3b44e51327@maciej.szmigiero.name> <87r1jnohq6.fsf@codeaurora.org> From: "Maciej S. Szmigiero" Subject: Re: rtlwifi/rtl8192cu AP mode broken with PS STA Message-ID: <8e0434eb-d15f-065d-2ba7-b50c67877112@maciej.szmigiero.name> Date: Tue, 6 Apr 2021 14:06:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <87r1jnohq6.fsf@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06.04.2021 12:00, Kalle Valo wrote: > "Maciej S. Szmigiero" writes: > >> On 29.03.2021 00:54, Maciej S. Szmigiero wrote: >>> Hi, >>> >>> It looks like rtlwifi/rtl8192cu AP mode is broken when a STA is using PS, >>> since the driver does not update its beacon to account for TIM changes, >>> so a station that is sleeping will never learn that it has packets >>> buffered at the AP. >>> >>> Looking at the code, the rtl8192cu driver implements neither the set_tim() >>> callback, nor does it explicitly update beacon data periodically, so it >>> has no way to learn that it had changed. >>> >>> This results in the AP mode being virtually unusable with STAs that do >>> PS and don't allow for it to be disabled (IoT devices, mobile phones, >>> etc.). >>> >>> I think the easiest fix here would be to implement set_tim() for example >>> the way rt2x00 driver does: queue a work or schedule a tasklet to update >>> the beacon data on the device. >> >> Are there any plans to fix this? >> The driver is listed as maintained by Ping-Ke. > > Yeah, power save is hard and I'm not surprised that there are drivers > with broken power save mode support. If there's no fix available we > should stop supporting AP mode in the driver. > https://wireless.wiki.kernel.org/en/developers/documentation/mac80211/api clearly documents that "For AP mode, it must (...) react to the set_tim() callback or fetch each beacon from mac80211". The driver isn't doing either so no wonder the beacon it is sending isn't getting updated. As I have said above, it seems to me that all that needs to be done here is to queue a work in a set_tim() callback, then call send_beacon_frame() from rtlwifi/core.c from this work. But I don't know the exact device semantics, maybe it needs some other notification that the beacon has changed, too, or even tries to manage the TIM bitmap by itself. It would be a shame to lose the AP mode for such minor thing, though. I would play with this myself, but unfortunately I don't have time to work on this right now. That's where my question to Realtek comes: are there plans to actually fix this? Maciej