Commit 5090efa4 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Kalle Valo

mt76: move mt76_reg_pair definition in mt76.h

Move common definition of mt76_reg_pair in mt76.h
and remove duplicated code in mt76x2_init_common.c
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 16c8a792
...@@ -53,6 +53,11 @@ enum mt76_txq_id { ...@@ -53,6 +53,11 @@ enum mt76_txq_id {
__MT_TXQ_MAX __MT_TXQ_MAX
}; };
struct mt76_reg_pair {
u32 reg;
u32 value;
};
enum mt76_rxq_id { enum mt76_rxq_id {
MT_RXQ_MAIN, MT_RXQ_MAIN,
MT_RXQ_MCU, MT_RXQ_MCU,
......
...@@ -219,11 +219,6 @@ struct mt76x0_wcid { ...@@ -219,11 +219,6 @@ struct mt76x0_wcid {
u8 tx_rate_nss; u8 tx_rate_nss;
}; };
struct mt76_reg_pair {
u32 reg;
u32 value;
};
struct mt76x0_rxwi; struct mt76x0_rxwi;
extern const struct ieee80211_ops mt76x0_ops; extern const struct ieee80211_ops mt76x0_ops;
......
...@@ -47,11 +47,6 @@ struct ieee80211_rate mt76x2_rates[] = { ...@@ -47,11 +47,6 @@ struct ieee80211_rate mt76x2_rates[] = {
}; };
EXPORT_SYMBOL_GPL(mt76x2_rates); EXPORT_SYMBOL_GPL(mt76x2_rates);
struct mt76x2_reg_pair {
u32 reg;
u32 value;
};
static void static void
mt76x2_set_wlan_state(struct mt76x2_dev *dev, bool enable) mt76x2_set_wlan_state(struct mt76x2_dev *dev, bool enable)
{ {
...@@ -93,7 +88,7 @@ EXPORT_SYMBOL_GPL(mt76x2_reset_wlan); ...@@ -93,7 +88,7 @@ EXPORT_SYMBOL_GPL(mt76x2_reset_wlan);
static void static void
mt76x2_write_reg_pairs(struct mt76x2_dev *dev, mt76x2_write_reg_pairs(struct mt76x2_dev *dev,
const struct mt76x2_reg_pair *data, int len) const struct mt76_reg_pair *data, int len)
{ {
while (len > 0) { while (len > 0) {
mt76_wr(dev, data->reg, data->value); mt76_wr(dev, data->reg, data->value);
...@@ -128,7 +123,7 @@ void mt76_write_mac_initvals(struct mt76x2_dev *dev) ...@@ -128,7 +123,7 @@ void mt76_write_mac_initvals(struct mt76x2_dev *dev)
FIELD_PREP(MT_PROT_CFG_NAV, 1) | \ FIELD_PREP(MT_PROT_CFG_NAV, 1) | \
FIELD_PREP(MT_PROT_CFG_TXOP_ALLOW, 0x3f)) FIELD_PREP(MT_PROT_CFG_TXOP_ALLOW, 0x3f))
static const struct mt76x2_reg_pair vals[] = { static const struct mt76_reg_pair vals[] = {
/* Copied from MediaTek reference source */ /* Copied from MediaTek reference source */
{ MT_PBF_SYS_CTRL, 0x00080c00 }, { MT_PBF_SYS_CTRL, 0x00080c00 },
{ MT_PBF_CFG, 0x1efebcff }, { MT_PBF_CFG, 0x1efebcff },
...@@ -184,7 +179,7 @@ void mt76_write_mac_initvals(struct mt76x2_dev *dev) ...@@ -184,7 +179,7 @@ void mt76_write_mac_initvals(struct mt76x2_dev *dev)
{ MT_PROT_AUTO_TX_CFG, 0x00830083 }, { MT_PROT_AUTO_TX_CFG, 0x00830083 },
{ MT_HT_CTRL_CFG, 0x000001ff }, { MT_HT_CTRL_CFG, 0x000001ff },
}; };
struct mt76x2_reg_pair prot_vals[] = { struct mt76_reg_pair prot_vals[] = {
{ MT_CCK_PROT_CFG, DEFAULT_PROT_CFG_CCK }, { MT_CCK_PROT_CFG, DEFAULT_PROT_CFG_CCK },
{ MT_OFDM_PROT_CFG, DEFAULT_PROT_CFG_OFDM }, { MT_OFDM_PROT_CFG, DEFAULT_PROT_CFG_OFDM },
{ MT_MM20_PROT_CFG, DEFAULT_PROT_CFG_20 }, { MT_MM20_PROT_CFG, DEFAULT_PROT_CFG_20 },
......
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