Krishna, Vamsi | 83814ea | 2009-02-11 21:07:20 +0530 | [diff] [blame] | 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> |
Mike Lockwood | 0d511c4 | 2010-03-10 17:05:03 -0500 | [diff] [blame] | 21 | #include <linux/if_ether.h> |
Krishna, Vamsi | 83814ea | 2009-02-11 21:07:20 +0530 | [diff] [blame] | 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 { |
Mike Lockwood | aecca43 | 2011-02-09 09:38:26 -0500 | [diff] [blame] | 30 | /* Vendor ID for this set of functions. |
| 31 | * Default vendor_id in platform data will be used if this is zero. |
| 32 | */ |
| 33 | __u16 vendor_id; |
| 34 | |
| 35 | /* Product ID for this set of functions. */ |
Krishna, Vamsi | 83814ea | 2009-02-11 21:07:20 +0530 | [diff] [blame] | 36 | __u16 product_id; |
| 37 | |
| 38 | /* List of function names associated with this product. |
| 39 | * This is used to compute the USB product ID dynamically |
| 40 | * based on which functions are enabled. |
| 41 | */ |
| 42 | int num_functions; |
| 43 | char **functions; |
| 44 | }; |
| 45 | |
| 46 | struct android_usb_platform_data { |
| 47 | /* USB device descriptor fields */ |
| 48 | __u16 vendor_id; |
| 49 | |
| 50 | /* Default product ID. */ |
| 51 | __u16 product_id; |
| 52 | |
| 53 | __u16 version; |
| 54 | |
| 55 | char *product_name; |
| 56 | char *manufacturer_name; |
| 57 | char *serial_number; |
| 58 | |
| 59 | /* List of available USB products. |
| 60 | * This is used to compute the USB product ID dynamically |
| 61 | * based on which functions are enabled. |
| 62 | * if num_products is zero or no match can be found, |
| 63 | * we use the default product ID |
| 64 | */ |
| 65 | int num_products; |
| 66 | struct android_usb_product *products; |
| 67 | |
| 68 | /* List of all supported USB functions. |
| 69 | * This list is used to define the order in which |
| 70 | * the functions appear in the configuration's list of USB interfaces. |
| 71 | * This is necessary to avoid depending upon the order in which |
| 72 | * the individual function drivers are initialized. |
| 73 | */ |
| 74 | int num_functions; |
| 75 | char **functions; |
| 76 | }; |
| 77 | |
| 78 | /* Platform data for "usb_mass_storage" driver. */ |
| 79 | struct usb_mass_storage_platform_data { |
| 80 | /* Contains values for the SC_INQUIRY SCSI command. */ |
| 81 | char *vendor; |
| 82 | char *product; |
| 83 | int release; |
| 84 | |
| 85 | /* number of LUNS */ |
| 86 | int nluns; |
| 87 | }; |
| 88 | |
Mike Lockwood | 0d511c4 | 2010-03-10 17:05:03 -0500 | [diff] [blame] | 89 | /* Platform data for USB ethernet driver. */ |
| 90 | struct usb_ether_platform_data { |
| 91 | u8 ethaddr[ETH_ALEN]; |
| 92 | u32 vendorID; |
| 93 | const char *vendorDescr; |
| 94 | }; |
| 95 | |
John Michelau | 677ba87 | 2010-11-08 18:05:37 -0600 | [diff] [blame] | 96 | /* Platform data for ACM driver. */ |
| 97 | struct acm_platform_data { |
| 98 | u8 num_inst; |
| 99 | }; |
| 100 | |
Krishna, Vamsi | 83814ea | 2009-02-11 21:07:20 +0530 | [diff] [blame] | 101 | extern void android_register_function(struct android_usb_function *f); |
| 102 | |
| 103 | extern void android_enable_function(struct usb_function *f, int enable); |
| 104 | |
| 105 | |
| 106 | #endif /* __LINUX_USB_ANDROID_H */ |