[][MAC80211][WiFi6/7][app][Add single wiphy support for atenl & iwpriv wrapper]

[Description]
Add single wiphy support for atenl & iwpirv wrapper
To support single wiphy, main phy idx is used for debugfs in atenl &
iwpriv wrapper.

[Release-log]
N/A

Change-Id: Ic146442a8838cd812be9e92ce3e4f5e5f32c91fe
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/9176525
diff --git a/feed/app/atenl/src/eeprom.c b/feed/app/atenl/src/eeprom.c
index d112dc7..b3a652a 100644
--- a/feed/app/atenl/src/eeprom.c
+++ b/feed/app/atenl/src/eeprom.c
@@ -27,7 +27,7 @@
 
 	snprintf(fname, sizeof(fname),
 		 "/sys/kernel/debug/ieee80211/phy%d/mt76/eeprom",
-		 get_band_val(an, 0, phy_idx));
+		 an->main_phy_idx);
 	fd_ori = open(fname, O_RDONLY);
 	if (fd_ori < 0)
 		return -1;
@@ -344,17 +344,14 @@
 	bool flash_mode;
 	int eeprom_fd;
 	char buf[30];
-	u8 main_phy_idx = phy_idx;
 
 	set_band_val(an, 0, phy_idx, phy_idx);
 	atenl_nl_check_mtd(an);
 	flash_mode = an->mtd_part != NULL;
 
 	// Get the first main phy index for this chip
-	if (flash_mode)
-		main_phy_idx -= an->band_idx;
-
-	snprintf(buf, sizeof(buf), "/tmp/atenl-eeprom-phy%u", main_phy_idx);
+	an->main_phy_idx = phy_idx - an->band_idx;
+	snprintf(buf, sizeof(buf), "/tmp/atenl-eeprom-phy%u", an->main_phy_idx);
 	eeprom_file = strdup(buf);
 
 	eeprom_fd = atenl_eeprom_init_file(an, flash_mode);
@@ -461,7 +458,7 @@
 
 	snprintf(fname, sizeof(fname),
 		"/sys/kernel/debug/ieee80211/phy%d/mt76/eeprom",
-		get_band_val(an, 0, phy_idx));
+		an->main_phy_idx);
 	fd_ori = open(fname, O_RDONLY);
 	if (fd_ori < 0)
 		return -1;