mt76x02_phy.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: ISC */
  2. /*
  3. * Copyright (C) 2018 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
  4. */
  5. #ifndef __MT76x02_PHY_H
  6. #define __MT76x02_PHY_H
  7. #include "mt76x02_regs.h"
  8. static inline int
  9. mt76x02_get_rssi_gain_thresh(struct mt76x02_dev *dev)
  10. {
  11. switch (dev->mphy.chandef.width) {
  12. case NL80211_CHAN_WIDTH_80:
  13. return -62;
  14. case NL80211_CHAN_WIDTH_40:
  15. return -65;
  16. default:
  17. return -68;
  18. }
  19. }
  20. static inline int
  21. mt76x02_get_low_rssi_gain_thresh(struct mt76x02_dev *dev)
  22. {
  23. switch (dev->mphy.chandef.width) {
  24. case NL80211_CHAN_WIDTH_80:
  25. return -76;
  26. case NL80211_CHAN_WIDTH_40:
  27. return -79;
  28. default:
  29. return -82;
  30. }
  31. }
  32. void mt76x02_add_rate_power_offset(struct mt76_rate_power *r, int offset);
  33. void mt76x02_phy_set_txpower(struct mt76x02_dev *dev, int txp_0, int txp_2);
  34. void mt76x02_limit_rate_power(struct mt76_rate_power *r, int limit);
  35. int mt76x02_get_max_rate_power(struct mt76_rate_power *r);
  36. void mt76x02_phy_set_rxpath(struct mt76x02_dev *dev);
  37. void mt76x02_phy_set_txdac(struct mt76x02_dev *dev);
  38. void mt76x02_phy_set_bw(struct mt76x02_dev *dev, int width, u8 ctrl);
  39. void mt76x02_phy_set_band(struct mt76x02_dev *dev, int band,
  40. bool primary_upper);
  41. bool mt76x02_phy_adjust_vga_gain(struct mt76x02_dev *dev);
  42. void mt76x02_init_agc_gain(struct mt76x02_dev *dev);
  43. #endif /* __MT76x02_PHY_H */