Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107104
b: refs/heads/master
c: 74c0ee9
h: refs/heads/master
v: v3
  • Loading branch information
Ivo van Doorn authored and John W. Linville committed Jul 29, 2008
1 parent c01151b commit bffbf4a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 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: 4104863fb4a724723d1d5f3cba9d3c5084087e45
refs/heads/master: 74c0ee9b59bdaa81a666d5d58022f847390e4b0c
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ enum rt2x00_flags {
DEVICE_STARTED_SUSPEND,
DEVICE_ENABLED_RADIO,
DEVICE_DISABLED_RADIO_HW,
DEVICE_DIRTY_CONFIG,

/*
* Driver features
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@ int rt2x00lib_start(struct rt2x00_dev *rt2x00dev)
rt2x00dev->intf_associated = 0;

__set_bit(DEVICE_STARTED, &rt2x00dev->flags);
__set_bit(DEVICE_DIRTY_CONFIG, &rt2x00dev->flags);

return 0;
}
Expand Down Expand Up @@ -1237,9 +1238,9 @@ int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev)
/*
* Reconfigure device.
*/
rt2x00lib_config(rt2x00dev, &rt2x00dev->hw->conf, 1);
if (!rt2x00dev->hw->conf.radio_enabled)
rt2x00lib_disable_radio(rt2x00dev);
retval = rt2x00mac_config(rt2x00dev->hw, &rt2x00dev->hw->conf);
if (retval)
goto exit;

/*
* Iterator over each active interface to
Expand Down
13 changes: 12 additions & 1 deletion trunk/drivers/net/wireless/rt2x00/rt2x00mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ EXPORT_SYMBOL_GPL(rt2x00mac_remove_interface);
int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
{
struct rt2x00_dev *rt2x00dev = hw->priv;
int force_reconfig;

/*
* Mac80211 might be calling this function while we are trying
Expand All @@ -329,7 +330,17 @@ int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
}

rt2x00lib_config(rt2x00dev, conf, 0);
/*
* When the DEVICE_DIRTY_CONFIG flag is set, the device has recently
* been started and the configuration must be forced upon the hardware.
* Otherwise registers will not be intialized correctly and could
* result in non-working hardware because essential registers aren't
* initialized.
*/
force_reconfig =
__test_and_clear_bit(DEVICE_DIRTY_CONFIG, &rt2x00dev->flags);

rt2x00lib_config(rt2x00dev, conf, force_reconfig);

/*
* Reenable RX only if the radio should be on.
Expand Down

0 comments on commit bffbf4a

Please sign in to comment.