[][MAC80211][WiFi7][app][Add ibf atenl support for eagle]

[Description]
Add ibf atenl support for eagle
1. add eagle ibf eeprom offset and len
2. fix litepoint lna gain setting for wifi 7

[Release-log]
N/A

Change-Id: I0b9200e778d9c9f26aa44527142f060941dd04e2
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8099658
diff --git a/feed/atenl/src/nl.c b/feed/atenl/src/nl.c
index efd8e68..56c68f1 100644
--- a/feed/atenl/src/nl.c
+++ b/feed/atenl/src/nl.c
@@ -831,15 +831,20 @@
 void
 atenl_get_ibf_cal_result(struct atenl *an)
 {
-	u16 offset;
+	u16 offset, group_size = 40;
 
 	if (an->adie_id == 0x7975)
 		offset = 0x651;
 	else if (an->adie_id == 0x7976)
 		offset = 0x60a;
 
-	/* per group size = 40, for group 0-8 */
-	atenl_eeprom_read_from_driver(an, offset, 40 * 9);
+	if (is_mt7996(an)) {
+		offset = 0xc00;
+		group_size = 46;
+	}
+
+	/* per group size = 40 or 46, for group 0-8 */
+	atenl_eeprom_read_from_driver(an, offset, group_size * 9);
 }
 
 static int
@@ -897,9 +902,11 @@
 		 * so maintain a temp variable to allow mcs update in anthor action.
 		 */
 		an->ibf_mcs = val[0];
-		an->ibf_ant = tmp_ant;
 		nla_put_u8(msg, MT76_TM_ATTR_TX_RATE_IDX, an->ibf_mcs);
-		nla_put_u8(msg, MT76_TM_ATTR_TX_ANTENNA, an->ibf_ant);
+		if (!is_mt7996(an)) {
+			an->ibf_ant = tmp_ant;
+			nla_put_u8(msg, MT76_TM_ATTR_TX_ANTENNA, an->ibf_ant);
+		}
 		break;
 	case TXBF_ACT_TX_ANT:
 		nla_put_u8(msg, MT76_TM_ATTR_TX_ANTENNA, val[0]);
@@ -937,9 +944,11 @@
 		a = nla_nest_start(msg, MT76_TM_ATTR_TXBF_PARAM);
 		if (!a)
 			return -ENOMEM;
-		/* Note: litepoint may send random number for lna_gain_level, reset to 0 */
+		/* Note: litepoint may send random number for lna_gain_level,
+		 * reset to 1 (mid gain) and 0 for wifi 7 and wifi 6, respectively
+		 */
 		if (action == TXBF_ACT_IBF_PHASE_CAL)
-			val[4] = 0;
+			val[4] = is_mt7996(an) ? 1 : 0;
 		for (i = 0; i < 5; i++)
 			nla_put_u16(msg, i, val[i]);
 		/* Used to distinguish between command mode and HQADLL mode */