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
50d21c5c
Commit
50d21c5c
authored
Mar 20, 2003
by
Geert Uytterhoeven
Committed by
Linus Torvalds
Mar 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Amiga serial updates
Convert Amiga serial driver to use tasklets (from Roman Zippel)
parent
08144811
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
20 deletions
+7
-20
drivers/char/amiserial.c
drivers/char/amiserial.c
+5
-20
include/linux/serialP.h
include/linux/serialP.h
+2
-0
No files found.
drivers/char/amiserial.c
View file @
50d21c5c
...
@@ -102,8 +102,6 @@ static char *serial_version = "4.30";
...
@@ -102,8 +102,6 @@ static char *serial_version = "4.30";
static
char
*
serial_name
=
"Amiga-builtin serial driver"
;
static
char
*
serial_name
=
"Amiga-builtin serial driver"
;
static
DECLARE_TASK_QUEUE
(
tq_serial
);
static
struct
tty_driver
serial_driver
,
callout_driver
;
static
struct
tty_driver
serial_driver
,
callout_driver
;
static
int
serial_refcount
;
static
int
serial_refcount
;
...
@@ -276,8 +274,7 @@ static _INLINE_ void rs_sched_event(struct async_struct *info,
...
@@ -276,8 +274,7 @@ static _INLINE_ void rs_sched_event(struct async_struct *info,
int
event
)
int
event
)
{
{
info
->
event
|=
1
<<
event
;
info
->
event
|=
1
<<
event
;
queue_task
(
&
info
->
tqueue
,
&
tq_serial
);
tasklet_schedule
(
&
info
->
tlet
);
mark_bh
(
SERIAL_BH
);
}
}
static
_INLINE_
void
receive_chars
(
struct
async_struct
*
info
)
static
_INLINE_
void
receive_chars
(
struct
async_struct
*
info
)
...
@@ -560,12 +557,8 @@ static void ser_tx_int(int irq, void *dev_id, struct pt_regs * regs)
...
@@ -560,12 +557,8 @@ static void ser_tx_int(int irq, void *dev_id, struct pt_regs * regs)
* interrupt driver proper are done; the interrupt driver schedules
* interrupt driver proper are done; the interrupt driver schedules
* them using rs_sched_event(), and they get done here.
* them using rs_sched_event(), and they get done here.
*/
*/
static
void
do_serial_bh
(
void
)
{
run_task_queue
(
&
tq_serial
);
}
static
void
do_softint
(
void
*
private_
)
static
void
do_softint
(
unsigned
long
private_
)
{
{
struct
async_struct
*
info
=
(
struct
async_struct
*
)
private_
;
struct
async_struct
*
info
=
(
struct
async_struct
*
)
private_
;
struct
tty_struct
*
tty
;
struct
tty_struct
*
tty
;
...
@@ -1878,8 +1871,7 @@ static int get_async_struct(int line, struct async_struct **ret_info)
...
@@ -1878,8 +1871,7 @@ static int get_async_struct(int line, struct async_struct **ret_info)
info
->
flags
=
sstate
->
flags
;
info
->
flags
=
sstate
->
flags
;
info
->
xmit_fifo_size
=
sstate
->
xmit_fifo_size
;
info
->
xmit_fifo_size
=
sstate
->
xmit_fifo_size
;
info
->
line
=
line
;
info
->
line
=
line
;
info
->
tqueue
.
routine
=
do_softint
;
tasklet_init
(
&
info
->
tlet
,
do_softint
,
(
unsigned
long
)
info
);
info
->
tqueue
.
data
=
info
;
info
->
state
=
sstate
;
info
->
state
=
sstate
;
if
(
sstate
->
info
)
{
if
(
sstate
->
info
)
{
kfree
(
info
);
kfree
(
info
);
...
@@ -2117,8 +2109,6 @@ static int __init rs_init(void)
...
@@ -2117,8 +2109,6 @@ static int __init rs_init(void)
if
(
!
request_mem_region
(
CUSTOM_PHYSADDR
+
0x30
,
4
,
"amiserial [Paula]"
))
if
(
!
request_mem_region
(
CUSTOM_PHYSADDR
+
0x30
,
4
,
"amiserial [Paula]"
))
return
-
EBUSY
;
return
-
EBUSY
;
init_bh
(
SERIAL_BH
,
do_serial_bh
);
IRQ_ports
=
NULL
;
IRQ_ports
=
NULL
;
show_serial_version
();
show_serial_version
();
...
@@ -2234,23 +2224,18 @@ static int __init rs_init(void)
...
@@ -2234,23 +2224,18 @@ static int __init rs_init(void)
static
__exit
void
rs_exit
(
void
)
static
__exit
void
rs_exit
(
void
)
{
{
unsigned
long
flags
;
int
e1
,
e2
;
int
e1
,
e2
;
struct
async_struct
*
info
;
struct
async_struct
*
info
=
rs_table
[
0
].
info
;
/* printk("Unloading %s: version %s\n", serial_name, serial_version); */
/* printk("Unloading %s: version %s\n", serial_name, serial_version); */
save_flags
(
flags
);
tasklet_kill
(
&
info
->
tlet
);
cli
();
remove_bh
(
SERIAL_BH
);
if
((
e1
=
tty_unregister_driver
(
&
serial_driver
)))
if
((
e1
=
tty_unregister_driver
(
&
serial_driver
)))
printk
(
"SERIAL: failed to unregister serial driver (%d)
\n
"
,
printk
(
"SERIAL: failed to unregister serial driver (%d)
\n
"
,
e1
);
e1
);
if
((
e2
=
tty_unregister_driver
(
&
callout_driver
)))
if
((
e2
=
tty_unregister_driver
(
&
callout_driver
)))
printk
(
"SERIAL: failed to unregister callout driver (%d)
\n
"
,
printk
(
"SERIAL: failed to unregister callout driver (%d)
\n
"
,
e2
);
e2
);
restore_flags
(
flags
);
info
=
rs_table
[
0
].
info
;
if
(
info
)
{
if
(
info
)
{
rs_table
[
0
].
info
=
NULL
;
rs_table
[
0
].
info
=
NULL
;
kfree
(
info
);
kfree
(
info
);
...
...
include/linux/serialP.h
View file @
50d21c5c
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include <linux/config.h>
#include <linux/config.h>
#include <linux/termios.h>
#include <linux/termios.h>
#include <linux/workqueue.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/circ_buf.h>
#include <linux/circ_buf.h>
#include <linux/wait.h>
#include <linux/wait.h>
#if (LINUX_VERSION_CODE < 0x020300)
#if (LINUX_VERSION_CODE < 0x020300)
...
@@ -87,6 +88,7 @@ struct async_struct {
...
@@ -87,6 +88,7 @@ struct async_struct {
u16
iomem_reg_shift
;
u16
iomem_reg_shift
;
int
io_type
;
int
io_type
;
struct
work_struct
work
;
struct
work_struct
work
;
struct
tasklet_struct
tlet
;
#ifdef DECLARE_WAITQUEUE
#ifdef DECLARE_WAITQUEUE
wait_queue_head_t
open_wait
;
wait_queue_head_t
open_wait
;
wait_queue_head_t
close_wait
;
wait_queue_head_t
close_wait
;
...
...
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