diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-07-13 16:23:51 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-07-13 16:23:51 -0400 |
commit | 327309e899662b482c58cf25f574513d38b5788c (patch) | |
tree | 069de438aa0e92dd9b6ba28e6b207e2cd07151a5 /drivers/usb/core | |
parent | 0c168775709faa74c1b87f1e61046e0c51ade7f3 (diff) | |
parent | c32511e2718618f0b53479eb36e07439aa363a74 (diff) |
Merge upstream 2.6.13-rc3 into ieee80211 branch of netdev-2.6.
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/buffer.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/hcd-pci.c | 1 | ||||
-rw-r--r-- | drivers/usb/core/hcd.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/hcd.h | 8 | ||||
-rw-r--r-- | drivers/usb/core/hub.c | 40 | ||||
-rw-r--r-- | drivers/usb/core/message.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/sysfs.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/urb.c | 4 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 5 |
9 files changed, 27 insertions, 39 deletions
diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c index b7827df21f48..fc15b4acc8af 100644 --- a/drivers/usb/core/buffer.c +++ b/drivers/usb/core/buffer.c | |||
@@ -106,7 +106,7 @@ void hcd_buffer_destroy (struct usb_hcd *hcd) | |||
106 | void *hcd_buffer_alloc ( | 106 | void *hcd_buffer_alloc ( |
107 | struct usb_bus *bus, | 107 | struct usb_bus *bus, |
108 | size_t size, | 108 | size_t size, |
109 | int mem_flags, | 109 | unsigned mem_flags, |
110 | dma_addr_t *dma | 110 | dma_addr_t *dma |
111 | ) | 111 | ) |
112 | { | 112 | { |
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 71b4a8d66318..fc056062c960 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
@@ -380,6 +380,7 @@ int usb_hcd_pci_resume (struct pci_dev *dev) | |||
380 | usb_hc_died (hcd); | 380 | usb_hc_died (hcd); |
381 | } | 381 | } |
382 | 382 | ||
383 | pci_enable_device(dev); | ||
383 | return retval; | 384 | return retval; |
384 | } | 385 | } |
385 | EXPORT_SYMBOL (usb_hcd_pci_resume); | 386 | EXPORT_SYMBOL (usb_hcd_pci_resume); |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 83e732a0d64a..8616356f55e8 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -1112,7 +1112,7 @@ static void urb_unlink (struct urb *urb) | |||
1112 | * expects usb_submit_urb() to have sanity checked and conditioned all | 1112 | * expects usb_submit_urb() to have sanity checked and conditioned all |
1113 | * inputs in the urb | 1113 | * inputs in the urb |
1114 | */ | 1114 | */ |
1115 | static int hcd_submit_urb (struct urb *urb, int mem_flags) | 1115 | static int hcd_submit_urb (struct urb *urb, unsigned mem_flags) |
1116 | { | 1116 | { |
1117 | int status; | 1117 | int status; |
1118 | struct usb_hcd *hcd = urb->dev->bus->hcpriv; | 1118 | struct usb_hcd *hcd = urb->dev->bus->hcpriv; |
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index 8dc13cde2f73..67db4a999b93 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h | |||
@@ -142,12 +142,12 @@ struct hcd_timeout { /* timeouts we allocate */ | |||
142 | 142 | ||
143 | struct usb_operations { | 143 | struct usb_operations { |
144 | int (*get_frame_number) (struct usb_device *usb_dev); | 144 | int (*get_frame_number) (struct usb_device *usb_dev); |
145 | int (*submit_urb) (struct urb *urb, int mem_flags); | 145 | int (*submit_urb) (struct urb *urb, unsigned mem_flags); |
146 | int (*unlink_urb) (struct urb *urb, int status); | 146 | int (*unlink_urb) (struct urb *urb, int status); |
147 | 147 | ||
148 | /* allocate dma-consistent buffer for URB_DMA_NOMAPPING */ | 148 | /* allocate dma-consistent buffer for URB_DMA_NOMAPPING */ |
149 | void *(*buffer_alloc)(struct usb_bus *bus, size_t size, | 149 | void *(*buffer_alloc)(struct usb_bus *bus, size_t size, |
150 | int mem_flags, | 150 | unsigned mem_flags, |
151 | dma_addr_t *dma); | 151 | dma_addr_t *dma); |
152 | void (*buffer_free)(struct usb_bus *bus, size_t size, | 152 | void (*buffer_free)(struct usb_bus *bus, size_t size, |
153 | void *addr, dma_addr_t dma); | 153 | void *addr, dma_addr_t dma); |
@@ -200,7 +200,7 @@ struct hc_driver { | |||
200 | int (*urb_enqueue) (struct usb_hcd *hcd, | 200 | int (*urb_enqueue) (struct usb_hcd *hcd, |
201 | struct usb_host_endpoint *ep, | 201 | struct usb_host_endpoint *ep, |
202 | struct urb *urb, | 202 | struct urb *urb, |
203 | int mem_flags); | 203 | unsigned mem_flags); |
204 | int (*urb_dequeue) (struct usb_hcd *hcd, struct urb *urb); | 204 | int (*urb_dequeue) (struct usb_hcd *hcd, struct urb *urb); |
205 | 205 | ||
206 | /* hw synch, freeing endpoint resources that urb_dequeue can't */ | 206 | /* hw synch, freeing endpoint resources that urb_dequeue can't */ |
@@ -247,7 +247,7 @@ int hcd_buffer_create (struct usb_hcd *hcd); | |||
247 | void hcd_buffer_destroy (struct usb_hcd *hcd); | 247 | void hcd_buffer_destroy (struct usb_hcd *hcd); |
248 | 248 | ||
249 | void *hcd_buffer_alloc (struct usb_bus *bus, size_t size, | 249 | void *hcd_buffer_alloc (struct usb_bus *bus, size_t size, |
250 | int mem_flags, dma_addr_t *dma); | 250 | unsigned mem_flags, dma_addr_t *dma); |
251 | void hcd_buffer_free (struct usb_bus *bus, size_t size, | 251 | void hcd_buffer_free (struct usb_bus *bus, size_t size, |
252 | void *addr, dma_addr_t dma); | 252 | void *addr, dma_addr_t dma); |
253 | 253 | ||
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 32ff32181852..c3e46d24a37e 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | #include <linux/usb.h> | 27 | #include <linux/usb.h> |
28 | #include <linux/usbdevice_fs.h> | 28 | #include <linux/usbdevice_fs.h> |
29 | #include <linux/kthread.h> | ||
29 | 30 | ||
30 | #include <asm/semaphore.h> | 31 | #include <asm/semaphore.h> |
31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
@@ -47,8 +48,7 @@ static LIST_HEAD(hub_event_list); /* List of hubs needing servicing */ | |||
47 | /* Wakes up khubd */ | 48 | /* Wakes up khubd */ |
48 | static DECLARE_WAIT_QUEUE_HEAD(khubd_wait); | 49 | static DECLARE_WAIT_QUEUE_HEAD(khubd_wait); |
49 | 50 | ||
50 | static pid_t khubd_pid = 0; /* PID of khubd */ | 51 | static struct task_struct *khubd_task; |
51 | static DECLARE_COMPLETION(khubd_exited); | ||
52 | 52 | ||
53 | /* cycle leds on hubs that aren't blinking for attention */ | 53 | /* cycle leds on hubs that aren't blinking for attention */ |
54 | static int blinkenlights = 0; | 54 | static int blinkenlights = 0; |
@@ -2807,23 +2807,16 @@ loop: | |||
2807 | 2807 | ||
2808 | static int hub_thread(void *__unused) | 2808 | static int hub_thread(void *__unused) |
2809 | { | 2809 | { |
2810 | /* | ||
2811 | * This thread doesn't need any user-level access, | ||
2812 | * so get rid of all our resources | ||
2813 | */ | ||
2814 | |||
2815 | daemonize("khubd"); | ||
2816 | allow_signal(SIGKILL); | ||
2817 | |||
2818 | /* Send me a signal to get me die (for debugging) */ | ||
2819 | do { | 2810 | do { |
2820 | hub_events(); | 2811 | hub_events(); |
2821 | wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list)); | 2812 | wait_event_interruptible(khubd_wait, |
2813 | !list_empty(&hub_event_list) || | ||
2814 | kthread_should_stop()); | ||
2822 | try_to_freeze(); | 2815 | try_to_freeze(); |
2823 | } while (!signal_pending(current)); | 2816 | } while (!kthread_should_stop() || !list_empty(&hub_event_list)); |
2824 | 2817 | ||
2825 | pr_debug ("%s: khubd exiting\n", usbcore_name); | 2818 | pr_debug("%s: khubd exiting\n", usbcore_name); |
2826 | complete_and_exit(&khubd_exited, 0); | 2819 | return 0; |
2827 | } | 2820 | } |
2828 | 2821 | ||
2829 | static struct usb_device_id hub_id_table [] = { | 2822 | static struct usb_device_id hub_id_table [] = { |
@@ -2849,20 +2842,15 @@ static struct usb_driver hub_driver = { | |||
2849 | 2842 | ||
2850 | int usb_hub_init(void) | 2843 | int usb_hub_init(void) |
2851 | { | 2844 | { |
2852 | pid_t pid; | ||
2853 | |||
2854 | if (usb_register(&hub_driver) < 0) { | 2845 | if (usb_register(&hub_driver) < 0) { |
2855 | printk(KERN_ERR "%s: can't register hub driver\n", | 2846 | printk(KERN_ERR "%s: can't register hub driver\n", |
2856 | usbcore_name); | 2847 | usbcore_name); |
2857 | return -1; | 2848 | return -1; |
2858 | } | 2849 | } |
2859 | 2850 | ||
2860 | pid = kernel_thread(hub_thread, NULL, CLONE_KERNEL); | 2851 | khubd_task = kthread_run(hub_thread, NULL, "khubd"); |
2861 | if (pid >= 0) { | 2852 | if (!IS_ERR(khubd_task)) |
2862 | khubd_pid = pid; | ||
2863 | |||
2864 | return 0; | 2853 | return 0; |
2865 | } | ||
2866 | 2854 | ||
2867 | /* Fall through if kernel_thread failed */ | 2855 | /* Fall through if kernel_thread failed */ |
2868 | usb_deregister(&hub_driver); | 2856 | usb_deregister(&hub_driver); |
@@ -2873,12 +2861,7 @@ int usb_hub_init(void) | |||
2873 | 2861 | ||
2874 | void usb_hub_cleanup(void) | 2862 | void usb_hub_cleanup(void) |
2875 | { | 2863 | { |
2876 | int ret; | 2864 | kthread_stop(khubd_task); |
2877 | |||
2878 | /* Kill the thread */ | ||
2879 | ret = kill_proc(khubd_pid, SIGKILL, 1); | ||
2880 | |||
2881 | wait_for_completion(&khubd_exited); | ||
2882 | 2865 | ||
2883 | /* | 2866 | /* |
2884 | * Hub resources are freed for us by usb_deregister. It calls | 2867 | * Hub resources are freed for us by usb_deregister. It calls |
@@ -2890,7 +2873,6 @@ void usb_hub_cleanup(void) | |||
2890 | usb_deregister(&hub_driver); | 2873 | usb_deregister(&hub_driver); |
2891 | } /* usb_hub_cleanup() */ | 2874 | } /* usb_hub_cleanup() */ |
2892 | 2875 | ||
2893 | |||
2894 | static int config_descriptors_changed(struct usb_device *udev) | 2876 | static int config_descriptors_changed(struct usb_device *udev) |
2895 | { | 2877 | { |
2896 | unsigned index; | 2878 | unsigned index; |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index f50aaf25c98e..a428ef479bd7 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -320,7 +320,7 @@ int usb_sg_init ( | |||
320 | struct scatterlist *sg, | 320 | struct scatterlist *sg, |
321 | int nents, | 321 | int nents, |
322 | size_t length, | 322 | size_t length, |
323 | int mem_flags | 323 | unsigned mem_flags |
324 | ) | 324 | ) |
325 | { | 325 | { |
326 | int i; | 326 | int i; |
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 740cb4c668df..00297f113849 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -196,6 +196,7 @@ usb_descriptor_attr (bDeviceClass, "%02x\n") | |||
196 | usb_descriptor_attr (bDeviceSubClass, "%02x\n") | 196 | usb_descriptor_attr (bDeviceSubClass, "%02x\n") |
197 | usb_descriptor_attr (bDeviceProtocol, "%02x\n") | 197 | usb_descriptor_attr (bDeviceProtocol, "%02x\n") |
198 | usb_descriptor_attr (bNumConfigurations, "%d\n") | 198 | usb_descriptor_attr (bNumConfigurations, "%d\n") |
199 | usb_descriptor_attr (bMaxPacketSize0, "%d\n") | ||
199 | 200 | ||
200 | static struct attribute *dev_attrs[] = { | 201 | static struct attribute *dev_attrs[] = { |
201 | /* current configuration's attributes */ | 202 | /* current configuration's attributes */ |
@@ -211,6 +212,7 @@ static struct attribute *dev_attrs[] = { | |||
211 | &dev_attr_bDeviceSubClass.attr, | 212 | &dev_attr_bDeviceSubClass.attr, |
212 | &dev_attr_bDeviceProtocol.attr, | 213 | &dev_attr_bDeviceProtocol.attr, |
213 | &dev_attr_bNumConfigurations.attr, | 214 | &dev_attr_bNumConfigurations.attr, |
215 | &dev_attr_bMaxPacketSize0.attr, | ||
214 | &dev_attr_speed.attr, | 216 | &dev_attr_speed.attr, |
215 | &dev_attr_devnum.attr, | 217 | &dev_attr_devnum.attr, |
216 | &dev_attr_version.attr, | 218 | &dev_attr_version.attr, |
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 0faf18d511de..c0feee25ff0a 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -60,7 +60,7 @@ void usb_init_urb(struct urb *urb) | |||
60 | * | 60 | * |
61 | * The driver must call usb_free_urb() when it is finished with the urb. | 61 | * The driver must call usb_free_urb() when it is finished with the urb. |
62 | */ | 62 | */ |
63 | struct urb *usb_alloc_urb(int iso_packets, int mem_flags) | 63 | struct urb *usb_alloc_urb(int iso_packets, unsigned mem_flags) |
64 | { | 64 | { |
65 | struct urb *urb; | 65 | struct urb *urb; |
66 | 66 | ||
@@ -224,7 +224,7 @@ struct urb * usb_get_urb(struct urb *urb) | |||
224 | * GFP_NOIO, unless b) or c) apply | 224 | * GFP_NOIO, unless b) or c) apply |
225 | * | 225 | * |
226 | */ | 226 | */ |
227 | int usb_submit_urb(struct urb *urb, int mem_flags) | 227 | int usb_submit_urb(struct urb *urb, unsigned mem_flags) |
228 | { | 228 | { |
229 | int pipe, temp, max; | 229 | int pipe, temp, max; |
230 | struct usb_device *dev; | 230 | struct usb_device *dev; |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index a3c42203213a..99c85d2f92da 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -1129,7 +1129,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size, | |||
1129 | void *usb_buffer_alloc ( | 1129 | void *usb_buffer_alloc ( |
1130 | struct usb_device *dev, | 1130 | struct usb_device *dev, |
1131 | size_t size, | 1131 | size_t size, |
1132 | int mem_flags, | 1132 | unsigned mem_flags, |
1133 | dma_addr_t *dma | 1133 | dma_addr_t *dma |
1134 | ) | 1134 | ) |
1135 | { | 1135 | { |
@@ -1532,6 +1532,9 @@ EXPORT_SYMBOL(usb_register); | |||
1532 | EXPORT_SYMBOL(usb_deregister); | 1532 | EXPORT_SYMBOL(usb_deregister); |
1533 | EXPORT_SYMBOL(usb_disabled); | 1533 | EXPORT_SYMBOL(usb_disabled); |
1534 | 1534 | ||
1535 | EXPORT_SYMBOL_GPL(usb_get_intf); | ||
1536 | EXPORT_SYMBOL_GPL(usb_put_intf); | ||
1537 | |||
1535 | EXPORT_SYMBOL(usb_alloc_dev); | 1538 | EXPORT_SYMBOL(usb_alloc_dev); |
1536 | EXPORT_SYMBOL(usb_put_dev); | 1539 | EXPORT_SYMBOL(usb_put_dev); |
1537 | EXPORT_SYMBOL(usb_get_dev); | 1540 | EXPORT_SYMBOL(usb_get_dev); |