All of lore.kernel.org
 help / color / mirror / Atom feed
* Cannot use ioctl SIOCGIWFREQ
@ 2013-03-09 21:46 C. McPherson
  0 siblings, 0 replies; only message in thread
From: C. McPherson @ 2013-03-09 21:46 UTC (permalink / raw)
  To: linux-wireless

Hello:
I am running my compat-wireless with version 3.8-1 and found that when I 
issue ghe SIOCGIWFREQ ioctl while in monitor mode returns with a 
-ENODATA. I have found that the ieee80211_cfg_get_channel function in 
net/wireless/cfg.c does not account for any channel context when the 
interface is in monitor mode and any attepmpt to use the SIOCGIWFREQ 
function will error out. I have modified my local version to include a 
check for a monitor interfaces  The code block below fixes the problem:


static int ieee80211_cfg_get_channel(struct wiphy *wiphy,
                                      struct wireless_dev *wdev,
                                      struct cfg80211_chan_def *chandef)
{
         struct ieee80211_sub_if_data *sdata = 
IEEE80211_WDEV_TO_SUB_IF(wdev);
         struct ieee80211_chanctx_conf *chanctx_conf;
         struct ieee80211_local *local = wiphy_priv(wiphy);
         int ret = -ENODATA;


         if (!wdev)
                 return -EOPNOTSUPP;

         switch (wdev->iftype) {
                 case NL80211_IFTYPE_MONITOR:
                         *chandef = local->monitor_chandef;
                         ret = 0;
                         break;
                 default:
                         rcu_read_lock();
                         chanctx_conf = 
rcu_dereference(sdata->vif.chanctx_conf);
                         if (chanctx_conf) {
                                 *chandef = chanctx_conf->def;
                                 ret = 0;
                         }
                         rcu_read_unlock();
         }
         return ret;
}


Thanks
Clyde

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-09 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-09 21:46 Cannot use ioctl SIOCGIWFREQ C. McPherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.