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
73330824
Commit
73330824
authored
Apr 23, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: digi_acceleport: add support for new tty tiocmget and tiocmset functions.
parent
6b69d085
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
24 deletions
+38
-24
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/digi_acceleport.c
+38
-24
No files found.
drivers/usb/serial/digi_acceleport.c
View file @
73330824
...
@@ -460,6 +460,9 @@ static void digi_set_termios( struct usb_serial_port *port,
...
@@ -460,6 +460,9 @@ static void digi_set_termios( struct usb_serial_port *port,
static
void
digi_break_ctl
(
struct
usb_serial_port
*
port
,
int
break_state
);
static
void
digi_break_ctl
(
struct
usb_serial_port
*
port
,
int
break_state
);
static
int
digi_ioctl
(
struct
usb_serial_port
*
port
,
struct
file
*
file
,
static
int
digi_ioctl
(
struct
usb_serial_port
*
port
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
);
unsigned
int
cmd
,
unsigned
long
arg
);
static
int
digi_tiocmget
(
struct
usb_serial_port
*
port
,
struct
file
*
file
);
static
int
digi_tiocmset
(
struct
usb_serial_port
*
port
,
struct
file
*
file
,
unsigned
int
set
,
unsigned
int
clear
);
static
int
digi_write
(
struct
usb_serial_port
*
port
,
int
from_user
,
static
int
digi_write
(
struct
usb_serial_port
*
port
,
int
from_user
,
const
unsigned
char
*
buf
,
int
count
);
const
unsigned
char
*
buf
,
int
count
);
static
void
digi_write_bulk_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
);
static
void
digi_write_bulk_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
);
...
@@ -526,6 +529,8 @@ static struct usb_serial_device_type digi_acceleport_2_device = {
...
@@ -526,6 +529,8 @@ static struct usb_serial_device_type digi_acceleport_2_device = {
.
ioctl
=
digi_ioctl
,
.
ioctl
=
digi_ioctl
,
.
set_termios
=
digi_set_termios
,
.
set_termios
=
digi_set_termios
,
.
break_ctl
=
digi_break_ctl
,
.
break_ctl
=
digi_break_ctl
,
.
tiocmget
=
digi_tiocmget
,
.
tiocmset
=
digi_tiocmset
,
.
attach
=
digi_startup
,
.
attach
=
digi_startup
,
.
shutdown
=
digi_shutdown
,
.
shutdown
=
digi_shutdown
,
};
};
...
@@ -551,6 +556,8 @@ static struct usb_serial_device_type digi_acceleport_4_device = {
...
@@ -551,6 +556,8 @@ static struct usb_serial_device_type digi_acceleport_4_device = {
.
ioctl
=
digi_ioctl
,
.
ioctl
=
digi_ioctl
,
.
set_termios
=
digi_set_termios
,
.
set_termios
=
digi_set_termios
,
.
break_ctl
=
digi_break_ctl
,
.
break_ctl
=
digi_break_ctl
,
.
tiocmget
=
digi_tiocmget
,
.
tiocmset
=
digi_tiocmset
,
.
attach
=
digi_startup
,
.
attach
=
digi_startup
,
.
shutdown
=
digi_shutdown
,
.
shutdown
=
digi_shutdown
,
};
};
...
@@ -1211,39 +1218,46 @@ static void digi_break_ctl( struct usb_serial_port *port, int break_state )
...
@@ -1211,39 +1218,46 @@ static void digi_break_ctl( struct usb_serial_port *port, int break_state )
}
}
static
int
digi_ioctl
(
struct
usb_serial_port
*
port
,
struct
file
*
file
,
static
int
digi_tiocmget
(
struct
usb_serial_port
*
port
,
struct
file
*
file
)
unsigned
int
cmd
,
unsigned
long
arg
)
{
{
struct
digi_port
*
priv
=
usb_get_serial_port_data
(
port
);
unsigned
int
val
;
unsigned
long
flags
;
dbg
(
"%s: TOP: port=%d"
,
__FUNCTION__
,
priv
->
dp_port_num
);
spin_lock_irqsave
(
&
priv
->
dp_port_lock
,
flags
);
val
=
priv
->
dp_modem_signals
;
spin_unlock_irqrestore
(
&
priv
->
dp_port_lock
,
flags
);
return
val
;
}
static
int
digi_tiocmset
(
struct
usb_serial_port
*
port
,
struct
file
*
file
,
unsigned
int
set
,
unsigned
int
clear
)
{
struct
digi_port
*
priv
=
usb_get_serial_port_data
(
port
);
struct
digi_port
*
priv
=
usb_get_serial_port_data
(
port
);
unsigned
int
val
;
unsigned
int
val
;
unsigned
long
flags
=
0
;
unsigned
long
flags
;
dbg
(
"%s: TOP: port=%d"
,
__FUNCTION__
,
priv
->
dp_port_num
);
dbg
(
"digi_ioctl: TOP: port=%d, cmd=0x%x"
,
priv
->
dp_port_num
,
cmd
);
spin_lock_irqsave
(
&
priv
->
dp_port_lock
,
flags
);
val
=
(
priv
->
dp_modem_signals
&
~
clear
)
|
set
;
spin_unlock_irqrestore
(
&
priv
->
dp_port_lock
,
flags
);
return
digi_set_modem_signals
(
port
,
val
,
1
);
}
switch
(
cmd
)
{
case
TIOCMGET
:
static
int
digi_ioctl
(
struct
usb_serial_port
*
port
,
struct
file
*
file
,
spin_lock_irqsave
(
&
priv
->
dp_port_lock
,
flags
);
unsigned
int
cmd
,
unsigned
long
arg
)
val
=
priv
->
dp_modem_signals
;
{
spin_unlock_irqrestore
(
&
priv
->
dp_port_lock
,
flags
);
if
(
copy_to_user
((
unsigned
int
*
)
arg
,
&
val
,
sizeof
(
int
))
)
return
(
-
EFAULT
);
return
(
0
);
case
TIOCMSET
:
struct
digi_port
*
priv
=
usb_get_serial_port_data
(
port
);
case
TIOCMBIS
:
case
TIOCMBIC
:
dbg
(
"digi_ioctl: TOP: port=%d, cmd=0x%x"
,
priv
->
dp_port_num
,
cmd
);
if
(
copy_from_user
(
&
val
,
(
unsigned
int
*
)
arg
,
sizeof
(
int
))
)
return
(
-
EFAULT
);
switch
(
cmd
)
{
spin_lock_irqsave
(
&
priv
->
dp_port_lock
,
flags
);
if
(
cmd
==
TIOCMBIS
)
val
=
priv
->
dp_modem_signals
|
val
;
else
if
(
cmd
==
TIOCMBIC
)
val
=
priv
->
dp_modem_signals
&
~
val
;
spin_unlock_irqrestore
(
&
priv
->
dp_port_lock
,
flags
);
return
(
digi_set_modem_signals
(
port
,
val
,
1
)
);
case
TIOCMIWAIT
:
case
TIOCMIWAIT
:
/* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/
/* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/
...
...
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