Commit 975e122d authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau
Browse files

wifi: mt76: mt7921: rename mt7921_dev in mt792x_dev



This is a preliminary patch to introduce WiFi7 chipset support

Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 78562b2c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
#include "mt7921.h"

static int
mt7921_acpi_read(struct mt7921_dev *dev, u8 *method, u8 **tbl, u32 *len)
mt7921_acpi_read(struct mt792x_dev *dev, u8 *method, u8 **tbl, u32 *len)
{
	struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL };
	union acpi_object *sar_root, *sar_unit;
@@ -65,7 +65,7 @@ mt7921_acpi_read(struct mt7921_dev *dev, u8 *method, u8 **tbl, u32 *len)

/* MTCL : Country List Table for 6G band */
static int
mt7921_asar_acpi_read_mtcl(struct mt7921_dev *dev, u8 **table, u8 *version)
mt7921_asar_acpi_read_mtcl(struct mt792x_dev *dev, u8 **table, u8 *version)
{
	*version = (mt7921_acpi_read(dev, MT7921_ACPI_MTCL, table, NULL) < 0)
		   ? 1 : 2;
@@ -74,7 +74,7 @@ mt7921_asar_acpi_read_mtcl(struct mt7921_dev *dev, u8 **table, u8 *version)

/* MTDS : Dynamic SAR Power Table */
static int
mt7921_asar_acpi_read_mtds(struct mt7921_dev *dev, u8 **table, u8 version)
mt7921_asar_acpi_read_mtds(struct mt792x_dev *dev, u8 **table, u8 version)
{
	int len, ret, sarlen, prelen, tblcnt;
	bool enable;
@@ -109,7 +109,7 @@ mt7921_asar_acpi_read_mtds(struct mt7921_dev *dev, u8 **table, u8 version)

/* MTGS : Geo SAR Power Table */
static int
mt7921_asar_acpi_read_mtgs(struct mt7921_dev *dev, u8 **table, u8 version)
mt7921_asar_acpi_read_mtgs(struct mt792x_dev *dev, u8 **table, u8 version)
{
	int len, ret = 0, sarlen, prelen, tblcnt;

@@ -140,7 +140,7 @@ mt7921_asar_acpi_read_mtgs(struct mt7921_dev *dev, u8 **table, u8 version)

/* MTFG : Flag Table */
static int
mt7921_asar_acpi_read_mtfg(struct mt7921_dev *dev, u8 **table)
mt7921_asar_acpi_read_mtfg(struct mt792x_dev *dev, u8 **table)
{
	int len, ret;

@@ -154,7 +154,7 @@ mt7921_asar_acpi_read_mtfg(struct mt7921_dev *dev, u8 **table)
	return ret;
}

int mt7921_init_acpi_sar(struct mt7921_dev *dev)
int mt7921_init_acpi_sar(struct mt792x_dev *dev)
{
	struct mt7921_acpi_sar *asar;
	int ret;
+19 −19
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
static int
mt7921_reg_set(void *data, u64 val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;

	mt7921_mutex_acquire(dev);
	mt76_wr(dev, dev->mt76.debugfs_reg, val);
@@ -18,7 +18,7 @@ mt7921_reg_set(void *data, u64 val)
static int
mt7921_reg_get(void *data, u64 *val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;

	mt7921_mutex_acquire(dev);
	*val = mt76_rr(dev, dev->mt76.debugfs_reg);
@@ -32,7 +32,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_regval, mt7921_reg_get, mt7921_reg_set,
static int
mt7921_fw_debug_set(void *data, u64 val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;

	mt7921_mutex_acquire(dev);

@@ -47,7 +47,7 @@ mt7921_fw_debug_set(void *data, u64 val)
static int
mt7921_fw_debug_get(void *data, u64 *val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;

	*val = dev->fw_debug;

@@ -61,7 +61,7 @@ static void
mt7921_ampdu_stat_read_phy(struct mt792x_phy *phy,
			   struct seq_file *file)
{
	struct mt7921_dev *dev = file->private;
	struct mt792x_dev *dev = file->private;
	int bound[15], range[4], i;

	if (!phy)
@@ -93,7 +93,7 @@ mt7921_ampdu_stat_read_phy(struct mt792x_phy *phy,
static int
mt7921_tx_stats_show(struct seq_file *file, void *data)
{
	struct mt7921_dev *dev = file->private;
	struct mt792x_dev *dev = file->private;
	struct mt792x_phy *phy = &dev->phy;
	struct mt76_mib_stats *mib = &phy->mib;
	int i;
@@ -123,7 +123,7 @@ DEFINE_SHOW_ATTRIBUTE(mt7921_tx_stats);
static int
mt7921_queues_acq(struct seq_file *s, void *data)
{
	struct mt7921_dev *dev = dev_get_drvdata(s->private);
	struct mt792x_dev *dev = dev_get_drvdata(s->private);
	int i;

	mt7921_mutex_acquire(dev);
@@ -154,7 +154,7 @@ mt7921_queues_acq(struct seq_file *s, void *data)
static int
mt7921_queues_read(struct seq_file *s, void *data)
{
	struct mt7921_dev *dev = dev_get_drvdata(s->private);
	struct mt792x_dev *dev = dev_get_drvdata(s->private);
	struct {
		struct mt76_queue *q;
		char *queue;
@@ -211,7 +211,7 @@ mt7921_seq_puts_array(struct seq_file *file, const char *str,
static int
mt7921_txpwr(struct seq_file *s, void *data)
{
	struct mt7921_dev *dev = dev_get_drvdata(s->private);
	struct mt792x_dev *dev = dev_get_drvdata(s->private);
	struct mt7921_txpwr txpwr;
	int ret;

@@ -263,7 +263,7 @@ mt7921_txpwr(struct seq_file *s, void *data)
static int
mt7921_pm_set(void *data, u64 val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;
	struct mt76_connac_pm *pm = &dev->pm;

	if (mt76_is_usb(&dev->mt76))
@@ -296,7 +296,7 @@ mt7921_pm_set(void *data, u64 val)
static int
mt7921_pm_get(void *data, u64 *val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;

	*val = dev->pm.enable_user;

@@ -308,7 +308,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_pm, mt7921_pm_get, mt7921_pm_set, "%lld\n");
static int
mt7921_deep_sleep_set(void *data, u64 val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;
	struct mt76_connac_pm *pm = &dev->pm;
	bool monitor = !!(dev->mphy.hw->conf.flags & IEEE80211_CONF_MONITOR);
	bool enable = !!val;
@@ -332,7 +332,7 @@ mt7921_deep_sleep_set(void *data, u64 val)
static int
mt7921_deep_sleep_get(void *data, u64 *val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;

	*val = dev->pm.ds_enable_user;

@@ -345,7 +345,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_ds, mt7921_deep_sleep_get,
static int
mt7921_pm_stats(struct seq_file *s, void *data)
{
	struct mt7921_dev *dev = dev_get_drvdata(s->private);
	struct mt792x_dev *dev = dev_get_drvdata(s->private);
	struct mt76_connac_pm *pm = &dev->pm;

	unsigned long awake_time = pm->stats.awake_time;
@@ -368,7 +368,7 @@ mt7921_pm_stats(struct seq_file *s, void *data)
static int
mt7921_pm_idle_timeout_set(void *data, u64 val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;

	dev->pm.idle_timeout = msecs_to_jiffies(val);

@@ -378,7 +378,7 @@ mt7921_pm_idle_timeout_set(void *data, u64 val)
static int
mt7921_pm_idle_timeout_get(void *data, u64 *val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;

	*val = jiffies_to_msecs(dev->pm.idle_timeout);

@@ -390,7 +390,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_pm_idle_timeout, mt7921_pm_idle_timeout_get,

static int mt7921_chip_reset(void *data, u64 val)
{
	struct mt7921_dev *dev = data;
	struct mt792x_dev *dev = data;
	int ret = 0;

	switch (val) {
@@ -414,7 +414,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_reset, NULL, mt7921_chip_reset, "%lld\n");
static int
mt7921s_sched_quota_read(struct seq_file *s, void *data)
{
	struct mt7921_dev *dev = dev_get_drvdata(s->private);
	struct mt792x_dev *dev = dev_get_drvdata(s->private);
	struct mt76_sdio *sdio = &dev->mt76.sdio;

	seq_printf(s, "pse_data_quota\t%d\n", sdio->sched.pse_data_quota);
@@ -425,7 +425,7 @@ mt7921s_sched_quota_read(struct seq_file *s, void *data)
	return 0;
}

int mt7921_init_debugfs(struct mt7921_dev *dev)
int mt7921_init_debugfs(struct mt792x_dev *dev)
{
	struct dentry *dir;

+13 −13
Original line number Diff line number Diff line
@@ -7,9 +7,9 @@

static int mt7921_poll_tx(struct napi_struct *napi, int budget)
{
	struct mt7921_dev *dev;
	struct mt792x_dev *dev;

	dev = container_of(napi, struct mt7921_dev, mt76.tx_napi);
	dev = container_of(napi, struct mt792x_dev, mt76.tx_napi);

	if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) {
		napi_complete(napi);
@@ -27,10 +27,10 @@ static int mt7921_poll_tx(struct napi_struct *napi, int budget)

static int mt7921_poll_rx(struct napi_struct *napi, int budget)
{
	struct mt7921_dev *dev;
	struct mt792x_dev *dev;
	int done;

	dev = container_of(napi->dev, struct mt7921_dev, mt76.napi_dev);
	dev = container_of(napi->dev, struct mt792x_dev, mt76.napi_dev);

	if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) {
		napi_complete(napi);
@@ -43,7 +43,7 @@ static int mt7921_poll_rx(struct napi_struct *napi, int budget)
	return done;
}

static void mt7921_dma_prefetch(struct mt7921_dev *dev)
static void mt7921_dma_prefetch(struct mt792x_dev *dev)
{
#define PREFETCH(base, depth)	((base) << 16 | (depth))

@@ -64,7 +64,7 @@ static void mt7921_dma_prefetch(struct mt7921_dev *dev)
	mt76_wr(dev, MT_WFDMA0_TX_RING17_EXT_CTRL, PREFETCH(0x380, 0x4));
}

static int mt7921_dma_disable(struct mt7921_dev *dev, bool force)
static int mt7921_dma_disable(struct mt792x_dev *dev, bool force)
{
	/* disable WFDMA0 */
	mt76_clear(dev, MT_WFDMA0_GLO_CFG,
@@ -98,7 +98,7 @@ static int mt7921_dma_disable(struct mt7921_dev *dev, bool force)
	return 0;
}

static int mt7921_dma_enable(struct mt7921_dev *dev)
static int mt7921_dma_enable(struct mt792x_dev *dev)
{
	/* configure perfetch settings */
	mt7921_dma_prefetch(dev);
@@ -131,7 +131,7 @@ static int mt7921_dma_enable(struct mt7921_dev *dev)
	return 0;
}

static int mt7921_dma_reset(struct mt7921_dev *dev, bool force)
static int mt7921_dma_reset(struct mt792x_dev *dev, bool force)
{
	int i, err;

@@ -154,7 +154,7 @@ static int mt7921_dma_reset(struct mt7921_dev *dev, bool force)
	return mt7921_dma_enable(dev);
}

int mt7921_wfsys_reset(struct mt7921_dev *dev)
int mt7921_wfsys_reset(struct mt792x_dev *dev)
{
	mt76_clear(dev, MT_WFSYS_SW_RST_B, WFSYS_SW_RST_B);
	msleep(50);
@@ -167,7 +167,7 @@ int mt7921_wfsys_reset(struct mt7921_dev *dev)
	return 0;
}

int mt7921_wpdma_reset(struct mt7921_dev *dev, bool force)
int mt7921_wpdma_reset(struct mt792x_dev *dev, bool force)
{
	int i, err;

@@ -196,7 +196,7 @@ int mt7921_wpdma_reset(struct mt7921_dev *dev, bool force)
	return 0;
}

int mt7921_wpdma_reinit_cond(struct mt7921_dev *dev)
int mt7921_wpdma_reinit_cond(struct mt792x_dev *dev)
{
	struct mt76_connac_pm *pm = &dev->pm;
	int err;
@@ -221,7 +221,7 @@ int mt7921_wpdma_reinit_cond(struct mt7921_dev *dev)
	return 0;
}

int mt7921_dma_init(struct mt7921_dev *dev)
int mt7921_dma_init(struct mt792x_dev *dev)
{
	int ret;

@@ -286,7 +286,7 @@ int mt7921_dma_init(struct mt7921_dev *dev)
	return mt7921_dma_enable(dev);
}

void mt7921_dma_cleanup(struct mt7921_dev *dev)
void mt7921_dma_cleanup(struct mt792x_dev *dev)
{
	/* disable */
	mt76_clear(dev, MT_WFDMA0_GLO_CFG,
+10 −10
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ static ssize_t mt7921_thermal_temp_show(struct device *dev,
	switch (to_sensor_dev_attr(attr)->index) {
	case 0: {
		struct mt792x_phy *phy = dev_get_drvdata(dev);
		struct mt7921_dev *mdev = phy->dev;
		struct mt792x_dev *mdev = phy->dev;
		int temperature;

		mt7921_mutex_acquire(mdev);
@@ -110,7 +110,7 @@ mt7921_regd_notifier(struct wiphy *wiphy,
		     struct regulatory_request *request)
{
	struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
	struct mt7921_dev *dev = mt7921_hw_dev(hw);
	struct mt792x_dev *dev = mt7921_hw_dev(hw);

	memcpy(dev->mt76.alpha2, request->alpha2, sizeof(dev->mt76.alpha2));
	dev->mt76.region = request->dfs_region;
@@ -127,7 +127,7 @@ static int
mt7921_init_wiphy(struct ieee80211_hw *hw)
{
	struct mt792x_phy *phy = mt7921_hw_phy(hw);
	struct mt7921_dev *dev = phy->dev;
	struct mt792x_dev *dev = phy->dev;
	struct wiphy *wiphy = hw->wiphy;

	hw->queues = 4;
@@ -200,7 +200,7 @@ mt7921_init_wiphy(struct ieee80211_hw *hw)
}

static void
mt7921_mac_init_band(struct mt7921_dev *dev, u8 band)
mt7921_mac_init_band(struct mt792x_dev *dev, u8 band)
{
	u32 mask, set;

@@ -309,7 +309,7 @@ mt7921_get_mac80211_ops(struct device *dev, void *drv_data, u8 *fw_features)
}
EXPORT_SYMBOL_GPL(mt7921_get_mac80211_ops);

int mt7921_mac_init(struct mt7921_dev *dev)
int mt7921_mac_init(struct mt792x_dev *dev)
{
	int i;

@@ -329,7 +329,7 @@ int mt7921_mac_init(struct mt7921_dev *dev)
}
EXPORT_SYMBOL_GPL(mt7921_mac_init);

static int __mt7921_init_hardware(struct mt7921_dev *dev)
static int __mt7921_init_hardware(struct mt792x_dev *dev)
{
	int ret;

@@ -352,7 +352,7 @@ static int __mt7921_init_hardware(struct mt7921_dev *dev)
	return ret;
}

static int mt7921_init_hardware(struct mt7921_dev *dev)
static int mt7921_init_hardware(struct mt792x_dev *dev)
{
	int ret, i;

@@ -374,7 +374,7 @@ static int mt7921_init_hardware(struct mt7921_dev *dev)
	return 0;
}

static int mt7921_init_wcid(struct mt7921_dev *dev)
static int mt7921_init_wcid(struct mt792x_dev *dev)
{
	int idx;

@@ -393,7 +393,7 @@ static int mt7921_init_wcid(struct mt7921_dev *dev)

static void mt7921_init_work(struct work_struct *work)
{
	struct mt7921_dev *dev = container_of(work, struct mt7921_dev,
	struct mt792x_dev *dev = container_of(work, struct mt792x_dev,
					      init_work);
	int ret;

@@ -429,7 +429,7 @@ static void mt7921_init_work(struct work_struct *work)
	mt76_connac_mcu_set_deep_sleep(&dev->mt76, dev->pm.ds_enable);
}

int mt7921_register_device(struct mt7921_dev *dev)
int mt7921_register_device(struct mt792x_dev *dev)
{
	struct ieee80211_hw *hw = mt76_hw(dev);
	int ret;
+29 −29
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ static u32 mt7921_mac_wtbl_lmac_addr(int idx, u8 offset)
	return MT_WTBL_LMAC_OFFS(idx, 0) + offset * 4;
}

static struct mt76_wcid *mt7921_rx_get_wcid(struct mt7921_dev *dev,
static struct mt76_wcid *mt7921_rx_get_wcid(struct mt792x_dev *dev,
					    u16 idx, bool unicast)
{
	struct mt792x_sta *sta;
@@ -43,7 +43,7 @@ static struct mt76_wcid *mt7921_rx_get_wcid(struct mt7921_dev *dev,
	return &sta->vif->sta.wcid;
}

bool mt7921_mac_wtbl_update(struct mt7921_dev *dev, int idx, u32 mask)
bool mt7921_mac_wtbl_update(struct mt792x_dev *dev, int idx, u32 mask)
{
	mt76_rmw(dev, MT_WTBL_UPDATE, MT_WTBL_UPDATE_WLAN_IDX,
		 FIELD_PREP(MT_WTBL_UPDATE_WLAN_IDX, idx) | mask);
@@ -52,7 +52,7 @@ bool mt7921_mac_wtbl_update(struct mt7921_dev *dev, int idx, u32 mask)
			 0, 5000);
}

static void mt7921_mac_sta_poll(struct mt7921_dev *dev)
static void mt7921_mac_sta_poll(struct mt792x_dev *dev)
{
	static const u8 ac_to_tid[] = {
		[IEEE80211_AC_BE] = 0,
@@ -185,7 +185,7 @@ static void mt7921_mac_sta_poll(struct mt7921_dev *dev)
}

static void
mt7921_get_status_freq_info(struct mt7921_dev *dev, struct mt76_phy *mphy,
mt7921_get_status_freq_info(struct mt792x_dev *dev, struct mt76_phy *mphy,
			    struct mt76_rx_status *status, u8 chfreq)
{
	if (chfreq > 180) {
@@ -217,7 +217,7 @@ mt7921_mac_rssi_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
}

static void
mt7921_mac_assoc_rssi(struct mt7921_dev *dev, struct sk_buff *skb)
mt7921_mac_assoc_rssi(struct mt792x_dev *dev, struct sk_buff *skb)
{
	struct ieee80211_hdr *hdr = mt76_skb_get_hdr(skb);

@@ -231,7 +231,7 @@ mt7921_mac_assoc_rssi(struct mt7921_dev *dev, struct sk_buff *skb)
}

static int
mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb)
mt7921_mac_fill_rx(struct mt792x_dev *dev, struct sk_buff *skb)
{
	u32 csum_mask = MT_RXD0_NORMAL_IP_SUM | MT_RXD0_NORMAL_UDP_TCP_SUM;
	struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb;
@@ -511,7 +511,7 @@ mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb)
	return 0;
}

void mt7921_mac_add_txs(struct mt7921_dev *dev, void *data)
void mt7921_mac_add_txs(struct mt792x_dev *dev, void *data)
{
	struct mt792x_sta *msta = NULL;
	struct mt76_wcid *wcid;
@@ -552,7 +552,7 @@ void mt7921_mac_add_txs(struct mt7921_dev *dev, void *data)
	rcu_read_unlock();
}

static void mt7921_mac_tx_free(struct mt7921_dev *dev, void *data, int len)
static void mt7921_mac_tx_free(struct mt792x_dev *dev, void *data, int len)
{
	struct mt76_connac_tx_free *free = data;
	__le32 *tx_info = (__le32 *)(data + sizeof(*free));
@@ -634,7 +634,7 @@ static void mt7921_mac_tx_free(struct mt7921_dev *dev, void *data, int len)

bool mt7921_rx_check(struct mt76_dev *mdev, void *data, int len)
{
	struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
	struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
	__le32 *rxd = (__le32 *)data;
	__le32 *end = (__le32 *)&rxd[len / 4];
	enum rx_pkt_type type;
@@ -659,7 +659,7 @@ EXPORT_SYMBOL_GPL(mt7921_rx_check);
void mt7921_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
			 struct sk_buff *skb, u32 *info)
{
	struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
	struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
	__le32 *rxd = (__le32 *)skb->data;
	__le32 *end = (__le32 *)&skb->data[skb->len];
	enum rx_pkt_type type;
@@ -701,7 +701,7 @@ EXPORT_SYMBOL_GPL(mt7921_queue_rx_skb);

void mt7921_mac_reset_counters(struct mt792x_phy *phy)
{
	struct mt7921_dev *dev = phy->dev;
	struct mt792x_dev *dev = phy->dev;
	int i;

	for (i = 0; i < 4; i++) {
@@ -724,7 +724,7 @@ void mt7921_mac_reset_counters(struct mt792x_phy *phy)
void mt7921_mac_set_timing(struct mt792x_phy *phy)
{
	s16 coverage_class = phy->coverage_class;
	struct mt7921_dev *dev = phy->dev;
	struct mt792x_dev *dev = phy->dev;
	u32 val, reg_offset;
	u32 cck = FIELD_PREP(MT_TIMEOUT_VAL_PLCP, 231) |
		  FIELD_PREP(MT_TIMEOUT_VAL_CCA, 48);
@@ -771,7 +771,7 @@ mt7921_phy_get_nf(struct mt792x_phy *phy, int idx)
static void
mt7921_phy_update_channel(struct mt76_phy *mphy, int idx)
{
	struct mt7921_dev *dev = container_of(mphy->dev, struct mt7921_dev, mt76);
	struct mt792x_dev *dev = container_of(mphy->dev, struct mt792x_dev, mt76);
	struct mt792x_phy *phy = (struct mt792x_phy *)mphy->priv;
	struct mt76_channel_state *state;
	u64 busy_time, tx_time, rx_time, obss_time;
@@ -802,7 +802,7 @@ mt7921_phy_update_channel(struct mt76_phy *mphy, int idx)

void mt7921_update_channel(struct mt76_phy *mphy)
{
	struct mt7921_dev *dev = container_of(mphy->dev, struct mt7921_dev, mt76);
	struct mt792x_dev *dev = container_of(mphy->dev, struct mt792x_dev, mt76);

	if (mt76_connac_pm_wake(mphy, &dev->pm))
		return;
@@ -820,7 +820,7 @@ mt7921_vif_connect_iter(void *priv, u8 *mac,
			struct ieee80211_vif *vif)
{
	struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
	struct mt7921_dev *dev = mvif->phy->dev;
	struct mt792x_dev *dev = mvif->phy->dev;
	struct ieee80211_hw *hw = mt76_hw(dev);

	if (vif->type == NL80211_IFTYPE_STATION)
@@ -841,7 +841,7 @@ mt7921_vif_connect_iter(void *priv, u8 *mac,
/* system error recovery */
void mt7921_mac_reset_work(struct work_struct *work)
{
	struct mt7921_dev *dev = container_of(work, struct mt7921_dev,
	struct mt792x_dev *dev = container_of(work, struct mt792x_dev,
					      reset_work);
	struct ieee80211_hw *hw = mt76_hw(dev);
	struct mt76_connac_pm *pm = &dev->pm;
@@ -886,7 +886,7 @@ void mt7921_mac_reset_work(struct work_struct *work)

void mt7921_reset(struct mt76_dev *mdev)
{
	struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
	struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
	struct mt76_connac_pm *pm = &dev->pm;

	if (!dev->hw_init_done)
@@ -905,7 +905,7 @@ EXPORT_SYMBOL_GPL(mt7921_reset);
void mt7921_mac_update_mib_stats(struct mt792x_phy *phy)
{
	struct mt76_mib_stats *mib = &phy->mib;
	struct mt7921_dev *dev = phy->dev;
	struct mt792x_dev *dev = phy->dev;
	int i, aggr0 = 0, aggr1;
	u32 val;

@@ -989,10 +989,10 @@ void mt7921_mac_work(struct work_struct *work)

void mt7921_pm_wake_work(struct work_struct *work)
{
	struct mt7921_dev *dev;
	struct mt792x_dev *dev;
	struct mt76_phy *mphy;

	dev = (struct mt7921_dev *)container_of(work, struct mt7921_dev,
	dev = (struct mt792x_dev *)container_of(work, struct mt792x_dev,
						pm.wake_work);
	mphy = dev->phy.mt76;

@@ -1022,11 +1022,11 @@ void mt7921_pm_wake_work(struct work_struct *work)

void mt7921_pm_power_save_work(struct work_struct *work)
{
	struct mt7921_dev *dev;
	struct mt792x_dev *dev;
	unsigned long delta;
	struct mt76_phy *mphy;

	dev = (struct mt7921_dev *)container_of(work, struct mt7921_dev,
	dev = (struct mt792x_dev *)container_of(work, struct mt792x_dev,
						pm.ps_work.work);
	mphy = dev->phy.mt76;

@@ -1059,10 +1059,10 @@ void mt7921_pm_power_save_work(struct work_struct *work)

void mt7921_coredump_work(struct work_struct *work)
{
	struct mt7921_dev *dev;
	struct mt792x_dev *dev;
	char *dump, *data;

	dev = (struct mt7921_dev *)container_of(work, struct mt7921_dev,
	dev = (struct mt792x_dev *)container_of(work, struct mt792x_dev,
						coredump.work.work);

	if (time_is_after_jiffies(dev->coredump.last_activity +
@@ -1106,7 +1106,7 @@ void mt7921_coredump_work(struct work_struct *work)

/* usb_sdio */
static void
mt7921_usb_sdio_write_txwi(struct mt7921_dev *dev, struct mt76_wcid *wcid,
mt7921_usb_sdio_write_txwi(struct mt792x_dev *dev, struct mt76_wcid *wcid,
			   enum mt76_txq_id qid, struct ieee80211_sta *sta,
			   struct ieee80211_key_conf *key, int pid,
			   struct sk_buff *skb)
@@ -1123,7 +1123,7 @@ int mt7921_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
				   struct ieee80211_sta *sta,
				   struct mt76_tx_info *tx_info)
{
	struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
	struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_info->skb);
	struct ieee80211_key_conf *key = info->control.hw_key;
	struct sk_buff *skb = tx_info->skb;
@@ -1189,7 +1189,7 @@ EXPORT_SYMBOL_GPL(mt7921_usb_sdio_tx_complete_skb);

bool mt7921_usb_sdio_tx_status_data(struct mt76_dev *mdev, u8 *update)
{
	struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
	struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);

	mt7921_mutex_acquire(dev);
	mt7921_mac_sta_poll(dev);
@@ -1202,7 +1202,7 @@ EXPORT_SYMBOL_GPL(mt7921_usb_sdio_tx_status_data);
#if IS_ENABLED(CONFIG_IPV6)
void mt7921_set_ipv6_ns_work(struct work_struct *work)
{
	struct mt7921_dev *dev = container_of(work, struct mt7921_dev,
	struct mt792x_dev *dev = container_of(work, struct mt792x_dev,
					      ipv6_ns_work);
	struct sk_buff *skb;
	int ret = 0;
Loading