changeset 131:cae9cb333c2c

fc-tmsh: me command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 19 Feb 2017 17:19:34 +0000
parents d3e2b619ff89
children 5380872923a6
files rvinterf/include/l1tm.h rvinterf/tmsh/l1cmd.c rvinterf/tmsh/usercmd.c
diffstat 3 files changed, 43 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/include/l1tm.h	Sun Feb 19 17:04:14 2017 +0000
+++ b/rvinterf/include/l1tm.h	Sun Feb 19 17:19:34 2017 +0000
@@ -190,4 +190,17 @@
   RX_TX_MON                 = 27
 };
 
+enum ME_CFG_WRITE_E
+{
+  CFG_WRITE_MKDIRS   = 100,
+  CFG_WRITE_RF_CAL   = 102,
+  CFG_WRITE_RF_CFG   = 103,
+  CFG_WRITE_TX_CAL   = 104,
+  CFG_WRITE_TX_CFG   = 105,
+  CFG_WRITE_RX_CAL   = 106,
+  CFG_WRITE_RX_CFG   = 107,
+  CFG_WRITE_SYS_CAL  = 108,
+  CFG_WRITE_SYS_CFG  = 109
+};
+
 #define	MAX_RF_TABLE_SIZE	128
--- a/rvinterf/tmsh/l1cmd.c	Sun Feb 19 17:04:14 2017 +0000
+++ b/rvinterf/tmsh/l1cmd.c	Sun Feb 19 17:19:34 2017 +0000
@@ -568,3 +568,31 @@
 	send_etm_cmd(cmdpkt, 3);
 	return(0);
 }
+
+static struct kwtab me_arg[] = {
+	{"mkdirs", CFG_WRITE_MKDIRS},
+	{"save-rf-cal", CFG_WRITE_RF_CAL},
+	{"save-rf-cfg", CFG_WRITE_RF_CFG},
+	{"save-tx-cal", CFG_WRITE_TX_CAL},
+	{"save-tx-cfg", CFG_WRITE_TX_CFG},
+	{"save-rx-cal", CFG_WRITE_RX_CAL},
+	{"save-rx-cfg", CFG_WRITE_RX_CFG},
+	{"save-sys-cal", CFG_WRITE_SYS_CAL},
+	{"save-sys-cfg", CFG_WRITE_SYS_CFG},
+	{0, 0}
+};
+
+cmd_me(argc, argv)
+	char **argv;
+{
+	u16 arg;
+	u_char cmdpkt[5];
+
+	if (keyword_or_num(argv[1], me_arg, &arg))
+		return(ERROR_USAGE);
+	cmdpkt[1] = MISC_ENABLE;
+	cmdpkt[2] = arg;
+	cmdpkt[3] = arg >> 8;
+	send_etm_cmd(cmdpkt, 3);
+	return(0);
+}
--- a/rvinterf/tmsh/usercmd.c	Sun Feb 19 17:04:14 2017 +0000
+++ b/rvinterf/tmsh/usercmd.c	Sun Feb 19 17:19:34 2017 +0000
@@ -18,6 +18,7 @@
 extern int cmd_check_ffs1();
 extern int cmd_dieid();
 extern int cmd_ffs2();
+extern int cmd_me();
 extern int cmd_mpr();
 extern int cmd_mpw();
 extern int cmd_omr();
@@ -69,6 +70,7 @@
 	{"etmpkt", 1, 253, cmd_tmpkt},
 	{"exit", 0, 0, cmd_exit},
 	{"ffs2", 1, 3, cmd_ffs2},
+	{"me", 1, 1, cmd_me},
 	{"mpr", 1, 1, cmd_mpr},
 	{"mpw", 2, 2, cmd_mpw},
 	{"omr", 2, 2, cmd_omr},