Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidKernelMSM
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidKernelMSM
Commits
9cf8b580
Commit
9cf8b580
authored
14 years ago
by
Mike Lockwood
Committed by
Dima Zavin
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
USB: gadget: f_accessory: Clear accessory strings when USB is disconnected
Signed-off-by:
Mike Lockwood
<
lockwood@android.com
>
parent
4aaac2e5
Loading
Loading
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/usb/gadget/f_accessory.c
+18
-9
18 additions, 9 deletions
drivers/usb/gadget/f_accessory.c
with
18 additions
and
9 deletions
drivers/usb/gadget/f_accessory.c
+
18
−
9
View file @
9cf8b580
...
...
@@ -216,15 +216,26 @@ static struct usb_request *req_get(struct acc_dev *dev, struct list_head *head)
return
req
;
}
static
void
acc_
complete_in
(
struct
usb_ep
*
ep
,
struct
usb_request
*
req
)
static
void
acc_
set_disconnected
(
struct
acc_dev
*
dev
)
{
struct
acc_dev
*
dev
=
_acc_dev
;
if
(
req
->
status
!=
0
)
{
dev
->
online
=
0
;
dev
->
disconnected
=
1
;
/* clear all accessory strings */
memset
(
dev
->
manufacturer
,
0
,
sizeof
(
dev
->
manufacturer
));
memset
(
dev
->
model
,
0
,
sizeof
(
dev
->
model
));
memset
(
dev
->
description
,
0
,
sizeof
(
dev
->
description
));
memset
(
dev
->
version
,
0
,
sizeof
(
dev
->
version
));
memset
(
dev
->
uri
,
0
,
sizeof
(
dev
->
uri
));
}
static
void
acc_complete_in
(
struct
usb_ep
*
ep
,
struct
usb_request
*
req
)
{
struct
acc_dev
*
dev
=
_acc_dev
;
if
(
req
->
status
!=
0
)
acc_set_disconnected
(
dev
);
req_put
(
dev
,
&
dev
->
tx_idle
,
req
);
wake_up
(
&
dev
->
write_wq
);
...
...
@@ -235,10 +246,8 @@ static void acc_complete_out(struct usb_ep *ep, struct usb_request *req)
struct
acc_dev
*
dev
=
_acc_dev
;
dev
->
rx_done
=
1
;
if
(
req
->
status
!=
0
)
{
dev
->
online
=
0
;
dev
->
disconnected
=
1
;
}
if
(
req
->
status
!=
0
)
acc_set_disconnected
(
dev
);
wake_up
(
&
dev
->
read_wq
);
}
...
...
@@ -706,7 +715,7 @@ static void acc_function_disable(struct usb_function *f)
struct
usb_composite_dev
*
cdev
=
dev
->
cdev
;
DBG
(
cdev
,
"acc_function_disable
\n
"
);
dev
->
online
=
0
;
acc_set_disconnected
(
dev
)
;
usb_ep_disable
(
dev
->
ep_in
);
usb_ep_disable
(
dev
->
ep_out
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment