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
71d84158
Commit
71d84158
authored
Jun 11, 2003
by
Alexander Viro
Committed by
Linus Torvalds
Jun 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] tty_driver refcounting
arch/ppc/8xx_io/uart.c converted to dynamic allocation
parent
241b7600
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
34 deletions
+38
-34
arch/ppc/8xx_io/uart.c
arch/ppc/8xx_io/uart.c
+38
-34
No files found.
arch/ppc/8xx_io/uart.c
View file @
71d84158
...
...
@@ -85,7 +85,7 @@ static char *serial_version = "0.03";
static
DECLARE_TASK_QUEUE
(
tq_serial
);
static
struct
tty_driver
serial_driver
;
static
struct
tty_driver
*
serial_driver
;
static
int
serial_console_setup
(
struct
console
*
co
,
char
*
options
);
static
void
serial_console_write
(
struct
console
*
c
,
const
char
*
s
,
...
...
@@ -2459,7 +2459,7 @@ void kgdb_map_scc(void)
static
struct
tty_driver
*
serial_console_device
(
struct
console
*
c
,
int
*
index
)
{
*
index
=
c
->
index
;
return
&
serial_driver
;
return
serial_driver
;
}
/*
...
...
@@ -2476,6 +2476,26 @@ console_initcall(console_8xx_init);
*/
static
int
baud_idx
;
static
struct
tty_operations
rs_8xx_ops
=
{
.
open
=
rs_8xx_open
,
.
close
=
rs_8xx_close
,
.
write
=
rs_8xx_write
,
.
put_char
=
rs_8xx_put_char
,
.
write_room
=
rs_8xx_write_room
,
.
chars_in_buffer
=
rs_8xx_chars_in_buffer
,
.
flush_buffer
=
rs_8xx_flush_buffer
,
.
ioctl
=
rs_8xx_ioctl
,
.
throttle
=
rs_8xx_throttle
,
.
unthrottle
=
rs_8xx_unthrottle
,
.
send_xchar
=
rs_8xx_send_xchar
,
.
set_termios
=
rs_8xx_set_termios
,
.
stop
=
rs_8xx_stop
,
.
start
=
rs_8xx_start
,
.
hangup
=
rs_8xx_hangup
,
.
wait_until_sent
=
rs_8xx_wait_until_sent
,
.
read_proc
=
rs_8xx_read_proc
,
};
/*
* The serial driver boot-time initialization code!
*/
...
...
@@ -2494,46 +2514,30 @@ int __init rs_8xx_init(void)
volatile
scc_uart_t
*
sup
;
volatile
immap_t
*
immap
;
serial_driver
=
alloc_tty_driver
(
NR_PORTS
);
if
(
!
serial_driver
)
return
-
ENOMEM
;
init_bh
(
SERIAL_BH
,
do_serial_bh
);
show_serial_version
();
/* Initialize the tty_driver structure */
__clear_user
(
&
serial_driver
,
sizeof
(
struct
tty_driver
));
serial_driver
.
magic
=
TTY_DRIVER_MAGIC
;
serial_driver
.
driver_name
=
"serial"
;
serial_driver
.
devfs_name
=
"tts/"
;
serial_driver
.
name
=
"ttyS"
;
serial_driver
.
major
=
TTY_MAJOR
;
serial_driver
.
minor_start
=
64
;
serial_driver
.
num
=
NR_PORTS
;
serial_driver
.
type
=
TTY_DRIVER_TYPE_SERIAL
;
serial_driver
.
subtype
=
SERIAL_TYPE_NORMAL
;
serial_driver
.
init_termios
=
tty_std_termios
;
serial_driver
.
init_termios
.
c_cflag
=
serial_driver
->
driver_name
=
"serial"
;
serial_driver
->
devfs_name
=
"tts/"
;
serial_driver
->
name
=
"ttyS"
;
serial_driver
->
major
=
TTY_MAJOR
;
serial_driver
->
minor_start
=
64
;
serial_driver
->
type
=
TTY_DRIVER_TYPE_SERIAL
;
serial_driver
->
subtype
=
SERIAL_TYPE_NORMAL
;
serial_driver
->
init_termios
=
tty_std_termios
;
serial_driver
->
init_termios
.
c_cflag
=
baud_idx
|
CS8
|
CREAD
|
HUPCL
|
CLOCAL
;
serial_driver
.
flags
=
TTY_DRIVER_REAL_RAW
;
serial_driver
.
open
=
rs_8xx_open
;
serial_driver
.
close
=
rs_8xx_close
;
serial_driver
.
write
=
rs_8xx_write
;
serial_driver
.
put_char
=
rs_8xx_put_char
;
serial_driver
.
write_room
=
rs_8xx_write_room
;
serial_driver
.
chars_in_buffer
=
rs_8xx_chars_in_buffer
;
serial_driver
.
flush_buffer
=
rs_8xx_flush_buffer
;
serial_driver
.
ioctl
=
rs_8xx_ioctl
;
serial_driver
.
throttle
=
rs_8xx_throttle
;
serial_driver
.
unthrottle
=
rs_8xx_unthrottle
;
serial_driver
.
send_xchar
=
rs_8xx_send_xchar
;
serial_driver
.
set_termios
=
rs_8xx_set_termios
;
serial_driver
.
stop
=
rs_8xx_stop
;
serial_driver
.
start
=
rs_8xx_start
;
serial_driver
.
hangup
=
rs_8xx_hangup
;
serial_driver
.
wait_until_sent
=
rs_8xx_wait_until_sent
;
serial_driver
.
read_proc
=
rs_8xx_read_proc
;
if
(
tty_register_driver
(
&
serial_driver
))
serial_driver
->
flags
=
TTY_DRIVER_REAL_RAW
;
tty_set_operations
(
serial_driver
,
&
rs_8xx_ops
);
if
(
tty_register_driver
(
serial_driver
))
panic
(
"Couldn't register serial driver
\n
"
);
cp
=
cpmp
;
/* Get pointer to Communication Processor */
...
...
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