From patchwork Thu Mar 3 18:43:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivo van Doorn X-Patchwork-Id: 606971 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p23Imj2n021009 for ; Thu, 3 Mar 2011 18:49:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758687Ab1CCSsv (ORCPT ); Thu, 3 Mar 2011 13:48:51 -0500 Received: from mail-ww0-f42.google.com ([74.125.82.42]:59983 "EHLO mail-ww0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754069Ab1CCSsu (ORCPT ); Thu, 3 Mar 2011 13:48:50 -0500 Received: by wwe15 with SMTP id 15so285125wwe.1 for ; Thu, 03 Mar 2011 10:48:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=mtAC06yNPzzNxNkiXT4TEJJUMePDmsoYMnIj1jfjCOw=; b=DMCthvikJjm14ZmZIrb2SGbwIIHeECQrMyM8/ZrHGnAtc537msTv7xCZdtiHvDyRFi kyL+UCbZPTjdfYh9piYmlwMYBtwzJc1zkz6a0xkgdp77KOBYYfAFenMpRkECZUDhXjSg ZoHfd1XBeEE5Qs0qaGvYDuxljBvvs6egaCXpU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=rDAIA/rdY/MloOPfnF0uzyGceyg0o1QrII5FSUYAHIes6oGjtlxgDlj7tEBOzJf4zL vZIVk6xHgdzq0GQzXGAr3WnM1GhlMVdy0hxsSB4Ck9fJfbWj/nqe0kDafDmp3Ud40Th1 LHOCgYy12oABpBdkXHNeDovgkyPFN20Hot02k= Received: by 10.216.144.205 with SMTP id n55mr948793wej.5.1299178129480; Thu, 03 Mar 2011 10:48:49 -0800 (PST) Received: from localhost.localdomain (g121037.upc-g.chello.nl [80.57.121.37]) by mx.google.com with ESMTPS id j49sm738659wer.14.2011.03.03.10.48.43 (version=SSLv3 cipher=OTHER); Thu, 03 Mar 2011 10:48:46 -0800 (PST) From: Ivo van Doorn To: "John W. Linville" Subject: [PATCH 10/19] rt2x00: Don't call ieee80211_get_tx_rate for MCS rates Date: Thu, 3 Mar 2011 19:43:49 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.x86_64; KDE/4.4.5; x86_64; ; ) Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com References: <201103031938.56423.IvDoorn@gmail.com> <201103031942.58935.IvDoorn@gmail.com> <201103031943.26328.IvDoorn@gmail.com> In-Reply-To: <201103031943.26328.IvDoorn@gmail.com> MIME-Version: 1.0 Message-Id: <201103031943.50656.IvDoorn@gmail.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]); Thu, 03 Mar 2011 18:49:20 +0000 (UTC) diff --git a/drivers/net/wireless/rt2x00/rt2x00ht.c b/drivers/net/wireless/rt2x00/rt2x00ht.c index 78a0e73..ae1219d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00ht.c +++ b/drivers/net/wireless/rt2x00/rt2x00ht.c @@ -78,14 +78,6 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, __set_bit(ENTRY_TXD_HT_AMPDU, &txdesc->flags); /* - * Determine HT Mix/Greenfield rate mode - */ - if (txrate->flags & IEEE80211_TX_RC_MCS) - txdesc->rate_mode = RATE_MODE_HT_MIX; - if (txrate->flags & IEEE80211_TX_RC_GREEN_FIELD) - txdesc->rate_mode = RATE_MODE_HT_GREENFIELD; - - /* * Set 40Mhz mode if necessary (for legacy rates this will * duplicate the frame to both channels). */ diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 6300cf3..f06b5c7 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c @@ -321,9 +321,9 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; - struct ieee80211_rate *rate = - ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); - const struct rt2x00_rate *hwrate; + struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; + struct ieee80211_rate *rate; + const struct rt2x00_rate *hwrate = NULL; memset(txdesc, 0, sizeof(*txdesc)); @@ -390,10 +390,18 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, /* * Determine rate modulation. */ - hwrate = rt2x00_get_rate(rate->hw_value); - txdesc->rate_mode = RATE_MODE_CCK; - if (hwrate->flags & DEV_RATE_OFDM) - txdesc->rate_mode = RATE_MODE_OFDM; + if (txrate->flags & IEEE80211_TX_RC_GREEN_FIELD) + txdesc->rate_mode = RATE_MODE_HT_GREENFIELD; + else if (txrate->flags & IEEE80211_TX_RC_MCS) + txdesc->rate_mode = RATE_MODE_HT_MIX; + else { + rate = ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); + hwrate = rt2x00_get_rate(rate->hw_value); + if (hwrate->flags & DEV_RATE_OFDM) + txdesc->rate_mode = RATE_MODE_OFDM; + else + txdesc->rate_mode = RATE_MODE_CCK; + } /* * Apply TX descriptor handling by components