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
582aa136
Commit
582aa136
authored
Apr 23, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: usb-serial core: add support for new tty tiocmget and tiocmset functions.
parent
a899637c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-serial.c
+47
-0
drivers/usb/serial/usb-serial.h
drivers/usb/serial/usb-serial.h
+2
-0
No files found.
drivers/usb/serial/usb-serial.c
View file @
582aa136
...
...
@@ -785,6 +785,51 @@ static int serial_read_proc (char *page, char **start, off_t off, int count, int
return
((
count
<
begin
+
length
-
off
)
?
count
:
begin
+
length
-
off
);
}
static
int
serial_tiocmget
(
struct
tty_struct
*
tty
,
struct
file
*
file
)
{
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
tty
->
driver_data
;
struct
usb_serial
*
serial
=
get_usb_serial
(
port
,
__FUNCTION__
);
if
(
!
serial
)
goto
exit
;
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
if
(
!
port
->
open_count
)
{
dbg
(
"%s - port not open"
,
__FUNCTION__
);
goto
exit
;
}
if
(
serial
->
type
->
tiocmget
)
return
serial
->
type
->
tiocmget
(
port
,
file
);
exit:
return
-
EINVAL
;
}
static
int
serial_tiocmset
(
struct
tty_struct
*
tty
,
struct
file
*
file
,
unsigned
int
set
,
unsigned
int
clear
)
{
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
tty
->
driver_data
;
struct
usb_serial
*
serial
=
get_usb_serial
(
port
,
__FUNCTION__
);
if
(
!
serial
)
goto
exit
;
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
if
(
!
port
->
open_count
)
{
dbg
(
"%s - port not open"
,
__FUNCTION__
);
goto
exit
;
}
if
(
serial
->
type
->
tiocmset
)
return
serial
->
type
->
tiocmset
(
port
,
file
,
set
,
clear
);
exit:
return
-
EINVAL
;
}
void
usb_serial_port_softint
(
void
*
private
)
{
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
private
;
...
...
@@ -1286,6 +1331,8 @@ struct tty_driver usb_serial_tty_driver = {
.
break_ctl
=
serial_break
,
.
chars_in_buffer
=
serial_chars_in_buffer
,
.
read_proc
=
serial_read_proc
,
.
tiocmget
=
serial_tiocmget
,
.
tiocmset
=
serial_tiocmset
,
};
...
...
drivers/usb/serial/usb-serial.h
View file @
582aa136
...
...
@@ -251,6 +251,8 @@ struct usb_serial_device_type {
int
(
*
chars_in_buffer
)
(
struct
usb_serial_port
*
port
);
void
(
*
throttle
)
(
struct
usb_serial_port
*
port
);
void
(
*
unthrottle
)
(
struct
usb_serial_port
*
port
);
int
(
*
tiocmget
)
(
struct
usb_serial_port
*
port
,
struct
file
*
file
);
int
(
*
tiocmset
)
(
struct
usb_serial_port
*
port
,
struct
file
*
file
,
unsigned
int
set
,
unsigned
int
clear
);
void
(
*
read_int_callback
)(
struct
urb
*
urb
,
struct
pt_regs
*
regs
);
void
(
*
read_bulk_callback
)(
struct
urb
*
urb
,
struct
pt_regs
*
regs
);
...
...
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