diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-12 19:46:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-12 19:46:58 -0400 |
commit | 9374430a52dfae5c013b88f7f030c04a6774d410 (patch) | |
tree | ce1ee8eee4e79fbb9486e810278d1092afc74a44 /include/linux | |
parent | 66f49739fe1591197364f2dad1b67b975e8f5e85 (diff) | |
parent | 13f9966b3ba5b45f47f2ea0eb0a90afceedfbb1f (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (149 commits)
USB: ohci-pnx4008: Remove unnecessary cast of return value of kzalloc
USB: additions to the quirk list
usb-storage: implement autosuspend
USB: cdc-acm: add new device id to option driver
USB: goku_udc trivial cleanups
USB: usb gadget stack can now -DDEBUG with Kconfig
usb gadget stack: remove usb_ep_*_buffer(), part 2
usb gadget stack: remove usb_ep_*_buffer(), part 1
USB: pxa2xx_udc -- cleanups, mostly removing dma hooks
USB: pxa2xx_udc: use generic gpio layer
USB: quirk for samsung printer
USB: usb/dma doc updates
USB: drivers/usb/storage/unusual_devs.h whitespace cleanup
USB: remove Makefile reference to obsolete OHCI_AT91
USB: io_*: remove bogus termios no change checks
USB: mos7720: remove bogus no termios change check
USB: visor and whiteheat: remove bogus termios change checks
USB: pl2303: remove bogus checks and fix speed support to use tty_get_baud_rate()
USB: mos7840.c: turn this into a serial driver
USB: make the usb_device numa_node get assigned from controller
...
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/usb.h | 69 | ||||
-rw-r--r-- | include/linux/usb/Kbuild | 1 | ||||
-rw-r--r-- | include/linux/usb/gadgetfs.h (renamed from include/linux/usb_gadgetfs.h) | 24 | ||||
-rw-r--r-- | include/linux/usb/quirks.h | 3 | ||||
-rw-r--r-- | include/linux/usb/serial.h | 7 | ||||
-rw-r--r-- | include/linux/usb_gadget.h | 48 |
6 files changed, 92 insertions, 60 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 56aa2ee21f1b..7a60946df3b6 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -146,6 +146,10 @@ struct usb_interface { | |||
146 | * active alternate setting */ | 146 | * active alternate setting */ |
147 | unsigned num_altsetting; /* number of alternate settings */ | 147 | unsigned num_altsetting; /* number of alternate settings */ |
148 | 148 | ||
149 | /* If there is an interface association descriptor then it will list | ||
150 | * the associated interfaces */ | ||
151 | struct usb_interface_assoc_descriptor *intf_assoc; | ||
152 | |||
149 | int minor; /* minor number this interface is | 153 | int minor; /* minor number this interface is |
150 | * bound to */ | 154 | * bound to */ |
151 | enum usb_interface_condition condition; /* state of binding */ | 155 | enum usb_interface_condition condition; /* state of binding */ |
@@ -175,6 +179,7 @@ void usb_put_intf(struct usb_interface *intf); | |||
175 | 179 | ||
176 | /* this maximum is arbitrary */ | 180 | /* this maximum is arbitrary */ |
177 | #define USB_MAXINTERFACES 32 | 181 | #define USB_MAXINTERFACES 32 |
182 | #define USB_MAXIADS USB_MAXINTERFACES/2 | ||
178 | 183 | ||
179 | /** | 184 | /** |
180 | * struct usb_interface_cache - long-term representation of a device interface | 185 | * struct usb_interface_cache - long-term representation of a device interface |
@@ -245,6 +250,11 @@ struct usb_host_config { | |||
245 | struct usb_config_descriptor desc; | 250 | struct usb_config_descriptor desc; |
246 | 251 | ||
247 | char *string; /* iConfiguration string, if present */ | 252 | char *string; /* iConfiguration string, if present */ |
253 | |||
254 | /* List of any Interface Association Descriptors in this | ||
255 | * configuration. */ | ||
256 | struct usb_interface_assoc_descriptor *intf_assoc[USB_MAXIADS]; | ||
257 | |||
248 | /* the interfaces associated with this configuration, | 258 | /* the interfaces associated with this configuration, |
249 | * stored in no particular order */ | 259 | * stored in no particular order */ |
250 | struct usb_interface *interface[USB_MAXINTERFACES]; | 260 | struct usb_interface *interface[USB_MAXINTERFACES]; |
@@ -403,6 +413,8 @@ struct usb_device { | |||
403 | 413 | ||
404 | unsigned auto_pm:1; /* autosuspend/resume in progress */ | 414 | unsigned auto_pm:1; /* autosuspend/resume in progress */ |
405 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ | 415 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ |
416 | unsigned reset_resume:1; /* needs reset instead of resume */ | ||
417 | unsigned persist_enabled:1; /* USB_PERSIST enabled for this dev */ | ||
406 | unsigned autosuspend_disabled:1; /* autosuspend and autoresume */ | 418 | unsigned autosuspend_disabled:1; /* autosuspend and autoresume */ |
407 | unsigned autoresume_disabled:1; /* disabled by the user */ | 419 | unsigned autoresume_disabled:1; /* disabled by the user */ |
408 | #endif | 420 | #endif |
@@ -770,6 +782,28 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor | |||
770 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \ | 782 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \ |
771 | .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) | 783 | .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) |
772 | 784 | ||
785 | /** | ||
786 | * USB_DEVICE_AND_INTERFACE_INFO - macro used to describe a specific usb device | ||
787 | * with a class of usb interfaces | ||
788 | * @vend: the 16 bit USB Vendor ID | ||
789 | * @prod: the 16 bit USB Product ID | ||
790 | * @cl: bInterfaceClass value | ||
791 | * @sc: bInterfaceSubClass value | ||
792 | * @pr: bInterfaceProtocol value | ||
793 | * | ||
794 | * This macro is used to create a struct usb_device_id that matches a | ||
795 | * specific device with a specific class of interfaces. | ||
796 | * | ||
797 | * This is especially useful when explicitly matching devices that have | ||
798 | * vendor specific bDeviceClass values, but standards-compliant interfaces. | ||
799 | */ | ||
800 | #define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \ | ||
801 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ | ||
802 | | USB_DEVICE_ID_MATCH_DEVICE, \ | ||
803 | .idVendor = (vend), .idProduct = (prod), \ | ||
804 | .bInterfaceClass = (cl), \ | ||
805 | .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) | ||
806 | |||
773 | /* ----------------------------------------------------------------------- */ | 807 | /* ----------------------------------------------------------------------- */ |
774 | 808 | ||
775 | /* Stuff for dynamic usb ids */ | 809 | /* Stuff for dynamic usb ids */ |
@@ -816,10 +850,15 @@ struct usbdrv_wrap { | |||
816 | * do (or don't) show up otherwise in the filesystem. | 850 | * do (or don't) show up otherwise in the filesystem. |
817 | * @suspend: Called when the device is going to be suspended by the system. | 851 | * @suspend: Called when the device is going to be suspended by the system. |
818 | * @resume: Called when the device is being resumed by the system. | 852 | * @resume: Called when the device is being resumed by the system. |
853 | * @reset_resume: Called when the suspended device has been reset instead | ||
854 | * of being resumed. | ||
819 | * @pre_reset: Called by usb_reset_composite_device() when the device | 855 | * @pre_reset: Called by usb_reset_composite_device() when the device |
820 | * is about to be reset. | 856 | * is about to be reset. |
821 | * @post_reset: Called by usb_reset_composite_device() after the device | 857 | * @post_reset: Called by usb_reset_composite_device() after the device |
822 | * has been reset. | 858 | * has been reset, or in lieu of @resume following a reset-resume |
859 | * (i.e., the device is reset instead of being resumed, as might | ||
860 | * happen if power was lost). The second argument tells which is | ||
861 | * the reason. | ||
823 | * @id_table: USB drivers use ID table to support hotplugging. | 862 | * @id_table: USB drivers use ID table to support hotplugging. |
824 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set | 863 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set |
825 | * or your driver's probe function will never get called. | 864 | * or your driver's probe function will never get called. |
@@ -859,9 +898,10 @@ struct usb_driver { | |||
859 | 898 | ||
860 | int (*suspend) (struct usb_interface *intf, pm_message_t message); | 899 | int (*suspend) (struct usb_interface *intf, pm_message_t message); |
861 | int (*resume) (struct usb_interface *intf); | 900 | int (*resume) (struct usb_interface *intf); |
901 | int (*reset_resume)(struct usb_interface *intf); | ||
862 | 902 | ||
863 | void (*pre_reset) (struct usb_interface *intf); | 903 | int (*pre_reset)(struct usb_interface *intf); |
864 | void (*post_reset) (struct usb_interface *intf); | 904 | int (*post_reset)(struct usb_interface *intf); |
865 | 905 | ||
866 | const struct usb_device_id *id_table; | 906 | const struct usb_device_id *id_table; |
867 | 907 | ||
@@ -964,6 +1004,7 @@ extern int usb_disabled(void); | |||
964 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ | 1004 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ |
965 | #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt | 1005 | #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt |
966 | * needed */ | 1006 | * needed */ |
1007 | #define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */ | ||
967 | 1008 | ||
968 | struct usb_iso_packet_descriptor { | 1009 | struct usb_iso_packet_descriptor { |
969 | unsigned int offset; | 1010 | unsigned int offset; |
@@ -974,11 +1015,26 @@ struct usb_iso_packet_descriptor { | |||
974 | 1015 | ||
975 | struct urb; | 1016 | struct urb; |
976 | 1017 | ||
1018 | struct usb_anchor { | ||
1019 | struct list_head urb_list; | ||
1020 | wait_queue_head_t wait; | ||
1021 | spinlock_t lock; | ||
1022 | }; | ||
1023 | |||
1024 | static inline void init_usb_anchor(struct usb_anchor *anchor) | ||
1025 | { | ||
1026 | INIT_LIST_HEAD(&anchor->urb_list); | ||
1027 | init_waitqueue_head(&anchor->wait); | ||
1028 | spin_lock_init(&anchor->lock); | ||
1029 | } | ||
1030 | |||
977 | typedef void (*usb_complete_t)(struct urb *); | 1031 | typedef void (*usb_complete_t)(struct urb *); |
978 | 1032 | ||
979 | /** | 1033 | /** |
980 | * struct urb - USB Request Block | 1034 | * struct urb - USB Request Block |
981 | * @urb_list: For use by current owner of the URB. | 1035 | * @urb_list: For use by current owner of the URB. |
1036 | * @anchor_list: membership in the list of an anchor | ||
1037 | * @anchor: to anchor URBs to a common mooring | ||
982 | * @pipe: Holds endpoint number, direction, type, and more. | 1038 | * @pipe: Holds endpoint number, direction, type, and more. |
983 | * Create these values with the eight macros available; | 1039 | * Create these values with the eight macros available; |
984 | * usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl" | 1040 | * usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl" |
@@ -1151,6 +1207,8 @@ struct urb | |||
1151 | /* public: documented fields in the urb that can be used by drivers */ | 1207 | /* public: documented fields in the urb that can be used by drivers */ |
1152 | struct list_head urb_list; /* list head for use by the urb's | 1208 | struct list_head urb_list; /* list head for use by the urb's |
1153 | * current owner */ | 1209 | * current owner */ |
1210 | struct list_head anchor_list; /* the URB may be anchored by the driver */ | ||
1211 | struct usb_anchor *anchor; | ||
1154 | struct usb_device *dev; /* (in) pointer to associated device */ | 1212 | struct usb_device *dev; /* (in) pointer to associated device */ |
1155 | unsigned int pipe; /* (in) pipe information */ | 1213 | unsigned int pipe; /* (in) pipe information */ |
1156 | int status; /* (return) non-ISO status */ | 1214 | int status; /* (return) non-ISO status */ |
@@ -1286,6 +1344,11 @@ extern struct urb *usb_get_urb(struct urb *urb); | |||
1286 | extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); | 1344 | extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); |
1287 | extern int usb_unlink_urb(struct urb *urb); | 1345 | extern int usb_unlink_urb(struct urb *urb); |
1288 | extern void usb_kill_urb(struct urb *urb); | 1346 | extern void usb_kill_urb(struct urb *urb); |
1347 | extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); | ||
1348 | extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor); | ||
1349 | extern void usb_unanchor_urb(struct urb *urb); | ||
1350 | extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor, | ||
1351 | unsigned int timeout); | ||
1289 | 1352 | ||
1290 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, | 1353 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, |
1291 | gfp_t mem_flags, dma_addr_t *dma); | 1354 | gfp_t mem_flags, dma_addr_t *dma); |
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild index 43f160cfe003..6ce42bf9f743 100644 --- a/include/linux/usb/Kbuild +++ b/include/linux/usb/Kbuild | |||
@@ -1,5 +1,6 @@ | |||
1 | unifdef-y += audio.h | 1 | unifdef-y += audio.h |
2 | unifdef-y += cdc.h | 2 | unifdef-y += cdc.h |
3 | unifdef-y += ch9.h | 3 | unifdef-y += ch9.h |
4 | unifdef-y += gadgetfs.h | ||
4 | unifdef-y += midi.h | 5 | unifdef-y += midi.h |
5 | 6 | ||
diff --git a/include/linux/usb_gadgetfs.h b/include/linux/usb/gadgetfs.h index 8086d5a9b94e..e8654c338729 100644 --- a/include/linux/usb_gadgetfs.h +++ b/include/linux/usb/gadgetfs.h | |||
@@ -1,3 +1,5 @@ | |||
1 | #ifndef __LINUX_USB_GADGETFS_H | ||
2 | #define __LINUX_USB_GADGETFS_H | ||
1 | 3 | ||
2 | #include <asm/types.h> | 4 | #include <asm/types.h> |
3 | #include <asm/ioctl.h> | 5 | #include <asm/ioctl.h> |
@@ -7,11 +9,12 @@ | |||
7 | /* | 9 | /* |
8 | * Filesystem based user-mode API to USB Gadget controller hardware | 10 | * Filesystem based user-mode API to USB Gadget controller hardware |
9 | * | 11 | * |
10 | * Almost everything can be done with only read and write operations, | 12 | * Other than ep0 operations, most things are done by read() and write() |
11 | * on endpoint files found in one directory. They are configured by | 13 | * on endpoint files found in one directory. They are configured by |
12 | * writing descriptors, and then may be used for normal stream style | 14 | * writing descriptors, and then may be used for normal stream style |
13 | * i/o requests. When ep0 is configured, the device can enumerate; | 15 | * i/o requests. When ep0 is configured, the device can enumerate; |
14 | * when it's closed, the device disconnects from usb. | 16 | * when it's closed, the device disconnects from usb. Operations on |
17 | * ep0 require ioctl() operations. | ||
15 | * | 18 | * |
16 | * Configuration and device descriptors get written to /dev/gadget/$CHIP, | 19 | * Configuration and device descriptors get written to /dev/gadget/$CHIP, |
17 | * which may then be used to read usb_gadgetfs_event structs. The driver | 20 | * which may then be used to read usb_gadgetfs_event structs. The driver |
@@ -21,9 +24,9 @@ | |||
21 | */ | 24 | */ |
22 | 25 | ||
23 | /* | 26 | /* |
24 | * Events are delivered on the ep0 file descriptor, if the user mode driver | 27 | * Events are delivered on the ep0 file descriptor, when the user mode driver |
25 | * reads from this file descriptor after writing the descriptors. Don't | 28 | * reads from this file descriptor after writing the descriptors. Don't |
26 | * stop polling this descriptor, if you write that kind of driver. | 29 | * stop polling this descriptor. |
27 | */ | 30 | */ |
28 | 31 | ||
29 | enum usb_gadgetfs_event_type { | 32 | enum usb_gadgetfs_event_type { |
@@ -36,8 +39,10 @@ enum usb_gadgetfs_event_type { | |||
36 | // and likely more ! | 39 | // and likely more ! |
37 | }; | 40 | }; |
38 | 41 | ||
42 | /* NOTE: this structure must stay the same size and layout on | ||
43 | * both 32-bit and 64-bit kernels. | ||
44 | */ | ||
39 | struct usb_gadgetfs_event { | 45 | struct usb_gadgetfs_event { |
40 | enum usb_gadgetfs_event_type type; | ||
41 | union { | 46 | union { |
42 | // NOP, DISCONNECT, SUSPEND: nothing | 47 | // NOP, DISCONNECT, SUSPEND: nothing |
43 | // ... some hardware can't report disconnection | 48 | // ... some hardware can't report disconnection |
@@ -46,19 +51,20 @@ struct usb_gadgetfs_event { | |||
46 | enum usb_device_speed speed; | 51 | enum usb_device_speed speed; |
47 | 52 | ||
48 | // SETUP: packet; DATA phase i/o precedes next event | 53 | // SETUP: packet; DATA phase i/o precedes next event |
49 | // (setup.bmRequestType & USB_DIR_IN) flags direction | 54 | // (setup.bmRequestType & USB_DIR_IN) flags direction |
50 | // ... includes SET_CONFIGURATION, SET_INTERFACE | 55 | // ... includes SET_CONFIGURATION, SET_INTERFACE |
51 | struct usb_ctrlrequest setup; | 56 | struct usb_ctrlrequest setup; |
52 | } u; | 57 | } u; |
58 | enum usb_gadgetfs_event_type type; | ||
53 | }; | 59 | }; |
54 | 60 | ||
55 | 61 | ||
56 | /* endpoint ioctls */ | 62 | /* endpoint ioctls */ |
57 | 63 | ||
58 | /* IN transfers may be reported to the gadget driver as complete | 64 | /* IN transfers may be reported to the gadget driver as complete |
59 | * when the fifo is loaded, before the host reads the data; | 65 | * when the fifo is loaded, before the host reads the data; |
60 | * OUT transfers may be reported to the host's "client" driver as | 66 | * OUT transfers may be reported to the host's "client" driver as |
61 | * complete when they're sitting in the FIFO unread. | 67 | * complete when they're sitting in the FIFO unread. |
62 | * THIS returns how many bytes are "unclaimed" in the endpoint fifo | 68 | * THIS returns how many bytes are "unclaimed" in the endpoint fifo |
63 | * (needed for precise fault handling, when the hardware allows it) | 69 | * (needed for precise fault handling, when the hardware allows it) |
64 | */ | 70 | */ |
@@ -72,4 +78,4 @@ struct usb_gadgetfs_event { | |||
72 | */ | 78 | */ |
73 | #define GADGETFS_CLEAR_HALT _IO('g',3) | 79 | #define GADGETFS_CLEAR_HALT _IO('g',3) |
74 | 80 | ||
75 | 81 | #endif /* __LINUX_USB_GADGETFS_H */ | |
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 6bac8faacbc6..8da374caf582 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
@@ -9,3 +9,6 @@ | |||
9 | 9 | ||
10 | /* string descriptors must not be fetched using a 255-byte read */ | 10 | /* string descriptors must not be fetched using a 255-byte read */ |
11 | #define USB_QUIRK_STRING_FETCH_255 0x00000002 | 11 | #define USB_QUIRK_STRING_FETCH_255 0x00000002 |
12 | |||
13 | /* device can't resume correctly so reset it instead */ | ||
14 | #define USB_QUIRK_RESET_RESUME 0x00000004 | ||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 32acbae28d24..e8b8928232c8 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -221,6 +221,9 @@ struct usb_serial_driver { | |||
221 | int (*port_probe) (struct usb_serial_port *port); | 221 | int (*port_probe) (struct usb_serial_port *port); |
222 | int (*port_remove) (struct usb_serial_port *port); | 222 | int (*port_remove) (struct usb_serial_port *port); |
223 | 223 | ||
224 | int (*suspend) (struct usb_serial *serial, pm_message_t message); | ||
225 | int (*resume) (struct usb_serial *serial); | ||
226 | |||
224 | /* serial function calls */ | 227 | /* serial function calls */ |
225 | int (*open) (struct usb_serial_port *port, struct file * filp); | 228 | int (*open) (struct usb_serial_port *port, struct file * filp); |
226 | void (*close) (struct usb_serial_port *port, struct file * filp); | 229 | void (*close) (struct usb_serial_port *port, struct file * filp); |
@@ -249,6 +252,9 @@ extern void usb_serial_port_softint(struct usb_serial_port *port); | |||
249 | extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); | 252 | extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); |
250 | extern void usb_serial_disconnect(struct usb_interface *iface); | 253 | extern void usb_serial_disconnect(struct usb_interface *iface); |
251 | 254 | ||
255 | extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); | ||
256 | extern int usb_serial_resume(struct usb_interface *intf); | ||
257 | |||
252 | extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); | 258 | extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); |
253 | extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); | 259 | extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); |
254 | 260 | ||
@@ -269,6 +275,7 @@ extern void usb_serial_put(struct usb_serial *serial); | |||
269 | extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); | 275 | extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); |
270 | extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); | 276 | extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); |
271 | extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); | 277 | extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); |
278 | extern int usb_serial_generic_resume (struct usb_serial *serial); | ||
272 | extern int usb_serial_generic_write_room (struct usb_serial_port *port); | 279 | extern int usb_serial_generic_write_room (struct usb_serial_port *port); |
273 | extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); | 280 | extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); |
274 | extern void usb_serial_generic_read_bulk_callback (struct urb *urb); | 281 | extern void usb_serial_generic_read_bulk_callback (struct urb *urb); |
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index e17186dbcdca..4f59b2aa8a9e 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h | |||
@@ -110,13 +110,6 @@ struct usb_ep_ops { | |||
110 | gfp_t gfp_flags); | 110 | gfp_t gfp_flags); |
111 | void (*free_request) (struct usb_ep *ep, struct usb_request *req); | 111 | void (*free_request) (struct usb_ep *ep, struct usb_request *req); |
112 | 112 | ||
113 | void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, | ||
114 | dma_addr_t *dma, gfp_t gfp_flags); | ||
115 | void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, | ||
116 | unsigned bytes); | ||
117 | // NOTE: on 2.6, drivers may also use dma_map() and | ||
118 | // dma_sync_single_*() to directly manage dma overhead. | ||
119 | |||
120 | int (*queue) (struct usb_ep *ep, struct usb_request *req, | 113 | int (*queue) (struct usb_ep *ep, struct usb_request *req, |
121 | gfp_t gfp_flags); | 114 | gfp_t gfp_flags); |
122 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); | 115 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); |
@@ -235,47 +228,6 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) | |||
235 | } | 228 | } |
236 | 229 | ||
237 | /** | 230 | /** |
238 | * usb_ep_alloc_buffer - allocate an I/O buffer | ||
239 | * @ep:the endpoint associated with the buffer | ||
240 | * @len:length of the desired buffer | ||
241 | * @dma:pointer to the buffer's DMA address; must be valid | ||
242 | * @gfp_flags:GFP_* flags to use | ||
243 | * | ||
244 | * Returns a new buffer, or null if one could not be allocated. | ||
245 | * The buffer is suitably aligned for dma, if that endpoint uses DMA, | ||
246 | * and the caller won't have to care about dma-inconsistency | ||
247 | * or any hidden "bounce buffer" mechanism. No additional per-request | ||
248 | * DMA mapping will be required for such buffers. | ||
249 | * Free it later with usb_ep_free_buffer(). | ||
250 | * | ||
251 | * You don't need to use this call to allocate I/O buffers unless you | ||
252 | * want to make sure drivers don't incur costs for such "bounce buffer" | ||
253 | * copies or per-request DMA mappings. | ||
254 | */ | ||
255 | static inline void * | ||
256 | usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, | ||
257 | gfp_t gfp_flags) | ||
258 | { | ||
259 | return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); | ||
260 | } | ||
261 | |||
262 | /** | ||
263 | * usb_ep_free_buffer - frees an i/o buffer | ||
264 | * @ep:the endpoint associated with the buffer | ||
265 | * @buf:CPU view address of the buffer | ||
266 | * @dma:the buffer's DMA address | ||
267 | * @len:length of the buffer | ||
268 | * | ||
269 | * reverses the effect of usb_ep_alloc_buffer(). | ||
270 | * caller guarantees the buffer will no longer be accessed | ||
271 | */ | ||
272 | static inline void | ||
273 | usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len) | ||
274 | { | ||
275 | ep->ops->free_buffer (ep, buf, dma, len); | ||
276 | } | ||
277 | |||
278 | /** | ||
279 | * usb_ep_queue - queues (submits) an I/O request to an endpoint. | 231 | * usb_ep_queue - queues (submits) an I/O request to an endpoint. |
280 | * @ep:the endpoint associated with the request | 232 | * @ep:the endpoint associated with the request |
281 | * @req:the request being submitted | 233 | * @req:the request being submitted |