0001
0002
0003
0004
0005
0006 #ifndef __MT76x02_PHY_H
0007 #define __MT76x02_PHY_H
0008
0009 #include "mt76x02_regs.h"
0010
0011 static inline int
0012 mt76x02_get_rssi_gain_thresh(struct mt76x02_dev *dev)
0013 {
0014 switch (dev->mphy.chandef.width) {
0015 case NL80211_CHAN_WIDTH_80:
0016 return -62;
0017 case NL80211_CHAN_WIDTH_40:
0018 return -65;
0019 default:
0020 return -68;
0021 }
0022 }
0023
0024 static inline int
0025 mt76x02_get_low_rssi_gain_thresh(struct mt76x02_dev *dev)
0026 {
0027 switch (dev->mphy.chandef.width) {
0028 case NL80211_CHAN_WIDTH_80:
0029 return -76;
0030 case NL80211_CHAN_WIDTH_40:
0031 return -79;
0032 default:
0033 return -82;
0034 }
0035 }
0036
0037 void mt76x02_add_rate_power_offset(struct mt76_rate_power *r, int offset);
0038 void mt76x02_phy_set_txpower(struct mt76x02_dev *dev, int txp_0, int txp_2);
0039 void mt76x02_limit_rate_power(struct mt76_rate_power *r, int limit);
0040 int mt76x02_get_max_rate_power(struct mt76_rate_power *r);
0041 void mt76x02_phy_set_rxpath(struct mt76x02_dev *dev);
0042 void mt76x02_phy_set_txdac(struct mt76x02_dev *dev);
0043 void mt76x02_phy_set_bw(struct mt76x02_dev *dev, int width, u8 ctrl);
0044 void mt76x02_phy_set_band(struct mt76x02_dev *dev, int band,
0045 bool primary_upper);
0046 bool mt76x02_phy_adjust_vga_gain(struct mt76x02_dev *dev);
0047 void mt76x02_init_agc_gain(struct mt76x02_dev *dev);
0048
0049 #endif