Skip to content

Commit

Permalink
rt2x00: Make periodic beacon updates for PCI devices atomic
Browse files Browse the repository at this point in the history
Allow the beacondone and pretbtt functions to update the beacon from
atomic context by using the beacon update functions with caller locking.

This is a preparation for moving the periodic beacon handling into
tasklets that require atomic context.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Helmut Schaa authored and John W. Linville committed Jan 31, 2011
1 parent 1dae8d3 commit 8d59c4e
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,13 @@ static void rt2x00lib_beaconupdate_iter(void *data, u8 *mac,
vif->type != NL80211_IFTYPE_WDS)
return;

rt2x00queue_update_beacon(rt2x00dev, vif);
/*
* Update the beacon without locking. This is safe on PCI devices
* as they only update the beacon periodically here. This should
* never be called for USB devices.
*/
WARN_ON(rt2x00_is_usb(rt2x00dev));
rt2x00queue_update_beacon_locked(rt2x00dev, vif);
}

void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
Expand All @@ -183,9 +189,9 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
return;

/* send buffered bc/mc frames out for every bssid */
ieee80211_iterate_active_interfaces(rt2x00dev->hw,
rt2x00lib_bc_buffer_iter,
rt2x00dev);
ieee80211_iterate_active_interfaces_atomic(rt2x00dev->hw,
rt2x00lib_bc_buffer_iter,
rt2x00dev);
/*
* Devices with pre tbtt interrupt don't need to update the beacon
* here as they will fetch the next beacon directly prior to
Expand All @@ -195,9 +201,9 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
return;

/* fetch next beacon */
ieee80211_iterate_active_interfaces(rt2x00dev->hw,
rt2x00lib_beaconupdate_iter,
rt2x00dev);
ieee80211_iterate_active_interfaces_atomic(rt2x00dev->hw,
rt2x00lib_beaconupdate_iter,
rt2x00dev);
}
EXPORT_SYMBOL_GPL(rt2x00lib_beacondone);

Expand All @@ -207,9 +213,9 @@ void rt2x00lib_pretbtt(struct rt2x00_dev *rt2x00dev)
return;

/* fetch next beacon */
ieee80211_iterate_active_interfaces(rt2x00dev->hw,
rt2x00lib_beaconupdate_iter,
rt2x00dev);
ieee80211_iterate_active_interfaces_atomic(rt2x00dev->hw,
rt2x00lib_beaconupdate_iter,
rt2x00dev);
}
EXPORT_SYMBOL_GPL(rt2x00lib_pretbtt);

Expand Down

0 comments on commit 8d59c4e

Please sign in to comment.