aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShahar Levi <shahar_levi@ti.com>2011-03-06 09:32:13 -0500
committerLuciano Coelho <coelho@ti.com>2011-04-19 09:49:00 -0400
commitae77eccf04f8c36769bdba334e1bbcc7bb9d3644 (patch)
tree194dfe308ae19ae5ace06f5c9fbb38532976c7b4
parent13b107dd9808343d05627f0fba7fbc764c86738e (diff)
wl12xx: 1281/1283 support - Improve Tx & Rx path
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>
-rw-r--r--drivers/net/wireless/wl12xx/rx.c31
-rw-r--r--drivers/net/wireless/wl12xx/tx.c30
2 files changed, 40 insertions, 21 deletions
diff --git a/drivers/net/wireless/wl12xx/rx.c b/drivers/net/wireless/wl12xx/rx.c
index 919b59f00301..132b0cab5696 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)
163 break; 163 break;
164 } 164 }
165 165
166 /* 166 if (wl->chip.id != CHIP_ID_1283_PG20) {
167 * Choose the block we want to read 167 /*
168 * For aggregated packets, only the first memory block should 168 * Choose the block we want to read
169 * be retrieved. The FW takes care of the rest. 169 * For aggregated packets, only the first memory block
170 */ 170 * should be retrieved. The FW takes care of the rest.
171 mem_block = wl1271_rx_get_mem_block(status, drv_rx_counter); 171 */
172 wl->rx_mem_pool_addr.addr = (mem_block << 8) + 172 mem_block = wl1271_rx_get_mem_block(status,
173 le32_to_cpu(wl_mem_map->packet_memory_pool_start); 173 drv_rx_counter);
174 wl->rx_mem_pool_addr.addr_extra = 174
175 wl->rx_mem_pool_addr.addr + 4; 175 wl->rx_mem_pool_addr.addr = (mem_block << 8) +
176 wl1271_write(wl, WL1271_SLV_REG_DATA, &wl->rx_mem_pool_addr, 176 le32_to_cpu(wl_mem_map->packet_memory_pool_start);
177 sizeof(wl->rx_mem_pool_addr), false); 177
178 wl->rx_mem_pool_addr.addr_extra =
179 wl->rx_mem_pool_addr.addr + 4;
180
181 wl1271_write(wl, WL1271_SLV_REG_DATA,
182 &wl->rx_mem_pool_addr,
183 sizeof(wl->rx_mem_pool_addr), false);
184 }
178 185
179 /* Read all available packets at once */ 186 /* Read all available packets at once */
180 wl1271_read(wl, WL1271_SLV_MEM_DATA, wl->aggr_buf, 187 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 e296f0a5fe27..afc8505abeb6 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,
158 desc = (struct wl1271_tx_hw_descr *)skb_push( 158 desc = (struct wl1271_tx_hw_descr *)skb_push(
159 skb, total_len - skb->len); 159 skb, total_len - skb->len);
160 160
161 desc->wl127x_mem.extra_blocks = TX_HW_BLOCK_SPARE; 161 /* HW descriptor fields change between wl127x and wl128x */
162 desc->wl127x_mem.total_mem_blocks = total_blocks; 162 if (wl->chip.id == CHIP_ID_1283_PG20) {
163 desc->wl128x_mem.total_mem_blocks = total_blocks;
164 } else {
165 desc->wl127x_mem.extra_blocks = TX_HW_BLOCK_SPARE;
166 desc->wl127x_mem.total_mem_blocks = total_blocks;
167 }
168
163 desc->id = id; 169 desc->id = id;
164 170
165 wl->tx_blocks_available -= total_blocks; 171 wl->tx_blocks_available -= total_blocks;
@@ -249,6 +255,13 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb,
249 255
250 desc->wl128x_mem.extra_bytes = aligned_len - skb->len; 256 desc->wl128x_mem.extra_bytes = aligned_len - skb->len;
251 desc->length = cpu_to_le16(aligned_len >> 2); 257 desc->length = cpu_to_le16(aligned_len >> 2);
258
259 wl1271_debug(DEBUG_TX, "tx_fill_hdr: hlid: %d "
260 "tx_attr: 0x%x len: %d life: %d mem: %d",
261 desc->hlid, tx_attr,
262 le16_to_cpu(desc->length),
263 le16_to_cpu(desc->life_time),
264 desc->wl128x_mem.total_mem_blocks);
252 } else { 265 } else {
253 int pad; 266 int pad;
254 267
@@ -260,16 +273,15 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb,
260 pad = aligned_len - skb->len; 273 pad = aligned_len - skb->len;
261 tx_attr |= pad << TX_HW_ATTR_OFST_LAST_WORD_PAD; 274 tx_attr |= pad << TX_HW_ATTR_OFST_LAST_WORD_PAD;
262 275
263 wl1271_debug(DEBUG_TX, "tx_fill_hdr: padding: %d", pad); 276 wl1271_debug(DEBUG_TX, "tx_fill_hdr: pad: %d hlid: %d "
277 "tx_attr: 0x%x len: %d life: %d mem: %d", pad,
278 desc->hlid, tx_attr,
279 le16_to_cpu(desc->length),
280 le16_to_cpu(desc->life_time),
281 desc->wl127x_mem.total_mem_blocks);
264 } 282 }
265 283
266 desc->tx_attr = cpu_to_le16(tx_attr); 284 desc->tx_attr = cpu_to_le16(tx_attr);
267
268 wl1271_debug(DEBUG_TX, "tx_fill_hdr: hlid: %d tx_attr: 0x%x "
269 "len: %d life: %d mem: %d",
270 desc->hlid, le16_to_cpu(desc->tx_attr),
271 le16_to_cpu(desc->length), le16_to_cpu(desc->life_time),
272 desc->wl127x_mem.total_mem_blocks);
273} 285}
274 286
275/* caller must hold wl->mutex */ 287/* caller must hold wl->mutex */