rk: gcc-wrapper.py ignore memcontrol.c:5355
[firefly-linux-kernel-4.4.55.git] / include / linux / usb / android_composite.h
1 /*
2  * Platform data for Android USB
3  *
4  * Copyright (C) 2008 Google, Inc.
5  * Author: Mike Lockwood <lockwood@android.com>
6  *
7  * This software is licensed under the terms of the GNU General Public
8  * License version 2, as published by the Free Software Foundation, and
9  * may be copied, distributed, and modified under those terms.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  */
17 #ifndef __LINUX_USB_ANDROID_H
18 #define __LINUX_USB_ANDROID_H
19
20 #include <linux/usb/composite.h>
21 #include <linux/if_ether.h>
22
23 struct android_usb_function {
24         struct list_head        list;
25         char                    *name;
26         int                     (*bind_config)(struct usb_configuration *c);
27 };
28
29 struct android_usb_product {
30         /* Default product ID. */
31         __u16 product_id;
32
33         /* List of function names associated with this product.
34          * This is used to compute the USB product ID dynamically
35          * based on which functions are enabled.
36          */
37         int num_functions;
38         char **functions;
39 };
40
41 struct android_usb_platform_data {
42         /* USB device descriptor fields */
43         __u16 vendor_id;
44
45         /* Default product ID. */
46         __u16 product_id;
47
48         __u16 version;
49
50         char *product_name;
51         char *manufacturer_name;
52         char *serial_number;
53
54         /* List of available USB products.
55          * This is used to compute the USB product ID dynamically
56          * based on which functions are enabled.
57          * if num_products is zero or no match can be found,
58          * we use the default product ID
59          */
60         int num_products;
61         struct android_usb_product *products;
62
63         /* List of all supported USB functions.
64          * This list is used to define the order in which
65          * the functions appear in the configuration's list of USB interfaces.
66          * This is necessary to avoid depending upon the order in which
67          * the individual function drivers are initialized.
68          */
69         int num_functions;
70         char **functions;
71 };
72
73 /* Platform data for "usb_mass_storage" driver. */
74 struct usb_mass_storage_platform_data {
75         /* Contains values for the SC_INQUIRY SCSI command. */
76         char *vendor;
77         char *product;
78         int release;
79
80         /* number of LUNS */
81         int nluns;
82 };
83
84 /* Platform data for USB ethernet driver. */
85 struct usb_ether_platform_data {
86         u8      ethaddr[ETH_ALEN];
87         u32     vendorID;
88         const char *vendorDescr;
89 };
90
91 extern void android_usb_set_connected(int on);
92
93 extern void android_register_function(struct android_usb_function *f);
94
95 extern void android_enable_function(struct usb_function *f, int enable);
96
97
98 #endif  /* __LINUX_USB_ANDROID_H */