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
Kirill Smelkov
linux
Commits
87a9d57e
Commit
87a9d57e
authored
Sep 02, 2002
by
Vojtech Pavlik
Browse files
Options
Browse Files
Download
Plain Diff
Merge suse.cz:/home/vojtech/bk/linus into suse.cz:/home/vojtech/bk/input
parents
bd039e05
921e8a00
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
56 deletions
+27
-56
drivers/char/tty_io.c
drivers/char/tty_io.c
+2
-0
drivers/input/serio/i8042-io.h
drivers/input/serio/i8042-io.h
+2
-2
drivers/input/serio/serport.c
drivers/input/serio/serport.c
+23
-54
No files found.
drivers/char/tty_io.c
View file @
87a9d57e
...
...
@@ -204,6 +204,8 @@ char *tty_name(struct tty_struct *tty, char *buf)
return
_tty_make_name
(
tty
,
(
tty
)
?
tty
->
driver
.
name
:
NULL
,
buf
);
}
EXPORT_SYMBOL
(
tty_name
);
inline
int
tty_paranoia_check
(
struct
tty_struct
*
tty
,
kdev_t
device
,
const
char
*
routine
)
{
...
...
drivers/input/serio/i8042-io.h
View file @
87a9d57e
...
...
@@ -62,7 +62,7 @@ static inline int i8042_platform_init(void)
* On ix86 platforms touching the i8042 data register region can do really
* bad things. Because of this the region is always reserved on ix86 boxes.
*/
#if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__)
#if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__)
&& !defined(__x86_64__)
if
(
!
request_region
(
I8042_DATA_REG
,
16
,
"i8042"
))
return
0
;
#endif
...
...
@@ -71,7 +71,7 @@ static inline int i8042_platform_init(void)
static
inline
void
i8042_platform_exit
(
void
)
{
#if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__)
#if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__)
&& !defined(__x86_64__)
release_region
(
I8042_DATA_REG
,
16
);
#endif
}
...
...
drivers/input/serio/serport.c
View file @
87a9d57e
/*
* $Id: serport_old.c,v 1.10 2002/01/24 19:52:57 vojtech Exp $
* Input device TTY line discipline
*
* Copyright (c) 1999-2002 Vojtech Pavlik
*
* Copyright (c) 1999-2001 Vojtech Pavlik
*/
/*
* This is a module that converts a tty line into a much simpler
* 'serial io port' abstraction that the input device drivers use.
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#include <asm/uaccess.h>
...
...
@@ -41,10 +25,13 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION
(
"Input device TTY line discipline"
);
MODULE_LICENSE
(
"GPL"
);
#define SERPORT_BUSY 1
struct
serport
{
struct
tty_struct
*
tty
;
wait_queue_head_t
wait
;
struct
serio
serio
;
unsigned
long
flags
;
char
phys
[
32
];
};
...
...
@@ -68,20 +55,20 @@ static int serport_serio_open(struct serio *serio)
static
void
serport_serio_close
(
struct
serio
*
serio
)
{
struct
serport
*
serport
=
serio
->
driver
;
serport
->
serio
.
type
=
0
;
wake_up_interruptible
(
&
serport
->
wait
);
}
/*
* serport_ldisc_open() is the routine that is called upon setting our line
* discipline on a tty. It looks for the Mag, and if found, registers
* it as a joystick device.
* discipline on a tty. It prepares the serio struct.
*/
static
int
serport_ldisc_open
(
struct
tty_struct
*
tty
)
{
struct
serport
*
serport
;
char
ttyname
[
64
];
int
i
;
char
name
[
64
];
MOD_INC_USE_COUNT
;
...
...
@@ -96,11 +83,7 @@ static int serport_ldisc_open(struct tty_struct *tty)
serport
->
tty
=
tty
;
tty
->
disc_data
=
serport
;
strcpy
(
ttyname
,
tty
->
driver
.
name
);
for
(
i
=
0
;
ttyname
[
i
]
!=
0
&&
ttyname
[
i
]
!=
'/'
;
i
++
);
ttyname
[
i
]
=
0
;
sprintf
(
serport
->
phys
,
"%s%d/serio0"
,
ttyname
,
minor
(
tty
->
device
)
-
tty
->
driver
.
minor_start
);
snprintf
(
serport
->
phys
,
sizeof
(
serport
->
phys
),
"%s/serio0"
,
tty_name
(
tty
,
name
));
serport
->
serio
.
name
=
serport_name
;
serport
->
serio
.
phys
=
serport
->
phys
;
...
...
@@ -161,29 +144,18 @@ static int serport_ldisc_room(struct tty_struct *tty)
static
ssize_t
serport_ldisc_read
(
struct
tty_struct
*
tty
,
struct
file
*
file
,
unsigned
char
*
buf
,
size_t
nr
)
{
struct
serport
*
serport
=
(
struct
serport
*
)
tty
->
disc_data
;
DECLARE_WAITQUEUE
(
wait
,
current
);
char
name
[
32
];
char
name
[
64
];
#ifdef CONFIG_DEVFS_FS
sprintf
(
name
,
tty
->
driver
.
name
,
minor
(
tty
->
device
)
-
tty
->
driver
.
minor_start
);
#else
sprintf
(
name
,
"%s%d"
,
tty
->
driver
.
name
,
minor
(
tty
->
device
)
-
tty
->
driver
.
minor_start
);
#endif
if
(
test_and_set_bit
(
SERPORT_BUSY
,
&
serport
->
flags
))
return
-
EBUSY
;
serio_register_port
(
&
serport
->
serio
);
printk
(
KERN_INFO
"serio: Serial port %s
\n
"
,
name
);
add_wait_queue
(
&
serport
->
wait
,
&
wait
);
set_current_state
(
TASK_INTERRUPTIBLE
);
while
(
serport
->
serio
.
type
&&
!
signal_pending
(
current
))
schedule
();
set_current_state
(
TASK_RUNNING
);
remove_wait_queue
(
&
serport
->
wait
,
&
wait
);
printk
(
KERN_INFO
"serio: Serial port %s
\n
"
,
tty_name
(
tty
,
name
));
wait_event_interruptible
(
serport
->
wait
,
!
serport
->
serio
.
type
);
serio_unregister_port
(
&
serport
->
serio
);
clear_bit
(
SERPORT_BUSY
,
&
serport
->
flags
);
return
0
;
}
...
...
@@ -195,10 +167,8 @@ static int serport_ldisc_ioctl(struct tty_struct * tty, struct file * file, unsi
{
struct
serport
*
serport
=
(
struct
serport
*
)
tty
->
disc_data
;
switch
(
cmd
)
{
case
SPIOCSTYPE
:
return
get_user
(
serport
->
serio
.
type
,
(
unsigned
long
*
)
arg
);
}
if
(
cmd
==
SPIOCSTYPE
)
return
get_user
(
serport
->
serio
.
type
,
(
unsigned
long
*
)
arg
);
return
-
EINVAL
;
}
...
...
@@ -208,7 +178,6 @@ static void serport_ldisc_write_wakeup(struct tty_struct * tty)
struct
serport
*
sp
=
(
struct
serport
*
)
tty
->
disc_data
;
serio_dev_write_wakeup
(
&
sp
->
serio
);
}
/*
...
...
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