Commit 624845b3 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho

wl18xx: implement hw op for calculating hw block count per packet

Implement the calc_tx_blocks op for the 18xx family.
Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 1349c421
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#define WL18XX_TX_HW_BLOCK_SPARE 1 #define WL18XX_TX_HW_BLOCK_SPARE 1
#define WL18XX_TX_HW_GEM_BLOCK_SPARE 2 #define WL18XX_TX_HW_GEM_BLOCK_SPARE 2
#define WL18XX_TX_HW_BLOCK_SIZE 268
static struct wl18xx_conf wl18xx_default_conf = { static struct wl18xx_conf wl18xx_default_conf = {
.phy = { .phy = {
...@@ -305,11 +306,18 @@ static void wl18xx_ack_event(struct wl1271 *wl) ...@@ -305,11 +306,18 @@ static void wl18xx_ack_event(struct wl1271 *wl)
wlcore_write_reg(wl, REG_INTERRUPT_TRIG, WL18XX_INTR_TRIG_EVENT_ACK); wlcore_write_reg(wl, REG_INTERRUPT_TRIG, WL18XX_INTR_TRIG_EVENT_ACK);
} }
static u32 wl18xx_calc_tx_blocks(struct wl1271 *wl, u32 len, u32 spare_blks)
{
u32 blk_size = WL18XX_TX_HW_BLOCK_SIZE;
return (len + blk_size - 1) / blk_size + spare_blks;
}
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,
}; };
int __devinit wl18xx_probe(struct platform_device *pdev) int __devinit wl18xx_probe(struct platform_device *pdev)
......
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