Re: [Ipw2100-devel] link quality patch



This patch seems to have changed the behaviour of reported link quality for the better. I do not see inaccurate values at boot as I did before and the values do not seem to jump around as much. The model is most accurate for the high percentages say 50-100 but when you plot the model it has the roll off that you would expect. See for example,

http://www.wildpackets.com/elements/whitepapers/Converting_Signal_Strength.pdf

James Ketrenos wrote:

Bill Moss wrote:

The link quality as displayed by iwconfig has gone through about three patches so far if I am counting right. This number is computed as the minimum of five values, one of which is signal quality. Under good conditions, the link quality matches the signal quality. Vendors generally publish a percent to dBm look up table along with RSSI_MAX to provide a basis for the link quality calculation but I have not found this data anywhere. The linear conversion between dBm and percentage does not model this nonlinear process well. I built a quadratic model which can be found in the patch below. This model does a much better job. To build the model, I booted by laptop in Windows XP and obtained four stable percentage values at four locations in my house. I then booted to FC3 and obtained four stable dBm values for those locations. I fit this data with a quadratic which is in the patch. Here is the data.

percentage                      dBm
100                                  -20
80                                   -50
57                                   -67
45                                   -74


Cool! I ran through the math (solving qual = (100 * a^2 - b * (15 * a + 62 * b)) / a^2) for the min/max thresholds just to make sure I understood what you were talking about :)

I'll incorporate your patch for the next drop.

James


The result is my iwconfig link quality values now track my Windows XP link quality values. A useful reference is http://www.wildpackets.com/elements/whitepapers/Converting_Signal_Strength.pdf
patch
___________________

--- ipw2200.c_orig      2005-02-02 19:31:47.742210264 -0500
+++ ipw2200.c   2005-02-02 19:47:19.107621200 -0500
@@ -3101,7 +3101,7 @@ static u32 ipw_get_current_rate(struct i
      return 0;
}

-#define PERFECT_RSSI (-50)
+#define PERFECT_RSSI (-20)
#define WORST_RSSI   (-85)
#define IPW_STATS_INTERVAL (2 * HZ)
static void ipw_gather_stats(struct ipw_priv *priv)
@@ -3114,6 +3114,7 @@ static void ipw_gather_stats(struct ipw_
      s16 rssi;
      u32 beacon_quality, signal_quality, tx_quality, rx_quality,
              rate_quality;
+       u32 max_rate;

      if (!(priv->status & STATUS_ASSOCIATED)) {
              priv->quality = 0;
@@ -3171,7 +3172,8 @@ static void ipw_gather_stats(struct ipw_
                      beacon_quality, missed_beacons_percent);

      priv->last_rate = ipw_get_current_rate(priv);
-       rate_quality =  priv->last_rate * 40 / priv->last_rate + 60;
+       max_rate = ipw_get_max_rate(priv);
+       rate_quality =  priv->last_rate * 40 / max_rate + 60;
      IPW_DEBUG_STATS("Rate quality : %3d%% (%dMbs)\n",
                      rate_quality, priv->last_rate / 1000000);

@@ -3199,8 +3201,11 @@ static void ipw_gather_stats(struct ipw_
      else if (rssi < WORST_RSSI)
              signal_quality = 0;
      else
-               signal_quality = (rssi - WORST_RSSI) * 100 /
-                       (PERFECT_RSSI - WORST_RSSI);
+               signal_quality = ( 100 *
+ (PERFECT_RSSI - WORST_RSSI) * (PERFECT_RSSI - WORST_RSSI) + - (PERFECT_RSSI - rssi) * (15 * (PERFECT_RSSI - WORST_RSSI)
+               + 62 * (PERFECT_RSSI - rssi)) ) /
+ ( (PERFECT_RSSI - WORST_RSSI) * (PERFECT_RSSI - WORST_RSSI) );
      IPW_DEBUG_STATS("Signal level : %3d%% (%d dBm)\n",
                      signal_quality, rssi);




--
Bill Moss
Professor, Mathematical Sciences
Clemson University




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]