NetMos 9865 || 6 x serial port PCI card || What is /lib/modules/$(uname -r)/build ?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: At the 100th Meridian where the great plains begin
Distribution: Debian Testing on T60 laptop
Posts: 105
Original Poster
Rep:
Quote:
Originally Posted by nstamoul
So did anyone succed in using all 6 ports of the controller?
It seems at least two of us have had success at that. I've succeeded in getting six to work for one card and two for a second card. What's your procedure for installing the driver? What kernel are you using? Have you also tried looking at output of lspci, setserial, lshw to see if that gives any clues?
I did actually get more than 2 ports working .
I pathed the 1.06 version,since the other one did not load the mcs9865-isa module corectly and I finaly have at least 4 ports working (did not try the other 2).
2.6.32-3 debian vanilla.
Location: At the 100th Meridian where the great plains begin
Distribution: Debian Testing on T60 laptop
Posts: 105
Original Poster
Rep:
You guys got one error in addition to mine. I didn't have any issues with struct uart_info having its members renamed. Thanks dblade for posting your patch about that.
Liquid_Squelch, if the patch isn't working then you can just edit the file by hand. It seems there are only 4 lines that you need to change. Try the following:
Back up mcs9865.c:
Code:
$cp mcs9865.c mcs9865.c-saved
Open mcs9865.c with a text editor (e.g. emacs) and
replace the three occurrences of:
Code:
up->port.info->tty
(which are on lines on lines 622, 852 and 957 in my versions of the file) with:
Code:
up->port.info->port.tty
replace the occurrence of:
Code:
SA_SHIRQ
(which is on line 2068 in my version of the file) with:
Code:
IRQF_SHARED
Not sure if you're used to using text editors in GNU/Linux (since you say you're new to Linux). If not, then the search command key binding in emacs is <ctrl>-s and the search-and-replace binding is <alt>-<shift>-%
Once you've taken care of that, try doing make again.
looks like the patch file has carriage returns (^M) in it. I have no idea why, but you could use:
dos2unix
-OR-
vi editor, command :1,$s/<ctrl-v><ctrl-m>//g
-OR-
sed -i 's/<ctrl-v><ctrl-m>//g' patch.txt
to remove them.
(where <ctrl-v> and <ctrl-m> mean to actually press those keys)
EDIT: FYI
I had to see what was going on with this. Even after I removed the ^M 's from the patch (new file attached) it wouldn't apply until I removed the ^M's from mcs9865.c file. They have no business being in there but apparently the driver was packaged up on windows...
Last edited by dblade; 06-08-2010 at 06:10 PM.
Reason: new info
I was finally able to make and install. I manually made the changes, and then removed all of the carriage returns.. I also performed a chmod to all of the files to make sure there were no issue..
Now, my problem, is I can 'cat' some of the ports..
I can see the ports listed, and I am assuming ttyS2 - S7 are the new ports.
# setserial -g /dev/tty[SD]*
/dev/ttyD0, UART: 16550A, Port: 0xdcf8, IRQ: 17
/dev/ttyD1, UART: 16550A, Port: 0xdcf0, IRQ: 18
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
/dev/ttyS4, UART: 16550A, Port: 0xdce8, IRQ: 19
/dev/ttyS5, UART: 16550A, Port: 0xdcd8, IRQ: 19
/dev/ttyS6, UART: 16550A, Port: 0xdcc8, IRQ: 19
/dev/ttyS7, UART: 16550A, Port: 0xdcb8, IRQ: 19
When I try and 'cat' the ports ttyS2, ttyS3, ttyD0, or ttyD1, I receive an error:
This tells me that the piggy back com ports are working. It is the physical 2 on board serial cards are UART unknown. I tried setting UART to 16550A but that still gave me the error - so I change the IRQ to 19.. Still no go. Any pointers to get the last 2 serial cards up and running?
THANK YOU AGAIN for all who have helped me out.. we're at the home stretch!
Last edited by Liquid_Squelch; 06-09-2010 at 10:56 PM.
also on 33 kernel taked errors:
1)"error: 'struct uart_port' has no member named 'info'"
2)"error: 'struct uart_state' has no member named 'delta_msr_wait'"
solutions:
1) replace "port.info" to "port.state"
2) replace "delta_msr_wait" to "port.delta_msr_wait"
full patched version of mcs9865.c at pastebin.com/RaRqpF15
arkhnchul, sounds similar to the changes in the patch attached to post #11.
If you wanted to take the time to create a stand alone/complete patch file for 2.6.33, just create a copy of the original source file [1] before any editing (calling it something like mcs9865.c.orig) and after doing all of the editing changes to get it work, do a "diff -u msc9865.c.orig mcs9865.c > mcs9865_patch2.6.33.x.txt" (or similar).
[1] If you do decide to do it, also make sure that you get rid of the carriage returns (^M) in the original source file first. That caused issues with the patches I had posted as recently discussed.
Usually when a patch completely fails, there are one or more of several reasons:
1 -- the patch is for a significantly different version of the source code (or the source code has changed since the patch was made).
2 -- you aren't inside the correct directory when you apply the patch.
4 -- patch is in the wrong format to begin with.
3 -- some other reason.
I find it odd that it says "Stripping trailing CRs from patch." - I haven't seen that in the past.
Maybe, assuming the problem is not #1 or #2 or #4 reason I suggested for the failure, try increasing the `fuzz factor` for patch, it might succeed? Or it might not..
post 18 is the same problem and I've provided a solution in post 20. I've also removed the patch in post #9. You didn't say what kernel you are on, but maybe try the patch in post 20.
For a kernel .32 and newer I'd try out the patch in post #11.
Last edited by dblade; 08-18-2010 at 12:33 AM.
Reason: more info
Wow, fast responses. Thanks! I'll try dblade's ideas first and then if I have to I'll move on to grapefruitgirl's ideas. I'll let everyone know what happens.
Sorry to resurrect an old thread but I have this same problem. My card is a Syba SY-PCI15001 6-port with the MOSCHIP 9865. I've acquired three drivers for it. The oldest was supplied with the CD that came with the card. More recent is the one I downloaded from Syba's website.
It looked as if this latest version from MOSCHIP would not require patching. The readme says it supports kernels 2.6.22 to 2.6.33. I am using LinuxMCE based upon Kubuntu 8.10 with the 2.6.27.17 kernel so I thought I would be OK. I looked at the patch and saw that it was just making a few syntax modifications to match kernel updates. Looking at the most recent MCS9865.c file, it does check for the kernel version in order to supply the correct syntax. Here is an example:
Code:
//Helper function used in ISR to receive the the charecters from the UART
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
static _INLINE_ void receive_chars(struct uart_9865_port *up, u8 *status)
#else
static _INLINE_ void receive_chars(struct uart_9865_port *up, u8 *status, struct pt_regs *regs)
#endif
{
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,26))
struct tty_struct *tty = up->port.info->tty;
#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)&&(LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,31)))
struct tty_struct *tty = up->port.info->port.tty;
#else
struct tty_struct *tty = up->port.state->port.tty;
#endif
However when I try to install I get errors.
Code:
js@higgins:~/MCS9865_V1.0.0.9$ ls
Makefile mcs9865.c mcs9865-isa.c mcs9865_isa_installation
mcs9865 mcs9865.h mcs9865-isa.h MCS9865_Linux_UM_Ver1.1.pdf
js@higgins:~/MCS9865_V1.0.0.9$ make
rm -f *.mod.c *.o *.ko .*.cmd *.symvers
make -C /lib/modules/2.6.27-17-generic/build/ SUBDIRS=/home/js/MCS9865_V1.0.0.9modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-17-generic'
CC [M] /home/js/MCS9865_V1.0.0.9/mcs9865.o
/home/js/MCS9865_V1.0.0.9/mcs9865.c: In function ‘receive_chars’:
/home/js/MCS9865_V1.0.0.9/mcs9865.c:644: warning: comparison of distinct pointer types lacks a cast
/home/js/MCS9865_V1.0.0.9/mcs9865.c:718: warning: comparison of distinct pointer types lacks a cast
CC [M] /home/js/MCS9865_V1.0.0.9/mcs9865-isa.o
Building modules, stage 2.
MODPOST 2 modules
CC /home/js/MCS9865_V1.0.0.9/mcs9865-isa.mod.o
LD [M] /home/js/MCS9865_V1.0.0.9/mcs9865-isa.ko
CC /home/js/MCS9865_V1.0.0.9/mcs9865.mod.o
LD [M] /home/js/MCS9865_V1.0.0.9/mcs9865.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-17-generic'
js@higgins:~/MCS9865_V1.0.0.9$ sudo make install
[sudo] password for js:
cp mcs9865.ko mcs9865-isa.ko /lib/modules/2.6.27-17-generic/kernel/drivers/serial/
depmod -A
chmod +x mcs9865
cp mcs9865 /etc/init.d/
ln -s /etc/init.d/mcs9865 /etc/rc.d/rc3.d/Smcs9865 || true
ln: creating symbolic link `/etc/rc.d/rc3.d/Smcs9865': No such file or directory
ln -s /etc/init.d/mcs9865 /etc/rc.d/rc5.d/Smcs9865 || true
ln: creating symbolic link `/etc/rc.d/rc5.d/Smcs9865': No such file or directory
modprobe mcs9865
modprobe mcs9865-isa
js@higgins:~/MCS9865_V1.0.0.9$
Does anyone know what this means or how to get rid of it?
"warning: comparison of distinct pointer types lacks a cast"
This card is working now for Debian (Ubuntu, Kubuntu). Here is the procedure:
1. download MCS9865_V1.0.0.11. driver from MOSCHIP and extract
2. open terminal and change to the newly created directory
3. "make" (no sudo required)
4. copy mcs9865.ko and mcs9865-isa.ko to /lib/modules/pick-your-kernel-version/kernel/drivers/serial
5. edit /etc/modules and add a line "mcs9865"
6. "depmod -a"
7. reboot
The only warning "comparison of distinct pointer types lacks a cast" during make but that is not a show stopper.
Location: At the 100th Meridian where the great plains begin
Distribution: Debian Testing on T60 laptop
Posts: 105
Original Poster
Rep:
I did get all ports on both of my cards to work so I thought I'd mention that. I followed GrapefruiTgirl's instructions and it was pretty easy. Thanks GrapefruiTgirl for your help. My kernel is 2.6.25-14.fc9.i686 (it's no longer a Debian one as stated in a previous post) and I'm using legacy grub (GNU GRUB 0.97). Note this is quite an old kernel and an old version of grub. I just needed to include 8250.nr_uarts=8 in my kernel boot line. Note that nr_uarts=8 doesn't seem to work.
So it's just a matter of telling the kernel at boot time how many serial ports to allow for, and then in my case I now have the following serial port devices working: /dev/ttyD0, /dev/ttyD1, /dev/ttyD2, /dev/ttyD3, /dev/ttyS0, /dev/ttyS1, /dev/ttyS2, /dev/ttyS3, /dev/ttyS4, /dev/ttyS5, /dev/ttyS6, /dev/ttyS7. It's interesting you only need to specify 8250.nr_uarts=8 for these cards even though there are actually 12 ports in total that are created. I'm thinking perhaps the driver takes care of the remaining 4 by creating the /dev/ttyD[1-4] devices.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.