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
a00470d6
Commit
a00470d6
authored
May 26, 2003
by
Alexander Viro
Committed by
Linus Torvalds
May 26, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] callout removal: generic_serial
callout removal: generic_serial
parent
05922507
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
42 deletions
+5
-42
drivers/char/generic_serial.c
drivers/char/generic_serial.c
+5
-37
include/linux/generic_serial.h
include/linux/generic_serial.h
+0
-5
No files found.
drivers/char/generic_serial.c
View file @
a00470d6
...
...
@@ -554,7 +554,7 @@ void gs_hangup(struct tty_struct *tty)
return
;
gs_shutdown_port
(
port
);
port
->
flags
&=
~
(
ASYNC_NORMAL_ACTIVE
|
ASYNC_CALLOUT_ACTIVE
|
GS_ACTIVE
);
port
->
flags
&=
~
(
ASYNC_NORMAL_ACTIVE
|
GS_ACTIVE
);
port
->
tty
=
NULL
;
port
->
count
=
0
;
...
...
@@ -618,48 +618,20 @@ int gs_block_til_ready(void *port_, struct file * filp)
gs_dprintk
(
GS_DEBUG_BTR
,
"after hung up
\n
"
);
/*
* If this is a callout device, then just make sure the normal
* device isn't being used.
*/
if
(
tty
->
driver
->
subtype
==
GS_TYPE_CALLOUT
)
{
if
(
port
->
flags
&
ASYNC_NORMAL_ACTIVE
)
return
-
EBUSY
;
if
((
port
->
flags
&
ASYNC_CALLOUT_ACTIVE
)
&&
(
port
->
flags
&
ASYNC_SESSION_LOCKOUT
)
&&
(
port
->
session
!=
current
->
session
))
return
-
EBUSY
;
if
((
port
->
flags
&
ASYNC_CALLOUT_ACTIVE
)
&&
(
port
->
flags
&
ASYNC_PGRP_LOCKOUT
)
&&
(
port
->
pgrp
!=
current
->
pgrp
))
return
-
EBUSY
;
port
->
flags
|=
ASYNC_CALLOUT_ACTIVE
;
return
0
;
}
gs_dprintk
(
GS_DEBUG_BTR
,
"after subtype
\n
"
);
/*
* If non-blocking mode is set, or the port is not enabled,
* then make the check up front and then exit.
*/
if
((
filp
->
f_flags
&
O_NONBLOCK
)
||
(
tty
->
flags
&
(
1
<<
TTY_IO_ERROR
)))
{
if
(
port
->
flags
&
ASYNC_CALLOUT_ACTIVE
)
return
-
EBUSY
;
port
->
flags
|=
ASYNC_NORMAL_ACTIVE
;
return
0
;
}
gs_dprintk
(
GS_DEBUG_BTR
,
"after nonblock
\n
"
);
if
(
port
->
flags
&
ASYNC_CALLOUT_ACTIVE
)
{
if
(
port
->
normal_termios
.
c_cflag
&
CLOCAL
)
do_clocal
=
1
;
}
else
{
if
(
C_CLOCAL
(
tty
))
do_clocal
=
1
;
}
if
(
C_CLOCAL
(
tty
))
do_clocal
=
1
;
/*
* Block waiting for the carrier detect and the line to become
...
...
@@ -690,8 +662,7 @@ int gs_block_til_ready(void *port_, struct file * filp)
retval
=
-
ERESTARTSYS
;
break
;
}
if
(
!
(
port
->
flags
&
ASYNC_CALLOUT_ACTIVE
)
&&
!
(
port
->
flags
&
ASYNC_CLOSING
)
&&
if
(
!
(
port
->
flags
&
ASYNC_CLOSING
)
&&
(
do_clocal
||
CD
))
break
;
gs_dprintk
(
GS_DEBUG_BTR
,
"signal_pending is now: %d (%lx)
\n
"
,
...
...
@@ -769,8 +740,6 @@ void gs_close(struct tty_struct * tty, struct file * filp)
*/
if
(
port
->
flags
&
ASYNC_NORMAL_ACTIVE
)
port
->
normal_termios
=
*
tty
->
termios
;
if
(
port
->
flags
&
ASYNC_CALLOUT_ACTIVE
)
port
->
callout_termios
=
*
tty
->
termios
;
/*
* Now we wait for the transmit buffer to clear; and we notify
* the line discipline to only process XON/XOFF characters.
...
...
@@ -812,8 +781,7 @@ void gs_close(struct tty_struct * tty, struct file * filp)
}
wake_up_interruptible
(
&
port
->
open_wait
);
}
port
->
flags
&=
~
(
ASYNC_NORMAL_ACTIVE
|
ASYNC_CALLOUT_ACTIVE
|
ASYNC_CLOSING
|
ASYNC_INITIALIZED
);
port
->
flags
&=
~
(
ASYNC_NORMAL_ACTIVE
|
ASYNC_CLOSING
|
ASYNC_INITIALIZED
);
wake_up_interruptible
(
&
port
->
close_wait
);
restore_flags
(
flags
);
...
...
include/linux/generic_serial.h
View file @
a00470d6
...
...
@@ -37,11 +37,8 @@ struct gs_port {
/* struct semaphore port_write_sem; */
int
flags
;
struct
termios
normal_termios
;
struct
termios
callout_termios
;
wait_queue_head_t
open_wait
;
wait_queue_head_t
close_wait
;
long
session
;
long
pgrp
;
int
count
;
int
blocked_open
;
struct
tty_struct
*
tty
;
...
...
@@ -67,8 +64,6 @@ struct gs_port {
#define GS_TYPE_NORMAL 1
#define GS_TYPE_CALLOUT 2
#define GS_DEBUG_FLUSH 0x00000001
#define GS_DEBUG_BTR 0x00000002
...
...
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