[][MAC80211][WiFi6][app][Add atenl support for cheetah]
[Description]
Add atenl support for cheetah
[Release-log]
N/A
Change-Id: I0e543c138c9d7a189acb10efb97c9066a93909b8
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8188100
diff --git a/feed/atenl/files/iwpriv.sh b/feed/atenl/files/iwpriv.sh
index a29c765..a9bcfab 100755
--- a/feed/atenl/files/iwpriv.sh
+++ b/feed/atenl/files/iwpriv.sh
@@ -101,6 +101,10 @@
SOC_start_idx="1"
SOC_end_idx="2"
is_connac3="0"
+ elif [ ! -z "$(head -c 2 ${eeprom_file} | hexdump | grep "7981")" ]; then
+ SOC_start_idx="0"
+ SOC_end_idx="1"
+ is_connac3="0"
elif [ ! -z "$(head -c 2 ${eeprom_file} | hexdump | grep "7986")" ]; then
SOC_start_idx="0"
SOC_end_idx="1"
@@ -116,7 +120,7 @@
else
echo "Interface Conversion Failed!"
echo "Please use iwpriv <phy0/phy1/..> set <...> or configure the sku of your board manually by the following commands"
- echo "For AX6000:"
+ echo "For AX3000/AX6000:"
echo " echo STARTIDX=0 >> ${interface_file}"
echo " echo ENDIDX=1 >> ${interface_file}"
echo " echo IS_CONNAC3=0 >> ${interface_file}"
diff --git a/feed/atenl/src/atenl.h b/feed/atenl/src/atenl.h
index 60feaf4..a5f9fbb 100644
--- a/feed/atenl/src/atenl.h
+++ b/feed/atenl/src/atenl.h
@@ -270,7 +270,7 @@
MT_EE_BAND_SEL_DUAL,
};
-/* for mt7916/mt7986 */
+/* for mt7916/mt7981/mt7986 */
enum {
MT_EE_BAND_SEL_2G,
MT_EE_BAND_SEL_5G,
@@ -400,6 +400,11 @@
return (an->chip_id == 0x7916) || (an->chip_id == 0x7906);
}
+static inline bool is_mt7981(struct atenl *an)
+{
+ return an->chip_id == 0x7981;
+}
+
static inline bool is_mt7986(struct atenl *an)
{
return an->chip_id == 0x7986;
diff --git a/feed/atenl/src/eeprom.c b/feed/atenl/src/eeprom.c
index 706a7b0..d7a2467 100644
--- a/feed/atenl/src/eeprom.c
+++ b/feed/atenl/src/eeprom.c
@@ -117,7 +117,7 @@
if (is_mt7915(an)) {
an->adie_id = 0x7975;
- } else if (is_mt7916(an)) {
+ } else if (is_mt7916(an) || is_mt7981(an)) {
an->adie_id = 0x7976;
} else if (is_mt7986(an)) {
bool is_7975 = false;
@@ -164,6 +164,7 @@
break;
case 0x7906:
case 0x7916:
+ case 0x7981:
case 0x7986:
an->eeprom_size = 4096;
an->eeprom_prek_offs = 0x19a;
@@ -209,7 +210,7 @@
anb->valid = true;
anb->cap = BAND_TYPE_5G;
}
- } else if (is_mt7916(an) || is_mt7986(an)) {
+ } else if (is_mt7916(an) || is_mt7981(an) || is_mt7986(an)) {
struct atenl_band *anb;
u8 val, band_sel;
int i;
@@ -316,6 +317,10 @@
an->anb[0].chainmask = 0x3;
an->anb[1].chainmask = 0x3;
break;
+ case 0x7981:
+ an->anb[0].chainmask = 0x3;
+ an->anb[1].chainmask = 0x7;
+ break;
case 0x7986:
an->anb[0].chainmask = 0xf;
an->anb[1].chainmask = 0xf;