RE: Intel536ep and kernel 2.6.26

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2008/7/21 jayjwa <jayjwa@xxxxxxxxxxx> wrote:

> I've been using the Intel 536ep for quite some time now.
> It requires a kernel module to work. The source has been
> getting updated each time the kernel changes and breaks
> something, but so far no changes to allow the module to
> continue to compile under the latest kernel, 2.6.26 (at
> the time of this writing). As I use this modem to connect
> to the Internet, if I can't get the modem working again
> I'm stuck not being able to update the kernel.

Hello, Jayjwa -

I just upgraded to kernel 2.6.26, and found the same problems!


The attached patch seems to be working for me so far, but I am
by no means a kernel module guy, so any feedback is welcome...

Regards,
 - Jeff
diff -ur ../intel-536EP-2.56.76.0/coredrv/coredrv.c ./coredrv/coredrv.c
--- ../intel-536EP-2.56.76.0/coredrv/coredrv.c	2007-09-25 01:36:16.000000000 -0500
+++ ./coredrv/coredrv.c	2008-08-11 09:55:29.000000000 -0500
@@ -741,9 +741,15 @@
    return(persist_hamproc_read(page));
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+#define PROC_ROOT_ADDR NULL
+#else
+#define PROC_ROOT_ADDR &proc_root
+#endif
+
 int create_hamproc(void)
 {
-   hamproc = create_proc_entry("ham", S_IFREG | S_IRUGO, &proc_root);
+   hamproc = create_proc_entry("ham", S_IFREG | S_IRUGO, PROC_ROOT_ADDR);
    if(hamproc == NULL) return -ENOMEM;
    hamproc->read_proc = hamproc_read;
    hamproc->write_proc = hamproc_write;
@@ -751,7 +757,7 @@
 }
 void detach_hamproc(void)
 {
-   remove_proc_entry("ham", &proc_root);
+   remove_proc_entry("ham", PROC_ROOT_ADDR);
 }
 
 
Only in ./coredrv: modules.order
diff -ur ../intel-536EP-2.56.76.0/coredrv/softserial.c ./coredrv/softserial.c
--- ../intel-536EP-2.56.76.0/coredrv/softserial.c	2007-09-25 01:56:55.000000000 -0500
+++ ./coredrv/softserial.c	2008-08-11 09:54:16.000000000 -0500
@@ -103,6 +103,39 @@
 static int             softserial_refcount;
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+static const struct tty_operations tty_ops = {
+  softserial_open,
+  softserial_close,
+  softserial_write,
+  softserial_put_char,
+  softserial_flush_chars,
+  softserial_write_room,
+  softserial_chars_in_buffer,
+  softserial_ioctl,
+  NULL, /*compat_ioctl*/
+  softserial_set_termios,
+  softserial_throttle,
+  softserial_unthrottle,
+  softserial_stop,
+  softserial_start,
+  softserial_hangup,
+  softserial_break,
+  softserial_flush_buffer,
+  softserial_set_ldisc,
+  softserial_wait_until_sent,
+  softserial_send_xchar,
+  NULL, /*read_proc*/
+  NULL, /*tiocmget*/
+  NULL, /*tiocmset*/
+#ifdef CONFIG_CONSOLE_POLL
+  NULL, /*poll_init*/
+  NULL, /*poll_get_char*/
+  NULL  /*poll_put_char*/
+#endif
+};
+#endif 
+
 int softserial_register_tty(void)
 {
    int rc;
@@ -131,7 +164,9 @@
                                                   HUPCL  |\
                                                   CLOCAL;
    G.softserial_tty_driver.magic           = TTY_DRIVER_MAGIC;
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+   G.softserial_tty_driver.ops=&tty_ops;
+#else
    G.softserial_tty_driver.open            = softserial_open;
    G.softserial_tty_driver.close           = softserial_close;
    G.softserial_tty_driver.write           = softserial_write;
@@ -151,6 +186,7 @@
    G.softserial_tty_driver.break_ctl       = softserial_break;
    G.softserial_tty_driver.wait_until_sent = softserial_wait_until_sent;
    G.softserial_tty_driver.set_ldisc       = softserial_set_ldisc;
+#endif
    rc = tty_register_driver(&(G.softserial_tty_driver));
    if(rc)
    {
diff -ur ../intel-536EP-2.56.76.0/coredrv/softserial.h ./coredrv/softserial.h
--- ../intel-536EP-2.56.76.0/coredrv/softserial.h	2007-02-23 06:32:12.000000000 -0600
+++ ./coredrv/softserial.h	2008-08-11 09:54:36.000000000 -0500
@@ -88,7 +88,11 @@
 void softserial_send_xchar     (struct tty_struct*, char);
 void softserial_close          (struct tty_struct*, struct file*);
 int  softserial_open           (struct tty_struct*, struct file*);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+int softserial_put_char       (struct tty_struct*, unsigned char);
+#else
 void softserial_put_char       (struct tty_struct*, unsigned char);
+#endif
 void softserial_set_termios    (struct tty_struct*, struct ktermios*);
 int  softserial_write	       (struct tty_struct * tty,
                       const unsigned char *buf, int count);
diff -ur ../intel-536EP-2.56.76.0/coredrv/softserial_io.c ./coredrv/softserial_io.c
--- ../intel-536EP-2.56.76.0/coredrv/softserial_io.c	2007-02-23 02:46:41.000000000 -0600
+++ ./coredrv/softserial_io.c	2008-08-11 10:00:06.000000000 -0500
@@ -38,6 +38,17 @@
 extern struct global G;
 
 //=============================================================================
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+int softserial_put_char(struct tty_struct* ptty,
+                        unsigned char ch)
+{
+#if defined (DEBUG_LINUX)
+   printk("softserial:softserial_put_char()\n");
+#endif
+   G.softcore.putchar(ch);
+   return 1;
+}
+#else
 void softserial_put_char(struct tty_struct* ptty,
                         unsigned char ch)
 {
@@ -46,6 +57,7 @@
 #endif
    G.softcore.putchar(ch);
 }
+#endif
 
 //=============================================================================
 void softserial_flush_chars(struct tty_struct* ptty)

[Index of Archives]     [Linux Media Development]     [Asterisk]     [DCCP]     [Netdev]     [X.org]     [Xfree86]     [Fedora Women]     [Linux USB]

  Powered by Linux