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
998835d5
Commit
998835d5
authored
Apr 21, 2004
by
Colin Leroy
Committed by
Greg Kroah-Hartman
Apr 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: fix cdc-acm as it is still (differently) broken
parent
c3998736
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
35 deletions
+46
-35
drivers/usb/class/cdc-acm.c
drivers/usb/class/cdc-acm.c
+46
-35
No files found.
drivers/usb/class/cdc-acm.c
View file @
998835d5
...
...
@@ -581,45 +581,51 @@ static int acm_probe (struct usb_interface *intf,
dev
=
interface_to_usbdev
(
intf
);
cfacm
=
dev
->
actconfig
;
for
(
j
=
0
;
j
<
cfacm
->
desc
.
bNumInterfaces
-
1
;
j
++
)
{
if
(
usb_interface_claimed
(
cfacm
->
interface
[
j
])
||
usb_interface_claimed
(
cfacm
->
interface
[
j
+
1
]))
continue
;
cfacm
=
dev
->
actconfig
;
/* We know we're probe()d with the control interface. */
ifcom
=
intf
->
cur_altsetting
;
/* We know we're probe()d with the control interface.
* FIXME ACM doesn't guarantee the data interface is
/* ACM doesn't guarantee the data interface is
* adjacent to the control interface, or that if one
* is there it's not for call management ... so
use
*
the cdc union descriptor whenever there is one.
* is there it's not for call management ... so
find
*
it
*/
ifcom
=
intf
->
cur_altsetting
;
if
(
intf
==
cfacm
->
interface
[
j
])
{
ifdata
=
cfacm
->
interface
[
j
+
1
]
->
cur_altsetting
;
data
=
cfacm
->
interface
[
j
+
1
];
}
else
if
(
intf
==
cfacm
->
interface
[
j
+
1
])
{
for
(
j
=
0
;
j
<
cfacm
->
desc
.
bNumInterfaces
;
j
++
)
{
ifdata
=
cfacm
->
interface
[
j
]
->
cur_altsetting
;
data
=
cfacm
->
interface
[
j
];
}
else
continue
;
if
(
ifdata
->
desc
.
bInterfaceClass
!=
10
||
ifdata
->
desc
.
bNumEndpoints
<
2
)
continue
;
epctrl
=
&
ifcom
->
endpoint
[
0
].
desc
;
epread
=
&
ifdata
->
endpoint
[
0
].
desc
;
epwrite
=
&
ifdata
->
endpoint
[
1
].
desc
;
if
(
ifdata
->
desc
.
bInterfaceClass
==
10
&&
ifdata
->
desc
.
bNumEndpoints
==
2
)
{
epctrl
=
&
ifcom
->
endpoint
[
0
].
desc
;
epread
=
&
ifdata
->
endpoint
[
0
].
desc
;
epwrite
=
&
ifdata
->
endpoint
[
1
].
desc
;
if
((
epctrl
->
bEndpointAddress
&
0x80
)
!=
0x80
||
(
epctrl
->
bmAttributes
&
3
)
!=
3
||
(
epread
->
bmAttributes
&
3
)
!=
2
||
(
epwrite
->
bmAttributes
&
3
)
!=
2
||
((
epread
->
bEndpointAddress
&
0x80
)
^
(
epwrite
->
bEndpointAddress
&
0x80
))
!=
0x80
)
goto
next_interface
;
if
((
epread
->
bEndpointAddress
&
0x80
)
!=
0x80
)
{
epread
=
&
ifdata
->
endpoint
[
1
].
desc
;
epwrite
=
&
ifdata
->
endpoint
[
0
].
desc
;
}
dbg
(
"found data interface at %d
\n
"
,
j
);
break
;
}
else
{
next_interface:
ifdata
=
NULL
;
data
=
NULL
;
}
}
if
((
epctrl
->
bEndpointAddress
&
0x80
)
!=
0x80
||
(
epctrl
->
bmAttributes
&
3
)
!=
3
||
(
epread
->
bmAttributes
&
3
)
!=
2
||
(
epwrite
->
bmAttributes
&
3
)
!=
2
||
((
epread
->
bEndpointAddress
&
0x80
)
^
(
epwrite
->
bEndpointAddress
&
0x80
))
!=
0x80
)
continue
;
/* there's been a problem */
if
(
!
ifdata
)
{
dbg
(
"interface not found (%p)
\n
"
,
ifdata
);
return
-
ENODEV
;
if
((
epread
->
bEndpointAddress
&
0x80
)
!=
0x80
)
{
epread
=
&
ifdata
->
endpoint
[
1
].
desc
;
epwrite
=
&
ifdata
->
endpoint
[
0
].
desc
;
}
for
(
minor
=
0
;
minor
<
ACM_TTY_MINORS
&&
acm_table
[
minor
];
minor
++
);
...
...
@@ -696,16 +702,21 @@ static int acm_probe (struct usb_interface *intf,
acm
->
line
.
databits
=
8
;
acm_set_line
(
acm
,
&
acm
->
line
);
usb_driver_claim_interface
(
&
acm_driver
,
data
,
acm
);
if
(
(
j
=
usb_driver_claim_interface
(
&
acm_driver
,
data
,
acm
))
!=
0
)
{
err
(
"claim failed"
);
usb_free_urb
(
acm
->
ctrlurb
);
usb_free_urb
(
acm
->
readurb
);
usb_free_urb
(
acm
->
writeurb
);
kfree
(
acm
);
kfree
(
buf
);
return
j
;
}
tty_register_device
(
acm_tty_driver
,
minor
,
&
intf
->
dev
);
acm_table
[
minor
]
=
acm
;
usb_set_intfdata
(
intf
,
acm
);
return
0
;
}
return
-
EIO
;
}
static
void
acm_disconnect
(
struct
usb_interface
*
intf
)
...
...
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