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
nexedi
linux
Commits
1ae23b0d
Commit
1ae23b0d
authored
Mar 11, 2003
by
Russell King
Committed by
Linus Torvalds
Mar 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SERIAL] Add uart_console(port) macro.
parent
dcb96e76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
drivers/serial/core.c
drivers/serial/core.c
+15
-12
No files found.
drivers/serial/core.c
View file @
1ae23b0d
...
...
@@ -52,6 +52,12 @@ static DECLARE_MUTEX(port_sem);
#define uart_users(state) ((state)->count + ((state)->info ? (state)->info->blocked_open : 0))
#ifdef CONFIG_SERIAL_CORE_CONSOLE
#define uart_console(port) ((port)->cons && (port)->cons->index == (port)->line)
#else
#define uart_console(port) (0)
#endif
static
void
uart_change_speed
(
struct
uart_state
*
state
,
struct
termios
*
old_termios
);
static
void
uart_wait_until_sent
(
struct
tty_struct
*
tty
,
int
timeout
);
static
void
uart_change_pm
(
struct
uart_state
*
state
,
int
pm_state
);
...
...
@@ -1284,7 +1290,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
schedule_timeout
(
state
->
close_delay
);
set_current_state
(
TASK_RUNNING
);
}
}
else
if
(
!
port
->
cons
||
port
->
cons
->
index
!=
port
->
line
)
{
}
else
if
(
!
uart_console
(
port
)
)
{
uart_change_pm
(
state
,
3
);
}
...
...
@@ -1392,15 +1398,12 @@ static void uart_hangup(struct tty_struct *tty)
static
void
uart_update_termios
(
struct
uart_state
*
state
)
{
struct
tty_struct
*
tty
=
state
->
info
->
tty
;
struct
uart_port
*
port
=
state
->
port
;
#ifdef CONFIG_SERIAL_CORE_CONSOLE
struct
console
*
c
=
state
->
port
->
cons
;
if
(
c
&&
c
->
cflag
&&
c
->
index
==
state
->
port
->
line
)
{
tty
->
termios
->
c_cflag
=
c
->
cflag
;
c
->
cflag
=
0
;
if
(
uart_console
(
port
))
{
tty
->
termios
->
c_cflag
=
port
->
cons
->
cflag
;
port
->
cons
->
cflag
=
0
;
}
#endif
/*
* If the device failed to grab its irq resources,
...
...
@@ -1417,7 +1420,7 @@ static void uart_update_termios(struct uart_state *state)
* And finally enable the RTS and DTR signals.
*/
if
(
tty
->
termios
->
c_cflag
&
CBAUD
)
uart_set_mctrl
(
state
->
port
,
TIOCM_DTR
|
TIOCM_RTS
);
uart_set_mctrl
(
port
,
TIOCM_DTR
|
TIOCM_RTS
);
}
}
...
...
@@ -1914,7 +1917,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port, u32 level
/*
* Disable the console device before suspending.
*/
if
(
port
->
cons
&&
port
->
cons
->
index
==
port
->
line
)
if
(
uart_console
(
port
)
)
port
->
cons
->
flags
&=
~
CON_ENABLED
;
uart_change_pm
(
state
,
3
);
...
...
@@ -1939,7 +1942,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port, u32 level)
/*
* Re-enable the console device after suspending.
*/
if
(
port
->
cons
&&
port
->
cons
->
index
==
port
->
line
)
{
if
(
uart_console
(
port
)
)
{
uart_change_speed
(
state
,
NULL
);
port
->
cons
->
flags
|=
CON_ENABLED
;
}
...
...
@@ -2025,7 +2028,7 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state,
* Power down all ports by default, except the
* console if we have one.
*/
if
(
!
port
->
cons
||
port
->
cons
->
index
!=
port
->
line
)
if
(
!
uart_console
(
port
)
)
uart_change_pm
(
state
,
3
);
}
}
...
...
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