Commit c605d0ce authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

wifi: mt76: mt7921: move mt792x_mutex_{acquire/release} in mt792x.h

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 1c42e0f2
......@@ -8,9 +8,9 @@ mt7921_reg_set(void *data, u64 val)
{
struct mt792x_dev *dev = data;
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
mt76_wr(dev, dev->mt76.debugfs_reg, val);
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
return 0;
}
......@@ -20,9 +20,9 @@ mt7921_reg_get(void *data, u64 *val)
{
struct mt792x_dev *dev = data;
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
*val = mt76_rr(dev, dev->mt76.debugfs_reg);
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
return 0;
}
......@@ -34,12 +34,12 @@ mt7921_fw_debug_set(void *data, u64 val)
{
struct mt792x_dev *dev = data;
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
dev->fw_debug = (u8)val;
mt7921_mcu_fw_log_2_host(dev, dev->fw_debug);
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
return 0;
}
......@@ -98,7 +98,7 @@ mt7921_tx_stats_show(struct seq_file *file, void *data)
struct mt76_mib_stats *mib = &phy->mib;
int i;
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
mt7921_ampdu_stat_read_phy(phy, file);
......@@ -113,7 +113,7 @@ mt7921_tx_stats_show(struct seq_file *file, void *data)
seq_puts(file, "\n");
}
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
return 0;
}
......@@ -126,7 +126,7 @@ mt7921_queues_acq(struct seq_file *s, void *data)
struct mt792x_dev *dev = dev_get_drvdata(s->private);
int i;
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
for (i = 0; i < 4; i++) {
u32 ctrl, val, qlen = 0;
......@@ -146,7 +146,7 @@ mt7921_queues_acq(struct seq_file *s, void *data)
seq_printf(s, "AC%d: queued=%d\n", i, qlen);
}
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
return 0;
}
......@@ -215,9 +215,9 @@ mt7921_txpwr(struct seq_file *s, void *data)
struct mt7921_txpwr txpwr;
int ret;
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
ret = mt7921_get_txpwr_info(dev, &txpwr);
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
if (ret)
return ret;
......@@ -316,7 +316,7 @@ mt7921_deep_sleep_set(void *data, u64 val)
if (mt76_is_usb(&dev->mt76))
return -EOPNOTSUPP;
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
if (pm->ds_enable_user == enable)
goto out;
......@@ -324,7 +324,7 @@ mt7921_deep_sleep_set(void *data, u64 val)
pm->ds_enable = enable && !monitor;
mt76_connac_mcu_set_deep_sleep(&dev->mt76, pm->ds_enable);
out:
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
return 0;
}
......@@ -400,9 +400,9 @@ static int mt7921_chip_reset(void *data, u64 val)
break;
default:
/* Collect the core dump before reset wifisys. */
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
ret = mt76_connac_mcu_chip_config(&dev->mt76);
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
break;
}
......
......@@ -64,9 +64,9 @@ static ssize_t mt7921_thermal_temp_show(struct device *dev,
struct mt792x_dev *mdev = phy->dev;
int temperature;
mt7921_mutex_acquire(mdev);
mt792x_mutex_acquire(mdev);
temperature = mt7921_mcu_get_temperature(phy);
mt7921_mutex_release(mdev);
mt792x_mutex_release(mdev);
if (temperature < 0)
return temperature;
......@@ -116,11 +116,11 @@ mt7921_regd_notifier(struct wiphy *wiphy,
dev->mt76.region = request->dfs_region;
dev->country_ie_env = request->country_ie_env;
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
mt7921_mcu_set_clc(dev, request->alpha2, request->country_ie_env);
mt76_connac_mcu_set_channel_domain(hw->priv);
mt7921_set_tx_sar_pwr(hw, NULL);
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
}
static int
......
......@@ -971,7 +971,7 @@ void mt7921_mac_work(struct work_struct *work)
mac_work.work);
phy = mphy->priv;
mt7921_mutex_acquire(phy->dev);
mt792x_mutex_acquire(phy->dev);
mt76_update_survey(mphy);
if (++mphy->mac_work_count == 2) {
......@@ -980,7 +980,7 @@ void mt7921_mac_work(struct work_struct *work)
mt7921_mac_update_mib_stats(phy);
}
mt7921_mutex_release(phy->dev);
mt792x_mutex_release(phy->dev);
mt76_tx_status_check(mphy->dev, false);
ieee80211_queue_delayed_work(phy->mt76->hw, &mphy->mac_work,
......@@ -1191,9 +1191,9 @@ bool mt7921_usb_sdio_tx_status_data(struct mt76_dev *mdev, u8 *update)
{
struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
mt7921_mac_sta_poll(dev);
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
return false;
}
......@@ -1213,10 +1213,10 @@ void mt7921_set_ipv6_ns_work(struct work_struct *work)
if (!skb)
break;
mt7921_mutex_acquire(dev);
mt792x_mutex_acquire(dev);
ret = mt76_mcu_skb_send_msg(&dev->mt76, skb,
MCU_UNI_CMD(OFFLOAD), true);
mt7921_mutex_release(dev);
mt792x_mutex_release(dev);
} while (!ret);
......
......@@ -224,11 +224,6 @@ mt7921_hw_dev(struct ieee80211_hw *hw)
return container_of(phy->dev, struct mt792x_dev, mt76);
}
#define mt7921_mutex_acquire(dev) \
mt76_connac_mutex_acquire(&(dev)->mt76, &(dev)->pm)
#define mt7921_mutex_release(dev) \
mt76_connac_mutex_release(&(dev)->mt76, &(dev)->pm)
extern const struct ieee80211_ops mt7921_ops;
u32 mt7921_reg_map(struct mt792x_dev *dev, u32 addr);
......
......@@ -126,4 +126,9 @@ struct mt792x_dev {
u32 backup_l2;
};
#define mt792x_mutex_acquire(dev) \
mt76_connac_mutex_acquire(&(dev)->mt76, &(dev)->pm)
#define mt792x_mutex_release(dev) \
mt76_connac_mutex_release(&(dev)->mt76, &(dev)->pm)
#endif /* __MT7925_H */
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