1 /* SPDX-License-Identifier: ISC */
2 /* Copyright (C) 2020 MediaTek Inc. */
4 #ifndef __MT7915_EEPROM_H
5 #define __MT7915_EEPROM_H
14 enum mt7915_eeprom_field
{
15 MT_EE_CHIP_ID
= 0x000,
16 MT_EE_VERSION
= 0x002,
17 MT_EE_MAC_ADDR
= 0x004,
18 MT_EE_MAC_ADDR2
= 0x00a,
19 MT_EE_DDIE_FT_VERSION
= 0x050,
20 MT_EE_WIFI_CONF
= 0x190,
21 MT_EE_TX0_POWER_2G
= 0x2fc,
22 MT_EE_TX0_POWER_5G
= 0x34b,
23 MT_EE_ADIE_FT_VERSION
= 0x9a0,
28 #define MT_EE_WIFI_CONF_TX_MASK GENMASK(2, 0)
29 #define MT_EE_WIFI_CONF_BAND_SEL GENMASK(7, 6)
30 #define MT_EE_WIFI_CONF_TSSI0_2G BIT(0)
31 #define MT_EE_WIFI_CONF_TSSI0_5G BIT(2)
32 #define MT_EE_WIFI_CONF_TSSI1_5G BIT(4)
34 enum mt7915_eeprom_band
{
41 #define SKU_DELTA_VAL GENMASK(5, 0)
42 #define SKU_DELTA_ADD BIT(6)
43 #define SKU_DELTA_EN BIT(7)
45 enum mt7915_sku_delta_group
{
67 enum mt7915_sku_rate_group
{
83 MAX_SKU_RATE_GROUP_NUM
,
93 mt7915_get_channel_group(int channel
)
95 if (channel
>= 184 && channel
<= 196)
113 mt7915_tssi_enabled(struct mt7915_dev
*dev
, enum nl80211_band band
)
115 u8
*eep
= dev
->mt76
.eeprom
.data
;
118 if (band
== NL80211_BAND_5GHZ
)
119 return eep
[MT_EE_WIFI_CONF
+ 7] & MT_EE_WIFI_CONF_TSSI0_5G
;
121 return eep
[MT_EE_WIFI_CONF
+ 7] & MT_EE_WIFI_CONF_TSSI0_2G
;
124 extern const struct sku_group mt7915_sku_groups
[];