Skip to content

Commit

Permalink
p54: sort channel list by frequency instead of channel index
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
chunkeey authored and linvjw committed Feb 14, 2011
1 parent 91f71fa commit 192abec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/p54/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 192abec

Please sign in to comment.