[][MAC80211][WiFi6/7][app][Fix atenl cannot support binfile mode precal issue]

[Description]
Fix atenl cannot support binfile mode precal issue

[Release-log]
N/A

Change-Id: Id684aa49f12a0d4d697270b8d3b7d7410c0d5e99
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8178938
diff --git a/feed/atenl/src/eeprom.c b/feed/atenl/src/eeprom.c
index 10720d0..706a7b0 100644
--- a/feed/atenl/src/eeprom.c
+++ b/feed/atenl/src/eeprom.c
@@ -18,10 +18,10 @@
 
 	/* reserve space for pre-cal data in flash mode */
 	if (flash_mode) {
-		atenl_dbg("%s: init eeprom with flash mode\n", __func__);
+		atenl_dbg("%s: init eeprom with flash / binfile mode\n", __func__);
 		max_len = EEPROM_PART_SIZE;
 	} else {
-		atenl_dbg("%s: init eeprom with efuse mode\n", __func__);
+		atenl_dbg("%s: init eeprom with efuse / default bin mode\n", __func__);
 		max_len = 0x1e00;
 	}
 
@@ -419,11 +419,10 @@
 
 int atenl_eeprom_write_mtd(struct atenl *an)
 {
-	bool flash_mode = an->mtd_part != NULL;
 	pid_t pid;
 	char offset[10];
 
-	if (!flash_mode)
+	if (an->mtd_part == NULL || !(~an->mtd_offset))
 		return 0;
 
 	pid = fork();
@@ -498,12 +497,9 @@
 
 void atenl_eeprom_cmd_handler(struct atenl *an, u8 phy_idx, char *cmd)
 {
-	bool flash_mode;
-
 	an->cmd_mode = true;
 
 	atenl_eeprom_init(an, phy_idx);
-	flash_mode = an->mtd_part != NULL;
 
 	if (!strncmp(cmd, "sync eeprom all", 15)) {
 		atenl_eeprom_write_mtd(an);
@@ -520,7 +516,11 @@
 			unlink(eeprom_file);
 		} else if (!strncmp(s, "file", 4)) {
 			atenl_info("%s\n", eeprom_file);
-			atenl_info("Flash mode: %d\n", flash_mode);
+			if (an->mtd_part != NULL)
+				atenl_info("%s mode\n",
+					   ~an->mtd_offset == 0 ? "Binfile" : "Flash");
+			else
+				atenl_info("Efuse / Default bin mode\n");
 		} else if (!strncmp(s, "set", 3)) {
 			u32 offset, val;