From patchwork Mon Oct 12 12:08:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luciano Coelho X-Patchwork-Id: 53107 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9CCFrqc017443 for ; Mon, 12 Oct 2009 12:15:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756115AbZJLMLI (ORCPT ); Mon, 12 Oct 2009 08:11:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754917AbZJLMLH (ORCPT ); Mon, 12 Oct 2009 08:11:07 -0400 Received: from smtp.nokia.com ([192.100.105.134]:64656 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755590AbZJLMLF (ORCPT ); Mon, 12 Oct 2009 08:11:05 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9CC8w8K021531; Mon, 12 Oct 2009 07:09:33 -0500 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 12 Oct 2009 15:09:19 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 12 Oct 2009 15:09:18 +0300 Received: from localhost.localdomain (pimenta.research.nokia.com [172.21.50.90]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9CC8vIJ011869; Mon, 12 Oct 2009 15:09:15 +0300 From: Luciano Coelho To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Juuso Oikarinen Subject: [PATCH 12/16] wl1271: Update TX path block calucation algo Date: Mon, 12 Oct 2009 15:08:53 +0300 Message-Id: <1255349337-9776-13-git-send-email-luciano.coelho@nokia.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1255349337-9776-1-git-send-email-luciano.coelho@nokia.com> References: <1255349337-9776-1-git-send-email-luciano.coelho@nokia.com> X-OriginalArrivalTime: 12 Oct 2009 12:09:18.0527 (UTC) FILETIME=[D31594F0:01CA4B34] X-Nokia-AV: Clean Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c index 5d3aa4b..56a7f36 100644 --- a/drivers/net/wireless/wl12xx/wl1271_tx.c +++ b/drivers/net/wireless/wl12xx/wl1271_tx.c @@ -57,8 +57,8 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra) /* approximate the number of blocks required for this packet in the firmware */ /* FIXME: try to figure out what is done here and make it cleaner */ - total_blocks = (total_len) >> TX_HW_BLOCK_SHIFT_DIV; - excluded = (total_blocks << 2) + (skb->len & 0xff) + 34; + total_blocks = (total_len + 20) >> TX_HW_BLOCK_SHIFT_DIV; + excluded = (total_blocks << 2) + ((total_len + 20) & 0xff) + 34; total_blocks += (excluded > 252) ? 2 : 1; total_blocks += TX_HW_BLOCK_SPARE;