diff --git a/mac80211.c b/mac80211.c index e1f6b4b2..0cf003e6 100644 --- a/mac80211.c +++ b/mac80211.c @@ -13,14 +13,14 @@ #include "mt76.h" #define CHAN2G(_idx, _freq) { \ - .band = IEEE80211_BAND_2GHZ, \ + .band = NL80211_BAND_2GHZ, \ .center_freq = (_freq), \ .hw_value = (_idx), \ .max_power = 30, \ } #define CHAN5G(_idx, _freq) { \ - .band = IEEE80211_BAND_5GHZ, \ + .band = NL80211_BAND_5GHZ, \ .center_freq = (_freq), \ .hw_value = (_idx), \ .max_power = 30, \ @@ -138,7 +138,7 @@ static int mt76_init_sband_2g(struct mt76_dev *dev, struct ieee80211_rate *rates, int n_rates) { - dev->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &dev->sband_2g; + dev->hw->wiphy->bands[NL80211_BAND_2GHZ] = &dev->sband_2g; return mt76_init_sband(dev, &dev->sband_2g, mt76_channels_2ghz, @@ -150,7 +150,7 @@ static int mt76_init_sband_5g(struct mt76_dev *dev, struct ieee80211_rate *rates, int n_rates, bool vht) { - dev->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &dev->sband_5g; + dev->hw->wiphy->bands[NL80211_BAND_5GHZ] = &dev->sband_5g; return mt76_init_sband(dev, &dev->sband_5g, mt76_channels_5ghz, diff --git a/mt7603_init.c b/mt7603_init.c index fca0abe6..0be81836 100644 --- a/mt7603_init.c +++ b/mt7603_init.c @@ -373,7 +373,7 @@ int mt7603_register_device(struct mt7603_dev *dev) if (ret) return ret; - sband = wiphy->bands[IEEE80211_BAND_2GHZ]; + sband = wiphy->bands[NL80211_BAND_2GHZ]; dev->chandef.chan = &sband->channels[0]; mt7603_init_debugfs(dev); diff --git a/mt7603_mac.c b/mt7603_mac.c index e0b90591..6fbd60a0 100644 --- a/mt7603_mac.c +++ b/mt7603_mac.c @@ -52,7 +52,7 @@ void mt7603_mac_set_timing(struct mt7603_dev *dev) MT76_SET(MT_TIMEOUT_VAL_CCA, offset); int sifs; - if (dev->chandef.chan->band == IEEE80211_BAND_5GHZ) + if (dev->chandef.chan->band == NL80211_BAND_5GHZ) sifs = 16; else sifs = 10; diff --git a/mt7603_main.c b/mt7603_main.c index e7fc956f..08ca585e 100644 --- a/mt7603_main.c +++ b/mt7603_main.c @@ -135,7 +135,7 @@ mt7603_set_channel(struct mt7603_dev *dev, struct cfg80211_chan_def *def) if (ret) return ret; - if (def->chan->band == IEEE80211_BAND_5GHZ) { + if (def->chan->band == NL80211_BAND_5GHZ) { idx = 1; rssi_data += MT_EE_RSSI_OFFSET_5G; } else { diff --git a/mt76x2_eeprom.c b/mt76x2_eeprom.c index 83395999..3e8f4827 100644 --- a/mt76x2_eeprom.c +++ b/mt76x2_eeprom.c @@ -342,14 +342,14 @@ void mt76x2_read_rx_gain(struct mt76x2_dev *dev) u8 lna; u16 val; - if (chan->band == IEEE80211_BAND_2GHZ) + if (chan->band == NL80211_BAND_2GHZ) val = mt76x2_eeprom_get(dev, MT_EE_RF_2G_RX_HIGH_GAIN) >> 8; else val = mt76x2_get_5g_rx_gain(dev, channel); mt76x2_set_rx_gain_group(dev, val); - if (chan->band == IEEE80211_BAND_2GHZ) { + if (chan->band == NL80211_BAND_2GHZ) { val = mt76x2_eeprom_get(dev, MT_EE_RSSI_OFFSET_2G_0); mt76x2_set_rssi_offset(dev, 0, val); mt76x2_set_rssi_offset(dev, 1, val >> 8); @@ -386,7 +386,7 @@ void mt76x2_read_rx_gain(struct mt76x2_dev *dev) if (val & MT_EE_NIC_CONF_1_LNA_EXT_5G) memset(lna_5g, 0, sizeof(lna_5g)); - if (chan->band == IEEE80211_BAND_2GHZ) + if (chan->band == NL80211_BAND_2GHZ) lna = lna_2g; else if (channel <= 64) lna = lna_5g[0]; @@ -415,7 +415,7 @@ void mt76x2_get_rate_power(struct mt76x2_dev *dev, struct mt76x2_rate_power *t) bool is_5ghz = false; u16 val; - is_5ghz = dev->chandef.chan->band == IEEE80211_BAND_5GHZ; + is_5ghz = dev->chandef.chan->band == NL80211_BAND_5GHZ; memset(t, 0, sizeof(*t)); @@ -550,7 +550,7 @@ void mt76x2_get_power_info(struct mt76x2_dev *dev, struct mt76x2_tx_power_info * bw40 = mt76x2_eeprom_get(dev, MT_EE_TX_POWER_DELTA_BW40); bw80 = mt76x2_eeprom_get(dev, MT_EE_TX_POWER_DELTA_BW80); - if (dev->chandef.chan->band == IEEE80211_BAND_5GHZ) { + if (dev->chandef.chan->band == NL80211_BAND_5GHZ) { bw40 >>= 8; mt76x2_get_power_info_5g(dev, t, 0, MT_EE_TX_POWER_0_START_5G); mt76x2_get_power_info_5g(dev, t, 1, MT_EE_TX_POWER_1_START_5G); @@ -586,7 +586,7 @@ int mt76x2_get_temp_comp(struct mt76x2_dev *dev, struct mt76x2_temp_comp *t) return -EINVAL; t->temp_25_ref = val & 0x7f; - if (band == IEEE80211_BAND_5GHZ) { + if (band == NL80211_BAND_5GHZ) { slope = mt76x2_eeprom_get(dev, MT_EE_RF_TEMP_COMP_SLOPE_5G); bounds = mt76x2_eeprom_get(dev, MT_EE_TX_POWER_EXT_PA_5G); } else { @@ -606,7 +606,7 @@ bool mt76x2_ext_pa_enabled(struct mt76x2_dev *dev, enum ieee80211_band band) { u16 conf1 = mt76x2_eeprom_get(dev, MT_EE_NIC_CONF_0); - if (band == IEEE80211_BAND_5GHZ) + if (band == NL80211_BAND_5GHZ) return !(conf1 & MT_EE_NIC_CONF_0_PA_INT_5G); else return !(conf1 & MT_EE_NIC_CONF_0_PA_INT_2G); diff --git a/mt76x2_eeprom.h b/mt76x2_eeprom.h index 9355f0cb..b75cee35 100644 --- a/mt76x2_eeprom.h +++ b/mt76x2_eeprom.h @@ -170,7 +170,7 @@ mt76x2_has_ext_lna(struct mt76x2_dev *dev) { u32 val = mt76x2_eeprom_get(dev, MT_EE_NIC_CONF_1); - if (dev->chandef.chan->band == IEEE80211_BAND_2GHZ) + if (dev->chandef.chan->band == NL80211_BAND_2GHZ) return val & MT_EE_NIC_CONF_1_LNA_EXT_2G; else return val & MT_EE_NIC_CONF_1_LNA_EXT_5G; diff --git a/mt76x2_init.c b/mt76x2_init.c index 63eba271..5171b99b 100644 --- a/mt76x2_init.c +++ b/mt76x2_init.c @@ -739,8 +739,8 @@ int mt76x2_register_device(struct mt76x2_dev *dev) if (ret) goto fail; - sband = wiphy->bands[dev->mt76.cap.has_5ghz ? IEEE80211_BAND_5GHZ : - IEEE80211_BAND_2GHZ]; + sband = wiphy->bands[dev->mt76.cap.has_5ghz ? NL80211_BAND_5GHZ : + NL80211_BAND_2GHZ]; dev->chandef.chan = &sband->channels[0]; mt76x2_init_debugfs(dev); diff --git a/mt76x2_mac.c b/mt76x2_mac.c index 692f151b..1715309c 100644 --- a/mt76x2_mac.c +++ b/mt76x2_mac.c @@ -35,7 +35,7 @@ mt76x2_mac_process_rate(struct ieee80211_rx_status *status, u16 rate) if (idx >= 8) idx = 0; - if (status->band == IEEE80211_BAND_2GHZ) + if (status->band == NL80211_BAND_2GHZ) idx += 4; status->rate_idx = idx; @@ -257,7 +257,7 @@ mt76x2_mac_process_tx_rate(struct ieee80211_tx_rate *txrate, u16 rate, switch (MT76_GET(MT_RXWI_RATE_PHY, rate)) { case MT_PHY_TYPE_OFDM: - if (band == IEEE80211_BAND_2GHZ) + if (band == NL80211_BAND_2GHZ) idx += 4; txrate->idx = idx; diff --git a/mt76x2_phy.c b/mt76x2_phy.c index 03900dad..a27fc126 100644 --- a/mt76x2_phy.c +++ b/mt76x2_phy.c @@ -188,7 +188,7 @@ mt76x2_phy_tssi_init_cal(struct mt76x2_dev *dev) if (mt76x2_channel_silent(dev)) return false; - if (chan->band == IEEE80211_BAND_2GHZ) + if (chan->band == NL80211_BAND_2GHZ) flag |= BIT(0); if (mt76x2_ext_pa_enabled(dev, chan->band)) @@ -203,7 +203,7 @@ static void mt76x2_phy_channel_calibrate(struct mt76x2_dev *dev, bool mac_stopped) { struct ieee80211_channel *chan = dev->chandef.chan; - bool is_5ghz = chan->band == IEEE80211_BAND_5GHZ; + bool is_5ghz = chan->band == NL80211_BAND_5GHZ; if (dev->cal.channel_cal_done) return; @@ -240,7 +240,7 @@ mt76x2_phy_set_txpower_regs(struct mt76x2_dev *dev, enum ieee80211_band band) u32 pa_mode[2]; u32 pa_mode_adj; - if (band == IEEE80211_BAND_2GHZ) { + if (band == NL80211_BAND_2GHZ) { pa_mode[0] = 0x010055ff; pa_mode[1] = 0x00550055; @@ -282,7 +282,7 @@ mt76x2_phy_set_txpower_regs(struct mt76x2_dev *dev, enum ieee80211_band band) mt76_wr(dev, MT_TX1_RF_GAIN_CORR, val); mt76_wr(dev, MT_TX_ALC_CFG_4, 0x00001818); } else { - if (band == IEEE80211_BAND_2GHZ) { + if (band == NL80211_BAND_2GHZ) { u32 val = 0x0f3c3c3c; mt76_wr(dev, MT_TX0_RF_GAIN_CORR, val); mt76_wr(dev, MT_TX1_RF_GAIN_CORR, val); @@ -344,11 +344,11 @@ static void mt76x2_phy_set_band(struct mt76x2_dev *dev, int band, bool primary_upper) { switch (band) { - case IEEE80211_BAND_2GHZ: + case NL80211_BAND_2GHZ: mt76_set(dev, MT_TX_BAND_CFG, MT_TX_BAND_CFG_2G); mt76_clear(dev, MT_TX_BAND_CFG, MT_TX_BAND_CFG_5G); break; - case IEEE80211_BAND_5GHZ: + case NL80211_BAND_5GHZ: mt76_clear(dev, MT_TX_BAND_CFG, MT_TX_BAND_CFG_2G); mt76_set(dev, MT_TX_BAND_CFG, MT_TX_BAND_CFG_5G); break;