18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef LINUX_B43_PPR_H_
38c2ecf20Sopenharmony_ci#define LINUX_B43_PPR_H_
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/types.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#define B43_PPR_CCK_RATES_NUM		4
88c2ecf20Sopenharmony_ci#define B43_PPR_OFDM_RATES_NUM		8
98c2ecf20Sopenharmony_ci#define B43_PPR_MCS_RATES_NUM		8
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define B43_PPR_RATES_NUM	(B43_PPR_CCK_RATES_NUM +	\
128c2ecf20Sopenharmony_ci				 B43_PPR_OFDM_RATES_NUM * 2 +	\
138c2ecf20Sopenharmony_ci				 B43_PPR_MCS_RATES_NUM * 4)
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_cistruct b43_ppr_rates {
168c2ecf20Sopenharmony_ci	u8 cck[B43_PPR_CCK_RATES_NUM];
178c2ecf20Sopenharmony_ci	u8 ofdm[B43_PPR_OFDM_RATES_NUM];
188c2ecf20Sopenharmony_ci	u8 ofdm_20_cdd[B43_PPR_OFDM_RATES_NUM];
198c2ecf20Sopenharmony_ci	u8 mcs_20[B43_PPR_MCS_RATES_NUM]; /* SISO */
208c2ecf20Sopenharmony_ci	u8 mcs_20_cdd[B43_PPR_MCS_RATES_NUM];
218c2ecf20Sopenharmony_ci	u8 mcs_20_stbc[B43_PPR_MCS_RATES_NUM];
228c2ecf20Sopenharmony_ci	u8 mcs_20_sdm[B43_PPR_MCS_RATES_NUM];
238c2ecf20Sopenharmony_ci};
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_cistruct b43_ppr {
268c2ecf20Sopenharmony_ci	/* All powers are in qdbm (Q5.2) */
278c2ecf20Sopenharmony_ci	union {
288c2ecf20Sopenharmony_ci		u8 __all_rates[B43_PPR_RATES_NUM];
298c2ecf20Sopenharmony_ci		struct b43_ppr_rates rates;
308c2ecf20Sopenharmony_ci	};
318c2ecf20Sopenharmony_ci};
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_cistruct b43_wldev;
348c2ecf20Sopenharmony_cienum b43_band;
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_civoid b43_ppr_clear(struct b43_wldev *dev, struct b43_ppr *ppr);
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_civoid b43_ppr_add(struct b43_wldev *dev, struct b43_ppr *ppr, int diff);
398c2ecf20Sopenharmony_civoid b43_ppr_apply_max(struct b43_wldev *dev, struct b43_ppr *ppr, u8 max);
408c2ecf20Sopenharmony_civoid b43_ppr_apply_min(struct b43_wldev *dev, struct b43_ppr *ppr, u8 min);
418c2ecf20Sopenharmony_ciu8 b43_ppr_get_max(struct b43_wldev *dev, struct b43_ppr *ppr);
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_cibool b43_ppr_load_max_from_sprom(struct b43_wldev *dev, struct b43_ppr *ppr,
448c2ecf20Sopenharmony_ci				 enum b43_band band);
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#endif /* LINUX_B43_PPR_H_ */
47