Commit fb0f2e4a authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho

wl18xx: implement hw op for setting blocks in hw_tx_desc

Add the 18xx variant to the HW Tx descriptor union and set the 18xx
specific values during Tx.
Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 624845b3
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "../wlcore/debug.h" #include "../wlcore/debug.h"
#include "../wlcore/io.h" #include "../wlcore/io.h"
#include "../wlcore/acx.h" #include "../wlcore/acx.h"
#include "../wlcore/tx.h"
#include "../wlcore/boot.h" #include "../wlcore/boot.h"
#include "reg.h" #include "reg.h"
...@@ -312,12 +313,21 @@ static u32 wl18xx_calc_tx_blocks(struct wl1271 *wl, u32 len, u32 spare_blks) ...@@ -312,12 +313,21 @@ static u32 wl18xx_calc_tx_blocks(struct wl1271 *wl, u32 len, u32 spare_blks)
return (len + blk_size - 1) / blk_size + spare_blks; return (len + blk_size - 1) / blk_size + spare_blks;
} }
static void
wl18xx_set_tx_desc_blocks(struct wl1271 *wl, struct wl1271_tx_hw_descr *desc,
u32 blks, u32 spare_blks)
{
desc->wl18xx_mem.total_mem_blocks = blks;
desc->wl18xx_mem.reserved = 0;
}
static struct wlcore_ops wl18xx_ops = { static struct wlcore_ops wl18xx_ops = {
.identify_chip = wl18xx_identify_chip, .identify_chip = wl18xx_identify_chip,
.boot = wl18xx_boot, .boot = wl18xx_boot,
.trigger_cmd = wl18xx_trigger_cmd, .trigger_cmd = wl18xx_trigger_cmd,
.ack_event = wl18xx_ack_event, .ack_event = wl18xx_ack_event,
.calc_tx_blocks = wl18xx_calc_tx_blocks, .calc_tx_blocks = wl18xx_calc_tx_blocks,
.set_tx_desc_blocks = wl18xx_set_tx_desc_blocks,
}; };
int __devinit wl18xx_probe(struct platform_device *pdev) int __devinit wl18xx_probe(struct platform_device *pdev)
......
...@@ -85,6 +85,19 @@ struct wl128x_tx_mem { ...@@ -85,6 +85,19 @@ struct wl128x_tx_mem {
u8 extra_bytes; u8 extra_bytes;
} __packed; } __packed;
struct wl18xx_tx_mem {
/*
* Total number of memory blocks allocated by the host for
* this packet.
*/
u8 total_mem_blocks;
/*
* always zero
*/
u8 reserved;
} __packed;
/* /*
* On wl128x based devices, when TX packets are aggregated, each packet * On wl128x based devices, when TX packets are aggregated, each packet
* size must be aligned to the SDIO block size. The maximum block size * size must be aligned to the SDIO block size. The maximum block size
...@@ -100,6 +113,7 @@ struct wl1271_tx_hw_descr { ...@@ -100,6 +113,7 @@ struct wl1271_tx_hw_descr {
union { union {
struct wl127x_tx_mem wl127x_mem; struct wl127x_tx_mem wl127x_mem;
struct wl128x_tx_mem wl128x_mem; struct wl128x_tx_mem wl128x_mem;
struct wl18xx_tx_mem wl18xx_mem;
} __packed; } __packed;
/* Device time (in us) when the packet arrived to the driver */ /* Device time (in us) when the packet arrived to the driver */
__le32 start_time; __le32 start_time;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment