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
9fdd2c89
Commit
9fdd2c89
authored
Aug 12, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: fix up usb-serial drivers now that port[] is an array of pointers.
parent
03d9ca5f
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
98 additions
and
98 deletions
+98
-98
drivers/usb/serial/belkin_sa.c
drivers/usb/serial/belkin_sa.c
+3
-3
drivers/usb/serial/cyberjack.c
drivers/usb/serial/cyberjack.c
+4
-4
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/digi_acceleport.c
+10
-10
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.c
+8
-8
drivers/usb/serial/generic.c
drivers/usb/serial/generic.c
+1
-1
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/io_edgeport.c
+8
-8
drivers/usb/serial/io_ti.c
drivers/usb/serial/io_ti.c
+8
-8
drivers/usb/serial/keyspan.c
drivers/usb/serial/keyspan.c
+9
-9
drivers/usb/serial/keyspan_pda.c
drivers/usb/serial/keyspan_pda.c
+5
-5
drivers/usb/serial/kl5kusb105.c
drivers/usb/serial/kl5kusb105.c
+4
-4
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/kobil_sct.c
+6
-6
drivers/usb/serial/mct_u232.c
drivers/usb/serial/mct_u232.c
+4
-4
drivers/usb/serial/omninet.c
drivers/usb/serial/omninet.c
+4
-4
drivers/usb/serial/pl2303.c
drivers/usb/serial/pl2303.c
+3
-3
drivers/usb/serial/visor.c
drivers/usb/serial/visor.c
+13
-13
drivers/usb/serial/whiteheat.c
drivers/usb/serial/whiteheat.c
+8
-8
No files found.
drivers/usb/serial/belkin_sa.c
View file @
9fdd2c89
...
@@ -189,8 +189,8 @@ static int belkin_sa_startup (struct usb_serial *serial)
...
@@ -189,8 +189,8 @@ static int belkin_sa_startup (struct usb_serial *serial)
priv
->
bad_flow_control
=
(
dev
->
descriptor
.
bcdDevice
<=
0x0206
)
?
1
:
0
;
priv
->
bad_flow_control
=
(
dev
->
descriptor
.
bcdDevice
<=
0x0206
)
?
1
:
0
;
info
(
"bcdDevice: %04x, bfc: %d"
,
dev
->
descriptor
.
bcdDevice
,
priv
->
bad_flow_control
);
info
(
"bcdDevice: %04x, bfc: %d"
,
dev
->
descriptor
.
bcdDevice
,
priv
->
bad_flow_control
);
init_waitqueue_head
(
&
serial
->
port
->
write_wait
);
init_waitqueue_head
(
&
serial
->
port
[
0
]
->
write_wait
);
usb_set_serial_port_data
(
serial
->
port
,
priv
);
usb_set_serial_port_data
(
serial
->
port
[
0
]
,
priv
);
return
(
0
);
return
(
0
);
}
}
...
@@ -206,7 +206,7 @@ static void belkin_sa_shutdown (struct usb_serial *serial)
...
@@ -206,7 +206,7 @@ static void belkin_sa_shutdown (struct usb_serial *serial)
/* 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
)
{
/* My special items, the standard routines free my urbs */
/* My special items, the standard routines free my urbs */
priv
=
usb_get_serial_port_data
(
&
serial
->
port
[
i
]);
priv
=
usb_get_serial_port_data
(
serial
->
port
[
i
]);
if
(
priv
)
if
(
priv
)
kfree
(
priv
);
kfree
(
priv
);
}
}
...
...
drivers/usb/serial/cyberjack.c
View file @
9fdd2c89
...
@@ -123,9 +123,9 @@ static int cyberjack_startup (struct usb_serial *serial)
...
@@ -123,9 +123,9 @@ static int cyberjack_startup (struct usb_serial *serial)
priv
->
rdtodo
=
0
;
priv
->
rdtodo
=
0
;
priv
->
wrfilled
=
0
;
priv
->
wrfilled
=
0
;
priv
->
wrsent
=
0
;
priv
->
wrsent
=
0
;
usb_set_serial_port_data
(
serial
->
port
,
priv
);
usb_set_serial_port_data
(
serial
->
port
[
0
]
,
priv
);
init_waitqueue_head
(
&
serial
->
port
->
write_wait
);
init_waitqueue_head
(
&
serial
->
port
[
0
]
->
write_wait
);
return
(
0
);
return
(
0
);
}
}
...
@@ -138,8 +138,8 @@ static void cyberjack_shutdown (struct usb_serial *serial)
...
@@ -138,8 +138,8 @@ static void cyberjack_shutdown (struct usb_serial *serial)
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
/* My special items, the standard routines free my urbs */
/* My special items, the standard routines free my urbs */
kfree
(
usb_get_serial_port_data
(
&
serial
->
port
[
i
]));
kfree
(
usb_get_serial_port_data
(
serial
->
port
[
i
]));
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
NULL
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
NULL
);
}
}
}
}
...
...
drivers/usb/serial/digi_acceleport.c
View file @
9fdd2c89
...
@@ -1675,7 +1675,7 @@ static int digi_startup_device( struct usb_serial *serial )
...
@@ -1675,7 +1675,7 @@ static int digi_startup_device( struct usb_serial *serial )
/* set USB_DISABLE_SPD flag for write bulk urbs */
/* set USB_DISABLE_SPD flag for write bulk urbs */
for
(
i
=
0
;
i
<
serial
->
type
->
num_ports
+
1
;
i
++
)
{
for
(
i
=
0
;
i
<
serial
->
type
->
num_ports
+
1
;
i
++
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
port
->
write_urb
->
dev
=
port
->
serial
->
dev
;
port
->
write_urb
->
dev
=
port
->
serial
->
dev
;
...
@@ -1711,7 +1711,7 @@ dbg( "digi_startup: TOP" );
...
@@ -1711,7 +1711,7 @@ dbg( "digi_startup: TOP" );
GFP_KERNEL
);
GFP_KERNEL
);
if
(
priv
==
(
struct
digi_port
*
)
0
)
{
if
(
priv
==
(
struct
digi_port
*
)
0
)
{
while
(
--
i
>=
0
)
while
(
--
i
>=
0
)
kfree
(
usb_get_serial_port_data
(
&
serial
->
port
[
i
])
);
kfree
(
usb_get_serial_port_data
(
serial
->
port
[
i
])
);
return
(
1
);
/* error */
return
(
1
);
/* error */
}
}
...
@@ -1734,9 +1734,9 @@ dbg( "digi_startup: TOP" );
...
@@ -1734,9 +1734,9 @@ dbg( "digi_startup: TOP" );
(
void
*
)(
&
serial
->
port
[
i
]));
(
void
*
)(
&
serial
->
port
[
i
]));
/* initialize write wait queue for this port */
/* initialize write wait queue for this port */
init_waitqueue_head
(
&
serial
->
port
[
i
]
.
write_wait
);
init_waitqueue_head
(
&
serial
->
port
[
i
]
->
write_wait
);
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
priv
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
priv
);
}
}
/* allocate serial private structure */
/* allocate serial private structure */
...
@@ -1744,14 +1744,14 @@ dbg( "digi_startup: TOP" );
...
@@ -1744,14 +1744,14 @@ dbg( "digi_startup: TOP" );
GFP_KERNEL
);
GFP_KERNEL
);
if
(
serial_priv
==
(
struct
digi_serial
*
)
0
)
{
if
(
serial_priv
==
(
struct
digi_serial
*
)
0
)
{
for
(
i
=
0
;
i
<
serial
->
type
->
num_ports
+
1
;
i
++
)
for
(
i
=
0
;
i
<
serial
->
type
->
num_ports
+
1
;
i
++
)
kfree
(
usb_get_serial_port_data
(
&
serial
->
port
[
i
])
);
kfree
(
usb_get_serial_port_data
(
serial
->
port
[
i
])
);
return
(
1
);
/* error */
return
(
1
);
/* error */
}
}
/* initialize serial private structure */
/* initialize serial private structure */
spin_lock_init
(
&
serial_priv
->
ds_serial_lock
);
spin_lock_init
(
&
serial_priv
->
ds_serial_lock
);
serial_priv
->
ds_oob_port_num
=
serial
->
type
->
num_ports
;
serial_priv
->
ds_oob_port_num
=
serial
->
type
->
num_ports
;
serial_priv
->
ds_oob_port
=
&
serial
->
port
[
serial_priv
->
ds_oob_port_num
];
serial_priv
->
ds_oob_port
=
serial
->
port
[
serial_priv
->
ds_oob_port_num
];
serial_priv
->
ds_device_started
=
0
;
serial_priv
->
ds_device_started
=
0
;
usb_set_serial_data
(
serial
,
serial_priv
);
usb_set_serial_data
(
serial
,
serial_priv
);
...
@@ -1770,14 +1770,14 @@ dbg( "digi_shutdown: TOP, in_interrupt()=%ld", in_interrupt() );
...
@@ -1770,14 +1770,14 @@ dbg( "digi_shutdown: TOP, in_interrupt()=%ld", in_interrupt() );
/* stop reads and writes on all ports */
/* stop reads and writes on all ports */
for
(
i
=
0
;
i
<
serial
->
type
->
num_ports
+
1
;
i
++
)
{
for
(
i
=
0
;
i
<
serial
->
type
->
num_ports
+
1
;
i
++
)
{
usb_unlink_urb
(
serial
->
port
[
i
]
.
read_urb
);
usb_unlink_urb
(
serial
->
port
[
i
]
->
read_urb
);
usb_unlink_urb
(
serial
->
port
[
i
]
.
write_urb
);
usb_unlink_urb
(
serial
->
port
[
i
]
->
write_urb
);
}
}
/* free the private data structures for all ports */
/* free the private data structures for all ports */
/* number of regular ports + 1 for the out-of-band port */
/* number of regular ports + 1 for the out-of-band port */
for
(
i
=
0
;
i
<
serial
->
type
->
num_ports
+
1
;
i
++
)
for
(
i
=
0
;
i
<
serial
->
type
->
num_ports
+
1
;
i
++
)
kfree
(
usb_get_serial_port_data
(
&
serial
->
port
[
i
])
);
kfree
(
usb_get_serial_port_data
(
serial
->
port
[
i
])
);
kfree
(
usb_get_serial_data
(
serial
)
);
kfree
(
usb_get_serial_data
(
serial
)
);
}
}
...
@@ -1980,7 +1980,7 @@ opcode, line, status, val );
...
@@ -1980,7 +1980,7 @@ opcode, line, status, val );
if
(
status
!=
0
||
line
>=
serial
->
type
->
num_ports
)
if
(
status
!=
0
||
line
>=
serial
->
type
->
num_ports
)
continue
;
continue
;
port
=
&
serial
->
port
[
line
];
port
=
serial
->
port
[
line
];
if
(
port_paranoia_check
(
port
,
__FUNCTION__
)
if
(
port_paranoia_check
(
port
,
__FUNCTION__
)
||
(
priv
=
usb_get_serial_port_data
(
port
))
==
NULL
)
||
(
priv
=
usb_get_serial_port_data
(
port
))
==
NULL
)
...
...
drivers/usb/serial/ftdi_sio.c
View file @
9fdd2c89
...
@@ -981,7 +981,7 @@ static int set_serial_info(struct usb_serial_port * port, struct serial_struct *
...
@@ -981,7 +981,7 @@ static int set_serial_info(struct usb_serial_port * port, struct serial_struct *
/* Called from ftdi_SIO_startup, etc. */
/* Called from ftdi_SIO_startup, etc. */
static
int
ftdi_common_startup
(
struct
usb_serial
*
serial
)
static
int
ftdi_common_startup
(
struct
usb_serial
*
serial
)
{
{
struct
usb_serial_port
*
port
=
&
serial
->
port
[
0
];
struct
usb_serial_port
*
port
=
serial
->
port
[
0
];
struct
ftdi_private
*
priv
;
struct
ftdi_private
*
priv
;
dbg
(
"%s"
,
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
...
@@ -1022,7 +1022,7 @@ static int ftdi_common_startup (struct usb_serial *serial)
...
@@ -1022,7 +1022,7 @@ static int ftdi_common_startup (struct usb_serial *serial)
port
->
bulk_out_buffer
=
NULL
;
port
->
bulk_out_buffer
=
NULL
;
}
}
usb_set_serial_port_data
(
serial
->
port
,
priv
);
usb_set_serial_port_data
(
serial
->
port
[
0
]
,
priv
);
return
(
0
);
return
(
0
);
}
}
...
@@ -1042,7 +1042,7 @@ static int ftdi_SIO_startup (struct usb_serial *serial)
...
@@ -1042,7 +1042,7 @@ static int ftdi_SIO_startup (struct usb_serial *serial)
return
(
err
);
return
(
err
);
}
}
priv
=
usb_get_serial_port_data
(
serial
->
port
);
priv
=
usb_get_serial_port_data
(
serial
->
port
[
0
]
);
priv
->
chip_type
=
SIO
;
priv
->
chip_type
=
SIO
;
priv
->
baud_base
=
12000000
/
16
;
priv
->
baud_base
=
12000000
/
16
;
priv
->
write_offset
=
1
;
priv
->
write_offset
=
1
;
...
@@ -1063,7 +1063,7 @@ static int ftdi_8U232AM_startup (struct usb_serial *serial)
...
@@ -1063,7 +1063,7 @@ static int ftdi_8U232AM_startup (struct usb_serial *serial)
return
(
err
);
return
(
err
);
}
}
priv
=
usb_get_serial_port_data
(
serial
->
port
);
priv
=
usb_get_serial_port_data
(
serial
->
port
[
0
]
);
priv
->
chip_type
=
FT8U232AM
;
priv
->
chip_type
=
FT8U232AM
;
priv
->
baud_base
=
48000000
/
2
;
/* Would be / 16, but FTDI supports 0.125, 0.25 and 0.5 divisor fractions! */
priv
->
baud_base
=
48000000
/
2
;
/* Would be / 16, but FTDI supports 0.125, 0.25 and 0.5 divisor fractions! */
...
@@ -1083,7 +1083,7 @@ static int ftdi_FT232BM_startup (struct usb_serial *serial)
...
@@ -1083,7 +1083,7 @@ static int ftdi_FT232BM_startup (struct usb_serial *serial)
return
(
err
);
return
(
err
);
}
}
priv
=
usb_get_serial_port_data
(
serial
->
port
);
priv
=
usb_get_serial_port_data
(
serial
->
port
[
0
]
);
priv
->
chip_type
=
FT232BM
;
priv
->
chip_type
=
FT232BM
;
priv
->
baud_base
=
48000000
/
2
;
/* Would be / 16, but FT232BM supports multiple of 0.125 divisor fractions! */
priv
->
baud_base
=
48000000
/
2
;
/* Would be / 16, but FT232BM supports multiple of 0.125 divisor fractions! */
...
@@ -1103,7 +1103,7 @@ static int ftdi_USB_UIRT_startup (struct usb_serial *serial)
...
@@ -1103,7 +1103,7 @@ static int ftdi_USB_UIRT_startup (struct usb_serial *serial)
return
(
err
);
return
(
err
);
}
}
priv
=
usb_get_serial_port_data
(
serial
->
port
);
priv
=
usb_get_serial_port_data
(
serial
->
port
[
0
]
);
priv
->
flags
|=
ASYNC_SPD_CUST
;
priv
->
flags
|=
ASYNC_SPD_CUST
;
priv
->
custom_divisor
=
77
;
priv
->
custom_divisor
=
77
;
priv
->
force_baud
=
B38400
;
priv
->
force_baud
=
B38400
;
...
@@ -1124,7 +1124,7 @@ static int ftdi_HE_TIRA1_startup (struct usb_serial *serial)
...
@@ -1124,7 +1124,7 @@ static int ftdi_HE_TIRA1_startup (struct usb_serial *serial)
return
(
err
);
return
(
err
);
}
}
priv
=
usb_get_serial_port_data
(
serial
->
port
);
priv
=
usb_get_serial_port_data
(
serial
->
port
[
0
]
);
priv
->
flags
|=
ASYNC_SPD_CUST
;
priv
->
flags
|=
ASYNC_SPD_CUST
;
priv
->
custom_divisor
=
240
;
priv
->
custom_divisor
=
240
;
priv
->
force_baud
=
B38400
;
priv
->
force_baud
=
B38400
;
...
@@ -1146,7 +1146,7 @@ static int ftdi_HE_TIRA1_startup (struct usb_serial *serial)
...
@@ -1146,7 +1146,7 @@ static int ftdi_HE_TIRA1_startup (struct usb_serial *serial)
static
void
ftdi_shutdown
(
struct
usb_serial
*
serial
)
static
void
ftdi_shutdown
(
struct
usb_serial
*
serial
)
{
/* ftdi_shutdown */
{
/* ftdi_shutdown */
struct
usb_serial_port
*
port
=
serial
->
port
;
struct
usb_serial_port
*
port
=
serial
->
port
[
0
];
struct
ftdi_private
*
priv
=
usb_get_serial_port_data
(
port
);
struct
ftdi_private
*
priv
=
usb_get_serial_port_data
(
port
);
dbg
(
"%s"
,
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
...
...
drivers/usb/serial/generic.c
View file @
9fdd2c89
...
@@ -300,7 +300,7 @@ void usb_serial_generic_shutdown (struct usb_serial *serial)
...
@@ -300,7 +300,7 @@ void usb_serial_generic_shutdown (struct usb_serial *serial)
/* 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
)
{
generic_cleanup
(
&
serial
->
port
[
i
]);
generic_cleanup
(
serial
->
port
[
i
]);
}
}
}
}
drivers/usb/serial/io_edgeport.c
View file @
9fdd2c89
...
@@ -824,7 +824,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
...
@@ -824,7 +824,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
while
((
position
<
length
)
&&
(
portNumber
<
edge_serial
->
serial
->
num_ports
))
{
while
((
position
<
length
)
&&
(
portNumber
<
edge_serial
->
serial
->
num_ports
))
{
txCredits
=
data
[
position
]
|
(
data
[
position
+
1
]
<<
8
);
txCredits
=
data
[
position
]
|
(
data
[
position
+
1
]
<<
8
);
if
(
txCredits
)
{
if
(
txCredits
)
{
port
=
&
edge_serial
->
serial
->
port
[
portNumber
];
port
=
edge_serial
->
serial
->
port
[
portNumber
];
if
(
port_paranoia_check
(
port
,
__FUNCTION__
)
==
0
)
{
if
(
port_paranoia_check
(
port
,
__FUNCTION__
)
==
0
)
{
edge_port
=
usb_get_serial_port_data
(
port
);
edge_port
=
usb_get_serial_port_data
(
port
);
if
(
edge_port
->
open
)
{
if
(
edge_port
->
open
)
{
...
@@ -1031,7 +1031,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
...
@@ -1031,7 +1031,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
return
-
ENODEV
;
return
-
ENODEV
;
}
}
if
(
edge_serial
->
interrupt_in_buffer
==
NULL
)
{
if
(
edge_serial
->
interrupt_in_buffer
==
NULL
)
{
struct
usb_serial_port
*
port0
=
&
serial
->
port
[
0
];
struct
usb_serial_port
*
port0
=
serial
->
port
[
0
];
/* not set up yet, so do it now */
/* not set up yet, so do it now */
edge_serial
->
interrupt_in_buffer
=
port0
->
interrupt_in_buffer
;
edge_serial
->
interrupt_in_buffer
=
port0
->
interrupt_in_buffer
;
...
@@ -2065,7 +2065,7 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char
...
@@ -2065,7 +2065,7 @@ static int process_rcvd_data (struct edgeport_serial *edge_serial, unsigned char
/* spit this data back into the tty driver if this port is open */
/* spit this data back into the tty driver if this port is open */
if
(
rxLen
)
{
if
(
rxLen
)
{
port
=
&
edge_serial
->
serial
->
port
[
edge_serial
->
rxPort
];
port
=
edge_serial
->
serial
->
port
[
edge_serial
->
rxPort
];
if
(
port_paranoia_check
(
port
,
__FUNCTION__
)
==
0
)
{
if
(
port_paranoia_check
(
port
,
__FUNCTION__
)
==
0
)
{
edge_port
=
usb_get_serial_port_data
(
port
);
edge_port
=
usb_get_serial_port_data
(
port
);
if
(
edge_port
->
open
)
{
if
(
edge_port
->
open
)
{
...
@@ -2118,7 +2118,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
...
@@ -2118,7 +2118,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
__u8
code
=
edge_serial
->
rxStatusCode
;
__u8
code
=
edge_serial
->
rxStatusCode
;
/* switch the port pointer to the one being currently talked about */
/* switch the port pointer to the one being currently talked about */
port
=
&
edge_serial
->
serial
->
port
[
edge_serial
->
rxPort
];
port
=
edge_serial
->
serial
->
port
[
edge_serial
->
rxPort
];
if
(
port_paranoia_check
(
port
,
__FUNCTION__
))
{
if
(
port_paranoia_check
(
port
,
__FUNCTION__
))
{
return
;
return
;
}
}
...
@@ -3018,8 +3018,8 @@ static int edge_startup (struct usb_serial *serial)
...
@@ -3018,8 +3018,8 @@ static int edge_startup (struct usb_serial *serial)
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
memset
(
edge_port
,
0
,
sizeof
(
struct
edgeport_port
));
memset
(
edge_port
,
0
,
sizeof
(
struct
edgeport_port
));
edge_port
->
port
=
&
serial
->
port
[
i
];
edge_port
->
port
=
serial
->
port
[
i
];
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
edge_port
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
edge_port
);
}
}
return
0
;
return
0
;
...
@@ -3039,8 +3039,8 @@ static void edge_shutdown (struct usb_serial *serial)
...
@@ -3039,8 +3039,8 @@ static void edge_shutdown (struct usb_serial *serial)
/* 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
)
{
kfree
(
usb_get_serial_port_data
(
&
serial
->
port
[
i
]));
kfree
(
usb_get_serial_port_data
(
serial
->
port
[
i
]));
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
NULL
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
NULL
);
}
}
kfree
(
usb_get_serial_data
(
serial
));
kfree
(
usb_get_serial_data
(
serial
));
usb_set_serial_data
(
serial
,
NULL
);
usb_set_serial_data
(
serial
,
NULL
);
...
...
drivers/usb/serial/io_ti.c
View file @
9fdd2c89
...
@@ -924,7 +924,7 @@ static int TISendBulkTransferSync (struct usb_serial *serial, void *buffer, int
...
@@ -924,7 +924,7 @@ static int TISendBulkTransferSync (struct usb_serial *serial, void *buffer, int
status
=
usb_bulk_msg
(
serial
->
dev
,
status
=
usb_bulk_msg
(
serial
->
dev
,
usb_sndbulkpipe
(
serial
->
dev
,
usb_sndbulkpipe
(
serial
->
dev
,
serial
->
port
[
0
]
.
bulk_out_endpointAddress
),
serial
->
port
[
0
]
->
bulk_out_endpointAddress
),
buffer
,
buffer
,
length
,
length
,
num_sent
,
num_sent
,
...
@@ -1682,7 +1682,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
...
@@ -1682,7 +1682,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
function
=
TIUMP_GET_FUNC_FROM_CODE
(
data
[
0
]);
function
=
TIUMP_GET_FUNC_FROM_CODE
(
data
[
0
]);
dbg
(
"%s - port_number %d, function %d, info 0x%x"
,
dbg
(
"%s - port_number %d, function %d, info 0x%x"
,
__FUNCTION__
,
port_number
,
function
,
data
[
1
]);
__FUNCTION__
,
port_number
,
function
,
data
[
1
]);
port
=
&
edge_serial
->
serial
->
port
[
port_number
];
port
=
edge_serial
->
serial
->
port
[
port_number
];
if
(
port_paranoia_check
(
port
,
__FUNCTION__
))
{
if
(
port_paranoia_check
(
port
,
__FUNCTION__
))
{
dbg
(
"%s - change found for port that is not present"
,
dbg
(
"%s - change found for port that is not present"
,
__FUNCTION__
);
__FUNCTION__
);
...
@@ -1945,7 +1945,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
...
@@ -1945,7 +1945,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
edge_serial
=
edge_port
->
edge_serial
;
edge_serial
=
edge_port
->
edge_serial
;
if
(
edge_serial
->
num_ports_open
==
0
)
{
if
(
edge_serial
->
num_ports_open
==
0
)
{
/* we are the first port to be opened, let's post the interrupt urb */
/* we are the first port to be opened, let's post the interrupt urb */
urb
=
edge_serial
->
serial
->
port
[
0
]
.
interrupt_in_urb
;
urb
=
edge_serial
->
serial
->
port
[
0
]
->
interrupt_in_urb
;
if
(
!
urb
)
{
if
(
!
urb
)
{
dev_err
(
&
port
->
dev
,
"%s - no interrupt urb present, exiting
\n
"
,
__FUNCTION__
);
dev_err
(
&
port
->
dev
,
"%s - no interrupt urb present, exiting
\n
"
,
__FUNCTION__
);
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -2034,7 +2034,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
...
@@ -2034,7 +2034,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
--
edge_port
->
edge_serial
->
num_ports_open
;
--
edge_port
->
edge_serial
->
num_ports_open
;
if
(
edge_port
->
edge_serial
->
num_ports_open
<=
0
)
{
if
(
edge_port
->
edge_serial
->
num_ports_open
<=
0
)
{
/* last port is now closed, let's shut down our interrupt urb */
/* last port is now closed, let's shut down our interrupt urb */
usb_unlink_urb
(
serial
->
port
[
0
]
.
interrupt_in_urb
);
usb_unlink_urb
(
serial
->
port
[
0
]
->
interrupt_in_urb
);
edge_port
->
edge_serial
->
num_ports_open
=
0
;
edge_port
->
edge_serial
->
num_ports_open
=
0
;
}
}
edge_port
->
close_pending
=
0
;
edge_port
->
close_pending
=
0
;
...
@@ -2603,9 +2603,9 @@ static int edge_startup (struct usb_serial *serial)
...
@@ -2603,9 +2603,9 @@ static int edge_startup (struct usb_serial *serial)
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
memset
(
edge_port
,
0
,
sizeof
(
struct
edgeport_port
));
memset
(
edge_port
,
0
,
sizeof
(
struct
edgeport_port
));
edge_port
->
port
=
&
serial
->
port
[
i
];
edge_port
->
port
=
serial
->
port
[
i
];
edge_port
->
edge_serial
=
edge_serial
;
edge_port
->
edge_serial
=
edge_serial
;
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
edge_port
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
edge_port
);
}
}
return
0
;
return
0
;
...
@@ -2618,8 +2618,8 @@ static void edge_shutdown (struct usb_serial *serial)
...
@@ -2618,8 +2618,8 @@ static void edge_shutdown (struct usb_serial *serial)
dbg
(
"%s"
,
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
kfree
(
usb_get_serial_port_data
(
&
serial
->
port
[
i
]));
kfree
(
usb_get_serial_port_data
(
serial
->
port
[
i
]));
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
NULL
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
NULL
);
}
}
kfree
(
usb_get_serial_data
(
serial
));
kfree
(
usb_get_serial_data
(
serial
));
usb_set_serial_data
(
serial
,
NULL
);
usb_set_serial_data
(
serial
,
NULL
);
...
...
drivers/usb/serial/keyspan.c
View file @
9fdd2c89
...
@@ -523,7 +523,7 @@ static void usa26_instat_callback(struct urb *urb, struct pt_regs *regs)
...
@@ -523,7 +523,7 @@ static void usa26_instat_callback(struct urb *urb, struct pt_regs *regs)
dbg
(
"%s - Unexpected port number %d"
,
__FUNCTION__
,
msg
->
port
);
dbg
(
"%s - Unexpected port number %d"
,
__FUNCTION__
,
msg
->
port
);
goto
exit
;
goto
exit
;
}
}
port
=
&
serial
->
port
[
msg
->
port
];
port
=
serial
->
port
[
msg
->
port
];
p_priv
=
usb_get_serial_port_data
(
port
);
p_priv
=
usb_get_serial_port_data
(
port
);
/* Update handshaking pin state information */
/* Update handshaking pin state information */
...
@@ -658,7 +658,7 @@ static void usa28_instat_callback(struct urb *urb, struct pt_regs *regs)
...
@@ -658,7 +658,7 @@ static void usa28_instat_callback(struct urb *urb, struct pt_regs *regs)
dbg
(
"%s - Unexpected port number %d"
,
__FUNCTION__
,
msg
->
port
);
dbg
(
"%s - Unexpected port number %d"
,
__FUNCTION__
,
msg
->
port
);
goto
exit
;
goto
exit
;
}
}
port
=
&
serial
->
port
[
msg
->
port
];
port
=
serial
->
port
[
msg
->
port
];
p_priv
=
usb_get_serial_port_data
(
port
);
p_priv
=
usb_get_serial_port_data
(
port
);
/* Update handshaking pin state information */
/* Update handshaking pin state information */
...
@@ -701,7 +701,7 @@ static void usa49_glocont_callback(struct urb *urb, struct pt_regs *regs)
...
@@ -701,7 +701,7 @@ static void usa49_glocont_callback(struct urb *urb, struct pt_regs *regs)
serial
=
(
struct
usb_serial
*
)
urb
->
context
;
serial
=
(
struct
usb_serial
*
)
urb
->
context
;
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
p_priv
=
usb_get_serial_port_data
(
port
);
p_priv
=
usb_get_serial_port_data
(
port
);
if
(
p_priv
->
resend_cont
)
{
if
(
p_priv
->
resend_cont
)
{
...
@@ -750,7 +750,7 @@ static void usa49_instat_callback(struct urb *urb, struct pt_regs *regs)
...
@@ -750,7 +750,7 @@ static void usa49_instat_callback(struct urb *urb, struct pt_regs *regs)
dbg
(
"%s - Unexpected port number %d"
,
__FUNCTION__
,
msg
->
portNumber
);
dbg
(
"%s - Unexpected port number %d"
,
__FUNCTION__
,
msg
->
portNumber
);
goto
exit
;
goto
exit
;
}
}
port
=
&
serial
->
port
[
msg
->
portNumber
];
port
=
serial
->
port
[
msg
->
portNumber
];
p_priv
=
usb_get_serial_port_data
(
port
);
p_priv
=
usb_get_serial_port_data
(
port
);
/* Update handshaking pin state information */
/* Update handshaking pin state information */
...
@@ -1188,7 +1188,7 @@ static void keyspan_setup_urbs(struct usb_serial *serial)
...
@@ -1188,7 +1188,7 @@ static void keyspan_setup_urbs(struct usb_serial *serial)
/* Setup endpoints for each port specific thing */
/* Setup endpoints for each port specific thing */
for
(
i
=
0
;
i
<
d_details
->
num_ports
;
i
++
)
{
for
(
i
=
0
;
i
<
d_details
->
num_ports
;
i
++
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
p_priv
=
usb_get_serial_port_data
(
port
);
p_priv
=
usb_get_serial_port_data
(
port
);
/* Do indat endpoints first, once for each flip */
/* Do indat endpoints first, once for each flip */
...
@@ -1893,7 +1893,7 @@ static int keyspan_startup (struct usb_serial *serial)
...
@@ -1893,7 +1893,7 @@ static int keyspan_startup (struct usb_serial *serial)
/* Now setup per port private data */
/* Now setup per port private data */
for
(
i
=
0
;
i
<
serial
->
num_ports
;
i
++
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
i
++
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
p_priv
=
kmalloc
(
sizeof
(
struct
keyspan_port_private
),
GFP_KERNEL
);
p_priv
=
kmalloc
(
sizeof
(
struct
keyspan_port_private
),
GFP_KERNEL
);
if
(
!
p_priv
)
{
if
(
!
p_priv
)
{
dbg
(
"%s - kmalloc for keyspan_port_private (%d) failed!."
,
__FUNCTION__
,
i
);
dbg
(
"%s - kmalloc for keyspan_port_private (%d) failed!."
,
__FUNCTION__
,
i
);
...
@@ -1929,7 +1929,7 @@ static void keyspan_shutdown (struct usb_serial *serial)
...
@@ -1929,7 +1929,7 @@ static void keyspan_shutdown (struct usb_serial *serial)
stop_urb
(
s_priv
->
instat_urb
);
stop_urb
(
s_priv
->
instat_urb
);
stop_urb
(
s_priv
->
glocont_urb
);
stop_urb
(
s_priv
->
glocont_urb
);
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
p_priv
=
usb_get_serial_port_data
(
port
);
p_priv
=
usb_get_serial_port_data
(
port
);
stop_urb
(
p_priv
->
inack_urb
);
stop_urb
(
p_priv
->
inack_urb
);
stop_urb
(
p_priv
->
outcont_urb
);
stop_urb
(
p_priv
->
outcont_urb
);
...
@@ -1945,7 +1945,7 @@ static void keyspan_shutdown (struct usb_serial *serial)
...
@@ -1945,7 +1945,7 @@ static void keyspan_shutdown (struct usb_serial *serial)
if
(
s_priv
->
glocont_urb
)
if
(
s_priv
->
glocont_urb
)
usb_free_urb
(
s_priv
->
glocont_urb
);
usb_free_urb
(
s_priv
->
glocont_urb
);
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
p_priv
=
usb_get_serial_port_data
(
port
);
p_priv
=
usb_get_serial_port_data
(
port
);
if
(
p_priv
->
inack_urb
)
if
(
p_priv
->
inack_urb
)
usb_free_urb
(
p_priv
->
inack_urb
);
usb_free_urb
(
p_priv
->
inack_urb
);
...
@@ -1965,7 +1965,7 @@ static void keyspan_shutdown (struct usb_serial *serial)
...
@@ -1965,7 +1965,7 @@ static void keyspan_shutdown (struct usb_serial *serial)
/* dbg("Freeing port->private."); */
/* dbg("Freeing port->private."); */
/* Now free per port private data */
/* Now free per port private data */
for
(
i
=
0
;
i
<
serial
->
num_ports
;
i
++
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
i
++
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
kfree
(
usb_get_serial_port_data
(
port
));
kfree
(
usb_get_serial_port_data
(
port
));
}
}
}
}
...
...
drivers/usb/serial/keyspan_pda.c
View file @
9fdd2c89
...
@@ -264,7 +264,7 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
...
@@ -264,7 +264,7 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
case
0
:
case
0
:
/* rest of message is rx data */
/* rest of message is rx data */
if
(
urb
->
actual_length
)
{
if
(
urb
->
actual_length
)
{
tty
=
serial
->
port
[
0
]
.
tty
;
tty
=
serial
->
port
[
0
]
->
tty
;
for
(
i
=
1
;
i
<
urb
->
actual_length
;
++
i
)
{
for
(
i
=
1
;
i
<
urb
->
actual_length
;
++
i
)
{
tty_insert_flip_char
(
tty
,
data
[
i
],
0
);
tty_insert_flip_char
(
tty
,
data
[
i
],
0
);
}
}
...
@@ -278,7 +278,7 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
...
@@ -278,7 +278,7 @@ static void keyspan_pda_rx_interrupt (struct urb *urb, struct pt_regs *regs)
case
1
:
/* modemline change */
case
1
:
/* modemline change */
break
;
break
;
case
2
:
/* tx unthrottle interrupt */
case
2
:
/* tx unthrottle interrupt */
tty
=
serial
->
port
[
0
]
.
tty
;
tty
=
serial
->
port
[
0
]
->
tty
;
priv
->
tx_throttled
=
0
;
priv
->
tx_throttled
=
0
;
/* queue up a wakeup at scheduler time */
/* queue up a wakeup at scheduler time */
schedule_work
(
&
priv
->
wakeup_work
);
schedule_work
(
&
priv
->
wakeup_work
);
...
@@ -801,8 +801,8 @@ static int keyspan_pda_startup (struct usb_serial *serial)
...
@@ -801,8 +801,8 @@ static int keyspan_pda_startup (struct usb_serial *serial)
priv
=
kmalloc
(
sizeof
(
struct
keyspan_pda_private
),
GFP_KERNEL
);
priv
=
kmalloc
(
sizeof
(
struct
keyspan_pda_private
),
GFP_KERNEL
);
if
(
!
priv
)
if
(
!
priv
)
return
(
1
);
/* error */
return
(
1
);
/* error */
usb_set_serial_port_data
(
&
serial
->
port
[
0
],
priv
);
usb_set_serial_port_data
(
serial
->
port
[
0
],
priv
);
init_waitqueue_head
(
&
serial
->
port
[
0
]
.
write_wait
);
init_waitqueue_head
(
&
serial
->
port
[
0
]
->
write_wait
);
INIT_WORK
(
&
priv
->
wakeup_work
,
(
void
*
)
keyspan_pda_wakeup_write
,
INIT_WORK
(
&
priv
->
wakeup_work
,
(
void
*
)
keyspan_pda_wakeup_write
,
(
void
*
)(
&
serial
->
port
[
0
]));
(
void
*
)(
&
serial
->
port
[
0
]));
INIT_WORK
(
&
priv
->
unthrottle_work
,
INIT_WORK
(
&
priv
->
unthrottle_work
,
...
@@ -815,7 +815,7 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
...
@@ -815,7 +815,7 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
{
{
dbg
(
"%s"
,
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
kfree
(
usb_get_serial_port_data
(
&
serial
->
port
[
0
]));
kfree
(
usb_get_serial_port_data
(
serial
->
port
[
0
]));
}
}
#ifdef KEYSPAN
#ifdef KEYSPAN
...
...
drivers/usb/serial/kl5kusb105.c
View file @
9fdd2c89
...
@@ -290,7 +290,7 @@ static int klsi_105_startup (struct usb_serial *serial)
...
@@ -290,7 +290,7 @@ static int klsi_105_startup (struct usb_serial *serial)
priv
->
bytes_in
=
0
;
priv
->
bytes_in
=
0
;
priv
->
bytes_out
=
0
;
priv
->
bytes_out
=
0
;
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
priv
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
priv
);
spin_lock_init
(
&
priv
->
lock
);
spin_lock_init
(
&
priv
->
lock
);
for
(
i
=
0
;
i
<
NUM_URBS
;
i
++
)
{
for
(
i
=
0
;
i
<
NUM_URBS
;
i
++
)
{
...
@@ -312,7 +312,7 @@ static int klsi_105_startup (struct usb_serial *serial)
...
@@ -312,7 +312,7 @@ static int klsi_105_startup (struct usb_serial *serial)
}
}
/* priv->termios is left uninitalized until port opening */
/* priv->termios is left uninitalized until port opening */
init_waitqueue_head
(
&
serial
->
port
[
i
]
.
write_wait
);
init_waitqueue_head
(
&
serial
->
port
[
i
]
->
write_wait
);
}
}
return
(
0
);
return
(
0
);
...
@@ -327,7 +327,7 @@ static void klsi_105_shutdown (struct usb_serial *serial)
...
@@ -327,7 +327,7 @@ static void klsi_105_shutdown (struct usb_serial *serial)
/* 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
)
{
struct
klsi_105_private
*
priv
=
usb_get_serial_port_data
(
&
serial
->
port
[
i
]);
struct
klsi_105_private
*
priv
=
usb_get_serial_port_data
(
serial
->
port
[
i
]);
unsigned
long
flags
;
unsigned
long
flags
;
if
(
priv
)
{
if
(
priv
)
{
...
@@ -354,7 +354,7 @@ static void klsi_105_shutdown (struct usb_serial *serial)
...
@@ -354,7 +354,7 @@ static void klsi_105_shutdown (struct usb_serial *serial)
spin_unlock_irqrestore
(
&
priv
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
priv
->
lock
,
flags
);
kfree
(
priv
);
kfree
(
priv
);
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
NULL
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
NULL
);
}
}
}
}
}
/* klsi_105_shutdown */
}
/* klsi_105_shutdown */
...
...
drivers/usb/serial/kobil_sct.c
View file @
9fdd2c89
...
@@ -177,7 +177,7 @@ static int kobil_startup (struct usb_serial *serial)
...
@@ -177,7 +177,7 @@ static int kobil_startup (struct usb_serial *serial)
printk
(
KERN_DEBUG
"KOBIL KAAN SIM detected
\n
"
);
printk
(
KERN_DEBUG
"KOBIL KAAN SIM detected
\n
"
);
break
;
break
;
}
}
usb_set_serial_port_data
(
serial
->
port
,
priv
);
usb_set_serial_port_data
(
serial
->
port
[
0
]
,
priv
);
// search for the necessary endpoints
// search for the necessary endpoints
pdev
=
serial
->
dev
;
pdev
=
serial
->
dev
;
...
@@ -206,14 +206,14 @@ static int kobil_startup (struct usb_serial *serial)
...
@@ -206,14 +206,14 @@ static int kobil_startup (struct usb_serial *serial)
static
void
kobil_shutdown
(
struct
usb_serial
*
serial
)
static
void
kobil_shutdown
(
struct
usb_serial
*
serial
)
{
{
int
i
;
int
i
;
dbg
(
"%s - port %d"
,
__FUNCTION__
,
serial
->
port
->
number
);
dbg
(
"%s - port %d"
,
__FUNCTION__
,
serial
->
port
[
0
]
->
number
);
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
while
(
serial
->
port
[
i
]
.
open_count
>
0
)
{
while
(
serial
->
port
[
i
]
->
open_count
>
0
)
{
kobil_close
(
&
serial
->
port
[
i
],
NULL
);
kobil_close
(
serial
->
port
[
i
],
NULL
);
}
}
kfree
(
usb_get_serial_port_data
(
&
serial
->
port
[
i
]));
kfree
(
usb_get_serial_port_data
(
serial
->
port
[
i
]));
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
NULL
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
NULL
);
}
}
}
}
...
...
drivers/usb/serial/mct_u232.c
View file @
9fdd2c89
...
@@ -320,9 +320,9 @@ static int mct_u232_startup (struct usb_serial *serial)
...
@@ -320,9 +320,9 @@ static int mct_u232_startup (struct usb_serial *serial)
priv
->
control_state
=
0
;
priv
->
control_state
=
0
;
priv
->
last_lsr
=
0
;
priv
->
last_lsr
=
0
;
priv
->
last_msr
=
0
;
priv
->
last_msr
=
0
;
usb_set_serial_port_data
(
serial
->
port
,
priv
);
usb_set_serial_port_data
(
serial
->
port
[
0
]
,
priv
);
init_waitqueue_head
(
&
serial
->
port
->
write_wait
);
init_waitqueue_head
(
&
serial
->
port
[
0
]
->
write_wait
);
return
(
0
);
return
(
0
);
}
/* mct_u232_startup */
}
/* mct_u232_startup */
...
@@ -337,7 +337,7 @@ static void mct_u232_shutdown (struct usb_serial *serial)
...
@@ -337,7 +337,7 @@ static void mct_u232_shutdown (struct usb_serial *serial)
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
/* My special items, the standard routines free my urbs */
/* My special items, the standard routines free my urbs */
priv
=
usb_get_serial_port_data
(
&
serial
->
port
[
i
]);
priv
=
usb_get_serial_port_data
(
serial
->
port
[
i
]);
if
(
priv
)
if
(
priv
)
kfree
(
priv
);
kfree
(
priv
);
}
}
...
@@ -393,7 +393,7 @@ static int mct_u232_open (struct usb_serial_port *port, struct file *filp)
...
@@ -393,7 +393,7 @@ static int mct_u232_open (struct usb_serial_port *port, struct file *filp)
{
{
/* Puh, that's dirty */
/* Puh, that's dirty */
struct
usb_serial_port
*
rport
;
struct
usb_serial_port
*
rport
;
rport
=
&
serial
->
port
[
1
];
rport
=
serial
->
port
[
1
];
rport
->
tty
=
port
->
tty
;
rport
->
tty
=
port
->
tty
;
usb_set_serial_port_data
(
rport
,
usb_get_serial_port_data
(
port
));
usb_set_serial_port_data
(
rport
,
usb_get_serial_port_data
(
port
));
port
->
read_urb
=
rport
->
interrupt_in_urb
;
port
->
read_urb
=
rport
->
interrupt_in_urb
;
...
...
drivers/usb/serial/omninet.c
View file @
9fdd2c89
...
@@ -170,7 +170,7 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
...
@@ -170,7 +170,7 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
}
}
usb_set_serial_port_data
(
port
,
od
);
usb_set_serial_port_data
(
port
,
od
);
wport
=
&
serial
->
port
[
1
];
wport
=
serial
->
port
[
1
];
wport
->
tty
=
port
->
tty
;
wport
->
tty
=
port
->
tty
;
/* Start reading from the device */
/* Start reading from the device */
...
@@ -201,7 +201,7 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp)
...
@@ -201,7 +201,7 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp)
return
;
return
;
if
(
serial
->
dev
)
{
if
(
serial
->
dev
)
{
wport
=
&
serial
->
port
[
1
];
wport
=
serial
->
port
[
1
];
usb_unlink_urb
(
wport
->
write_urb
);
usb_unlink_urb
(
wport
->
write_urb
);
usb_unlink_urb
(
port
->
read_urb
);
usb_unlink_urb
(
port
->
read_urb
);
}
}
...
@@ -271,7 +271,7 @@ static void omninet_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
...
@@ -271,7 +271,7 @@ static void omninet_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
static
int
omninet_write
(
struct
usb_serial_port
*
port
,
int
from_user
,
const
unsigned
char
*
buf
,
int
count
)
static
int
omninet_write
(
struct
usb_serial_port
*
port
,
int
from_user
,
const
unsigned
char
*
buf
,
int
count
)
{
{
struct
usb_serial
*
serial
=
port
->
serial
;
struct
usb_serial
*
serial
=
port
->
serial
;
struct
usb_serial_port
*
wport
=
&
serial
->
port
[
1
];
struct
usb_serial_port
*
wport
=
serial
->
port
[
1
];
struct
omninet_data
*
od
=
usb_get_serial_port_data
(
port
);
struct
omninet_data
*
od
=
usb_get_serial_port_data
(
port
);
struct
omninet_header
*
header
=
(
struct
omninet_header
*
)
wport
->
write_urb
->
transfer_buffer
;
struct
omninet_header
*
header
=
(
struct
omninet_header
*
)
wport
->
write_urb
->
transfer_buffer
;
...
@@ -326,7 +326,7 @@ static int omninet_write (struct usb_serial_port *port, int from_user, const uns
...
@@ -326,7 +326,7 @@ static int omninet_write (struct usb_serial_port *port, int from_user, const uns
static
int
omninet_write_room
(
struct
usb_serial_port
*
port
)
static
int
omninet_write_room
(
struct
usb_serial_port
*
port
)
{
{
struct
usb_serial
*
serial
=
port
->
serial
;
struct
usb_serial
*
serial
=
port
->
serial
;
struct
usb_serial_port
*
wport
=
&
serial
->
port
[
1
];
struct
usb_serial_port
*
wport
=
serial
->
port
[
1
];
int
room
=
0
;
// Default: no room
int
room
=
0
;
// Default: no room
...
...
drivers/usb/serial/pl2303.c
View file @
9fdd2c89
...
@@ -186,7 +186,7 @@ static int pl2303_startup (struct usb_serial *serial)
...
@@ -186,7 +186,7 @@ static int pl2303_startup (struct usb_serial *serial)
return
-
ENOMEM
;
return
-
ENOMEM
;
memset
(
priv
,
0x00
,
sizeof
(
struct
pl2303_private
));
memset
(
priv
,
0x00
,
sizeof
(
struct
pl2303_private
));
spin_lock_init
(
&
priv
->
lock
);
spin_lock_init
(
&
priv
->
lock
);
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
priv
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
priv
);
}
}
return
0
;
return
0
;
}
}
...
@@ -592,8 +592,8 @@ static void pl2303_shutdown (struct usb_serial *serial)
...
@@ -592,8 +592,8 @@ static void pl2303_shutdown (struct usb_serial *serial)
dbg
(
"%s"
,
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
kfree
(
usb_get_serial_port_data
(
&
serial
->
port
[
i
]));
kfree
(
usb_get_serial_port_data
(
serial
->
port
[
i
]));
usb_set_serial_port_data
(
&
serial
->
port
[
i
],
NULL
);
usb_set_serial_port_data
(
serial
->
port
[
i
],
NULL
);
}
}
}
}
...
...
drivers/usb/serial/visor.c
View file @
9fdd2c89
...
@@ -850,25 +850,25 @@ static int treo_attach (struct usb_serial *serial)
...
@@ -850,25 +850,25 @@ static int treo_attach (struct usb_serial *serial)
* "virtual serial port". So let's force the endpoints to be
* "virtual serial port". So let's force the endpoints to be
* where we want them to be. */
* where we want them to be. */
for
(
i
=
serial
->
num_bulk_in
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
serial
->
num_bulk_in
;
i
<
serial
->
num_ports
;
++
i
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
port
->
read_urb
=
serial
->
port
[
0
]
.
read_urb
;
port
->
read_urb
=
serial
->
port
[
0
]
->
read_urb
;
port
->
bulk_in_endpointAddress
=
serial
->
port
[
0
]
.
bulk_in_endpointAddress
;
port
->
bulk_in_endpointAddress
=
serial
->
port
[
0
]
->
bulk_in_endpointAddress
;
port
->
bulk_in_buffer
=
serial
->
port
[
0
]
.
bulk_in_buffer
;
port
->
bulk_in_buffer
=
serial
->
port
[
0
]
->
bulk_in_buffer
;
}
}
for
(
i
=
serial
->
num_bulk_out
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
serial
->
num_bulk_out
;
i
<
serial
->
num_ports
;
++
i
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
port
->
write_urb
=
serial
->
port
[
0
]
.
write_urb
;
port
->
write_urb
=
serial
->
port
[
0
]
->
write_urb
;
port
->
bulk_out_size
=
serial
->
port
[
0
]
.
bulk_out_size
;
port
->
bulk_out_size
=
serial
->
port
[
0
]
->
bulk_out_size
;
port
->
bulk_out_endpointAddress
=
serial
->
port
[
0
]
.
bulk_out_endpointAddress
;
port
->
bulk_out_endpointAddress
=
serial
->
port
[
0
]
->
bulk_out_endpointAddress
;
port
->
bulk_out_buffer
=
serial
->
port
[
0
]
.
bulk_out_buffer
;
port
->
bulk_out_buffer
=
serial
->
port
[
0
]
->
bulk_out_buffer
;
}
}
for
(
i
=
serial
->
num_interrupt_in
;
i
<
serial
->
num_ports
;
++
i
)
{
for
(
i
=
serial
->
num_interrupt_in
;
i
<
serial
->
num_ports
;
++
i
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
port
->
interrupt_in_urb
=
serial
->
port
[
0
]
.
interrupt_in_urb
;
port
->
interrupt_in_urb
=
serial
->
port
[
0
]
->
interrupt_in_urb
;
port
->
interrupt_in_endpointAddress
=
serial
->
port
[
0
]
.
interrupt_in_endpointAddress
;
port
->
interrupt_in_endpointAddress
=
serial
->
port
[
0
]
->
interrupt_in_endpointAddress
;
port
->
interrupt_in_buffer
=
serial
->
port
[
0
]
.
interrupt_in_buffer
;
port
->
interrupt_in_buffer
=
serial
->
port
[
0
]
->
interrupt_in_buffer
;
}
}
return
0
;
return
0
;
...
...
drivers/usb/serial/whiteheat.c
View file @
9fdd2c89
...
@@ -361,7 +361,7 @@ static int whiteheat_attach (struct usb_serial *serial)
...
@@ -361,7 +361,7 @@ static int whiteheat_attach (struct usb_serial *serial)
struct
whiteheat_urb_wrap
*
wrap
;
struct
whiteheat_urb_wrap
*
wrap
;
struct
list_head
*
tmp
;
struct
list_head
*
tmp
;
command_port
=
&
serial
->
port
[
COMMAND_PORT
];
command_port
=
serial
->
port
[
COMMAND_PORT
];
pipe
=
usb_sndbulkpipe
(
serial
->
dev
,
command_port
->
bulk_out_endpointAddress
);
pipe
=
usb_sndbulkpipe
(
serial
->
dev
,
command_port
->
bulk_out_endpointAddress
);
/*
/*
...
@@ -400,7 +400,7 @@ static int whiteheat_attach (struct usb_serial *serial)
...
@@ -400,7 +400,7 @@ static int whiteheat_attach (struct usb_serial *serial)
DRIVER_VERSION
,
hw_info
->
sw_major_rev
,
hw_info
->
sw_minor_rev
);
DRIVER_VERSION
,
hw_info
->
sw_major_rev
,
hw_info
->
sw_minor_rev
);
for
(
i
=
0
;
i
<
serial
->
num_ports
;
i
++
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
i
++
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
info
=
(
struct
whiteheat_private
*
)
kmalloc
(
sizeof
(
struct
whiteheat_private
),
GFP_KERNEL
);
info
=
(
struct
whiteheat_private
*
)
kmalloc
(
sizeof
(
struct
whiteheat_private
),
GFP_KERNEL
);
if
(
info
==
NULL
)
{
if
(
info
==
NULL
)
{
...
@@ -496,7 +496,7 @@ static int whiteheat_attach (struct usb_serial *serial)
...
@@ -496,7 +496,7 @@ static int whiteheat_attach (struct usb_serial *serial)
no_command_private:
no_command_private:
for
(
i
=
serial
->
num_ports
-
1
;
i
>=
0
;
i
--
)
{
for
(
i
=
serial
->
num_ports
-
1
;
i
>=
0
;
i
--
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
info
=
usb_get_serial_port_data
(
port
);
info
=
usb_get_serial_port_data
(
port
);
for
(
j
=
urb_pool_size
-
1
;
j
>=
0
;
j
--
)
{
for
(
j
=
urb_pool_size
-
1
;
j
>=
0
;
j
--
)
{
tmp
=
list_first
(
&
info
->
tx_urbs_free
);
tmp
=
list_first
(
&
info
->
tx_urbs_free
);
...
@@ -543,11 +543,11 @@ static void whiteheat_shutdown (struct usb_serial *serial)
...
@@ -543,11 +543,11 @@ static void whiteheat_shutdown (struct usb_serial *serial)
dbg
(
"%s"
,
__FUNCTION__
);
dbg
(
"%s"
,
__FUNCTION__
);
/* free up our private data for our command port */
/* free up our private data for our command port */
command_port
=
&
serial
->
port
[
COMMAND_PORT
];
command_port
=
serial
->
port
[
COMMAND_PORT
];
kfree
(
usb_get_serial_port_data
(
command_port
));
kfree
(
usb_get_serial_port_data
(
command_port
));
for
(
i
=
0
;
i
<
serial
->
num_ports
;
i
++
)
{
for
(
i
=
0
;
i
<
serial
->
num_ports
;
i
++
)
{
port
=
&
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
info
=
usb_get_serial_port_data
(
port
);
info
=
usb_get_serial_port_data
(
port
);
list_for_each_safe
(
tmp
,
tmp2
,
&
info
->
rx_urbs_free
)
{
list_for_each_safe
(
tmp
,
tmp2
,
&
info
->
rx_urbs_free
)
{
list_del
(
tmp
);
list_del
(
tmp
);
...
@@ -1119,7 +1119,7 @@ static int firm_send_command (struct usb_serial_port *port, __u8 command, __u8 *
...
@@ -1119,7 +1119,7 @@ static int firm_send_command (struct usb_serial_port *port, __u8 command, __u8 *
dbg
(
"%s - command %d"
,
__FUNCTION__
,
command
);
dbg
(
"%s - command %d"
,
__FUNCTION__
,
command
);
command_port
=
&
port
->
serial
->
port
[
COMMAND_PORT
];
command_port
=
port
->
serial
->
port
[
COMMAND_PORT
];
command_info
=
usb_get_serial_port_data
(
command_port
);
command_info
=
usb_get_serial_port_data
(
command_port
);
spin_lock_irqsave
(
&
command_info
->
lock
,
flags
);
spin_lock_irqsave
(
&
command_info
->
lock
,
flags
);
command_info
->
command_finished
=
FALSE
;
command_info
->
command_finished
=
FALSE
;
...
@@ -1323,7 +1323,7 @@ static int start_command_port(struct usb_serial *serial)
...
@@ -1323,7 +1323,7 @@ static int start_command_port(struct usb_serial *serial)
unsigned
long
flags
;
unsigned
long
flags
;
int
retval
=
0
;
int
retval
=
0
;
command_port
=
&
serial
->
port
[
COMMAND_PORT
];
command_port
=
serial
->
port
[
COMMAND_PORT
];
command_info
=
usb_get_serial_port_data
(
command_port
);
command_info
=
usb_get_serial_port_data
(
command_port
);
spin_lock_irqsave
(
&
command_info
->
lock
,
flags
);
spin_lock_irqsave
(
&
command_info
->
lock
,
flags
);
if
(
!
command_info
->
port_running
)
{
if
(
!
command_info
->
port_running
)
{
...
@@ -1351,7 +1351,7 @@ static void stop_command_port(struct usb_serial *serial)
...
@@ -1351,7 +1351,7 @@ static void stop_command_port(struct usb_serial *serial)
struct
whiteheat_command_private
*
command_info
;
struct
whiteheat_command_private
*
command_info
;
unsigned
long
flags
;
unsigned
long
flags
;
command_port
=
&
serial
->
port
[
COMMAND_PORT
];
command_port
=
serial
->
port
[
COMMAND_PORT
];
command_info
=
usb_get_serial_port_data
(
command_port
);
command_info
=
usb_get_serial_port_data
(
command_port
);
spin_lock_irqsave
(
&
command_info
->
lock
,
flags
);
spin_lock_irqsave
(
&
command_info
->
lock
,
flags
);
command_info
->
port_running
--
;
command_info
->
port_running
--
;
...
...
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