Re: [PATCH 14/16] ipw2200: wireless extension sensitivity threshold support

2006-03-09 Thread Jiri Benc
On Thu, 09 Mar 2006 11:39:06 +0800, Zhu Yi wrote:
 On Wed, 2006-03-08 at 13:23 +0100, Jiri Benc wrote:
  I don't think it's a good idea to misuse 'iwconfig sens' for this.
 
 This has been discussed on ipw2100-devel ML. Jean will change the manual
 for 'iwconfig sens'.
 http://marc.theaimsgroup.com/?l=ipw2100-develm=114141001301586w=2

OK then, thanks for clarification.

-- 
Jiri Benc
SUSE Labs
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 14/16] ipw2200: wireless extension sensitivity threshold support

2006-03-08 Thread Zhu Yi
On Wed, 2006-03-08 at 13:23 +0100, Jiri Benc wrote:
 On Wed, 8 Mar 2006 13:34:10 +0800, Zhu Yi wrote:
  +3.2 iwconfig sens
  +---
  +
  +The 'iwconfig ethX sens XX' command will not set the signal sensitivity
  +threshold, as described in iwconfig documentation, but rather the number
  +of consecutive missed beacons that will trigger handover, i.e. roaming
  +to another access point. At the same time, it will set the disassociation
  +threshold to 3 times the given value.
 
 I don't think it's a good idea to misuse 'iwconfig sens' for this.

This has been discussed on ipw2100-devel ML. Jean will change the manual
for 'iwconfig sens'.
http://marc.theaimsgroup.com/?l=ipw2100-develm=114141001301586w=2

Thanks,
-yi

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 14/16] ipw2200: wireless extension sensitivity threshold support

2006-03-07 Thread Zhu Yi

From: Olivier Hochreutiner [EMAIL PROTECTED]
Date: Wed, 8 Mar 2006 03:13:55 + (+0800)

[PATCH 14/16] 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 [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
---

--- a/Documentation/networking/README.ipw2200
+++ b/Documentation/networking/README.ipw2200
@@ -30,6 +30,7 @@ Index
 2.   Ad-Hoc Networking
 3.   Interacting with Wireless Tools
 3.1. iwconfig mode
+3.2. iwconfig sens
 4.   About the Version Numbers
 5.   Firmware installation
 6.   Support
@@ -398,6 +399,15 @@ When configuring the mode of the adapter
 are reset to the value used when the module was loaded.  This includes
 channels, rates, ESSID, etc.
 
+3.2 iwconfig sens
+---
+
+The 'iwconfig ethX sens XX' command will not set the signal sensitivity
+threshold, as described in iwconfig documentation, but rather the number
+of consecutive missed beacons that will trigger handover, i.e. roaming
+to another access point. At the same time, it will set the disassociation
+threshold to 3 times the given value.
+
 
 4.   About the Version Numbers
 ---
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -8614,6 +8614,52 @@ static int ipw_wx_get_nick(struct net_de
return 0;
 }
 
+static int ipw_wx_set_sens(struct net_device *dev,
+   struct iw_request_info *info,
+   union iwreq_data *wrqu, char *extra)
+{
+   struct ipw_priv *priv = ieee80211_priv(dev);
+   int err = 0;
+
+   IPW_DEBUG_WX(Setting roaming threshold to %d\n, wrqu-sens.value);
+   IPW_DEBUG_WX(Setting disassociate threshold to %d\n, 
3*wrqu-sens.value);
+   mutex_lock(priv-mutex);
+
+   if (wrqu-sens.fixed == 0)
+   {
+   priv-roaming_threshold = IPW_MB_ROAMING_THRESHOLD_DEFAULT;
+   priv-disassociate_threshold = 
IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT;
+   goto out;
+   }
+   if ((wrqu-sens.value  IPW_MB_ROAMING_THRESHOLD_MAX) ||
+   (wrqu-sens.value  IPW_MB_ROAMING_THRESHOLD_MIN)) {
+   err = -EINVAL;
+   goto out;
+   }
+
+   priv-roaming_threshold = wrqu-sens.value;
+   priv-disassociate_threshold = 3*wrqu-sens.value;
+  out:
+   mutex_unlock(priv-mutex);
+   return err;
+}
+
+static int ipw_wx_get_sens(struct net_device *dev,
+   struct iw_request_info *info,
+   union iwreq_data *wrqu, char *extra)
+{
+   struct ipw_priv *priv = ieee80211_priv(dev);
+   mutex_lock(priv-mutex);
+   wrqu-sens.fixed = 1;
+   wrqu-sens.value = priv-roaming_threshold;
+   mutex_unlock(priv-mutex);
+
+   IPW_DEBUG_WX(GET roaming threshold - %s %d \n,
+wrqu-power.disabled ? OFF : ON, wrqu-power.value);
+
+   return 0;
+}
+
 static int ipw_wx_set_rate(struct net_device *dev,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *extra)
@@ -9435,6 +9481,8 @@ static iw_handler ipw_wx_handlers[] = {
IW_IOCTL(SIOCGIWFREQ) = ipw_wx_get_freq,
IW_IOCTL(SIOCSIWMODE) = ipw_wx_set_mode,
IW_IOCTL(SIOCGIWMODE) = ipw_wx_get_mode,
+   IW_IOCTL(SIOCSIWSENS) = ipw_wx_set_sens,
+   IW_IOCTL(SIOCGIWSENS) = ipw_wx_get_sens,
IW_IOCTL(SIOCGIWRANGE) = ipw_wx_get_range,
IW_IOCTL(SIOCSIWAP) = ipw_wx_set_wap,
IW_IOCTL(SIOCGIWAP) = ipw_wx_get_wap,
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -246,8 +246,10 @@ enum connection_manager_assoc_states {
 #define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED   31
 
 #define HOST_NOTIFICATION_STATUS_BEACON_MISSING 1
-#define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT   24
+#define IPW_MB_ROAMING_THRESHOLD_MIN1
 #define IPW_MB_ROAMING_THRESHOLD_DEFAULT8
+#define IPW_MB_ROAMING_THRESHOLD_MAX30
+#define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT   
3*IPW_MB_ROAMING_THRESHOLD_DEFAULT
 #define IPW_REAL_RATE_RX_PACKET_THRESHOLD   300
 
 #define MACADRR_BYTE_LEN 6
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html