aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/inode.c776
-rw-r--r--drivers/usb/gadget/android.c1181
-rw-r--r--drivers/usb/gadget/ci13xxx_msm.c135
-rw-r--r--drivers/usb/gadget/ci13xxx_pci.c176
-rw-r--r--drivers/usb/gadget/ci13xxx_udc.c2977
-rw-r--r--drivers/usb/gadget/ci13xxx_udc.h227
-rw-r--r--drivers/usb/gadget/f_accessory.c788
-rw-r--r--drivers/usb/gadget/f_adb.c635
-rw-r--r--drivers/usb/gadget/f_audio.c798
-rw-r--r--drivers/usb/gadget/f_mtp.c1264
-rw-r--r--drivers/usb/gadget/file_storage.c3631
-rw-r--r--drivers/usb/gadget/fsl_tegra_udc.c155
-rw-r--r--drivers/usb/gadget/langwell_udc.c3607
-rw-r--r--drivers/usb/gadget/langwell_udc.h233
-rw-r--r--drivers/usb/gadget/mv_udc_phy.c214
-rw-r--r--drivers/usb/gadget/u_audio.c327
-rw-r--r--drivers/usb/gadget/u_audio.h56
-rw-r--r--drivers/usb/host/ehci-ath79.c204
-rw-r--r--drivers/usb/host/ehci-au1xxx.c323
-rw-r--r--drivers/usb/host/ehci-cns3xxx.c171
-rw-r--r--drivers/usb/host/ehci-ixp4xx.c156
-rw-r--r--drivers/usb/host/ehci-lpm.c84
-rw-r--r--drivers/usb/host/ohci-ath79.c151
-rw-r--r--drivers/usb/host/ohci-au1xxx.c319
-rw-r--r--drivers/usb/host/ohci-cns3xxx.c165
-rw-r--r--drivers/usb/host/ohci-pnx4008.c453
-rw-r--r--drivers/usb/host/ohci-pnx8550.c242
-rw-r--r--drivers/usb/host/ohci-ppc-soc.c215
-rw-r--r--drivers/usb/host/ohci-sh.c142
-rw-r--r--drivers/usb/host/ohci-ssb.c260
-rw-r--r--drivers/usb/otg/langwell_otg.c2347
-rw-r--r--drivers/usb/otg/otg-wakelock.c169
-rw-r--r--drivers/usb/otg/otg_id.c205
-rw-r--r--drivers/usb/otg/tegra-otg.c540
-rw-r--r--drivers/usb/serial/ChangeLog.history730
-rw-r--r--drivers/usb/serial/baseband_usb_chr.c1124
-rw-r--r--drivers/usb/serial/baseband_usb_chr.h106
-rw-r--r--drivers/usb/serial/ezusb.c61
-rw-r--r--drivers/usb/storage/libusual.c243
39 files changed, 25590 insertions, 0 deletions
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
new file mode 100644
index 00000000000..2278dad886e
--- /dev/null
+++ b/drivers/usb/core/inode.c
@@ -0,0 +1,776 @@
1/*****************************************************************************/
2
3/*
4 * inode.c -- Inode/Dentry functions for the USB device file system.
5 *
6 * Copyright (C) 2000 Thomas Sailer (sailer@ife.ee.ethz.ch)
7 * Copyright (C) 2001,2002,2004 Greg Kroah-Hartman (greg@kroah.com)
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 * History:
24 * 0.1 04.01.2000 Created
25 * 0.2 10.12.2001 converted to use the vfs layer better
26 */
27
28/*****************************************************************************/
29
30#include <linux/module.h>
31#include <linux/fs.h>
32#include <linux/mount.h>
33#include <linux/pagemap.h>
34#include <linux/init.h>
35#include <linux/proc_fs.h>
36#include <linux/usb.h>
37#include <linux/namei.h>
38#include <linux/usbdevice_fs.h>
39#include <linux/parser.h>
40#include <linux/notifier.h>
41#include <linux/seq_file.h>
42#include <linux/usb/hcd.h>
43#include <asm/byteorder.h>
44#include "usb.h"
45
46#define USBFS_DEFAULT_DEVMODE (S_IWUSR | S_IRUGO)
47#define USBFS_DEFAULT_BUSMODE (S_IXUGO | S_IRUGO)
48#define USBFS_DEFAULT_LISTMODE S_IRUGO
49
50static const struct file_operations default_file_operations;
51static struct vfsmount *usbfs_mount;
52static int usbfs_mount_count; /* = 0 */
53static int ignore_mount = 0;
54
55static struct dentry *devices_usbfs_dentry;
56static int num_buses; /* = 0 */
57
58static uid_t devuid; /* = 0 */
59static uid_t busuid; /* = 0 */
60static uid_t listuid; /* = 0 */
61static gid_t devgid; /* = 0 */
62static gid_t busgid; /* = 0 */
63static gid_t listgid; /* = 0 */
64static umode_t devmode = USBFS_DEFAULT_DEVMODE;
65static umode_t busmode = USBFS_DEFAULT_BUSMODE;
66static umode_t listmode = USBFS_DEFAULT_LISTMODE;
67
68static int usbfs_show_options(struct seq_file *seq, struct vfsmount *mnt)
69{
70 if (devuid != 0)
71 seq_printf(seq, ",devuid=%u", devuid);
72 if (devgid != 0)
73 seq_printf(seq, ",devgid=%u", devgid);
74 if (devmode != USBFS_DEFAULT_DEVMODE)
75 seq_printf(seq, ",devmode=%o", devmode);
76 if (busuid != 0)
77 seq_printf(seq, ",busuid=%u", busuid);
78 if (busgid != 0)
79 seq_printf(seq, ",busgid=%u", busgid);
80 if (busmode != USBFS_DEFAULT_BUSMODE)
81 seq_printf(seq, ",busmode=%o", busmode);
82 if (listuid != 0)
83 seq_printf(seq, ",listuid=%u", listuid);
84 if (listgid != 0)
85 seq_printf(seq, ",listgid=%u", listgid);
86 if (listmode != USBFS_DEFAULT_LISTMODE)
87 seq_printf(seq, ",listmode=%o", listmode);
88
89 return 0;
90}
91
92enum {
93 Opt_devuid, Opt_devgid, Opt_devmode,
94 Opt_busuid, Opt_busgid, Opt_busmode,
95 Opt_listuid, Opt_listgid, Opt_listmode,
96 Opt_err,
97};
98
99static const match_table_t tokens = {
100 {Opt_devuid, "devuid=%u"},
101 {Opt_devgid, "devgid=%u"},
102 {Opt_devmode, "devmode=%o"},
103 {Opt_busuid, "busuid=%u"},
104 {Opt_busgid, "busgid=%u"},
105 {Opt_busmode, "busmode=%o"},
106 {Opt_listuid, "listuid=%u"},
107 {Opt_listgid, "listgid=%u"},
108 {Opt_listmode, "listmode=%o"},
109 {Opt_err, NULL}
110};
111
112static int parse_options(struct super_block *s, char *data)
113{
114 char *p;
115 int option;
116
117 /* (re)set to defaults. */
118 devuid = 0;
119 busuid = 0;
120 listuid = 0;
121 devgid = 0;
122 busgid = 0;
123 listgid = 0;
124 devmode = USBFS_DEFAULT_DEVMODE;
125 busmode = USBFS_DEFAULT_BUSMODE;
126 listmode = USBFS_DEFAULT_LISTMODE;
127
128 while ((p = strsep(&data, ",")) != NULL) {
129 substring_t args[MAX_OPT_ARGS];
130 int token;
131 if (!*p)
132 continue;
133
134 token = match_token(p, tokens, args);
135 switch (token) {
136 case Opt_devuid:
137 if (match_int(&args[0], &option))
138 return -EINVAL;
139 devuid = option;
140 break;
141 case Opt_devgid:
142 if (match_int(&args[0], &option))
143 return -EINVAL;
144 devgid = option;
145 break;
146 case Opt_devmode:
147 if (match_octal(&args[0], &option))
148 return -EINVAL;
149 devmode = option & S_IRWXUGO;
150 break;
151 case Opt_busuid:
152 if (match_int(&args[0], &option))
153 return -EINVAL;
154 busuid = option;
155 break;
156 case Opt_busgid:
157 if (match_int(&args[0], &option))
158 return -EINVAL;
159 busgid = option;
160 break;
161 case Opt_busmode:
162 if (match_octal(&args[0], &option))
163 return -EINVAL;
164 busmode = option & S_IRWXUGO;
165 break;