diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 48 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2200.h | 4 |
2 files changed, 51 insertions, 1 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 | ||
8611 | static 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 | |||
8641 | static 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 | |||
8611 | static int ipw_wx_set_rate(struct net_device *dev, | 8657 | static 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, |
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h index e8f133666c65..2033fc6f1892 100644 --- a/drivers/net/wireless/ipw2200.h +++ b/drivers/net/wireless/ipw2200.h | |||
@@ -246,8 +246,10 @@ enum connection_manager_assoc_states { | |||
246 | #define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED 31 | 246 | #define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED 31 |
247 | 247 | ||
248 | #define HOST_NOTIFICATION_STATUS_BEACON_MISSING 1 | 248 | #define HOST_NOTIFICATION_STATUS_BEACON_MISSING 1 |
249 | #define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT 24 | 249 | #define IPW_MB_ROAMING_THRESHOLD_MIN 1 |
250 | #define IPW_MB_ROAMING_THRESHOLD_DEFAULT 8 | 250 | #define IPW_MB_ROAMING_THRESHOLD_DEFAULT 8 |
251 | #define IPW_MB_ROAMING_THRESHOLD_MAX 30 | ||
252 | #define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT 3*IPW_MB_ROAMING_THRESHOLD_DEFAULT | ||
251 | #define IPW_REAL_RATE_RX_PACKET_THRESHOLD 300 | 253 | #define IPW_REAL_RATE_RX_PACKET_THRESHOLD 300 |
252 | 254 | ||
253 | #define MACADRR_BYTE_LEN 6 | 255 | #define MACADRR_BYTE_LEN 6 |