aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2200.c
diff options
context:
space:
mode:
authorOlivier Hochreutiner <olivier.hochreutiner@epfl.ch>2006-03-07 14:13:55 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-03-17 15:08:04 -0500
commit651be26f2daf31e61faf4b55ada709cf39ec76a2 (patch)
treecac9bac812d1ecc1f85bce54a2591cab34752627 /drivers/net/wireless/ipw2200.c
parent71de1f3dd14e3e39cef929506a9526779f5a447d (diff)
[PATCH] ipw2200: wireless extension sensitivity threshold support
The patch allows the user to set the handover threshold, i.e. the number of consecutively missed beacons that will trigger a roaming attempt. The disassociation threshold is set to 3 times the handover threshold. Signed-off-by: Olivier Hochreutiner <olivier.hochreutiner@epfl.ch> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ipw2200.c')
-rw-r--r--drivers/net/wireless/ipw2200.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 954a095eeb51..078f33b01c2f 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -8608,6 +8608,52 @@ static int ipw_wx_get_nick(struct net_device *dev,
8608 return 0; 8608 return 0;
8609} 8609}
8610 8610
8611static int ipw_wx_set_sens(struct net_device *dev,
8612 struct iw_request_info *info,
8613 union iwreq_data *wrqu, char *extra)
8614{
8615 struct ipw_priv *priv = ieee80211_priv(dev);
8616 int err = 0;
8617
8618 IPW_DEBUG_WX("Setting roaming threshold to %d\n", wrqu->sens.value);
8619 IPW_DEBUG_WX("Setting disassociate threshold to %d\n", 3*wrqu->sens.value);
8620 mutex_lock(&priv->mutex);
8621
8622 if (wrqu->sens.fixed == 0)
8623 {
8624 priv->roaming_threshold = IPW_MB_ROAMING_THRESHOLD_DEFAULT;
8625 priv->disassociate_threshold = IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT;
8626 goto out;
8627 }
8628 if ((wrqu->sens.value > IPW_MB_ROAMING_THRESHOLD_MAX) ||
8629 (wrqu->sens.value < IPW_MB_ROAMING_THRESHOLD_MIN)) {
8630 err = -EINVAL;
8631 goto out;
8632 }
8633
8634 priv->roaming_threshold = wrqu->sens.value;
8635 priv->disassociate_threshold = 3*wrqu->sens.value;
8636 out:
8637 mutex_unlock(&priv->mutex);
8638 return err;
8639}
8640
8641static int ipw_wx_get_sens(struct net_device *dev,
8642 struct iw_request_info *info,
8643 union iwreq_data *wrqu, char *extra)
8644{
8645 struct ipw_priv *priv = ieee80211_priv(dev);
8646 mutex_lock(&priv->mutex);
8647 wrqu->sens.fixed = 1;
8648 wrqu->sens.value = priv->roaming_threshold;
8649 mutex_unlock(&priv->mutex);
8650
8651 IPW_DEBUG_WX("GET roaming threshold -> %s %d \n",
8652 wrqu->power.disabled ? "OFF" : "ON", wrqu->power.value);
8653
8654 return 0;
8655}
8656
8611static int ipw_wx_set_rate(struct net_device *dev, 8657static int ipw_wx_set_rate(struct net_device *dev,
8612 struct iw_request_info *info, 8658 struct iw_request_info *info,
8613 union iwreq_data *wrqu, char *extra) 8659 union iwreq_data *wrqu, char *extra)
@@ -9429,6 +9475,8 @@ static iw_handler ipw_wx_handlers[] = {
9429 IW_IOCTL(SIOCGIWFREQ) = ipw_wx_get_freq, 9475 IW_IOCTL(SIOCGIWFREQ) = ipw_wx_get_freq,
9430 IW_IOCTL(SIOCSIWMODE) = ipw_wx_set_mode, 9476 IW_IOCTL(SIOCSIWMODE) = ipw_wx_set_mode,
9431 IW_IOCTL(SIOCGIWMODE) = ipw_wx_get_mode, 9477 IW_IOCTL(SIOCGIWMODE) = ipw_wx_get_mode,
9478 IW_IOCTL(SIOCSIWSENS) = ipw_wx_set_sens,
9479 IW_IOCTL(SIOCGIWSENS) = ipw_wx_get_sens,
9432 IW_IOCTL(SIOCGIWRANGE) = ipw_wx_get_range, 9480 IW_IOCTL(SIOCGIWRANGE) = ipw_wx_get_range,
9433 IW_IOCTL(SIOCSIWAP) = ipw_wx_set_wap, 9481 IW_IOCTL(SIOCSIWAP) = ipw_wx_set_wap,
9434 IW_IOCTL(SIOCGIWAP) = ipw_wx_get_wap, 9482 IW_IOCTL(SIOCGIWAP) = ipw_wx_get_wap,