aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2011-08-14 06:17:32 -0400
committerLuciano Coelho <coelho@ti.com>2011-08-22 05:35:30 -0400
commitbf54e301671a6ece6c94550294dc7faf14158cd3 (patch)
treed33066bcbeb014c3b14aee433619b307040e8879 /drivers/net
parent010d3d30a218fba961bd3d250a59b0ce9d5278f3 (diff)
wl12xx: track freed packets in FW by AC
Track the number of freed packets in each AC when receiving an interrupt from the FW. This paves the way for tracking allocated packets per AC. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/wl12xx/main.c16
-rw-r--r--drivers/net/wireless/wl12xx/tx.c2
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h8
3 files changed, 23 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index c917f69f0069..09cecb336d53 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -814,6 +814,7 @@ static void wl12xx_fw_status(struct wl1271 *wl,
814 struct timespec ts; 814 struct timespec ts;
815 u32 old_tx_blk_count = wl->tx_blocks_available; 815 u32 old_tx_blk_count = wl->tx_blocks_available;
816 int avail, freed_blocks; 816 int avail, freed_blocks;
817 int i;
817 818
818 wl1271_raw_read(wl, FW_STATUS_ADDR, status, sizeof(*status), false); 819 wl1271_raw_read(wl, FW_STATUS_ADDR, status, sizeof(*status), false);
819 820
@@ -824,6 +825,15 @@ static void wl12xx_fw_status(struct wl1271 *wl,
824 status->drv_rx_counter, 825 status->drv_rx_counter,
825 status->tx_results_counter); 826 status->tx_results_counter);
826 827
828 for (i = 0; i < NUM_TX_QUEUES; i++) {
829 /* prevent wrap-around in freed-packets counter */
830 wl->tx_allocated_pkts -=
831 (status->tx_released_pkts[i] -
832 wl->tx_pkts_freed[i]) & 0xff;
833
834 wl->tx_pkts_freed[i] = status->tx_released_pkts[i];
835 }
836
827 freed_blocks = le32_to_cpu(status->total_released_blks) - 837 freed_blocks = le32_to_cpu(status->total_released_blks) -
828 wl->tx_blocks_freed; 838 wl->tx_blocks_freed;
829 wl->tx_blocks_freed = le32_to_cpu(status->total_released_blks); 839 wl->tx_blocks_freed = le32_to_cpu(status->total_released_blks);
@@ -1934,7 +1944,7 @@ out:
1934static void __wl1271_op_remove_interface(struct wl1271 *wl, 1944static void __wl1271_op_remove_interface(struct wl1271 *wl,
1935 bool reset_tx_queues) 1945 bool reset_tx_queues)
1936{ 1946{
1937 int ret; 1947 int ret, i;
1938 1948
1939 wl1271_debug(DEBUG_MAC80211, "mac80211 remove interface"); 1949 wl1271_debug(DEBUG_MAC80211, "mac80211 remove interface");
1940 1950
@@ -2050,6 +2060,10 @@ deinit:
2050 2060
2051 wl->tx_blocks_freed = 0; 2061 wl->tx_blocks_freed = 0;
2052 2062
2063 wl->tx_allocated_pkts = 0;
2064 for (i = 0; i < NUM_TX_QUEUES; i++)
2065 wl->tx_pkts_freed[i] = 0;
2066
2053 wl1271_debugfs_reset(wl); 2067 wl1271_debugfs_reset(wl);
2054 2068
2055 kfree(wl->fw_status); 2069 kfree(wl->fw_status);
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index 8fdffd08d492..7dd6d8b94f64 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -242,6 +242,8 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra,
242 wl->tx_blocks_available -= total_blocks; 242 wl->tx_blocks_available -= total_blocks;
243 wl->tx_allocated_blocks += total_blocks; 243 wl->tx_allocated_blocks += total_blocks;
244 244
245 wl->tx_allocated_pkts++;
246
245 if (wl->bss_type == BSS_TYPE_AP_BSS) 247 if (wl->bss_type == BSS_TYPE_AP_BSS)
246 wl->links[hlid].allocated_blks += total_blocks; 248 wl->links[hlid].allocated_blks += total_blocks;
247 249
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index 416d68ed95cf..24b40251535b 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -268,8 +268,8 @@ struct wl12xx_fw_status {
268 /* Size (in Memory Blocks) of TX pool */ 268 /* Size (in Memory Blocks) of TX pool */
269 __le32 tx_total; 269 __le32 tx_total;
270 270
271 /* Cumulative counter of released mem-blocks per AC */ 271 /* Cumulative counter of released packets per AC */
272 u8 tx_released_blks[NUM_TX_QUEUES]; 272 u8 tx_released_pkts[NUM_TX_QUEUES];
273 273
274 /* Cumulative counter of freed MBs per HLID */ 274 /* Cumulative counter of freed MBs per HLID */
275 u8 tx_lnk_free_blks[WL12XX_MAX_LINKS]; 275 u8 tx_lnk_free_blks[WL12XX_MAX_LINKS];
@@ -422,6 +422,10 @@ struct wl1271 {
422 u32 tx_allocated_blocks; 422 u32 tx_allocated_blocks;
423 u32 tx_results_count; 423 u32 tx_results_count;
424 424
425 /* Accounting for allocated / available Tx packets in HW */
426 u32 tx_pkts_freed[NUM_TX_QUEUES];
427 u32 tx_allocated_pkts;
428
425 /* Transmitted TX packets counter for chipset interface */ 429 /* Transmitted TX packets counter for chipset interface */
426 u32 tx_packets_count; 430 u32 tx_packets_count;
427 431