From patchwork Sun Feb 27 22:30:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Yariv X-Patchwork-Id: 593801 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 p1RMV2VK002421 for ; Sun, 27 Feb 2011 22:31:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751852Ab1B0WbA (ORCPT ); Sun, 27 Feb 2011 17:31:00 -0500 Received: from mail-ww0-f42.google.com ([74.125.82.42]:35232 "EHLO mail-ww0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751886Ab1B0WbA (ORCPT ); Sun, 27 Feb 2011 17:31:00 -0500 Received: by wwe15 with SMTP id 15so2538990wwe.1 for ; Sun, 27 Feb 2011 14:30:59 -0800 (PST) Received: by 10.216.69.84 with SMTP id m62mr1554407wed.84.1298845858880; Sun, 27 Feb 2011 14:30:58 -0800 (PST) Received: from localhost.localdomain (93-173-12-148.bb.netvision.net.il [93.173.12.148]) by mx.google.com with ESMTPS id o19sm1561251wee.2.2011.02.27.14.30.57 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Feb 2011 14:30:58 -0800 (PST) From: Ido Yariv To: Luciano Coelho Cc: linux-wireless@vger.kernel.org, Ido Yariv , Ohad Ben-Cohen Subject: [PATCH 2/7] wl12xx: Do end-of-transactions transfers only if needed Date: Mon, 28 Feb 2011 00:30:40 +0200 Message-Id: <1298845845-12191-3-git-send-email-ido@wizery.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1298845845-12191-1-git-send-email-ido@wizery.com> References: <1298845845-12191-1-git-send-email-ido@wizery.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]); Sun, 27 Feb 2011 22:31:03 +0000 (UTC) diff --git a/drivers/net/wireless/wl12xx/boot.h b/drivers/net/wireless/wl12xx/boot.h index d67dcff..55d7521 100644 --- a/drivers/net/wireless/wl12xx/boot.h +++ b/drivers/net/wireless/wl12xx/boot.h @@ -56,7 +56,7 @@ struct wl1271_static_data { #define OCP_REG_CLK_PULL 0x0cb4 #define REG_FUSE_DATA_2_1 0x050a -#define PG_VER_MASK 0x3c +#define PG_VER_MASK 0xc #define PG_VER_OFFSET 2 #define CMD_MBOX_ADDRESS 0x407B4 diff --git a/drivers/net/wireless/wl12xx/rx.c b/drivers/net/wireless/wl12xx/rx.c index 3d13d7a..a07e3f9 100644 --- a/drivers/net/wireless/wl12xx/rx.c +++ b/drivers/net/wireless/wl12xx/rx.c @@ -198,7 +198,13 @@ void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_common_status *status) pkt_offset += pkt_length; } } - wl1271_write32(wl, RX_DRIVER_COUNTER_ADDRESS, wl->rx_counter); + + /* + * Write the driver's packet counter to the FW. This is only required + * for older hardware revisions + */ + if (wl->hw_pg_ver < 3) + wl1271_write32(wl, RX_DRIVER_COUNTER_ADDRESS, wl->rx_counter); } void wl1271_set_default_filters(struct wl1271 *wl) diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index ac60d57..57bd3bd 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c @@ -506,8 +506,14 @@ out_ack: sent_packets = true; } if (sent_packets) { - /* interrupt the firmware with the new packets */ - wl1271_write32(wl, WL1271_HOST_WR_ACCESS, wl->tx_packets_count); + /* + * Interrupt the firmware with the new packets. This is only + * required for older hardware revisions + */ + if (wl->hw_pg_ver < 3) + wl1271_write32(wl, WL1271_HOST_WR_ACCESS, + wl->tx_packets_count); + wl1271_handle_tx_low_watermark(wl); }