From patchwork Wed Sep 12 09:29:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujith Manoharan X-Patchwork-Id: 1441611 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D04B3DF28C for ; Wed, 12 Sep 2012 09:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754346Ab2ILJaz (ORCPT ); Wed, 12 Sep 2012 05:30:55 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:51760 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014Ab2ILJaz (ORCPT ); Wed, 12 Sep 2012 05:30:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qualcomm.com; i=@qualcomm.com; q=dns/txt; s=qcdkim; t=1347442254; x=1378978254; h=from:mime-version:content-type:content-transfer-encoding: message-id:date:to:x-mailer:cc:subject:x-originating-ip; bh=h7TP0u/U+pj7b0tdnu6Y5D9vUZyN2iLpcqyQ8diCSQM=; b=pE7PkFz2V7CMBpqcvHnkEf+QT9RkqqdF4ssgbhmVpjeYwmFOh+7xKHEb lvVCiaYvWfHxxSktYKwlTuQu7TL4Kr388R+f4Q29ydxOnlxSjLJqQldRO U7tdeEFsXioiWbJP+m+QDZeVsng0NJcw77SCSMJBYeqELvhq4JJeaGwCk A=; X-IronPort-AV: E=McAfee;i="5400,1158,6832"; a="233352322" Received: from ironmsg04-r.qualcomm.com ([172.30.46.18]) by wolverine02.qualcomm.com with ESMTP; 12 Sep 2012 02:30:54 -0700 From: Sujith Manoharan X-IronPort-AV: E=Sophos;i="4.80,408,1344236400"; d="scan'208";a="385709673" Received: from nasanexhc11.na.qualcomm.com ([172.30.39.6]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 12 Sep 2012 02:30:54 -0700 Received: from APHYDEXHC04.ap.qualcomm.com (10.222.117.50) by nasanexhc11.na.qualcomm.com (172.30.39.6) with Microsoft SMTP Server (TLS) id 14.2.318.1; Wed, 12 Sep 2012 02:30:54 -0700 Received: from nako (10.100.2.1) by qcmail1.qualcomm.com (10.222.117.50) with Microsoft SMTP Server (TLS) id 14.2.318.1; Wed, 12 Sep 2012 15:00:50 +0530 MIME-Version: 1.0 Message-ID: <20560.22038.518027.522745@gargle.gargle.HOWL> Date: Wed, 12 Sep 2012 14:59:58 +0530 To: X-Mailer: VM 8.2.0b under 24.2.1 (x86_64-unknown-linux-gnu) CC: Subject: [PATCH] ath9k: Enable SGI correctly X-Originating-IP: [10.100.2.1] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Set the driver specific SGI flag based on the station's HT capabilities, otherwise rate control uses the wrong rate. Signed-off-by: Sujith Manoharan --- drivers/net/wireless/ath/ath9k/rc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 4b12c34..27ed80b 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c @@ -1222,11 +1222,14 @@ static u8 ath_rc_build_ht_caps(struct ath_softc *sc, struct ieee80211_sta *sta) caps |= WLAN_RC_TS_FLAG | WLAN_RC_DS_FLAG; else if (sta->ht_cap.mcs.rx_mask[1]) caps |= WLAN_RC_DS_FLAG; - if (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) { caps |= WLAN_RC_40_FLAG; - if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40 || - sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) - caps |= WLAN_RC_SGI_FLAG; + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) + caps |= WLAN_RC_SGI_FLAG; + } else { + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) + caps |= WLAN_RC_SGI_FLAG; + } } return caps;