vserver 1.9.5.x5
[linux-2.6.git] / drivers / serial / 8250_pnp.c
index abbbe3f..18c58fb 100644 (file)
 #include <linux/pnp.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
-#include <linux/tty.h>
-#include <linux/serial.h>
-#include <linux/serialP.h>
 #include <linux/serial_core.h>
+#include <linux/bitops.h>
 
-#include <asm/bitops.h>
 #include <asm/byteorder.h>
-#include <asm/serial.h>
 
 #include "8250.h"
 
@@ -49,7 +45,7 @@ static const struct pnp_device_id pnp_dev_table[] = {
        /* Actiontec ISA PNP 56K X2 Fax Modem */
        {       "AEI1240",              0       },
        /* Rockwell 56K ACF II Fax+Data+Voice Modem */
-       {       "AKY1021",              SPCI_FL_NO_SHIRQ        },
+       {       "AKY1021",              0 /*SPCI_FL_NO_SHIRQ*/  },
        /* AZT3005 PnP SOUND DEVICE */
        {       "AZT4001",              0       },
        /* Best Data Products Inc. Smart One 336F PnP Modem */
@@ -254,6 +250,8 @@ static const struct pnp_device_id pnp_dev_table[] = {
        /* Kortex International */
        /* KORTEX 14400 Externe PnP */
        {       "ROK0100",              0       },
+       /* Rockwell 28.8 */
+       {       "ROK4120",              0       },
        /* Viking Components, Inc */
        /* Viking 28.8 INTERNAL Fax+Data+Voice PnP */
        {       "ROK4920",              0       },
@@ -293,6 +291,8 @@ static const struct pnp_device_id pnp_dev_table[] = {
        {       "USR0006",              0       },
        /* U.S. Robotics 33.6K Voice EXT PnP */
        {       "USR0007",              0       },
+       /* U.S. Robotics Courier V.Everything INT PnP */
+       {       "USR0009",              0       },
        /* U.S. Robotics 33.6K Voice INT PnP */
        {       "USR2002",              0       },
        /* U.S. Robotics 56K Voice INT PnP */
@@ -334,7 +334,7 @@ static char *modem_names[] __devinitdata = {
        "MODEM", "Modem", "modem", "FAX", "Fax", "fax",
        "56K", "56k", "K56", "33.6", "28.8", "14.4",
        "33,600", "28,800", "14,400", "33.600", "28.800", "14.400",
-       "33600", "28800", "14400", "V.90", "V.34", "V.32", 0
+       "33600", "28800", "14400", "V.90", "V.34", "V.32", NULL
 };
 
 static int __devinit check_name(char *name)
@@ -361,9 +361,6 @@ static int __devinit check_resources(struct pnp_option *option)
                            ((port->min == 0x2f8) ||
                             (port->min == 0x3f8) ||
                             (port->min == 0x2e8) ||
-#ifdef CONFIG_X86_PC9800
-                            (port->min == 0x8b0) ||
-#endif
                             (port->min == 0x3e8)))
                                return 1;
        }
@@ -399,38 +396,41 @@ static int __devinit serial_pnp_guess_board(struct pnp_dev *dev, int *flags)
 static int __devinit
 serial_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
 {
-       struct serial_struct serial_req;
+       struct uart_port port;
        int ret, line, flags = dev_id->driver_data;
+
        if (flags & UNKNOWN_DEV) {
                ret = serial_pnp_guess_board(dev, &flags);
                if (ret < 0)
                        return ret;
        }
-       memset(&serial_req, 0, sizeof(serial_req));
-       serial_req.irq = pnp_irq(dev,0);
-       serial_req.port = pnp_port_start(dev, 0);
-       if (HIGH_BITS_OFFSET)
-               serial_req.port = pnp_port_start(dev, 0) >> HIGH_BITS_OFFSET;
+
+       memset(&port, 0, sizeof(struct uart_port));
+       port.irq = pnp_irq(dev,0);
+       port.iobase = pnp_port_start(dev, 0);
+
 #ifdef SERIAL_DEBUG_PNP
        printk("Setup PNP port: port %x, irq %d, type %d\n",
-              serial_req.port, serial_req.irq, serial_req.io_type);
+              port.iobase, port.irq, port.iotype);
 #endif
 
-       serial_req.flags = UPF_SKIP_TEST | UPF_AUTOPROBE  | UPF_RESOURCES;
-       serial_req.baud_base = 115200;
-       line = register_serial(&serial_req);
+       port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
+       port.uartclk = 1843200;
+       port.dev = &dev->dev;
+
+       line = serial8250_register_port(&port);
 
        if (line >= 0)
-               pnp_set_drvdata(dev, (void *)(line + 1));
+               pnp_set_drvdata(dev, (void *)((long)line + 1));
        return line >= 0 ? 0 : -ENODEV;
 
 }
 
 static void __devexit serial_pnp_remove(struct pnp_dev * dev)
 {
-       int line = (int)pnp_get_drvdata(dev);
+       long line = (long)pnp_get_drvdata(dev);
        if (line)
-               unregister_serial(line - 1);
+               serial8250_unregister_port(line - 1);
 }
 
 static struct pnp_driver serial_pnp_driver = {