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
148b63e6
Commit
148b63e6
authored
Mar 14, 2011
by
Mike Lockwood
Committed by
Dima Zavin
Mar 29, 2011
Browse files
Options
Downloads
Patches
Plain Diff
USB: gadget: f_accessory: Add string for accessory's unique serial number
Signed-off-by:
Mike Lockwood
<
lockwood@android.com
>
parent
64bef932
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/usb/gadget/f_accessory.c
+8
-0
8 additions, 0 deletions
drivers/usb/gadget/f_accessory.c
include/linux/usb/f_accessory.h
+2
-0
2 additions, 0 deletions
include/linux/usb/f_accessory.h
with
10 additions
and
0 deletions
drivers/usb/gadget/f_accessory.c
+
8
−
0
View file @
148b63e6
...
...
@@ -71,6 +71,7 @@ struct acc_dev {
char
description
[
ACC_STRING_SIZE
];
char
version
[
ACC_STRING_SIZE
];
char
uri
[
ACC_STRING_SIZE
];
char
serial
[
ACC_STRING_SIZE
];
/* for acc_complete_set_string */
int
string_index
;
...
...
@@ -273,6 +274,9 @@ static void acc_complete_set_string(struct usb_ep *ep, struct usb_request *req)
case
ACCESSORY_STRING_URI
:
string_dest
=
dev
->
uri
;
break
;
case
ACCESSORY_STRING_SERIAL
:
string_dest
=
dev
->
serial
;
break
;
}
if
(
string_dest
)
{
unsigned
long
flags
;
...
...
@@ -505,6 +509,9 @@ static long acc_ioctl(struct file *fp, unsigned code, unsigned long value)
case
ACCESSORY_GET_STRING_URI
:
src
=
dev
->
uri
;
break
;
case
ACCESSORY_GET_STRING_SERIAL
:
src
=
dev
->
serial
;
break
;
}
if
(
!
src
)
return
-
EINVAL
;
...
...
@@ -658,6 +665,7 @@ static int acc_function_setup(struct usb_function *f,
memset
(
dev
->
description
,
0
,
sizeof
(
dev
->
description
));
memset
(
dev
->
version
,
0
,
sizeof
(
dev
->
version
));
memset
(
dev
->
uri
,
0
,
sizeof
(
dev
->
uri
));
memset
(
dev
->
serial
,
0
,
sizeof
(
dev
->
serial
));
}
}
}
...
...
This diff is collapsed.
Click to expand it.
include/linux/usb/f_accessory.h
+
2
−
0
View file @
148b63e6
...
...
@@ -34,6 +34,7 @@
#define ACCESSORY_STRING_DESCRIPTION 2
#define ACCESSORY_STRING_VERSION 3
#define ACCESSORY_STRING_URI 4
#define ACCESSORY_STRING_SERIAL 5
/* Control request for retrieving device's protocol version (currently 1)
*
...
...
@@ -75,5 +76,6 @@
#define ACCESSORY_GET_STRING_DESCRIPTION _IOW('M', 3, char[256])
#define ACCESSORY_GET_STRING_VERSION _IOW('M', 4, char[256])
#define ACCESSORY_GET_STRING_URI _IOW('M', 5, char[256])
#define ACCESSORY_GET_STRING_SERIAL _IOW('M', 6, char[256])
#endif
/* __LINUX_USB_F_ACCESSORY_H */
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