Building serial_cs.ko (PXA serial 8250 conflict)

Nathan M ngmlinux at gmail.com
Wed Aug 24 13:19:20 EDT 2005


Here's a patch I wrote that attempts to change the base minor
namespace of the pxa serial driver to 65 and the naming to "ttySA"
from "ttyS" such as to not conflict with other 8250/serial_cs drivers.
 I'm not sure if I've done this correctly and even if I have, I'm
concerned I may break my console which currently is set as:
===code===========================================
Kernel command line: root=/dev/nand console=ttyS0,38400
==================================================

Here is the patch:
===code===========================================
Support for pxa-serial and 8250/serial_cs coexistance.




#
# This patch will modify the default namespace and name
# for the pxa.c serial driver such as to prevent a
# conflict with other 8250/serial_cs drivers.
#



--- linux-2.6/drivers/serial/serial_core.c~pxa-serial

+++ linux-2.6/drivers/serial/serial_core.c

@@ -1901,7 +1901,7 @@

 static inline void

 uart_report_port(struct uart_driver *drv, struct uart_port *port)

 {

-	printk("%s%d", drv->dev_name, port->line);

+	printk("%s%d", drv->dev_name, port->line + drv->name_base);

 	printk(" at ");

 	switch (port->iotype) {

 	case UPIO_PORT:

@@ -2070,6 +2070,7 @@

 	normal->driver_name	= drv->driver_name;

 	normal->devfs_name	= drv->devfs_name;

 	normal->name		= drv->dev_name;

+	normal->name_base	= drv->name_base;

 	normal->major		= drv->major;

 	normal->minor_start	= drv->minor;

 	normal->type		= TTY_DRIVER_TYPE_SERIAL;

--- linux-2.6/include/linux/serial_core.h~pxa-serial

+++ linux-2.6/include/linux/serial_core.h

@@ -299,6 +299,7 @@

 	const char		*driver_name;

 	const char		*dev_name;

 	const char		*devfs_name;

+	int			 name_base;

 	int			 major;

 	int			 minor;

 	int			 nr;

--- linux-2.6/drivers/serial/pxa.c~pxa-serial

+++ linux-2.6/drivers/serial/pxa.c

@@ -788,7 +788,7 @@

 

 static struct uart_driver serial_pxa_reg = {

 	.owner		= THIS_MODULE,

	.driver_name	= "PXA serial",

 	.devfs_name	= "tts/",

-	.dev_name	= "ttyS",
+	.dev_name	= "ttySA",

 	.major		= TTY_MAJOR,

+#ifdef CONFIG_SERIAL_PXA

-	.minor			= 64,
+	.minor			= 65 + 3,

+	.name_base		= 3,
+#else

- 	.minor			= 64,
+	.minor			= 65,

+#endif

 	.nr		= ARRAY_SIZE(serial_pxa_ports),
	.cons		= PXA_CONSOLE,
};
==================================================

Thanks.

-Nathan M.



More information about the linux-pcmcia mailing list