[][MAC80211][app][Add ATERUINFO wrap support]

[Description]
Add ATERUINFO wrap support

[Release-log]
N/A


Change-Id: Ic8049b55e9dfe5a5c381fe1e8defd1065d682705
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7724408
diff --git a/feed/atenl/files/iwpriv.sh b/feed/atenl/files/iwpriv.sh
index b5b6fa3..6fd22c6 100755
--- a/feed/atenl/files/iwpriv.sh
+++ b/feed/atenl/files/iwpriv.sh
@@ -881,6 +881,31 @@
     fi
 }
 
+function convert_ruinfo {
+    local new_param=$1
+
+    do_cmd "mt76-test phy${phy_idx} set state=idle"
+    while [ -n "$new_param" ]
+    do
+        [ ${new_param:1:1} = ':' ] && {
+            new_param=${new_param:2}
+        }
+        local oIFS="$IFS"; IFS=":"; set -- $new_param; IFS="$oIFS"
+
+        parsing_ruinfo $new_param
+        new_param=${new_param:${#1}+1}
+    done
+}
+
+function parsing_ruinfo {
+    local new_param=$1
+    local oIFS="$IFS"; IFS="-:"; set -- $new_param; IFS="$oIFS"
+
+    # $7 is Start spatial stream and it should be 0, $9 is alpha, not used
+    do_cmd "mt76-test phy${phy_idx} set tx_rate_mode=he_mu tx_rate_sgi=0 tx_ltf=0 ru_alloc=$1 aid=$2 ru_idx=$3\
+        tx_rate_idx=$4 tx_rate_ldpc=$5 tx_rate_nss=$6 tx_length=$8"
+}
+
 function convert_dfs {
     local cmd=$1
     local param=$2
@@ -1272,6 +1297,10 @@
             echo "Entering ${param} mode in iwpriv"
             skip=1
             ;;
+        "ATERUINFO")
+            convert_ruinfo ${param}
+            skip=1
+            ;;
         *)
             print_debug "Unknown command to set: ${cmd}"
             skip=1