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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ehci-hub.c

?? host usb 主設(shè)備程序 支持sd卡 mouse keyboard 的最單單的驅(qū)動(dòng)程序 gcc編譯
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (C) 2001-2004 by David Brownell * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *//* this file is part of ehci-hcd.c *//*-------------------------------------------------------------------------*//* * EHCI Root Hub ... the nonsharable stuff * * Registers don't need cpu_to_le32, that happens transparently *//*-------------------------------------------------------------------------*/#ifdef	CONFIG_PMstatic int ehci_bus_suspend (struct usb_hcd *hcd){	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);	int			port;	int			mask;	ehci_dbg(ehci, "suspend root hub\n");	if (time_before (jiffies, ehci->next_statechange))		msleep(5);	port = HCS_N_PORTS (ehci->hcs_params);	spin_lock_irq (&ehci->lock);	/* stop schedules, clean any completed work */	if (HC_IS_RUNNING(hcd->state)) {		ehci_quiesce (ehci);		hcd->state = HC_STATE_QUIESCING;	}	ehci->command = ehci_readl(ehci, &ehci->regs->command);	if (ehci->reclaim)		ehci->reclaim_ready = 1;	ehci_work(ehci);	/* Unlike other USB host controller types, EHCI doesn't have	 * any notion of "global" or bus-wide suspend.  The driver has	 * to manually suspend all the active unsuspended ports, and	 * then manually resume them in the bus_resume() routine.	 */	ehci->bus_suspended = 0;	while (port--) {		u32 __iomem	*reg = &ehci->regs->port_status [port];		u32		t1 = ehci_readl(ehci, reg) & ~PORT_RWC_BITS;		u32		t2 = t1;		/* keep track of which ports we suspend */		if ((t1 & PORT_PE) && !(t1 & PORT_OWNER) &&				!(t1 & PORT_SUSPEND)) {			t2 |= PORT_SUSPEND;			set_bit(port, &ehci->bus_suspended);		}		/* enable remote wakeup on all ports */		if (device_may_wakeup(&hcd->self.root_hub->dev))			t2 |= PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E;		else			t2 &= ~(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E);		if (t1 != t2) {			ehci_vdbg (ehci, "port %d, %08x -> %08x\n",				port + 1, t1, t2);			ehci_writel(ehci, t2, reg);		}	}	/* turn off now-idle HC */	del_timer_sync (&ehci->watchdog);	ehci_halt (ehci);	hcd->state = HC_STATE_SUSPENDED;	/* allow remote wakeup */	mask = INTR_MASK;	if (!device_may_wakeup(&hcd->self.root_hub->dev))		mask &= ~STS_PCD;	ehci_writel(ehci, mask, &ehci->regs->intr_enable);	ehci_readl(ehci, &ehci->regs->intr_enable);	ehci->next_statechange = jiffies + msecs_to_jiffies(10);	spin_unlock_irq (&ehci->lock);	return 0;}/* caller has locked the root hub, and should reset/reinit on error */static int ehci_bus_resume (struct usb_hcd *hcd){	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);	u32			temp;	int			i;	if (time_before (jiffies, ehci->next_statechange))		msleep(5);	spin_lock_irq (&ehci->lock);	/* Ideally and we've got a real resume here, and no port's power	 * was lost.  (For PCI, that means Vaux was maintained.)  But we	 * could instead be restoring a swsusp snapshot -- so that BIOS was	 * the last user of the controller, not reset/pm hardware keeping	 * state we gave to it.	 */	temp = ehci_readl(ehci, &ehci->regs->intr_enable);	ehci_dbg(ehci, "resume root hub%s\n", temp ? "" : " after power loss");	/* at least some APM implementations will try to deliver	 * IRQs right away, so delay them until we're ready.	 */	ehci_writel(ehci, 0, &ehci->regs->intr_enable);	/* re-init operational registers */	ehci_writel(ehci, 0, &ehci->regs->segment);	ehci_writel(ehci, ehci->periodic_dma, &ehci->regs->frame_list);	ehci_writel(ehci, (u32) ehci->async->qh_dma, &ehci->regs->async_next);	/* restore CMD_RUN, framelist size, and irq threshold */	ehci_writel(ehci, ehci->command, &ehci->regs->command);	/* manually resume the ports we suspended during bus_suspend() */	i = HCS_N_PORTS (ehci->hcs_params);	while (i--) {		temp = ehci_readl(ehci, &ehci->regs->port_status [i]);		temp &= ~(PORT_RWC_BITS			| PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E);		if (test_bit(i, &ehci->bus_suspended) &&				(temp & PORT_SUSPEND)) {			ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);			temp |= PORT_RESUME;		}		ehci_writel(ehci, temp, &ehci->regs->port_status [i]);	}	i = HCS_N_PORTS (ehci->hcs_params);	mdelay (20);	while (i--) {		temp = ehci_readl(ehci, &ehci->regs->port_status [i]);		if (test_bit(i, &ehci->bus_suspended) &&				(temp & PORT_SUSPEND)) {			temp &= ~(PORT_RWC_BITS | PORT_RESUME);			ehci_writel(ehci, temp, &ehci->regs->port_status [i]);			ehci_vdbg (ehci, "resumed port %d\n", i + 1);		}	}	(void) ehci_readl(ehci, &ehci->regs->command);	/* maybe re-activate the schedule(s) */	temp = 0;	if (ehci->async->qh_next.qh)		temp |= CMD_ASE;	if (ehci->periodic_sched)		temp |= CMD_PSE;	if (temp) {		ehci->command |= temp;		ehci_writel(ehci, ehci->command, &ehci->regs->command);	}	ehci->next_statechange = jiffies + msecs_to_jiffies(5);	hcd->state = HC_STATE_RUNNING;	/* Now we can safely re-enable irqs */	ehci_writel(ehci, INTR_MASK, &ehci->regs->intr_enable);	spin_unlock_irq (&ehci->lock);	return 0;}#else#define ehci_bus_suspend	NULL#define ehci_bus_resume		NULL#endif	/* CONFIG_PM *//*-------------------------------------------------------------------------*//* Display the ports dedicated to the companion controller */static ssize_t show_companion(struct class_device *class_dev, char *buf){	struct ehci_hcd		*ehci;	int			nports, index, n;	int			count = PAGE_SIZE;	char			*ptr = buf;	ehci = hcd_to_ehci(bus_to_hcd(class_get_devdata(class_dev)));	nports = HCS_N_PORTS(ehci->hcs_params);	for (index = 0; index < nports; ++index) {		if (test_bit(index, &ehci->companion_ports)) {			n = scnprintf(ptr, count, "%d\n", index + 1);			ptr += n;			count -= n;		}	}	return ptr - buf;}/* * Dedicate or undedicate a port to the companion controller. * Syntax is "[-]portnum", where a leading '-' sign means * return control of the port to the EHCI controller. */static ssize_t store_companion(struct class_device *class_dev,		const char *buf, size_t count){	struct ehci_hcd		*ehci;	int			portnum, new_owner, try;	u32 __iomem		*status_reg;	u32			port_status;	ehci = hcd_to_ehci(bus_to_hcd(class_get_devdata(class_dev)));	new_owner = PORT_OWNER;		/* Owned by companion */	if (sscanf(buf, "%d", &portnum) != 1)		return -EINVAL;	if (portnum < 0) {		portnum = - portnum;		new_owner = 0;		/* Owned by EHCI */	}	if (portnum <= 0 || portnum > HCS_N_PORTS(ehci->hcs_params))		return -ENOENT;	status_reg = &ehci->regs->port_status[--portnum];	if (new_owner)		set_bit(portnum, &ehci->companion_ports);	else		clear_bit(portnum, &ehci->companion_ports);	/*	 * The controller won't set the OWNER bit if the port is	 * enabled, so this loop will sometimes require at least two	 * iterations: one to disable the port and one to set OWNER.	 */	for (try = 4; try > 0; --try) {		spin_lock_irq(&ehci->lock);		port_status = ehci_readl(ehci, status_reg);		if ((port_status & PORT_OWNER) == new_owner				|| (port_status & (PORT_OWNER | PORT_CONNECT))					== 0)			try = 0;		else {			port_status ^= PORT_OWNER;			port_status &= ~(PORT_PE | PORT_RWC_BITS);			ehci_writel(ehci, port_status, status_reg);		}		spin_unlock_irq(&ehci->lock);		if (try > 1)			msleep(5);	}	return count;}static CLASS_DEVICE_ATTR(companion, 0644, show_companion, store_companion);static inline void create_companion_file(struct ehci_hcd *ehci){	int	i;	/* with integrated TT there is no companion! */	if (!ehci_is_TDI(ehci))		i = class_device_create_file(ehci_to_hcd(ehci)->self.class_dev,				&class_device_attr_companion);}static inline void remove_companion_file(struct ehci_hcd *ehci){	/* with integrated TT there is no companion! */	if (!ehci_is_TDI(ehci))		class_device_remove_file(ehci_to_hcd(ehci)->self.class_dev,				&class_device_attr_companion);}/*-------------------------------------------------------------------------*/static int check_reset_complete (	struct ehci_hcd	*ehci,	int		index,	u32 __iomem	*status_reg,	int		port_status) {	if (!(port_status & PORT_CONNECT)) {		ehci->reset_done [index] = 0;		return port_status;	}	/* if reset finished and it's still not enabled -- handoff */	if (!(port_status & PORT_PE)) {		/* with integrated TT, there's nobody to hand it to! */		if (ehci_is_TDI(ehci)) {			ehci_dbg (ehci,				"Failed to enable port %d on root hub TT\n",				index+1);			return port_status;		}		ehci_dbg (ehci, "port %d full speed --> companion\n",			index + 1);		// what happens if HCS_N_CC(params) == 0 ?		port_status |= PORT_OWNER;		port_status &= ~PORT_RWC_BITS;		ehci_writel(ehci, port_status, status_reg);	} else		ehci_dbg (ehci, "port %d high speed\n", index + 1);	return port_status;}/*-------------------------------------------------------------------------*//* build "status change" packet (one or two bytes) from HC registers */static intehci_hub_status_data (struct usb_hcd *hcd, char *buf){	struct ehci_hcd	*ehci = hcd_to_ehci (hcd);	u32		temp, status = 0;	u32		mask;	int		ports, i, retval = 1;	unsigned long	flags;	/* if !USB_SUSPEND, root hub timers won't get shut down ... */	if (!HC_IS_RUNNING(hcd->state))		return 0;	/* init status to no-changes */	buf [0] = 0;	ports = HCS_N_PORTS (ehci->hcs_params);	if (ports > 7) {		buf [1] = 0;		retval++;	}	/* Some boards (mostly VIA?) report bogus overcurrent indications,	 * causing massive log spam unless we completely ignore them.  It	 * may be relevant that VIA VT8235 controlers, where PORT_POWER is	 * always set, seem to clear PORT_OCC and PORT_CSC when writing to	 * PORT_POWER; that's surprising, but maybe within-spec.	 */	if (!ignore_oc)		mask = PORT_CSC | PORT_PEC | PORT_OCC;	else		mask = PORT_CSC | PORT_PEC;	// PORT_RESUME from hardware ~= PORT_STAT_C_SUSPEND	/* no hub change reports (bit 0) for now (power, ...) */	/* port N changes (bit N)? */	spin_lock_irqsave (&ehci->lock, flags);	for (i = 0; i < ports; i++) {		temp = ehci_readl(ehci, &ehci->regs->port_status [i]);		/*		 * Return status information even for ports with OWNER set.		 * Otherwise khubd wouldn't see the disconnect event when a		 * high-speed device is switched over to the companion		 * controller by the user.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91免费版在线| 欧美一级日韩免费不卡| 视频一区二区国产| 国产三级欧美三级日产三级99| 北岛玲一区二区三区四区| 日韩精品1区2区3区| 综合久久久久久| 国产三级久久久| 日韩欧美电影在线| 欧美另类久久久品| 日本韩国一区二区三区| 国产福利一区二区三区视频| 免费美女久久99| 亚洲福利国产精品| 亚洲免费av高清| 国产精品精品国产色婷婷| 久久麻豆一区二区| 日韩欧美激情一区| 欧美精品第1页| 欧美视频一区在线| 日本高清不卡视频| 9i看片成人免费高清| 国产精品99久久久久| 精品伊人久久久久7777人| 亚洲成人av中文| 亚洲制服丝袜在线| 亚洲精品免费在线播放| 国产精品福利av| **欧美大码日韩| 国产精品成人一区二区艾草| 久久精品一区二区三区不卡牛牛| 日韩免费看的电影| 91精品久久久久久蜜臀| 51午夜精品国产| 欧美老肥妇做.爰bbww视频| 欧美午夜免费电影| 欧美日韩日日夜夜| 欧美日韩一区二区电影| 欧美男男青年gay1069videost| 欧美这里有精品| 欧美日韩精品一区视频| 7777女厕盗摄久久久| 欧美老肥妇做.爰bbww视频| 在线成人午夜影院| 精品免费一区二区三区| 欧美成人艳星乳罩| 日本一区二区综合亚洲| 国产精品污www在线观看| 中文天堂在线一区| 亚洲欧美日韩一区二区三区在线观看| 国产精品第13页| 一级中文字幕一区二区| 天天综合天天综合色| 蜜桃一区二区三区四区| 国产一区二区三区精品视频| 大美女一区二区三区| 色婷婷国产精品| 欧美日韩国产综合久久| 精品粉嫩aⅴ一区二区三区四区| 久久久精品免费观看| 中文字幕一区二| 亚洲午夜视频在线观看| 美国毛片一区二区| 9色porny自拍视频一区二区| 欧美性色欧美a在线播放| 日韩三级高清在线| 久久久91精品国产一区二区三区| 久久精品在这里| 一区二区三区四区乱视频| 天堂va蜜桃一区二区三区 | 国产精品欧美经典| 亚洲免费电影在线| 美脚の诱脚舐め脚责91| 成人国产精品视频| 欧美三级日韩在线| 久久精品在线免费观看| 亚洲国产一区二区视频| 国产一区二区三区精品视频| 日本电影亚洲天堂一区| 日韩欧美亚洲一区二区| 中文字幕一区二区在线播放| 亚洲国产aⅴ成人精品无吗| 国产二区国产一区在线观看| 在线观看日韩电影| 久久久激情视频| 婷婷六月综合亚洲| 成人看片黄a免费看在线| 717成人午夜免费福利电影| 久久久99久久| 日韩av一区二区三区| av电影天堂一区二区在线| 日韩欧美中文字幕制服| 亚洲嫩草精品久久| 国产一区二区久久| 538在线一区二区精品国产| 国产精品丝袜久久久久久app| 亚洲妇熟xx妇色黄| 99精品黄色片免费大全| 26uuu精品一区二区在线观看| 亚洲最快最全在线视频| 国产成人亚洲精品青草天美| 91精品国产品国语在线不卡 | 久久99精品久久久久久久久久久久| 成人av网站在线| 日韩精品一区二区在线| 亚洲成人在线观看视频| 91社区在线播放| 日本一区免费视频| 国产裸体歌舞团一区二区| 欧美一级精品大片| 午夜欧美一区二区三区在线播放| 91香蕉视频黄| 国产精品欧美久久久久一区二区 | 成人福利视频在线| 亚洲精品一区二区三区香蕉| 婷婷久久综合九色综合绿巨人| 成人动漫视频在线| 国产亚洲精品资源在线26u| 蜜臀av一区二区在线观看| 欧美日韩不卡在线| 亚洲自拍都市欧美小说| www.欧美精品一二区| 久久久精品国产免费观看同学| 免费一区二区视频| 欧美一区二区三区在线观看| 亚洲电影在线免费观看| 欧美日韩国产高清一区二区| 亚洲一区二区三区四区在线| 色婷婷久久99综合精品jk白丝| 日韩美女啊v在线免费观看| 99在线热播精品免费| 国产精品人人做人人爽人人添| 国产精品一区二区91| 久久你懂得1024| 国产精品一区二区久久精品爱涩| www久久精品| 国产福利精品一区二区| 国产欧美日韩三级| 成人精品小蝌蚪| 中文字幕在线观看不卡视频| 91香蕉视频在线| 亚洲国产一区二区视频| 欧美欧美欧美欧美| 久久精品久久综合| 久久综合九色综合97婷婷| 国产成人免费在线| 中文字幕在线视频一区| 91成人免费在线视频| 亚洲一区二区在线视频| 欧美剧情电影在线观看完整版免费励志电影| 亚洲午夜视频在线观看| 欧美一区中文字幕| 国产乱码精品一区二区三区五月婷| 久久久久久久久一| av不卡在线播放| 婷婷开心久久网| 亚洲精品一线二线三线| 不卡的av电影在线观看| 一区二区久久久久久| 欧美久久免费观看| 国产精品99久久久久久有的能看| 国产精品成人免费在线| 欧美丰满美乳xxx高潮www| 精品一区二区三区在线播放视频| 国产欧美日韩视频在线观看| 色狠狠综合天天综合综合| 天天综合日日夜夜精品| 久久午夜免费电影| 色婷婷av一区二区三区gif| 美女一区二区久久| 国产精品电影一区二区| 91精品婷婷国产综合久久性色| 国产精品一区二区果冻传媒| 一区二区三区蜜桃| 精品国精品国产| 91免费观看视频| 久久99国产精品免费网站| 中文字幕在线不卡| 欧美sm极限捆绑bd| 在线一区二区三区四区五区| 九一九一国产精品| 亚洲精品国产精华液| 久久综合久久综合久久综合| 欧美在线一区二区三区| 国产宾馆实践打屁股91| 亚洲成人免费在线| 国产精品超碰97尤物18| 欧美成人女星排行榜| 欧美伊人久久久久久午夜久久久久| 韩国精品在线观看| 天天色图综合网| 中文字幕一区二区三区视频| 欧美一区二区三区免费在线看| jizzjizzjizz欧美| 狠狠色狠狠色综合系列| 午夜精品久久久久久不卡8050| 国产精品国产三级国产aⅴ入口| 日韩久久久精品| 欧美日本国产一区| 日本电影欧美片|