From patchwork Fri Sep 17 14:39:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 188312 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 o8HEbOmF001465 for ; Fri, 17 Sep 2010 14:39:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754805Ab0IQOjv (ORCPT ); Fri, 17 Sep 2010 10:39:51 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:59370 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753957Ab0IQOju (ORCPT ); Fri, 17 Sep 2010 10:39:50 -0400 Received: by wyf22 with SMTP id 22so2419768wyf.19 for ; Fri, 17 Sep 2010 07:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=02RcNDTsD1RWI/N0ynKbs5Aq26IxpaQEygkvakjvGMg=; b=a3lcRzYSinqXJe7P9ZVioQOzlIZe4oo0zXE8onAB8f3l7mDqu0JoeVVYH2wr60gZSk TmSSkx8byrFSiY/Usy1xav7GwMtMZaCb0Sr8w5VOdejxi3pvKkKaLQLdnCAMG3PEXusA cuafUbiZbHAsgg691kQlLQv+8uK6BWp88Nj8M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=r/6RfBJZJj9Q5uqC3Umg84ccNP5YV4vCVYNB1vGACmqB4GHvys5rEe5P5uzISNwQtn e+wrKZu12WtxelbUBWTtY5eAFpXEpRJ+t5XW/ISj+BP8nPsTlLmCCEtHfObWmEctijok N0esVv/fhFwefqhnwmCVlOn2nEw1OX37J8tW8= Received: by 10.227.156.12 with SMTP id u12mr4173929wbw.213.1284734387648; Fri, 17 Sep 2010 07:39:47 -0700 (PDT) Received: from localhost.localdomain ([89.31.0.33]) by mx.google.com with ESMTPS id w31sm3473879wbd.21.2010.09.17.07.39.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Sep 2010 07:39:42 -0700 (PDT) From: Helmut Schaa To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Helmut Schaa Subject: [RFC] mac80211: distinct between max rates and the number of rates the hw can report Date: Fri, 17 Sep 2010 16:39:45 +0200 Message-Id: <1284734385-16064-1-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.7.1 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.3 (demeter1.kernel.org [140.211.167.41]); Fri, 17 Sep 2010 14:39:53 +0000 (UTC) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 19a5cb4..7e1426c 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1092,7 +1092,10 @@ enum ieee80211_hw_flags { * @sta_data_size: size (in bytes) of the drv_priv data area * within &struct ieee80211_sta. * - * @max_rates: maximum number of alternate rate retry stages + * @max_rates: maximum number of alternate rate retry stages the hw + * can handle. + * @max_report_rates: maximum number of alternate rate retry stages + * the hw can report back. * @max_rate_tries: maximum number of tries for each stage * * @napi_weight: weight used for NAPI polling. You must specify an @@ -1114,6 +1117,7 @@ struct ieee80211_hw { u16 max_listen_interval; s8 max_signal; u8 max_rates; + u8 max_report_rates; u8 max_rate_tries; }; diff --git a/net/mac80211/main.c b/net/mac80211/main.c index bf0eb6a..da95ede 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -517,6 +517,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, /* set up some defaults */ local->hw.queues = 1; local->hw.max_rates = 1; + local->hw.max_report_rates = 0; local->hw.conf.long_frame_max_tx_count = wiphy->retry_long; local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; local->user_power_level = -1; @@ -592,6 +593,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) WLAN_CIPHER_SUITE_AES_CMAC }; + if (hw->max_report_rates == 0) + hw->max_report_rates = hw->max_rates; + /* * generic code guarantees at least one band, * set this very early because much code assumes diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 571b32b..855000d 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -175,7 +175,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { /* the HW cannot have attempted that rate */ - if (i >= hw->max_rates) { + if (i >= hw->max_report_rates) { info->status.rates[i].idx = -1; info->status.rates[i].count = 0; } else if (info->status.rates[i].idx >= 0) {