From patchwork Fri Jul 29 17:22:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 1021542 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6THMk3b017316 for ; Fri, 29 Jul 2011 17:22:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751706Ab1G2RWo (ORCPT ); Fri, 29 Jul 2011 13:22:44 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:63916 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358Ab1G2RWo (ORCPT ); Fri, 29 Jul 2011 13:22:44 -0400 Received: by mail-fx0-f46.google.com with SMTP id 19so2464952fxh.19 for ; Fri, 29 Jul 2011 10:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=l6+oGW77BL2uYyMqkS0cfdNTXdfHt/23+fGs5D+8R7c=; b=jVMeSe71xRcVw9nHSUtym36HLOODsoG7L07Y+KFYmiPC/wdSe7diP36QyQdgoqWdjx 664BNuibPRAMVdb97CHmeCpVJv9NZznBILgsFR8dWLbpF8mzWP+TmYdO752oOgRzuGwg VmRkfjnohvsE3ZSzRjKXMdj0tV7E4UaJ6nuiU= Received: by 10.223.60.146 with SMTP id p18mr2116760fah.68.1311960163686; Fri, 29 Jul 2011 10:22:43 -0700 (PDT) Received: from localhost.localdomain (p5495C8C0.dip.t-dialin.net [84.149.200.192]) by mx.google.com with ESMTPS id q5sm1208402fah.30.2011.07.29.10.22.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jul 2011 10:22:42 -0700 (PDT) From: Helmut Schaa To: John Linville Cc: linux-wireless@vger.kernel.org, Johannes Berg , Helmut Schaa Subject: [PATCH 2/2] mac80211: Always send EAPOL frames at lowest rate Date: Fri, 29 Jul 2011 19:22:17 +0200 Message-Id: <1311960137-25420-2-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1311960137-25420-1-git-send-email-helmut.schaa@googlemail.com> References: <1311960137-25420-1-git-send-email-helmut.schaa@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Jul 2011 17:22:46 +0000 (UTC) Since EAPOL frames are normal data frames they are treated by the rate control algorithm as such. Thus it can happen that the rate control algorithm chooses an inappropriate rate (minstrel_ht uses MCS rates for example) for the 4-way handshake and under low signal conditions the handshake may time out. To fix this issue always treat EAPOL frames the same as management frames and send them with the lowest available rate. Signed-off-by: Helmut Schaa --- net/mac80211/rate.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index 3d5a2cb..c307b7b 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -199,6 +199,13 @@ static void rate_control_release(struct kref *kref) kfree(ctrl_ref); } +static bool rc_is_port_control(struct ieee80211_sta *pubsta, + struct ieee80211_tx_rate_control *txrc) +{ + struct sta_info *sta = container_of(pubsta, struct sta_info, sta); + return sta->sdata->control_port_protocol == txrc->skb->protocol; +} + static bool rc_no_data_or_no_ack(struct ieee80211_tx_rate_control *txrc) { struct sk_buff *skb = txrc->skb; @@ -241,7 +248,8 @@ bool rate_control_send_low(struct ieee80211_sta *sta, struct ieee80211_supported_band *sband = txrc->sband; int mcast_rate; - if (!sta || !priv_sta || rc_no_data_or_no_ack(txrc)) { + if (!sta || !priv_sta || rc_no_data_or_no_ack(txrc) || + rc_is_port_control(sta, txrc)) { info->control.rates[0].idx = rate_lowest_index(txrc->sband, sta); info->control.rates[0].count = (info->flags & IEEE80211_TX_CTL_NO_ACK) ?