mt76: move beacon_int in mt76_dev

Move beacon_int in mt76_dev data structure since it is used by
all drivers

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Lorenzo Bianconi 2019-04-29 10:12:59 +02:00 committed by Felix Fietkau
parent f8f527b16d
commit 3041c445e6
9 changed files with 9 additions and 9 deletions

View File

@ -469,6 +469,8 @@ struct mt76_dev {
u8 antenna_mask;
u16 chainmask;
int beacon_int;
struct mt76_sband sband_2g;
struct mt76_sband sband_5g;
struct debugfs_blob_wrapper eeprom;

View File

@ -156,7 +156,7 @@ void mt7603_beacon_set_timer(struct mt7603_dev *dev, int idx, int intval)
return;
}
dev->beacon_int = intval;
dev->mt76.beacon_int = intval;
mt76_wr(dev, MT_TBTT,
FIELD_PREP(MT_TBTT_PERIOD, intval) | MT_TBTT_CAL_ENABLE);

View File

@ -1268,7 +1268,7 @@ static void mt7603_dma_sched_reset(struct mt7603_dev *dev)
static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
{
int beacon_int = dev->beacon_int;
int beacon_int = dev->mt76.beacon_int;
u32 mask = dev->mt76.mmio.irqmask;
int i;

View File

@ -544,7 +544,7 @@ mt7603_sw_scan_complete(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
struct mt7603_dev *dev = hw->priv;
clear_bit(MT76_SCANNING, &dev->mt76.state);
mt7603_beacon_set_timer(dev, -1, dev->beacon_int);
mt7603_beacon_set_timer(dev, -1, dev->mt76.beacon_int);
}
static void

View File

@ -109,7 +109,6 @@ struct mt7603_dev {
ktime_t survey_time;
ktime_t ed_time;
int beacon_int;
struct mt76_queue q_rx;

View File

@ -107,7 +107,6 @@ struct mt76x02_dev {
u8 beacon_data_mask;
u8 tbtt_count;
u16 beacon_int;
u32 tx_hang_reset;
u8 tx_hang_check;

View File

@ -167,7 +167,7 @@ void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev,
void
mt76x02_resync_beacon_timer(struct mt76x02_dev *dev)
{
u32 timer_val = dev->beacon_int << 4;
u32 timer_val = dev->mt76.beacon_int << 4;
dev->tbtt_count++;

View File

@ -147,7 +147,7 @@ static void mt76x02u_restart_pre_tbtt_timer(struct mt76x02_dev *dev)
dev_dbg(dev->mt76.dev, "TSF: %llu us TBTT %u us\n", tsf, tbtt);
/* Convert beacon interval in TU (1024 usec) to nsec */
time = ((1000000000ull * dev->beacon_int) >> 10);
time = ((1000000000ull * dev->mt76.beacon_int) >> 10);
/* Adjust time to trigger hrtimer 8ms before TBTT */
if (tbtt < PRE_TBTT_USEC)
@ -217,7 +217,7 @@ static void mt76x02u_beacon_enable(struct mt76x02_dev *dev, bool en)
{
int i;
if (WARN_ON_ONCE(!dev->beacon_int))
if (WARN_ON_ONCE(!dev->mt76.beacon_int))
return;
if (en) {

View File

@ -650,7 +650,7 @@ void mt76x02_bss_info_changed(struct ieee80211_hw *hw,
mt76_rmw_field(dev, MT_BEACON_TIME_CFG,
MT_BEACON_TIME_CFG_INTVAL,
info->beacon_int << 4);
dev->beacon_int = info->beacon_int;
dev->mt76.beacon_int = info->beacon_int;
}
if (changed & BSS_CHANGED_BEACON_ENABLED)