aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2007-10-13 10:26:32 -0400
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:02:52 -0500
commit8de8c5162b157884aa4855564cbfd9ec9119c819 (patch)
tree42171390590a9623117846ccd377c4b42e72ddf1 /drivers
parent39e75857d08fe35ffad4dd9004580acf0d725b75 (diff)
[PATCH] rt2x00: Remove rt2x00_clear_link
rt2x00_clear_link() was becoming too large for statically inline, also it was used on a single location and shouldn't really be used anywhere else. So move the entire code into the function rt2x00lib_start_link_tuner() Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h18
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c16
2 files changed, 18 insertions, 16 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index c47a1e6333cc..d6f0a72b7a0c 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -277,25 +277,13 @@ struct link {
277}; 277};
278 278
279/* 279/*
280 * Clear all counters inside the link structure.
281 */
282static inline void rt2x00_clear_link(struct link *link)
283{
284 link->count = 0;
285 memset(&link->qual, 0, sizeof(link->qual));
286 link->qual.rx_percentage = 50;
287 link->qual.tx_percentage = 50;
288}
289
290/*
291 * Update the rssi using the walking average approach. 280 * Update the rssi using the walking average approach.
292 */ 281 */
293static inline void rt2x00_update_link_rssi(struct link *link, int rssi) 282static inline void rt2x00_update_link_rssi(struct link *link, int rssi)
294{ 283{
295 if (!link->qual.avg_rssi) 284 if (link->qual.avg_rssi)
296 link->qual.avg_rssi = rssi; 285 rssi = ((link->qual.avg_rssi * 7) + rssi) / 8;
297 else 286 link->qual.avg_rssi = rssi;
298 link->qual.avg_rssi = ((link->qual.avg_rssi * 7) + rssi) / 8;
299} 287}
300 288
301/* 289/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index b2016f459d3b..0f824b27f1ef 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -67,7 +67,21 @@ EXPORT_SYMBOL_GPL(rt2x00lib_get_ring);
67 */ 67 */
68static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev) 68static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
69{ 69{
70 rt2x00_clear_link(&rt2x00dev->link); 70 rt2x00dev->link.count = 0;
71 rt2x00dev->link.vgc_level = 0;
72
73 memset(&rt2x00dev->link.qual, 0, sizeof(rt2x00dev->link.qual));
74
75 /*
76 * The RX and TX percentage should start at 50%
77 * this will assure we will get at least get some
78 * decent value when the link tuner starts.
79 * The value will be dropped and overwritten with
80 * the correct (measured )value anyway during the
81 * first run of the link tuner.
82 */
83 rt2x00dev->link.qual.rx_percentage = 50;
84 rt2x00dev->link.qual.tx_percentage = 50;
71 85
72 /* 86 /*
73 * Reset the link tuner. 87 * Reset the link tuner.