From patchwork Mon Sep 21 20:25:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Perminov X-Patchwork-Id: 49122 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8LKPQ24015713 for ; Mon, 21 Sep 2009 20:25:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753827AbZIUUZr (ORCPT ); Mon, 21 Sep 2009 16:25:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753803AbZIUUZr (ORCPT ); Mon, 21 Sep 2009 16:25:47 -0400 Received: from mx38.mail.ru ([94.100.176.52]:65262 "EHLO mx38.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208AbZIUUZr (ORCPT ); Mon, 21 Sep 2009 16:25:47 -0400 Received: from [62.176.9.132] (port=4582 helo=[192.168.1.199]) by mx38.mail.ru with asmtp id 1MppSH-000Fwe-00; Tue, 22 Sep 2009 00:25:49 +0400 Subject: [PATCH v2] mac80211: Fix [re]association power saving issue on AP side From: Igor Perminov To: "John W. Linville" Cc: Johannes Berg , Jouni Malinen , linux-wireless@vger.kernel.org Date: Tue, 22 Sep 2009 00:25:44 +0400 Message-Id: <1253564744.4477.18.camel@sunlight> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 X-Spam: Not detected X-Mras: Ok Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Consider the following step-by step: 1. A STA authenticates and associates with the AP and exchanges traffic. 2. The STA reports to the AP that it is going to PS state. 3. Some time later the STA device goes to the stand-by mode (not only its wi-fi card, but the device itself) and drops the association state without sending a disassociation frame. 4. The STA device wakes up and begins authentication with an Auth frame as it hasn't been authenticated/associated previously. At the step 4 the AP "remembers" the STA and considers it is still in the PS state, so the AP buffers frames, which it has to send to the STA. But the STA isn't actually in the PS state and so it neither checks TIM bits nor reports to the AP that it isn't power saving. Because of that authentication/[re]association fails. To fix authentication/[re]association stage of this issue, Auth, Assoc Resp and Reassoc Resp frames are transmitted disregarding of STA's power saving state. N.B. This patch doesn't fix further data frame exchange after authentication/[re]association. A patch in hostapd is required to fix that. Signed-off-by: Igor Perminov --- net/mac80211/tx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 10a1099..4d981e7 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -367,7 +367,10 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; u32 staflags; - if (unlikely(!sta || ieee80211_is_probe_resp(hdr->frame_control))) + if (unlikely(!sta || ieee80211_is_probe_resp(hdr->frame_control) + || ieee80211_is_auth(hdr->frame_control) + || ieee80211_is_assoc_resp(hdr->frame_control) + || ieee80211_is_reassoc_resp(hdr->frame_control))) return TX_CONTINUE; staflags = get_sta_flags(sta);