aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/cfg80211.h5
-rw-r--r--net/mac80211/cfg.c9
-rw-r--r--net/wireless/wext-compat.c12
3 files changed, 26 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e1ee1416631d..50e3608f5656 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1342,6 +1342,9 @@ struct cfg80211_gtk_rekey_data {
1342 * doesn't verify much. Note, however, that the passed netdev may be 1342 * doesn't verify much. Note, however, that the passed netdev may be
1343 * %NULL as well if the user requested changing the channel for the 1343 * %NULL as well if the user requested changing the channel for the
1344 * device itself, or for a monitor interface. 1344 * device itself, or for a monitor interface.
1345 * @get_channel: Get the current operating channel, should return %NULL if
1346 * there's no single defined operating channel if for example the
1347 * device implements channel hopping for multi-channel virtual interfaces.
1345 * 1348 *
1346 * @scan: Request to do a scan. If returning zero, the scan request is given 1349 * @scan: Request to do a scan. If returning zero, the scan request is given
1347 * the driver, and will be valid until passed to cfg80211_scan_done(). 1350 * the driver, and will be valid until passed to cfg80211_scan_done().
@@ -1627,6 +1630,8 @@ struct cfg80211_ops {
1627 1630
1628 int (*probe_client)(struct wiphy *wiphy, struct net_device *dev, 1631 int (*probe_client)(struct wiphy *wiphy, struct net_device *dev,
1629 const u8 *peer, u64 *cookie); 1632 const u8 *peer, u64 *cookie);
1633
1634 struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy);
1630}; 1635};
1631 1636
1632/* 1637/*
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index eb54b6cf85c6..192f213cf43e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2590,6 +2590,14 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
2590 return 0; 2590 return 0;
2591} 2591}
2592 2592
2593static struct ieee80211_channel *
2594ieee80211_wiphy_get_channel(struct wiphy *wiphy)
2595{
2596 struct ieee80211_local *local = wiphy_priv(wiphy);
2597
2598 return local->oper_channel;
2599}
2600
2593struct cfg80211_ops mac80211_config_ops = { 2601struct cfg80211_ops mac80211_config_ops = {
2594 .add_virtual_intf = ieee80211_add_iface, 2602 .add_virtual_intf = ieee80211_add_iface,
2595 .del_virtual_intf = ieee80211_del_iface, 2603 .del_virtual_intf = ieee80211_del_iface,
@@ -2656,4 +2664,5 @@ struct cfg80211_ops mac80211_config_ops = {
2656 .tdls_oper = ieee80211_tdls_oper, 2664 .tdls_oper = ieee80211_tdls_oper,
2657 .tdls_mgmt = ieee80211_tdls_mgmt, 2665 .tdls_mgmt = ieee80211_tdls_mgmt,
2658 .probe_client = ieee80211_probe_client, 2666 .probe_client = ieee80211_probe_client,
2667 .get_channel = ieee80211_wiphy_get_channel,
2659}; 2668};
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 62f121d1d9cb..db38c8302b54 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -818,12 +818,24 @@ static int cfg80211_wext_giwfreq(struct net_device *dev,
818 struct iw_freq *freq, char *extra) 818 struct iw_freq *freq, char *extra)
819{ 819{
820 struct wireless_dev *wdev = dev->ieee80211_ptr; 820 struct wireless_dev *wdev = dev->ieee80211_ptr;
821 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
822 struct ieee80211_channel *chan;
821 823
822 switch (wdev->iftype) { 824 switch (wdev->iftype) {
823 case NL80211_IFTYPE_STATION: 825 case NL80211_IFTYPE_STATION:
824 return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra); 826 return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
825 case NL80211_IFTYPE_ADHOC: 827 case NL80211_IFTYPE_ADHOC:
826 return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra); 828 return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
829 case NL80211_IFTYPE_MONITOR:
830 if (!rdev->ops->get_channel)
831 return -EINVAL;
832
833 chan = rdev->ops->get_channel(wdev->wiphy);
834 if (!chan)
835 return -EINVAL;
836 freq->m = chan->center_freq;
837 freq->e = 6;
838 return 0;
827 default: 839 default:
828 if (!wdev->channel) 840 if (!wdev->channel)
829 return -EINVAL; 841 return -EINVAL;