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

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
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "mt7921.h" #include "mt7921.h"
static int 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 }; struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *sar_root, *sar_unit; union acpi_object *sar_root, *sar_unit;
...@@ -65,7 +65,7 @@ mt7921_acpi_read(struct mt7921_dev *dev, u8 *method, u8 **tbl, u32 *len) ...@@ -65,7 +65,7 @@ mt7921_acpi_read(struct mt7921_dev *dev, u8 *method, u8 **tbl, u32 *len)
/* MTCL : Country List Table for 6G band */ /* MTCL : Country List Table for 6G band */
static int 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) *version = (mt7921_acpi_read(dev, MT7921_ACPI_MTCL, table, NULL) < 0)
? 1 : 2; ? 1 : 2;
...@@ -74,7 +74,7 @@ mt7921_asar_acpi_read_mtcl(struct mt7921_dev *dev, u8 **table, u8 *version) ...@@ -74,7 +74,7 @@ mt7921_asar_acpi_read_mtcl(struct mt7921_dev *dev, u8 **table, u8 *version)
/* MTDS : Dynamic SAR Power Table */ /* MTDS : Dynamic SAR Power Table */
static int 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; int len, ret, sarlen, prelen, tblcnt;
bool enable; bool enable;
...@@ -109,7 +109,7 @@ mt7921_asar_acpi_read_mtds(struct mt7921_dev *dev, u8 **table, u8 version) ...@@ -109,7 +109,7 @@ mt7921_asar_acpi_read_mtds(struct mt7921_dev *dev, u8 **table, u8 version)
/* MTGS : Geo SAR Power Table */ /* MTGS : Geo SAR Power Table */
static int 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; int len, ret = 0, sarlen, prelen, tblcnt;
...@@ -140,7 +140,7 @@ mt7921_asar_acpi_read_mtgs(struct mt7921_dev *dev, u8 **table, u8 version) ...@@ -140,7 +140,7 @@ mt7921_asar_acpi_read_mtgs(struct mt7921_dev *dev, u8 **table, u8 version)
/* MTFG : Flag Table */ /* MTFG : Flag Table */
static int 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; int len, ret;
...@@ -154,7 +154,7 @@ mt7921_asar_acpi_read_mtfg(struct mt7921_dev *dev, u8 **table) ...@@ -154,7 +154,7 @@ mt7921_asar_acpi_read_mtfg(struct mt7921_dev *dev, u8 **table)
return ret; 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; struct mt7921_acpi_sar *asar;
int ret; int ret;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
static int static int
mt7921_reg_set(void *data, u64 val) mt7921_reg_set(void *data, u64 val)
{ {
struct mt7921_dev *dev = data; struct mt792x_dev *dev = data;
mt7921_mutex_acquire(dev); mt7921_mutex_acquire(dev);
mt76_wr(dev, dev->mt76.debugfs_reg, val); mt76_wr(dev, dev->mt76.debugfs_reg, val);
...@@ -18,7 +18,7 @@ mt7921_reg_set(void *data, u64 val) ...@@ -18,7 +18,7 @@ mt7921_reg_set(void *data, u64 val)
static int static int
mt7921_reg_get(void *data, u64 *val) mt7921_reg_get(void *data, u64 *val)
{ {
struct mt7921_dev *dev = data; struct mt792x_dev *dev = data;
mt7921_mutex_acquire(dev); mt7921_mutex_acquire(dev);
*val = mt76_rr(dev, dev->mt76.debugfs_reg); *val = mt76_rr(dev, dev->mt76.debugfs_reg);
...@@ -32,7 +32,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_regval, mt7921_reg_get, mt7921_reg_set, ...@@ -32,7 +32,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_regval, mt7921_reg_get, mt7921_reg_set,
static int static int
mt7921_fw_debug_set(void *data, u64 val) mt7921_fw_debug_set(void *data, u64 val)
{ {
struct mt7921_dev *dev = data; struct mt792x_dev *dev = data;
mt7921_mutex_acquire(dev); mt7921_mutex_acquire(dev);
...@@ -47,7 +47,7 @@ mt7921_fw_debug_set(void *data, u64 val) ...@@ -47,7 +47,7 @@ mt7921_fw_debug_set(void *data, u64 val)
static int static int
mt7921_fw_debug_get(void *data, u64 *val) mt7921_fw_debug_get(void *data, u64 *val)
{ {
struct mt7921_dev *dev = data; struct mt792x_dev *dev = data;
*val = dev->fw_debug; *val = dev->fw_debug;
...@@ -61,7 +61,7 @@ static void ...@@ -61,7 +61,7 @@ static void
mt7921_ampdu_stat_read_phy(struct mt792x_phy *phy, mt7921_ampdu_stat_read_phy(struct mt792x_phy *phy,
struct seq_file *file) struct seq_file *file)
{ {
struct mt7921_dev *dev = file->private; struct mt792x_dev *dev = file->private;
int bound[15], range[4], i; int bound[15], range[4], i;
if (!phy) if (!phy)
...@@ -93,7 +93,7 @@ mt7921_ampdu_stat_read_phy(struct mt792x_phy *phy, ...@@ -93,7 +93,7 @@ mt7921_ampdu_stat_read_phy(struct mt792x_phy *phy,
static int static int
mt7921_tx_stats_show(struct seq_file *file, void *data) 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 mt792x_phy *phy = &dev->phy;
struct mt76_mib_stats *mib = &phy->mib; struct mt76_mib_stats *mib = &phy->mib;
int i; int i;
...@@ -123,7 +123,7 @@ DEFINE_SHOW_ATTRIBUTE(mt7921_tx_stats); ...@@ -123,7 +123,7 @@ DEFINE_SHOW_ATTRIBUTE(mt7921_tx_stats);
static int static int
mt7921_queues_acq(struct seq_file *s, void *data) 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; int i;
mt7921_mutex_acquire(dev); mt7921_mutex_acquire(dev);
...@@ -154,7 +154,7 @@ mt7921_queues_acq(struct seq_file *s, void *data) ...@@ -154,7 +154,7 @@ mt7921_queues_acq(struct seq_file *s, void *data)
static int static int
mt7921_queues_read(struct seq_file *s, void *data) 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 {
struct mt76_queue *q; struct mt76_queue *q;
char *queue; char *queue;
...@@ -211,7 +211,7 @@ mt7921_seq_puts_array(struct seq_file *file, const char *str, ...@@ -211,7 +211,7 @@ mt7921_seq_puts_array(struct seq_file *file, const char *str,
static int static int
mt7921_txpwr(struct seq_file *s, void *data) 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; struct mt7921_txpwr txpwr;
int ret; int ret;
...@@ -263,7 +263,7 @@ mt7921_txpwr(struct seq_file *s, void *data) ...@@ -263,7 +263,7 @@ mt7921_txpwr(struct seq_file *s, void *data)
static int static int
mt7921_pm_set(void *data, u64 val) mt7921_pm_set(void *data, u64 val)
{ {
struct mt7921_dev *dev = data; struct mt792x_dev *dev = data;
struct mt76_connac_pm *pm = &dev->pm; struct mt76_connac_pm *pm = &dev->pm;
if (mt76_is_usb(&dev->mt76)) if (mt76_is_usb(&dev->mt76))
...@@ -296,7 +296,7 @@ mt7921_pm_set(void *data, u64 val) ...@@ -296,7 +296,7 @@ mt7921_pm_set(void *data, u64 val)
static int static int
mt7921_pm_get(void *data, u64 *val) mt7921_pm_get(void *data, u64 *val)
{ {
struct mt7921_dev *dev = data; struct mt792x_dev *dev = data;
*val = dev->pm.enable_user; *val = dev->pm.enable_user;
...@@ -308,7 +308,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_pm, mt7921_pm_get, mt7921_pm_set, "%lld\n"); ...@@ -308,7 +308,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_pm, mt7921_pm_get, mt7921_pm_set, "%lld\n");
static int static int
mt7921_deep_sleep_set(void *data, u64 val) 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; struct mt76_connac_pm *pm = &dev->pm;
bool monitor = !!(dev->mphy.hw->conf.flags & IEEE80211_CONF_MONITOR); bool monitor = !!(dev->mphy.hw->conf.flags & IEEE80211_CONF_MONITOR);
bool enable = !!val; bool enable = !!val;
...@@ -332,7 +332,7 @@ mt7921_deep_sleep_set(void *data, u64 val) ...@@ -332,7 +332,7 @@ mt7921_deep_sleep_set(void *data, u64 val)
static int static int
mt7921_deep_sleep_get(void *data, u64 *val) mt7921_deep_sleep_get(void *data, u64 *val)
{ {
struct mt7921_dev *dev = data; struct mt792x_dev *dev = data;
*val = dev->pm.ds_enable_user; *val = dev->pm.ds_enable_user;
...@@ -345,7 +345,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_ds, mt7921_deep_sleep_get, ...@@ -345,7 +345,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_ds, mt7921_deep_sleep_get,
static int static int
mt7921_pm_stats(struct seq_file *s, void *data) 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; struct mt76_connac_pm *pm = &dev->pm;
unsigned long awake_time = pm->stats.awake_time; unsigned long awake_time = pm->stats.awake_time;
...@@ -368,7 +368,7 @@ mt7921_pm_stats(struct seq_file *s, void *data) ...@@ -368,7 +368,7 @@ mt7921_pm_stats(struct seq_file *s, void *data)
static int static int
mt7921_pm_idle_timeout_set(void *data, u64 val) 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); dev->pm.idle_timeout = msecs_to_jiffies(val);
...@@ -378,7 +378,7 @@ mt7921_pm_idle_timeout_set(void *data, u64 val) ...@@ -378,7 +378,7 @@ mt7921_pm_idle_timeout_set(void *data, u64 val)
static int static int
mt7921_pm_idle_timeout_get(void *data, u64 *val) 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); *val = jiffies_to_msecs(dev->pm.idle_timeout);
...@@ -390,7 +390,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_pm_idle_timeout, mt7921_pm_idle_timeout_get, ...@@ -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) static int mt7921_chip_reset(void *data, u64 val)
{ {
struct mt7921_dev *dev = data; struct mt792x_dev *dev = data;
int ret = 0; int ret = 0;
switch (val) { switch (val) {
...@@ -414,7 +414,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_reset, NULL, mt7921_chip_reset, "%lld\n"); ...@@ -414,7 +414,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_reset, NULL, mt7921_chip_reset, "%lld\n");
static int static int
mt7921s_sched_quota_read(struct seq_file *s, void *data) 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; struct mt76_sdio *sdio = &dev->mt76.sdio;
seq_printf(s, "pse_data_quota\t%d\n", sdio->sched.pse_data_quota); 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) ...@@ -425,7 +425,7 @@ mt7921s_sched_quota_read(struct seq_file *s, void *data)
return 0; return 0;
} }
int mt7921_init_debugfs(struct mt7921_dev *dev) int mt7921_init_debugfs(struct mt792x_dev *dev)
{ {
struct dentry *dir; struct dentry *dir;
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
static int mt7921_poll_tx(struct napi_struct *napi, int budget) 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)) { if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) {
napi_complete(napi); napi_complete(napi);
...@@ -27,10 +27,10 @@ static int mt7921_poll_tx(struct napi_struct *napi, int budget) ...@@ -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) static int mt7921_poll_rx(struct napi_struct *napi, int budget)
{ {
struct mt7921_dev *dev; struct mt792x_dev *dev;
int done; 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)) { if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) {
napi_complete(napi); napi_complete(napi);
...@@ -43,7 +43,7 @@ static int mt7921_poll_rx(struct napi_struct *napi, int budget) ...@@ -43,7 +43,7 @@ static int mt7921_poll_rx(struct napi_struct *napi, int budget)
return done; 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)) #define PREFETCH(base, depth) ((base) << 16 | (depth))
...@@ -64,7 +64,7 @@ static void mt7921_dma_prefetch(struct mt7921_dev *dev) ...@@ -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)); 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 */ /* disable WFDMA0 */
mt76_clear(dev, MT_WFDMA0_GLO_CFG, mt76_clear(dev, MT_WFDMA0_GLO_CFG,
...@@ -98,7 +98,7 @@ static int mt7921_dma_disable(struct mt7921_dev *dev, bool force) ...@@ -98,7 +98,7 @@ static int mt7921_dma_disable(struct mt7921_dev *dev, bool force)
return 0; return 0;
} }
static int mt7921_dma_enable(struct mt7921_dev *dev) static int mt7921_dma_enable(struct mt792x_dev *dev)
{ {
/* configure perfetch settings */ /* configure perfetch settings */
mt7921_dma_prefetch(dev); mt7921_dma_prefetch(dev);
...@@ -131,7 +131,7 @@ static int mt7921_dma_enable(struct mt7921_dev *dev) ...@@ -131,7 +131,7 @@ static int mt7921_dma_enable(struct mt7921_dev *dev)
return 0; 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; int i, err;
...@@ -154,7 +154,7 @@ static int mt7921_dma_reset(struct mt7921_dev *dev, bool force) ...@@ -154,7 +154,7 @@ static int mt7921_dma_reset(struct mt7921_dev *dev, bool force)
return mt7921_dma_enable(dev); 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); mt76_clear(dev, MT_WFSYS_SW_RST_B, WFSYS_SW_RST_B);
msleep(50); msleep(50);
...@@ -167,7 +167,7 @@ int mt7921_wfsys_reset(struct mt7921_dev *dev) ...@@ -167,7 +167,7 @@ int mt7921_wfsys_reset(struct mt7921_dev *dev)
return 0; 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; int i, err;
...@@ -196,7 +196,7 @@ int mt7921_wpdma_reset(struct mt7921_dev *dev, bool force) ...@@ -196,7 +196,7 @@ int mt7921_wpdma_reset(struct mt7921_dev *dev, bool force)
return 0; 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; struct mt76_connac_pm *pm = &dev->pm;
int err; int err;
...@@ -221,7 +221,7 @@ int mt7921_wpdma_reinit_cond(struct mt7921_dev *dev) ...@@ -221,7 +221,7 @@ int mt7921_wpdma_reinit_cond(struct mt7921_dev *dev)
return 0; return 0;
} }
int mt7921_dma_init(struct mt7921_dev *dev) int mt7921_dma_init(struct mt792x_dev *dev)
{ {
int ret; int ret;
...@@ -286,7 +286,7 @@ int mt7921_dma_init(struct mt7921_dev *dev) ...@@ -286,7 +286,7 @@ int mt7921_dma_init(struct mt7921_dev *dev)
return mt7921_dma_enable(dev); return mt7921_dma_enable(dev);
} }
void mt7921_dma_cleanup(struct mt7921_dev *dev) void mt7921_dma_cleanup(struct mt792x_dev *dev)
{ {
/* disable */ /* disable */
mt76_clear(dev, MT_WFDMA0_GLO_CFG, mt76_clear(dev, MT_WFDMA0_GLO_CFG,
......
...@@ -61,7 +61,7 @@ static ssize_t mt7921_thermal_temp_show(struct device *dev, ...@@ -61,7 +61,7 @@ static ssize_t mt7921_thermal_temp_show(struct device *dev,
switch (to_sensor_dev_attr(attr)->index) { switch (to_sensor_dev_attr(attr)->index) {
case 0: { case 0: {
struct mt792x_phy *phy = dev_get_drvdata(dev); struct mt792x_phy *phy = dev_get_drvdata(dev);
struct mt7921_dev *mdev = phy->dev; struct mt792x_dev *mdev = phy->dev;
int temperature; int temperature;
mt7921_mutex_acquire(mdev); mt7921_mutex_acquire(mdev);
...@@ -110,7 +110,7 @@ mt7921_regd_notifier(struct wiphy *wiphy, ...@@ -110,7 +110,7 @@ mt7921_regd_notifier(struct wiphy *wiphy,
struct regulatory_request *request) struct regulatory_request *request)
{ {
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); 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)); memcpy(dev->mt76.alpha2, request->alpha2, sizeof(dev->mt76.alpha2));
dev->mt76.region = request->dfs_region; dev->mt76.region = request->dfs_region;
...@@ -127,7 +127,7 @@ static int ...@@ -127,7 +127,7 @@ static int
mt7921_init_wiphy(struct ieee80211_hw *hw) mt7921_init_wiphy(struct ieee80211_hw *hw)
{ {
struct mt792x_phy *phy = mt7921_hw_phy(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; struct wiphy *wiphy = hw->wiphy;
hw->queues = 4; hw->queues = 4;
...@@ -200,7 +200,7 @@ mt7921_init_wiphy(struct ieee80211_hw *hw) ...@@ -200,7 +200,7 @@ mt7921_init_wiphy(struct ieee80211_hw *hw)
} }
static void 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; u32 mask, set;
...@@ -309,7 +309,7 @@ mt7921_get_mac80211_ops(struct device *dev, void *drv_data, u8 *fw_features) ...@@ -309,7 +309,7 @@ mt7921_get_mac80211_ops(struct device *dev, void *drv_data, u8 *fw_features)
} }
EXPORT_SYMBOL_GPL(mt7921_get_mac80211_ops); 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; int i;
...@@ -329,7 +329,7 @@ int mt7921_mac_init(struct mt7921_dev *dev) ...@@ -329,7 +329,7 @@ int mt7921_mac_init(struct mt7921_dev *dev)
} }
EXPORT_SYMBOL_GPL(mt7921_mac_init); 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; int ret;
...@@ -352,7 +352,7 @@ static int __mt7921_init_hardware(struct mt7921_dev *dev) ...@@ -352,7 +352,7 @@ static int __mt7921_init_hardware(struct mt7921_dev *dev)
return ret; return ret;
} }
static int mt7921_init_hardware(struct mt7921_dev *dev) static int mt7921_init_hardware(struct mt792x_dev *dev)
{ {
int ret, i; int ret, i;
...@@ -374,7 +374,7 @@ static int mt7921_init_hardware(struct mt7921_dev *dev) ...@@ -374,7 +374,7 @@ static int mt7921_init_hardware(struct mt7921_dev *dev)
return 0; return 0;
} }
static int mt7921_init_wcid(struct mt7921_dev *dev) static int mt7921_init_wcid(struct mt792x_dev *dev)
{ {
int idx; int idx;
...@@ -393,7 +393,7 @@ static int mt7921_init_wcid(struct mt7921_dev *dev) ...@@ -393,7 +393,7 @@ static int mt7921_init_wcid(struct mt7921_dev *dev)
static void mt7921_init_work(struct work_struct *work) 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); init_work);
int ret; int ret;
...@@ -429,7 +429,7 @@ static void mt7921_init_work(struct work_struct *work) ...@@ -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); 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); struct ieee80211_hw *hw = mt76_hw(dev);
int ret; int ret;
......
...@@ -20,7 +20,7 @@ static u32 mt7921_mac_wtbl_lmac_addr(int idx, u8 offset) ...@@ -20,7 +20,7 @@ static u32 mt7921_mac_wtbl_lmac_addr(int idx, u8 offset)
return MT_WTBL_LMAC_OFFS(idx, 0) + offset * 4; 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) u16 idx, bool unicast)
{ {
struct mt792x_sta *sta; struct mt792x_sta *sta;
...@@ -43,7 +43,7 @@ static struct mt76_wcid *mt7921_rx_get_wcid(struct mt7921_dev *dev, ...@@ -43,7 +43,7 @@ static struct mt76_wcid *mt7921_rx_get_wcid(struct mt7921_dev *dev,
return &sta->vif->sta.wcid; 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, mt76_rmw(dev, MT_WTBL_UPDATE, MT_WTBL_UPDATE_WLAN_IDX,
FIELD_PREP(MT_WTBL_UPDATE_WLAN_IDX, idx) | mask); 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) ...@@ -52,7 +52,7 @@ bool mt7921_mac_wtbl_update(struct mt7921_dev *dev, int idx, u32 mask)
0, 5000); 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[] = { static const u8 ac_to_tid[] = {
[IEEE80211_AC_BE] = 0, [IEEE80211_AC_BE] = 0,
...@@ -185,7 +185,7 @@ static void mt7921_mac_sta_poll(struct mt7921_dev *dev) ...@@ -185,7 +185,7 @@ static void mt7921_mac_sta_poll(struct mt7921_dev *dev)
} }
static void 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) struct mt76_rx_status *status, u8 chfreq)
{ {
if (chfreq > 180) { if (chfreq > 180) {
...@@ -217,7 +217,7 @@ mt7921_mac_rssi_iter(void *priv, u8 *mac, struct ieee80211_vif *vif) ...@@ -217,7 +217,7 @@ mt7921_mac_rssi_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
} }
static void 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); 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) ...@@ -231,7 +231,7 @@ mt7921_mac_assoc_rssi(struct mt7921_dev *dev, struct sk_buff *skb)
} }
static int 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; 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; 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) ...@@ -511,7 +511,7 @@ mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb)
return 0; 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 mt792x_sta *msta = NULL;
struct mt76_wcid *wcid; struct mt76_wcid *wcid;
...@@ -552,7 +552,7 @@ void mt7921_mac_add_txs(struct mt7921_dev *dev, void *data) ...@@ -552,7 +552,7 @@ void mt7921_mac_add_txs(struct mt7921_dev *dev, void *data)
rcu_read_unlock(); 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; struct mt76_connac_tx_free *free = data;
__le32 *tx_info = (__le32 *)(data + sizeof(*free)); __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) ...@@ -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) 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 *rxd = (__le32 *)data;
__le32 *end = (__le32 *)&rxd[len / 4]; __le32 *end = (__le32 *)&rxd[len / 4];
enum rx_pkt_type type; enum rx_pkt_type type;
...@@ -659,7 +659,7 @@ EXPORT_SYMBOL_GPL(mt7921_rx_check); ...@@ -659,7 +659,7 @@ EXPORT_SYMBOL_GPL(mt7921_rx_check);
void mt7921_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q, void mt7921_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
struct sk_buff *skb, u32 *info) 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 *rxd = (__le32 *)skb->data;
__le32 *end = (__le32 *)&skb->data[skb->len]; __le32 *end = (__le32 *)&skb->data[skb->len];
enum rx_pkt_type type; enum rx_pkt_type type;
...@@ -701,7 +701,7 @@ EXPORT_SYMBOL_GPL(mt7921_queue_rx_skb); ...@@ -701,7 +701,7 @@ EXPORT_SYMBOL_GPL(mt7921_queue_rx_skb);
void mt7921_mac_reset_counters(struct mt792x_phy *phy) void mt7921_mac_reset_counters(struct mt792x_phy *phy)
{ {
struct mt7921_dev *dev = phy->dev; struct mt792x_dev *dev = phy->dev;
int i; int i;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
...@@ -724,7 +724,7 @@ void mt7921_mac_reset_counters(struct mt792x_phy *phy) ...@@ -724,7 +724,7 @@ void mt7921_mac_reset_counters(struct mt792x_phy *phy)
void mt7921_mac_set_timing(struct mt792x_phy *phy) void mt7921_mac_set_timing(struct mt792x_phy *phy)
{ {
s16 coverage_class = phy->coverage_class; s16 coverage_class = phy->coverage_class;
struct mt7921_dev *dev = phy->dev; struct mt792x_dev *dev = phy->dev;
u32 val, reg_offset; u32 val, reg_offset;
u32 cck = FIELD_PREP(MT_TIMEOUT_VAL_PLCP, 231) | u32 cck = FIELD_PREP(MT_TIMEOUT_VAL_PLCP, 231) |
FIELD_PREP(MT_TIMEOUT_VAL_CCA, 48); FIELD_PREP(MT_TIMEOUT_VAL_CCA, 48);
...@@ -771,7 +771,7 @@ mt7921_phy_get_nf(struct mt792x_phy *phy, int idx) ...@@ -771,7 +771,7 @@ mt7921_phy_get_nf(struct mt792x_phy *phy, int idx)
static void static void
mt7921_phy_update_channel(struct mt76_phy *mphy, int idx) 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 mt792x_phy *phy = (struct mt792x_phy *)mphy->priv;
struct mt76_channel_state *state; struct mt76_channel_state *state;
u64 busy_time, tx_time, rx_time, obss_time; u64 busy_time, tx_time, rx_time, obss_time;
...@@ -802,7 +802,7 @@ mt7921_phy_update_channel(struct mt76_phy *mphy, int idx) ...@@ -802,7 +802,7 @@ mt7921_phy_update_channel(struct mt76_phy *mphy, int idx)
void mt7921_update_channel(struct mt76_phy *mphy) 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)) if (mt76_connac_pm_wake(mphy, &dev->pm))
return; return;
...@@ -820,7 +820,7 @@ mt7921_vif_connect_iter(void *priv, u8 *mac, ...@@ -820,7 +820,7 @@ mt7921_vif_connect_iter(void *priv, u8 *mac,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; 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); struct ieee80211_hw *hw = mt76_hw(dev);
if (vif->type == NL80211_IFTYPE_STATION) if (vif->type == NL80211_IFTYPE_STATION)
...@@ -841,7 +841,7 @@ mt7921_vif_connect_iter(void *priv, u8 *mac, ...@@ -841,7 +841,7 @@ mt7921_vif_connect_iter(void *priv, u8 *mac,
/* system error recovery */ /* system error recovery */
void mt7921_mac_reset_work(struct work_struct *work) 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); reset_work);
struct ieee80211_hw *hw = mt76_hw(dev); struct ieee80211_hw *hw = mt76_hw(dev);
struct mt76_connac_pm *pm = &dev->pm; struct mt76_connac_pm *pm = &dev->pm;
...@@ -886,7 +886,7 @@ void mt7921_mac_reset_work(struct work_struct *work) ...@@ -886,7 +886,7 @@ void mt7921_mac_reset_work(struct work_struct *work)
void mt7921_reset(struct mt76_dev *mdev) 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; struct mt76_connac_pm *pm = &dev->pm;
if (!dev->hw_init_done) if (!dev->hw_init_done)
...@@ -905,7 +905,7 @@ EXPORT_SYMBOL_GPL(mt7921_reset); ...@@ -905,7 +905,7 @@ EXPORT_SYMBOL_GPL(mt7921_reset);
void mt7921_mac_update_mib_stats(struct mt792x_phy *phy) void mt7921_mac_update_mib_stats(struct mt792x_phy *phy)
{ {
struct mt76_mib_stats *mib = &phy->mib; struct mt76_mib_stats *mib = &phy->mib;
struct mt7921_dev *dev = phy->dev; struct mt792x_dev *dev = phy->dev;
int i, aggr0 = 0, aggr1; int i, aggr0 = 0, aggr1;
u32 val; u32 val;
...@@ -989,10 +989,10 @@ void mt7921_mac_work(struct work_struct *work) ...@@ -989,10 +989,10 @@ void mt7921_mac_work(struct work_struct *work)
void mt7921_pm_wake_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; 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); pm.wake_work);
mphy = dev->phy.mt76; mphy = dev->phy.mt76;
...@@ -1022,11 +1022,11 @@ void mt7921_pm_wake_work(struct work_struct *work) ...@@ -1022,11 +1022,11 @@ void mt7921_pm_wake_work(struct work_struct *work)
void mt7921_pm_power_save_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; unsigned long delta;
struct mt76_phy *mphy; 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); pm.ps_work.work);
mphy = dev->phy.mt76; mphy = dev->phy.mt76;
...@@ -1059,10 +1059,10 @@ void mt7921_pm_power_save_work(struct work_struct *work) ...@@ -1059,10 +1059,10 @@ void mt7921_pm_power_save_work(struct work_struct *work)
void mt7921_coredump_work(struct work_struct *work) void mt7921_coredump_work(struct work_struct *work)
{ {
struct mt7921_dev *dev; struct mt792x_dev *dev;
char *dump, *data; 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); coredump.work.work);
if (time_is_after_jiffies(dev->coredump.last_activity + if (time_is_after_jiffies(dev->coredump.last_activity +
...@@ -1106,7 +1106,7 @@ void mt7921_coredump_work(struct work_struct *work) ...@@ -1106,7 +1106,7 @@ void mt7921_coredump_work(struct work_struct *work)
/* usb_sdio */ /* usb_sdio */
static void 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, enum mt76_txq_id qid, struct ieee80211_sta *sta,
struct ieee80211_key_conf *key, int pid, struct ieee80211_key_conf *key, int pid,
struct sk_buff *skb) struct sk_buff *skb)
...@@ -1123,7 +1123,7 @@ int mt7921_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, ...@@ -1123,7 +1123,7 @@ int mt7921_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct mt76_tx_info *tx_info) 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_tx_info *info = IEEE80211_SKB_CB(tx_info->skb);
struct ieee80211_key_conf *key = info->control.hw_key; struct ieee80211_key_conf *key = info->control.hw_key;
struct sk_buff *skb = tx_info->skb; struct sk_buff *skb = tx_info->skb;
...@@ -1189,7 +1189,7 @@ EXPORT_SYMBOL_GPL(mt7921_usb_sdio_tx_complete_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) 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_mutex_acquire(dev);
mt7921_mac_sta_poll(dev); mt7921_mac_sta_poll(dev);
...@@ -1202,8 +1202,8 @@ EXPORT_SYMBOL_GPL(mt7921_usb_sdio_tx_status_data); ...@@ -1202,8 +1202,8 @@ EXPORT_SYMBOL_GPL(mt7921_usb_sdio_tx_status_data);
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
void mt7921_set_ipv6_ns_work(struct work_struct *work) 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); ipv6_ns_work);
struct sk_buff *skb; struct sk_buff *skb;
int ret = 0; int ret = 0;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#define LP_STATE_PR_ARG __entry->lp_state ? "lp ready" : "lp not ready" #define LP_STATE_PR_ARG __entry->lp_state ? "lp ready" : "lp not ready"
TRACE_EVENT(lp_event, TRACE_EVENT(lp_event,
TP_PROTO(struct mt7921_dev *dev, u8 lp_state), TP_PROTO(struct mt792x_dev *dev, u8 lp_state),
TP_ARGS(dev, lp_state), TP_ARGS(dev, lp_state),
......
...@@ -41,7 +41,7 @@ mt7921_rx_poll_complete(struct mt76_dev *mdev, enum mt76_rxq_id q) ...@@ -41,7 +41,7 @@ mt7921_rx_poll_complete(struct mt76_dev *mdev, enum mt76_rxq_id q)
static irqreturn_t mt7921_irq_handler(int irq, void *dev_instance) static irqreturn_t mt7921_irq_handler(int irq, void *dev_instance)
{ {
struct mt7921_dev *dev = dev_instance; struct mt792x_dev *dev = dev_instance;
mt76_wr(dev, MT_WFDMA0_HOST_INT_ENA, 0); mt76_wr(dev, MT_WFDMA0_HOST_INT_ENA, 0);
...@@ -55,7 +55,7 @@ static irqreturn_t mt7921_irq_handler(int irq, void *dev_instance) ...@@ -55,7 +55,7 @@ static irqreturn_t mt7921_irq_handler(int irq, void *dev_instance)
static void mt7921_irq_tasklet(unsigned long data) static void mt7921_irq_tasklet(unsigned long data)
{ {
struct mt7921_dev *dev = (struct mt7921_dev *)data; struct mt792x_dev *dev = (struct mt792x_dev *)data;
u32 intr, mask = 0; u32 intr, mask = 0;
mt76_wr(dev, MT_WFDMA0_HOST_INT_ENA, 0); mt76_wr(dev, MT_WFDMA0_HOST_INT_ENA, 0);
...@@ -97,12 +97,12 @@ static void mt7921_irq_tasklet(unsigned long data) ...@@ -97,12 +97,12 @@ static void mt7921_irq_tasklet(unsigned long data)
napi_schedule(&dev->mt76.napi[MT_RXQ_MAIN]); napi_schedule(&dev->mt76.napi[MT_RXQ_MAIN]);
} }
static int mt7921e_init_reset(struct mt7921_dev *dev) static int mt7921e_init_reset(struct mt792x_dev *dev)
{ {
return mt7921_wpdma_reset(dev, true); return mt7921_wpdma_reset(dev, true);
} }
static void mt7921e_unregister_device(struct mt7921_dev *dev) static void mt7921e_unregister_device(struct mt792x_dev *dev)
{ {
int i; int i;
struct mt76_connac_pm *pm = &dev->pm; struct mt76_connac_pm *pm = &dev->pm;
...@@ -124,7 +124,7 @@ static void mt7921e_unregister_device(struct mt7921_dev *dev) ...@@ -124,7 +124,7 @@ static void mt7921e_unregister_device(struct mt7921_dev *dev)
tasklet_disable(&dev->mt76.irq_tasklet); tasklet_disable(&dev->mt76.irq_tasklet);
} }
static u32 __mt7921_reg_addr(struct mt7921_dev *dev, u32 addr) static u32 __mt7921_reg_addr(struct mt792x_dev *dev, u32 addr)
{ {
static const struct mt76_connac_reg_map fixed_map[] = { static const struct mt76_connac_reg_map fixed_map[] = {
{ 0x820d0000, 0x30000, 0x10000 }, /* WF_LMAC_TOP (WF_WTBLON) */ { 0x820d0000, 0x30000, 0x10000 }, /* WF_LMAC_TOP (WF_WTBLON) */
...@@ -203,7 +203,7 @@ static u32 __mt7921_reg_addr(struct mt7921_dev *dev, u32 addr) ...@@ -203,7 +203,7 @@ static u32 __mt7921_reg_addr(struct mt7921_dev *dev, u32 addr)
static u32 mt7921_rr(struct mt76_dev *mdev, u32 offset) static u32 mt7921_rr(struct mt76_dev *mdev, u32 offset)
{ {
struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76); struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
u32 addr = __mt7921_reg_addr(dev, offset); u32 addr = __mt7921_reg_addr(dev, offset);
return dev->bus_ops->rr(mdev, addr); return dev->bus_ops->rr(mdev, addr);
...@@ -211,7 +211,7 @@ static u32 mt7921_rr(struct mt76_dev *mdev, u32 offset) ...@@ -211,7 +211,7 @@ static u32 mt7921_rr(struct mt76_dev *mdev, u32 offset)
static void mt7921_wr(struct mt76_dev *mdev, u32 offset, u32 val) static void mt7921_wr(struct mt76_dev *mdev, u32 offset, u32 val)
{ {
struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76); struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
u32 addr = __mt7921_reg_addr(dev, offset); u32 addr = __mt7921_reg_addr(dev, offset);
dev->bus_ops->wr(mdev, addr, val); dev->bus_ops->wr(mdev, addr, val);
...@@ -219,7 +219,7 @@ static void mt7921_wr(struct mt76_dev *mdev, u32 offset, u32 val) ...@@ -219,7 +219,7 @@ static void mt7921_wr(struct mt76_dev *mdev, u32 offset, u32 val)
static u32 mt7921_rmw(struct mt76_dev *mdev, u32 offset, u32 mask, u32 val) static u32 mt7921_rmw(struct mt76_dev *mdev, u32 offset, u32 mask, u32 val)
{ {
struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76); struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
u32 addr = __mt7921_reg_addr(dev, offset); u32 addr = __mt7921_reg_addr(dev, offset);
return dev->bus_ops->rmw(mdev, addr, mask, val); return dev->bus_ops->rmw(mdev, addr, mask, val);
...@@ -256,7 +256,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev, ...@@ -256,7 +256,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
}; };
struct ieee80211_ops *ops; struct ieee80211_ops *ops;
struct mt76_bus_ops *bus_ops; struct mt76_bus_ops *bus_ops;
struct mt7921_dev *dev; struct mt792x_dev *dev;
struct mt76_dev *mdev; struct mt76_dev *mdev;
u8 features; u8 features;
int ret; int ret;
...@@ -303,7 +303,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev, ...@@ -303,7 +303,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, mdev); pci_set_drvdata(pdev, mdev);
dev = container_of(mdev, struct mt7921_dev, mt76); dev = container_of(mdev, struct mt792x_dev, mt76);
dev->fw_features = features; dev->fw_features = features;
dev->hif_ops = &mt7921_pcie_ops; dev->hif_ops = &mt7921_pcie_ops;
mt76_mmio_init(&dev->mt76, pcim_iomap_table(pdev)[0]); mt76_mmio_init(&dev->mt76, pcim_iomap_table(pdev)[0]);
...@@ -373,7 +373,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev, ...@@ -373,7 +373,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
static void mt7921_pci_remove(struct pci_dev *pdev) static void mt7921_pci_remove(struct pci_dev *pdev)
{ {
struct mt76_dev *mdev = pci_get_drvdata(pdev); struct mt76_dev *mdev = pci_get_drvdata(pdev);
struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76); struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
mt7921e_unregister_device(dev); mt7921e_unregister_device(dev);
devm_free_irq(&pdev->dev, pdev->irq, dev); devm_free_irq(&pdev->dev, pdev->irq, dev);
...@@ -385,7 +385,7 @@ static int mt7921_pci_suspend(struct device *device) ...@@ -385,7 +385,7 @@ static int mt7921_pci_suspend(struct device *device)
{ {
struct pci_dev *pdev = to_pci_dev(device); struct pci_dev *pdev = to_pci_dev(device);
struct mt76_dev *mdev = pci_get_drvdata(pdev); struct mt76_dev *mdev = pci_get_drvdata(pdev);
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; struct mt76_connac_pm *pm = &dev->pm;
int i, err; int i, err;
...@@ -459,7 +459,7 @@ static int mt7921_pci_resume(struct device *device) ...@@ -459,7 +459,7 @@ static int mt7921_pci_resume(struct device *device)
{ {
struct pci_dev *pdev = to_pci_dev(device); struct pci_dev *pdev = to_pci_dev(device);
struct mt76_dev *mdev = pci_get_drvdata(pdev); struct mt76_dev *mdev = pci_get_drvdata(pdev);
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; struct mt76_connac_pm *pm = &dev->pm;
int i, err; int i, err;
......
...@@ -10,7 +10,7 @@ int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, ...@@ -10,7 +10,7 @@ int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct mt76_tx_info *tx_info) 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_tx_info *info = IEEE80211_SKB_CB(tx_info->skb);
struct ieee80211_key_conf *key = info->control.hw_key; struct ieee80211_key_conf *key = info->control.hw_key;
struct mt76_connac_hw_txp *txp; struct mt76_connac_hw_txp *txp;
...@@ -53,7 +53,7 @@ int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, ...@@ -53,7 +53,7 @@ int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
return 0; return 0;
} }
int mt7921e_mac_reset(struct mt7921_dev *dev) int mt7921e_mac_reset(struct mt792x_dev *dev)
{ {
int i, err; int i, err;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "mt7921.h" #include "mt7921.h"
#include "mcu.h" #include "mcu.h"
int mt7921e_driver_own(struct mt7921_dev *dev) int mt7921e_driver_own(struct mt792x_dev *dev)
{ {
u32 reg = mt7921_reg_map_l1(dev, MT_TOP_LPCR_HOST_BAND0); u32 reg = mt7921_reg_map_l1(dev, MT_TOP_LPCR_HOST_BAND0);
...@@ -22,7 +22,7 @@ static int ...@@ -22,7 +22,7 @@ static int
mt7921_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, mt7921_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
int cmd, int *seq) int cmd, int *seq)
{ {
struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76); struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
enum mt76_mcuq_id txq = MT_MCUQ_WM; enum mt76_mcuq_id txq = MT_MCUQ_WM;
int ret; int ret;
...@@ -38,7 +38,7 @@ mt7921_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, ...@@ -38,7 +38,7 @@ mt7921_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
return mt76_tx_queue_skb_raw(dev, mdev->q_mcu[txq], skb, 0); return mt76_tx_queue_skb_raw(dev, mdev->q_mcu[txq], skb, 0);
} }
int mt7921e_mcu_init(struct mt7921_dev *dev) int mt7921e_mcu_init(struct mt792x_dev *dev)
{ {
static const struct mt76_mcu_ops mt7921_mcu_ops = { static const struct mt76_mcu_ops mt7921_mcu_ops = {
.headroom = sizeof(struct mt76_connac2_mcu_txd), .headroom = sizeof(struct mt76_connac2_mcu_txd),
...@@ -62,7 +62,7 @@ int mt7921e_mcu_init(struct mt7921_dev *dev) ...@@ -62,7 +62,7 @@ int mt7921e_mcu_init(struct mt7921_dev *dev)
return err; return err;
} }
int __mt7921e_mcu_drv_pmctrl(struct mt7921_dev *dev) int __mt7921e_mcu_drv_pmctrl(struct mt792x_dev *dev)
{ {
int i, err = 0; int i, err = 0;
...@@ -81,7 +81,7 @@ int __mt7921e_mcu_drv_pmctrl(struct mt7921_dev *dev) ...@@ -81,7 +81,7 @@ int __mt7921e_mcu_drv_pmctrl(struct mt7921_dev *dev)
return err; return err;
} }
int mt7921e_mcu_drv_pmctrl(struct mt7921_dev *dev) int mt7921e_mcu_drv_pmctrl(struct mt792x_dev *dev)
{ {
struct mt76_phy *mphy = &dev->mt76.phy; struct mt76_phy *mphy = &dev->mt76.phy;
struct mt76_connac_pm *pm = &dev->pm; struct mt76_connac_pm *pm = &dev->pm;
...@@ -101,7 +101,7 @@ int mt7921e_mcu_drv_pmctrl(struct mt7921_dev *dev) ...@@ -101,7 +101,7 @@ int mt7921e_mcu_drv_pmctrl(struct mt7921_dev *dev)
return err; return err;
} }
int mt7921e_mcu_fw_pmctrl(struct mt7921_dev *dev) int mt7921e_mcu_fw_pmctrl(struct mt792x_dev *dev)
{ {
struct mt76_phy *mphy = &dev->mt76.phy; struct mt76_phy *mphy = &dev->mt76.phy;
struct mt76_connac_pm *pm = &dev->pm; struct mt76_connac_pm *pm = &dev->pm;
......
...@@ -27,7 +27,7 @@ static void mt7921s_txrx_worker(struct mt76_worker *w) ...@@ -27,7 +27,7 @@ static void mt7921s_txrx_worker(struct mt76_worker *w)
struct mt76_sdio *sdio = container_of(w, struct mt76_sdio, struct mt76_sdio *sdio = container_of(w, struct mt76_sdio,
txrx_worker); txrx_worker);
struct mt76_dev *mdev = container_of(sdio, struct mt76_dev, sdio); struct mt76_dev *mdev = container_of(sdio, struct mt76_dev, sdio);
struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76); struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) { if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) {
queue_work(mdev->wq, &dev->pm.wake_work); queue_work(mdev->wq, &dev->pm.wake_work);
...@@ -38,7 +38,7 @@ static void mt7921s_txrx_worker(struct mt76_worker *w) ...@@ -38,7 +38,7 @@ static void mt7921s_txrx_worker(struct mt76_worker *w)
mt76_connac_pm_unref(&dev->mphy, &dev->pm); mt76_connac_pm_unref(&dev->mphy, &dev->pm);
} }
static void mt7921s_unregister_device(struct mt7921_dev *dev) static void mt7921s_unregister_device(struct mt792x_dev *dev)
{ {
struct mt76_connac_pm *pm = &dev->pm; struct mt76_connac_pm *pm = &dev->pm;
...@@ -122,7 +122,7 @@ static int mt7921s_probe(struct sdio_func *func, ...@@ -122,7 +122,7 @@ static int mt7921s_probe(struct sdio_func *func,
.fw_own = mt7921s_mcu_fw_pmctrl, .fw_own = mt7921s_mcu_fw_pmctrl,
}; };
struct ieee80211_ops *ops; struct ieee80211_ops *ops;
struct mt7921_dev *dev; struct mt792x_dev *dev;
struct mt76_dev *mdev; struct mt76_dev *mdev;
u8 features; u8 features;
int ret; int ret;
...@@ -136,7 +136,7 @@ static int mt7921s_probe(struct sdio_func *func, ...@@ -136,7 +136,7 @@ static int mt7921s_probe(struct sdio_func *func,
if (!mdev) if (!mdev)
return -ENOMEM; return -ENOMEM;
dev = container_of(mdev, struct mt7921_dev, mt76); dev = container_of(mdev, struct mt792x_dev, mt76);
dev->fw_features = features; dev->fw_features = features;
dev->hif_ops = &mt7921_sdio_ops; dev->hif_ops = &mt7921_sdio_ops;
sdio_set_drvdata(func, dev); sdio_set_drvdata(func, dev);
...@@ -196,7 +196,7 @@ static int mt7921s_probe(struct sdio_func *func, ...@@ -196,7 +196,7 @@ static int mt7921s_probe(struct sdio_func *func,
static void mt7921s_remove(struct sdio_func *func) static void mt7921s_remove(struct sdio_func *func)
{ {
struct mt7921_dev *dev = sdio_get_drvdata(func); struct mt792x_dev *dev = sdio_get_drvdata(func);
mt7921s_unregister_device(dev); mt7921s_unregister_device(dev);
} }
...@@ -204,7 +204,7 @@ static void mt7921s_remove(struct sdio_func *func) ...@@ -204,7 +204,7 @@ static void mt7921s_remove(struct sdio_func *func)
static int mt7921s_suspend(struct device *__dev) static int mt7921s_suspend(struct device *__dev)
{ {
struct sdio_func *func = dev_to_sdio_func(__dev); struct sdio_func *func = dev_to_sdio_func(__dev);
struct mt7921_dev *dev = sdio_get_drvdata(func); struct mt792x_dev *dev = sdio_get_drvdata(func);
struct mt76_connac_pm *pm = &dev->pm; struct mt76_connac_pm *pm = &dev->pm;
struct mt76_dev *mdev = &dev->mt76; struct mt76_dev *mdev = &dev->mt76;
int err; int err;
...@@ -277,7 +277,7 @@ static int mt7921s_suspend(struct device *__dev) ...@@ -277,7 +277,7 @@ static int mt7921s_suspend(struct device *__dev)
static int mt7921s_resume(struct device *__dev) static int mt7921s_resume(struct device *__dev)
{ {
struct sdio_func *func = dev_to_sdio_func(__dev); struct sdio_func *func = dev_to_sdio_func(__dev);
struct mt7921_dev *dev = sdio_get_drvdata(func); struct mt792x_dev *dev = sdio_get_drvdata(func);
struct mt76_connac_pm *pm = &dev->pm; struct mt76_connac_pm *pm = &dev->pm;
struct mt76_dev *mdev = &dev->mt76; struct mt76_dev *mdev = &dev->mt76;
int err; int err;
......
...@@ -30,7 +30,7 @@ static u32 mt7921s_read_whcr(struct mt76_dev *dev) ...@@ -30,7 +30,7 @@ static u32 mt7921s_read_whcr(struct mt76_dev *dev)
return sdio_readl(dev->sdio.func, MCR_WHCR, NULL); return sdio_readl(dev->sdio.func, MCR_WHCR, NULL);
} }
int mt7921s_wfsys_reset(struct mt7921_dev *dev) int mt7921s_wfsys_reset(struct mt792x_dev *dev)
{ {
struct mt76_sdio *sdio = &dev->mt76.sdio; struct mt76_sdio *sdio = &dev->mt76.sdio;
u32 val, status; u32 val, status;
...@@ -71,7 +71,7 @@ int mt7921s_wfsys_reset(struct mt7921_dev *dev) ...@@ -71,7 +71,7 @@ int mt7921s_wfsys_reset(struct mt7921_dev *dev)
return 0; return 0;
} }
int mt7921s_init_reset(struct mt7921_dev *dev) int mt7921s_init_reset(struct mt792x_dev *dev)
{ {
set_bit(MT76_MCU_RESET, &dev->mphy.state); set_bit(MT76_MCU_RESET, &dev->mphy.state);
...@@ -91,7 +91,7 @@ int mt7921s_init_reset(struct mt7921_dev *dev) ...@@ -91,7 +91,7 @@ int mt7921s_init_reset(struct mt7921_dev *dev)
return 0; return 0;
} }
int mt7921s_mac_reset(struct mt7921_dev *dev) int mt7921s_mac_reset(struct mt792x_dev *dev)
{ {
int err; int err;
......
...@@ -16,7 +16,7 @@ static int ...@@ -16,7 +16,7 @@ static int
mt7921s_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, mt7921s_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
int cmd, int *seq) int cmd, int *seq)
{ {
struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76); struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
enum mt7921_sdio_pkt_type type = MT7921_SDIO_CMD; enum mt7921_sdio_pkt_type type = MT7921_SDIO_CMD;
enum mt76_mcuq_id txq = MT_MCUQ_WM; enum mt76_mcuq_id txq = MT_MCUQ_WM;
int ret, pad; int ret, pad;
...@@ -51,14 +51,14 @@ mt7921s_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, ...@@ -51,14 +51,14 @@ mt7921s_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
return ret; return ret;
} }
static u32 mt7921s_read_rm3r(struct mt7921_dev *dev) static u32 mt7921s_read_rm3r(struct mt792x_dev *dev)
{ {
struct mt76_sdio *sdio = &dev->mt76.sdio; struct mt76_sdio *sdio = &dev->mt76.sdio;
return sdio_readl(sdio->func, MCR_D2HRM3R, NULL); return sdio_readl(sdio->func, MCR_D2HRM3R, NULL);
} }
static u32 mt7921s_clear_rm3r_drv_own(struct mt7921_dev *dev) static u32 mt7921s_clear_rm3r_drv_own(struct mt792x_dev *dev)
{ {
struct mt76_sdio *sdio = &dev->mt76.sdio; struct mt76_sdio *sdio = &dev->mt76.sdio;
u32 val; u32 val;
...@@ -71,7 +71,7 @@ static u32 mt7921s_clear_rm3r_drv_own(struct mt7921_dev *dev) ...@@ -71,7 +71,7 @@ static u32 mt7921s_clear_rm3r_drv_own(struct mt7921_dev *dev)
return val; return val;
} }
int mt7921s_mcu_init(struct mt7921_dev *dev) int mt7921s_mcu_init(struct mt792x_dev *dev)
{ {
static const struct mt76_mcu_ops mt7921s_mcu_ops = { static const struct mt76_mcu_ops mt7921s_mcu_ops = {
.headroom = MT_SDIO_HDR_SIZE + .headroom = MT_SDIO_HDR_SIZE +
...@@ -97,7 +97,7 @@ int mt7921s_mcu_init(struct mt7921_dev *dev) ...@@ -97,7 +97,7 @@ int mt7921s_mcu_init(struct mt7921_dev *dev)
return 0; return 0;
} }
int mt7921s_mcu_drv_pmctrl(struct mt7921_dev *dev) int mt7921s_mcu_drv_pmctrl(struct mt792x_dev *dev)
{ {
struct sdio_func *func = dev->mt76.sdio.func; struct sdio_func *func = dev->mt76.sdio.func;
struct mt76_phy *mphy = &dev->mt76.phy; struct mt76_phy *mphy = &dev->mt76.phy;
...@@ -133,7 +133,7 @@ int mt7921s_mcu_drv_pmctrl(struct mt7921_dev *dev) ...@@ -133,7 +133,7 @@ int mt7921s_mcu_drv_pmctrl(struct mt7921_dev *dev)
return 0; return 0;
} }
int mt7921s_mcu_fw_pmctrl(struct mt7921_dev *dev) int mt7921s_mcu_fw_pmctrl(struct mt792x_dev *dev)
{ {
struct sdio_func *func = dev->mt76.sdio.func; struct sdio_func *func = dev->mt76.sdio.func;
struct mt76_phy *mphy = &dev->mt76.phy; struct mt76_phy *mphy = &dev->mt76.phy;
......
...@@ -31,7 +31,7 @@ static const struct nla_policy mt7921_tm_policy[NUM_MT7921_TM_ATTRS] = { ...@@ -31,7 +31,7 @@ static const struct nla_policy mt7921_tm_policy[NUM_MT7921_TM_ATTRS] = {
}; };
static int static int
mt7921_tm_set(struct mt7921_dev *dev, struct mt7921_tm_cmd *req) mt7921_tm_set(struct mt792x_dev *dev, struct mt7921_tm_cmd *req)
{ {
struct mt7921_rftest_cmd cmd = { struct mt7921_rftest_cmd cmd = {
.action = req->action, .action = req->action,
...@@ -82,7 +82,7 @@ mt7921_tm_set(struct mt7921_dev *dev, struct mt7921_tm_cmd *req) ...@@ -82,7 +82,7 @@ mt7921_tm_set(struct mt7921_dev *dev, struct mt7921_tm_cmd *req)
} }
static int static int
mt7921_tm_query(struct mt7921_dev *dev, struct mt7921_tm_cmd *req, mt7921_tm_query(struct mt792x_dev *dev, struct mt7921_tm_cmd *req,
struct mt7921_tm_evt *evt_resp) struct mt7921_tm_evt *evt_resp)
{ {
struct mt7921_rftest_cmd cmd = { struct mt7921_rftest_cmd cmd = {
......
...@@ -82,7 +82,7 @@ static void mt7921u_copy(struct mt76_dev *dev, u32 offset, ...@@ -82,7 +82,7 @@ static void mt7921u_copy(struct mt76_dev *dev, u32 offset,
mutex_unlock(&usb->usb_ctrl_mtx); mutex_unlock(&usb->usb_ctrl_mtx);
} }
int mt7921u_mcu_power_on(struct mt7921_dev *dev) int mt7921u_mcu_power_on(struct mt792x_dev *dev)
{ {
int ret; int ret;
...@@ -105,7 +105,7 @@ static int ...@@ -105,7 +105,7 @@ static int
mt7921u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, mt7921u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
int cmd, int *seq) int cmd, int *seq)
{ {
struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76); struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
u32 pad, ep; u32 pad, ep;
int ret; int ret;
...@@ -131,7 +131,7 @@ mt7921u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, ...@@ -131,7 +131,7 @@ mt7921u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
return ret; return ret;
} }
static int mt7921u_mcu_init(struct mt7921_dev *dev) static int mt7921u_mcu_init(struct mt792x_dev *dev)
{ {
static const struct mt76_mcu_ops mcu_ops = { static const struct mt76_mcu_ops mcu_ops = {
.headroom = MT_SDIO_HDR_SIZE + .headroom = MT_SDIO_HDR_SIZE +
...@@ -157,13 +157,13 @@ static int mt7921u_mcu_init(struct mt7921_dev *dev) ...@@ -157,13 +157,13 @@ static int mt7921u_mcu_init(struct mt7921_dev *dev)
static void mt7921u_stop(struct ieee80211_hw *hw) static void mt7921u_stop(struct ieee80211_hw *hw)
{ {
struct mt7921_dev *dev = mt7921_hw_dev(hw); struct mt792x_dev *dev = mt7921_hw_dev(hw);
mt76u_stop_tx(&dev->mt76); mt76u_stop_tx(&dev->mt76);
mt7921_stop(hw); mt7921_stop(hw);
} }
static void mt7921u_cleanup(struct mt7921_dev *dev) static void mt7921u_cleanup(struct mt792x_dev *dev)
{ {
clear_bit(MT76_STATE_INITIALIZED, &dev->mphy.state); clear_bit(MT76_STATE_INITIALIZED, &dev->mphy.state);
mt7921u_wfsys_reset(dev); mt7921u_wfsys_reset(dev);
...@@ -207,7 +207,7 @@ static int mt7921u_probe(struct usb_interface *usb_intf, ...@@ -207,7 +207,7 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
struct usb_device *udev = interface_to_usbdev(usb_intf); struct usb_device *udev = interface_to_usbdev(usb_intf);
struct ieee80211_ops *ops; struct ieee80211_ops *ops;
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
struct mt7921_dev *dev; struct mt792x_dev *dev;
struct mt76_dev *mdev; struct mt76_dev *mdev;
u8 features; u8 features;
int ret; int ret;
...@@ -222,7 +222,7 @@ static int mt7921u_probe(struct usb_interface *usb_intf, ...@@ -222,7 +222,7 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
if (!mdev) if (!mdev)
return -ENOMEM; return -ENOMEM;
dev = container_of(mdev, struct mt7921_dev, mt76); dev = container_of(mdev, struct mt792x_dev, mt76);
dev->fw_features = features; dev->fw_features = features;
dev->hif_ops = &hif_ops; dev->hif_ops = &hif_ops;
...@@ -284,7 +284,7 @@ static int mt7921u_probe(struct usb_interface *usb_intf, ...@@ -284,7 +284,7 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
static void mt7921u_disconnect(struct usb_interface *usb_intf) static void mt7921u_disconnect(struct usb_interface *usb_intf)
{ {
struct mt7921_dev *dev = usb_get_intfdata(usb_intf); struct mt792x_dev *dev = usb_get_intfdata(usb_intf);
cancel_work_sync(&dev->init_work); cancel_work_sync(&dev->init_work);
if (!test_bit(MT76_STATE_INITIALIZED, &dev->mphy.state)) if (!test_bit(MT76_STATE_INITIALIZED, &dev->mphy.state))
...@@ -302,7 +302,7 @@ static void mt7921u_disconnect(struct usb_interface *usb_intf) ...@@ -302,7 +302,7 @@ static void mt7921u_disconnect(struct usb_interface *usb_intf)
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int mt7921u_suspend(struct usb_interface *intf, pm_message_t state) static int mt7921u_suspend(struct usb_interface *intf, pm_message_t state)
{ {
struct mt7921_dev *dev = usb_get_intfdata(intf); struct mt792x_dev *dev = usb_get_intfdata(intf);
struct mt76_connac_pm *pm = &dev->pm; struct mt76_connac_pm *pm = &dev->pm;
int err; int err;
...@@ -329,7 +329,7 @@ static int mt7921u_suspend(struct usb_interface *intf, pm_message_t state) ...@@ -329,7 +329,7 @@ static int mt7921u_suspend(struct usb_interface *intf, pm_message_t state)
static int mt7921u_resume(struct usb_interface *intf) static int mt7921u_resume(struct usb_interface *intf)
{ {
struct mt7921_dev *dev = usb_get_intfdata(intf); struct mt792x_dev *dev = usb_get_intfdata(intf);
struct mt76_connac_pm *pm = &dev->pm; struct mt76_connac_pm *pm = &dev->pm;
bool reinit = true; bool reinit = true;
int err, i; int err, i;
......
...@@ -32,7 +32,7 @@ static void mt7921u_uhw_wr(struct mt76_dev *dev, u32 addr, u32 val) ...@@ -32,7 +32,7 @@ static void mt7921u_uhw_wr(struct mt76_dev *dev, u32 addr, u32 val)
mutex_unlock(&dev->usb.usb_ctrl_mtx); mutex_unlock(&dev->usb.usb_ctrl_mtx);
} }
static void mt7921u_dma_prefetch(struct mt7921_dev *dev) static void mt7921u_dma_prefetch(struct mt792x_dev *dev)
{ {
mt76_rmw(dev, MT_UWFDMA0_TX_RING_EXT_CTRL(0), mt76_rmw(dev, MT_UWFDMA0_TX_RING_EXT_CTRL(0),
MT_WPDMA0_MAX_CNT_MASK, 4); MT_WPDMA0_MAX_CNT_MASK, 4);
...@@ -70,7 +70,7 @@ static void mt7921u_dma_prefetch(struct mt7921_dev *dev) ...@@ -70,7 +70,7 @@ static void mt7921u_dma_prefetch(struct mt7921_dev *dev)
MT_WPDMA0_BASE_PTR_MASK, 0x2c0); MT_WPDMA0_BASE_PTR_MASK, 0x2c0);
} }
static void mt7921u_wfdma_init(struct mt7921_dev *dev) static void mt7921u_wfdma_init(struct mt792x_dev *dev)
{ {
mt7921u_dma_prefetch(dev); mt7921u_dma_prefetch(dev);
...@@ -90,7 +90,7 @@ static void mt7921u_wfdma_init(struct mt7921_dev *dev) ...@@ -90,7 +90,7 @@ static void mt7921u_wfdma_init(struct mt7921_dev *dev)
mt76_set(dev, MT_WFDMA_DUMMY_CR, MT_WFDMA_NEED_REINIT); mt76_set(dev, MT_WFDMA_DUMMY_CR, MT_WFDMA_NEED_REINIT);
} }
static int mt7921u_dma_rx_evt_ep4(struct mt7921_dev *dev) static int mt7921u_dma_rx_evt_ep4(struct mt792x_dev *dev)
{ {
if (!mt76_poll(dev, MT_UWFDMA0_GLO_CFG, if (!mt76_poll(dev, MT_UWFDMA0_GLO_CFG,
MT_WFDMA0_GLO_CFG_RX_DMA_BUSY, 0, 1000)) MT_WFDMA0_GLO_CFG_RX_DMA_BUSY, 0, 1000))
...@@ -104,7 +104,7 @@ static int mt7921u_dma_rx_evt_ep4(struct mt7921_dev *dev) ...@@ -104,7 +104,7 @@ static int mt7921u_dma_rx_evt_ep4(struct mt7921_dev *dev)
return 0; return 0;
} }
static void mt7921u_epctl_rst_opt(struct mt7921_dev *dev, bool reset) static void mt7921u_epctl_rst_opt(struct mt792x_dev *dev, bool reset)
{ {
u32 val; u32 val;
...@@ -121,7 +121,7 @@ static void mt7921u_epctl_rst_opt(struct mt7921_dev *dev, bool reset) ...@@ -121,7 +121,7 @@ static void mt7921u_epctl_rst_opt(struct mt7921_dev *dev, bool reset)
mt7921u_uhw_wr(&dev->mt76, MT_SSUSB_EPCTL_CSR_EP_RST_OPT, val); mt7921u_uhw_wr(&dev->mt76, MT_SSUSB_EPCTL_CSR_EP_RST_OPT, val);
} }
int mt7921u_dma_init(struct mt7921_dev *dev, bool resume) int mt7921u_dma_init(struct mt792x_dev *dev, bool resume)
{ {
int err; int err;
...@@ -148,7 +148,7 @@ int mt7921u_dma_init(struct mt7921_dev *dev, bool resume) ...@@ -148,7 +148,7 @@ int mt7921u_dma_init(struct mt7921_dev *dev, bool resume)
return 0; return 0;
} }
int mt7921u_wfsys_reset(struct mt7921_dev *dev) int mt7921u_wfsys_reset(struct mt792x_dev *dev)
{ {
u32 val; u32 val;
int i; int i;
...@@ -180,7 +180,7 @@ int mt7921u_wfsys_reset(struct mt7921_dev *dev) ...@@ -180,7 +180,7 @@ int mt7921u_wfsys_reset(struct mt7921_dev *dev)
return 0; return 0;
} }
int mt7921u_init_reset(struct mt7921_dev *dev) int mt7921u_init_reset(struct mt792x_dev *dev)
{ {
set_bit(MT76_RESET, &dev->mphy.state); set_bit(MT76_RESET, &dev->mphy.state);
...@@ -197,7 +197,7 @@ int mt7921u_init_reset(struct mt7921_dev *dev) ...@@ -197,7 +197,7 @@ int mt7921u_init_reset(struct mt7921_dev *dev)
return mt76u_resume_rx(&dev->mt76); return mt76u_resume_rx(&dev->mt76);
} }
int mt7921u_mac_reset(struct mt7921_dev *dev) int mt7921u_mac_reset(struct mt792x_dev *dev)
{ {
int err; int err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment