summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wlcore/rx.c
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-12-12 12:15:08 +0200
committerLuciano Coelho <coelho@ti.com>2012-04-12 08:44:00 +0300
commitb14684a00439b7b154e63be9446fba19281b8bbc (patch)
treed50511456cdd9f09dc81fc2efaedde73839c3eca /drivers/net/wireless/ti/wlcore/rx.c
parentcd70f6a48b3fbb841a127361ee4ac0752f9d29a2 (diff)
downloadlinux-stable-b14684a00439b7b154e63be9446fba19281b8bbc.tar.gz
linux-stable-b14684a00439b7b154e63be9446fba19281b8bbc.tar.bz2
linux-stable-b14684a00439b7b154e63be9446fba19281b8bbc.zip
wlcore/wl12xx: add prepare_read hw op for Rx data
The only difference in the read_data operations is that some chips need to prepare the data to be read before reading. So instead of having a mandatory read_data operation, we now have an option prepare_data operation that only needs to be implemented for chips that require it. In the wl12xx lower driver, we only set the prepare_data operation for wl127x chips. Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/rx.c')
-rw-r--r--drivers/net/wireless/ti/wlcore/rx.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c
index d1e420649d31..3f504d151e54 100644
--- a/drivers/net/wireless/ti/wlcore/rx.c
+++ b/drivers/net/wireless/ti/wlcore/rx.c
@@ -38,13 +38,6 @@
*/
#include "../wl12xx/reg.h"
-static u8 wl12xx_rx_get_mem_block(struct wl12xx_fw_status *status,
- u32 drv_rx_counter)
-{
- return le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]) &
- RX_MEM_BLOCK_MASK;
-}
-
static u32 wlcore_rx_get_buf_size(struct wl1271 *wl,
u32 rx_pkt_desc)
{
@@ -202,13 +195,11 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length,
void wl12xx_rx(struct wl1271 *wl, struct wl12xx_fw_status *status)
{
- struct wl1271_acx_mem_map *wl_mem_map = wl->target_mem_map;
unsigned long active_hlids[BITS_TO_LONGS(WL12XX_MAX_LINKS)] = {0};
u32 buf_size;
u32 fw_rx_counter = status->fw_rx_counter & NUM_RX_PKT_DESC_MOD_MASK;
u32 drv_rx_counter = wl->rx_counter & NUM_RX_PKT_DESC_MOD_MASK;
u32 rx_counter;
- u32 mem_block;
u32 pkt_len, align_pkt_len;
u32 pkt_offset, des;
u8 hlid;
@@ -234,27 +225,9 @@ void wl12xx_rx(struct wl1271 *wl, struct wl12xx_fw_status *status)
break;
}
- 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 = wl12xx_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;
-
- wlcore_write_data(wl, REG_SLV_REG_DATA,
- &wl->rx_mem_pool_addr,
- sizeof(wl->rx_mem_pool_addr), false);
- }
-
/* Read all available packets at once */
+ des = le32_to_cpu(status->rx_pkt_descs[drv_rx_counter]);
+ wlcore_hw_prepare_read(wl, des, buf_size);
wlcore_read_data(wl, REG_SLV_MEM_DATA, wl->aggr_buf,
buf_size, true);