wpi, iwn: fix check in find_eeprom_channel()

Return correct eeprom_chan structure pointer for 7, 8, 11 and 12 5Ghz
channels.
This commit is contained in:
Andriy Voskoboinyk 2016-04-03 14:38:26 +00:00
parent d5d7399d2d
commit 86d9f8fc65
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297524
2 changed files with 4 additions and 2 deletions

View File

@ -2554,7 +2554,8 @@ iwn_find_eeprom_channel(struct iwn_softc *sc, struct ieee80211_channel *c)
} else {
for (j = 0; j < 5; j++) {
for (i = 0; i < iwn_bands[j].nchan; i++) {
if (iwn_bands[j].chan[i] == c->ic_ieee)
if (iwn_bands[j].chan[i] == c->ic_ieee &&
((j == 0) ^ IEEE80211_IS_CHAN_A(c)) == 1)
return &sc->eeprom_channels[j][i];
}
}

View File

@ -1503,7 +1503,8 @@ wpi_find_eeprom_channel(struct wpi_softc *sc, struct ieee80211_channel *c)
for (j = 0; j < WPI_CHAN_BANDS_COUNT; j++)
for (i = 0; i < wpi_bands[j].nchan; i++)
if (wpi_bands[j].chan[i] == c->ic_ieee)
if (wpi_bands[j].chan[i] == c->ic_ieee &&
((j == 0) ^ IEEE80211_IS_CHAN_A(c)) == 1)
return &sc->eeprom_channels[j][i];
return NULL;