Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
05814450
Commit
05814450
authored
Jan 09, 2006
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge master.kernel.org:/home/rmk/linux-2.6-serial
parents
8e9c238c
a61c2d78
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
10 deletions
+31
-10
Documentation/kernel-parameters.txt
Documentation/kernel-parameters.txt
+2
-0
drivers/serial/8250.c
drivers/serial/8250.c
+18
-10
drivers/serial/Kconfig
drivers/serial/Kconfig
+10
-0
drivers/serial/serial_core.c
drivers/serial/serial_core.c
+1
-0
No files found.
Documentation/kernel-parameters.txt
View file @
05814450
...
@@ -998,6 +998,8 @@ running once the system is up.
...
@@ -998,6 +998,8 @@ running once the system is up.
nowb [ARM]
nowb [ARM]
nr_uarts= [SERIAL] maximum number of UARTs to be registered.
opl3= [HW,OSS]
opl3= [HW,OSS]
Format: <io>
Format: <io>
...
...
drivers/serial/8250.c
View file @
05814450
...
@@ -54,6 +54,8 @@
...
@@ -54,6 +54,8 @@
*/
*/
static
unsigned
int
share_irqs
=
SERIAL8250_SHARE_IRQS
;
static
unsigned
int
share_irqs
=
SERIAL8250_SHARE_IRQS
;
static
unsigned
int
nr_uarts
=
CONFIG_SERIAL_8250_RUNTIME_UARTS
;
/*
/*
* Debugging.
* Debugging.
*/
*/
...
@@ -2118,7 +2120,7 @@ static void __init serial8250_isa_init_ports(void)
...
@@ -2118,7 +2120,7 @@ static void __init serial8250_isa_init_ports(void)
return
;
return
;
first
=
0
;
first
=
0
;
for
(
i
=
0
;
i
<
UART_NR
;
i
++
)
{
for
(
i
=
0
;
i
<
nr_uarts
;
i
++
)
{
struct
uart_8250_port
*
up
=
&
serial8250_ports
[
i
];
struct
uart_8250_port
*
up
=
&
serial8250_ports
[
i
];
up
->
port
.
line
=
i
;
up
->
port
.
line
=
i
;
...
@@ -2137,7 +2139,7 @@ static void __init serial8250_isa_init_ports(void)
...
@@ -2137,7 +2139,7 @@ static void __init serial8250_isa_init_ports(void)
}
}
for
(
i
=
0
,
up
=
serial8250_ports
;
for
(
i
=
0
,
up
=
serial8250_ports
;
i
<
ARRAY_SIZE
(
old_serial_port
)
&&
i
<
UART_NR
;
i
<
ARRAY_SIZE
(
old_serial_port
)
&&
i
<
nr_uarts
;
i
++
,
up
++
)
{
i
++
,
up
++
)
{
up
->
port
.
iobase
=
old_serial_port
[
i
].
port
;
up
->
port
.
iobase
=
old_serial_port
[
i
].
port
;
up
->
port
.
irq
=
irq_canonicalize
(
old_serial_port
[
i
].
irq
);
up
->
port
.
irq
=
irq_canonicalize
(
old_serial_port
[
i
].
irq
);
...
@@ -2159,7 +2161,7 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
...
@@ -2159,7 +2161,7 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
serial8250_isa_init_ports
();
serial8250_isa_init_ports
();
for
(
i
=
0
;
i
<
UART_NR
;
i
++
)
{
for
(
i
=
0
;
i
<
nr_uarts
;
i
++
)
{
struct
uart_8250_port
*
up
=
&
serial8250_ports
[
i
];
struct
uart_8250_port
*
up
=
&
serial8250_ports
[
i
];
up
->
port
.
dev
=
dev
;
up
->
port
.
dev
=
dev
;
...
@@ -2262,7 +2264,7 @@ static int serial8250_console_setup(struct console *co, char *options)
...
@@ -2262,7 +2264,7 @@ static int serial8250_console_setup(struct console *co, char *options)
* if so, search for the first available port that does have
* if so, search for the first available port that does have
* console support.
* console support.
*/
*/
if
(
co
->
index
>=
UART_NR
)
if
(
co
->
index
>=
nr_uarts
)
co
->
index
=
0
;
co
->
index
=
0
;
port
=
&
serial8250_ports
[
co
->
index
].
port
;
port
=
&
serial8250_ports
[
co
->
index
].
port
;
if
(
!
port
->
iobase
&&
!
port
->
membase
)
if
(
!
port
->
iobase
&&
!
port
->
membase
)
...
@@ -2298,7 +2300,7 @@ static int __init find_port(struct uart_port *p)
...
@@ -2298,7 +2300,7 @@ static int __init find_port(struct uart_port *p)
int
line
;
int
line
;
struct
uart_port
*
port
;
struct
uart_port
*
port
;
for
(
line
=
0
;
line
<
UART_NR
;
line
++
)
{
for
(
line
=
0
;
line
<
nr_uarts
;
line
++
)
{
port
=
&
serial8250_ports
[
line
].
port
;
port
=
&
serial8250_ports
[
line
].
port
;
if
(
uart_match_port
(
p
,
port
))
if
(
uart_match_port
(
p
,
port
))
return
line
;
return
line
;
...
@@ -2420,7 +2422,7 @@ static int __devexit serial8250_remove(struct platform_device *dev)
...
@@ -2420,7 +2422,7 @@ static int __devexit serial8250_remove(struct platform_device *dev)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
UART_NR
;
i
++
)
{
for
(
i
=
0
;
i
<
nr_uarts
;
i
++
)
{
struct
uart_8250_port
*
up
=
&
serial8250_ports
[
i
];
struct
uart_8250_port
*
up
=
&
serial8250_ports
[
i
];
if
(
up
->
port
.
dev
==
&
dev
->
dev
)
if
(
up
->
port
.
dev
==
&
dev
->
dev
)
...
@@ -2487,7 +2489,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
...
@@ -2487,7 +2489,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
/*
/*
* First, find a port entry which matches.
* First, find a port entry which matches.
*/
*/
for
(
i
=
0
;
i
<
UART_NR
;
i
++
)
for
(
i
=
0
;
i
<
nr_uarts
;
i
++
)
if
(
uart_match_port
(
&
serial8250_ports
[
i
].
port
,
port
))
if
(
uart_match_port
(
&
serial8250_ports
[
i
].
port
,
port
))
return
&
serial8250_ports
[
i
];
return
&
serial8250_ports
[
i
];
...
@@ -2496,7 +2498,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
...
@@ -2496,7 +2498,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
* free entry. We look for one which hasn't been previously
* free entry. We look for one which hasn't been previously
* used (indicated by zero iobase).
* used (indicated by zero iobase).
*/
*/
for
(
i
=
0
;
i
<
UART_NR
;
i
++
)
for
(
i
=
0
;
i
<
nr_uarts
;
i
++
)
if
(
serial8250_ports
[
i
].
port
.
type
==
PORT_UNKNOWN
&&
if
(
serial8250_ports
[
i
].
port
.
type
==
PORT_UNKNOWN
&&
serial8250_ports
[
i
].
port
.
iobase
==
0
)
serial8250_ports
[
i
].
port
.
iobase
==
0
)
return
&
serial8250_ports
[
i
];
return
&
serial8250_ports
[
i
];
...
@@ -2505,7 +2507,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
...
@@ -2505,7 +2507,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
* That also failed. Last resort is to find any entry which
* That also failed. Last resort is to find any entry which
* doesn't have a real port associated with it.
* doesn't have a real port associated with it.
*/
*/
for
(
i
=
0
;
i
<
UART_NR
;
i
++
)
for
(
i
=
0
;
i
<
nr_uarts
;
i
++
)
if
(
serial8250_ports
[
i
].
port
.
type
==
PORT_UNKNOWN
)
if
(
serial8250_ports
[
i
].
port
.
type
==
PORT_UNKNOWN
)
return
&
serial8250_ports
[
i
];
return
&
serial8250_ports
[
i
];
...
@@ -2590,8 +2592,11 @@ static int __init serial8250_init(void)
...
@@ -2590,8 +2592,11 @@ static int __init serial8250_init(void)
{
{
int
ret
,
i
;
int
ret
,
i
;
if
(
nr_uarts
>
UART_NR
)
nr_uarts
=
UART_NR
;
printk
(
KERN_INFO
"Serial: 8250/16550 driver $Revision: 1.90 $ "
printk
(
KERN_INFO
"Serial: 8250/16550 driver $Revision: 1.90 $ "
"%d ports, IRQ sharing %sabled
\n
"
,
(
int
)
UART_NR
,
"%d ports, IRQ sharing %sabled
\n
"
,
nr_uarts
,
share_irqs
?
"en"
:
"dis"
);
share_irqs
?
"en"
:
"dis"
);
for
(
i
=
0
;
i
<
NR_IRQS
;
i
++
)
for
(
i
=
0
;
i
<
NR_IRQS
;
i
++
)
...
@@ -2651,6 +2656,9 @@ module_param(share_irqs, uint, 0644);
...
@@ -2651,6 +2656,9 @@ module_param(share_irqs, uint, 0644);
MODULE_PARM_DESC
(
share_irqs
,
"Share IRQs with other non-8250/16x50 devices"
MODULE_PARM_DESC
(
share_irqs
,
"Share IRQs with other non-8250/16x50 devices"
" (unsafe)"
);
" (unsafe)"
);
module_param
(
nr_uarts
,
uint
,
0644
);
MODULE_PARM_DESC
(
nr_uarts
,
"Maximum number of UARTs supported. (1-"
__MODULE_STRING
(
CONFIG_SERIAL_8250_NR_UARTS
)
")"
);
#ifdef CONFIG_SERIAL_8250_RSA
#ifdef CONFIG_SERIAL_8250_RSA
module_param_array
(
probe_rsa
,
ulong
,
&
probe_rsa_count
,
0444
);
module_param_array
(
probe_rsa
,
ulong
,
&
probe_rsa_count
,
0444
);
MODULE_PARM_DESC
(
probe_rsa
,
"Probe I/O ports for RSA"
);
MODULE_PARM_DESC
(
probe_rsa
,
"Probe I/O ports for RSA"
);
...
...
drivers/serial/Kconfig
View file @
05814450
...
@@ -95,6 +95,16 @@ config SERIAL_8250_NR_UARTS
...
@@ -95,6 +95,16 @@ config SERIAL_8250_NR_UARTS
PCI enumeration and any ports that may be added at run-time
PCI enumeration and any ports that may be added at run-time
via hot-plug, or any ISA multi-port serial cards.
via hot-plug, or any ISA multi-port serial cards.
config SERIAL_8250_RUNTIME_UARTS
int "Number of 8250/16550 serial ports to register at runtime"
depends on SERIAL_8250
default "4"
help
Set this to the maximum number of serial ports you want
the kernel to register at boot time. This can be overriden
with the module parameter "nr_uarts", or boot-time parameter
8250.nr_uarts
config SERIAL_8250_EXTENDED
config SERIAL_8250_EXTENDED
bool "Extended 8250/16550 serial driver options"
bool "Extended 8250/16550 serial driver options"
depends on SERIAL_8250
depends on SERIAL_8250
...
...
drivers/serial/serial_core.c
View file @
05814450
...
@@ -1440,6 +1440,7 @@ uart_block_til_ready(struct file *filp, struct uart_state *state)
...
@@ -1440,6 +1440,7 @@ uart_block_til_ready(struct file *filp, struct uart_state *state)
* modem is ready for us.
* modem is ready for us.
*/
*/
spin_lock_irq
(
&
port
->
lock
);
spin_lock_irq
(
&
port
->
lock
);
port
->
ops
->
enable_ms
(
port
);
mctrl
=
port
->
ops
->
get_mctrl
(
port
);
mctrl
=
port
->
ops
->
get_mctrl
(
port
);
spin_unlock_irq
(
&
port
->
lock
);
spin_unlock_irq
(
&
port
->
lock
);
if
(
mctrl
&
TIOCM_CAR
)
if
(
mctrl
&
TIOCM_CAR
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment