aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-07 22:23:21 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-07 22:23:21 -0500
commitc96e2c92072d3e78954c961f53d8c7352f7abbd7 (patch)
treed844f26f926ff40e98e9eae0e11fd71acad81df4 /drivers/usb/core/hub.c
parentf2aca47dc3c2d0c2d5dbd972558557e74232bbce (diff)
parent64358164f5bfe5e11d4040c1eb674c29e1436ce5 (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: (70 commits) USB: remove duplicate device id from zc0301 USB: remove duplicate device id from usb_storage USB: remove duplicate device id from keyspan USB: remove duplicate device id from ftdi_sio USB: remove duplicate device id from visor USB: a bit more coding style cleanup usbcore: trivial whitespace fixes usb-storage: use first bulk endpoints, not last EHCI: fix interrupt-driven remote wakeup USB: switch ehci-hcd to new polling scheme USB: autosuspend for usb printer driver USB Input: Added kernel module to support all GTCO CalComp USB InterWrite School products USB: Sierra Wireless auto set D0 USB: usb ethernet gadget recognizes HUSB2DEV USB: list atmel husb2_udc gadget controller USB: gadgetfs AIO tweaks USB: gadgetfs behaves better on userspace init bug USB: gadgetfs race fix USB: gadgetfs simplifications USB: gadgetfs cleanups ...
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c64
1 files changed, 21 insertions, 43 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 1988224b362b..590ec82d0515 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -87,9 +87,6 @@ static DECLARE_WAIT_QUEUE_HEAD(khubd_wait);
87 87
88static struct task_struct *khubd_task; 88static struct task_struct *khubd_task;
89 89
90/* multithreaded probe logic */
91static int multithread_probe = 0;
92
93/* cycle leds on hubs that aren't blinking for attention */ 90/* cycle leds on hubs that aren't blinking for attention */
94static int blinkenlights = 0; 91static int blinkenlights = 0;
95module_param (blinkenlights, bool, S_IRUGO); 92module_param (blinkenlights, bool, S_IRUGO);
@@ -1256,9 +1253,28 @@ static inline void show_string(struct usb_device *udev, char *id, char *string)
1256static int __usb_port_suspend(struct usb_device *, int port1); 1253static int __usb_port_suspend(struct usb_device *, int port1);
1257#endif 1254#endif
1258 1255
1259static int __usb_new_device(void *void_data) 1256/**
1257 * usb_new_device - perform initial device setup (usbcore-internal)
1258 * @udev: newly addressed device (in ADDRESS state)
1259 *
1260 * This is called with devices which have been enumerated, but not yet
1261 * configured. The device descriptor is available, but not descriptors
1262 * for any device configuration. The caller must have locked either
1263 * the parent hub (if udev is a normal device) or else the
1264 * usb_bus_list_lock (if udev is a root hub). The parent's pointer to
1265 * udev has already been installed, but udev is not yet visible through
1266 * sysfs or other filesystem code.
1267 *
1268 * It will return if the device is configured properly or not. Zero if
1269 * the interface was registered with the driver core; else a negative
1270 * errno value.
1271 *
1272 * This call is synchronous, and may not be used in an interrupt context.
1273 *
1274 * Only the hub driver or root-hub registrar should ever call this.
1275 */
1276int usb_new_device(struct usb_device *udev)
1260{ 1277{
1261 struct usb_device *udev = void_data;
1262 int err; 1278 int err;
1263 1279
1264 /* Lock ourself into memory in order to keep a probe sequence 1280 /* Lock ourself into memory in order to keep a probe sequence
@@ -1375,44 +1391,6 @@ fail:
1375 goto exit; 1391 goto exit;
1376} 1392}
1377 1393
1378/**
1379 * usb_new_device - perform initial device setup (usbcore-internal)
1380 * @udev: newly addressed device (in ADDRESS state)
1381 *
1382 * This is called with devices which have been enumerated, but not yet
1383 * configured. The device descriptor is available, but not descriptors
1384 * for any device configuration. The caller must have locked either
1385 * the parent hub (if udev is a normal device) or else the
1386 * usb_bus_list_lock (if udev is a root hub). The parent's pointer to
1387 * udev has already been installed, but udev is not yet visible through
1388 * sysfs or other filesystem code.
1389 *
1390 * The return value for this function depends on if the
1391 * multithread_probe variable is set or not. If it's set, it will
1392 * return a if the probe thread was successfully created or not. If the
1393 * variable is not set, it will return if the device is configured
1394 * properly or not. interfaces, in sysfs); else a negative errno value.
1395 *
1396 * This call is synchronous, and may not be used in an interrupt context.
1397 *
1398 * Only the hub driver or root-hub registrar should ever call this.
1399 */
1400int usb_new_device(struct usb_device *udev)
1401{
1402 struct task_struct *probe_task;
1403 int ret = 0;
1404
1405 if (multithread_probe) {
1406 probe_task = kthread_run(__usb_new_device, udev,
1407 "usb-probe-%s", udev->devnum);
1408 if (IS_ERR(probe_task))
1409 ret = PTR_ERR(probe_task);
1410 } else
1411 ret = __usb_new_device(udev);
1412
1413 return ret;
1414}
1415
1416static int hub_port_status(struct usb_hub *hub, int port1, 1394static int hub_port_status(struct usb_hub *hub, int port1,
1417 u16 *status, u16 *change) 1395 u16 *status, u16 *change)
1418{ 1396{