Add Broadcom / Netgear changes from RAXE 1.0.0.48
[project/bcm63xx/u-boot.git] / drivers / net / bcmbca / xrdp_full / gen_data_path_init_data.sh
diff --git a/drivers/net/bcmbca/xrdp_full/gen_data_path_init_data.sh b/drivers/net/bcmbca/xrdp_full/gen_data_path_init_data.sh
new file mode 100755 (executable)
index 0000000..1e70e64
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+if [[ $# != 2 ]]; then
+   echo "$0 console_output_file_name data_path_<chip_id>.c"
+   exit -1
+fi
+dos2unix $1
+cat <<EOT > $2
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ *  Copyright 2019 Broadcom Ltd.
+ */
+
+#include "access_logging.h"
+
+const access_log_tuple_t init_data[] = {
+EOT
+
+grep '^>>>' $1 | awk '{print "\t{", $2, ",", $3,"},"}' >> $2
+
+cat <<EOT >> $2
+    { (ACCESS_LOG_OP_STOP << 24), 0 }
+};
+EOT