From patchwork Wed Apr 20 05:31:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujith Manoharan X-Patchwork-Id: 720591 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 p3K5SUrJ031829 for ; Wed, 20 Apr 2011 05:28:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752114Ab1DTF23 (ORCPT ); Wed, 20 Apr 2011 01:28:29 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:45415 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751617Ab1DTF22 (ORCPT ); Wed, 20 Apr 2011 01:28:28 -0400 Received: by mail-pz0-f46.google.com with SMTP id 9so215203pzk.19 for ; Tue, 19 Apr 2011 22:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:x-mailer:cc:subject; bh=9AewZCMFGP2sCHvIQr6FDB1oK0WCVtBd+TscjEv6sII=; b=PuAy+YjDDg4KsIgJt0nZVTXLEeiB1lHMwWEfl5/G4PJqtzcLRVtHPQIUijBHcIVju5 iRwCdcmPNhuE22Egr0BLiWE4JuOxOBHHIeYGqJELFkqdMpDUlV+XLQWgxV5mJf35wRFs PsE4VcipL9M25KvG/qTtiYT8oDYbeOQXQRc+c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:mime-version:content-type:content-transfer-encoding:message-id :date:to:x-mailer:cc:subject; b=gM1+VG2LTpMQ+DmgQsHwSvH/qw479QLOdhlXe9j2WuPbjAnr4iCh7GJOq3AXeyhCzI Dh7QDcd4e3Q5JoIWxTodXQba+PxNMyLgDpgBWK86gmftgRuCxNUmzOYCiL3UAJ2pL8OY DuHOG7K0b3xYpV/xAKVNonjusq4PdWjHlZ9UE= Received: by 10.68.34.4 with SMTP id v4mr2649905pbi.159.1303277308353; Tue, 19 Apr 2011 22:28:28 -0700 (PDT) Received: from atheros-test ([182.72.177.186]) by mx.google.com with ESMTPS id h7sm401945pbg.74.2011.04.19.22.28.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 19 Apr 2011 22:28:27 -0700 (PDT) From: Sujith MIME-Version: 1.0 Message-ID: <19886.28564.501697.981883@gargle.gargle.HOWL> Date: Wed, 20 Apr 2011 11:01:00 +0530 To: linville@tuxdriver.com X-Mailer: VM 8.1.1 under 23.3.1 (x86_64-unknown-linux-gnu) CC: linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net Subject: [PATCH 3/5] ath9k_htc: Fix max A-MPDU size handling 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]); Wed, 20 Apr 2011 05:28:30 +0000 (UTC) From: Sujith Manoharan Set the maximum ampdu size of a station correctly in the target by using the ampdu_factor. Signed-off-by: Sujith Manoharan --- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index a640268..fbc238a 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -467,6 +467,7 @@ static int ath9k_htc_add_station(struct ath9k_htc_priv *priv, struct ath9k_htc_sta *ista; int ret, sta_idx; u8 cmd_rsp; + u16 maxampdu; if (priv->nstations >= ATH9K_HTC_MAX_STA) return -ENOBUFS; @@ -490,7 +491,15 @@ static int ath9k_htc_add_station(struct ath9k_htc_priv *priv, tsta.sta_index = sta_idx; tsta.vif_index = avp->index; - tsta.maxampdu = cpu_to_be16(0xffff); + + if (!sta) { + tsta.maxampdu = cpu_to_be16(0xffff); + } else { + maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + + sta->ht_cap.ampdu_factor); + tsta.maxampdu = cpu_to_be16(maxampdu); + } + if (sta && sta->ht_cap.ht_supported) tsta.flags = cpu_to_be16(ATH_HTC_STA_HT);