wl1271: Update TX path block calucation algo
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>
Mon, 12 Oct 2009 12:08:53 +0000 (15:08 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Oct 2009 20:48:05 +0000 (16:48 -0400)
Update the TX path block calculation algorithm based on TI reference.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/wl1271_tx.c

index 5d3aa4b26cf3782c59e05aa47aa709029a7608e5..56a7f36380b7a76ce7db3c32e43a600ce6a85608 100644 (file)
@@ -57,8 +57,8 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra)
        /* approximate the number of blocks required for this packet
           in the firmware */
        /* FIXME: try to figure out what is done here and make it cleaner */
-       total_blocks = (total_len) >> TX_HW_BLOCK_SHIFT_DIV;
-       excluded = (total_blocks << 2) + (skb->len & 0xff) + 34;
+       total_blocks = (total_len + 20) >> TX_HW_BLOCK_SHIFT_DIV;
+       excluded = (total_blocks << 2) + ((total_len + 20) & 0xff) + 34;
        total_blocks += (excluded > 252) ? 2 : 1;
        total_blocks += TX_HW_BLOCK_SPARE;