aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorHolger Schurig <holgerschurig@gmail.com>2010-04-19 04:23:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-20 11:50:52 -0400
commit1289723ef238908ca8d95ff48a46ee0de970f882 (patch)
treeb4d584aee8abcc33dec2039fb45112156d3cd3d0 /net/mac80211
parent03ceedea972a82d343fa5c2528b3952fa9e615d5 (diff)
mac80211: sample survey implementation for mac80211 & hwsim
This adds the survey function to both mac80211 itself and to mac80211_hwsim. For the latter driver, we simply invent some noise level.A real driver which cannot determine the real channel noise MUST NOT report any noise, especially not a magically conjured one :-) Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c12
-rw-r--r--net/mac80211/driver-ops.h9
2 files changed, 21 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 4edd73cbf052..f97dda735cbb 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -410,6 +410,17 @@ static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
410 return ret; 410 return ret;
411} 411}
412 412
413static int ieee80211_dump_survey(struct wiphy *wiphy, struct net_device *dev,
414 int idx, struct survey_info *survey)
415{
416 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
417
418 if (!local->ops->get_survey)
419 return -EOPNOTSUPP;
420
421 return drv_get_survey(local, idx, survey);
422}
423
413static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev, 424static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,
414 u8 *mac, struct station_info *sinfo) 425 u8 *mac, struct station_info *sinfo)
415{ 426{
@@ -1507,6 +1518,7 @@ struct cfg80211_ops mac80211_config_ops = {
1507 .change_station = ieee80211_change_station, 1518 .change_station = ieee80211_change_station,
1508 .get_station = ieee80211_get_station, 1519 .get_station = ieee80211_get_station,
1509 .dump_station = ieee80211_dump_station, 1520 .dump_station = ieee80211_dump_station,
1521 .dump_survey = ieee80211_dump_survey,
1510#ifdef CONFIG_MAC80211_MESH 1522#ifdef CONFIG_MAC80211_MESH
1511 .add_mpath = ieee80211_add_mpath, 1523 .add_mpath = ieee80211_add_mpath,
1512 .del_mpath = ieee80211_del_mpath, 1524 .del_mpath = ieee80211_del_mpath,
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index c3d844093a2f..d1f8a7c2225a 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -346,6 +346,15 @@ static inline int drv_ampdu_action(struct ieee80211_local *local,
346 return ret; 346 return ret;
347} 347}
348 348
349static inline int drv_get_survey(struct ieee80211_local *local, int idx,
350 struct survey_info *survey)
351{
352 int ret = -EOPNOTSUPP;
353 if (local->ops->conf_tx)
354 ret = local->ops->get_survey(&local->hw, idx, survey);
355 /* trace_drv_get_survey(local, idx, survey, ret); */
356 return ret;
357}
349 358
350static inline void drv_rfkill_poll(struct ieee80211_local *local) 359static inline void drv_rfkill_poll(struct ieee80211_local *local)
351{ 360{