nl80211: add generation number to all dumps
In order for userspace to be able to figure out whether it obtained a consistent snapshot of data or not when using netlink dumps, we need to have a generation number in each dump message that indicates whether the list has changed or not -- its value is arbitrary. This patch adds such a number to all dumps, this needs some mac80211 involvement to keep track of a generation number to start with when adding/removing mesh paths or stations. The wiphy and netdev lists can be fully handled within cfg80211, of course, but generation numbers need to be stored there as well. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
f401a6f7ed
commit
f5ea9120be
@@ -372,6 +372,10 @@ struct rate_info {
|
||||
* @txrate: current unicast bitrate to this station
|
||||
* @rx_packets: packets received from this station
|
||||
* @tx_packets: packets transmitted to this station
|
||||
* @generation: generation number for nl80211 dumps.
|
||||
* This number should increase every time the list of stations
|
||||
* changes, i.e. when a station is added or removed, so that
|
||||
* userspace can tell whether it got a consistent snapshot.
|
||||
*/
|
||||
struct station_info {
|
||||
u32 filled;
|
||||
@@ -385,6 +389,8 @@ struct station_info {
|
||||
struct rate_info txrate;
|
||||
u32 rx_packets;
|
||||
u32 tx_packets;
|
||||
|
||||
int generation;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -444,6 +450,10 @@ enum mpath_info_flags {
|
||||
* @flags: mesh path flags
|
||||
* @discovery_timeout: total mesh path discovery timeout, in msecs
|
||||
* @discovery_retries: mesh path discovery retries
|
||||
* @generation: generation number for nl80211 dumps.
|
||||
* This number should increase every time the list of mesh paths
|
||||
* changes, i.e. when a station is added or removed, so that
|
||||
* userspace can tell whether it got a consistent snapshot.
|
||||
*/
|
||||
struct mpath_info {
|
||||
u32 filled;
|
||||
@@ -454,6 +464,8 @@ struct mpath_info {
|
||||
u32 discovery_timeout;
|
||||
u8 discovery_retries;
|
||||
u8 flags;
|
||||
|
||||
int generation;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user