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
3ef6008c
Commit
3ef6008c
authored
Aug 28, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: kl5usb105 driver: fixed __FUNCTION__ usages.
parent
d314c356
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
56 deletions
+52
-56
drivers/usb/serial/kl5kusb105.c
drivers/usb/serial/kl5kusb105.c
+52
-56
No files found.
drivers/usb/serial/kl5kusb105.c
View file @
3ef6008c
...
@@ -135,7 +135,7 @@ static struct usb_serial_device_type kl5kusb105d_device = {
...
@@ -135,7 +135,7 @@ static struct usb_serial_device_type kl5kusb105d_device = {
.
read_bulk_callback
=
klsi_105_read_bulk_callback
,
.
read_bulk_callback
=
klsi_105_read_bulk_callback
,
.
ioctl
=
klsi_105_ioctl
,
.
ioctl
=
klsi_105_ioctl
,
.
set_termios
=
klsi_105_set_termios
,
.
set_termios
=
klsi_105_set_termios
,
/*
break_ctl:
klsi_105_break_ctl,*/
/*
.break_ctl =
klsi_105_break_ctl,*/
.
attach
=
klsi_105_startup
,
.
attach
=
klsi_105_startup
,
.
shutdown
=
klsi_105_shutdown
,
.
shutdown
=
klsi_105_shutdown
,
.
throttle
=
klsi_105_throttle
,
.
throttle
=
klsi_105_throttle
,
...
@@ -187,7 +187,8 @@ static int klsi_105_chg_port_settings(struct usb_serial *serial,
...
@@ -187,7 +187,8 @@ static int klsi_105_chg_port_settings(struct usb_serial *serial,
KLSI_TIMEOUT
);
KLSI_TIMEOUT
);
if
(
rc
<
0
)
if
(
rc
<
0
)
err
(
"Change port settings failed (error = %d)"
,
rc
);
err
(
"Change port settings failed (error = %d)"
,
rc
);
info
(
__FUNCTION__
" - %d byte block, baudrate %x, databits %d, u1 %d, u2 %d"
,
info
(
"%s - %d byte block, baudrate %x, databits %d, u1 %d, u2 %d"
,
__FUNCTION__
,
settings
->
pktlen
,
settings
->
pktlen
,
settings
->
baudrate
,
settings
->
databits
,
settings
->
baudrate
,
settings
->
databits
,
settings
->
unknown1
,
settings
->
unknown2
);
settings
->
unknown1
,
settings
->
unknown2
);
...
@@ -218,7 +219,7 @@ static int klsi_105_get_line_state(struct usb_serial *serial,
...
@@ -218,7 +219,7 @@ static int klsi_105_get_line_state(struct usb_serial *serial,
__u8
status_buf
[
KLSI_STATUSBUF_LEN
]
=
{
-
1
,
-
1
};
__u8
status_buf
[
KLSI_STATUSBUF_LEN
]
=
{
-
1
,
-
1
};
__u16
status
;
__u16
status
;
info
(
__FUNCTION__
" - sending SIO Poll request"
);
info
(
"%s - sending SIO Poll request"
,
__FUNCTION__
);
rc
=
usb_control_msg
(
serial
->
dev
,
usb_rcvctrlpipe
(
serial
->
dev
,
0
),
rc
=
usb_control_msg
(
serial
->
dev
,
usb_rcvctrlpipe
(
serial
->
dev
,
0
),
KL5KUSB105A_SIO_POLL
,
KL5KUSB105A_SIO_POLL
,
USB_TYPE_VENDOR
|
USB_DIR_IN
,
USB_TYPE_VENDOR
|
USB_DIR_IN
,
...
@@ -232,7 +233,7 @@ static int klsi_105_get_line_state(struct usb_serial *serial,
...
@@ -232,7 +233,7 @@ static int klsi_105_get_line_state(struct usb_serial *serial,
else
{
else
{
status
=
status_buf
[
0
]
+
(
status_buf
[
1
]
<<
8
);
status
=
status_buf
[
0
]
+
(
status_buf
[
1
]
<<
8
);
info
(
__FUNCTION__
" - read status %x %x"
,
info
(
"%s - read status %x %x"
,
__FUNCTION__
,
status_buf
[
0
],
status_buf
[
1
]);
status_buf
[
0
],
status_buf
[
1
]);
*
line_state_p
=
klsi_105_status2linestate
(
status
);
*
line_state_p
=
klsi_105_status2linestate
(
status
);
...
@@ -260,7 +261,7 @@ static int klsi_105_startup (struct usb_serial *serial)
...
@@ -260,7 +261,7 @@ static int klsi_105_startup (struct usb_serial *serial)
serial
->
port
[
i
].
private
=
kmalloc
(
sizeof
(
struct
klsi_105_private
),
serial
->
port
[
i
].
private
=
kmalloc
(
sizeof
(
struct
klsi_105_private
),
GFP_KERNEL
);
GFP_KERNEL
);
if
(
!
serial
->
port
[
i
].
private
)
{
if
(
!
serial
->
port
[
i
].
private
)
{
dbg
(
__FUNCTION__
"kmalloc for klsi_105_private failed."
);
dbg
(
"%skmalloc for klsi_105_private failed."
,
__FUNCTION__
);
return
(
-
1
);
/* error */
return
(
-
1
);
/* error */
}
}
priv
=
(
struct
klsi_105_private
*
)
serial
->
port
[
i
].
private
;
priv
=
(
struct
klsi_105_private
*
)
serial
->
port
[
i
].
private
;
...
@@ -290,8 +291,7 @@ static int klsi_105_startup (struct usb_serial *serial)
...
@@ -290,8 +291,7 @@ static int klsi_105_startup (struct usb_serial *serial)
urb
->
transfer_buffer
=
kmalloc
(
URB_TRANSFER_BUFFER_SIZE
,
urb
->
transfer_buffer
=
kmalloc
(
URB_TRANSFER_BUFFER_SIZE
,
GFP_KERNEL
);
GFP_KERNEL
);
if
(
!
urb
->
transfer_buffer
)
{
if
(
!
urb
->
transfer_buffer
)
{
err
(
__FUNCTION__
err
(
"%s - out of memory for urb buffers."
,
__FUNCTION__
);
" - out of memory for urb buffers."
);
continue
;
continue
;
}
}
}
}
...
@@ -308,7 +308,7 @@ static void klsi_105_shutdown (struct usb_serial *serial)
...
@@ -308,7 +308,7 @@ static void klsi_105_shutdown (struct usb_serial *serial)
{
{
int
i
;
int
i
;
dbg
(
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
/* stop reads and writes on all ports */
/* stop reads and writes on all ports */
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
...
@@ -354,7 +354,7 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp)
...
@@ -354,7 +354,7 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp)
int
i
;
int
i
;
unsigned
long
line_state
;
unsigned
long
line_state
;
dbg
(
__FUNCTION__
" port %d"
,
port
->
number
);
dbg
(
"%s port %d"
,
__FUNCTION__
,
port
->
number
);
/* force low_latency on so that our tty_push actually forces
/* force low_latency on so that our tty_push actually forces
* the data through
* the data through
...
@@ -394,8 +394,7 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp)
...
@@ -394,8 +394,7 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp)
rc
=
usb_submit_urb
(
port
->
read_urb
,
GFP_KERNEL
);
rc
=
usb_submit_urb
(
port
->
read_urb
,
GFP_KERNEL
);
if
(
rc
)
{
if
(
rc
)
{
err
(
__FUNCTION__
err
(
"%s - failed submitting read urb, error %d"
,
__FUNCTION__
,
rc
);
" - failed submitting read urb, error %d"
,
rc
);
retval
=
rc
;
retval
=
rc
;
goto
exit
;
goto
exit
;
}
}
...
@@ -412,13 +411,12 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp)
...
@@ -412,13 +411,12 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp)
err
(
"Enabling read failed (error = %d)"
,
rc
);
err
(
"Enabling read failed (error = %d)"
,
rc
);
retval
=
rc
;
retval
=
rc
;
}
else
}
else
dbg
(
__FUNCTION__
" - enabled reading"
);
dbg
(
"%s - enabled reading"
,
__FUNCTION__
);
rc
=
klsi_105_get_line_state
(
serial
,
&
line_state
);
rc
=
klsi_105_get_line_state
(
serial
,
&
line_state
);
if
(
rc
>=
0
)
{
if
(
rc
>=
0
)
{
priv
->
line_state
=
line_state
;
priv
->
line_state
=
line_state
;
dbg
(
__FUNCTION__
dbg
(
"%s - read line state 0x%lx"
,
__FUNCTION__
,
line_state
);
" - read line state 0x%lx"
,
line_state
);
retval
=
0
;
retval
=
0
;
}
else
}
else
retval
=
rc
;
retval
=
rc
;
...
@@ -434,7 +432,8 @@ static void klsi_105_close (struct usb_serial_port *port, struct file *filp)
...
@@ -434,7 +432,8 @@ static void klsi_105_close (struct usb_serial_port *port, struct file *filp)
struct
klsi_105_private
*
priv
struct
klsi_105_private
*
priv
=
(
struct
klsi_105_private
*
)
port
->
private
;
=
(
struct
klsi_105_private
*
)
port
->
private
;
int
rc
;
int
rc
;
dbg
(
__FUNCTION__
" port %d"
,
port
->
number
);
dbg
(
"%s port %d"
,
__FUNCTION__
,
port
->
number
);
serial
=
get_usb_serial
(
port
,
__FUNCTION__
);
serial
=
get_usb_serial
(
port
,
__FUNCTION__
);
...
@@ -480,7 +479,7 @@ static int klsi_105_write (struct usb_serial_port *port, int from_user,
...
@@ -480,7 +479,7 @@ static int klsi_105_write (struct usb_serial_port *port, int from_user,
int
result
,
size
;
int
result
,
size
;
int
bytes_sent
=
0
;
int
bytes_sent
=
0
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
while
(
count
>
0
)
{
while
(
count
>
0
)
{
/* try to find a free urb (write 0 bytes if none) */
/* try to find a free urb (write 0 bytes if none) */
...
@@ -492,21 +491,21 @@ static int klsi_105_write (struct usb_serial_port *port, int from_user,
...
@@ -492,21 +491,21 @@ static int klsi_105_write (struct usb_serial_port *port, int from_user,
for
(
i
=
0
;
i
<
NUM_URBS
;
i
++
)
{
for
(
i
=
0
;
i
<
NUM_URBS
;
i
++
)
{
if
(
priv
->
write_urb_pool
[
i
]
->
status
!=
-
EINPROGRESS
)
{
if
(
priv
->
write_urb_pool
[
i
]
->
status
!=
-
EINPROGRESS
)
{
urb
=
priv
->
write_urb_pool
[
i
];
urb
=
priv
->
write_urb_pool
[
i
];
dbg
(
__FUNCTION__
" - using pool URB %d"
,
i
);
dbg
(
"%s - using pool URB %d"
,
__FUNCTION__
,
i
);
break
;
break
;
}
}
}
}
spin_unlock_irqrestore
(
&
priv
->
write_urb_pool_lock
,
flags
);
spin_unlock_irqrestore
(
&
priv
->
write_urb_pool_lock
,
flags
);
if
(
urb
==
NULL
)
{
if
(
urb
==
NULL
)
{
dbg
(
__FUNCTION__
" - no more free urbs"
);
dbg
(
"%s - no more free urbs"
,
__FUNCTION__
);
goto
exit
;
goto
exit
;
}
}
if
(
urb
->
transfer_buffer
==
NULL
)
{
if
(
urb
->
transfer_buffer
==
NULL
)
{
urb
->
transfer_buffer
=
kmalloc
(
URB_TRANSFER_BUFFER_SIZE
,
GFP_ATOMIC
);
urb
->
transfer_buffer
=
kmalloc
(
URB_TRANSFER_BUFFER_SIZE
,
GFP_ATOMIC
);
if
(
urb
->
transfer_buffer
==
NULL
)
{
if
(
urb
->
transfer_buffer
==
NULL
)
{
err
(
__FUNCTION__
" - no more kernel memory..."
);
err
(
"%s - no more kernel memory..."
,
__FUNCTION__
);
goto
exit
;
goto
exit
;
}
}
}
}
...
@@ -540,8 +539,7 @@ static int klsi_105_write (struct usb_serial_port *port, int from_user,
...
@@ -540,8 +539,7 @@ static int klsi_105_write (struct usb_serial_port *port, int from_user,
/* send the data out the bulk port */
/* send the data out the bulk port */
result
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
);
result
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
);
if
(
result
)
{
if
(
result
)
{
err
(
__FUNCTION__
err
(
"%s - failed submitting write urb, error %d"
,
__FUNCTION__
,
result
);
" - failed submitting write urb, error %d"
,
result
);
goto
exit
;
goto
exit
;
}
}
buf
+=
size
;
buf
+=
size
;
...
@@ -559,15 +557,15 @@ static void klsi_105_write_bulk_callback ( struct urb *urb)
...
@@ -559,15 +557,15 @@ static void klsi_105_write_bulk_callback ( struct urb *urb)
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
urb
->
context
;
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
urb
->
context
;
struct
usb_serial
*
serial
=
port
->
serial
;
struct
usb_serial
*
serial
=
port
->
serial
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
if
(
!
serial
)
{
if
(
!
serial
)
{
dbg
(
__FUNCTION__
" - bad serial pointer, exiting"
);
dbg
(
"%s - bad serial pointer, exiting"
,
__FUNCTION__
);
return
;
return
;
}
}
if
(
urb
->
status
)
{
if
(
urb
->
status
)
{
dbg
(
__FUNCTION__
" - nonzero write bulk status received: %d"
,
dbg
(
"%s - nonzero write bulk status received: %d"
,
__FUNCTION__
,
urb
->
status
);
urb
->
status
);
return
;
return
;
}
}
...
@@ -599,7 +597,7 @@ static int klsi_105_chars_in_buffer (struct usb_serial_port *port)
...
@@ -599,7 +597,7 @@ static int klsi_105_chars_in_buffer (struct usb_serial_port *port)
spin_unlock_irqrestore
(
&
priv
->
write_urb_pool_lock
,
flags
);
spin_unlock_irqrestore
(
&
priv
->
write_urb_pool_lock
,
flags
);
dbg
(
__FUNCTION__
" - returns %d"
,
chars
);
dbg
(
"%s - returns %d"
,
__FUNCTION__
,
chars
);
return
(
chars
);
return
(
chars
);
}
}
...
@@ -620,7 +618,7 @@ static int klsi_105_write_room (struct usb_serial_port *port)
...
@@ -620,7 +618,7 @@ static int klsi_105_write_room (struct usb_serial_port *port)
spin_unlock_irqrestore
(
&
priv
->
write_urb_pool_lock
,
flags
);
spin_unlock_irqrestore
(
&
priv
->
write_urb_pool_lock
,
flags
);
dbg
(
__FUNCTION__
" - returns %d"
,
room
);
dbg
(
"%s - returns %d"
,
__FUNCTION__
,
room
);
return
(
room
);
return
(
room
);
}
}
...
@@ -636,16 +634,16 @@ static void klsi_105_read_bulk_callback (struct urb *urb)
...
@@ -636,16 +634,16 @@ static void klsi_105_read_bulk_callback (struct urb *urb)
unsigned
char
*
data
=
urb
->
transfer_buffer
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
int
rc
;
int
rc
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
/* The urb might have been killed. */
/* The urb might have been killed. */
if
(
urb
->
status
)
{
if
(
urb
->
status
)
{
dbg
(
__FUNCTION__
" - nonzero read bulk status received: %d"
,
dbg
(
"%s - nonzero read bulk status received: %d"
,
__FUNCTION__
,
urb
->
status
);
urb
->
status
);
return
;
return
;
}
}
if
(
!
serial
)
{
if
(
!
serial
)
{
dbg
(
__FUNCTION__
" - bad serial pointer, exiting"
);
dbg
(
"%s - bad serial pointer, exiting"
,
__FUNCTION__
);
return
;
return
;
}
}
...
@@ -654,10 +652,10 @@ static void klsi_105_read_bulk_callback (struct urb *urb)
...
@@ -654,10 +652,10 @@ static void klsi_105_read_bulk_callback (struct urb *urb)
*/
*/
if
(
urb
->
actual_length
==
0
)
{
if
(
urb
->
actual_length
==
0
)
{
/* empty urbs seem to happen, we ignore them */
/* empty urbs seem to happen, we ignore them */
/* dbg(
__FUNCTION__ " - emtpy URB"
); */
/* dbg(
"%s - emtpy URB", __FUNCTION__
); */
;
;
}
else
if
(
urb
->
actual_length
<=
2
)
{
}
else
if
(
urb
->
actual_length
<=
2
)
{
dbg
(
__FUNCTION__
" - size %d URB not understood"
,
dbg
(
"%s - size %d URB not understood"
,
__FUNCTION__
,
urb
->
actual_length
);
urb
->
actual_length
);
usb_serial_debug_data
(
__FILE__
,
__FUNCTION__
,
urb
->
actual_length
,
data
);
usb_serial_debug_data
(
__FILE__
,
__FUNCTION__
,
urb
->
actual_length
,
data
);
}
else
{
}
else
{
...
@@ -675,9 +673,8 @@ static void klsi_105_read_bulk_callback (struct urb *urb)
...
@@ -675,9 +673,8 @@ static void klsi_105_read_bulk_callback (struct urb *urb)
urb
->
actual_length
,
data
);
urb
->
actual_length
,
data
);
if
(
bytes_sent
+
2
>
urb
->
actual_length
)
{
if
(
bytes_sent
+
2
>
urb
->
actual_length
)
{
dbg
(
__FUNCTION__
dbg
(
"%s - trying to read more data than available"
" - trying to read more data than available"
" (%d vs. %d)"
,
__FUNCTION__
,
" (%d vs. %d)"
,
bytes_sent
+
2
,
urb
->
actual_length
);
bytes_sent
+
2
,
urb
->
actual_length
);
/* cap at implied limit */
/* cap at implied limit */
bytes_sent
=
urb
->
actual_length
-
2
;
bytes_sent
=
urb
->
actual_length
-
2
;
...
@@ -706,8 +703,7 @@ static void klsi_105_read_bulk_callback (struct urb *urb)
...
@@ -706,8 +703,7 @@ static void klsi_105_read_bulk_callback (struct urb *urb)
port
);
port
);
rc
=
usb_submit_urb
(
port
->
read_urb
,
GFP_ATOMIC
);
rc
=
usb_submit_urb
(
port
->
read_urb
,
GFP_ATOMIC
);
if
(
rc
)
if
(
rc
)
err
(
__FUNCTION__
err
(
"%s - failed resubmitting read urb, error %d"
,
__FUNCTION__
,
rc
);
" - failed resubmitting read urb, error %d"
,
rc
);
}
/* klsi_105_read_bulk_callback */
}
/* klsi_105_read_bulk_callback */
...
@@ -727,7 +723,7 @@ static void klsi_105_set_termios (struct usb_serial_port *port,
...
@@ -727,7 +723,7 @@ static void klsi_105_set_termios (struct usb_serial_port *port,
if
(
(
cflag
&
CBAUD
)
!=
(
old_cflag
&
CBAUD
)
)
{
if
(
(
cflag
&
CBAUD
)
!=
(
old_cflag
&
CBAUD
)
)
{
/* reassert DTR and (maybe) RTS on transition from B0 */
/* reassert DTR and (maybe) RTS on transition from B0 */
if
(
(
old_cflag
&
CBAUD
)
==
B0
)
{
if
(
(
old_cflag
&
CBAUD
)
==
B0
)
{
dbg
(
__FUNCTION__
": baud was B0"
);
dbg
(
"%s: baud was B0"
,
__FUNCTION__
);
#if 0
#if 0
priv->control_state |= TIOCM_DTR;
priv->control_state |= TIOCM_DTR;
/* don't set RTS if using hardware flow control */
/* don't set RTS if using hardware flow control */
...
@@ -765,7 +761,7 @@ static void klsi_105_set_termios (struct usb_serial_port *port,
...
@@ -765,7 +761,7 @@ static void klsi_105_set_termios (struct usb_serial_port *port,
break
;
break
;
}
}
if
((
cflag
&
CBAUD
)
==
B0
)
{
if
((
cflag
&
CBAUD
)
==
B0
)
{
dbg
(
__FUNCTION__
": baud is B0"
);
dbg
(
"%s: baud is B0"
,
__FUNCTION__
);
/* Drop RTS and DTR */
/* Drop RTS and DTR */
/* maybe this should be simulated by sending read
/* maybe this should be simulated by sending read
* disable and read enable messages?
* disable and read enable messages?
...
@@ -782,10 +778,10 @@ static void klsi_105_set_termios (struct usb_serial_port *port,
...
@@ -782,10 +778,10 @@ static void klsi_105_set_termios (struct usb_serial_port *port,
/* set the number of data bits */
/* set the number of data bits */
switch
(
cflag
&
CSIZE
)
{
switch
(
cflag
&
CSIZE
)
{
case
CS5
:
case
CS5
:
dbg
(
__FUNCTION__
" - 5 bits/byte not supported"
);
dbg
(
"%s - 5 bits/byte not supported"
,
__FUNCTION__
);
return
;
return
;
case
CS6
:
case
CS6
:
dbg
(
__FUNCTION__
" - 6 bits/byte not supported"
);
dbg
(
"%s - 6 bits/byte not supported"
,
__FUNCTION__
);
return
;
return
;
case
CS7
:
case
CS7
:
priv
->
cfg
.
databits
=
kl5kusb105a_dtb_7
;
priv
->
cfg
.
databits
=
kl5kusb105a_dtb_7
;
...
@@ -856,7 +852,7 @@ static void mct_u232_break_ctl( struct usb_serial_port *port, int break_state )
...
@@ -856,7 +852,7 @@ static void mct_u232_break_ctl( struct usb_serial_port *port, int break_state )
struct mct_u232_private *priv = (struct mct_u232_private *)port->private;
struct mct_u232_private *priv = (struct mct_u232_private *)port->private;
unsigned char lcr = priv->last_lcr;
unsigned char lcr = priv->last_lcr;
dbg
(__FUNCTION__ "state=%d"
, break_state);
dbg
("%sstate=%d", __FUNCTION__
, break_state);
if (break_state)
if (break_state)
lcr |= MCT_U232_SET_BREAK;
lcr |= MCT_U232_SET_BREAK;
...
@@ -872,14 +868,14 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
...
@@ -872,14 +868,14 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
struct
klsi_105_private
*
priv
=
(
struct
klsi_105_private
*
)
port
->
private
;
struct
klsi_105_private
*
priv
=
(
struct
klsi_105_private
*
)
port
->
private
;
int
mask
;
int
mask
;
dbg
(
__FUNCTION__
"cmd=0x%x"
,
cmd
);
dbg
(
"%scmd=0x%x"
,
__FUNCTION__
,
cmd
);
/* Based on code from acm.c and others */
/* Based on code from acm.c and others */
switch
(
cmd
)
{
switch
(
cmd
)
{
case
TIOCMGET
:
{
case
TIOCMGET
:
{
int
rc
;
int
rc
;
unsigned
long
line_state
;
unsigned
long
line_state
;
dbg
(
__FUNCTION__
" - TIOCMGET request, just guessing"
);
dbg
(
"%s - TIOCMGET request, just guessing"
,
__FUNCTION__
);
rc
=
klsi_105_get_line_state
(
serial
,
&
line_state
);
rc
=
klsi_105_get_line_state
(
serial
,
&
line_state
);
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
...
@@ -888,7 +884,7 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
...
@@ -888,7 +884,7 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
return
-
ENOIOCTLCMD
;
return
-
ENOIOCTLCMD
;
}
else
{
}
else
{
priv
->
line_state
=
line_state
;
priv
->
line_state
=
line_state
;
dbg
(
__FUNCTION__
" - read line state 0x%lx"
,
line_state
);
dbg
(
"%s - read line state 0x%lx"
,
__FUNCTION__
,
line_state
);
}
}
return
put_user
(
priv
->
line_state
,
(
unsigned
long
*
)
arg
);
return
put_user
(
priv
->
line_state
,
(
unsigned
long
*
)
arg
);
};
};
...
@@ -903,10 +899,10 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
...
@@ -903,10 +899,10 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
/* RTS needs set */
/* RTS needs set */
if
(
((
cmd
==
TIOCMSET
)
&&
(
mask
&
TIOCM_RTS
))
||
if
(
((
cmd
==
TIOCMSET
)
&&
(
mask
&
TIOCM_RTS
))
||
(
cmd
==
TIOCMBIS
)
)
(
cmd
==
TIOCMBIS
)
)
dbg
(
__FUNCTION__
" - set RTS not handled"
);
dbg
(
"%s - set RTS not handled"
,
__FUNCTION__
);
/* priv->control_state |= TIOCM_RTS; */
/* priv->control_state |= TIOCM_RTS; */
else
else
dbg
(
__FUNCTION__
" - clear RTS not handled"
);
dbg
(
"%s - clear RTS not handled"
,
__FUNCTION__
);
/* priv->control_state &= ~TIOCM_RTS; */
/* priv->control_state &= ~TIOCM_RTS; */
}
}
...
@@ -914,10 +910,10 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
...
@@ -914,10 +910,10 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
/* DTR needs set */
/* DTR needs set */
if
(
((
cmd
==
TIOCMSET
)
&&
(
mask
&
TIOCM_DTR
))
||
if
(
((
cmd
==
TIOCMSET
)
&&
(
mask
&
TIOCM_DTR
))
||
(
cmd
==
TIOCMBIS
)
)
(
cmd
==
TIOCMBIS
)
)
dbg
(
__FUNCTION__
" - set DTR not handled"
);
dbg
(
"%s - set DTR not handled"
,
__FUNCTION__
);
/* priv->control_state |= TIOCM_DTR; */
/* priv->control_state |= TIOCM_DTR; */
else
else
dbg
(
__FUNCTION__
" - clear DTR not handled"
);
dbg
(
"%s - clear DTR not handled"
,
__FUNCTION__
);
/* priv->control_state &= ~TIOCM_DTR; */
/* priv->control_state &= ~TIOCM_DTR; */
}
}
/*
/*
...
@@ -928,19 +924,19 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
...
@@ -928,19 +924,19 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
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)*/
/* TODO */
/* TODO */
dbg
(
__FUNCTION__
" - TIOCMIWAIT not handled"
);
dbg
(
"%s - TIOCMIWAIT not handled"
,
__FUNCTION__
);
return
-
ENOIOCTLCMD
;
return
-
ENOIOCTLCMD
;
case
TIOCGICOUNT
:
case
TIOCGICOUNT
:
/* return count of modemline transitions */
/* return count of modemline transitions */
/* TODO */
/* TODO */
dbg
(
__FUNCTION__
" - TIOCGICOUNT not handled"
);
dbg
(
"%s - TIOCGICOUNT not handled"
,
__FUNCTION__
);
return
-
ENOIOCTLCMD
;
return
-
ENOIOCTLCMD
;
case
TCGETS
:
{
case
TCGETS
:
{
/* return current info to caller */
/* return current info to caller */
int
retval
;
int
retval
;
dbg
(
__FUNCTION__
" - TCGETS data faked/incomplete"
);
dbg
(
"%s - TCGETS data faked/incomplete"
,
__FUNCTION__
);
retval
=
verify_area
(
VERIFY_WRITE
,
(
void
*
)
arg
,
retval
=
verify_area
(
VERIFY_WRITE
,
(
void
*
)
arg
,
sizeof
(
struct
termios
));
sizeof
(
struct
termios
));
...
@@ -956,7 +952,7 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
...
@@ -956,7 +952,7 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
/* set port termios to the one given by the user */
/* set port termios to the one given by the user */
int
retval
;
int
retval
;
dbg
(
__FUNCTION__
" - TCSETS not handled"
);
dbg
(
"%s - TCSETS not handled"
,
__FUNCTION__
);
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
retval
=
verify_area
(
VERIFY_READ
,
(
void
*
)
arg
,
sizeof
(
struct
termios
));
sizeof
(
struct
termios
));
...
@@ -982,7 +978,7 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
...
@@ -982,7 +978,7 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
return
-
ENOIOCTLCMD
;
return
-
ENOIOCTLCMD
;
}
}
default:
default:
dbg
(
__FUNCTION__
": arg not supported - 0x%04x"
,
cmd
);
dbg
(
"%s: arg not supported - 0x%04x"
,
__FUNCTION__
,
cmd
);
return
(
-
ENOIOCTLCMD
);
return
(
-
ENOIOCTLCMD
);
break
;
break
;
}
}
...
@@ -991,7 +987,7 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
...
@@ -991,7 +987,7 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
static
void
klsi_105_throttle
(
struct
usb_serial_port
*
port
)
static
void
klsi_105_throttle
(
struct
usb_serial_port
*
port
)
{
{
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
usb_unlink_urb
(
port
->
read_urb
);
usb_unlink_urb
(
port
->
read_urb
);
}
}
...
@@ -999,12 +995,12 @@ static void klsi_105_unthrottle (struct usb_serial_port *port)
...
@@ -999,12 +995,12 @@ static void klsi_105_unthrottle (struct usb_serial_port *port)
{
{
int
result
;
int
result
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
port
->
read_urb
->
dev
=
port
->
serial
->
dev
;
port
->
read_urb
->
dev
=
port
->
serial
->
dev
;
result
=
usb_submit_urb
(
port
->
read_urb
,
GFP_ATOMIC
);
result
=
usb_submit_urb
(
port
->
read_urb
,
GFP_ATOMIC
);
if
(
result
)
if
(
result
)
err
(
__FUNCTION__
" - failed submitting read urb, error %d"
,
err
(
"%s - failed submitting read urb, error %d"
,
__FUNCTION__
,
result
);
result
);
}
}
...
...
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