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
241b7600
Commit
241b7600
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/8260_io/uart.c converted to dynamic allocation
parent
850a46e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
36 deletions
+38
-36
arch/ppc/8260_io/uart.c
arch/ppc/8260_io/uart.c
+38
-36
No files found.
arch/ppc/8260_io/uart.c
View file @
241b7600
...
...
@@ -74,7 +74,7 @@
static
char
*
serial_name
=
"CPM UART driver"
;
static
char
*
serial_version
=
"0.02"
;
static
struct
tty_driver
serial_driver
;
static
struct
tty_driver
*
serial_driver
;
static
int
serial_console_setup
(
struct
console
*
co
,
char
*
options
);
/*
...
...
@@ -2394,7 +2394,7 @@ void kgdb_map_scc(void)
static
kdev_t
serial_console_device
(
struct
console
*
c
)
{
*
index
=
c
->
index
;
return
&
serial_driver
;
return
serial_driver
;
}
...
...
@@ -2423,6 +2423,26 @@ long __init console_8xx_init(long kmem_start, long kmem_end)
*/
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!
*/
...
...
@@ -2442,45 +2462,27 @@ int __init rs_8xx_init(void)
volatile
immap_t
*
immap
;
volatile
iop8260_t
*
io
;
serial_driver
=
alloc_tty_driver
(
NR_PORTS
);
if
(
!
serial_driver
)
return
-
ENOMEM
;
show_serial_version
();
/* Initialize the tty_driver structure */
/*memset(&serial_driver, 0, sizeof(struct tty_driver));*/
__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
"
);
immap
=
immr
;
...
...
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