diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2002-09-30 05:34:45 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-09-30 05:34:45 -0700 |
| commit | 2b9fa51a14b2c4e41b8abecb134d997c1eae5a02 (patch) | |
| tree | f15f538a78a4b5e8499fbaec0898de9985aeb6c8 /include/linux | |
| parent | fd0a1c61869aa279d6a8c484a3f6cda1e13a57ef (diff) | |
| parent | 5dd171035db04c910d66819d0522e3dedacc3ffa (diff) | |
Merge http://linux-scsi.bkbits.net/scsi-for-linus-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/auto_fs.h | 2 | ||||
| -rw-r--r-- | include/linux/module.h | 1 | ||||
| -rw-r--r-- | include/linux/usb.h | 77 | ||||
| -rw-r--r-- | include/linux/usbdevice_fs.h | 2 |
4 files changed, 66 insertions, 16 deletions
diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h index 39b120cd2e12..13bc53bc06f5 100644 --- a/include/linux/auto_fs.h +++ b/include/linux/auto_fs.h @@ -45,7 +45,7 @@ * If so, 32-bit user-space code should be backwards compatible. */ -#if defined(__sparc__) || defined(__mips__) || defined(__x86_64) \ +#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \ || defined(__powerpc__) || defined(__s390__) typedef unsigned int autofs_wqt_t; #else diff --git a/include/linux/module.h b/include/linux/module.h index c71778e38536..4dc669b060fb 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -253,6 +253,7 @@ static const struct gtype##_id * __module_##gtype##_table \ * software modules * * "GPL" [GNU Public License v2 or later] + * "GPL v2" [GNU Public License v2] * "GPL and additional rights" [GNU Public License v2 rights and more] * "Dual BSD/GPL" [GNU Public License v2 or BSD license choice] * "Dual MPL/GPL" [GNU Public License v2 or Mozilla license choice] diff --git a/include/linux/usb.h b/include/linux/usb.h index 5d323aa0d36e..5dbc3cb115f7 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -84,6 +84,7 @@ #include <linux/list.h> /* for struct list_head */ #include <linux/device.h> /* for struct device */ #include <linux/fs.h> /* for struct file_operations */ +#include <linux/completion.h> /* for struct completion */ static __inline__ void wait_ms(unsigned int ms) @@ -452,9 +453,9 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size) * User mode code can read these tables to choose which modules to load. * Declare the table as a MODULE_DEVICE_TABLE. * - * The third probe() parameter will point to a matching entry from this - * table. (Null value reserved.) Use the driver_data field for each - * match to hold information tied to that match: device quirks, etc. + * A probe() parameter will point to a matching entry from this table. + * Use the driver_info field for each match to hold information tied + * to that match: device quirks, etc. * * Terminate the driver's table with an all-zeroes entry. * Use the flag values to control which fields are compared. @@ -604,17 +605,14 @@ struct usb_device_id { * @name: The driver name should be unique among USB drivers, * and should normally be the same as the module name. * @probe: Called to see if the driver is willing to manage a particular - * interface on a device. The probe routine returns a handle that - * will later be provided to disconnect(), or a null pointer to - * indicate that the driver will not handle the interface. - * The handle is normally a pointer to driver-specific data. - * If the probe() routine needs to access the interface - * structure itself, use usb_ifnum_to_if() to make sure it's using - * the right one. + * interface on a device. If it is, probe returns zero and uses + * dev_set_drvdata() to associate driver-specific data with the + * interface. It may also use usb_set_interface() to specify the + * appropriate altsetting. If unwilling to manage the interface, + * return a negative errno value. * @disconnect: Called when the interface is no longer accessible, usually - * because its device has been (or is being) disconnected. The - * handle passed is what was returned by probe(), or was provided - * to usb_driver_claim_interface(). + * because its device has been (or is being) disconnected or the + * driver module is being unloaded. * @ioctl: Used for drivers that want to talk to userspace through * the "usbfs" filesystem. This lets devices provide ways to * expose information to user space regardless of where they @@ -648,7 +646,7 @@ struct usb_driver { void (*disconnect) (struct usb_interface *intf); - int (*ioctl) (struct usb_device *dev, unsigned int code, void *buf); + int (*ioctl) (struct usb_interface *intf, unsigned int code, void *buf); const struct usb_device_id *id_table; @@ -1074,6 +1072,57 @@ extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate); #define USB_CTRL_SET_TIMEOUT 3 + +/** + * struct usb_sg_request - support for scatter/gather I/O + * @status: zero indicates success, else negative errno + * @bytes: counts bytes transferred. + * + * These requests are initialized using usb_sg_init(), and then are used + * as request handles passed to usb_sg_wait() or usb_sg_cancel(). Most + * members of the request object aren't for driver access. + * + * The status and bytecount values are valid only after usb_sg_wait() + * returns. If the status is zero, then the bytecount matches the total + * from the request. + * + * After an error completion, drivers may need to clear a halt condition + * on the endpoint. + */ +struct usb_sg_request { + int status; + size_t bytes; + + // members not documented above are private to usbcore, + // and are not provided for driver access! + spinlock_t lock; + + struct usb_device *dev; + int pipe; + struct scatterlist *sg; + int nents; + + int entries; + struct urb **urbs; + + int count; + struct completion complete; +}; + +int usb_sg_init ( + struct usb_sg_request *io, + struct usb_device *dev, + unsigned pipe, + unsigned period, + struct scatterlist *sg, + int nents, + size_t length, + int mem_flags +); +void usb_sg_cancel (struct usb_sg_request *io); +void usb_sg_wait (struct usb_sg_request *io); + + /* -------------------------------------------------------------------------- */ /* diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index de18e956f47b..84653713900c 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h @@ -108,7 +108,7 @@ struct usbdevfs_urb { struct usbdevfs_iso_packet_desc iso_frame_desc[0]; }; -/* ioctls for talking to drivers in the usbcore module: */ +/* ioctls for talking directly to drivers */ struct usbdevfs_ioctl { int ifno; /* interface 0..N ; negative numbers reserved */ int ioctl_code; /* MUST encode size + direction of data so the |
