mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chan
Drivers that don't use chanctxes cannot perform VHT association because they still use a "backward compatibility" pair of {ieee80211_channel, nl80211_channel_type} in ieee80211_conf and ieee80211_local. Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> [fix kernel-doc] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
此提交包含在:
@@ -79,7 +79,7 @@ static void ath9k_beacon_setup(struct ath_softc *sc, struct ieee80211_vif *vif,
|
||||
u8 chainmask = ah->txchainmask;
|
||||
u8 rate = 0;
|
||||
|
||||
sband = &sc->sbands[common->hw->conf.channel->band];
|
||||
sband = &sc->sbands[common->hw->conf.chandef.chan->band];
|
||||
rate = sband->bitrates[rateidx].hw_value;
|
||||
if (vif->bss_conf.use_short_preamble)
|
||||
rate |= sband->bitrates[rateidx].hw_value_short;
|
||||
|
@@ -208,7 +208,7 @@ bool ath9k_hw_reset_calvalid(struct ath_hw *ah)
|
||||
return true;
|
||||
|
||||
ath_dbg(common, CALIBRATE, "Resetting Cal %d state for channel %u\n",
|
||||
currCal->calData->calType, conf->channel->center_freq);
|
||||
currCal->calData->calType, conf->chandef.chan->center_freq);
|
||||
|
||||
ah->caldata->CalValid &= ~currCal->calData->calType;
|
||||
currCal->calState = CAL_WAITING;
|
||||
|
@@ -133,13 +133,14 @@ EXPORT_SYMBOL(ath9k_cmn_update_ichannel);
|
||||
struct ath9k_channel *ath9k_cmn_get_curchannel(struct ieee80211_hw *hw,
|
||||
struct ath_hw *ah)
|
||||
{
|
||||
struct ieee80211_channel *curchan = hw->conf.channel;
|
||||
struct ieee80211_channel *curchan = hw->conf.chandef.chan;
|
||||
struct ath9k_channel *channel;
|
||||
u8 chan_idx;
|
||||
|
||||
chan_idx = curchan->hw_value;
|
||||
channel = &ah->channels[chan_idx];
|
||||
ath9k_cmn_update_ichannel(channel, curchan, hw->conf.channel_type);
|
||||
ath9k_cmn_update_ichannel(channel, curchan,
|
||||
cfg80211_get_chandef_type(&hw->conf.chandef));
|
||||
|
||||
return channel;
|
||||
}
|
||||
|
@@ -190,7 +190,7 @@ void ath9k_htc_reset(struct ath9k_htc_priv *priv)
|
||||
{
|
||||
struct ath_hw *ah = priv->ah;
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
struct ieee80211_channel *channel = priv->hw->conf.channel;
|
||||
struct ieee80211_channel *channel = priv->hw->conf.chandef.chan;
|
||||
struct ath9k_hw_cal_data *caldata = NULL;
|
||||
enum htc_phymode mode;
|
||||
__be16 htc_mode;
|
||||
@@ -250,7 +250,7 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
struct ieee80211_conf *conf = &common->hw->conf;
|
||||
bool fastcc;
|
||||
struct ieee80211_channel *channel = hw->conf.channel;
|
||||
struct ieee80211_channel *channel = hw->conf.chandef.chan;
|
||||
struct ath9k_hw_cal_data *caldata = NULL;
|
||||
enum htc_phymode mode;
|
||||
__be16 htc_mode;
|
||||
@@ -602,7 +602,7 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv,
|
||||
u32 caps = 0;
|
||||
int i, j;
|
||||
|
||||
sband = priv->hw->wiphy->bands[priv->hw->conf.channel->band];
|
||||
sband = priv->hw->wiphy->bands[priv->hw->conf.chandef.chan->band];
|
||||
|
||||
for (i = 0, j = 0; i < sband->n_bitrates; i++) {
|
||||
if (sta->supp_rates[sband->band] & BIT(i)) {
|
||||
@@ -904,7 +904,7 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
|
||||
struct ath9k_htc_priv *priv = hw->priv;
|
||||
struct ath_hw *ah = priv->ah;
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
struct ieee80211_channel *curchan = hw->conf.channel;
|
||||
struct ieee80211_channel *curchan = hw->conf.chandef.chan;
|
||||
struct ath9k_channel *init_channel;
|
||||
int ret = 0;
|
||||
enum htc_phymode mode;
|
||||
@@ -1193,15 +1193,17 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
|
||||
}
|
||||
|
||||
if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || chip_reset) {
|
||||
struct ieee80211_channel *curchan = hw->conf.channel;
|
||||
struct ieee80211_channel *curchan = hw->conf.chandef.chan;
|
||||
enum nl80211_channel_type channel_type =
|
||||
cfg80211_get_chandef_type(&hw->conf.chandef);
|
||||
int pos = curchan->hw_value;
|
||||
|
||||
ath_dbg(common, CONFIG, "Set channel: %d MHz\n",
|
||||
curchan->center_freq);
|
||||
|
||||
ath9k_cmn_update_ichannel(&priv->ah->channels[pos],
|
||||
hw->conf.channel,
|
||||
hw->conf.channel_type);
|
||||
hw->conf.chandef.chan,
|
||||
channel_type);
|
||||
|
||||
if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) {
|
||||
ath_err(common, "Unable to set channel\n");
|
||||
|
@@ -490,7 +490,7 @@ static void ath9k_htc_tx_process(struct ath9k_htc_priv *priv,
|
||||
if (txs->ts_flags & ATH9K_HTC_TXSTAT_SGI)
|
||||
rate->flags |= IEEE80211_TX_RC_SHORT_GI;
|
||||
} else {
|
||||
if (cur_conf->channel->band == IEEE80211_BAND_5GHZ)
|
||||
if (cur_conf->chandef.chan->band == IEEE80211_BAND_5GHZ)
|
||||
rate->idx += 4; /* No CCK rates */
|
||||
}
|
||||
|
||||
@@ -939,7 +939,7 @@ static void ath9k_process_rate(struct ieee80211_hw *hw,
|
||||
return;
|
||||
}
|
||||
|
||||
band = hw->conf.channel->band;
|
||||
band = hw->conf.chandef.chan->band;
|
||||
sband = hw->wiphy->bands[band];
|
||||
|
||||
for (i = 0; i < sband->n_bitrates; i++) {
|
||||
@@ -1078,8 +1078,8 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
|
||||
priv->ah->stats.avgbrssi = rxbuf->rxstatus.rs_rssi;
|
||||
|
||||
rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp);
|
||||
rx_status->band = hw->conf.channel->band;
|
||||
rx_status->freq = hw->conf.channel->center_freq;
|
||||
rx_status->band = hw->conf.chandef.chan->band;
|
||||
rx_status->freq = hw->conf.chandef.chan->center_freq;
|
||||
rx_status->signal = rxbuf->rxstatus.rs_rssi + ATH_DEFAULT_NOISE_FLOOR;
|
||||
rx_status->antenna = rxbuf->rxstatus.rs_antenna;
|
||||
rx_status->flag |= RX_FLAG_MACTIME_END;
|
||||
|
@@ -139,7 +139,7 @@ static void ath9k_hw_set_clockrate(struct ath_hw *ah)
|
||||
clockrate = 117;
|
||||
else if (!ah->curchan) /* should really check for CCK instead */
|
||||
clockrate = ATH9K_CLOCK_RATE_CCK;
|
||||
else if (conf->channel->band == IEEE80211_BAND_2GHZ)
|
||||
else if (conf->chandef.chan->band == IEEE80211_BAND_2GHZ)
|
||||
clockrate = ATH9K_CLOCK_RATE_2GHZ_OFDM;
|
||||
else if (ah->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK)
|
||||
clockrate = ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM;
|
||||
@@ -1110,7 +1110,8 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
|
||||
* BA frames in some implementations, but it has been found to fix ACK
|
||||
* timeout issues in other cases as well.
|
||||
*/
|
||||
if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ &&
|
||||
if (conf->chandef.chan &&
|
||||
conf->chandef.chan->band == IEEE80211_BAND_2GHZ &&
|
||||
!IS_CHAN_HALF_RATE(chan) && !IS_CHAN_QUARTER_RATE(chan)) {
|
||||
acktimeout += 64 - sifstime - ah->slottime;
|
||||
ctstimeout += 48 - sifstime - ah->slottime;
|
||||
|
@@ -213,7 +213,7 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int
|
||||
txctl.txq = sc->tx.txq_map[IEEE80211_AC_BE];
|
||||
|
||||
memset(tx_info, 0, sizeof(*tx_info));
|
||||
tx_info->band = hw->conf.channel->band;
|
||||
tx_info->band = hw->conf.chandef.chan->band;
|
||||
tx_info->flags |= IEEE80211_TX_CTL_NO_ACK;
|
||||
tx_info->control.rates[0].idx = 0;
|
||||
tx_info->control.rates[0].count = 1;
|
||||
|
@@ -585,7 +585,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
|
||||
struct ath_softc *sc = hw->priv;
|
||||
struct ath_hw *ah = sc->sc_ah;
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
struct ieee80211_channel *curchan = hw->conf.channel;
|
||||
struct ieee80211_channel *curchan = hw->conf.chandef.chan;
|
||||
struct ath9k_channel *init_channel;
|
||||
int r;
|
||||
|
||||
@@ -1184,7 +1184,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
|
||||
}
|
||||
|
||||
if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) {
|
||||
struct ieee80211_channel *curchan = hw->conf.channel;
|
||||
struct ieee80211_channel *curchan = hw->conf.chandef.chan;
|
||||
enum nl80211_channel_type channel_type =
|
||||
cfg80211_get_chandef_type(&conf->chandef);
|
||||
int pos = curchan->hw_value;
|
||||
int old_pos = -1;
|
||||
unsigned long flags;
|
||||
@@ -1193,7 +1195,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
|
||||
old_pos = ah->curchan - &ah->channels[0];
|
||||
|
||||
ath_dbg(common, CONFIG, "Set channel: %d MHz type: %d\n",
|
||||
curchan->center_freq, conf->channel_type);
|
||||
curchan->center_freq, channel_type);
|
||||
|
||||
/* update survey stats for the old channel before switching */
|
||||
spin_lock_irqsave(&common->cc_lock, flags);
|
||||
@@ -1208,7 +1210,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
|
||||
ath9k_hw_getnf(ah, ah->curchan);
|
||||
|
||||
ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos],
|
||||
curchan, conf->channel_type);
|
||||
curchan, channel_type);
|
||||
|
||||
/*
|
||||
* If the operating channel changes, change the survey in-use flags
|
||||
|
@@ -814,7 +814,7 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
|
||||
* So, set fourth rate in series to be same as third one for
|
||||
* above conditions.
|
||||
*/
|
||||
if ((sc->hw->conf.channel->band == IEEE80211_BAND_2GHZ) &&
|
||||
if ((sc->hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ) &&
|
||||
(conf_is_ht(&sc->hw->conf))) {
|
||||
u8 dot11rate = rate_table->info[rix].dot11rate;
|
||||
u8 phy = rate_table->info[rix].phy;
|
||||
@@ -1328,7 +1328,7 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
|
||||
|
||||
ath_dbg(ath9k_hw_common(sc->sc_ah), CONFIG,
|
||||
"Operating HT Bandwidth changed to: %d\n",
|
||||
sc->hw->conf.channel_type);
|
||||
cfg80211_get_chandef_type(&sc->hw->conf.chandef));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -859,7 +859,7 @@ static int ath9k_process_rate(struct ath_common *common,
|
||||
unsigned int i = 0;
|
||||
struct ath_softc __maybe_unused *sc = common->priv;
|
||||
|
||||
band = hw->conf.channel->band;
|
||||
band = hw->conf.chandef.chan->band;
|
||||
sband = hw->wiphy->bands[band];
|
||||
|
||||
if (rx_stats->rs_rate & 0x80) {
|
||||
@@ -954,8 +954,8 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common,
|
||||
if (ath9k_process_rate(common, hw, rx_stats, rx_status))
|
||||
return -EINVAL;
|
||||
|
||||
rx_status->band = hw->conf.channel->band;
|
||||
rx_status->freq = hw->conf.channel->center_freq;
|
||||
rx_status->band = hw->conf.chandef.chan->band;
|
||||
rx_status->freq = hw->conf.chandef.chan->center_freq;
|
||||
rx_status->signal = ah->noise + rx_stats->rs_rssi;
|
||||
rx_status->antenna = rx_stats->rs_antenna;
|
||||
rx_status->flag |= RX_FLAG_MACTIME_END;
|
||||
|
新增問題並參考
封鎖使用者