aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/sysfs.h17
-rw-r--r--include/linux/usb.h4
-rw-r--r--include/linux/usb/ch9.h22
-rw-r--r--include/linux/usb/iowarrior.h33
-rw-r--r--include/linux/usb/quirks.h11
5 files changed, 83 insertions, 4 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 192de3afa96b..f45450b295c0 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -126,6 +126,11 @@ void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr);
126int __must_check sysfs_create_group(struct kobject *, 126int __must_check sysfs_create_group(struct kobject *,
127 const struct attribute_group *); 127 const struct attribute_group *);
128void sysfs_remove_group(struct kobject *, const struct attribute_group *); 128void sysfs_remove_group(struct kobject *, const struct attribute_group *);
129int sysfs_add_file_to_group(struct kobject *kobj,
130 const struct attribute *attr, const char *group);
131void sysfs_remove_file_from_group(struct kobject *kobj,
132 const struct attribute *attr, const char *group);
133
129void sysfs_notify(struct kobject * k, char *dir, char *attr); 134void sysfs_notify(struct kobject * k, char *dir, char *attr);
130 135
131 136
@@ -210,6 +215,18 @@ static inline void sysfs_remove_group(struct kobject * k, const struct attribute
210 ; 215 ;
211} 216}
212 217
218static inline int sysfs_add_file_to_group(struct kobject *kobj,
219 const struct attribute *attr, const char *group)
220{
221 return 0;
222}
223
224static inline void sysfs_remove_file_from_group(struct kobject *kobj,
225 const struct attribute *attr, const char *group);
226{
227 ;
228}
229
213static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) 230static inline void sysfs_notify(struct kobject * k, char *dir, char *attr)
214{ 231{
215} 232}
diff --git a/include/linux/usb.h b/include/linux/usb.h
index a8e8d1ecebb1..87dc75a6cee1 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -388,10 +388,14 @@ struct usb_device {
388 struct usb_device *children[USB_MAXCHILDREN]; 388 struct usb_device *children[USB_MAXCHILDREN];
389 389
390 int pm_usage_cnt; /* usage counter for autosuspend */ 390 int pm_usage_cnt; /* usage counter for autosuspend */
391 u32 quirks; /* quirks of the whole device */
392
391#ifdef CONFIG_PM 393#ifdef CONFIG_PM
392 struct delayed_work autosuspend; /* for delayed autosuspends */ 394 struct delayed_work autosuspend; /* for delayed autosuspends */
393 struct mutex pm_mutex; /* protects PM operations */ 395 struct mutex pm_mutex; /* protects PM operations */
394 396
397 unsigned autosuspend_delay; /* in jiffies */
398
395 unsigned auto_pm:1; /* autosuspend/resume in progress */ 399 unsigned auto_pm:1; /* autosuspend/resume in progress */
396 unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ 400 unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */
397#endif 401#endif
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 245c72531228..1122a6c2c1a3 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -1,8 +1,9 @@
1/* 1/*
2 * This file holds USB constants and structures that are needed for USB 2 * This file holds USB constants and structures that are needed for
3 * device APIs. These are used by the USB device model, which is defined 3 * USB device APIs. These are used by the USB device model, which is
4 * in chapter 9 of the USB 2.0 specification. Linux has several APIs in C 4 * defined in chapter 9 of the USB 2.0 specification and in the
5 * that need these: 5 * Wireless USB 1.0 (spread around). Linux has several APIs in C that
6 * need these:
6 * 7 *
7 * - the master/host side Linux-USB kernel driver API; 8 * - the master/host side Linux-USB kernel driver API;
8 * - the "usbfs" user space API; and 9 * - the "usbfs" user space API; and
@@ -14,6 +15,19 @@
14 * 15 *
15 * There's also "Wireless USB", using low power short range radios for 16 * There's also "Wireless USB", using low power short range radios for
16 * peripheral interconnection but otherwise building on the USB framework. 17 * peripheral interconnection but otherwise building on the USB framework.
18 *
19 * Note all descriptors are declared '__attribute__((packed))' so that:
20 *
21 * [a] they never get padded, either internally (USB spec writers
22 * probably handled that) or externally;
23 *
24 * [b] so that accessing bigger-than-a-bytes fields will never
25 * generate bus errors on any platform, even when the location of
26 * its descriptor inside a bundle isn't "naturally aligned", and
27 *
28 * [c] for consistency, removing all doubt even when it appears to
29 * someone that the two other points are non-issues for that
30 * particular descriptor type.
17 */ 31 */
18 32
19#ifndef __LINUX_USB_CH9_H 33#ifndef __LINUX_USB_CH9_H
diff --git a/include/linux/usb/iowarrior.h b/include/linux/usb/iowarrior.h
new file mode 100644
index 000000000000..cbbe020a4f5c
--- /dev/null
+++ b/include/linux/usb/iowarrior.h
@@ -0,0 +1,33 @@
1#ifndef _IOWARRIOR_H_
2#define _IOWARRIOR_H_
3
4#define CODEMERCS_MAGIC_NUMBER 0xC0 /* like COde Mercenaries */
5
6/* Define the ioctl commands for reading and writing data */
7#define IOW_WRITE _IOW(CODEMERCS_MAGIC_NUMBER, 1, __u8 *)
8#define IOW_READ _IOW(CODEMERCS_MAGIC_NUMBER, 2, __u8 *)
9
10/*
11 A struct for available device info which is read
12 with the ioctl IOW_GETINFO.
13 To be compatible with 2.4 userspace which didn't have an easy way to get
14 this information.
15*/
16struct iowarrior_info {
17 __u32 vendor; /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */
18 __u32 product; /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_XXXXX) */
19 __u8 serial[9]; /* the serial number of our chip (if a serial-number is not available this is empty string) */
20 __u32 revision; /* revision number of the chip */
21 __u32 speed; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */
22 __u32 power; /* power consumption of the device in mA */
23 __u32 if_num; /* the number of the endpoint */
24 __u32 report_size; /* size of the data-packets on this interface */
25};
26
27/*
28 Get some device-information (product-id , serial-number etc.)
29 in order to identify a chip.
30*/
31#define IOW_GETINFO _IOR(CODEMERCS_MAGIC_NUMBER, 3, struct iowarrior_info)
32
33#endif /* _IOWARRIOR_H_ */
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
new file mode 100644
index 000000000000..6bac8faacbc6
--- /dev/null
+++ b/include/linux/usb/quirks.h
@@ -0,0 +1,11 @@
1/*
2 * This file holds the definitions of quirks found in USB devices.
3 * Only quirks that affect the whole device, not an interface,
4 * belong here.
5 */
6
7/* device must not be autosuspended */
8#define USB_QUIRK_NO_AUTOSUSPEND 0x00000001
9
10/* string descriptors must not be fetched using a 255-byte read */
11#define USB_QUIRK_STRING_FETCH_255 0x00000002