2019-07-24 15:58:20 +07:00
|
|
|
/* SPDX-License-Identifier: ISC */
|
2018-09-22 18:45:30 +07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MT76x02_PHY_H
|
|
|
|
#define __MT76x02_PHY_H
|
|
|
|
|
|
|
|
#include "mt76x02_regs.h"
|
|
|
|
|
2018-10-12 17:16:24 +07:00
|
|
|
static inline int
|
|
|
|
mt76x02_get_rssi_gain_thresh(struct mt76x02_dev *dev)
|
|
|
|
{
|
2019-10-13 00:46:40 +07:00
|
|
|
switch (dev->mphy.chandef.width) {
|
2018-10-12 17:16:24 +07:00
|
|
|
case NL80211_CHAN_WIDTH_80:
|
|
|
|
return -62;
|
|
|
|
case NL80211_CHAN_WIDTH_40:
|
|
|
|
return -65;
|
|
|
|
default:
|
|
|
|
return -68;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
mt76x02_get_low_rssi_gain_thresh(struct mt76x02_dev *dev)
|
|
|
|
{
|
2019-10-13 00:46:40 +07:00
|
|
|
switch (dev->mphy.chandef.width) {
|
2018-10-12 17:16:24 +07:00
|
|
|
case NL80211_CHAN_WIDTH_80:
|
|
|
|
return -76;
|
|
|
|
case NL80211_CHAN_WIDTH_40:
|
|
|
|
return -79;
|
|
|
|
default:
|
|
|
|
return -82;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-22 18:45:30 +07:00
|
|
|
void mt76x02_add_rate_power_offset(struct mt76_rate_power *r, int offset);
|
2018-10-07 16:45:19 +07:00
|
|
|
void mt76x02_phy_set_txpower(struct mt76x02_dev *dev, int txp_0, int txp_2);
|
2018-09-22 18:45:30 +07:00
|
|
|
void mt76x02_limit_rate_power(struct mt76_rate_power *r, int limit);
|
|
|
|
int mt76x02_get_max_rate_power(struct mt76_rate_power *r);
|
2018-10-07 16:45:19 +07:00
|
|
|
void mt76x02_phy_set_rxpath(struct mt76x02_dev *dev);
|
|
|
|
void mt76x02_phy_set_txdac(struct mt76x02_dev *dev);
|
2018-10-12 17:16:17 +07:00
|
|
|
void mt76x02_phy_set_bw(struct mt76x02_dev *dev, int width, u8 ctrl);
|
2018-10-12 17:16:18 +07:00
|
|
|
void mt76x02_phy_set_band(struct mt76x02_dev *dev, int band,
|
|
|
|
bool primary_upper);
|
2018-10-12 17:16:25 +07:00
|
|
|
bool mt76x02_phy_adjust_vga_gain(struct mt76x02_dev *dev);
|
2018-10-12 17:16:26 +07:00
|
|
|
void mt76x02_init_agc_gain(struct mt76x02_dev *dev);
|
2018-09-22 18:45:30 +07:00
|
|
|
|
|
|
|
#endif /* __MT76x02_PHY_H */
|