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
b8d399ae
Commit
b8d399ae
authored
Dec 29, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Plain Diff
Merge kroah.com:/home/linux/linux/BK/bleeding-2.5
into kroah.com:/home/linux/linux/BK/tty-2.5
parents
bec7aa00
a3a2b130
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
68 additions
and
57 deletions
+68
-57
arch/mips/au1000/common/serial.c
arch/mips/au1000/common/serial.c
+6
-6
drivers/char/dz.c
drivers/char/dz.c
+2
-2
drivers/char/hvc_console.c
drivers/char/hvc_console.c
+1
-1
drivers/char/ip2main.c
drivers/char/ip2main.c
+4
-4
drivers/char/n_tty.c
drivers/char/n_tty.c
+8
-9
drivers/char/pty.c
drivers/char/pty.c
+3
-4
drivers/char/tty_io.c
drivers/char/tty_io.c
+27
-16
drivers/char/vt.c
drivers/char/vt.c
+1
-1
drivers/serial/core.c
drivers/serial/core.c
+2
-2
drivers/tc/zs.c
drivers/tc/zs.c
+2
-2
drivers/usb/class/bluetty.c
drivers/usb/class/bluetty.c
+2
-2
drivers/usb/class/cdc-acm.c
drivers/usb/class/cdc-acm.c
+3
-3
drivers/usb/serial/bus.c
drivers/usb/serial/bus.c
+3
-2
include/linux/tty.h
include/linux/tty.h
+2
-3
include/linux/tty_driver.h
include/linux/tty_driver.h
+2
-0
No files found.
arch/mips/au1000/common/serial.c
View file @
b8d399ae
...
...
@@ -2682,9 +2682,9 @@ static int __init rs_init(void)
(
state
->
flags
&
ASYNC_FOURPORT
)
?
" FourPort"
:
""
,
state
->
port
,
state
->
irq
,
uart_config
[
state
->
type
].
name
);
tty_register_dev
fs
(
&
serial_driver
,
0
,
tty_register_dev
ice
(
&
serial_driver
,
serial_driver
.
minor_start
+
state
->
line
);
tty_register_dev
fs
(
&
callout_driver
,
0
,
tty_register_dev
ice
(
&
callout_driver
,
callout_driver
.
minor_start
+
state
->
line
);
}
return
0
;
...
...
@@ -2772,9 +2772,9 @@ int register_serial(struct serial_struct *req)
state
->
iomem_base
?
"iomem"
:
"port"
,
state
->
iomem_base
?
(
unsigned
long
)
state
->
iomem_base
:
state
->
port
,
state
->
irq
,
uart_config
[
state
->
type
].
name
);
tty_register_dev
fs
(
&
serial_driver
,
0
,
tty_register_dev
ice
(
&
serial_driver
,
serial_driver
.
minor_start
+
state
->
line
);
tty_register_dev
fs
(
&
callout_driver
,
0
,
tty_register_dev
ice
(
&
callout_driver
,
callout_driver
.
minor_start
+
state
->
line
);
return
state
->
line
+
SERIAL_DEV_OFFSET
;
}
...
...
@@ -2801,9 +2801,9 @@ void unregister_serial(int line)
/* These will be hidden, because they are devices that will no longer
* be available to the system. (ie, PCMCIA modems, once ejected)
*/
tty_unregister_dev
fs
(
&
serial_driver
,
tty_unregister_dev
ice
(
&
serial_driver
,
serial_driver
.
minor_start
+
state
->
line
);
tty_unregister_dev
fs
(
&
callout_driver
,
tty_unregister_dev
ice
(
&
callout_driver
,
callout_driver
.
minor_start
+
state
->
line
);
restore_flags
(
flags
);
}
...
...
drivers/char/dz.c
View file @
b8d399ae
...
...
@@ -1425,9 +1425,9 @@ int __init dz_init(void)
printk
(
"ttyS%02d at 0x%08x (irq = %d)
\n
"
,
info
->
line
,
info
->
port
,
SERIAL
);
tty_register_dev
fs
(
&
serial_driver
,
0
,
tty_register_dev
ice
(
&
serial_driver
,
serial_driver
.
minor_start
+
info
->
line
);
tty_register_dev
fs
(
&
callout_driver
,
0
,
tty_register_dev
ice
(
&
callout_driver
,
callout_driver
.
minor_start
+
info
->
line
);
}
...
...
drivers/char/hvc_console.c
View file @
b8d399ae
...
...
@@ -279,7 +279,7 @@ int __init hvc_init(void)
for
(
i
=
0
;
i
<
hvc_driver
.
num
;
i
++
)
{
hvc_struct
[
i
].
lock
=
SPIN_LOCK_UNLOCKED
;
hvc_struct
[
i
].
index
=
i
;
tty_register_dev
fs
(
&
hvc_driver
,
0
,
hvc_driver
.
minor_start
+
i
);
tty_register_dev
ice
(
&
hvc_driver
,
hvc_driver
.
minor_start
+
i
);
}
if
(
tty_register_driver
(
&
hvc_driver
))
...
...
drivers/char/ip2main.c
View file @
b8d399ae
...
...
@@ -899,11 +899,11 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
{
if
(
pB
->
i2eChannelMap
[
box
]
&
(
1
<<
j
)
)
{
tty_register_dev
fs
(
&
ip2_tty_driver
,
0
,
j
+
ABS_BIGGEST_BOX
*
tty_register_dev
ice
(
&
ip2_tty_driver
,
j
+
ABS_BIGGEST_BOX
*
(
box
+
i
*
ABS_MAX_BOXES
));
tty_register_dev
fs
(
&
ip2_callout_driver
,
0
,
j
+
ABS_BIGGEST_BOX
*
tty_register_dev
ice
(
&
ip2_callout_driver
,
j
+
ABS_BIGGEST_BOX
*
(
box
+
i
*
ABS_MAX_BOXES
));
}
}
...
...
drivers/char/n_tty.c
View file @
b8d399ae
...
...
@@ -48,10 +48,6 @@
#define IS_CONSOLE_DEV(dev) (kdev_val(dev) == __mkdev(TTY_MAJOR,0))
#define IS_SYSCONS_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,1))
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/* number of characters left in xmit buffer before select has we have room */
#define WAKEUP_CHARS 256
...
...
@@ -725,16 +721,18 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
if
(
tty
->
real_raw
)
{
spin_lock_irqsave
(
&
tty
->
read_lock
,
cpuflags
);
i
=
MIN
(
count
,
MIN
(
N_TTY_BUF_SIZE
-
tty
->
read_cnt
,
N_TTY_BUF_SIZE
-
tty
->
read_head
));
i
=
min
(
N_TTY_BUF_SIZE
-
tty
->
read_cnt
,
N_TTY_BUF_SIZE
-
tty
->
read_head
);
i
=
min
(
count
,
i
);
memcpy
(
tty
->
read_buf
+
tty
->
read_head
,
cp
,
i
);
tty
->
read_head
=
(
tty
->
read_head
+
i
)
&
(
N_TTY_BUF_SIZE
-
1
);
tty
->
read_cnt
+=
i
;
cp
+=
i
;
count
-=
i
;
i
=
MIN
(
count
,
MIN
(
N_TTY_BUF_SIZE
-
tty
->
read_cnt
,
N_TTY_BUF_SIZE
-
tty
->
read_head
));
i
=
min
(
N_TTY_BUF_SIZE
-
tty
->
read_cnt
,
N_TTY_BUF_SIZE
-
tty
->
read_head
);
i
=
min
(
count
,
i
);
memcpy
(
tty
->
read_buf
+
tty
->
read_head
,
cp
,
i
);
tty
->
read_head
=
(
tty
->
read_head
+
i
)
&
(
N_TTY_BUF_SIZE
-
1
);
tty
->
read_cnt
+=
i
;
...
...
@@ -915,7 +913,8 @@ static inline int copy_from_read_buf(struct tty_struct *tty,
retval
=
0
;
spin_lock_irqsave
(
&
tty
->
read_lock
,
flags
);
n
=
MIN
(
*
nr
,
MIN
(
tty
->
read_cnt
,
N_TTY_BUF_SIZE
-
tty
->
read_tail
));
n
=
min
(
tty
->
read_cnt
,
N_TTY_BUF_SIZE
-
tty
->
read_tail
);
n
=
min
((
ssize_t
)
*
nr
,
n
);
spin_unlock_irqrestore
(
&
tty
->
read_lock
,
flags
);
if
(
n
)
{
mb
();
...
...
drivers/char/pty.c
View file @
b8d399ae
...
...
@@ -64,8 +64,6 @@ static struct termios *pts_termios_locked[UNIX98_NR_MAJORS][NR_PTYS];
static
struct
pty_struct
ptm_state
[
UNIX98_NR_MAJORS
][
NR_PTYS
];
#endif
#define MIN(a,b) ((a) < (b) ? (a) : (b))
static
void
pty_close
(
struct
tty_struct
*
tty
,
struct
file
*
filp
)
{
if
(
!
tty
)
...
...
@@ -97,7 +95,7 @@ static void pty_close(struct tty_struct * tty, struct file * filp)
}
}
#endif
tty_unregister_dev
fs
(
&
tty
->
link
->
driver
,
minor
(
tty
->
device
));
tty_unregister_dev
ice
(
&
tty
->
link
->
driver
,
minor
(
tty
->
device
));
tty_vhangup
(
tty
->
link
);
}
}
...
...
@@ -156,7 +154,7 @@ static int pty_write(struct tty_struct * tty, int from_user,
n
=
count
;
if
(
!
n
)
break
;
n
=
MIN
(
n
,
PTY_BUF_SIZE
);
n
=
min
(
n
,
PTY_BUF_SIZE
);
n
-=
copy_from_user
(
temp_buffer
,
buf
,
n
);
if
(
!
n
)
{
if
(
!
c
)
...
...
@@ -307,6 +305,7 @@ static void pty_flush_buffer(struct tty_struct *tty)
}
}
extern
void
tty_register_devfs
(
struct
tty_driver
*
driver
,
unsigned
int
flags
,
unsigned
minor
);
static
int
pty_open
(
struct
tty_struct
*
tty
,
struct
file
*
filp
)
{
int
retval
;
...
...
drivers/char/tty_io.c
View file @
b8d399ae
...
...
@@ -90,6 +90,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/smp_lock.h>
#include <linux/device.h>
#include <asm/uaccess.h>
#include <asm/system.h>
...
...
@@ -158,13 +159,6 @@ extern void tx3912_console_init(void);
extern
void
tx3912_rs_init
(
void
);
extern
void
hvc_console_init
(
void
);
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a,b) ((a) < (b) ? (b) : (a))
#endif
static
struct
tty_struct
*
alloc_tty_struct
(
void
)
{
struct
tty_struct
*
tty
;
...
...
@@ -713,7 +707,7 @@ static inline ssize_t do_tty_write(
unlock_kernel
();
}
else
{
for
(;;)
{
unsigned
long
size
=
MAX
(
PAGE_SIZE
*
2
,
16384
);
unsigned
long
size
=
max
((
unsigned
long
)
PAGE_SIZE
*
2
,
16384UL
);
if
(
size
>
count
)
size
=
count
;
lock_kernel
();
...
...
@@ -1351,7 +1345,7 @@ static int tty_open(struct inode * inode, struct file * filp)
set_bit
(
TTY_PTY_LOCK
,
&
tty
->
flags
);
/* LOCK THE SLAVE */
minor
-=
driver
->
minor_start
;
devpts_pty_new
(
driver
->
other
->
name_base
+
minor
,
MKDEV
(
driver
->
other
->
major
,
minor
+
driver
->
other
->
minor_start
));
tty_register_dev
fs
(
&
pts_driver
[
major
],
DEVFS_FL_DEFAULT
,
tty_register_dev
ice
(
&
pts_driver
[
major
]
,
pts_driver
[
major
].
minor_start
+
minor
);
noctty
=
1
;
goto
init_dev_done
;
...
...
@@ -2038,9 +2032,6 @@ void tty_default_put_char(struct tty_struct *tty, unsigned char ch)
tty
->
driver
.
write
(
tty
,
0
,
&
ch
,
1
);
}
/*
* Register a tty device described by <driver>, with minor number <minor>.
*/
void
tty_register_devfs
(
struct
tty_driver
*
driver
,
unsigned
int
flags
,
unsigned
minor
)
{
#ifdef CONFIG_DEVFS_FS
...
...
@@ -2077,8 +2068,21 @@ void tty_unregister_devfs (struct tty_driver *driver, unsigned minor)
devfs_remove
(
driver
->
name
,
minor
-
driver
->
minor_start
+
driver
->
name_base
);
}
EXPORT_SYMBOL
(
tty_register_devfs
);
EXPORT_SYMBOL
(
tty_unregister_devfs
);
/*
* Register a tty device described by <driver>, with minor number <minor>.
*/
void
tty_register_device
(
struct
tty_driver
*
driver
,
unsigned
minor
)
{
tty_register_devfs
(
driver
,
0
,
minor
);
}
void
tty_unregister_device
(
struct
tty_driver
*
driver
,
unsigned
minor
)
{
tty_unregister_devfs
(
driver
,
minor
);
}
EXPORT_SYMBOL
(
tty_register_device
);
EXPORT_SYMBOL
(
tty_unregister_device
);
/*
* Called by a tty driver to register itself.
...
...
@@ -2104,7 +2108,7 @@ int tty_register_driver(struct tty_driver *driver)
if
(
!
(
driver
->
flags
&
TTY_DRIVER_NO_DEVFS
)
)
{
for
(
i
=
0
;
i
<
driver
->
num
;
i
++
)
tty_register_dev
fs
(
driver
,
0
,
driver
->
minor_start
+
i
);
tty_register_dev
ice
(
driver
,
driver
->
minor_start
+
i
);
}
proc_tty_register_driver
(
driver
);
return
error
;
...
...
@@ -2159,7 +2163,7 @@ int tty_unregister_driver(struct tty_driver *driver)
driver
->
termios_locked
[
i
]
=
NULL
;
kfree
(
tp
);
}
tty_unregister_dev
fs
(
driver
,
driver
->
minor_start
+
i
);
tty_unregister_dev
ice
(
driver
,
driver
->
minor_start
+
i
);
}
proc_tty_unregister_driver
(
driver
);
return
0
;
...
...
@@ -2261,12 +2265,19 @@ static struct tty_driver dev_console_driver;
extern
int
vty_init
(
void
);
#endif
struct
device_class
tty_devclass
=
{
.
name
=
"tty"
,
};
EXPORT_SYMBOL
(
tty_devclass
);
/*
* Ok, now we can initialize the rest of the tty devices and can count
* on memory allocations, interrupts etc..
*/
void
__init
tty_init
(
void
)
{
devclass_register
(
&
tty_devclass
);
/*
* dev_tty_driver and dev_console_driver are actually magic
* devices which get redirected at open time. Nevertheless,
...
...
drivers/char/vt.c
View file @
b8d399ae
...
...
@@ -2646,7 +2646,7 @@ static void __init con_init_devfs (void)
int
i
;
for
(
i
=
0
;
i
<
console_driver
.
num
;
i
++
)
tty_register_dev
fs
(
&
console_driver
,
DEVFS_FL_DEFAULT
,
tty_register_dev
ice
(
&
console_driver
,
console_driver
.
minor_start
+
i
);
}
...
...
drivers/serial/core.c
View file @
b8d399ae
...
...
@@ -2096,7 +2096,7 @@ __uart_register_port(struct uart_driver *drv, struct uart_state *state,
* Register the port whether it's detected or not. This allows
* setserial to be used to alter this ports parameters.
*/
tty_register_dev
fs
(
drv
->
tty_driver
,
0
,
drv
->
minor
+
port
->
line
);
tty_register_dev
ice
(
drv
->
tty_driver
,
drv
->
minor
+
port
->
line
);
if
(
port
->
type
!=
PORT_UNKNOWN
)
{
unsigned
long
flags
;
...
...
@@ -2153,7 +2153,7 @@ __uart_unregister_port(struct uart_driver *drv, struct uart_state *state)
/*
* Remove the devices from devfs
*/
tty_unregister_dev
fs
(
drv
->
tty_driver
,
drv
->
minor
+
port
->
line
);
tty_unregister_dev
ice
(
drv
->
tty_driver
,
drv
->
minor
+
port
->
line
);
/*
* Free the port IO and memory resources, if any.
...
...
drivers/tc/zs.c
View file @
b8d399ae
...
...
@@ -1971,9 +1971,9 @@ int __init zs_init(void)
printk
(
"ttyS%02d at 0x%08x (irq = %d)"
,
info
->
line
,
info
->
port
,
info
->
irq
);
printk
(
" is a Z85C30 SCC
\n
"
);
tty_register_dev
fs
(
&
serial_driver
,
0
,
tty_register_dev
ice
(
&
serial_driver
,
serial_driver
.
minor_start
+
info
->
line
);
tty_register_dev
fs
(
&
callout_driver
,
0
,
tty_register_dev
ice
(
&
callout_driver
,
callout_driver
.
minor_start
+
info
->
line
);
}
...
...
drivers/usb/class/bluetty.c
View file @
b8d399ae
...
...
@@ -1201,7 +1201,7 @@ static int usb_bluetooth_probe (struct usb_interface *intf,
bluetooth
,
endpoint
->
bInterval
);
/* initialize the devfs nodes for this device and let the user know what bluetooths we are bound to */
tty_register_dev
fs
(
&
bluetooth_tty_driver
,
0
,
minor
);
tty_register_dev
ice
(
&
bluetooth_tty_driver
,
minor
);
info
(
"Bluetooth converter now attached to ttyUB%d (or usb/ttub/%d for devfs)"
,
minor
,
minor
);
bluetooth_table
[
minor
]
=
bluetooth
;
...
...
@@ -1267,7 +1267,7 @@ static void usb_bluetooth_disconnect(struct usb_interface *intf)
if
(
bluetooth
->
interrupt_in_buffer
)
kfree
(
bluetooth
->
interrupt_in_buffer
);
tty_unregister_dev
fs
(
&
bluetooth_tty_driver
,
bluetooth
->
minor
);
tty_unregister_dev
ice
(
&
bluetooth_tty_driver
,
bluetooth
->
minor
);
for
(
i
=
0
;
i
<
NUM_BULK_URBS
;
++
i
)
{
if
(
bluetooth
->
write_urb_pool
[
i
])
{
...
...
drivers/usb/class/cdc-acm.c
View file @
b8d399ae
...
...
@@ -361,7 +361,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
usb_unlink_urb
(
acm
->
writeurb
);
usb_unlink_urb
(
acm
->
readurb
);
}
else
{
tty_unregister_dev
fs
(
&
acm_tty_driver
,
acm
->
minor
);
tty_unregister_dev
ice
(
&
acm_tty_driver
,
acm
->
minor
);
acm_table
[
acm
->
minor
]
=
NULL
;
usb_free_urb
(
acm
->
ctrlurb
);
usb_free_urb
(
acm
->
readurb
);
...
...
@@ -649,7 +649,7 @@ static int acm_probe (struct usb_interface *intf,
usb_driver_claim_interface
(
&
acm_driver
,
acm
->
iface
+
0
,
acm
);
usb_driver_claim_interface
(
&
acm_driver
,
acm
->
iface
+
1
,
acm
);
tty_register_dev
fs
(
&
acm_tty_driver
,
0
,
minor
);
tty_register_dev
ice
(
&
acm_tty_driver
,
minor
);
acm_table
[
minor
]
=
acm
;
usb_set_intfdata
(
intf
,
acm
);
...
...
@@ -681,7 +681,7 @@ static void acm_disconnect(struct usb_interface *intf)
usb_driver_release_interface
(
&
acm_driver
,
acm
->
iface
+
1
);
if
(
!
acm
->
used
)
{
tty_unregister_dev
fs
(
&
acm_tty_driver
,
acm
->
minor
);
tty_unregister_dev
ice
(
&
acm_tty_driver
,
acm
->
minor
);
acm_table
[
acm
->
minor
]
=
NULL
;
usb_free_urb
(
acm
->
ctrlurb
);
usb_free_urb
(
acm
->
readurb
);
...
...
drivers/usb/serial/bus.c
View file @
b8d399ae
...
...
@@ -78,7 +78,7 @@ static int usb_serial_device_probe (struct device *dev)
minor
=
port
->
number
;
tty_register_dev
fs
(
&
usb_serial_tty_driver
,
0
,
minor
);
tty_register_dev
ice
(
&
usb_serial_tty_driver
,
minor
);
dev_info
(
*
dev
,
"%s converter now attached to ttyUSB%d (or usb/tts/%d for devfs)
\n
"
,
driver
->
name
,
minor
,
minor
);
...
...
@@ -110,7 +110,7 @@ static int usb_serial_device_remove (struct device *dev)
}
exit:
minor
=
port
->
number
;
tty_unregister_dev
fs
(
&
usb_serial_tty_driver
,
minor
);
tty_unregister_dev
ice
(
&
usb_serial_tty_driver
,
minor
);
dev_info
(
*
dev
,
"%s converter now disconnected from ttyUSB%d
\n
"
,
driver
->
name
,
minor
);
...
...
@@ -128,6 +128,7 @@ int usb_serial_bus_register(struct usb_serial_device_type *device)
device
->
driver
.
bus
=
&
usb_serial_bus_type
;
device
->
driver
.
probe
=
usb_serial_device_probe
;
device
->
driver
.
remove
=
usb_serial_device_remove
;
device
->
driver
.
devclass
=
&
tty_devclass
;
retval
=
driver_register
(
&
device
->
driver
);
...
...
include/linux/tty.h
View file @
b8d399ae
...
...
@@ -379,9 +379,8 @@ extern void start_tty(struct tty_struct * tty);
extern
int
tty_register_ldisc
(
int
disc
,
struct
tty_ldisc
*
new_ldisc
);
extern
int
tty_register_driver
(
struct
tty_driver
*
driver
);
extern
int
tty_unregister_driver
(
struct
tty_driver
*
driver
);
extern
void
tty_register_devfs
(
struct
tty_driver
*
driver
,
unsigned
int
flags
,
unsigned
minor
);
extern
void
tty_unregister_devfs
(
struct
tty_driver
*
driver
,
unsigned
minor
);
extern
void
tty_register_device
(
struct
tty_driver
*
driver
,
unsigned
minor
);
extern
void
tty_unregister_device
(
struct
tty_driver
*
driver
,
unsigned
minor
);
extern
int
tty_read_raw_data
(
struct
tty_struct
*
tty
,
unsigned
char
*
bufp
,
int
buflen
);
extern
void
tty_write_message
(
struct
tty_struct
*
tty
,
char
*
msg
);
...
...
include/linux/tty_driver.h
View file @
b8d399ae
...
...
@@ -227,4 +227,6 @@ extern struct list_head tty_drivers;
#define SERIAL_TYPE_NORMAL 1
#define SERIAL_TYPE_CALLOUT 2
extern
struct
device_class
tty_devclass
;
#endif
/* #ifdef _LINUX_TTY_DRIVER_H */
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