p54: sort channel list by frequency instead of channel index
authorChristian Lamparter <chunkeey@googlemail.com>
Sat, 12 Feb 2011 20:49:38 +0000 (21:49 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 14 Feb 2011 20:51:21 +0000 (15:51 -0500)
Some channel indices of the low 5GHz band clash with
those of the 2.4GHz band. Therefore we should go
with the channel's center frequency.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/p54/eeprom.c

index 35b09aa0529bf6cb6f142680d045c0e894c44df9..ec7d4b86bf0616ab8a1c1c30bed2036bb6c0a6b3 100644 (file)
@@ -93,7 +93,7 @@ static int p54_compare_channels(const void *_a,
        const struct p54_channel_entry *a = _a;
        const struct p54_channel_entry *b = _b;
 
-       return a->index - b->index;
+       return a->freq - b->freq;
 }
 
 static int p54_fill_band_bitrates(struct ieee80211_hw *dev,
@@ -291,7 +291,7 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev)
                }
        }
 
-       /* sort the list by the channel index */
+       /* sort the channel list by frequency */
        sort(list->channels, list->entries, sizeof(struct p54_channel_entry),
             p54_compare_channels, NULL);