Skip to content

Commit

Permalink
mt76: move beacon_int in mt76_dev
Browse files Browse the repository at this point in the history
Move beacon_int in mt76_dev data structure since it is used by
all drivers

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed May 1, 2019
1 parent f8f527b commit 3041c44
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt76.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt7603/beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt7603/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt7603/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ struct mt7603_dev {

ktime_t survey_time;
ktime_t ed_time;
int beacon_int;

struct mt76_queue q_rx;

Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt76x02.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt76x02_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3041c44

Please sign in to comment.