Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luciano Coelho <coelho@ti.com>
To: linux-wireless@vger.kernel.org
Cc: shahar_levi@ti.com, ruthyz@ti.com
Subject: [PATCH v2 10/14] wl12xx: 1281/1283 support - Improve Tx & Rx path
Date: Fri, 18 Mar 2011 16:19:25 +0200	[thread overview]
Message-ID: <1300457969-19601-11-git-send-email-coelho@ti.com> (raw)
In-Reply-To: <1300457969-19601-1-git-send-email-coelho@ti.com>

From: Shahar Levi <shahar_levi@ti.com>

Reduced bus transactions in the Tx & Rx path.

[Removed unnecessary check wl->chip.id != CHIP_ID_1283_PG20 when
checking the quirk -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
---
 drivers/net/wireless/wl12xx/rx.c |   31 +++++++++++++++++++------------
 drivers/net/wireless/wl12xx/tx.c |   30 +++++++++++++++++++++---------
 2 files changed, 40 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/rx.c b/drivers/net/wireless/wl12xx/rx.c
index 919b59f..132b0ca 100644
--- a/drivers/net/wireless/wl12xx/rx.c
+++ b/drivers/net/wireless/wl12xx/rx.c
@@ -163,18 +163,25 @@ void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_common_status *status)
 			break;
 		}
 
-		/*
-		 * Choose the block we want to read
-		 * For aggregated packets, only the first memory block should
-		 * be retrieved. The FW takes care of the rest.
-		 */
-		mem_block = wl1271_rx_get_mem_block(status, drv_rx_counter);
-		wl->rx_mem_pool_addr.addr = (mem_block << 8) +
-			le32_to_cpu(wl_mem_map->packet_memory_pool_start);
-		wl->rx_mem_pool_addr.addr_extra =
-			wl->rx_mem_pool_addr.addr + 4;
-		wl1271_write(wl, WL1271_SLV_REG_DATA, &wl->rx_mem_pool_addr,
-				sizeof(wl->rx_mem_pool_addr), false);
+		if (wl->chip.id != CHIP_ID_1283_PG20) {
+			/*
+			 * Choose the block we want to read
+			 * For aggregated packets, only the first memory block
+			 * should be retrieved. The FW takes care of the rest.
+			 */
+			mem_block = wl1271_rx_get_mem_block(status,
+							    drv_rx_counter);
+
+			wl->rx_mem_pool_addr.addr = (mem_block << 8) +
+			   le32_to_cpu(wl_mem_map->packet_memory_pool_start);
+
+			wl->rx_mem_pool_addr.addr_extra =
+				wl->rx_mem_pool_addr.addr + 4;
+
+			wl1271_write(wl, WL1271_SLV_REG_DATA,
+				     &wl->rx_mem_pool_addr,
+				     sizeof(wl->rx_mem_pool_addr), false);
+		}
 
 		/* Read all available packets at once */
 		wl1271_read(wl, WL1271_SLV_MEM_DATA, wl->aggr_buf,
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index e296f0a..afc8505 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -158,8 +158,14 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra,
 		desc = (struct wl1271_tx_hw_descr *)skb_push(
 			skb, total_len - skb->len);
 
-		desc->wl127x_mem.extra_blocks = TX_HW_BLOCK_SPARE;
-		desc->wl127x_mem.total_mem_blocks = total_blocks;
+		/* HW descriptor fields change between wl127x and wl128x */
+		if (wl->chip.id == CHIP_ID_1283_PG20) {
+			desc->wl128x_mem.total_mem_blocks = total_blocks;
+		} else {
+			desc->wl127x_mem.extra_blocks = TX_HW_BLOCK_SPARE;
+			desc->wl127x_mem.total_mem_blocks = total_blocks;
+		}
+
 		desc->id = id;
 
 		wl->tx_blocks_available -= total_blocks;
@@ -249,6 +255,13 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb,
 
 		desc->wl128x_mem.extra_bytes = aligned_len - skb->len;
 		desc->length = cpu_to_le16(aligned_len >> 2);
+
+		wl1271_debug(DEBUG_TX, "tx_fill_hdr: hlid: %d "
+			     "tx_attr: 0x%x len: %d life: %d mem: %d",
+			     desc->hlid, tx_attr,
+			     le16_to_cpu(desc->length),
+			     le16_to_cpu(desc->life_time),
+			     desc->wl128x_mem.total_mem_blocks);
 	} else {
 		int pad;
 
@@ -260,16 +273,15 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb,
 		pad = aligned_len - skb->len;
 		tx_attr |= pad << TX_HW_ATTR_OFST_LAST_WORD_PAD;
 
-		wl1271_debug(DEBUG_TX, "tx_fill_hdr: padding: %d", pad);
+		wl1271_debug(DEBUG_TX, "tx_fill_hdr: pad: %d hlid: %d "
+			     "tx_attr: 0x%x len: %d life: %d mem: %d", pad,
+			     desc->hlid, tx_attr,
+			     le16_to_cpu(desc->length),
+			     le16_to_cpu(desc->life_time),
+			     desc->wl127x_mem.total_mem_blocks);
 	}
 
 	desc->tx_attr = cpu_to_le16(tx_attr);
-
-	wl1271_debug(DEBUG_TX, "tx_fill_hdr: hlid: %d tx_attr: 0x%x "
-		     "len: %d life: %d mem: %d",
-		     desc->hlid, le16_to_cpu(desc->tx_attr),
-		     le16_to_cpu(desc->length),	le16_to_cpu(desc->life_time),
-		     desc->wl127x_mem.total_mem_blocks);
 }
 
 /* caller must hold wl->mutex */
-- 
1.7.1


  parent reply	other threads:[~2011-03-18 14:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 14:19 [PATCH v2 00/14] wl12xx: 1281/1283 support Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 01/14] wl12xx: add new board_tcxo_clock element to the platform data Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 02/14] wl12xx: 1281/1283 support - move IRQ polarity Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 03/14] wl12xx: 1281/1283 support - Add Definitions Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 04/14] wl12xx: 1281/1283 support - Add acx commands Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 05/14] wl12xx: 1281/1283 support - add block size handling for sdio and spi Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 06/14] wl12xx: 1281/1283 support - New radio structs and functions Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 07/14] wl12xx: 1281/1283 support - Loading FW & NVS Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 08/14] wl12xx: 1281/1283 support - New boot sequence Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 09/14] wl12xx: 1281/1283 support - use dynamic memory for the RX/TX pools Luciano Coelho
2011-03-18 14:19 ` Luciano Coelho [this message]
2011-03-18 14:19 ` [PATCH v2 11/14] wl12xx: 1281/1283 support - Add dummy packet support Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 12/14] wl12xx: 1281/1283 support - Use different FW file for AP mode wl127x/wl128x chips Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 13/14] wl12xx: 1281/1283 support - enable chip support Luciano Coelho
2011-03-18 14:19 ` [PATCH v2 14/14] wl12xx: use 1 spare TX block instead of two Luciano Coelho
2011-03-18 21:05 ` [PATCH v2 00/14] wl12xx: 1281/1283 support Luciano Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1300457969-19601-11-git-send-email-coelho@ti.com \
    --to=coelho@ti.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=ruthyz@ti.com \
    --cc=shahar_levi@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox