linux_dsm_epyc7002/drivers/net/wireless/b43/ppr.h
Rafał Miłecki ec76643b00 b43: implement PPR (Power Per Rate) management/API
Broadcom hardware supports auto-adjustment of TX power depending on the
currently used rate. So far all calculations were handled without any
helpers (API) using big arrays and magic offsets.
It seems Broadcom recently decided to clean this up by developing PPR.
Their wlc_ppr.h can be found in open parts of the SDK.
As we plan to implement support for rate-based TX power it makes sense
to also implement our version of PPR as well.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-25 16:00:43 -04:00

46 lines
1.2 KiB
C

#ifndef LINUX_B43_PPR_H_
#define LINUX_B43_PPR_H_
#include <linux/types.h>
#define B43_PPR_CCK_RATES_NUM 4
#define B43_PPR_OFDM_RATES_NUM 8
#define B43_PPR_MCS_RATES_NUM 8
#define B43_PPR_RATES_NUM (B43_PPR_CCK_RATES_NUM + \
B43_PPR_OFDM_RATES_NUM * 2 + \
B43_PPR_MCS_RATES_NUM * 4)
struct b43_ppr_rates {
u8 cck[B43_PPR_CCK_RATES_NUM];
u8 ofdm[B43_PPR_OFDM_RATES_NUM];
u8 ofdm_20_cdd[B43_PPR_OFDM_RATES_NUM];
u8 mcs_20[B43_PPR_MCS_RATES_NUM]; /* SISO */
u8 mcs_20_cdd[B43_PPR_MCS_RATES_NUM];
u8 mcs_20_stbc[B43_PPR_MCS_RATES_NUM];
u8 mcs_20_sdm[B43_PPR_MCS_RATES_NUM];
};
struct b43_ppr {
/* All powers are in qdbm (Q5.2) */
union {
u8 __all_rates[B43_PPR_RATES_NUM];
struct b43_ppr_rates rates;
};
};
struct b43_wldev;
enum b43_band;
void b43_ppr_clear(struct b43_wldev *dev, struct b43_ppr *ppr);
void b43_ppr_add(struct b43_wldev *dev, struct b43_ppr *ppr, int diff);
void b43_ppr_apply_max(struct b43_wldev *dev, struct b43_ppr *ppr, u8 max);
void b43_ppr_apply_min(struct b43_wldev *dev, struct b43_ppr *ppr, u8 min);
u8 b43_ppr_get_max(struct b43_wldev *dev, struct b43_ppr *ppr);
bool b43_ppr_load_max_from_sprom(struct b43_wldev *dev, struct b43_ppr *ppr,
enum b43_band band);
#endif /* LINUX_B43_PPR_H_ */