1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
4 * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
5 * Copyright (C) 2018 Stanislaw Gruszka <stf_xl@wp.pl>
8 #ifndef __MT76X0U_EEPROM_H
9 #define __MT76X0U_EEPROM_H
11 #include "../mt76x02_eeprom.h"
15 #define MT76X0U_EE_MAX_VER 0x0c
16 #define MT76X0_EEPROM_SIZE 512
18 int mt76x0_eeprom_init(struct mt76x02_dev
*dev
);
19 void mt76x0_read_rx_gain(struct mt76x02_dev
*dev
);
20 void mt76x0_get_tx_power_per_rate(struct mt76x02_dev
*dev
,
21 struct ieee80211_channel
*chan
,
22 struct mt76_rate_power
*t
);
23 void mt76x0_get_power_info(struct mt76x02_dev
*dev
,
24 struct ieee80211_channel
*chan
, s8
*tp
);
26 static inline s8
s6_to_s8(u32 val
)
28 s8 ret
= val
& GENMASK(5, 0);
35 static inline bool mt76x0_tssi_enabled(struct mt76x02_dev
*dev
)
37 return (mt76x02_eeprom_get(dev
, MT_EE_NIC_CONF_1
) &
38 MT_EE_NIC_CONF_1_TX_ALC_EN
);