MOSCHIP 9865 serial driver

There seem to be floating around some PCI serial adapter cards using a MOSCHIP 9865 chipset. They have a Linux driver inside the included CD but it is a bit outdated and won't compile under recent versions of the kernel. The latest version referenced in the source code seems to be 2.6.20.

These are the error messages:

/home/izto/src/MCS9865_Linux/mcs9865.c: In function 'receive_chars':
/home/izto/src/MCS9865_Linux/mcs9865.c:622: error: 'struct uart_info' has no member named 'tty'
/home/izto/src/MCS9865_Linux/mcs9865.c: In function 'receive_chars_dma_done':
/home/izto/src/MCS9865_Linux/mcs9865.c:852: error: 'struct uart_info' has no member named 'tty'
/home/izto/src/MCS9865_Linux/mcs9865.c: In function 'serial9865_handle_port':
/home/izto/src/MCS9865_Linux/mcs9865.c:957: error: 'struct uart_info' has no member named 'tty'
/home/izto/src/MCS9865_Linux/mcs9865.c: In function 'serial9865_probe':
/home/izto/src/MCS9865_Linux/mcs9865.c:2068: error: 'SA_SHIRQ' undeclared (first use in this function)
/home/izto/src/MCS9865_Linux/mcs9865.c:2068: error: (Each undeclared identifier is reported only once
/home/izto/src/MCS9865_Linux/mcs9865.c:2068: error: for each function it appears in.)

After googling around I found this thread (http://forums.linuxmint.com/viewtopic.php?f=49&t=29576&p=202487) and a patch for a related driver (MCS9900?).

The author of the original patch points out it seems to be just a matter of some renamed constant names and structure members, so I then adapted his patch for the source code I got from the driver CD for the card and applied it. Seems to work fine, YMMV. The files are here:

This is the dmesg output when loading the driver:

mcs9865-serial 0000:04:05.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
0000:04:05.0: ttyD0 at I/O 0xb130 (irq = 20) is a mcs9865-serial
mcs9865-serial 0000:04:05.1: PCI INT B -> GSI 21 (level, low) -> IRQ 21
0000:04:05.1: ttyD1 at I/O 0xb120 (irq = 21) is a mcs9865-serial

Oh, in case you're wondering:

ttyD0 has major number 201, minor 0
ttyD1 has major number 201, minor 1

A udev-enabled system should create the device files automatically but if you can't find them this should do the trick:

mknod /dev/ttyD0 c 201 0
mknod /dev/ttyD1 c 201 1


28-nov-2009
izto [] asic - linux . com . mx.