diff options
author | Holger Schurig <holgerschurig@gmail.com> | 2009-11-11 06:25:40 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-13 17:43:58 -0500 |
commit | 61fa713c751683da915fa0c1aa502be85822c357 (patch) | |
tree | a4f286a2bb59b9afd1f3b836cb62a8e81bafee98 /include/net/cfg80211.h | |
parent | a043897a314e8bcfc821d54fe4e591efed5936a3 (diff) |
cfg80211: return channel noise via survey API
This patch implements the NL80211_CMD_GET_SURVEY command and an get_survey()
ops that a driver can implement. The goal of this command is to allow a
drivers to report channel survey data (e.g. channel noise, channel
occupation).
For now, only the mechanism to report back channel noise has been
implemented.
In future, there will either be a survey-trigger command --- or the existing
scan-trigger command will be enhanced. This will allow user-space to
request survey for arbitrary channels.
Note: any driver that cannot report channel noise should not report
any value at all, e.g. made-up -92 dBm.
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r-- | include/net/cfg80211.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0e4c51fc63e5..21710fc17eaf 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -235,6 +235,35 @@ struct key_params { | |||
235 | }; | 235 | }; |
236 | 236 | ||
237 | /** | 237 | /** |
238 | * enum survey_info_flags - survey information flags | ||
239 | * | ||
240 | * Used by the driver to indicate which info in &struct survey_info | ||
241 | * it has filled in during the get_survey(). | ||
242 | */ | ||
243 | enum survey_info_flags { | ||
244 | SURVEY_INFO_NOISE_DBM = 1<<0, | ||
245 | }; | ||
246 | |||
247 | /** | ||
248 | * struct survey_info - channel survey response | ||
249 | * | ||
250 | * Used by dump_survey() to report back per-channel survey information. | ||
251 | * | ||
252 | * @channel: the channel this survey record reports, mandatory | ||
253 | * @filled: bitflag of flags from &enum survey_info_flags | ||
254 | * @noise: channel noise in dBm. This and all following fields are | ||
255 | * optional | ||
256 | * | ||
257 | * This structure can later be expanded with things like | ||
258 | * channel duty cycle etc. | ||
259 | */ | ||
260 | struct survey_info { | ||
261 | struct ieee80211_channel *channel; | ||
262 | u32 filled; | ||
263 | s8 noise; | ||
264 | }; | ||
265 | |||
266 | /** | ||
238 | * struct beacon_parameters - beacon parameters | 267 | * struct beacon_parameters - beacon parameters |
239 | * | 268 | * |
240 | * Used to configure the beacon for an interface. | 269 | * Used to configure the beacon for an interface. |
@@ -944,6 +973,8 @@ struct cfg80211_bitrate_mask { | |||
944 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting | 973 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting |
945 | * functions to adjust rfkill hw state | 974 | * functions to adjust rfkill hw state |
946 | * | 975 | * |
976 | * @dump_survey: get site survey information. | ||
977 | * | ||
947 | * @testmode_cmd: run a test mode command | 978 | * @testmode_cmd: run a test mode command |
948 | */ | 979 | */ |
949 | struct cfg80211_ops { | 980 | struct cfg80211_ops { |
@@ -1063,6 +1094,9 @@ struct cfg80211_ops { | |||
1063 | const u8 *peer, | 1094 | const u8 *peer, |
1064 | const struct cfg80211_bitrate_mask *mask); | 1095 | const struct cfg80211_bitrate_mask *mask); |
1065 | 1096 | ||
1097 | int (*dump_survey)(struct wiphy *wiphy, struct net_device *netdev, | ||
1098 | int idx, struct survey_info *info); | ||
1099 | |||
1066 | /* some temporary stuff to finish wext */ | 1100 | /* some temporary stuff to finish wext */ |
1067 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1101 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
1068 | bool enabled, int timeout); | 1102 | bool enabled, int timeout); |