[][MAC80211][mt76][Add ZWDFS testmode support]
[Description]
Add ZWDFS testmode support including background chain channel switch
and show IPI histogram command
[Release-log]
N/A
Change-Id: I0acc2c52abd30f77db4a8c22c8516ad69c13fe11
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6696081
diff --git a/feed/atenl/files/iwpriv.sh b/feed/atenl/files/iwpriv.sh
index 910e314..d42c32b 100755
--- a/feed/atenl/files/iwpriv.sh
+++ b/feed/atenl/files/iwpriv.sh
@@ -20,8 +20,8 @@
echo "$1"
;;
"DEBUG")
- eval "$1"
echo "$1"
+ eval "$1"
;;
esac
}
@@ -680,6 +680,41 @@
fi
}
+function convert_dfs {
+ local cmd=$1
+ local param=$2
+
+ case ${cmd} in
+ "DfsRxCtrl")
+ local offchan_ch="$(echo $param | cut -d ':' -f1)"
+ local offchan_bw="$(echo $param | cut -d ':' -f2)"
+
+ if [ "$offchan_bw" = "0" ]; then
+ offchan_bw="20"
+ elif [ "$offchan_bw" = "1" ]; then
+ offchan_bw="40"
+ elif [ "$offchan_bw" = "2" ]; then
+ offchan_bw="80"
+ fi
+
+ do_cmd "mt76-test phy${phy_idx} set state=idle"
+ do_cmd "mt76-test phy${phy_idx} set offchan_ch=${offchan_ch} offchan_bw=${offchan_bw}"
+ ;;
+ "DfsRxHist")
+ local ipi_th="$(echo $param | cut -d ':' -f 1)"
+ local ipi_period="$(echo $param | cut -d ':' -f 2)"
+ local ipi_antenna="$(echo $param | cut -d ':' -f 3)"
+
+ if [ -z $ipi_antenna ]; then
+ do_cmd "mt76-test phy${phy_idx} set ipi_threshold=${ipi_th} ipi_period=${ipi_period}"
+ else
+ do_cmd "mt76-test phy${phy_idx} set ipi_threshold=${ipi_th} ipi_period=${ipi_period} ipi_antenna_idx=${ipi_antenna}"
+ fi
+ ;;
+ *)
+ esac
+}
+
function do_ate_work() {
local ate_cmd=$1
@@ -844,6 +879,10 @@
set_mac_addr ${cmd} ${param}
skip=1
;;
+ "DfsRxCtrl"|"DfsRxHist")
+ convert_dfs ${cmd} ${param}
+ skip=1
+ ;;
"ATETxBfInit"|"ATEIBFPhaseComp"|"ATEEBfProfileConfig"|"ATEIBfProfileConfig"| \
"TxBfTxApply"|"ATETxPacketWithBf"|"TxBfProfileData20MAllWrite"|"ATEIBfInstCal"|\
"ATEIBfGdCal"|"ATEIBFPhaseE2pUpdate")
diff --git a/feed/atenl/src/nl.h b/feed/atenl/src/nl.h
index 27336bd..44a0a3f 100644
--- a/feed/atenl/src/nl.h
+++ b/feed/atenl/src/nl.h
@@ -19,7 +19,7 @@
* @MT76_TM_ATTR_TX_COUNT: configured number of frames to send when setting
* state to MT76_TM_STATE_TX_FRAMES (u32)
* @MT76_TM_ATTR_TX_PENDING: pending frames during MT76_TM_STATE_TX_FRAMES (u32)
- * @MT76_TM_ATTR_TX_LENGTH: packet tx msdu length (u32)
+ * @MT76_TM_ATTR_TX_LENGTH: packet tx mpdu length (u32)
* @MT76_TM_ATTR_TX_RATE_MODE: packet tx mode (u8, see &enum mt76_testmode_tx_mode)
* @MT76_TM_ATTR_TX_RATE_NSS: packet tx number of spatial streams (u8)
* @MT76_TM_ATTR_TX_RATE_IDX: packet tx rate/MCS index (u8)
@@ -37,7 +37,6 @@
* @MT76_TM_ATTR_STATS: statistics (nested, see &enum mt76_testmode_stats_attr)
*
* @MT76_TM_ATTR_PRECAL: Pre-cal data (u8)
- * @MT76_TM_ATTR_PRECAL: Pre-cal data (u8)
* @MT76_TM_ATTR_PRECAL_INFO: group size, dpd size, dpd_info, transmit size,
* eeprom cal indicator (u32),
* dpd_info = [dpd_per_chan_size, chan_num_2g,
@@ -48,6 +47,36 @@
* @MT76_TM_ATTR_TX_IPG: tx inter-packet gap, in unit of us (u32)
* @MT76_TM_ATTR_TX_TIME: packet transmission time, in unit of us (u32)
*
+ * @MT76_TM_ATTR_DRV_DATA: driver specific netlink attrs (nested)
+ *
+ * @MT76_TM_ATTR_MAC_ADDRS: array of nested MAC addresses (nested)
+ *
+ * @MT76_TM_ATTR_EEPROM_ACTION: eeprom setting actions
+ * (u8, see &enum mt76_testmode_eeprom_action)
+ * @MT76_TM_ATTR_EEPROM_OFFSET: offset of eeprom data block for writing (u32)
+ * @MT76_TM_ATTR_EEPROM_VAL: values for writing into a 16-byte data block
+ * (nested, u8 attrs)
+ *
+ * @MT76_TM_ATTR_CFG: config testmode rf feature
+ * (nested, see &mt76_testmode_cfg)
+ * @MT76_TM_ATTR_TXBF_ACT: txbf setting actions (u8)
+ * @MT76_TM_ATTR_TXBF_PARAM: txbf parameters (nested)
+ *
+ * @MT76_TM_ATTR_OFF_CH_SCAN_CH: config the channel of background chain (ZWDFS)
+ * (u8)
+ * @MT76_TM_ATTR_OFF_CH_SCAN_CENTER_CH: config the center channel of
+ * background chain (ZWDFS) (u8)
+ * @MT76_TM_ATTR_OFF_CH_SCAN_BW: config the bandwidth of
+ * background chain (ZWDFS) (u8)
+ * @MT76_TM_ATTR_OFF_CH_SCAN_PATH: config the tx path of
+ * background chain (ZWDFS) (u8)
+ *
+ * @MT76_TM_ATTR_IPI_THRESHOLD: config the IPI index you want to read (u8)
+ * @MT76_TM_ATTR_IPI_PERIOD: config the time period for reading
+ * the histogram of specific IPI index (u8)
+ * @MT76_TM_ATTR_IPI_ANTENNA_INDEX: config the antenna index for reading
+ * the histogram of specific IPI index (u8)
+ *
*/
enum mt76_testmode_attr {
MT76_TM_ATTR_UNSPEC,
@@ -76,7 +105,6 @@
MT76_TM_ATTR_FREQ_OFFSET,
MT76_TM_ATTR_STATS,
-
MT76_TM_ATTR_PRECAL,
MT76_TM_ATTR_PRECAL_INFO,
@@ -106,6 +134,10 @@
MT76_TM_ATTR_OFF_CH_SCAN_BW,
MT76_TM_ATTR_OFF_CH_SCAN_PATH,
+ MT76_TM_ATTR_IPI_THRESHOLD,
+ MT76_TM_ATTR_IPI_PERIOD,
+ MT76_TM_ATTR_IPI_ANTENNA_INDEX,
+
/* keep last */
NUM_MT76_TM_ATTRS,
MT76_TM_ATTR_MAX = NUM_MT76_TM_ATTRS - 1,