X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=net%2Fwireless%2Fwext-compat.c;h=3c24eb97e9d7f0eaf60cff02f2372967f29e5284;hb=e11c259f745889b55bc5596ca78271f2f5cf08d2;hp=62f121d1d9cbdb833d27990fc36b58f2e3ab22aa;hpb=97d2eb13a019ec09cc1a7ea2d3705c0b117b3c0d;p=cascardo%2Flinux.git diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 62f121d1d9cb..3c24eb97e9d7 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c @@ -8,6 +8,7 @@ * Copyright 2008-2009 Johannes Berg */ +#include #include #include #include @@ -818,12 +819,24 @@ static int cfg80211_wext_giwfreq(struct net_device *dev, struct iw_freq *freq, char *extra) { struct wireless_dev *wdev = dev->ieee80211_ptr; + struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); + struct ieee80211_channel *chan; switch (wdev->iftype) { case NL80211_IFTYPE_STATION: return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra); case NL80211_IFTYPE_ADHOC: return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra); + case NL80211_IFTYPE_MONITOR: + if (!rdev->ops->get_channel) + return -EINVAL; + + chan = rdev->ops->get_channel(wdev->wiphy); + if (!chan) + return -EINVAL; + freq->m = chan->center_freq; + freq->e = 6; + return 0; default: if (!wdev->channel) return -EINVAL;