From patchwork Tue Jun 11 15:57:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huehn X-Patchwork-Id: 2704861 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 289BFC1459 for ; Tue, 11 Jun 2013 15:58:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A9E02026D for ; Tue, 11 Jun 2013 15:58:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BAF6D2025F for ; Tue, 11 Jun 2013 15:58:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752242Ab3FKP6W (ORCPT ); Tue, 11 Jun 2013 11:58:22 -0400 Received: from mail.net.t-labs.tu-berlin.de ([130.149.220.252]:33609 "EHLO mail.net.t-labs.tu-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751903Ab3FKP6V (ORCPT ); Tue, 11 Jun 2013 11:58:21 -0400 Received: from bob.magnets (unknown [130.149.221.98]) by mail.net.t-labs.tu-berlin.de (Postfix) with ESMTPSA id 72EE14C5E2B; Tue, 11 Jun 2013 17:58:20 +0200 (CEST) From: Thomas Huehn To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, nbd@nbd.name, johannes@sipsolutions.net, chunkeey@googlemail.com Subject: [PATCH] carl9170: make use of the new rate control API Date: Tue, 11 Jun 2013 17:57:17 +0200 Message-Id: <1370966237-27716-1-git-send-email-thomas@net.t-labs.tu-berlin.de> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch enabels carl9170 to use the new rate table to lookup each mrr rate and retry information per packet. Signed-off-by: Benjamin Vahl Signed-off-by: Thomas Huehn --- drivers/net/wireless/ath/carl9170/carl9170.h | 1 + drivers/net/wireless/ath/carl9170/tx.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h index 9dce106..ddaa149 100644 --- a/drivers/net/wireless/ath/carl9170/carl9170.h +++ b/drivers/net/wireless/ath/carl9170/carl9170.h @@ -322,6 +322,7 @@ struct ar9170 { /* MAC */ enum carl9170_erp_modes erp_mode; + struct ieee80211_tx_rate rates[4]; /* PHY */ struct ieee80211_channel *channel; diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c index c61cafa..d21c81d 100644 --- a/drivers/net/wireless/ath/carl9170/tx.c +++ b/drivers/net/wireless/ath/carl9170/tx.c @@ -266,6 +266,7 @@ static void carl9170_tx_release(struct kref *ref) struct carl9170_tx_info *arinfo; struct ieee80211_tx_info *txinfo; struct sk_buff *skb; + int size; arinfo = container_of(ref, struct carl9170_tx_info, ref); txinfo = container_of((void *) arinfo, struct ieee80211_tx_info, @@ -324,6 +325,9 @@ static void carl9170_tx_release(struct kref *ref) } } + size = min_t(int, sizeof(txinfo->status.rates), sizeof(ar->rates)); + memcpy(txinfo->status.rates, ar->rates, size); + skb_pull(skb, sizeof(struct _carl9170_tx_superframe)); ieee80211_tx_status_irqsafe(ar->hw, skb); } @@ -982,6 +986,8 @@ static int carl9170_tx_prepare(struct ar9170 *ar, txc->s.ampdu_settings, factor); } + ieee80211_get_tx_rates(info->control.vif, sta, skb, ar->rates, ARRAY_SIZE(ar->rates)); + /* * NOTE: For the first rate, the ERP & AMPDU flags are directly * taken from mac_control. For all fallback rate, the firmware @@ -989,7 +995,7 @@ static int carl9170_tx_prepare(struct ar9170 *ar, */ for (i = 0; i < CARL9170_TX_MAX_RATES; i++) { __le32 phy_set; - txrate = &info->control.rates[i]; + txrate = &ar->rates[i]; if (txrate->idx < 0) break;