亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hub.c

?? usb driver for 2.6.17
?? C
?? 第 1 頁 / 共 5 頁
字號:
	if (t < 0)		return t;	/* everything is fail-fast once disconnect	 * processing starts	 */	if (udev->state == USB_STATE_NOTATTACHED) {		usb_unlock_device(hdev);		return -ENODEV;	}	/* when everyone grabs locks top->bottom,	 * non-overlapping work may be concurrent	 */	usb_lock_device(udev);	usb_unlock_device(hdev);	return udev->portnum;}static void recursively_mark_NOTATTACHED(struct usb_device *udev){	int i;	for (i = 0; i < udev->maxchild; ++i) {		if (udev->children[i])			recursively_mark_NOTATTACHED(udev->children[i]);	}	udev->state = USB_STATE_NOTATTACHED;}/** * usb_set_device_state - change a device's current state (usbcore, hcds) * @udev: pointer to device whose state should be changed * @new_state: new state value to be stored * * udev->state is _not_ fully protected by the device lock.  Although * most transitions are made only while holding the lock, the state can * can change to USB_STATE_NOTATTACHED at almost any time.  This * is so that devices can be marked as disconnected as soon as possible, * without having to wait for any semaphores to be released.  As a result, * all changes to any device's state must be protected by the * device_state_lock spinlock. * * Once a device has been added to the device tree, all changes to its state * should be made using this routine.  The state should _not_ be set directly. * * If udev->state is already USB_STATE_NOTATTACHED then no change is made. * Otherwise udev->state is set to new_state, and if new_state is * USB_STATE_NOTATTACHED then all of udev's descendants' states are also set * to USB_STATE_NOTATTACHED. */void usb_set_device_state(struct usb_device *udev,		enum usb_device_state new_state){	unsigned long flags;	spin_lock_irqsave(&device_state_lock, flags);	if (udev->state == USB_STATE_NOTATTACHED)		;	/* do nothing */	else if (new_state != USB_STATE_NOTATTACHED) {		udev->state = new_state;		/* root hub wakeup capabilities are managed out-of-band		 * and may involve silicon errata ... ignore them here.		 */		if (udev->parent) {			if (new_state == USB_STATE_CONFIGURED)				device_init_wakeup(&udev->dev,					(udev->actconfig->desc.bmAttributes					 & USB_CONFIG_ATT_WAKEUP));			else if (new_state != USB_STATE_SUSPENDED)				device_init_wakeup(&udev->dev, 0);		}	} else		recursively_mark_NOTATTACHED(udev);	spin_unlock_irqrestore(&device_state_lock, flags);}#ifdef CONFIG_PM/** * usb_root_hub_lost_power - called by HCD if the root hub lost Vbus power * @rhdev: struct usb_device for the root hub * * The USB host controller driver calls this function when its root hub * is resumed and Vbus power has been interrupted or the controller * has been reset.  The routine marks all the children of the root hub * as NOTATTACHED and marks logical connect-change events on their ports. */void usb_root_hub_lost_power(struct usb_device *rhdev){	struct usb_hub *hub;	int port1;	unsigned long flags;	dev_warn(&rhdev->dev, "root hub lost power or was reset\n");	spin_lock_irqsave(&device_state_lock, flags);	hub = hdev_to_hub(rhdev);	for (port1 = 1; port1 <= rhdev->maxchild; ++port1) {		if (rhdev->children[port1 - 1]) {			recursively_mark_NOTATTACHED(					rhdev->children[port1 - 1]);			set_bit(port1, hub->change_bits);		}	}	spin_unlock_irqrestore(&device_state_lock, flags);}EXPORT_SYMBOL_GPL(usb_root_hub_lost_power);#endifstatic void choose_address(struct usb_device *udev){	int		devnum;	struct usb_bus	*bus = udev->bus;	/* If khubd ever becomes multithreaded, this will need a lock */	/* Try to allocate the next devnum beginning at bus->devnum_next. */	devnum = find_next_zero_bit(bus->devmap.devicemap, 128,			bus->devnum_next);	if (devnum >= 128)		devnum = find_next_zero_bit(bus->devmap.devicemap, 128, 1);	bus->devnum_next = ( devnum >= 127 ? 1 : devnum + 1);	if (devnum < 128) {		set_bit(devnum, bus->devmap.devicemap);		udev->devnum = devnum;	}}static void release_address(struct usb_device *udev){	if (udev->devnum > 0) {		clear_bit(udev->devnum, udev->bus->devmap.devicemap);		udev->devnum = -1;	}}/** * usb_disconnect - disconnect a device (usbcore-internal) * @pdev: pointer to device being disconnected * Context: !in_interrupt () * * Something got disconnected. Get rid of it and all of its children. * * If *pdev is a normal device then the parent hub must already be locked. * If *pdev is a root hub then this routine will acquire the * usb_bus_list_lock on behalf of the caller. * * Only hub drivers (including virtual root hub drivers for host * controllers) should ever call this. * * This call is synchronous, and may not be used in an interrupt context. */void usb_disconnect(struct usb_device **pdev){	struct usb_device	*udev = *pdev;	int			i;	if (!udev) {		pr_debug ("%s nodev\n", __FUNCTION__);		return;	}	/* mark the device as inactive, so any further urb submissions for	 * this device (and any of its children) will fail immediately.	 * this quiesces everyting except pending urbs.	 */	usb_set_device_state(udev, USB_STATE_NOTATTACHED);	dev_info (&udev->dev, "USB disconnect, address %d\n", udev->devnum);	usb_lock_device(udev);	/* Free up all the children before we remove this device */	for (i = 0; i < USB_MAXCHILDREN; i++) {		if (udev->children[i])			usb_disconnect(&udev->children[i]);	}	/* deallocate hcd/hardware state ... nuking all pending urbs and	 * cleaning up all state associated with the current configuration	 * so that the hardware is now fully quiesced.	 */	usb_disable_device(udev, 0);	usb_notify_remove_device(udev);	/* Free the device number, remove the /proc/bus/usb entry and	 * the sysfs attributes, and delete the parent's children[]	 * (or root_hub) pointer.	 */	dev_dbg (&udev->dev, "unregistering device\n");	release_address(udev);	usb_remove_sysfs_dev_files(udev);	/* Avoid races with recursively_mark_NOTATTACHED() */	spin_lock_irq(&device_state_lock);	*pdev = NULL;	spin_unlock_irq(&device_state_lock);	usb_unlock_device(udev);	device_unregister(&udev->dev);}static inline const char *plural(int n){	return (n == 1 ? "" : "s");}static int choose_configuration(struct usb_device *udev){	int i;	int num_configs;	struct usb_host_config *c, *best;	best = NULL;	c = udev->config;	num_configs = udev->descriptor.bNumConfigurations;	for (i = 0; i < num_configs; (i++, c++)) {		struct usb_interface_descriptor	*desc = NULL;		/* It's possible that a config has no interfaces! */		if (c->desc.bNumInterfaces > 0)			desc = &c->intf_cache[0]->altsetting->desc;		/*		 * HP's USB bus-powered keyboard has only one configuration		 * and it claims to be self-powered; other devices may have		 * similar errors in their descriptors.  If the next test		 * were allowed to execute, such configurations would always		 * be rejected and the devices would not work as expected.		 * In the meantime, we run the risk of selecting a config		 * that requires external power at a time when that power		 * isn't available.  It seems to be the lesser of two evils.		 *		 * Bugzilla #6448 reports a device that appears to crash		 * when it receives a GET_DEVICE_STATUS request!  We don't		 * have any other way to tell whether a device is self-powered,		 * but since we don't use that information anywhere but here,		 * the call has been removed.		 *		 * Maybe the GET_DEVICE_STATUS call and the test below can		 * be reinstated when device firmwares become more reliable.		 * Don't hold your breath.		 */#if 0		/* Rule out self-powered configs for a bus-powered device */		if (bus_powered && (c->desc.bmAttributes &					USB_CONFIG_ATT_SELFPOWER))			continue;#endif		/*		 * The next test may not be as effective as it should be.		 * Some hubs have errors in their descriptor, claiming		 * to be self-powered when they are really bus-powered.		 * We will overestimate the amount of current such hubs		 * make available for each port.		 *		 * This is a fairly benign sort of failure.  It won't		 * cause us to reject configurations that we should have		 * accepted.		 */		/* Rule out configs that draw too much bus current */		if (c->desc.bMaxPower * 2 > udev->bus_mA)			continue;		/* If the first config's first interface is COMM/2/0xff		 * (MSFT RNDIS), rule it out unless Linux has host-side		 * RNDIS support. */		if (i == 0 && desc				&& desc->bInterfaceClass == USB_CLASS_COMM				&& desc->bInterfaceSubClass == 2				&& desc->bInterfaceProtocol == 0xff) {#ifndef CONFIG_USB_NET_RNDIS			continue;#else			best = c;#endif		}		/* From the remaining configs, choose the first one whose		 * first interface is for a non-vendor-specific class.		 * Reason: Linux is more likely to have a class driver		 * than a vendor-specific driver. */		else if (udev->descriptor.bDeviceClass !=						USB_CLASS_VENDOR_SPEC &&				(!desc || desc->bInterfaceClass !=						USB_CLASS_VENDOR_SPEC)) {			best = c;			break;		}		/* If all the remaining configs are vendor-specific,		 * choose the first one. */		else if (!best)			best = c;	}	if (best) {		i = best->desc.bConfigurationValue;		dev_info(&udev->dev,			"configuration #%d chosen from %d choice%s\n",			i, num_configs, plural(num_configs));	} else {		i = -1;		dev_warn(&udev->dev,			"no configuration chosen from %d choice%s\n",			num_configs, plural(num_configs));	}	return i;}#ifdef DEBUGstatic void show_string(struct usb_device *udev, char *id, char *string){	if (!string)		return;	dev_printk(KERN_INFO, &udev->dev, "%s: %s\n", id, string);}#elsestatic inline void show_string(struct usb_device *udev, char *id, char *string){}#endif#ifdef	CONFIG_USB_OTG#include "otg_whitelist.h"#endif/** * usb_new_device - perform initial device setup (usbcore-internal) * @udev: newly addressed device (in ADDRESS state) * * This is called with devices which have been enumerated, but not yet * configured.  The device descriptor is available, but not descriptors * for any device configuration.  The caller must have locked either * the parent hub (if udev is a normal device) or else the * usb_bus_list_lock (if udev is a root hub).  The parent's pointer to * udev has already been installed, but udev is not yet visible through * sysfs or other filesystem code. * * Returns 0 for success (device is configured and listed, with its * interfaces, in sysfs); else a negative errno value. * * This call is synchronous, and may not be used in an interrupt context. * * Only the hub driver or root-hub registrar should ever call this. */int usb_new_device(struct usb_device *udev){	int err;	int c;	err = usb_get_configuration(udev);	if (err < 0) {		dev_err(&udev->dev, "can't read configurations, error %d\n",			err);		goto fail;	}	/* read the standard strings and cache them if present */	udev->product = usb_cache_string(udev, udev->descriptor.iProduct);	udev->manufacturer = usb_cache_string(udev,			udev->descriptor.iManufacturer);	udev->serial = usb_cache_string(udev, udev->descriptor.iSerialNumber);	/* Tell the world! */	dev_dbg(&udev->dev, "new device strings: Mfr=%d, Product=%d, "			"SerialNumber=%d\n",			udev->descriptor.iManufacturer,			udev->descriptor.iProduct,			udev->descriptor.iSerialNumber);	show_string(udev, "Product", udev->product);	show_string(udev, "Manufacturer", udev->manufacturer);	show_string(udev, "SerialNumber", udev->serial);#ifdef	CONFIG_USB_OTG	/*	 * OTG-aware devices on OTG-capable root hubs may be able to use SRP,	 * to wake us after we've powered off VBUS; and HNP, switching roles	 * "host" to "peripheral".  The OTG descriptor helps figure this out.	 */	if (!udev->bus->is_b_host			&& udev->config			&& udev->parent == udev->bus->root_hub) {		struct usb_otg_descriptor	*desc = 0;		struct usb_bus			*bus = udev->bus;		/* descriptor may appear anywhere in config */		if (__usb_get_extra_descriptor (udev->rawdescriptors[0],					le16_to_cpu(udev->config[0].desc.wTotalLength),					USB_DT_OTG, (void **) &desc) == 0) {			if (desc->bmAttributes & USB_OTG_HNP) {				unsigned		port1 = udev->portnum;				struct usb_device	*root = udev->parent;								dev_info(&udev->dev,					"Dual-Role OTG device on %sHNP port\n",					(port1 == bus->otg_port)						? "" : "non-");				/* enable HNP before suspend, it's simpler */				if (port1 == bus->otg_port)					bus->b_hnp_enable = 1;				err = usb_control_msg(udev,					usb_sndctrlpipe(udev, 0),					USB_REQ_SET_FEATURE, 0,					bus->b_hnp_enable						? USB_DEVICE_B_HNP_ENABLE						: USB_DEVICE_A_ALT_HNP_SUPPORT,					0, NULL, 0, USB_CTRL_SET_TIMEOUT);				if (err < 0) {					/* OTG MESSAGE: report errors here,					 * customize to match your product.					 */					dev_info(&udev->dev,						"can't set HNP mode; %d\n",						err);					bus->b_hnp_enable = 0;				}			}		}	}	if (!is_targeted(udev)) {		/* Maybe it can talk to us, though we can't talk to it.		 * (Includes HNP test device.)		 */		if (udev->bus->b_hnp_enable || udev->bus->is_b_host) {			static int __usb_suspend_device(struct usb_device *,						int port1);			err = __usb_suspend_device(udev, udev->bus->otg_port);			if (err < 0)				dev_dbg(&udev->dev, "HNP fail, %d\n", err);		}		err = -ENODEV;		goto fail;	}#endif	/* put device-specific files into sysfs */	err = device_add (&udev->dev);	if (err) {		dev_err(&udev->dev, "can't device_add, error %d\n", err);		goto fail;	}	usb_create_sysfs_dev_files (udev);	usb_lock_device(udev);	/* choose and set the configuration. that registers the interfaces	 * with the driver core, and lets usb device drivers bind to them.	 */	c = choose_configuration(udev);	if (c >= 0) {		err = usb_set_configuration(udev, c);		if (err) {			dev_err(&udev->dev, "can't set config #%d, error %d\n",					c, err);			/* This need not be fatal.  The user can try to			 * set other configurations. */		}	}	/* USB device state == configured ... usable */	usb_notify_add_device(udev);	usb_unlock_device(udev);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩高清不卡在线| 亚洲欧美国产高清| 欧美v日韩v国产v| 欧美一区国产二区| 精品久久久久久久人人人人传媒| 欧美日本视频在线| 欧美一区二区三区思思人| 99久久777色| 色素色在线综合| 欧美日韩国产首页| 久久人人爽人人爽| 国产精品午夜春色av| 亚洲美女在线国产| 麻豆成人91精品二区三区| 国产精品一区久久久久| 色94色欧美sute亚洲线路二| 欧美日韩一级片网站| 国产亚洲欧美一级| 亚洲精品乱码久久久久久久久 | 91在线视频网址| 国产成人av电影在线播放| 欧美在线免费观看亚洲| 久久免费美女视频| 亚洲第一会所有码转帖| 国产成人福利片| 欧美一区在线视频| 自拍偷自拍亚洲精品播放| 精品一区二区三区在线播放| 在线观看国产一区二区| 久久久99精品免费观看不卡| 午夜精品一区在线观看| 成人国产在线观看| 欧美精品一区二区三| 亚洲电影第三页| 欧美亚洲一区二区在线| 国产精品污网站| 成人在线一区二区三区| 精品国产免费一区二区三区四区| 99精品国产视频| 欧美成人综合网站| 偷拍自拍另类欧美| 欧美色涩在线第一页| 亚洲久草在线视频| 国产在线精品一区二区不卡了| 国产精品成人在线观看| 国产剧情在线观看一区二区| 欧美日韩视频在线第一区 | 亚洲国产精品久久人人爱蜜臀 | 日韩一区二区免费在线观看| 综合婷婷亚洲小说| 丰满少妇久久久久久久| 久久久精品蜜桃| 国产成人一区二区精品非洲| 精品av久久707| 日本午夜一本久久久综合| 国产精品99久久久久久有的能看| 久久伊99综合婷婷久久伊| 久久嫩草精品久久久精品| 国产精品美女久久久久久久网站| 成人av手机在线观看| 国产欧美一区二区在线观看| 粉嫩av一区二区三区在线播放 | 伊人婷婷欧美激情| 久久精品国产99国产| 精品黑人一区二区三区久久 | 色婷婷国产精品| 国产精品美女www爽爽爽| 在线亚洲免费视频| 免费人成黄页网站在线一区二区| 亚洲人成网站在线| 成人av网址在线| 丝袜亚洲另类丝袜在线| 精品理论电影在线| 91最新地址在线播放| 无码av免费一区二区三区试看 | 91国产成人在线| 中文字幕久久午夜不卡| 欧美高清视频不卡网| 国产精品996| 亚洲成人黄色影院| 国产精品网站在线| 欧美大片在线观看一区| 一本大道久久a久久综合| 国产九九视频一区二区三区| 亚洲一区二区三区激情| 麻豆精品新av中文字幕| 久久久精品tv| 亚洲国产成人午夜在线一区| 日韩欧美激情一区| 人人狠狠综合久久亚洲| 中文字幕精品三区| 奇米777欧美一区二区| 色琪琪一区二区三区亚洲区| 精品无人区卡一卡二卡三乱码免费卡 | 久久综合狠狠综合久久激情| 国产在线不卡视频| 国精产品一区一区三区mba视频| 91成人免费电影| 99re这里只有精品首页| 成人午夜视频网站| 成人av网站在线观看| 成人av资源站| 国产盗摄女厕一区二区三区| 国产一区二区福利视频| 国产成人精品午夜视频免费| 成人精品视频网站| 91国偷自产一区二区三区成为亚洲经典 | 日一区二区三区| 香蕉加勒比综合久久| 免费看日韩精品| 一区二区三区在线影院| 一区二区三区成人| 青青青爽久久午夜综合久久午夜| 精品福利一区二区三区| 国产亚洲精品中文字幕| 国产精品色呦呦| 亚洲综合久久av| 国内精品第一页| 91国产精品成人| 欧美区在线观看| 国产精品国产a| 日韩激情中文字幕| 成人美女在线视频| 欧美一级二级三级蜜桃| 亚洲欧美自拍偷拍| 狠狠狠色丁香婷婷综合激情 | 在线综合亚洲欧美在线视频| 精品国产亚洲在线| 日韩高清中文字幕一区| av在线播放一区二区三区| 日韩三级视频在线看| 中文字幕中文字幕一区| 亚洲超丰满肉感bbw| 一本久久a久久精品亚洲| 国产精品国产三级国产a| 秋霞午夜av一区二区三区| 91麻豆福利精品推荐| 亚洲国产高清aⅴ视频| 青青草伊人久久| 欧美一区二区三区精品| 亚洲午夜久久久久中文字幕久| 一区二区三区国产豹纹内裤在线 | 欧美日韩一级片在线观看| 国产精品久久久久久久久搜平片| 欧美精品一区视频| 韩国毛片一区二区三区| 欧美变态tickle挠乳网站| 国产在线视频一区二区三区| 久久久国产一区二区三区四区小说| 欧美一区二区女人| 美女视频一区在线观看| 欧美videos大乳护士334| 蜜臀av一区二区| 久久婷婷成人综合色| 91成人在线精品| 国内一区二区在线| 亚洲综合精品久久| 欧美极品aⅴ影院| 91精品在线一区二区| 色天天综合久久久久综合片| 精油按摩中文字幕久久| 五月婷婷久久综合| 亚洲激情自拍偷拍| 国产精品女同一区二区三区| 日韩免费观看高清完整版| 在线一区二区三区四区五区| 国产精品1区二区.| 韩国av一区二区三区| 午夜精彩视频在线观看不卡| 亚洲三级免费观看| 亚洲美女一区二区三区| 亚洲色图一区二区三区| 国产精品女上位| 国产精品五月天| 日韩伦理免费电影| 中文字幕亚洲视频| 亚洲欧洲三级电影| 亚洲精品国产视频| 一区二区三区在线播放| 亚洲女与黑人做爰| 亚洲一区二区高清| 日本一不卡视频| 韩国av一区二区三区四区| 国产大片一区二区| 成人毛片在线观看| 欧美在线小视频| 3d动漫精品啪啪一区二区竹菊| 极品美女销魂一区二区三区| 经典三级在线一区| 99久免费精品视频在线观看| 91免费观看在线| 91麻豆精品国产91久久久久久| 日本欧美一区二区在线观看| 国产麻豆91精品| 欧美性欧美巨大黑白大战| 日韩一区二区三区四区| 国产精品天天摸av网| 爽好多水快深点欧美视频| 国产精品99久久久久久久vr| 欧美亚洲日本国产|