Ated tool for Wi-Fi calibration on Hame MPR-A1

I am preparing OpenWRT firmware for a Hame MPR-A1 clone. Everything works great except the manufacturer needs a tool called ated to calibrate the Wi-Fi on each individual device. This tool is available with the manufacturer's firmware but we need to use OpenWRT. I can't find ated as a standard tool in OpenWRT but I have been able to find some source that may or may not be appropriate for our RT5350f-based board:

It appears that source needs the Ralink SDK and I found something that might be that as well:

But I seem unable to put all of this together to create a package. I chased down missing includes but ended up with a long list of errors. Below is the beginning of the that set of errors compiling. Any help or advice would be appreciated.

John

In file included from /home/user/dev/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/include/linux/if.h:23:0,
                 from switch_rt305x.c:7,
                 from switch.c:7:
/home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/include/linux/types.h:20:25: error: conflicting types for 'off_t'
 typedef __kernel_off_t  off_t;
                         ^
In file included from /home/user/dev/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/include/stdio.h:22:0,
                 from switch_rt305x.c:1,
                 from switch.c:7:
/home/user/dev/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/include/bits/alltypes.h:190:16: note: previous declaration of 'off_t' was here
 typedef _Int64 off_t;
                ^
In file included from /home/user/dev/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/include/sys/socket.h:20:0,
                 from switch_rt305x.c:6,
                 from switch.c:7:
/home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/arch/mips/include/asm/socket.h:30:2: error: expected identifier before numeric constant
  SOCK_DGRAM = 1,
  ^
In file included from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/arch/mips/include/asm/cpu-info.h:17:0,
                 from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/arch/mips/include/asm/cpu-features.h:13,
                 from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/arch/mips/include/asm/bitops.h:21,
                 from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/include/linux/bitops.h:36,
                 from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/include/linux/kernel.h:10,
                 from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/include/linux/uio.h:12,
                 from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/include/linux/socket.h:7,
                 from /home/user/dev/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/include/linux/if.h:24,
                 from switch_rt305x.c:7,
                 from switch.c:7:
/home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/arch/mips/include/asm/cpu-info.h:94:26: error: 'CONFIG_MIPS_L1_CACHE_SHIFT' undeclared here (not in a function)
 } __attribute__((aligned(SMP_CACHE_BYTES)));
                          ^
In file included from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/include/linux/bitops.h:36:0,
                 from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/include/linux/kernel.h:10,
                 from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/include/linux/uio.h:12,
                 from /home/user/dev/openwrt/build_dir/target-mipsel_24kc_musl-1.1.16/linux-ramips_rt305x/linux-4.4.92/include/linux/socket.h:7,
                 from /home/user/dev/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/include/linux/if.h:24,
                 from switch_rt305x.c:7,
                 from switch.c:7: