static int r8180_wx_get_scan(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *b) { int ret; struct r8180_priv *priv = ieee80211_priv(dev); down(&priv->wx_sem); if (priv->up) ret = ieee80211_wx_get_scan(priv->ieee80211, a, wrqu, b); else ret = -1; up(&priv->wx_sem); return ret; }
/* if we're still scanning, return -EAGAIN so that userspace tools * can get the complete scan results, otherwise return 0. */ int ieee80211softmac_wx_get_scan_results(struct net_device *net_dev, struct iw_request_info *info, union iwreq_data *data, char *extra) { unsigned long flags; struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); spin_lock_irqsave(&sm->lock, flags); if (sm->scanning) { spin_unlock_irqrestore(&sm->lock, flags); return -EAGAIN; } spin_unlock_irqrestore(&sm->lock, flags); return ieee80211_wx_get_scan(sm->ieee, info, data, extra); }
static int r8192_wx_get_scan(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *b) { int ret; struct r8192_priv *priv = ieee80211_priv(dev); if (!priv->up) return -ENETDOWN; mutex_lock(&priv->wx_mutex); ret = ieee80211_wx_get_scan(priv->ieee80211, a, wrqu, b); mutex_unlock(&priv->wx_mutex); return ret; }