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
fb3bedeb
Commit
fb3bedeb
authored
Aug 28, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: io_edgeport driver: fixed __FUNCTION__ usages.
parent
0925f212
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
142 additions
and
141 deletions
+142
-141
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/io_edgeport.c
+142
-141
No files found.
drivers/usb/serial/io_edgeport.c
View file @
fb3bedeb
...
...
@@ -590,7 +590,7 @@ static int get_string (struct usb_device *dev, int Id, char *string)
struct
usb_string_descriptor
StringDesc
;
struct
usb_string_descriptor
*
pStringDesc
;
dbg
(
__FUNCTION__
" - USB String ID = %d"
,
Id
);
dbg
(
"%s - USB String ID = %d"
,
__FUNCTION__
,
Id
);
if
(
!
usb_get_descriptor
(
dev
,
USB_DT_STRING
,
Id
,
&
StringDesc
,
sizeof
(
StringDesc
)))
{
return
0
;
...
...
@@ -625,7 +625,7 @@ static int get_string_desc (struct usb_device *dev, int Id, struct usb_string_de
struct usb_string_descriptor StringDesc;
struct usb_string_descriptor *pStringDesc;
dbg(
__FUNCTION__ " - USB String ID = %d"
, Id );
dbg(
"%s - USB String ID = %d", __FUNCTION__
, Id );
if (!usb_get_descriptor(dev, USB_DT_STRING, Id, &StringDesc, sizeof(StringDesc))) {
return 0;
...
...
@@ -760,14 +760,14 @@ static void edge_interrupt_callback (struct urb *urb)
int
portNumber
;
int
result
;
dbg
(
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
if
(
serial_paranoia_check
(
edge_serial
->
serial
,
__FUNCTION__
))
{
return
;
}
if
(
urb
->
status
)
{
dbg
(
__FUNCTION__
" - nonzero control read status received: %d"
,
urb
->
status
);
dbg
(
"%s - nonzero control read status received: %d"
,
__FUNCTION__
,
urb
->
status
);
return
;
}
...
...
@@ -779,7 +779,7 @@ static void edge_interrupt_callback (struct urb *urb)
bytes_avail
=
data
[
0
]
|
(
data
[
1
]
<<
8
);
if
(
bytes_avail
)
{
edge_serial
->
rxBytesAvail
+=
bytes_avail
;
dbg
(
__FUNCTION__
" - bytes_avail = %d, rxBytesAvail %d"
,
bytes_avail
,
edge_serial
->
rxBytesAvail
);
dbg
(
"%s - bytes_avail = %d, rxBytesAvail %d"
,
__FUNCTION__
,
bytes_avail
,
edge_serial
->
rxBytesAvail
);
if
((
edge_serial
->
rxBytesAvail
>
0
)
&&
(
edge_serial
->
read_urb
->
status
!=
-
EINPROGRESS
))
{
...
...
@@ -789,7 +789,7 @@ static void edge_interrupt_callback (struct urb *urb)
edge_serial
->
read_urb
->
dev
=
edge_serial
->
serial
->
dev
;
result
=
usb_submit_urb
(
edge_serial
->
read_urb
,
GFP_ATOMIC
);
if
(
result
)
{
dbg
(
__FUNCTION__
" - usb_submit_urb(read bulk) failed with result = %d"
,
result
);
dbg
(
"%s - usb_submit_urb(read bulk) failed with result = %d"
,
__FUNCTION__
,
result
);
}
}
}
...
...
@@ -805,7 +805,7 @@ static void edge_interrupt_callback (struct urb *urb)
edge_port
=
(
struct
edgeport_port
*
)
port
->
private
;
if
(
edge_port
->
open
)
{
edge_port
->
txCredits
+=
txCredits
;
dbg
(
__FUNCTION__
" - txcredits for port%d = %d"
,
portNumber
,
edge_port
->
txCredits
);
dbg
(
"%s - txcredits for port%d = %d"
,
__FUNCTION__
,
portNumber
,
edge_port
->
txCredits
);
/* tell the tty driver that something has changed */
if
(
edge_port
->
port
->
tty
)
...
...
@@ -835,14 +835,14 @@ static void edge_bulk_in_callback (struct urb *urb)
int
status
;
__u16
raw_data_length
;
dbg
(
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
if
(
serial_paranoia_check
(
edge_serial
->
serial
,
__FUNCTION__
))
{
return
;
}
if
(
urb
->
status
)
{
dbg
(
__FUNCTION__
" - nonzero read bulk status received: %d"
,
urb
->
status
);
dbg
(
"%s - nonzero read bulk status received: %d"
,
__FUNCTION__
,
urb
->
status
);
return
;
}
...
...
@@ -854,7 +854,7 @@ static void edge_bulk_in_callback (struct urb *urb)
/* decrement our rxBytes available by the number that we just got */
edge_serial
->
rxBytesAvail
-=
raw_data_length
;
dbg
(
__FUNCTION__
" - Received = %d, rxBytesAvail %d"
,
raw_data_length
,
edge_serial
->
rxBytesAvail
);
dbg
(
"%s - Received = %d, rxBytesAvail %d"
,
__FUNCTION__
,
raw_data_length
,
edge_serial
->
rxBytesAvail
);
process_rcvd_data
(
edge_serial
,
data
,
urb
->
actual_length
);
...
...
@@ -867,7 +867,7 @@ static void edge_bulk_in_callback (struct urb *urb)
edge_serial
->
read_urb
->
dev
=
edge_serial
->
serial
->
dev
;
status
=
usb_submit_urb
(
edge_serial
->
read_urb
,
GFP_ATOMIC
);
if
(
status
)
{
err
(
__FUNCTION__
" - usb_submit_urb(read bulk) failed, status = %d"
,
status
);
err
(
"%s - usb_submit_urb(read bulk) failed, status = %d"
,
__FUNCTION__
,
status
);
}
}
}
...
...
@@ -884,14 +884,14 @@ static void edge_bulk_out_data_callback (struct urb *urb)
struct
edgeport_port
*
edge_port
=
(
struct
edgeport_port
*
)
urb
->
context
;
struct
tty_struct
*
tty
;
dbg
(
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
if
(
port_paranoia_check
(
edge_port
->
port
,
__FUNCTION__
))
{
return
;
}
if
(
urb
->
status
)
{
dbg
(
__FUNCTION__
" - nonzero write bulk status received: %d"
,
urb
->
status
);
dbg
(
"%s - nonzero write bulk status received: %d"
,
__FUNCTION__
,
urb
->
status
);
}
tty
=
edge_port
->
port
->
tty
;
...
...
@@ -925,10 +925,10 @@ static void edge_bulk_out_cmd_callback (struct urb *urb)
struct
tty_struct
*
tty
;
int
status
=
urb
->
status
;
dbg
(
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
CmdUrbs
--
;
dbg
(
__FUNCTION__
" - FREE URB %p (outstanding %d)"
,
urb
,
CmdUrbs
);
dbg
(
"%s - FREE URB %p (outstanding %d)"
,
__FUNCTION__
,
urb
,
CmdUrbs
);
/* clean up the transfer buffer */
...
...
@@ -945,7 +945,7 @@ static void edge_bulk_out_cmd_callback (struct urb *urb)
}
if
(
status
)
{
dbg
(
__FUNCTION__
" - nonzero write bulk status received: %d"
,
status
);
dbg
(
"%s - nonzero write bulk status received: %d"
,
__FUNCTION__
,
status
);
return
;
}
...
...
@@ -983,7 +983,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
if
(
port_paranoia_check
(
port
,
__FUNCTION__
))
return
-
ENODEV
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
if
(
edge_port
==
NULL
)
return
-
ENODEV
;
...
...
@@ -1034,7 +1034,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
* this interrupt will continue as long as the edgeport is connected */
response
=
usb_submit_urb
(
edge_serial
->
interrupt_read_urb
,
GFP_KERNEL
);
if
(
response
)
{
err
(
__FUNCTION__
" - Error %d submitting control urb"
,
response
);
err
(
"%s - Error %d submitting control urb"
,
__FUNCTION__
,
response
);
}
}
...
...
@@ -1058,7 +1058,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
response
=
send_iosp_ext_cmd
(
edge_port
,
IOSP_CMD_OPEN_PORT
,
0
);
if
(
response
<
0
)
{
err
(
__FUNCTION__
" - error sending open port command"
);
err
(
"%s - error sending open port command"
,
__FUNCTION__
);
edge_port
->
openPending
=
FALSE
;
return
-
ENODEV
;
}
...
...
@@ -1071,7 +1071,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
if
(
edge_port
->
open
==
FALSE
)
{
/* open timed out */
dbg
(
__FUNCTION__
" - open timedout"
);
dbg
(
"%s - open timedout"
,
__FUNCTION__
);
edge_port
->
openPending
=
FALSE
;
return
-
ENODEV
;
}
...
...
@@ -1084,7 +1084,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
edge_port
->
txfifo
.
fifo
=
kmalloc
(
edge_port
->
maxTxCredits
,
GFP_KERNEL
);
if
(
!
edge_port
->
txfifo
.
fifo
)
{
dbg
(
__FUNCTION__
" - no memory"
);
dbg
(
"%s - no memory"
,
__FUNCTION__
);
edge_close
(
port
,
filp
);
return
-
ENOMEM
;
}
...
...
@@ -1093,14 +1093,14 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
edge_port
->
write_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
edge_port
->
write_urb
)
{
dbg
(
__FUNCTION__
" - no memory"
);
dbg
(
"%s - no memory"
,
__FUNCTION__
);
edge_close
(
port
,
filp
);
return
-
ENOMEM
;
}
dbg
(
__FUNCTION__
"(%d) - Initialize TX fifo to %d bytes"
,
port
->
number
,
edge_port
->
maxTxCredits
);
dbg
(
"%s(%d) - Initialize TX fifo to %d bytes"
,
__FUNCTION__
,
port
->
number
,
edge_port
->
maxTxCredits
);
dbg
(
__FUNCTION__
" exited"
);
dbg
(
"%s exited"
,
__FUNCTION__
);
return
0
;
}
...
...
@@ -1128,11 +1128,11 @@ static void block_until_chase_response(struct edgeport_port *edge_port)
// Did we get our Chase response
if
(
edge_port
->
chaseResponsePending
==
FALSE
)
{
dbg
(
__FUNCTION__
" - Got Chase Response"
);
dbg
(
"%s - Got Chase Response"
,
__FUNCTION__
);
// did we get all of our credit back?
if
(
edge_port
->
txCredits
==
edge_port
->
maxTxCredits
)
{
dbg
(
__FUNCTION__
" - Got all credits"
);
dbg
(
"%s - Got all credits"
,
__FUNCTION__
);
return
;
}
}
...
...
@@ -1145,12 +1145,12 @@ static void block_until_chase_response(struct edgeport_port *edge_port)
wait
--
;
if
(
wait
==
0
)
{
edge_port
->
chaseResponsePending
=
FALSE
;
dbg
(
__FUNCTION__
" - Chase TIMEOUT"
);
dbg
(
"%s - Chase TIMEOUT"
,
__FUNCTION__
);
return
;
}
}
else
{
// Reset timout value back to 10 seconds
dbg
(
__FUNCTION__
" - Last %d, Current %d"
,
lastCredits
,
edge_port
->
txCredits
);
dbg
(
"%s - Last %d, Current %d"
,
__FUNCTION__
,
lastCredits
,
edge_port
->
txCredits
);
wait
=
10
;
}
}
...
...
@@ -1180,20 +1180,20 @@ static void block_until_tx_empty (struct edgeport_port *edge_port)
// Is the Edgeport Buffer empty?
if
(
lastCount
==
0
)
{
dbg
(
__FUNCTION__
" - TX Buffer Empty"
);
dbg
(
"%s - TX Buffer Empty"
,
__FUNCTION__
);
return
;
}
// Block the thread for a while
interruptible_sleep_on_timeout
(
&
edge_port
->
wait_chase
,
timeout
);
dbg
(
__FUNCTION__
" wait"
);
dbg
(
"%s wait"
,
__FUNCTION__
);
if
(
lastCount
==
fifo
->
count
)
{
// No activity.. count down.
wait
--
;
if
(
wait
==
0
)
{
dbg
(
__FUNCTION__
" - TIMEOUT"
);
dbg
(
"%s - TIMEOUT"
,
__FUNCTION__
);
return
;
}
}
else
{
...
...
@@ -1218,7 +1218,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
if
(
port_paranoia_check
(
port
,
__FUNCTION__
))
return
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
serial
=
get_usb_serial
(
port
,
__FUNCTION__
);
if
(
!
serial
)
...
...
@@ -1238,7 +1238,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
/* flush and chase */
edge_port
->
chaseResponsePending
=
TRUE
;
dbg
(
__FUNCTION__
" - Sending IOSP_CMD_CHASE_PORT"
);
dbg
(
"%s - Sending IOSP_CMD_CHASE_PORT"
,
__FUNCTION__
);
status
=
send_iosp_ext_cmd
(
edge_port
,
IOSP_CMD_CHASE_PORT
,
0
);
if
(
status
==
0
)
{
// block until chase finished
...
...
@@ -1248,7 +1248,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
}
/* close the port */
dbg
(
__FUNCTION__
" - Sending IOSP_CMD_CLOSE_PORT"
);
dbg
(
"%s - Sending IOSP_CMD_CLOSE_PORT"
,
__FUNCTION__
);
send_iosp_ext_cmd
(
edge_port
,
IOSP_CMD_CLOSE_PORT
,
0
);
//port->close = TRUE;
...
...
@@ -1272,7 +1272,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
kfree
(
edge_port
->
txfifo
.
fifo
);
}
dbg
(
__FUNCTION__
" exited"
);
dbg
(
"%s exited"
,
__FUNCTION__
);
}
/*****************************************************************************
...
...
@@ -1291,7 +1291,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
int
firsthalf
;
int
secondhalf
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
if
(
edge_port
==
NULL
)
return
-
ENODEV
;
...
...
@@ -1302,12 +1302,12 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
// calculate number of bytes to put in fifo
copySize
=
min
((
unsigned
int
)
count
,
(
edge_port
->
txCredits
-
fifo
->
count
));
dbg
(
__FUNCTION__
"(%d) of %d byte(s) Fifo room %d -- will copy %d bytes"
,
dbg
(
"%s(%d) of %d byte(s) Fifo room %d -- will copy %d bytes"
,
__FUNCTION__
,
port
->
number
,
count
,
edge_port
->
txCredits
-
fifo
->
count
,
copySize
);
/* catch writes of 0 bytes which the tty driver likes to give us, and when txCredits is empty */
if
(
copySize
==
0
)
{
dbg
(
__FUNCTION__
" - copySize = Zero"
);
dbg
(
"%s - copySize = Zero"
,
__FUNCTION__
);
return
0
;
}
...
...
@@ -1319,7 +1319,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
bytesleft
=
fifo
->
size
-
fifo
->
head
;
firsthalf
=
min
(
bytesleft
,
copySize
);
dbg
(
__FUNCTION__
" - copy %d bytes of %d into fifo "
,
firsthalf
,
bytesleft
);
dbg
(
"%s - copy %d bytes of %d into fifo "
,
__FUNCTION__
,
firsthalf
,
bytesleft
);
/* now copy our data */
if
(
from_user
)
{
...
...
@@ -1341,7 +1341,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
secondhalf
=
copySize
-
firsthalf
;
if
(
secondhalf
)
{
dbg
(
__FUNCTION__
" - copy rest of data %d"
,
secondhalf
);
dbg
(
"%s - copy rest of data %d"
,
__FUNCTION__
,
secondhalf
);
if
(
from_user
)
{
if
(
copy_from_user
(
&
fifo
->
fifo
[
fifo
->
head
],
&
data
[
firsthalf
],
secondhalf
))
return
-
EFAULT
;
...
...
@@ -1360,7 +1360,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
send_more_port_data
((
struct
edgeport_serial
*
)
port
->
serial
->
private
,
edge_port
);
dbg
(
__FUNCTION__
" wrote %d byte(s) TxCredits %d, Fifo %d"
,
copySize
,
edge_port
->
txCredits
,
fifo
->
count
);
dbg
(
"%s wrote %d byte(s) TxCredits %d, Fifo %d"
,
__FUNCTION__
,
copySize
,
edge_port
->
txCredits
,
fifo
->
count
);
return
copySize
;
}
...
...
@@ -1390,12 +1390,12 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
int
firsthalf
;
int
secondhalf
;
dbg
(
__FUNCTION__
"(%d)"
,
edge_port
->
port
->
number
);
dbg
(
"%s(%d)"
,
__FUNCTION__
,
edge_port
->
port
->
number
);
if
(
edge_port
->
write_in_progress
||
!
edge_port
->
open
||
(
fifo
->
count
==
0
))
{
dbg
(
__FUNCTION__
"(%d) EXIT - fifo %d, PendingWrite = %d"
,
edge_port
->
port
->
number
,
fifo
->
count
,
edge_port
->
write_in_progress
);
dbg
(
"%s(%d) EXIT - fifo %d, PendingWrite = %d"
,
__FUNCTION__
,
edge_port
->
port
->
number
,
fifo
->
count
,
edge_port
->
write_in_progress
);
return
;
}
...
...
@@ -1407,7 +1407,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
// it's better to wait for more credits so we can do a larger
// write.
if
(
edge_port
->
txCredits
<
EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD
(
edge_port
->
maxTxCredits
))
{
dbg
(
__FUNCTION__
"(%d) Not enough credit - fifo %d TxCredit %d"
,
edge_port
->
port
->
number
,
fifo
->
count
,
edge_port
->
txCredits
);
dbg
(
"%s(%d) Not enough credit - fifo %d TxCredit %d"
,
__FUNCTION__
,
edge_port
->
port
->
number
,
fifo
->
count
,
edge_port
->
txCredits
);
return
;
}
...
...
@@ -1427,7 +1427,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
count
=
fifo
->
count
;
buffer
=
kmalloc
(
count
+
2
,
GFP_ATOMIC
);
if
(
buffer
==
NULL
)
{
err
(
__FUNCTION__
" - no more kernel memory..."
);
err
(
"%s - no more kernel memory..."
,
__FUNCTION__
);
edge_port
->
write_in_progress
=
FALSE
;
return
;
}
...
...
@@ -1464,14 +1464,14 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
status
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
);
if
(
status
)
{
/* something went wrong */
dbg
(
__FUNCTION__
" - usb_submit_urb(write bulk) failed"
);
dbg
(
"%s - usb_submit_urb(write bulk) failed"
,
__FUNCTION__
);
edge_port
->
write_in_progress
=
FALSE
;
}
else
{
/* decrement the number of credits we have by the number we just sent */
edge_port
->
txCredits
-=
count
;
edge_port
->
icount
.
tx
+=
count
;
}
dbg
(
__FUNCTION__
" wrote %d byte(s) TxCredit %d, Fifo %d"
,
count
,
edge_port
->
txCredits
,
fifo
->
count
);
dbg
(
"%s wrote %d byte(s) TxCredit %d, Fifo %d"
,
__FUNCTION__
,
count
,
edge_port
->
txCredits
,
fifo
->
count
);
}
...
...
@@ -1488,24 +1488,24 @@ static int edge_write_room (struct usb_serial_port *port)
struct
edgeport_port
*
edge_port
=
(
struct
edgeport_port
*
)(
port
->
private
);
int
room
;
dbg
(
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
if
(
edge_port
==
NULL
)
return
-
ENODEV
;
if
(
edge_port
->
closePending
==
TRUE
)
return
-
ENODEV
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
if
(
!
edge_port
->
open
)
{
dbg
(
__FUNCTION__
" - port not opened"
);
dbg
(
"%s - port not opened"
,
__FUNCTION__
);
return
-
EINVAL
;
}
// total of both buffers is still txCredit
room
=
edge_port
->
txCredits
-
edge_port
->
txfifo
.
count
;
dbg
(
__FUNCTION__
" - returns %d"
,
room
);
dbg
(
"%s - returns %d"
,
__FUNCTION__
,
room
);
return
room
;
}
...
...
@@ -1524,7 +1524,7 @@ static int edge_chars_in_buffer (struct usb_serial_port *port)
struct
edgeport_port
*
edge_port
=
(
struct
edgeport_port
*
)(
port
->
private
);
int
num_chars
;
dbg
(
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
if
(
edge_port
==
NULL
)
return
-
ENODEV
;
...
...
@@ -1532,13 +1532,13 @@ static int edge_chars_in_buffer (struct usb_serial_port *port)
return
-
ENODEV
;
if
(
!
edge_port
->
open
)
{
dbg
(
__FUNCTION__
" - port not opened"
);
dbg
(
"%s - port not opened"
,
__FUNCTION__
);
return
-
EINVAL
;
}
num_chars
=
edge_port
->
maxTxCredits
-
edge_port
->
txCredits
+
edge_port
->
txfifo
.
count
;
if
(
num_chars
)
{
dbg
(
__FUNCTION__
"(port %d) - returns %d"
,
port
->
number
,
num_chars
);
dbg
(
"%s(port %d) - returns %d"
,
__FUNCTION__
,
port
->
number
,
num_chars
);
}
return
num_chars
;
...
...
@@ -1556,13 +1556,13 @@ static void edge_throttle (struct usb_serial_port *port)
struct
tty_struct
*
tty
;
int
status
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
if
(
edge_port
==
NULL
)
return
;
if
(
!
edge_port
->
open
)
{
dbg
(
__FUNCTION__
" - port not opened"
);
dbg
(
"%s - port not opened"
,
__FUNCTION__
);
return
;
}
...
...
@@ -1605,13 +1605,13 @@ static void edge_unthrottle (struct usb_serial_port *port)
struct
tty_struct
*
tty
;
int
status
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
if
(
edge_port
==
NULL
)
return
;
if
(
!
edge_port
->
open
)
{
dbg
(
__FUNCTION__
" - port not opened"
);
dbg
(
"%s - port not opened"
,
__FUNCTION__
);
return
;
}
...
...
@@ -1663,7 +1663,7 @@ static void edge_set_termios (struct usb_serial_port *port, struct termios *old_
if
(
old_termios
)
{
if
((
cflag
==
old_termios
->
c_cflag
)
&&
(
RELEVANT_IFLAG
(
tty
->
termios
->
c_iflag
)
==
RELEVANT_IFLAG
(
old_termios
->
c_iflag
)))
{
dbg
(
__FUNCTION__
" - nothing to change"
);
dbg
(
"%s - nothing to change"
,
__FUNCTION__
);
return
;
}
}
...
...
@@ -1677,13 +1677,13 @@ static void edge_set_termios (struct usb_serial_port *port, struct termios *old_
RELEVANT_IFLAG
(
old_termios
->
c_iflag
));
}
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
if
(
edge_port
==
NULL
)
return
;
if
(
!
edge_port
->
open
)
{
dbg
(
__FUNCTION__
" - port not opened"
);
dbg
(
"%s - port not opened"
,
__FUNCTION__
);
return
;
}
...
...
@@ -1710,7 +1710,7 @@ static int get_lsr_info(struct edgeport_port *edge_port, unsigned int *value)
if
(
edge_port
->
maxTxCredits
==
edge_port
->
txCredits
&&
edge_port
->
txfifo
.
count
==
0
)
{
dbg
(
__FUNCTION__
" -- Empty"
);
dbg
(
"%s -- Empty"
,
__FUNCTION__
);
result
=
TIOCSER_TEMT
;
}
...
...
@@ -1729,7 +1729,7 @@ static int get_number_bytes_avail(struct edgeport_port *edge_port, unsigned int
result
=
tty
->
read_cnt
;
dbg
(
__FUNCTION__
"(%d) = %d"
,
edge_port
->
port
->
number
,
result
);
dbg
(
"%s(%d) = %d"
,
__FUNCTION__
,
edge_port
->
port
->
number
,
result
);
if
(
copy_to_user
(
value
,
&
result
,
sizeof
(
int
)))
return
-
EFAULT
;
//return 0;
...
...
@@ -1794,7 +1794,7 @@ static int get_modem_info(struct edgeport_port *edge_port, unsigned int *value)
|
((
msr
&
MSR_DSR
)
?
TIOCM_DSR
:
0
);
/* 0x100 */
dbg
(
__FUNCTION__
" -- %x"
,
result
);
dbg
(
"%s -- %x"
,
__FUNCTION__
,
result
);
if
(
copy_to_user
(
value
,
&
result
,
sizeof
(
int
)))
return
-
EFAULT
;
...
...
@@ -1845,40 +1845,40 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
struct
serial_icounter_struct
icount
;
dbg
(
__FUNCTION__
" - port %d, cmd = 0x%x"
,
port
->
number
,
cmd
);
dbg
(
"%s - port %d, cmd = 0x%x"
,
__FUNCTION__
,
port
->
number
,
cmd
);
switch
(
cmd
)
{
// return number of bytes available
case
TIOCINQ
:
dbg
(
__FUNCTION__
" (%d) TIOCINQ"
,
port
->
number
);
dbg
(
"%s (%d) TIOCINQ"
,
__FUNCTION__
,
port
->
number
);
return
get_number_bytes_avail
(
edge_port
,
(
unsigned
int
*
)
arg
);
break
;
case
TIOCSERGETLSR
:
dbg
(
__FUNCTION__
" (%d) TIOCSERGETLSR"
,
port
->
number
);
dbg
(
"%s (%d) TIOCSERGETLSR"
,
__FUNCTION__
,
port
->
number
);
return
get_lsr_info
(
edge_port
,
(
unsigned
int
*
)
arg
);
return
0
;
case
TIOCMBIS
:
case
TIOCMBIC
:
case
TIOCMSET
:
dbg
(
__FUNCTION__
" (%d) TIOCMSET/TIOCMBIC/TIOCMSET"
,
port
->
number
);
dbg
(
"%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET"
,
__FUNCTION__
,
port
->
number
);
return
set_modem_info
(
edge_port
,
cmd
,
(
unsigned
int
*
)
arg
);
case
TIOCMGET
:
dbg
(
__FUNCTION__
" (%d) TIOCMGET"
,
port
->
number
);
dbg
(
"%s (%d) TIOCMGET"
,
__FUNCTION__
,
port
->
number
);
return
get_modem_info
(
edge_port
,
(
unsigned
int
*
)
arg
);
case
TIOCGSERIAL
:
dbg
(
__FUNCTION__
" (%d) TIOCGSERIAL"
,
port
->
number
);
dbg
(
"%s (%d) TIOCGSERIAL"
,
__FUNCTION__
,
port
->
number
);
return
get_serial_info
(
edge_port
,
(
struct
serial_struct
*
)
arg
);
case
TIOCSSERIAL
:
dbg
(
__FUNCTION__
" (%d) TIOCSSERIAL"
,
port
->
number
);
dbg
(
"%s (%d) TIOCSSERIAL"
,
__FUNCTION__
,
port
->
number
);
break
;
case
TIOCMIWAIT
:
dbg
(
__FUNCTION__
" (%d) TIOCMIWAIT"
,
port
->
number
);
dbg
(
"%s (%d) TIOCMIWAIT"
,
__FUNCTION__
,
port
->
number
);
cprev
=
edge_port
->
icount
;
while
(
1
)
{
interruptible_sleep_on
(
&
edge_port
->
delta_msr_wait
);
...
...
@@ -1914,7 +1914,7 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
icount
.
brk
=
cnow
.
brk
;
icount
.
buf_overrun
=
cnow
.
buf_overrun
;
dbg
(
__FUNCTION__
" (%d) TIOCGICOUNT RX=%d, TX=%d"
,
port
->
number
,
icount
.
rx
,
icount
.
tx
);
dbg
(
"%s (%d) TIOCGICOUNT RX=%d, TX=%d"
,
__FUNCTION__
,
port
->
number
,
icount
.
rx
,
icount
.
tx
);
if
(
copy_to_user
((
void
*
)
arg
,
&
icount
,
sizeof
(
icount
)))
return
-
EFAULT
;
return
0
;
...
...
@@ -1936,7 +1936,7 @@ static void edge_break (struct usb_serial_port *port, int break_state)
/* flush and chase */
edge_port
->
chaseResponsePending
=
TRUE
;
dbg
(
__FUNCTION__
" - Sending IOSP_CMD_CHASE_PORT"
);
dbg
(
"%s - Sending IOSP_CMD_CHASE_PORT"
,
__FUNCTION__
);
status
=
send_iosp_ext_cmd
(
edge_port
,
IOSP_CMD_CHASE_PORT
,
0
);
if
(
status
==
0
)
{
// block until chase finished
...
...
@@ -1946,14 +1946,14 @@ static void edge_break (struct usb_serial_port *port, int break_state)
}
if
(
break_state
==
-
1
)
{
dbg
(
__FUNCTION__
" - Sending IOSP_CMD_SET_BREAK"
);
dbg
(
"%s - Sending IOSP_CMD_SET_BREAK"
,
__FUNCTION__
);
status
=
send_iosp_ext_cmd
(
edge_port
,
IOSP_CMD_SET_BREAK
,
0
);
}
else
{
dbg
(
__FUNCTION__
" - Sending IOSP_CMD_CLEAR_BREAK"
);
dbg
(
"%s - Sending IOSP_CMD_CLEAR_BREAK"
,
__FUNCTION__
);
status
=
send_iosp_ext_cmd
(
edge_port
,
IOSP_CMD_CLEAR_BREAK
,
0
);
}
if
(
status
)
{
dbg
(
__FUNCTION__
" - error sending break set/clear command."
);
dbg
(
"%s - error sending break set/clear command."
,
__FUNCTION__
);
}
return
;
...
...
@@ -1973,14 +1973,14 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char
__u16
rxLen
;
int
i
;
dbg
(
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
lastBufferLength
=
bufferLength
+
1
;
while
(
bufferLength
>
0
)
{
/* failsafe incase we get a message that we don't understand */
if
(
lastBufferLength
==
bufferLength
)
{
dbg
(
__FUNCTION__
" - stuck in loop, exiting it."
);
dbg
(
"%s - stuck in loop, exiting it."
,
__FUNCTION__
);
break
;
}
lastBufferLength
=
bufferLength
;
...
...
@@ -2002,7 +2002,7 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char
++
buffer
;
--
bufferLength
;
dbg
(
__FUNCTION__
" - Hdr1=%02X Hdr2=%02X"
,
edge_serial
->
rxHeader1
,
edge_serial
->
rxHeader2
);
dbg
(
"%s - Hdr1=%02X Hdr2=%02X"
,
__FUNCTION__
,
edge_serial
->
rxHeader1
,
edge_serial
->
rxHeader2
);
// Process depending on whether this header is
// data or status
...
...
@@ -2033,7 +2033,7 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char
edge_serial
->
rxPort
=
IOSP_GET_HDR_PORT
(
edge_serial
->
rxHeader1
);
edge_serial
->
rxBytesRemaining
=
IOSP_GET_HDR_DATA_LEN
(
edge_serial
->
rxHeader1
,
edge_serial
->
rxHeader2
);
dbg
(
__FUNCTION__
" - Data for Port %u Len %u"
,
edge_serial
->
rxPort
,
edge_serial
->
rxBytesRemaining
);
dbg
(
"%s - Data for Port %u Len %u"
,
__FUNCTION__
,
edge_serial
->
rxPort
,
edge_serial
->
rxBytesRemaining
);
//ASSERT( DevExt->RxPort < DevExt->NumPorts );
//ASSERT( DevExt->RxBytesRemaining < IOSP_MAX_DATA_LENGTH );
...
...
@@ -2067,7 +2067,7 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char
if
(
edge_port
->
open
)
{
tty
=
edge_port
->
port
->
tty
;
if
(
tty
)
{
dbg
(
__FUNCTION__
" - Sending %d bytes to TTY for port %d"
,
rxLen
,
edge_serial
->
rxPort
);
dbg
(
"%s - Sending %d bytes to TTY for port %d"
,
__FUNCTION__
,
rxLen
,
edge_serial
->
rxPort
);
for
(
i
=
0
;
i
<
rxLen
;
++
i
)
{
/* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */
if
(
tty
->
flip
.
count
>=
TTY_FLIPBUF_SIZE
)
{
...
...
@@ -2120,17 +2120,17 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
}
edge_port
=
(
struct
edgeport_port
*
)
port
->
private
;
if
(
edge_port
==
NULL
)
{
err
(
__FUNCTION__
" - edge_port == NULL for port %d"
,
edge_serial
->
rxPort
);
err
(
"%s - edge_port == NULL for port %d"
,
__FUNCTION__
,
edge_serial
->
rxPort
);
return
;
}
dbg
(
__FUNCTION__
" - port %d"
,
edge_serial
->
rxPort
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
edge_serial
->
rxPort
);
if
(
code
==
IOSP_EXT_STATUS
)
{
switch
(
byte2
)
{
case
IOSP_EXT_STATUS_CHASE_RSP
:
// we want to do EXT status regardless of port open/closed
dbg
(
__FUNCTION__
" - Port %u EXT CHASE_RSP Data = %02x"
,
edge_serial
->
rxPort
,
byte3
);
dbg
(
"%s - Port %u EXT CHASE_RSP Data = %02x"
,
__FUNCTION__
,
edge_serial
->
rxPort
,
byte3
);
// Currently, the only EXT_STATUS is Chase, so process here instead of one more call
// to one more subroutine. If/when more EXT_STATUS, there'll be more work to do.
// Also, we currently clear flag and close the port regardless of content of above's Byte3.
...
...
@@ -2141,7 +2141,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
return
;
case
IOSP_EXT_STATUS_RX_CHECK_RSP
:
dbg
(
__FUNCTION__
" ========== Port %u CHECK_RSP Sequence = %02x =============
\n
"
,
edge_serial
->
rxPort
,
byte3
);
dbg
(
"%s ========== Port %u CHECK_RSP Sequence = %02x =============
\n
"
,
__FUNCTION__
,
edge_serial
->
rxPort
,
byte3
);
//Port->RxCheckRsp = TRUE;
return
;
}
...
...
@@ -2150,7 +2150,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
if
(
code
==
IOSP_STATUS_OPEN_RSP
)
{
edge_port
->
txCredits
=
GET_TX_BUFFER_SIZE
(
byte3
);
edge_port
->
maxTxCredits
=
edge_port
->
txCredits
;
dbg
(
__FUNCTION__
" - Port %u Open Response Inital MSR = %02x TxBufferSize = %d"
,
edge_serial
->
rxPort
,
byte2
,
edge_port
->
txCredits
);
dbg
(
"%s - Port %u Open Response Inital MSR = %02x TxBufferSize = %d"
,
__FUNCTION__
,
edge_serial
->
rxPort
,
byte2
,
edge_port
->
txCredits
);
handle_new_msr
(
edge_port
,
byte2
);
/* send the current line settings to the port so we are in sync with any further termios calls */
...
...
@@ -2174,23 +2174,23 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
switch
(
code
)
{
// Not currently sent by Edgeport
case
IOSP_STATUS_LSR
:
dbg
(
__FUNCTION__
" - Port %u LSR Status = %02x"
,
edge_serial
->
rxPort
,
byte2
);
dbg
(
"%s - Port %u LSR Status = %02x"
,
__FUNCTION__
,
edge_serial
->
rxPort
,
byte2
);
handle_new_lsr
(
edge_port
,
FALSE
,
byte2
,
0
);
break
;
case
IOSP_STATUS_LSR_DATA
:
dbg
(
__FUNCTION__
" - Port %u LSR Status = %02x, Data = %02x"
,
edge_serial
->
rxPort
,
byte2
,
byte3
);
dbg
(
"%s - Port %u LSR Status = %02x, Data = %02x"
,
__FUNCTION__
,
edge_serial
->
rxPort
,
byte2
,
byte3
);
// byte2 is LSR Register
// byte3 is broken data byte
handle_new_lsr
(
edge_port
,
TRUE
,
byte2
,
byte3
);
break
;
//
// case IOSP_EXT_4_STATUS:
// dbg(
__FUNCTION__" - Port %u LSR Status = %02x Data = %02x"
, edge_serial->rxPort, byte2, byte3);
// dbg(
"%s - Port %u LSR Status = %02x Data = %02x", __FUNCTION__
, edge_serial->rxPort, byte2, byte3);
// break;
//
case
IOSP_STATUS_MSR
:
dbg
(
__FUNCTION__
" - Port %u MSR Status = %02x"
,
edge_serial
->
rxPort
,
byte2
);
dbg
(
"%s - Port %u MSR Status = %02x"
,
__FUNCTION__
,
edge_serial
->
rxPort
,
byte2
);
// Process this new modem status and generate appropriate
// events, etc, based on the new status. This routine
...
...
@@ -2199,7 +2199,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
break
;
default:
dbg
(
__FUNCTION__
" - Unrecognized IOSP status code %u
\n
"
,
code
);
dbg
(
"%s - Unrecognized IOSP status code %u
\n
"
,
__FUNCTION__
,
code
);
break
;
}
...
...
@@ -2215,7 +2215,7 @@ static void handle_new_msr(struct edgeport_port *edge_port, __u8 newMsr)
{
struct
async_icount
*
icount
;
dbg
(
__FUNCTION__
" %02x"
,
newMsr
);
dbg
(
"%s %02x"
,
__FUNCTION__
,
newMsr
);
if
(
newMsr
&
(
MSR_DELTA_CTS
|
MSR_DELTA_DSR
|
MSR_DELTA_RI
|
MSR_DELTA_CD
))
{
icount
=
&
edge_port
->
icount
;
...
...
@@ -2252,7 +2252,7 @@ static void handle_new_lsr(struct edgeport_port *edge_port, __u8 lsrData, __u8 l
__u8
newLsr
=
(
__u8
)(
lsr
&
(
__u8
)(
LSR_OVER_ERR
|
LSR_PAR_ERR
|
LSR_FRM_ERR
|
LSR_BREAK
));
struct
async_icount
*
icount
;
dbg
(
__FUNCTION__
" - %02x"
,
newLsr
);
dbg
(
"%s - %02x"
,
__FUNCTION__
,
newLsr
);
edge_port
->
shadowLSR
=
lsr
;
...
...
@@ -2303,11 +2303,11 @@ static int sram_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u
__u16
current_length
;
unsigned
char
*
transfer_buffer
;
// dbg
(__FUNCTION__" - %x, %x, %d"
, extAddr, addr, length);
// dbg
("%s - %x, %x, %d", __FUNCTION__
, extAddr, addr, length);
transfer_buffer
=
kmalloc
(
64
,
GFP_KERNEL
);
if
(
!
transfer_buffer
)
{
err
(
__FUNCTION__
" - kmalloc(%d) failed.
\n
"
,
64
);
err
(
"%s - kmalloc(%d) failed.
\n
"
,
__FUNCTION__
,
64
);
return
-
ENOMEM
;
}
...
...
@@ -2319,7 +2319,7 @@ static int sram_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u
}
else
{
current_length
=
length
;
}
// dbg
(__FUNCTION__" - writing %x, %x, %d"
, extAddr, addr, current_length);
// dbg
("%s - writing %x, %x, %d", __FUNCTION__
, extAddr, addr, current_length);
memcpy
(
transfer_buffer
,
data
,
current_length
);
result
=
usb_control_msg
(
serial
->
dev
,
usb_sndctrlpipe
(
serial
->
dev
,
0
),
USB_REQUEST_ION_WRITE_RAM
,
0x40
,
addr
,
extAddr
,
transfer_buffer
,
current_length
,
300
);
...
...
@@ -2348,11 +2348,11 @@ static int rom_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u1
__u16
current_length
;
unsigned
char
*
transfer_buffer
;
// dbg
(__FUNCTION__" - %x, %x, %d"
, extAddr, addr, length);
// dbg
("%s - %x, %x, %d", __FUNCTION__
, extAddr, addr, length);
transfer_buffer
=
kmalloc
(
64
,
GFP_KERNEL
);
if
(
!
transfer_buffer
)
{
err
(
__FUNCTION__
" - kmalloc(%d) failed.
\n
"
,
64
);
err
(
"%s - kmalloc(%d) failed.
\n
"
,
__FUNCTION__
,
64
);
return
-
ENOMEM
;
}
...
...
@@ -2364,7 +2364,7 @@ static int rom_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u1
}
else
{
current_length
=
length
;
}
// dbg
(__FUNCTION__" - writing %x, %x, %d"
, extAddr, addr, current_length);
// dbg
("%s - writing %x, %x, %d", __FUNCTION__
, extAddr, addr, current_length);
memcpy
(
transfer_buffer
,
data
,
current_length
);
result
=
usb_control_msg
(
serial
->
dev
,
usb_sndctrlpipe
(
serial
->
dev
,
0
),
USB_REQUEST_ION_WRITE_ROM
,
0x40
,
addr
,
extAddr
,
transfer_buffer
,
current_length
,
300
);
...
...
@@ -2393,11 +2393,11 @@ static int rom_read (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16
__u16
current_length
;
unsigned
char
*
transfer_buffer
;
dbg
(
__FUNCTION__
" - %x, %x, %d"
,
extAddr
,
addr
,
length
);
dbg
(
"%s - %x, %x, %d"
,
__FUNCTION__
,
extAddr
,
addr
,
length
);
transfer_buffer
=
kmalloc
(
64
,
GFP_KERNEL
);
if
(
!
transfer_buffer
)
{
err
(
__FUNCTION__
" - kmalloc(%d) failed.
\n
"
,
64
);
err
(
"%s - kmalloc(%d) failed.
\n
"
,
__FUNCTION__
,
64
);
return
-
ENOMEM
;
}
...
...
@@ -2409,7 +2409,7 @@ static int rom_read (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16
}
else
{
current_length
=
length
;
}
// dbg
(__FUNCTION__" - %x, %x, %d"
, extAddr, addr, current_length);
// dbg
("%s - %x, %x, %d", __FUNCTION__
, extAddr, addr, current_length);
result
=
usb_control_msg
(
serial
->
dev
,
usb_rcvctrlpipe
(
serial
->
dev
,
0
),
USB_REQUEST_ION_READ_ROM
,
0xC0
,
addr
,
extAddr
,
transfer_buffer
,
current_length
,
300
);
if
(
result
<
0
)
...
...
@@ -2436,11 +2436,11 @@ static int send_iosp_ext_cmd (struct edgeport_port *edge_port, __u8 command, __u
int
length
=
0
;
int
status
=
0
;
dbg
(
__FUNCTION__
" - %d, %d"
,
command
,
param
);
dbg
(
"%s - %d, %d"
,
__FUNCTION__
,
command
,
param
);
buffer
=
kmalloc
(
10
,
GFP_ATOMIC
);
if
(
!
buffer
)
{
err
(
__FUNCTION__
" - kmalloc(%d) failed.
\n
"
,
10
);
err
(
"%s - kmalloc(%d) failed.
\n
"
,
__FUNCTION__
,
10
);
return
-
ENOMEM
;
}
...
...
@@ -2479,7 +2479,7 @@ static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer
return
-
ENOMEM
;
CmdUrbs
++
;
dbg
(
__FUNCTION__
" - ALLOCATE URB %p (outstanding %d)"
,
urb
,
CmdUrbs
);
dbg
(
"%s - ALLOCATE URB %p (outstanding %d)"
,
__FUNCTION__
,
urb
,
CmdUrbs
);
FILL_BULK_URB
(
urb
,
edge_serial
->
serial
->
dev
,
usb_sndbulkpipe
(
edge_serial
->
serial
->
dev
,
edge_serial
->
bulk_out_endpoint
),
...
...
@@ -2490,7 +2490,7 @@ static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer
if
(
status
)
{
/* something went wrong */
dbg
(
__FUNCTION__
" - usb_submit_urb(write bulk) failed"
);
dbg
(
"%s - usb_submit_urb(write bulk) failed"
,
__FUNCTION__
);
usb_unlink_urb
(
urb
);
usb_free_urb
(
urb
);
return
status
;
...
...
@@ -2505,7 +2505,7 @@ static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer
if (edge_port->commandPending == TRUE) {
/* command timed out */
dbg(
__FUNCTION__" - command timed out"
);
dbg(
"%s - command timed out", __FUNCTION__
);
status = -EINVAL;
}
#endif
...
...
@@ -2527,18 +2527,18 @@ static int send_cmd_write_baud_rate (struct edgeport_port *edge_port, int baudRa
int
status
;
unsigned
char
number
=
edge_port
->
port
->
number
-
edge_port
->
port
->
serial
->
minor
;
dbg
(
__FUNCTION__
" - port = %d, baud = %d"
,
edge_port
->
port
->
number
,
baudRate
);
dbg
(
"%s - port = %d, baud = %d"
,
__FUNCTION__
,
edge_port
->
port
->
number
,
baudRate
);
status
=
calc_baud_rate_divisor
(
baudRate
,
&
divisor
);
if
(
status
)
{
err
(
__FUNCTION__
" - bad baud rate"
);
err
(
"%s - bad baud rate"
,
__FUNCTION__
);
return
status
;
}
// Alloc memory for the string of commands.
cmdBuffer
=
kmalloc
(
0x100
,
GFP_ATOMIC
);
if
(
!
cmdBuffer
)
{
err
(
__FUNCTION__
" - kmalloc(%d) failed.
\n
"
,
0x100
);
err
(
"%s - kmalloc(%d) failed.
\n
"
,
__FUNCTION__
,
0x100
);
return
-
ENOMEM
;
}
currCmd
=
cmdBuffer
;
...
...
@@ -2576,7 +2576,7 @@ static int calc_baud_rate_divisor (int baudrate, int *divisor)
__u16
round
;
dbg
(
__FUNCTION__
" - %d"
,
baudrate
);
dbg
(
"%s - %d"
,
__FUNCTION__
,
baudrate
);
for
(
i
=
0
;
i
<
NUM_ENTRIES
(
divisor_table
);
i
++
)
{
if
(
divisor_table
[
i
].
BaudRate
==
baudrate
)
{
...
...
@@ -2600,7 +2600,7 @@ static int calc_baud_rate_divisor (int baudrate, int *divisor)
}
*
divisor
=
custom
;
dbg
(
__FUNCTION__
" - Baud %d = %d
\n
"
,
baudrate
,
custom
);
dbg
(
"%s - Baud %d = %d
\n
"
,
__FUNCTION__
,
baudrate
,
custom
);
return
0
;
}
...
...
@@ -2619,7 +2619,7 @@ static int send_cmd_write_uart_register (struct edgeport_port *edge_port, __u8 r
unsigned
long
cmdLen
=
0
;
int
status
;
dbg
(
__FUNCTION__
" - write to %s register 0x%02x"
,
(
regNum
==
MCR
)
?
"MCR"
:
"LCR"
,
regValue
);
dbg
(
"%s - write to %s register 0x%02x"
,
(
regNum
==
MCR
)
?
"MCR"
:
"LCR"
,
__FUNCTION__
,
regValue
);
// Alloc memory for the string of commands.
cmdBuffer
=
kmalloc
(
0x10
,
GFP_ATOMIC
);
...
...
@@ -2662,50 +2662,50 @@ static void change_port_settings (struct edgeport_port *edge_port, struct termio
__u8
txFlow
;
int
status
;
dbg
(
__FUNCTION__
" - port %d"
,
edge_port
->
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
edge_port
->
port
->
number
);
if
((
!
edge_port
->
open
)
&&
(
!
edge_port
->
openPending
))
{
dbg
(
__FUNCTION__
" - port not opened"
);
dbg
(
"%s - port not opened"
,
__FUNCTION__
);
return
;
}
tty
=
edge_port
->
port
->
tty
;
if
((
!
tty
)
||
(
!
tty
->
termios
))
{
dbg
(
__FUNCTION__
" - no tty structures"
);
dbg
(
"%s - no tty structures"
,
__FUNCTION__
);
return
;
}
cflag
=
tty
->
termios
->
c_cflag
;
switch
(
cflag
&
CSIZE
)
{
case
CS5
:
lData
=
LCR_BITS_5
;
mask
=
0x1f
;
dbg
(
__FUNCTION__
" - data bits = 5"
);
break
;
case
CS6
:
lData
=
LCR_BITS_6
;
mask
=
0x3f
;
dbg
(
__FUNCTION__
" - data bits = 6"
);
break
;
case
CS7
:
lData
=
LCR_BITS_7
;
mask
=
0x7f
;
dbg
(
__FUNCTION__
" - data bits = 7"
);
break
;
case
CS5
:
lData
=
LCR_BITS_5
;
mask
=
0x1f
;
dbg
(
"%s - data bits = 5"
,
__FUNCTION__
);
break
;
case
CS6
:
lData
=
LCR_BITS_6
;
mask
=
0x3f
;
dbg
(
"%s - data bits = 6"
,
__FUNCTION__
);
break
;
case
CS7
:
lData
=
LCR_BITS_7
;
mask
=
0x7f
;
dbg
(
"%s - data bits = 7"
,
__FUNCTION__
);
break
;
default:
case
CS8
:
lData
=
LCR_BITS_8
;
dbg
(
__FUNCTION__
" - data bits = 8"
);
break
;
case
CS8
:
lData
=
LCR_BITS_8
;
dbg
(
"%s - data bits = 8"
,
__FUNCTION__
);
break
;
}
lParity
=
LCR_PAR_NONE
;
if
(
cflag
&
PARENB
)
{
if
(
cflag
&
PARODD
)
{
lParity
=
LCR_PAR_ODD
;
dbg
(
__FUNCTION__
" - parity = odd"
);
dbg
(
"%s - parity = odd"
,
__FUNCTION__
);
}
else
{
lParity
=
LCR_PAR_EVEN
;
dbg
(
__FUNCTION__
" - parity = even"
);
dbg
(
"%s - parity = even"
,
__FUNCTION__
);
}
}
else
{
dbg
(
__FUNCTION__
" - parity = none"
);
dbg
(
"%s - parity = none"
,
__FUNCTION__
);
}
if
(
cflag
&
CSTOPB
)
{
lStop
=
LCR_STOP_2
;
dbg
(
__FUNCTION__
" - stop bits = 2"
);
dbg
(
"%s - stop bits = 2"
,
__FUNCTION__
);
}
else
{
lStop
=
LCR_STOP_1
;
dbg
(
__FUNCTION__
" - stop bits = 1"
);
dbg
(
"%s - stop bits = 1"
,
__FUNCTION__
);
}
/* figure out the flow control settings */
...
...
@@ -2713,9 +2713,9 @@ static void change_port_settings (struct edgeport_port *edge_port, struct termio
if
(
cflag
&
CRTSCTS
)
{
rxFlow
|=
IOSP_RX_FLOW_RTS
;
txFlow
|=
IOSP_TX_FLOW_CTS
;
dbg
(
__FUNCTION__
" - RTS/CTS is enabled"
);
dbg
(
"%s - RTS/CTS is enabled"
,
__FUNCTION__
);
}
else
{
dbg
(
__FUNCTION__
" - RTS/CTS is disabled"
);
dbg
(
"%s - RTS/CTS is disabled"
,
__FUNCTION__
);
}
/* if we are implementing XON/XOFF, set the start and stop character in the device */
...
...
@@ -2729,17 +2729,17 @@ static void change_port_settings (struct edgeport_port *edge_port, struct termio
/* if we are implementing INBOUND XON/XOFF */
if
(
I_IXOFF
(
tty
))
{
rxFlow
|=
IOSP_RX_FLOW_XON_XOFF
;
dbg
(
__FUNCTION__
" - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x"
,
start_char
,
stop_char
);
dbg
(
"%s - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x"
,
__FUNCTION__
,
start_char
,
stop_char
);
}
else
{
dbg
(
__FUNCTION__
" - INBOUND XON/XOFF is disabled"
);
dbg
(
"%s - INBOUND XON/XOFF is disabled"
,
__FUNCTION__
);
}
/* if we are implementing OUTBOUND XON/XOFF */
if
(
I_IXON
(
tty
))
{
txFlow
|=
IOSP_TX_FLOW_XON_XOFF
;
dbg
(
__FUNCTION__
" - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x"
,
start_char
,
stop_char
);
dbg
(
"%s - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x"
,
__FUNCTION__
,
start_char
,
stop_char
);
}
else
{
dbg
(
__FUNCTION__
" - OUTBOUND XON/XOFF is disabled"
);
dbg
(
"%s - OUTBOUND XON/XOFF is disabled"
,
__FUNCTION__
);
}
}
...
...
@@ -2776,7 +2776,7 @@ static void change_port_settings (struct edgeport_port *edge_port, struct termio
baud
=
9600
;
}
dbg
(
__FUNCTION__
" - baud rate = %d"
,
baud
);
dbg
(
"%s - baud rate = %d"
,
__FUNCTION__
,
baud
);
status
=
send_cmd_write_baud_rate
(
edge_port
,
baud
);
return
;
...
...
@@ -2951,7 +2951,7 @@ static int edge_startup (struct usb_serial *serial)
/* create our private serial structure */
edge_serial
=
kmalloc
(
sizeof
(
struct
edgeport_serial
),
GFP_KERNEL
);
if
(
edge_serial
==
NULL
)
{
err
(
__FUNCTION__
" - Out of memory"
);
err
(
"%s - Out of memory"
,
__FUNCTION__
);
return
-
ENOMEM
;
}
memset
(
edge_serial
,
0
,
sizeof
(
struct
edgeport_serial
));
...
...
@@ -2978,22 +2978,23 @@ static int edge_startup (struct usb_serial *serial)
/* set the number of ports from the manufacturing description */
/* serial->num_ports = serial->product_info.NumPorts; */
if
(
edge_serial
->
product_info
.
NumPorts
!=
serial
->
num_ports
)
{
warn
(
__FUNCTION__
"
- Device Reported %d serial ports vs core "
warn
(
"%s
- Device Reported %d serial ports vs core "
"thinking we have %d ports, email greg@kroah.com this info."
,
edge_serial
->
product_info
.
NumPorts
,
serial
->
num_ports
);
__FUNCTION__
,
edge_serial
->
product_info
.
NumPorts
,
serial
->
num_ports
);
}
dbg
(
__FUNCTION__
" - time 1 %ld"
,
jiffies
);
dbg
(
"%s - time 1 %ld"
,
__FUNCTION__
,
jiffies
);
/* now load the application firmware into this device */
load_application_firmware
(
edge_serial
);
dbg
(
__FUNCTION__
" - time 2 %ld"
,
jiffies
);
dbg
(
"%s - time 2 %ld"
,
__FUNCTION__
,
jiffies
);
/* Check current Edgeport EEPROM and update if necessary */
update_edgeport_E2PROM
(
edge_serial
);
dbg
(
__FUNCTION__
" - time 3 %ld"
,
jiffies
);
dbg
(
"%s - time 3 %ld"
,
__FUNCTION__
,
jiffies
);
/* set the configuration to use #1 */
// dbg("set_configuration 1");
...
...
@@ -3006,7 +3007,7 @@ static int edge_startup (struct usb_serial *serial)
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
edge_port
=
kmalloc
(
sizeof
(
struct
edgeport_port
),
GFP_KERNEL
);
if
(
edge_port
==
NULL
)
{
err
(
__FUNCTION__
" - Out of memory"
);
err
(
"%s - Out of memory"
,
__FUNCTION__
);
return
-
ENOMEM
;
}
memset
(
edge_port
,
0
,
sizeof
(
struct
edgeport_port
));
...
...
@@ -3027,7 +3028,7 @@ static void edge_shutdown (struct usb_serial *serial)
{
int
i
;
dbg
(
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
/* stop reads and writes on all ports */
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
...
...
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