cfg80211/mac80211: re-add get_channel operation
[deliverable/linux.git] / net / wireless / nl80211.c
index 079fc49e3975be98a8961e3d971d3f1dba42b86d..6b001e445718fdaaa0e1773e8cbdbd609bc02ed5 100644 (file)
@@ -1759,11 +1759,17 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 pid, u32 seq, int flags,
                        (cfg80211_rdev_list_generation << 2)))
                goto nla_put_failure;
 
-       if (rdev->monitor_channel) {
-               if (nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ,
-                               rdev->monitor_channel->center_freq) ||
-                   nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
-                               rdev->monitor_channel_type))
+       if (rdev->ops->get_channel) {
+               struct ieee80211_channel *chan;
+               enum nl80211_channel_type channel_type;
+
+               chan = rdev->ops->get_channel(&rdev->wiphy, wdev,
+                                             &channel_type);
+               if (chan &&
+                   (nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ,
+                                chan->center_freq) ||
+                    nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE,
+                                channel_type)))
                        goto nla_put_failure;
        }
 
This page took 0.043414 seconds and 5 git commands to generate.