aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPontus Fuchs <pontus.fuchs@gmail.com>2012-04-03 10:39:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-13 14:32:49 -0400
commitd91df0e3a1b9a7427785cb8d28be073df9b18b78 (patch)
treeecaafaaf178a20fdcbe21fc5c8e586527ab45aa1 /net
parent3a4b43fde103da510d8962a073bb748706f426bd (diff)
cfg80211: Add channel information to NL80211_CMD_GET_INTERFACE
If the current channel is known, add frequency and channel type to NL80211_CMD_GET_INTERFACE. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c4
-rw-r--r--net/wireless/nl80211.c13
-rw-r--r--net/wireless/wext-compat.c3
3 files changed, 18 insertions, 2 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 355735491252..510a745c3108 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2688,10 +2688,12 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
2688} 2688}
2689 2689
2690static struct ieee80211_channel * 2690static struct ieee80211_channel *
2691ieee80211_wiphy_get_channel(struct wiphy *wiphy) 2691ieee80211_wiphy_get_channel(struct wiphy *wiphy,
2692 enum nl80211_channel_type *type)
2692{ 2693{
2693 struct ieee80211_local *local = wiphy_priv(wiphy); 2694 struct ieee80211_local *local = wiphy_priv(wiphy);
2694 2695
2696 *type = local->_oper_channel_type;
2695 return local->oper_channel; 2697 return local->oper_channel;
2696} 2698}
2697 2699
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 5e261234d271..bcf6f70e518d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1501,6 +1501,19 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags,
1501 rdev->devlist_generation ^ 1501 rdev->devlist_generation ^
1502 (cfg80211_rdev_list_generation << 2)); 1502 (cfg80211_rdev_list_generation << 2));
1503 1503
1504 if (rdev->ops->get_channel) {
1505 struct ieee80211_channel *chan;
1506 enum nl80211_channel_type channel_type;
1507
1508 chan = rdev->ops->get_channel(&rdev->wiphy, &channel_type);
1509 if (chan) {
1510 NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ,
1511 chan->center_freq);
1512 NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
1513 channel_type);
1514 }
1515 }
1516
1504 return genlmsg_end(msg, hdr); 1517 return genlmsg_end(msg, hdr);
1505 1518
1506 nla_put_failure: 1519 nla_put_failure:
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 3c24eb97e9d7..6a6181a673ca 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -821,6 +821,7 @@ static int cfg80211_wext_giwfreq(struct net_device *dev,
821 struct wireless_dev *wdev = dev->ieee80211_ptr; 821 struct wireless_dev *wdev = dev->ieee80211_ptr;
822 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); 822 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
823 struct ieee80211_channel *chan; 823 struct ieee80211_channel *chan;
824 enum nl80211_channel_type channel_type;
824 825
825 switch (wdev->iftype) { 826 switch (wdev->iftype) {
826 case NL80211_IFTYPE_STATION: 827 case NL80211_IFTYPE_STATION:
@@ -831,7 +832,7 @@ static int cfg80211_wext_giwfreq(struct net_device *dev,
831 if (!rdev->ops->get_channel) 832 if (!rdev->ops->get_channel)
832 return -EINVAL; 833 return -EINVAL;
833 834
834 chan = rdev->ops->get_channel(wdev->wiphy); 835 chan = rdev->ops->get_channel(wdev->wiphy, &channel_type);
835 if (!chan) 836 if (!chan)
836 return -EINVAL; 837 return -EINVAL;
837 freq->m = chan->center_freq; 838 freq->m = chan->center_freq;