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

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

?? ehci-hub.c

?? host usb 主設備程序 支持sd卡 mouse keyboard 的最單單的驅動程序 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.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线观看一区| 色老头久久综合| 欧美一区二区三区不卡| 中文字幕在线观看一区二区| 国产一区二区三区不卡在线观看| 日韩欧美国产电影| 中文字幕亚洲综合久久菠萝蜜| 亚洲444eee在线观看| 欧美日韩mp4| 日产精品久久久久久久性色| 555www色欧美视频| 男人的j进女人的j一区| 欧美一区二区在线看| 麻豆精品国产传媒mv男同| 欧美一卡二卡三卡| 久久爱另类一区二区小说| 日韩精品一区二区三区视频| 天堂久久一区二区三区| 精品久久免费看| 国产69精品久久久久毛片| 国产欧美一区二区精品婷婷 | 成人免费一区二区三区视频| 成人av免费观看| 一区二区三区欧美在线观看| 欧美日本在线播放| 国产制服丝袜一区| 国产精品第13页| 日本高清视频一区二区| 日本欧美一区二区| 久久久99精品免费观看不卡| 国产一区二区毛片| 亚洲欧洲日韩在线| 精品视频一区三区九区| 国产精品一区二区不卡| 午夜视频在线观看一区二区| 国产精品三级电影| 欧美一区二区三区四区五区 | 精品88久久久久88久久久| 色综合 综合色| 国产传媒欧美日韩成人| 偷拍日韩校园综合在线| 亚洲国产精品二十页| 91精品国产色综合久久不卡蜜臀| 成人精品视频网站| 免费人成精品欧美精品| 亚洲在线视频网站| 中文字幕中文字幕中文字幕亚洲无线| 日韩一区二区免费在线观看| 色哟哟一区二区三区| 国产一区啦啦啦在线观看| 午夜一区二区三区视频| 日韩理论片在线| 欧美精品一区二区三区在线| 欧美日高清视频| 色哟哟在线观看一区二区三区| 国产精品一区二区三区99| 麻豆精品蜜桃视频网站| 亚洲电影第三页| 一区二区三区在线影院| 亚洲丝袜另类动漫二区| 国产欧美精品一区二区三区四区 | 欧美色精品天天在线观看视频| 丰满岳乱妇一区二区三区| 久久99在线观看| 久久超级碰视频| 奇米精品一区二区三区四区| 三级不卡在线观看| 无吗不卡中文字幕| 亚洲第一精品在线| 婷婷国产在线综合| 午夜精品久久久久久久蜜桃app| 亚洲欧美日韩国产成人精品影院| 国产精品电影院| 亚洲欧洲日产国产综合网| 欧美国产激情一区二区三区蜜月| 久久久久亚洲综合| 国产欧美中文在线| 中文成人综合网| 成人欧美一区二区三区视频网页| 国产拍欧美日韩视频二区| 国产精品丝袜一区| 国产精品亲子伦对白| 亚洲欧洲精品一区二区精品久久久| 国产欧美精品日韩区二区麻豆天美| 欧美激情一区二区三区在线| 欧美国产一区二区| 亚洲欧美日韩国产中文在线| 亚洲高清免费在线| 天堂久久久久va久久久久| 蜜臀精品一区二区三区在线观看| 看电视剧不卡顿的网站| 韩国女主播一区二区三区| 福利一区在线观看| 91在线国内视频| 欧美婷婷六月丁香综合色| 在线播放中文一区| 欧美成人a∨高清免费观看| 国产色产综合色产在线视频| 国产精品成人一区二区艾草| 亚洲成人av一区| 老司机精品视频导航| 成人精品小蝌蚪| 欧美亚洲综合另类| 欧美变态口味重另类| 日本一区二区视频在线| 亚洲丝袜自拍清纯另类| 天天操天天综合网| 国产麻豆精品95视频| 91久久精品网| 欧美电影免费观看高清完整版在线 | 成人性视频免费网站| 99riav久久精品riav| 欧美乱妇23p| 日本一区二区免费在线| 一区二区三区高清| 国内久久精品视频| 色先锋资源久久综合| 欧美一区二区三区视频免费播放 | 日韩欧美专区在线| 国产精品蜜臀在线观看| 日本美女一区二区| 99久久久国产精品| 欧美成人三级电影在线| 一区二区在线观看免费视频播放| 激情久久久久久久久久久久久久久久| 91亚洲永久精品| 久久伊人中文字幕| 亚洲精品福利视频网站| 国产伦精品一区二区三区视频青涩 | 在线视频亚洲一区| 久久久久久夜精品精品免费| 亚洲小说欧美激情另类| 成人一区二区三区视频在线观看 | 国产一区二区美女| 精品视频色一区| 国产精品视频第一区| 久久精品国产精品亚洲红杏| 欧美亚洲国产怡红院影院| 国产精品久久免费看| 精品一区二区日韩| 欧美丰满少妇xxxbbb| 亚洲精品视频在线观看网站| 国产大陆亚洲精品国产| 精品免费视频一区二区| 亚洲成人免费观看| 91网站在线观看视频| 国产精品毛片无遮挡高清| 国产精品一区二区三区99| 日韩一区二区免费在线观看| 视频一区二区三区在线| 日本精品免费观看高清观看| 专区另类欧美日韩| av午夜一区麻豆| 国产精品网站在线播放| 极品少妇一区二区| 日韩欧美国产三级| 青青草伊人久久| 日韩一区二区三区视频| 日韩影院精彩在线| 欧美美女黄视频| 亚洲成人av电影| 91精品国产免费| 日本在线不卡视频一二三区| 欧美日韩电影在线| 日韩中文字幕区一区有砖一区 | 欧美日韩成人综合| 亚洲成人中文在线| 欧美老肥妇做.爰bbww视频| 亚洲成va人在线观看| 欧美日韩日日摸| 丝袜美腿亚洲一区二区图片| 欧美一区二区三区色| 九九国产精品视频| 久久久久久久久久电影| 国产大片一区二区| 亚洲欧美偷拍另类a∨色屁股| 91网址在线看| 亚洲午夜久久久久久久久电影院| 欧美三级中文字幕| 天天免费综合色| 26uuu另类欧美| 大美女一区二区三区| 一区二区在线免费观看| 欧美欧美欧美欧美| 黑人精品欧美一区二区蜜桃| 国产欧美精品一区aⅴ影院| 91在线视频播放| 亚洲va天堂va国产va久| 欧美一三区三区四区免费在线看 | 欧美精品在线观看播放| 美女一区二区三区在线观看| 久久人人97超碰com| av在线综合网| 日韩一区精品视频| 国产色综合久久| 欧美色精品在线视频| 国产综合色产在线精品| 亚洲黄网站在线观看| 日韩片之四级片| 99精品国产91久久久久久|