diff options
author | Michael Wu <flamingice@sourmilk.net> | 2008-01-31 13:48:22 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:37:02 -0500 |
commit | 66f7ac50ed7cc5c19a62bc97e8f6e7891004a03a (patch) | |
tree | 92c4756ae29b64aee4a76a043fd46bb02472cfd9 /include | |
parent | e4c26add8893e40e6e809b8c1ebc81e37762af2b (diff) |
nl80211: Add monitor interface configuration flags
This allows precise control over what a monitor interface shows.
Signed-off-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nl80211.h | 35 | ||||
-rw-r--r-- | include/net/cfg80211.h | 24 |
2 files changed, 57 insertions, 2 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 63695060db9f..a9f0b93324a2 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -164,6 +164,9 @@ enum nl80211_commands { | |||
164 | * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands, | 164 | * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands, |
165 | * consisting of a nested array. | 165 | * consisting of a nested array. |
166 | * | 166 | * |
167 | * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of | ||
168 | * &enum nl80211_mntr_flags. | ||
169 | * | ||
167 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 170 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
168 | * @__NL80211_ATTR_AFTER_LAST: internal use | 171 | * @__NL80211_ATTR_AFTER_LAST: internal use |
169 | */ | 172 | */ |
@@ -200,6 +203,8 @@ enum nl80211_attrs { | |||
200 | 203 | ||
201 | NL80211_ATTR_WIPHY_BANDS, | 204 | NL80211_ATTR_WIPHY_BANDS, |
202 | 205 | ||
206 | NL80211_ATTR_MNTR_FLAGS, | ||
207 | |||
203 | /* add attributes here, update the policy in nl80211.c */ | 208 | /* add attributes here, update the policy in nl80211.c */ |
204 | 209 | ||
205 | __NL80211_ATTR_AFTER_LAST, | 210 | __NL80211_ATTR_AFTER_LAST, |
@@ -344,4 +349,34 @@ enum nl80211_bitrate_attr { | |||
344 | NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1 | 349 | NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1 |
345 | }; | 350 | }; |
346 | 351 | ||
352 | /** | ||
353 | * enum nl80211_mntr_flags - monitor configuration flags | ||
354 | * | ||
355 | * Monitor configuration flags. | ||
356 | * | ||
357 | * @__NL80211_MNTR_FLAG_INVALID: reserved | ||
358 | * | ||
359 | * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS | ||
360 | * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP | ||
361 | * @NL80211_MNTR_FLAG_CONTROL: pass control frames | ||
362 | * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering | ||
363 | * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing. | ||
364 | * overrides all other flags. | ||
365 | * | ||
366 | * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use | ||
367 | * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag | ||
368 | */ | ||
369 | enum nl80211_mntr_flags { | ||
370 | __NL80211_MNTR_FLAG_INVALID, | ||
371 | NL80211_MNTR_FLAG_FCSFAIL, | ||
372 | NL80211_MNTR_FLAG_PLCPFAIL, | ||
373 | NL80211_MNTR_FLAG_CONTROL, | ||
374 | NL80211_MNTR_FLAG_OTHER_BSS, | ||
375 | NL80211_MNTR_FLAG_COOK_FRAMES, | ||
376 | |||
377 | /* keep last */ | ||
378 | __NL80211_MNTR_FLAG_AFTER_LAST, | ||
379 | NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1 | ||
380 | }; | ||
381 | |||
347 | #endif /* __LINUX_NL80211_H */ | 382 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index bcc480b8892a..ab4caf63954f 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -163,6 +163,26 @@ struct station_stats { | |||
163 | u32 tx_bytes; | 163 | u32 tx_bytes; |
164 | }; | 164 | }; |
165 | 165 | ||
166 | /** | ||
167 | * enum monitor_flags - monitor flags | ||
168 | * | ||
169 | * Monitor interface configuration flags. Note that these must be the bits | ||
170 | * according to the nl80211 flags. | ||
171 | * | ||
172 | * @MONITOR_FLAG_FCSFAIL: pass frames with bad FCS | ||
173 | * @MONITOR_FLAG_PLCPFAIL: pass frames with bad PLCP | ||
174 | * @MONITOR_FLAG_CONTROL: pass control frames | ||
175 | * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering | ||
176 | * @MONITOR_FLAG_COOK_FRAMES: report frames after processing | ||
177 | */ | ||
178 | enum monitor_flags { | ||
179 | MONITOR_FLAG_FCSFAIL = 1<<NL80211_MNTR_FLAG_FCSFAIL, | ||
180 | MONITOR_FLAG_PLCPFAIL = 1<<NL80211_MNTR_FLAG_PLCPFAIL, | ||
181 | MONITOR_FLAG_CONTROL = 1<<NL80211_MNTR_FLAG_CONTROL, | ||
182 | MONITOR_FLAG_OTHER_BSS = 1<<NL80211_MNTR_FLAG_OTHER_BSS, | ||
183 | MONITOR_FLAG_COOK_FRAMES = 1<<NL80211_MNTR_FLAG_COOK_FRAMES, | ||
184 | }; | ||
185 | |||
166 | /* from net/wireless.h */ | 186 | /* from net/wireless.h */ |
167 | struct wiphy; | 187 | struct wiphy; |
168 | 188 | ||
@@ -213,10 +233,10 @@ struct wiphy; | |||
213 | */ | 233 | */ |
214 | struct cfg80211_ops { | 234 | struct cfg80211_ops { |
215 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, | 235 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, |
216 | enum nl80211_iftype type); | 236 | enum nl80211_iftype type, u32 *flags); |
217 | int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex); | 237 | int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex); |
218 | int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex, | 238 | int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex, |
219 | enum nl80211_iftype type); | 239 | enum nl80211_iftype type, u32 *flags); |
220 | 240 | ||
221 | int (*add_key)(struct wiphy *wiphy, struct net_device *netdev, | 241 | int (*add_key)(struct wiphy *wiphy, struct net_device *netdev, |
222 | u8 key_index, u8 *mac_addr, | 242 | u8 key_index, u8 *mac_addr, |