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/linux/nl80211.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/linux/nl80211.h')
-rw-r--r-- | include/linux/nl80211.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index d2f276de9abe..45db17f81aa3 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -160,6 +160,11 @@ | |||
160 | * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, | 160 | * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, |
161 | * partial scan results may be available | 161 | * partial scan results may be available |
162 | * | 162 | * |
163 | * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation | ||
164 | * or noise level | ||
165 | * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to | ||
166 | * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) | ||
167 | * | ||
163 | * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain | 168 | * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain |
164 | * has been changed and provides details of the request information | 169 | * has been changed and provides details of the request information |
165 | * that caused the change such as who initiated the regulatory request | 170 | * that caused the change such as who initiated the regulatory request |
@@ -341,6 +346,9 @@ enum nl80211_commands { | |||
341 | 346 | ||
342 | NL80211_CMD_SET_WIPHY_NETNS, | 347 | NL80211_CMD_SET_WIPHY_NETNS, |
343 | 348 | ||
349 | NL80211_CMD_GET_SURVEY, | ||
350 | NL80211_CMD_NEW_SURVEY_RESULTS, | ||
351 | |||
344 | /* add new commands above here */ | 352 | /* add new commands above here */ |
345 | 353 | ||
346 | /* used to define NL80211_CMD_MAX below */ | 354 | /* used to define NL80211_CMD_MAX below */ |
@@ -586,6 +594,10 @@ enum nl80211_commands { | |||
586 | * | 594 | * |
587 | * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface | 595 | * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface |
588 | * | 596 | * |
597 | * @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of | ||
598 | * the survey response for %NL80211_CMD_GET_SURVEY, nested attribute | ||
599 | * containing info as possible, see &enum survey_info. | ||
600 | * | ||
589 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 601 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
590 | * @__NL80211_ATTR_AFTER_LAST: internal use | 602 | * @__NL80211_ATTR_AFTER_LAST: internal use |
591 | */ | 603 | */ |
@@ -718,6 +730,8 @@ enum nl80211_attrs { | |||
718 | 730 | ||
719 | NL80211_ATTR_4ADDR, | 731 | NL80211_ATTR_4ADDR, |
720 | 732 | ||
733 | NL80211_ATTR_SURVEY_INFO, | ||
734 | |||
721 | /* add attributes here, update the policy in nl80211.c */ | 735 | /* add attributes here, update the policy in nl80211.c */ |
722 | 736 | ||
723 | __NL80211_ATTR_AFTER_LAST, | 737 | __NL80211_ATTR_AFTER_LAST, |
@@ -1121,6 +1135,26 @@ enum nl80211_reg_rule_flags { | |||
1121 | }; | 1135 | }; |
1122 | 1136 | ||
1123 | /** | 1137 | /** |
1138 | * enum nl80211_survey_info - survey information | ||
1139 | * | ||
1140 | * These attribute types are used with %NL80211_ATTR_SURVEY_INFO | ||
1141 | * when getting information about a survey. | ||
1142 | * | ||
1143 | * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved | ||
1144 | * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel | ||
1145 | * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) | ||
1146 | */ | ||
1147 | enum nl80211_survey_info { | ||
1148 | __NL80211_SURVEY_INFO_INVALID, | ||
1149 | NL80211_SURVEY_INFO_FREQUENCY, | ||
1150 | NL80211_SURVEY_INFO_NOISE, | ||
1151 | |||
1152 | /* keep last */ | ||
1153 | __NL80211_SURVEY_INFO_AFTER_LAST, | ||
1154 | NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1 | ||
1155 | }; | ||
1156 | |||
1157 | /** | ||
1124 | * enum nl80211_mntr_flags - monitor configuration flags | 1158 | * enum nl80211_mntr_flags - monitor configuration flags |
1125 | * | 1159 | * |
1126 | * Monitor configuration flags. | 1160 | * Monitor configuration flags. |