diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-10-09 13:00:38 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-10-10 21:49:29 +0400 |
commit | 1dc254ac9f04f23d332ed8eea79055f067c90627 (patch) | |
tree | cbadcc1ab4c37dae2d5856f98fa3245346bbca31 /drivers/net/wireless/rt2x00/rt2x00.h | |
parent | 8f78b0bb8791d8164aed86970905cdc12f3b8496 (diff) | |
download | linux-1dc254ac9f04f23d332ed8eea79055f067c90627.tar.xz |
rt2x00: use generic EWMA functions for average RSSI calculations
Remove the local MOVING_AVERAGE implementation, and use
the generic EWMA functions instead.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index fe4c572db52c..30ed92a6121e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h @@ -39,6 +39,7 @@ #include <linux/input-polldev.h> #include <linux/kfifo.h> #include <linux/hrtimer.h> +#include <linux/average.h> #include <net/mac80211.h> @@ -138,17 +139,6 @@ #define SHORT_EIFS ( SIFS + SHORT_DIFS + \ GET_DURATION(IEEE80211_HEADER + ACK_SIZE, 10) ) -/* - * Structure for average calculation - * The avg field contains the actual average value, - * but avg_weight is internally used during calculations - * to prevent rounding errors. - */ -struct avg_val { - int avg; - int avg_weight; -}; - enum rt2x00_chip_intf { RT2X00_CHIP_INTF_PCI, RT2X00_CHIP_INTF_PCIE, @@ -297,7 +287,7 @@ struct link_ant { * Similar to the avg_rssi in the link_qual structure * this value is updated by using the walking average. */ - struct avg_val rssi_ant; + struct ewma rssi_ant; }; /* @@ -326,7 +316,7 @@ struct link { /* * Currently active average RSSI value */ - struct avg_val avg_rssi; + struct ewma avg_rssi; /* * Work structure for scheduling periodic link tuning. |