0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __MT76X0U_EEPROM_H
0009 #define __MT76X0U_EEPROM_H
0010
0011 #include "../mt76x02_eeprom.h"
0012
0013 struct mt76x02_dev;
0014
0015 #define MT76X0U_EE_MAX_VER 0x0c
0016 #define MT76X0_EEPROM_SIZE 512
0017
0018 int mt76x0_eeprom_init(struct mt76x02_dev *dev);
0019 void mt76x0_read_rx_gain(struct mt76x02_dev *dev);
0020 void mt76x0_get_tx_power_per_rate(struct mt76x02_dev *dev,
0021 struct ieee80211_channel *chan,
0022 struct mt76_rate_power *t);
0023 void mt76x0_get_power_info(struct mt76x02_dev *dev,
0024 struct ieee80211_channel *chan, s8 *tp);
0025
0026 static inline s8 s6_to_s8(u32 val)
0027 {
0028 s8 ret = val & GENMASK(5, 0);
0029
0030 if (ret & BIT(5))
0031 ret -= BIT(6);
0032 return ret;
0033 }
0034
0035 static inline bool mt76x0_tssi_enabled(struct mt76x02_dev *dev)
0036 {
0037 return (mt76x02_eeprom_get(dev, MT_EE_NIC_CONF_1) &
0038 MT_EE_NIC_CONF_1_TX_ALC_EN);
0039 }
0040
0041 #endif