Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194501
b: refs/heads/master
c: 1289723
h: refs/heads/master
i:
  194499: f7cd769
v: v3
  • Loading branch information
Holger Schurig authored and John W. Linville committed Apr 20, 2010
1 parent d7a2f2d commit d6605de
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03ceedea972a82d343fa5c2528b3952fa9e615d5
refs/heads/master: 1289723ef238908ca8d95ff48a46ee0de970f882
28 changes: 28 additions & 0 deletions trunk/drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,33 @@ static int mac80211_hwsim_conf_tx(
return 0;
}

static int mac80211_hwsim_get_survey(
struct ieee80211_hw *hw, int idx,
struct survey_info *survey)
{
struct ieee80211_conf *conf = &hw->conf;

printk(KERN_DEBUG "%s:%s (idx=%d)\n",
wiphy_name(hw->wiphy), __func__, idx);

if (idx != 0)
return -ENOENT;

/* Current channel */
survey->channel = conf->channel;

/*
* Magically conjured noise level --- this is only ok for simulated hardware.
*
* A real driver which cannot determine the real channel noise MUST NOT
* report any noise, especially not a magically conjured one :-)
*/
survey->filled = SURVEY_INFO_NOISE_DBM;
survey->noise = -92;

return 0;
}

#ifdef CONFIG_NL80211_TESTMODE
/*
* This section contains example code for using netlink
Expand Down Expand Up @@ -1012,6 +1039,7 @@ static struct ieee80211_ops mac80211_hwsim_ops =
.sta_notify = mac80211_hwsim_sta_notify,
.set_tim = mac80211_hwsim_set_tim,
.conf_tx = mac80211_hwsim_conf_tx,
.get_survey = mac80211_hwsim_get_survey,
CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd)
.ampdu_action = mac80211_hwsim_ampdu_action,
.sw_scan_start = mac80211_hwsim_sw_scan,
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,8 @@ struct ieee80211_ops {
struct ieee80211_vif *vif,
enum ieee80211_ampdu_mlme_action action,
struct ieee80211_sta *sta, u16 tid, u16 *ssn);

int (*get_survey)(struct ieee80211_hw *hw, int idx,
struct survey_info *survey);
void (*rfkill_poll)(struct ieee80211_hw *hw);
void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
#ifdef CONFIG_NL80211_TESTMODE
Expand Down
12 changes: 12 additions & 0 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,17 @@ static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
return ret;
}

static int ieee80211_dump_survey(struct wiphy *wiphy, struct net_device *dev,
int idx, struct survey_info *survey)
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);

if (!local->ops->get_survey)
return -EOPNOTSUPP;

return drv_get_survey(local, idx, survey);
}

static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,
u8 *mac, struct station_info *sinfo)
{
Expand Down Expand Up @@ -1507,6 +1518,7 @@ struct cfg80211_ops mac80211_config_ops = {
.change_station = ieee80211_change_station,
.get_station = ieee80211_get_station,
.dump_station = ieee80211_dump_station,
.dump_survey = ieee80211_dump_survey,
#ifdef CONFIG_MAC80211_MESH
.add_mpath = ieee80211_add_mpath,
.del_mpath = ieee80211_del_mpath,
Expand Down
9 changes: 9 additions & 0 deletions trunk/net/mac80211/driver-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,15 @@ static inline int drv_ampdu_action(struct ieee80211_local *local,
return ret;
}

static inline int drv_get_survey(struct ieee80211_local *local, int idx,
struct survey_info *survey)
{
int ret = -EOPNOTSUPP;
if (local->ops->conf_tx)
ret = local->ops->get_survey(&local->hw, idx, survey);
/* trace_drv_get_survey(local, idx, survey, ret); */
return ret;
}

static inline void drv_rfkill_poll(struct ieee80211_local *local)
{
Expand Down

0 comments on commit d6605de

Please sign in to comment.