Skip to content

Commit 5090efa

Browse files
LorenzoBianconiKalle Valo
authored andcommitted
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: Lorenzo Bianconi <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 16c8a79 commit 5090efa

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

drivers/net/wireless/mediatek/mt76/mt76.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ enum mt76_txq_id {
5353
__MT_TXQ_MAX
5454
};
5555

56+
struct mt76_reg_pair {
57+
u32 reg;
58+
u32 value;
59+
};
60+
5661
enum mt76_rxq_id {
5762
MT_RXQ_MAIN,
5863
MT_RXQ_MCU,

drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,6 @@ struct mt76x0_wcid {
219219
u8 tx_rate_nss;
220220
};
221221

222-
struct mt76_reg_pair {
223-
u32 reg;
224-
u32 value;
225-
};
226-
227222
struct mt76x0_rxwi;
228223

229224
extern const struct ieee80211_ops mt76x0_ops;

drivers/net/wireless/mediatek/mt76/mt76x2_init_common.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ struct ieee80211_rate mt76x2_rates[] = {
4747
};
4848
EXPORT_SYMBOL_GPL(mt76x2_rates);
4949

50-
struct mt76x2_reg_pair {
51-
u32 reg;
52-
u32 value;
53-
};
54-
5550
static void
5651
mt76x2_set_wlan_state(struct mt76x2_dev *dev, bool enable)
5752
{
@@ -93,7 +88,7 @@ EXPORT_SYMBOL_GPL(mt76x2_reset_wlan);
9388

9489
static void
9590
mt76x2_write_reg_pairs(struct mt76x2_dev *dev,
96-
const struct mt76x2_reg_pair *data, int len)
91+
const struct mt76_reg_pair *data, int len)
9792
{
9893
while (len > 0) {
9994
mt76_wr(dev, data->reg, data->value);
@@ -128,7 +123,7 @@ void mt76_write_mac_initvals(struct mt76x2_dev *dev)
128123
FIELD_PREP(MT_PROT_CFG_NAV, 1) | \
129124
FIELD_PREP(MT_PROT_CFG_TXOP_ALLOW, 0x3f))
130125

131-
static const struct mt76x2_reg_pair vals[] = {
126+
static const struct mt76_reg_pair vals[] = {
132127
/* Copied from MediaTek reference source */
133128
{ MT_PBF_SYS_CTRL, 0x00080c00 },
134129
{ MT_PBF_CFG, 0x1efebcff },
@@ -184,7 +179,7 @@ void mt76_write_mac_initvals(struct mt76x2_dev *dev)
184179
{ MT_PROT_AUTO_TX_CFG, 0x00830083 },
185180
{ MT_HT_CTRL_CFG, 0x000001ff },
186181
};
187-
struct mt76x2_reg_pair prot_vals[] = {
182+
struct mt76_reg_pair prot_vals[] = {
188183
{ MT_CCK_PROT_CFG, DEFAULT_PROT_CFG_CCK },
189184
{ MT_OFDM_PROT_CFG, DEFAULT_PROT_CFG_OFDM },
190185
{ MT_MM20_PROT_CFG, DEFAULT_PROT_CFG_20 },

0 commit comments

Comments
 (0)