mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 21:36:52 +00:00
In ACPI SAR enabled device, mt7921 should read power limit in ACPI config. The limit value would be applied to regular tx power settings in mt76. Two major functionalities added: 1. Get SAR power table through ACPI. 2. Read power in Dynamic/Geo SAR table for tx power limit. Table note MTDS: Dynamic SAR table MTGS: Geo SAR table MTCL: Country List table (for 6GHz support) Reviewed-by: Sean Wang <[email protected]> Co-developed-by: Quan Zhou <[email protected]> Signed-off-by: Quan Zhou <[email protected]> Co-developed-by: Ming Yen Hsieh <[email protected]> Signed-off-by: Ming Yen Hsieh <[email protected]> Signed-off-by: Deren Wu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
94 lines
1.6 KiB
C
94 lines
1.6 KiB
C
/* SPDX-License-Identifier: ISC */
|
|
/* Copyright (C) 2022 MediaTek Inc. */
|
|
|
|
#ifndef __MT7921_ACPI_SAR_H
|
|
#define __MT7921_ACPI_SAR_H
|
|
|
|
#define MT7921_ASAR_MIN_DYN 1
|
|
#define MT7921_ASAR_MAX_DYN 8
|
|
#define MT7921_ASAR_MIN_GEO 3
|
|
#define MT7921_ASAR_MAX_GEO 8
|
|
|
|
#define MT7921_ACPI_MTCL "MTCL"
|
|
#define MT7921_ACPI_MTDS "MTDS"
|
|
#define MT7921_ACPI_MTGS "MTGS"
|
|
|
|
struct mt7921_asar_dyn_limit {
|
|
u8 idx;
|
|
u8 frp[5];
|
|
} __packed;
|
|
|
|
struct mt7921_asar_dyn {
|
|
u8 names[4];
|
|
u8 enable;
|
|
u8 nr_tbl;
|
|
struct mt7921_asar_dyn_limit tbl[0];
|
|
} __packed;
|
|
|
|
struct mt7921_asar_dyn_limit_v2 {
|
|
u8 idx;
|
|
u8 frp[11];
|
|
} __packed;
|
|
|
|
struct mt7921_asar_dyn_v2 {
|
|
u8 names[4];
|
|
u8 enable;
|
|
u8 rsvd;
|
|
u8 nr_tbl;
|
|
struct mt7921_asar_dyn_limit_v2 tbl[0];
|
|
} __packed;
|
|
|
|
struct mt7921_asar_geo_band {
|
|
u8 pwr;
|
|
u8 offset;
|
|
} __packed;
|
|
|
|
struct mt7921_asar_geo_limit {
|
|
u8 idx;
|
|
/* 0:2G, 1:5G */
|
|
struct mt7921_asar_geo_band band[2];
|
|
} __packed;
|
|
|
|
struct mt7921_asar_geo {
|
|
u8 names[4];
|
|
u8 version;
|
|
u8 nr_tbl;
|
|
struct mt7921_asar_geo_limit tbl[0];
|
|
} __packed;
|
|
|
|
struct mt7921_asar_geo_limit_v2 {
|
|
u8 idx;
|
|
/* 0:2G, 1:5G, 2:6G */
|
|
struct mt7921_asar_geo_band band[3];
|
|
} __packed;
|
|
|
|
struct mt7921_asar_geo_v2 {
|
|
u8 names[4];
|
|
u8 version;
|
|
u8 rsvd;
|
|
u8 nr_tbl;
|
|
struct mt7921_asar_geo_limit_v2 tbl[0];
|
|
} __packed;
|
|
|
|
struct mt7921_asar_cl {
|
|
u8 names[4];
|
|
u8 version;
|
|
u8 mode_6g;
|
|
u8 cl6g[6];
|
|
} __packed;
|
|
|
|
struct mt7921_acpi_sar {
|
|
u8 ver;
|
|
union {
|
|
struct mt7921_asar_dyn *dyn;
|
|
struct mt7921_asar_dyn_v2 *dyn_v2;
|
|
};
|
|
union {
|
|
struct mt7921_asar_geo *geo;
|
|
struct mt7921_asar_geo_v2 *geo_v2;
|
|
};
|
|
struct mt7921_asar_cl *countrylist;
|
|
};
|
|
|
|
#endif
|