]> git.hungrycats.org Git - linux/commitdiff
[PATCH] prism54 freq to channel incorrect for 5GHz
authorMargit Schubert-While <margitsw@t-online.de>
Tue, 6 Jul 2004 21:01:55 +0000 (17:01 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Tue, 6 Jul 2004 21:01:55 +0000 (17:01 -0400)
2004-07-06 Margit Schubert-While <margitsw@t-online.de>

* The frequency to channel conversion is wrong for the 5GHz band
* Although the (known) devices don't/can't use it,
  they do report it. (iwlist ethX freq)

drivers/net/wireless/prism54/oid_mgt.c

index f4c2d1d4c0153503a38a6bd079badfefbca9dcfb..be5c6944c166e1b5ed6ab2dfa7182abe163f7526 100644 (file)
@@ -28,10 +28,6 @@ const int frequency_list_bg[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442,
        2447, 2452, 2457, 2462, 2467, 2472, 2484
 };
 
-const int frequency_list_a[] = { 5170, 5180, 5190, 5200, 5210, 5220, 5230,
-       5240, 5260, 5280, 5300, 5320
-};
-
 int
 channel_of_freq(int f)
 {
@@ -41,10 +37,8 @@ channel_of_freq(int f)
                while ((c < 14) && (f != frequency_list_bg[c]))
                        c++;
                return (c >= 14) ? 0 : ++c;
-       } else if ((f >= (int) 5170) && (f <= (int) 5320)) {
-               while ((c < 12) && (f != frequency_list_a[c]))
-                       c++;
-               return (c >= 12) ? 0 : (c + 37);
+       } else if ((f >= (int) 5000) && (f <= (int) 6000)) {
+               return ( (f - 5000) / 5 );
        } else
                return 0;
 }