Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86479
b: refs/heads/master
c: 53b3f8e
h: refs/heads/master
i:
  86477: 24e8ca0
  86475: d7c024a
  86471: 49e76fd
  86463: af32b9b
v: v3
  • Loading branch information
Ivo van Doorn authored and John W. Linville committed Feb 28, 2008
1 parent 28f57d0 commit 2a35170
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 05253c93feb40901d80a0d6f239a0bc78860c679
refs/heads/master: 53b3f8e47a38f39836da1c9f9d2ea9a9c164c8f4
49 changes: 30 additions & 19 deletions trunk/drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,33 @@ EXPORT_SYMBOL_GPL(rt2x00lib_get_ring);
/*
* Link tuning handlers
*/
static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev)
{
if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
return;

/*
* Reset link information.
* Both the currently active vgc level as well as
* the link tuner counter should be reset. Resetting
* the counter is important for devices where the
* device should only perform link tuning during the
* first minute after being enabled.
*/
rt2x00dev->link.count = 0;
rt2x00dev->link.vgc_level = 0;

/*
* Reset the link tuner.
*/
rt2x00dev->ops->lib->reset_tuner(rt2x00dev);
}

static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
{
/*
* Clear all (possibly) pre-existing quality statistics.
*/
memset(&rt2x00dev->link.qual, 0, sizeof(rt2x00dev->link.qual));

/*
Expand All @@ -79,10 +101,7 @@ static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
rt2x00dev->link.qual.rx_percentage = 50;
rt2x00dev->link.qual.tx_percentage = 50;

/*
* Reset the link tuner.
*/
rt2x00dev->ops->lib->reset_tuner(rt2x00dev);
rt2x00lib_reset_link_tuner(rt2x00dev);

queue_delayed_work(rt2x00dev->hw->workqueue,
&rt2x00dev->link.work, LINK_TUNE_INTERVAL);
Expand All @@ -93,15 +112,6 @@ static void rt2x00lib_stop_link_tuner(struct rt2x00_dev *rt2x00dev)
cancel_delayed_work_sync(&rt2x00dev->link.work);
}

void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev)
{
if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
return;

rt2x00lib_stop_link_tuner(rt2x00dev);
rt2x00lib_start_link_tuner(rt2x00dev);
}

/*
* Ring initialization
*/
Expand Down Expand Up @@ -432,17 +442,18 @@ static void rt2x00lib_link_tuner(struct work_struct *work)
if (!test_bit(CONFIG_DISABLE_LINK_TUNING, &rt2x00dev->flags))
rt2x00dev->ops->lib->link_tuner(rt2x00dev);

/*
* Evaluate antenna setup.
*/
rt2x00lib_evaluate_antenna(rt2x00dev);

/*
* Precalculate a portion of the link signal which is
* in based on the tx/rx success/failure counters.
*/
rt2x00lib_precalculate_link_signal(&rt2x00dev->link.qual);

/*
* Evaluate antenna setup, make this the last step since this could
* possibly reset some statistics.
*/
rt2x00lib_evaluate_antenna(rt2x00dev);

/*
* Increase tuner counter, and reschedule the next link tuner run.
*/
Expand Down

0 comments on commit 2a35170

Please sign in to comment.