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
721e70a9
Commit
721e70a9
authored
Feb 10, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed 'typedef' from the Keyspan usb-serial drivers.
parent
66e07223
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
56 deletions
+56
-56
drivers/usb/serial/keyspan.c
drivers/usb/serial/keyspan.c
+17
-17
drivers/usb/serial/keyspan.h
drivers/usb/serial/keyspan.h
+9
-9
drivers/usb/serial/keyspan_usa26msg.h
drivers/usb/serial/keyspan_usa26msg.h
+10
-10
drivers/usb/serial/keyspan_usa28msg.h
drivers/usb/serial/keyspan_usa28msg.h
+10
-10
drivers/usb/serial/keyspan_usa49msg.h
drivers/usb/serial/keyspan_usa49msg.h
+10
-10
No files found.
drivers/usb/serial/keyspan.c
View file @
721e70a9
...
@@ -107,7 +107,7 @@ struct keyspan_serial_private {
...
@@ -107,7 +107,7 @@ struct keyspan_serial_private {
/* number of active ports */
/* number of active ports */
atomic_t
active_count
;
atomic_t
active_count
;
const
keyspan_device_details
*
device_details
;
const
struct
keyspan_device_details
*
device_details
;
struct
urb
*
instat_urb
;
struct
urb
*
instat_urb
;
char
instat_buf
[
INSTAT_BUFLEN
];
char
instat_buf
[
INSTAT_BUFLEN
];
...
@@ -125,7 +125,7 @@ struct keyspan_port_private {
...
@@ -125,7 +125,7 @@ struct keyspan_port_private {
/* Keep duplicate of device details in each port
/* Keep duplicate of device details in each port
structure as well - simplifies some of the
structure as well - simplifies some of the
callback functions etc. */
callback functions etc. */
const
keyspan_device_details
*
device_details
;
const
struct
keyspan_device_details
*
device_details
;
/* Input endpoints and buffer for this port */
/* Input endpoints and buffer for this port */
struct
urb
*
in_urbs
[
2
];
struct
urb
*
in_urbs
[
2
];
...
@@ -243,7 +243,7 @@ static void keyspan_set_termios (struct usb_serial_port *port,
...
@@ -243,7 +243,7 @@ static void keyspan_set_termios (struct usb_serial_port *port,
{
{
int
baud_rate
;
int
baud_rate
;
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
const
keyspan_device_details
*
d_details
;
const
struct
keyspan_device_details
*
d_details
;
unsigned
int
cflag
;
unsigned
int
cflag
;
dbg
(
__FUNCTION__
".
\n
"
);
dbg
(
__FUNCTION__
".
\n
"
);
...
@@ -321,7 +321,7 @@ static int keyspan_write(struct usb_serial_port *port, int from_user,
...
@@ -321,7 +321,7 @@ static int keyspan_write(struct usb_serial_port *port, int from_user,
const
unsigned
char
*
buf
,
int
count
)
const
unsigned
char
*
buf
,
int
count
)
{
{
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
const
keyspan_device_details
*
d_details
;
const
struct
keyspan_device_details
*
d_details
;
int
flip
;
int
flip
;
int
left
,
todo
;
int
left
,
todo
;
struct
urb
*
this_urb
;
struct
urb
*
this_urb
;
...
@@ -481,7 +481,7 @@ static void usa26_outcont_callback(struct urb *urb)
...
@@ -481,7 +481,7 @@ static void usa26_outcont_callback(struct urb *urb)
static
void
usa26_instat_callback
(
struct
urb
*
urb
)
static
void
usa26_instat_callback
(
struct
urb
*
urb
)
{
{
unsigned
char
*
data
=
urb
->
transfer_buffer
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
keyspan_usa26_portStatusMessage
*
msg
;
struct
keyspan_usa26_portStatusMessage
*
msg
;
struct
usb_serial
*
serial
;
struct
usb_serial
*
serial
;
struct
usb_serial_port
*
port
;
struct
usb_serial_port
*
port
;
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
...
@@ -498,7 +498,7 @@ static void usa26_instat_callback(struct urb *urb)
...
@@ -498,7 +498,7 @@ static void usa26_instat_callback(struct urb *urb)
goto
exit
;
goto
exit
;
}
}
msg
=
(
keyspan_usa26_portStatusMessage
*
)
data
;
msg
=
(
struct
keyspan_usa26_portStatusMessage
*
)
data
;
#if 0
#if 0
dbg(__FUNCTION__ " port status: port %d cts %d dcd %d dsr %d ri %d toff %d txoff %d rxen %d cr %d\n",
dbg(__FUNCTION__ " port status: port %d cts %d dcd %d dsr %d ri %d toff %d txoff %d rxen %d cr %d\n",
...
@@ -619,7 +619,7 @@ static void usa28_instat_callback(struct urb *urb)
...
@@ -619,7 +619,7 @@ static void usa28_instat_callback(struct urb *urb)
{
{
int
err
;
int
err
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
keyspan_usa28_portStatusMessage
*
msg
;
struct
keyspan_usa28_portStatusMessage
*
msg
;
struct
usb_serial
*
serial
;
struct
usb_serial
*
serial
;
struct
usb_serial_port
*
port
;
struct
usb_serial_port
*
port
;
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
...
@@ -642,7 +642,7 @@ static void usa28_instat_callback(struct urb *urb)
...
@@ -642,7 +642,7 @@ static void usa28_instat_callback(struct urb *urb)
data[6], data[7], data[8], data[9], data[10], data[11]);*/
data[6], data[7], data[8], data[9], data[10], data[11]);*/
/* Now do something useful with the data */
/* Now do something useful with the data */
msg
=
(
keyspan_usa28_portStatusMessage
*
)
data
;
msg
=
(
struct
keyspan_usa28_portStatusMessage
*
)
data
;
/* Check port number from message and retrieve private data */
/* Check port number from message and retrieve private data */
...
@@ -710,7 +710,7 @@ static void usa49_instat_callback(struct urb *urb)
...
@@ -710,7 +710,7 @@ static void usa49_instat_callback(struct urb *urb)
{
{
int
err
;
int
err
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
keyspan_usa49_portStatusMessage
*
msg
;
struct
keyspan_usa49_portStatusMessage
*
msg
;
struct
usb_serial
*
serial
;
struct
usb_serial
*
serial
;
struct
usb_serial_port
*
port
;
struct
usb_serial_port
*
port
;
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
...
@@ -735,7 +735,7 @@ static void usa49_instat_callback(struct urb *urb)
...
@@ -735,7 +735,7 @@ static void usa49_instat_callback(struct urb *urb)
data[6], data[7], data[8], data[9], data[10]);*/
data[6], data[7], data[8], data[9], data[10]);*/
/* Now do something useful with the data */
/* Now do something useful with the data */
msg
=
(
keyspan_usa49_portStatusMessage
*
)
data
;
msg
=
(
struct
keyspan_usa49_portStatusMessage
*
)
data
;
/* Check port number from message and retrieve private data */
/* Check port number from message and retrieve private data */
if
(
msg
->
portNumber
>=
serial
->
num_ports
)
{
if
(
msg
->
portNumber
>=
serial
->
num_ports
)
{
...
@@ -851,7 +851,7 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp)
...
@@ -851,7 +851,7 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp)
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_serial_private
*
s_priv
;
struct
usb_serial
*
serial
=
port
->
serial
;
struct
usb_serial
*
serial
=
port
->
serial
;
const
keyspan_device_details
*
d_details
;
const
struct
keyspan_device_details
*
d_details
;
int
i
,
already_active
,
err
;
int
i
,
already_active
,
err
;
struct
urb
*
urb
;
struct
urb
*
urb
;
...
@@ -1106,7 +1106,7 @@ static void keyspan_setup_urbs(struct usb_serial *serial)
...
@@ -1106,7 +1106,7 @@ static void keyspan_setup_urbs(struct usb_serial *serial)
{
{
int
i
,
j
;
int
i
,
j
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_serial_private
*
s_priv
;
const
keyspan_device_details
*
d_details
;
const
struct
keyspan_device_details
*
d_details
;
struct
usb_serial_port
*
port
;
struct
usb_serial_port
*
port
;
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
struct
callbacks
*
cback
;
struct
callbacks
*
cback
;
...
@@ -1293,7 +1293,7 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial,
...
@@ -1293,7 +1293,7 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial,
struct
keyspan_usa26_portControlMessage
msg
;
struct
keyspan_usa26_portControlMessage
msg
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
const
keyspan_device_details
*
d_details
;
const
struct
keyspan_device_details
*
d_details
;
int
outcont_urb
;
int
outcont_urb
;
struct
urb
*
this_urb
;
struct
urb
*
this_urb
;
int
err
;
int
err
;
...
@@ -1429,7 +1429,7 @@ static int keyspan_usa28_send_setup(struct usb_serial *serial,
...
@@ -1429,7 +1429,7 @@ static int keyspan_usa28_send_setup(struct usb_serial *serial,
struct
keyspan_usa28_portControlMessage
msg
;
struct
keyspan_usa28_portControlMessage
msg
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
const
keyspan_device_details
*
d_details
;
const
struct
keyspan_device_details
*
d_details
;
struct
urb
*
this_urb
;
struct
urb
*
this_urb
;
int
err
;
int
err
;
...
@@ -1514,7 +1514,7 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial,
...
@@ -1514,7 +1514,7 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial,
struct
keyspan_usa49_portControlMessage
msg
;
struct
keyspan_usa49_portControlMessage
msg
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
const
keyspan_device_details
*
d_details
;
const
struct
keyspan_device_details
*
d_details
;
int
glocont_urb
;
int
glocont_urb
;
struct
urb
*
this_urb
;
struct
urb
*
this_urb
;
int
err
;
int
err
;
...
@@ -1640,7 +1640,7 @@ static void keyspan_send_setup(struct usb_serial_port *port, int reset_port)
...
@@ -1640,7 +1640,7 @@ static void keyspan_send_setup(struct usb_serial_port *port, int reset_port)
{
{
struct
usb_serial
*
serial
=
port
->
serial
;
struct
usb_serial
*
serial
=
port
->
serial
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_serial_private
*
s_priv
;
const
keyspan_device_details
*
d_details
;
const
struct
keyspan_device_details
*
d_details
;
s_priv
=
(
struct
keyspan_serial_private
*
)(
serial
->
private
);
s_priv
=
(
struct
keyspan_serial_private
*
)(
serial
->
private
);
d_details
=
s_priv
->
device_details
;
d_details
=
s_priv
->
device_details
;
...
@@ -1666,7 +1666,7 @@ static int keyspan_startup (struct usb_serial *serial)
...
@@ -1666,7 +1666,7 @@ static int keyspan_startup (struct usb_serial *serial)
struct
usb_serial_port
*
port
;
struct
usb_serial_port
*
port
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_port_private
*
p_priv
;
struct
keyspan_port_private
*
p_priv
;
const
keyspan_device_details
*
d_details
;
const
struct
keyspan_device_details
*
d_details
;
dbg
(
"keyspan_startup called.
\n
"
);
dbg
(
"keyspan_startup called.
\n
"
);
...
...
drivers/usb/serial/keyspan.h
View file @
721e70a9
...
@@ -194,7 +194,7 @@ struct ezusb_hex_record {
...
@@ -194,7 +194,7 @@ struct ezusb_hex_record {
#define keyspan_usa49w_product_id 0x010a
#define keyspan_usa49w_product_id 0x010a
typedef
struct
{
struct
keyspan_device_details
{
/* product ID value */
/* product ID value */
int
product_id
;
int
product_id
;
...
@@ -232,13 +232,13 @@ typedef struct {
...
@@ -232,13 +232,13 @@ typedef struct {
u8
*
rate_hi
,
u8
*
rate_low
,
u8
*
prescaler
);
u8
*
rate_hi
,
u8
*
rate_low
,
u8
*
prescaler
);
u32
baudclk
;
u32
baudclk
;
}
keyspan_device_details
;
};
/* Now for each device type we setup the device detail
/* Now for each device type we setup the device detail
structure with the appropriate information (provided
structure with the appropriate information (provided
in Keyspan's documentation) */
in Keyspan's documentation) */
static
const
keyspan_device_details
usa18x_device_details
=
{
static
const
struct
keyspan_device_details
usa18x_device_details
=
{
keyspan_usa18x_product_id
,
/* product ID */
keyspan_usa18x_product_id
,
/* product ID */
msg_usa26
,
/* msg type*/
msg_usa26
,
/* msg type*/
1
,
/* num ports */
1
,
/* num ports */
...
@@ -254,7 +254,7 @@ static const keyspan_device_details usa18x_device_details = {
...
@@ -254,7 +254,7 @@ static const keyspan_device_details usa18x_device_details = {
KEYSPAN_USA18X_BAUDCLK
/* base baud clock */
KEYSPAN_USA18X_BAUDCLK
/* base baud clock */
};
};
static
const
keyspan_device_details
usa19_device_details
=
{
static
const
struct
keyspan_device_details
usa19_device_details
=
{
keyspan_usa19_product_id
,
/* product ID */
keyspan_usa19_product_id
,
/* product ID */
msg_usa28
,
/* msg type*/
msg_usa28
,
/* msg type*/
1
,
/* num ports */
1
,
/* num ports */
...
@@ -270,7 +270,7 @@ static const keyspan_device_details usa19_device_details = {
...
@@ -270,7 +270,7 @@ static const keyspan_device_details usa19_device_details = {
KEYSPAN_USA19_BAUDCLK
/* base baud clock */
KEYSPAN_USA19_BAUDCLK
/* base baud clock */
};
};
static
const
keyspan_device_details
usa19w_device_details
=
{
static
const
struct
keyspan_device_details
usa19w_device_details
=
{
keyspan_usa19w_product_id
,
/* product ID */
keyspan_usa19w_product_id
,
/* product ID */
msg_usa26
,
/* msg type*/
msg_usa26
,
/* msg type*/
1
,
/* num ports */
1
,
/* num ports */
...
@@ -286,7 +286,7 @@ static const keyspan_device_details usa19w_device_details = {
...
@@ -286,7 +286,7 @@ static const keyspan_device_details usa19w_device_details = {
KEYSPAN_USA19W_BAUDCLK
/* base baud clock */
KEYSPAN_USA19W_BAUDCLK
/* base baud clock */
};
};
static
const
keyspan_device_details
usa28x_device_details
=
{
static
const
struct
keyspan_device_details
usa28x_device_details
=
{
keyspan_usa28x_product_id
,
/* product ID */
keyspan_usa28x_product_id
,
/* product ID */
msg_usa26
,
/* msg type*/
msg_usa26
,
/* msg type*/
2
,
/* num ports */
2
,
/* num ports */
...
@@ -302,7 +302,7 @@ static const keyspan_device_details usa28x_device_details = {
...
@@ -302,7 +302,7 @@ static const keyspan_device_details usa28x_device_details = {
KEYSPAN_USA28X_BAUDCLK
KEYSPAN_USA28X_BAUDCLK
};
};
static
const
keyspan_device_details
usa28xa_device_details
=
{
static
const
struct
keyspan_device_details
usa28xa_device_details
=
{
keyspan_usa28xa_product_id
,
/* product ID */
keyspan_usa28xa_product_id
,
/* product ID */
msg_usa26
,
/* msg type*/
msg_usa26
,
/* msg type*/
2
,
/* num ports */
2
,
/* num ports */
...
@@ -320,7 +320,7 @@ static const keyspan_device_details usa28xa_device_details = {
...
@@ -320,7 +320,7 @@ static const keyspan_device_details usa28xa_device_details = {
/* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */
/* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */
static
const
keyspan_device_details
usa49w_device_details
=
{
static
const
struct
keyspan_device_details
usa49w_device_details
=
{
keyspan_usa49w_product_id
,
/* product ID */
keyspan_usa49w_product_id
,
/* product ID */
msg_usa49
,
/* msg type*/
msg_usa49
,
/* msg type*/
4
,
/* num ports */
4
,
/* num ports */
...
@@ -336,7 +336,7 @@ static const keyspan_device_details usa49w_device_details = {
...
@@ -336,7 +336,7 @@ static const keyspan_device_details usa49w_device_details = {
KEYSPAN_USA49W_BAUDCLK
KEYSPAN_USA49W_BAUDCLK
};
};
static
const
keyspan_device_details
*
keyspan_devices
[]
=
{
static
const
struct
keyspan_device_details
*
keyspan_devices
[]
=
{
&
usa18x_device_details
,
&
usa18x_device_details
,
&
usa19_device_details
,
&
usa19_device_details
,
&
usa19w_device_details
,
&
usa19w_device_details
,
...
...
drivers/usb/serial/keyspan_usa26msg.h
View file @
721e70a9
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
#define __USA26MSG__
#define __USA26MSG__
typedef
struct
keyspan_usa26_portControlMessage
struct
keyspan_usa26_portControlMessage
{
{
/*
/*
there are three types of "commands" sent in the control message:
there are three types of "commands" sent in the control message:
...
@@ -164,7 +164,7 @@ typedef struct keyspan_usa26_portControlMessage
...
@@ -164,7 +164,7 @@ typedef struct keyspan_usa26_portControlMessage
returnStatus
,
// BOTH: return current status (even if it hasn't changed)
returnStatus
,
// BOTH: return current status (even if it hasn't changed)
resetDataToggle
;
// BOTH: reset data toggle state to DATA0
resetDataToggle
;
// BOTH: reset data toggle state to DATA0
}
keyspan_usa26_portControlMessage
;
};
// defines for bits in lcr
// defines for bits in lcr
#define USA_DATABITS_5 0x00
#define USA_DATABITS_5 0x00
...
@@ -182,7 +182,7 @@ typedef struct keyspan_usa26_portControlMessage
...
@@ -182,7 +182,7 @@ typedef struct keyspan_usa26_portControlMessage
// all things called "StatusMessage" are sent on the status endpoint
// all things called "StatusMessage" are sent on the status endpoint
typedef
struct
keyspan_usa26_portStatusMessage
// one for each port
struct
keyspan_usa26_portStatusMessage
// one for each port
{
{
u8
port
,
// BOTH: 0=first, 1=second, other=see below
u8
port
,
// BOTH: 0=first, 1=second, other=see below
hskia_cts
,
// USA26: reports HSKIA pin
hskia_cts
,
// USA26: reports HSKIA pin
...
@@ -195,7 +195,7 @@ typedef struct keyspan_usa26_portStatusMessage // one for each port
...
@@ -195,7 +195,7 @@ typedef struct keyspan_usa26_portStatusMessage // one for each port
_txXoff
,
// port is in XOFF state (either host or RX XOFF)
_txXoff
,
// port is in XOFF state (either host or RX XOFF)
rxEnabled
,
// as configured by rxOn/rxOff 1=on, 0=off
rxEnabled
,
// as configured by rxOn/rxOff 1=on, 0=off
controlResponse
;
// 1=a control message has been processed
controlResponse
;
// 1=a control message has been processed
}
keyspan_usa26_portStatusMessage
;
};
// bits in RX data message when STAT byte is included
// bits in RX data message when STAT byte is included
#define RXERROR_OVERRUN 0x02
#define RXERROR_OVERRUN 0x02
...
@@ -203,28 +203,28 @@ typedef struct keyspan_usa26_portStatusMessage // one for each port
...
@@ -203,28 +203,28 @@ typedef struct keyspan_usa26_portStatusMessage // one for each port
#define RXERROR_FRAMING 0x08
#define RXERROR_FRAMING 0x08
#define RXERROR_BREAK 0x10
#define RXERROR_BREAK 0x10
typedef
struct
keyspan_usa26_globalControlMessage
struct
keyspan_usa26_globalControlMessage
{
{
u8
sendGlobalStatus
,
// 2=request for two status responses
u8
sendGlobalStatus
,
// 2=request for two status responses
resetStatusToggle
,
// 1=reset global status toggle
resetStatusToggle
,
// 1=reset global status toggle
resetStatusCount
;
// a cycling value
resetStatusCount
;
// a cycling value
}
keyspan_usa26_globalControlMessage
;
};
typedef
struct
keyspan_usa26_globalStatusMessage
struct
keyspan_usa26_globalStatusMessage
{
{
u8
port
,
// 3
u8
port
,
// 3
sendGlobalStatus
,
// from request, decremented
sendGlobalStatus
,
// from request, decremented
resetStatusCount
;
// as in request
resetStatusCount
;
// as in request
}
keyspan_usa26_globalStatusMessage
;
};
typedef
struct
keyspan_usa26_globalDebugMessage
struct
keyspan_usa26_globalDebugMessage
{
{
u8
port
,
// 2
u8
port
,
// 2
a
,
a
,
b
,
b
,
c
,
c
,
d
;
d
;
}
keyspan_usa26_globalDebugMessage
;
};
// ie: the maximum length of an EZUSB endpoint buffer
// ie: the maximum length of an EZUSB endpoint buffer
#define MAX_DATA_LEN 64
#define MAX_DATA_LEN 64
...
...
drivers/usb/serial/keyspan_usa28msg.h
View file @
721e70a9
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
#define __USA28MSG__
#define __USA28MSG__
typedef
struct
keyspan_usa28_portControlMessage
struct
keyspan_usa28_portControlMessage
{
{
/*
/*
there are four types of "commands" sent in the control message:
there are four types of "commands" sent in the control message:
...
@@ -146,9 +146,9 @@ typedef struct keyspan_usa28_portControlMessage
...
@@ -146,9 +146,9 @@ typedef struct keyspan_usa28_portControlMessage
returnStatus
,
// return current status n times (1 or 2)
returnStatus
,
// return current status n times (1 or 2)
resetDataToggle
;
// reset data toggle state to DATA0
resetDataToggle
;
// reset data toggle state to DATA0
}
keyspan_usa28_portControlMessage
;
};
typedef
struct
keyspan_usa28_portStatusMessage
struct
keyspan_usa28_portStatusMessage
{
{
u8
port
,
// 0=first, 1=second, 2=global (see below)
u8
port
,
// 0=first, 1=second, 2=global (see below)
cts
,
cts
,
...
@@ -164,32 +164,32 @@ typedef struct keyspan_usa28_portStatusMessage
...
@@ -164,32 +164,32 @@ typedef struct keyspan_usa28_portStatusMessage
rxBreak
,
// 1=we're in break state
rxBreak
,
// 1=we're in break state
rs232invalid
,
// 1=no valid signals on rs-232 inputs
rs232invalid
,
// 1=no valid signals on rs-232 inputs
controlResponse
;
// 1=a control messages has been processed
controlResponse
;
// 1=a control messages has been processed
}
keyspan_usa28_portStatusMessage
;
};
// bit defines in txState
// bit defines in txState
#define TX_OFF 0x01 // requested by host txOff command
#define TX_OFF 0x01 // requested by host txOff command
#define TX_XOFF 0x02 // either real, or simulated by host
#define TX_XOFF 0x02 // either real, or simulated by host
typedef
struct
keyspan_usa28_globalControlMessage
struct
keyspan_usa28_globalControlMessage
{
{
u8
sendGlobalStatus
,
// 2=request for two status responses
u8
sendGlobalStatus
,
// 2=request for two status responses
resetStatusToggle
,
// 1=reset global status toggle
resetStatusToggle
,
// 1=reset global status toggle
resetStatusCount
;
// a cycling value
resetStatusCount
;
// a cycling value
}
keyspan_usa28_globalControlMessage
;
};
typedef
struct
keyspan_usa28_globalStatusMessage
struct
keyspan_usa28_globalStatusMessage
{
{
u8
port
,
// 3
u8
port
,
// 3
sendGlobalStatus
,
// from request, decremented
sendGlobalStatus
,
// from request, decremented
resetStatusCount
;
// as in request
resetStatusCount
;
// as in request
}
keyspan_usa28_globalStatusMessage
;
};
typedef
struct
keyspan_usa28_globalDebugMessage
struct
keyspan_usa28_globalDebugMessage
{
{
u8
port
,
// 2
u8
port
,
// 2
n
,
// typically a count/status byte
n
,
// typically a count/status byte
b
;
// typically a data byte
b
;
// typically a data byte
}
keyspan_usa28_globalDebugMessage
;
};
// ie: the maximum length of an EZUSB endpoint buffer
// ie: the maximum length of an EZUSB endpoint buffer
#define MAX_DATA_LEN 64
#define MAX_DATA_LEN 64
...
...
drivers/usb/serial/keyspan_usa49msg.h
View file @
721e70a9
...
@@ -107,7 +107,7 @@
...
@@ -107,7 +107,7 @@
0x80 globalControlMessage
0x80 globalControlMessage
*/
*/
typedef
struct
keyspan_usa49_portControlMessage
struct
keyspan_usa49_portControlMessage
{
{
/*
/*
0. 0/1/2/3 port control message follows
0. 0/1/2/3 port control message follows
...
@@ -173,7 +173,7 @@ typedef struct keyspan_usa49_portControlMessage
...
@@ -173,7 +173,7 @@ typedef struct keyspan_usa49_portControlMessage
enablePort
,
// start servicing port (move data, check status)
enablePort
,
// start servicing port (move data, check status)
disablePort
;
// stop servicing port (does implicit tx/rx flush/off)
disablePort
;
// stop servicing port (does implicit tx/rx flush/off)
}
keyspan_usa49_portControlMessage
;
};
// defines for bits in lcr
// defines for bits in lcr
#define USA_DATABITS_5 0x00
#define USA_DATABITS_5 0x00
...
@@ -201,7 +201,7 @@ typedef struct keyspan_usa49_portControlMessage
...
@@ -201,7 +201,7 @@ typedef struct keyspan_usa49_portControlMessage
sends any control message (either global or port-specific).
sends any control message (either global or port-specific).
*/
*/
typedef
struct
keyspan_usa49_globalControlMessage
struct
keyspan_usa49_globalControlMessage
{
{
u8
portNumber
,
// 0x80
u8
portNumber
,
// 0x80
sendGlobalStatus
,
// 1/2=number of status responses requested
sendGlobalStatus
,
// 1/2=number of status responses requested
...
@@ -209,7 +209,7 @@ typedef struct keyspan_usa49_globalControlMessage
...
@@ -209,7 +209,7 @@ typedef struct keyspan_usa49_globalControlMessage
resetStatusCount
,
// a cycling value
resetStatusCount
,
// a cycling value
remoteWakeupEnable
,
// 0x10=P1, 0x20=P2, 0x40=P3, 0x80=P4
remoteWakeupEnable
,
// 0x10=P1, 0x20=P2, 0x40=P3, 0x80=P4
disableStatusMessages
;
// 1=send no status until host talks
disableStatusMessages
;
// 1=send no status until host talks
}
keyspan_usa49_globalControlMessage
;
};
/*
/*
Device->host messages send on the global status endpoint
Device->host messages send on the global status endpoint
...
@@ -221,7 +221,7 @@ typedef struct keyspan_usa49_globalControlMessage
...
@@ -221,7 +221,7 @@ typedef struct keyspan_usa49_globalControlMessage
0x81 globalDebugMessage
0x81 globalDebugMessage
*/
*/
typedef
struct
keyspan_usa49_portStatusMessage
// one for each port
struct
keyspan_usa49_portStatusMessage
// one for each port
{
{
u8
portNumber
,
// 0,1,2,3
u8
portNumber
,
// 0,1,2,3
cts
,
// reports CTS pin
cts
,
// reports CTS pin
...
@@ -234,7 +234,7 @@ typedef struct keyspan_usa49_portStatusMessage // one for each port
...
@@ -234,7 +234,7 @@ typedef struct keyspan_usa49_portStatusMessage // one for each port
controlResponse
,
// 1=a control message has been processed
controlResponse
,
// 1=a control message has been processed
txAck
,
// ACK (data TX complete)
txAck
,
// ACK (data TX complete)
rs232valid
;
// RS-232 signal valid
rs232valid
;
// RS-232 signal valid
}
keyspan_usa49_portStatusMessage
;
};
// bits in RX data message when STAT byte is included
// bits in RX data message when STAT byte is included
#define RXERROR_OVERRUN 0x02
#define RXERROR_OVERRUN 0x02
...
@@ -242,19 +242,19 @@ typedef struct keyspan_usa49_portStatusMessage // one for each port
...
@@ -242,19 +242,19 @@ typedef struct keyspan_usa49_portStatusMessage // one for each port
#define RXERROR_FRAMING 0x08
#define RXERROR_FRAMING 0x08
#define RXERROR_BREAK 0x10
#define RXERROR_BREAK 0x10
typedef
struct
keyspan_usa49_globalStatusMessage
struct
keyspan_usa49_globalStatusMessage
{
{
u8
portNumber
,
// 0x80=globalStatusMessage
u8
portNumber
,
// 0x80=globalStatusMessage
sendGlobalStatus
,
// from request, decremented
sendGlobalStatus
,
// from request, decremented
resetStatusCount
;
// as in request
resetStatusCount
;
// as in request
}
keyspan_usa49_globalStatusMessage
;
};
typedef
struct
keyspan_usa49_globalDebugMessage
struct
keyspan_usa49_globalDebugMessage
{
{
u8
portNumber
,
// 0x81=globalDebugMessage
u8
portNumber
,
// 0x81=globalDebugMessage
n
,
// typically a count/status byte
n
,
// typically a count/status byte
b
;
// typically a data byte
b
;
// typically a data byte
}
keyspan_usa49_globalDebugMessage
;
};
// ie: the maximum length of an EZUSB endpoint buffer
// ie: the maximum length of an EZUSB endpoint buffer
#define MAX_DATA_LEN 64
#define MAX_DATA_LEN 64
...
...
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