The Moxa UART interface driver is for moxa DA-820 embedded computer. It creates the /dev/moxa_interface_8250 the entry point for setting the UART RS-232/422/485 interface. 
You can use the mx_setinterface_8205 to set the working mode.

1. Setting the path to your kernel source tree in Makefile.

	To compile this driver, you should modify the KDIR to the path of your kernel source. We configure the KDIR in Makefile for configuring the path of the kernel source.

	The original KDIR

	KDIR:=$(ROOTDIR)/$(LINUXDIR)

	The new KDIR

	KDIR=/media/Home/work/x86/kernel/linux-source-3.2

2. Compile your kernel before makeing the module.

3. Compile the driver after your kernel source has compiled.

	$ cd /home/moxa/git/DA820/modules/moxa_uart8250_mode
	$ make
	  Building modules, stage 2.
	  MODPOST 2 modules
	  CC      /home/moxa/git/DA820/modules/moxa_uart8250_mode/moxa_uart_mode.o
	  LD [M]  /home/moxa/git/DA820/modules/moxa_uart8250_mode/moxa_uart_mode.ko

4. Load this driver

	You can copy it to target and load it.

	$ insmod /PATH/TO/moxa_uart_mode.ko

5. Uset the setuartmode utility to set/get the UART mode

	To set the first serial port as RS-232 mode

	root@Moxa:~# setuartmode -n 1 -s 0

	To set the first serial port as RS-485-2W mode

	root@Moxa:~# setuartmode -n 1 -s 1

	To set the first serial port as RS-422/485-4W mode

	root@Moxa:~# setuartmode -n 1 -s 2

	To get the first serial port mode.

	root@Moxa:~# setuartmode  -n 1 -g

	To set the second serial port as RS-232 mode
	
	root@Moxa:~# setuartmode -n 2 -s 0

	To set the second serial port as RS-485-2W mode

	root@Moxa:~# setuartmode -n 2 -s 1

	To set the second serial port as RS-422/485-4W mode

	root@Moxa:~# setuartmode -n 2 -s 2

	To get the second serial port mode.

	root@Moxa:~# setuartmode  -n 2 -g

