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

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

?? hub.c

?? Linux Kernel 2.6.9 for OMAP1710
?? C
?? 第 1 頁 / 共 5 頁
字號:
 * * Something got disconnected. Get rid of it, and all of its children. * If *pdev is a normal device then the parent hub should 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);	/* lock the bus list on behalf of HCDs unregistering their root hubs */	if (!udev->parent)		down(&usb_bus_list_lock);	down(&udev->serialize);	dev_info (&udev->dev, "USB disconnect, address %d\n", udev->devnum);	/* 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);	/* 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);	usbfs_remove_device(udev);	usb_remove_sysfs_dev_files(udev);	/* Avoid races with recursively_mark_NOTATTACHED() and locktree() */	spin_lock_irq(&device_state_lock);	*pdev = NULL;	spin_unlock_irq(&device_state_lock);	up(&udev->serialize);	if (!udev->parent)		up(&usb_bus_list_lock);	device_unregister(&udev->dev);}static int choose_configuration(struct usb_device *udev){	int c, i;	/* NOTE: this should interact with hub power budgeting */	c = udev->config[0].desc.bConfigurationValue;	if (udev->descriptor.bNumConfigurations != 1) {		for (i = 0; i < udev->descriptor.bNumConfigurations; i++) {			struct usb_interface_descriptor	*desc;			/* heuristic:  Linux is more likely to have class			 * drivers, so avoid vendor-specific interfaces.			 */			desc = &udev->config[i].intf_cache[0]					->altsetting->desc;			if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC)				continue;			/* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS */			if (desc->bInterfaceClass == USB_CLASS_COMM					&& desc->bInterfaceSubClass == 2					&& desc->bInterfaceProtocol == 0xff)				continue;			c = udev->config[i].desc.bConfigurationValue;			break;		}		dev_info(&udev->dev,			"configuration #%d chosen from %d choices\n",			c, udev->descriptor.bNumConfigurations);	}	return c;}#ifdef DEBUGstatic void show_string(struct usb_device *udev, char *id, int index){	char *buf;	if (!index)		return;	if (!(buf = kmalloc(256, GFP_KERNEL)))		return;	if (usb_string(udev, index, buf, 256) > 0)		dev_printk(KERN_INFO, &udev->dev, "%s: %s\n", id, buf);	kfree(buf);}#elsestatic inline void show_string(struct usb_device *udev, char *id, int index){}#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 udev and * 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 should ever call this; root hub registration * uses it indirectly. */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;	}	/* 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);	if (udev->descriptor.iProduct)		show_string(udev, "Product",				udev->descriptor.iProduct);	if (udev->descriptor.iManufacturer)		show_string(udev, "Manufacturer",				udev->descriptor.iManufacturer);	if (udev->descriptor.iSerialNumber)		show_string(udev, "SerialNumber",				udev->descriptor.iSerialNumber);#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],					udev->config[0].desc.wTotalLength,					USB_DT_OTG, (void **) &desc) == 0) {			if (desc->bmAttributes & USB_OTG_HNP) {				unsigned		port;				struct usb_device	*root = udev->parent;								for (port = 0; port < root->maxchild; port++) {					if (root->children[port] == udev)						break;				}				port++;				dev_info(&udev->dev,					"Dual-Role OTG device on %sHNP port\n",					(port == bus->otg_port)						? "" : "non-");				/* enable HNP before suspend, it's simpler */				if (port == 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, HZ * 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 port, u32 state);			err = __usb_suspend_device(udev,					udev->bus->otg_port - 1,					PM_SUSPEND_MEM);			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);	/* 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)		dev_warn(&udev->dev,				"can't choose an initial configuration\n");	else {		err = usb_set_configuration(udev, c);		if (err) {			dev_err(&udev->dev, "can't set config #%d, error %d\n",					c, err);			usb_remove_sysfs_dev_files(udev);			device_del(&udev->dev);			goto fail;		}	}	/* USB device state == configured ... usable */	/* add a /proc/bus/usb entry */	usbfs_add_device(udev);	return 0;fail:	usb_set_device_state(udev, USB_STATE_NOTATTACHED);	return err;}static int hub_port_status(struct usb_device *hdev, int port,			       u16 *status, u16 *change){	struct usb_hub *hub = usb_get_intfdata(hdev->actconfig->interface[0]);	int ret;	if (!hub)		return -ENODEV;	ret = get_port_status(hdev, port + 1, &hub->status->port);	if (ret < 0)		dev_err (&hub->intf->dev,			"%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#define SET_ADDRESS_TRIES	2#define GET_DESCRIPTOR_TRIES	2#define SET_CONFIG_TRIES	2#define HUB_ROOT_RESET_TIME	50	/* times are in msec */#define HUB_SHORT_RESET_TIME	10#define HUB_LONG_RESET_TIME	200#define HUB_RESET_TIMEOUT	500static int hub_port_wait_reset(struct usb_device *hdev, int port,				struct usb_device *udev, unsigned int delay){	int delay_time, ret;	u16 portstatus;	u16 portchange;	for (delay_time = 0;			delay_time < HUB_RESET_TIMEOUT;			delay_time += delay) {		/* wait to give the device a chance to reset */		msleep(delay);		/* read and decode port status */		ret = hub_port_status(hdev, port, &portstatus, &portchange);		if (ret < 0)			return ret;		/* Device went away? */		if (!(portstatus & USB_PORT_STAT_CONNECTION))			return -ENOTCONN;		/* bomb out completely if something weird happened */		if ((portchange & USB_PORT_STAT_C_CONNECTION))			return -EINVAL;		/* if we`ve finished resetting, then break out of the loop */		if (!(portstatus & USB_PORT_STAT_RESET) &&		    (portstatus & USB_PORT_STAT_ENABLE)) {			if (portstatus & USB_PORT_STAT_HIGH_SPEED)				udev->speed = USB_SPEED_HIGH;			else if (portstatus & USB_PORT_STAT_LOW_SPEED)				udev->speed = USB_SPEED_LOW;			else				udev->speed = USB_SPEED_FULL;			return 0;		}		/* switch to the long delay after two short delay failures */		if (delay_time >= 2 * HUB_SHORT_RESET_TIME)			delay = HUB_LONG_RESET_TIME;		dev_dbg (hubdev (hdev),			"port %d not reset yet, waiting %dms\n",			port + 1, delay);	}	return -EBUSY;}static int hub_port_reset(struct usb_device *hdev, int port,				struct usb_device *udev, unsigned int delay){	int i, status;	struct device *hub_dev = hubdev (hdev);	/* Reset the port */	for (i = 0; i < PORT_RESET_TRIES; i++) {		status = set_port_feature(hdev, port + 1, USB_PORT_FEAT_RESET);		if (status)			dev_err(hub_dev, "cannot reset port %d (err = %d)\n",					port + 1, status);		else			status = hub_port_wait_reset(hdev, port, udev, delay);		/* return on disconnect or reset */		if (status == -ENOTCONN || status == 0) {			clear_port_feature(hdev,				port + 1, USB_PORT_FEAT_C_RESET);			/* FIXME need disconnect() for NOTATTACHED device */			usb_set_device_state(udev, status					? USB_STATE_NOTATTACHED					: USB_STATE_DEFAULT);			return status;		}		dev_dbg (hub_dev,			"port %d not enabled, trying reset again...\n",			port + 1);		delay = HUB_LONG_RESET_TIME;	}	dev_err (hub_dev,		"Cannot enable port %i.  Maybe the USB cable is bad?\n",		port + 1);	return status;}static int hub_port_disable(struct usb_device *hdev, int port){	int ret;	if (hdev->children[port]) {		/* FIXME need disconnect() for NOTATTACHED device */		usb_set_device_state(hdev->children[port],				USB_STATE_NOTATTACHED);	}	ret = clear_port_feature(hdev, port + 1, USB_PORT_FEAT_ENABLE);	if (ret)		dev_err(hubdev(hdev), "cannot disable port %d (err = %d)\n",			port + 1, ret);	return ret;}#ifdef	CONFIG_USB_SUSPEND/* * Selective port suspend reduces power; most suspended devices draw * less than 500 uA.  It's also used in OTG, along with remote wakeup. * All devices below the suspended port are also suspended. * * Devices leave suspend state when the host wakes them up.  Some devices * also support "remote wakeup", where the device can activate the USB * tree above them to deliver data, such as a keypress or packet.  In * some cases, this wakes the USB host. */static int hub_port_suspend(struct usb_device *hdev, int port){	int			status;	struct usb_device	*udev;	udev = hdev->children[port - 1];	// dev_dbg(hubdev(hdev), "suspend port %d\n", port);	/* enable remote wakeup when appropriate; this lets the device	 * wake up the upstream hub (including maybe the root hub).	 *	 * NOTE:  OTG devices may issue remote wakeup (or SRP) even when	 * we don't explicitly enable it here.	 */	if (udev->actconfig			// && FIXME (remote wakeup enabled on this bus)			// ... currently assuming it's always appropriate			&& (udev->actconfig->desc.bmAttributes				& USB_CONFIG_ATT_WAKEUP) != 0) {		status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),				USB_REQ_SET_FEATURE, USB_RECIP_DEVICE,				USB_DEVICE_REMOTE_WAKEUP, 0,				NULL, 0,				USB_CTRL_SET_TIMEOUT);		if (status)			dev_dbg(&udev->dev,				"won't remote wakeup, status %d\n",				status);	}	/* see 7.1.7.6 */	status = set_port_feature(hdev, port, USB_PORT_FEAT_SUSPEND);	if (status) {		dev_dbg(hubdev(hdev),			"can't suspend port %d, status %d\n",			port, status);		/* paranoia:  "should not happen" */		(void) usb_control_msg(udev, usb_sndctrlpipe(udev, 0),				USB_REQ_CLEAR_FEATURE, USB_RECIP_DEVICE,				USB_DEVICE_REMOTE_WAKEUP, 0,				NULL, 0,				USB_CTRL_SET_TIMEOUT);	} else {		/* device has up to 10 msec to fully suspend */		dev_dbg(&udev->dev, "usb suspend\n");		udev->state = USB_STATE_SUSPENDED;		msleep(10);	}	return status;}/* * Devices on USB hub ports have only one "suspend" state, corresponding * to ACPI D2 (PM_SUSPEND_MEM), "may cause the device to lose some context". * State transitions include: * *   - suspend, resume ... when the VBUS power link stays live

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人精品二区三区99精品| 另类人妖一区二区av| 成人深夜在线观看| 久久久综合激的五月天| 国产精品影视在线| 国产精品传媒视频| 91麻豆swag| 亚洲午夜视频在线| 在线综合亚洲欧美在线视频| 男人的天堂久久精品| 欧美精品一区二区在线观看| 国产精品99久久久久久宅男| 国产精品入口麻豆九色| 91丨九色porny丨蝌蚪| 亚洲精品视频在线观看免费| 欧美美女喷水视频| 日本欧美在线看| 久久久久一区二区三区四区| aaa亚洲精品| 偷窥国产亚洲免费视频| 精品欧美一区二区在线观看| 国产91精品免费| 成人免费在线观看入口| 欧美日本一区二区在线观看| 精品无人区卡一卡二卡三乱码免费卡| 国产人成亚洲第一网站在线播放 | 成人深夜福利app| 亚洲激情网站免费观看| 日韩亚洲欧美一区二区三区| 国产精品一区在线观看你懂的| 中文字幕一区二区三区不卡| 欧美酷刑日本凌虐凌虐| 高清不卡在线观看| 亚洲成精国产精品女| 国产日韩欧美电影| 欧美日韩国产综合一区二区| 国产一区二区91| 一区二区三区精品在线观看| 2021久久国产精品不只是精品| 成人网在线免费视频| 国产精品理论在线观看| 在线国产亚洲欧美| 国产乱妇无码大片在线观看| 亚洲va在线va天堂| 成人深夜福利app| 国产片一区二区三区| 欧美日韩国产片| 成人午夜电影网站| 奇米一区二区三区| 亚洲精品亚洲人成人网| 国产亚洲精久久久久久| 欧美一区二区三区四区五区| 成人黄色软件下载| 韩国三级在线一区| 亚洲成人av一区二区| 中文字幕一区二区三区视频| 26uuu欧美| 欧美福利电影网| 91福利精品视频| 不卡大黄网站免费看| 国产精品白丝jk白祙喷水网站| 日本不卡123| 午夜一区二区三区视频| 亚洲女女做受ⅹxx高潮| 国产精品毛片无遮挡高清| 久久综合色8888| 欧美一三区三区四区免费在线看| 欧洲亚洲国产日韩| 91蝌蚪porny九色| 成人av在线网站| 国产成人免费网站| 国产成人在线视频网址| 国产乱理伦片在线观看夜一区| 久久电影网站中文字幕| 麻豆91精品视频| 日本成人在线电影网| 三级在线观看一区二区| 亚洲aaa精品| 日本一区中文字幕| 日本少妇一区二区| 捆绑调教一区二区三区| 久久精品国产999大香线蕉| 日本欧美久久久久免费播放网| 国产精品视频一区二区三区不卡| 久久久精品天堂| 久久久天堂av| 国产女主播一区| 中文字幕一区av| 国产精品久久精品日日| 国产精品久久久久久久久久久免费看| 欧美激情在线一区二区| 亚洲国产成人私人影院tom| 中文字幕不卡在线| 国产aⅴ综合色| 美腿丝袜亚洲一区| 狠狠色综合播放一区二区| 国产精品99久久久久久久女警| 东方aⅴ免费观看久久av| 92精品国产成人观看免费| 色婷婷精品久久二区二区蜜臂av| 91精品办公室少妇高潮对白| 色综合久久久久综合体| 欧美精品三级在线观看| 欧美mv和日韩mv的网站| 国产欧美一二三区| 亚洲免费高清视频在线| 日韩精品一级中文字幕精品视频免费观看 | 国产一区二区三区综合| 国产成人免费视频一区| 91捆绑美女网站| 欧美精品 国产精品| 日韩免费观看高清完整版在线观看| 精品国产伦一区二区三区观看体验 | 一本大道综合伊人精品热热| 欧美日韩综合在线免费观看| 日韩欧美国产精品一区| 国产精品无码永久免费888| 亚洲美女屁股眼交| 麻豆精品视频在线| k8久久久一区二区三区| 9191精品国产综合久久久久久| 久久久久免费观看| 夜夜嗨av一区二区三区网页| 激情五月婷婷综合| 色婷婷国产精品综合在线观看| 日韩手机在线导航| 国产精品国产自产拍高清av王其 | 亚洲午夜精品网| 精品一区二区三区在线观看| yourporn久久国产精品| 日韩欧美一级片| 亚洲日本在线看| 极品少妇xxxx精品少妇| 在线精品国精品国产尤物884a| 久久久久一区二区三区四区| 亚洲成a人片综合在线| 成人综合婷婷国产精品久久免费| 欧美日韩国产成人在线91| 亚洲图片激情小说| 韩国v欧美v亚洲v日本v| 欧美精选在线播放| 亚洲欧美国产77777| 国产福利一区在线观看| 日韩一区二区三| 一片黄亚洲嫩模| jiyouzz国产精品久久| 亚洲精品在线一区二区| 亚洲va国产va欧美va观看| 91在线视频18| 国产亚洲一区字幕| 精品亚洲免费视频| 日韩色在线观看| 亚洲国产中文字幕| 在线一区二区三区| 91视频com| 欧美三级电影在线看| 中文字幕制服丝袜成人av| 国产美女av一区二区三区| 欧美一级国产精品| 香蕉成人伊视频在线观看| 在线看日本不卡| 亚洲精品免费在线观看| 99久久婷婷国产| 中文字幕av一区二区三区免费看 | 国产乱国产乱300精品| 日韩欧美国产不卡| 日本欧美韩国一区三区| 9191成人精品久久| 日韩av成人高清| 91精品欧美一区二区三区综合在 | 国产婷婷色一区二区三区在线| 美女网站在线免费欧美精品| 欧美高清性hdvideosex| 丝袜亚洲精品中文字幕一区| 欧美欧美欧美欧美首页| 天天色图综合网| 欧美一区二区三区四区视频| 久久爱www久久做| 精品国产免费人成在线观看| 国产福利一区二区三区视频在线| 国产视频在线观看一区二区三区| 国产福利一区二区| 国产精品每日更新在线播放网址| 91在线视频官网| 亚洲影院久久精品| 91精品婷婷国产综合久久性色 | 国产精品久久毛片av大全日韩| 成人免费观看男女羞羞视频| 国产精品国产自产拍在线| 欧美在线一区二区三区| 亚洲电影一级片| 欧美一区二区三区在线电影| 美国毛片一区二区| 国产亚洲欧洲997久久综合| av一本久道久久综合久久鬼色| 国产精品成人免费| 欧美日韩一区二区不卡| 精品一区二区三区免费播放 | 成人理论电影网| 亚洲精品videosex极品|