Friday, April 3, 2009

Need some DDT

Although it wasn't so bad getting it to transmit and receive data, getting the driver to behave stably has been elusive. In particular, the locking scheme is not working. Code modifications are under way to base the locking scheme off of the pl2302 USB-serial driver. mos7703 currently uses mutexes, but I'm converting the code to spinlocks since this was generally recommended to me anyway. I also posted on linuxquestions.org hoping to get someone to take a look at it, but didn't recieve any responses. See it at http://www.linuxquestions.org/questions/linux-kernel-70/mos7703-serial-driver-714933/ Once I get more of a reasonably solid driver working, I'll post to the Linux Kernel Mailling List.
I've also recieved techniques for keeping compatibility across kernels. I've managed to clean up the code and use less preprocessor logic. This mostly involves using some high level wrapper functions for different kernels, and then using a few inline core functions to do the actual logic. Also trying to clean up some of the ugly macros around this.

1 comment:

  1. Hello,

    Trying to install in Ubuntu 8.10, kernel 2.6.27-11.

    Make yields this:

    make -C /lib/modules/2.6.27-11-generic/build -I/lib/modules/2.6.27-11-generic/build/drivers/usb/serial -Wall -Werror SUBDIRS=/home/jeffrey/Downloads/mos7703-0.2.1.1 modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.27-11-generic'
    CC [M] /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.o
    cc1: warnings being treated as errors
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c: In function ‘calc_baud_rate_divisor’:
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c:425: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c: In function ‘mos7703_write’:
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c:1602: error: cast from pointer to integer of different size
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c:1635: error: cast from pointer to integer of different size
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c:1635: error: cast from pointer to integer of different size
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c: In function ‘mos7703_bulk_in_callback’:
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c:1800: error: implicit declaration of function ‘tty_port_tty_get’
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c:1800: error: assignment makes pointer from integer without a cast
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c: In function ‘mos7703_init’:
    /home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.c:1907: error: cast to pointer from integer of different size
    make[2]: *** [/home/jeffrey/Downloads/mos7703-0.2.1.1/mos7703.o] Error 1
    make[1]: *** [_module_/home/jeffrey/Downloads/mos7703-0.2.1.1] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-11-generic'
    make: *** [default] Error 2

    ReplyDelete