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

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

?? hub.c

?? linux2.6.16版本
?? C
?? 第 1 頁 / 共 5 頁
字號:
	 * 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;		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);}EXPORT_SYMBOL(usb_set_device_state);#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;	u16 devstatus;	int bus_powered;	int num_configs;	struct usb_host_config *c, *best;	/* If this fails, assume the device is bus-powered */	devstatus = 0;	usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);	le16_to_cpus(&devstatus);	bus_powered = ((devstatus & (1 << USB_DEVICE_SELF_POWERED)) == 0);	dev_dbg(&udev->dev, "device is %s-powered\n",			bus_powered ? "bus" : "self");	best = NULL;	c = udev->config;	num_configs = udev->descriptor.bNumConfigurations;	for (i = 0; i < num_configs; (i++, c++)) {		struct usb_interface_descriptor	*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.		 */#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->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->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);	return 0;fail:	usb_set_device_state(udev, USB_STATE_NOTATTACHED);	return err;}static int hub_port_status(struct usb_hub *hub, int port1,			       u16 *status, u16 *change){	int ret;	ret = get_port_status(hub->hdev, port1, &hub->status->port);	if (ret < 0)		dev_err (hub->intfdev,			"%s failed (err = %d)\n", __FUNCTION__, ret);	else {		*status = le16_to_cpu(hub->status->port.wPortStatus);		*change = le16_to_cpu(hub->status->port.wPortChange); 		ret = 0;	}	return ret;}#define PORT_RESET_TRIES	5

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区在线观看| 日韩三级在线观看| 青青草精品视频| 国产精品国产三级国产普通话三级 | 国产大片一区二区| 性久久久久久久久| 中文字幕一区av| 久久一区二区三区国产精品| 欧美三级日韩三级国产三级| 99视频在线精品| 国产精品正在播放| 久久99热狠狠色一区二区| 一区二区在线看| 国产精品久久看| 精品国产乱码久久久久久久| 欧美日韩国产系列| 9i在线看片成人免费| 国产大陆精品国产| 精品一区二区三区视频在线观看| 亚洲动漫第一页| 亚洲精选在线视频| 成人欧美一区二区三区1314| 国产午夜精品美女毛片视频| 日韩免费观看高清完整版| 欧美日本在线观看| 欧美伊人久久久久久久久影院| 一本大道久久a久久综合| 成人aa视频在线观看| 成人一区二区在线观看| 国产成人av福利| 国产成人欧美日韩在线电影| 国内精品伊人久久久久av影院| 美女www一区二区| 久久精品久久久精品美女| 日韩精品一卡二卡三卡四卡无卡| 亚洲九九爱视频| 一区二区三区国产精品| 亚洲精品一卡二卡| 亚洲伦在线观看| 中文字幕综合网| 亚洲男人的天堂网| 亚洲日本免费电影| 亚洲最色的网站| 亚洲成av人片一区二区梦乃| 亚洲综合一区二区三区| 亚洲午夜在线电影| 五月激情综合婷婷| 日韩高清一区在线| 精品一区二区三区av| 狠狠色丁香婷婷综合| 国产精品白丝jk黑袜喷水| 国产成人精品免费网站| av一区二区三区四区| 91无套直看片红桃| 在线观看日产精品| 在线播放欧美女士性生活| 日韩一区二区在线免费观看| 26uuu成人网一区二区三区| 国产精品午夜久久| 亚洲精品国产一区二区精华液 | 亚洲欧洲日本在线| 亚洲精品国产a| 日韩中文字幕91| 精品无人码麻豆乱码1区2区| 国产盗摄一区二区| 色综合久久综合网97色综合| 欧美性视频一区二区三区| 日韩午夜电影av| 国产日韩欧美精品在线| 亚洲精品久久久蜜桃| 免费在线成人网| 国产精品2024| 欧美亚洲综合网| 精品99一区二区三区| 国产精品你懂的在线欣赏| 一区二区三区日韩欧美| 麻豆成人免费电影| www.亚洲人| 日韩欧美在线综合网| 国产精品色噜噜| 婷婷久久综合九色综合伊人色| 国产专区欧美精品| 在线观看亚洲成人| 国产三级久久久| 午夜久久电影网| 成人精品鲁一区一区二区| 欧美日韩在线三区| 久久精品一区二区三区不卡| 亚洲综合av网| 国产精品99精品久久免费| 欧美中文字幕一区| 国产人成一区二区三区影院| 午夜精品一区在线观看| 成人av免费在线| 欧美一区二区久久久| 亚洲男人电影天堂| 国产一区福利在线| 欧美日韩免费一区二区三区| 欧美国产综合色视频| 免费成人你懂的| 欧美在线播放高清精品| 久久久久久99精品| 日本中文一区二区三区| 色婷婷国产精品| 国产亚洲精品aa| 久色婷婷小香蕉久久| 欧美日韩精品免费| 国产精品久久久一区麻豆最新章节| 美日韩一区二区| 欧美日精品一区视频| 国产精品卡一卡二| 国产精品一区二区三区乱码| 日韩欧美精品在线| 日韩中文字幕不卡| 欧美亚洲国产怡红院影院| 中文字幕精品一区二区精品绿巨人| 卡一卡二国产精品| 欧美老女人第四色| 亚洲精品乱码久久久久久久久| 成人免费黄色在线| 国产日韩精品一区| 国产在线播放一区| 亚洲精品一区二区三区精华液| 日日夜夜精品视频免费| 91国在线观看| 一区二区三区四区激情| 色综合久久天天| 亚洲精品久久久久久国产精华液| 波波电影院一区二区三区| 国产女主播在线一区二区| 国产一区二区在线看| 亚洲精品在线观看视频| 男女激情视频一区| 欧美一区二区三区四区五区| 亚洲国产精品尤物yw在线观看| 91美女在线视频| 亚洲免费观看高清完整版在线观看| www.在线成人| 亚洲婷婷在线视频| 色综合久久久久综合体桃花网| 亚洲另类中文字| 在线观看视频一区二区欧美日韩| 一区二区在线免费观看| 欧美日韩在线三级| 天堂成人免费av电影一区| 欧美一区午夜精品| 麻豆精品新av中文字幕| 久久综合视频网| 国产成人av电影在线播放| 国产精品白丝在线| 色综合天天视频在线观看| 亚洲一二三四在线观看| 91麻豆精品国产自产在线观看一区| 日韩电影在线观看网站| 精品国产一区久久| 成人午夜精品在线| 亚洲精品国产精华液| 欧美剧情电影在线观看完整版免费励志电影 | 久久久三级国产网站| 国产a级毛片一区| 一区二区三区在线观看欧美| 欧美日韩国产中文| 激情成人综合网| 最新国产精品久久精品| 欧美日韩电影在线| 国产一区二区三区四| 亚洲激情中文1区| 日韩精品一区二区在线| 懂色av一区二区三区免费观看 | 亚洲最大的成人av| 欧美一级在线免费| 国产jizzjizz一区二区| 亚洲一区二区成人在线观看| 欧美一级日韩一级| 成人av在线一区二区三区| 亚洲国产日韩精品| 国产午夜一区二区三区| 欧美在线观看禁18| 国产酒店精品激情| 亚洲制服丝袜av| 26uuu另类欧美亚洲曰本| av爱爱亚洲一区| 久久超级碰视频| 亚洲在线视频免费观看| wwww国产精品欧美| 欧洲人成人精品| 国产精品综合一区二区三区| 亚洲已满18点击进入久久| 久久一区二区三区国产精品| 在线视频综合导航| 国产ts人妖一区二区| 人禽交欧美网站| 亚洲精品免费在线播放| 久久久久久久久97黄色工厂| 欧美精品乱码久久久久久按摩 | 欧美视频日韩视频在线观看| 国产成人自拍网| 日本美女一区二区三区| 自拍偷拍亚洲激情| 国产欧美综合在线观看第十页|