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

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

?? ehci-sched.c

?? host usb 主設備程序 支持sd卡 mouse keyboard 的最單單的驅動程序 gcc編譯
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* * Copyright (c) 2001-2004 by David Brownell * Copyright (c) 2003 Michal Sojka, for high-speed iso transfers * * 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 scheduled transaction support:  interrupt, iso, split iso * These are called "periodic" transactions in the EHCI spec. * * Note that for interrupt transfers, the QH/QTD manipulation is shared * with the "asynchronous" transaction support (control/bulk transfers). * The only real difference is in how interrupt transfers are scheduled. * * For ISO, we make an "iso_stream" head to serve the same role as a QH. * It keeps track of every ITD (or SITD) that's linked, and holds enough * pre-calculated schedule data to make appending to the queue be quick. */static int ehci_get_frame (struct usb_hcd *hcd);/*-------------------------------------------------------------------------*//* * periodic_next_shadow - return "next" pointer on shadow list * @periodic: host pointer to qh/itd/sitd * @tag: hardware tag for type of this record */static union ehci_shadow *periodic_next_shadow (union ehci_shadow *periodic, __le32 tag){	switch (tag) {	case Q_TYPE_QH:		return &periodic->qh->qh_next;	case Q_TYPE_FSTN:		return &periodic->fstn->fstn_next;	case Q_TYPE_ITD:		return &periodic->itd->itd_next;	// case Q_TYPE_SITD:	default:		return &periodic->sitd->sitd_next;	}}/* caller must hold ehci->lock */static void periodic_unlink (struct ehci_hcd *ehci, unsigned frame, void *ptr){	union ehci_shadow	*prev_p = &ehci->pshadow [frame];	__le32			*hw_p = &ehci->periodic [frame];	union ehci_shadow	here = *prev_p;	/* find predecessor of "ptr"; hw and shadow lists are in sync */	while (here.ptr && here.ptr != ptr) {		prev_p = periodic_next_shadow (prev_p, Q_NEXT_TYPE (*hw_p));		hw_p = here.hw_next;		here = *prev_p;	}	/* an interrupt entry (at list end) could have been shared */	if (!here.ptr)		return;	/* update shadow and hardware lists ... the old "next" pointers	 * from ptr may still be in use, the caller updates them.	 */	*prev_p = *periodic_next_shadow (&here, Q_NEXT_TYPE (*hw_p));	*hw_p = *here.hw_next;}/* how many of the uframe's 125 usecs are allocated? */static unsigned shortperiodic_usecs (struct ehci_hcd *ehci, unsigned frame, unsigned uframe){	__le32			*hw_p = &ehci->periodic [frame];	union ehci_shadow	*q = &ehci->pshadow [frame];	unsigned		usecs = 0;	while (q->ptr) {		switch (Q_NEXT_TYPE (*hw_p)) {		case Q_TYPE_QH:			/* is it in the S-mask? */			if (q->qh->hw_info2 & cpu_to_le32 (1 << uframe))				usecs += q->qh->usecs;			/* ... or C-mask? */			if (q->qh->hw_info2 & cpu_to_le32 (1 << (8 + uframe)))				usecs += q->qh->c_usecs;			hw_p = &q->qh->hw_next;			q = &q->qh->qh_next;			break;		// case Q_TYPE_FSTN:		default:			/* for "save place" FSTNs, count the relevant INTR			 * bandwidth from the previous frame			 */			if (q->fstn->hw_prev != EHCI_LIST_END) {				ehci_dbg (ehci, "ignoring FSTN cost ...\n");			}			hw_p = &q->fstn->hw_next;			q = &q->fstn->fstn_next;			break;		case Q_TYPE_ITD:			usecs += q->itd->usecs [uframe];			hw_p = &q->itd->hw_next;			q = &q->itd->itd_next;			break;		case Q_TYPE_SITD:			/* is it in the S-mask?  (count SPLIT, DATA) */			if (q->sitd->hw_uframe & cpu_to_le32 (1 << uframe)) {				if (q->sitd->hw_fullspeed_ep &						__constant_cpu_to_le32 (1<<31))					usecs += q->sitd->stream->usecs;				else	/* worst case for OUT start-split */					usecs += HS_USECS_ISO (188);			}			/* ... C-mask?  (count CSPLIT, DATA) */			if (q->sitd->hw_uframe &					cpu_to_le32 (1 << (8 + uframe))) {				/* worst case for IN complete-split */				usecs += q->sitd->stream->c_usecs;			}			hw_p = &q->sitd->hw_next;			q = &q->sitd->sitd_next;			break;		}	}#ifdef	DEBUG	if (usecs > 100)		ehci_err (ehci, "uframe %d sched overrun: %d usecs\n",			frame * 8 + uframe, usecs);#endif	return usecs;}/*-------------------------------------------------------------------------*/static int same_tt (struct usb_device *dev1, struct usb_device *dev2){	if (!dev1->tt || !dev2->tt)		return 0;	if (dev1->tt != dev2->tt)		return 0;	if (dev1->tt->multi)		return dev1->ttport == dev2->ttport;	else		return 1;}#ifdef CONFIG_USB_EHCI_TT_NEWSCHED/* Which uframe does the low/fullspeed transfer start in? * * The parameter is the mask of ssplits in "H-frame" terms * and this returns the transfer start uframe in "B-frame" terms, * which allows both to match, e.g. a ssplit in "H-frame" uframe 0 * will cause a transfer in "B-frame" uframe 0.  "B-frames" lag * "H-frames" by 1 uframe.  See the EHCI spec sec 4.5 and figure 4.7. */static inline unsigned char tt_start_uframe(struct ehci_hcd *ehci, __le32 mask){	unsigned char smask = QH_SMASK & le32_to_cpu(mask);	if (!smask) {		ehci_err(ehci, "invalid empty smask!\n");		/* uframe 7 can't have bw so this will indicate failure */		return 7;	}	return ffs(smask) - 1;}static const unsigned charmax_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 30, 0 };/* carryover low/fullspeed bandwidth that crosses uframe boundries */static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8]){	int i;	for (i=0; i<7; i++) {		if (max_tt_usecs[i] < tt_usecs[i]) {			tt_usecs[i+1] += tt_usecs[i] - max_tt_usecs[i];			tt_usecs[i] = max_tt_usecs[i];		}	}}/* How many of the tt's periodic downstream 1000 usecs are allocated? * * While this measures the bandwidth in terms of usecs/uframe, * the low/fullspeed bus has no notion of uframes, so any particular * low/fullspeed transfer can "carry over" from one uframe to the next, * since the TT just performs downstream transfers in sequence. * * For example two seperate 100 usec transfers can start in the same uframe, * and the second one would "carry over" 75 usecs into the next uframe. */static voidperiodic_tt_usecs (	struct ehci_hcd *ehci,	struct usb_device *dev,	unsigned frame,	unsigned short tt_usecs[8]){	__le32			*hw_p = &ehci->periodic [frame];	union ehci_shadow	*q = &ehci->pshadow [frame];	unsigned char		uf;	memset(tt_usecs, 0, 16);	while (q->ptr) {		switch (Q_NEXT_TYPE(*hw_p)) {		case Q_TYPE_ITD:			hw_p = &q->itd->hw_next;			q = &q->itd->itd_next;			continue;		case Q_TYPE_QH:			if (same_tt(dev, q->qh->dev)) {				uf = tt_start_uframe(ehci, q->qh->hw_info2);				tt_usecs[uf] += q->qh->tt_usecs;			}			hw_p = &q->qh->hw_next;			q = &q->qh->qh_next;			continue;		case Q_TYPE_SITD:			if (same_tt(dev, q->sitd->urb->dev)) {				uf = tt_start_uframe(ehci, q->sitd->hw_uframe);				tt_usecs[uf] += q->sitd->stream->tt_usecs;			}			hw_p = &q->sitd->hw_next;			q = &q->sitd->sitd_next;			continue;		// case Q_TYPE_FSTN:		default:			ehci_dbg(ehci,				  "ignoring periodic frame %d FSTN\n", frame);			hw_p = &q->fstn->hw_next;			q = &q->fstn->fstn_next;		}	}	carryover_tt_bandwidth(tt_usecs);	if (max_tt_usecs[7] < tt_usecs[7])		ehci_err(ehci, "frame %d tt sched overrun: %d usecs\n",			frame, tt_usecs[7] - max_tt_usecs[7]);}/* * Return true if the device's tt's downstream bus is available for a * periodic transfer of the specified length (usecs), starting at the * specified frame/uframe.  Note that (as summarized in section 11.19 * of the usb 2.0 spec) TTs can buffer multiple transactions for each * uframe. * * The uframe parameter is when the fullspeed/lowspeed transfer * should be executed in "B-frame" terms, which is the same as the * highspeed ssplit's uframe (which is in "H-frame" terms).  For example * a ssplit in "H-frame" 0 causes a transfer in "B-frame" 0. * See the EHCI spec sec 4.5 and fig 4.7. * * This checks if the full/lowspeed bus, at the specified starting uframe, * has the specified bandwidth available, according to rules listed * in USB 2.0 spec section 11.18.1 fig 11-60. * * This does not check if the transfer would exceed the max ssplit * limit of 16, specified in USB 2.0 spec section 11.18.4 requirement #4, * since proper scheduling limits ssplits to less than 16 per uframe. */static int tt_available (	struct ehci_hcd		*ehci,	unsigned		period,	struct usb_device	*dev,	unsigned		frame,	unsigned		uframe,	u16			usecs){	if ((period == 0) || (uframe >= 7))	/* error */		return 0;	for (; frame < ehci->periodic_size; frame += period) {		unsigned short tt_usecs[8];		periodic_tt_usecs (ehci, dev, frame, tt_usecs);		ehci_vdbg(ehci, "tt frame %d check %d usecs start uframe %d in"			" schedule %d/%d/%d/%d/%d/%d/%d/%d\n",			frame, usecs, uframe,			tt_usecs[0], tt_usecs[1], tt_usecs[2], tt_usecs[3],			tt_usecs[4], tt_usecs[5], tt_usecs[6], tt_usecs[7]);		if (max_tt_usecs[uframe] <= tt_usecs[uframe]) {			ehci_vdbg(ehci, "frame %d uframe %d fully scheduled\n",				frame, uframe);			return 0;		}		/* special case for isoc transfers larger than 125us:		 * the first and each subsequent fully used uframe		 * must be empty, so as to not illegally delay		 * already scheduled transactions		 */		if (125 < usecs) {			int ufs = (usecs / 125) - 1;			int i;			for (i = uframe; i < (uframe + ufs) && i < 8; i++)				if (0 < tt_usecs[i]) {					ehci_vdbg(ehci,						"multi-uframe xfer can't fit "						"in frame %d uframe %d\n",						frame, i);					return 0;				}		}		tt_usecs[uframe] += usecs;		carryover_tt_bandwidth(tt_usecs);		/* fail if the carryover pushed bw past the last uframe's limit */		if (max_tt_usecs[7] < tt_usecs[7]) {			ehci_vdbg(ehci,				"tt unavailable usecs %d frame %d uframe %d\n",				usecs, frame, uframe);			return 0;		}	}	return 1;}#else/* return true iff the device's transaction translator is available * for a periodic transfer starting at the specified frame, using * all the uframes in the mask. */static int tt_no_collision (	struct ehci_hcd		*ehci,	unsigned		period,	struct usb_device	*dev,	unsigned		frame,	u32			uf_mask){	if (period == 0)	/* error */		return 0;	/* note bandwidth wastage:  split never follows csplit	 * (different dev or endpoint) until the next uframe.	 * calling convention doesn't make that distinction.	 */	for (; frame < ehci->periodic_size; frame += period) {		union ehci_shadow	here;		__le32			type;		here = ehci->pshadow [frame];		type = Q_NEXT_TYPE (ehci->periodic [frame]);		while (here.ptr) {			switch (type) {			case Q_TYPE_ITD:				type = Q_NEXT_TYPE (here.itd->hw_next);				here = here.itd->itd_next;				continue;			case Q_TYPE_QH:				if (same_tt (dev, here.qh->dev)) {					u32		mask;					mask = le32_to_cpu (here.qh->hw_info2);					/* "knows" no gap is needed */					mask |= mask >> 8;					if (mask & uf_mask)						break;				}				type = Q_NEXT_TYPE (here.qh->hw_next);				here = here.qh->qh_next;				continue;			case Q_TYPE_SITD:				if (same_tt (dev, here.sitd->urb->dev)) {					u16		mask;					mask = le32_to_cpu (here.sitd								->hw_uframe);					/* FIXME assumes no gap for IN! */					mask |= mask >> 8;					if (mask & uf_mask)						break;				}				type = Q_NEXT_TYPE (here.sitd->hw_next);				here = here.sitd->sitd_next;				continue;			// case Q_TYPE_FSTN:			default:				ehci_dbg (ehci,					"periodic frame %d bogus type %d\n",					frame, type);			}			/* collision or error */			return 0;		}	}	/* no collision */	return 1;}#endif /* CONFIG_USB_EHCI_TT_NEWSCHED *//*-------------------------------------------------------------------------*/static int enable_periodic (struct ehci_hcd *ehci){	u32	cmd;	int	status;	/* did clearing PSE did take effect yet?	 * takes effect only at frame boundaries...	 */	status = handshake(ehci, &ehci->regs->status, STS_PSS, 0, 9 * 125);	if (status != 0) {		ehci_to_hcd(ehci)->state = HC_STATE_HALT;		return status;	}	cmd = ehci_readl(ehci, &ehci->regs->command) | CMD_PSE;	ehci_writel(ehci, cmd, &ehci->regs->command);	/* posted write ... PSS happens later */	ehci_to_hcd(ehci)->state = HC_STATE_RUNNING;	/* make sure ehci_work scans these */	ehci->next_uframe = ehci_readl(ehci, &ehci->regs->frame_index)		% (ehci->periodic_size << 3);	return 0;}static int disable_periodic (struct ehci_hcd *ehci){	u32	cmd;	int	status;	/* did setting PSE not take effect yet?	 * takes effect only at frame boundaries...	 */	status = handshake(ehci, &ehci->regs->status, STS_PSS, STS_PSS, 9 * 125);	if (status != 0) {		ehci_to_hcd(ehci)->state = HC_STATE_HALT;		return status;	}	cmd = ehci_readl(ehci, &ehci->regs->command) & ~CMD_PSE;	ehci_writel(ehci, cmd, &ehci->regs->command);	/* posted write ... */	ehci->next_uframe = -1;	return 0;}/*-------------------------------------------------------------------------*//* periodic schedule slots have iso tds (normal or split) first, then a * sparse tree for active interrupt transfers. * * this just links in a qh; caller guarantees uframe masks are set right. * no FSTN support (yet; ehci 0.96+) */static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh){	unsigned	i;	unsigned	period = qh->period;	dev_dbg (&qh->dev->dev,		"link qh%d-%04x/%p start %d [%d/%d us]\n",		period, le32_to_cpup (&qh->hw_info2) & (QH_CMASK | QH_SMASK),		qh, qh->start, qh->usecs, qh->c_usecs);	/* high bandwidth, or otherwise every microframe */	if (period == 0)		period = 1;	for (i = qh->start; i < ehci->periodic_size; i += period) {		union ehci_shadow	*prev = &ehci->pshadow [i];		__le32			*hw_p = &ehci->periodic [i];		union ehci_shadow	here = *prev;		__le32			type = 0;		/* skip the iso nodes at list head */		while (here.ptr) {			type = Q_NEXT_TYPE (*hw_p);			if (type == Q_TYPE_QH)				break;			prev = periodic_next_shadow (prev, type);			hw_p = &here.qh->hw_next;			here = *prev;		}		/* sorting each branch by period (slow-->fast)		 * enables sharing interior tree nodes		 */		while (here.ptr && qh != here.qh) {			if (qh->period > here.qh->period)				break;			prev = &here.qh->qh_next;			hw_p = &here.qh->hw_next;			here = *prev;		}		/* link in this qh, unless some earlier pass did that */		if (qh != here.qh) {			qh->qh_next = here;			if (here.qh)				qh->hw_next = *hw_p;			wmb ();			prev->qh = qh;			*hw_p = QH_NEXT (qh->qh_dma);		}	}	qh->qh_state = QH_STATE_LINKED;	qh_get (qh);	/* update per-qh bandwidth for usbfs */	ehci_to_hcd(ehci)->self.bandwidth_allocated += qh->period		? ((qh->usecs + qh->c_usecs) / qh->period)		: (qh->usecs * 8);	/* maybe enable periodic schedule processing */	if (!ehci->periodic_sched++)		return enable_periodic (ehci);	return 0;}static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh){	unsigned	i;	unsigned	period;	// FIXME:	// IF this isn't high speed	//   and this qh is active in the current uframe	//   (and overlay token SplitXstate is false?)	// THEN

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
不卡视频一二三四| 欧美韩日一区二区三区| 国产精品久久久久桃色tv| 天天爽夜夜爽夜夜爽精品视频| 处破女av一区二区| 69堂成人精品免费视频| 中文字幕一区av| 国产在线视视频有精品| 欧美精品第一页| 一区二区久久久久| aaa欧美色吧激情视频| 欧美r级在线观看| 日本大胆欧美人术艺术动态| 色一区在线观看| 亚洲欧美激情在线| eeuss鲁片一区二区三区在线观看| 午夜精品福利一区二区三区av| 国产丶欧美丶日本不卡视频| 欧美sm美女调教| 蜜臀a∨国产成人精品| 欧美日韩的一区二区| 亚洲综合久久久| 91蜜桃视频在线| 自拍偷拍国产精品| 99久久久无码国产精品| 亚洲国产精品二十页| 成人午夜私人影院| 国产精品高清亚洲| 99久久精品一区二区| 国产精品不卡在线观看| 成人高清av在线| 日韩理论片在线| 在线欧美小视频| 亚洲1区2区3区视频| 69久久夜色精品国产69蝌蚪网| 中文字幕亚洲一区二区va在线| 色婷婷精品大在线视频 | 91原创在线视频| 国产精品美女视频| 91免费视频观看| 一区二区欧美国产| 欧美伦理影视网| 日韩不卡手机在线v区| 日韩一区二区在线观看| 久久福利视频一区二区| 99精品国产热久久91蜜凸| 国产精品亲子乱子伦xxxx裸| 成人ar影院免费观看视频| 亚洲欧美综合色| 精品视频一区二区三区免费| 免费在线一区观看| 国产视频一区在线播放| 色婷婷综合久久久久中文一区二区 | 在线播放一区二区三区| 美女视频一区在线观看| 久久久不卡影院| 91丨九色porny丨蝌蚪| 天天综合色天天综合色h| 日韩你懂的在线观看| 国产suv精品一区二区6| 夜夜嗨av一区二区三区四季av| 91麻豆精品国产91久久久久久久久| 激情欧美日韩一区二区| 自拍偷拍欧美精品| 欧美成人性福生活免费看| proumb性欧美在线观看| 亚洲成人av免费| 欧美国产精品一区二区| 欧美午夜精品久久久| 国产一区二区日韩精品| 亚洲亚洲精品在线观看| 久久精品亚洲精品国产欧美kt∨| 91蝌蚪porny成人天涯| 精品一区二区三区日韩| 亚洲一区视频在线| 欧美激情在线看| 欧美丰满少妇xxxbbb| 99国产精品久| 国模冰冰炮一区二区| 五月天丁香久久| 国产精品久久三| 精品日本一线二线三线不卡| 色婷婷av一区二区| 成人午夜av影视| 狠狠色丁香九九婷婷综合五月| 一区二区三区国产精华| 国产欧美日本一区视频| 欧美一区二区三区思思人| 色综合久久天天| 成熟亚洲日本毛茸茸凸凹| 乱一区二区av| 免费成人av在线播放| 一区二区三区精品在线| 中文久久乱码一区二区| 久久天堂av综合合色蜜桃网| 日韩视频免费直播| 欧美高清性hdvideosex| 欧美艳星brazzers| www.一区二区| 成人av在线影院| 韩国午夜理伦三级不卡影院| 天堂成人免费av电影一区| 亚洲欧美一区二区三区极速播放 | 国产三级三级三级精品8ⅰ区| 91麻豆精品国产91久久久久久| 色婷婷精品久久二区二区蜜臂av | 国产成人av影院| 国产一区三区三区| 极品少妇一区二区| 国产一区二区免费看| 极品销魂美女一区二区三区| 精品亚洲国内自在自线福利| 久久99久久久久| 国产综合色精品一区二区三区| 久久66热偷产精品| 国产尤物一区二区| 福利视频网站一区二区三区| 粉嫩av一区二区三区粉嫩 | 亚洲一区免费在线观看| 亚洲高清中文字幕| 五月天激情小说综合| 久久精品久久综合| 国产毛片精品国产一区二区三区| 国产精品1区2区3区在线观看| 国产成人在线免费| 99re亚洲国产精品| 欧美性感一类影片在线播放| 7777精品伊人久久久大香线蕉完整版 | 欧美日韩一区二区在线观看| 欧美精品在线观看播放| 精品国内二区三区| 国产精品久久综合| 一区二区三区在线观看国产| 日韩高清在线不卡| 国产福利精品一区| 91在线观看下载| 欧美日韩国产一级| 精品剧情v国产在线观看在线| 国产亚洲污的网站| 亚洲精品日日夜夜| 久久精品国产色蜜蜜麻豆| 成人午夜电影小说| 欧美视频一区在线| 精品国产免费视频| 亚洲丝袜美腿综合| 日本中文一区二区三区| 成人永久免费视频| 欧美精品色综合| 国产精品久线观看视频| 日韩精品成人一区二区三区| 国产成人免费在线观看不卡| 91久久线看在观草草青青| 欧美电影免费观看高清完整版在 | 精品三级在线观看| 国产欧美一区二区精品性色 | 欧美精品在线观看播放| 国产精品无圣光一区二区| 亚洲成av人**亚洲成av**| 成人污视频在线观看| 日韩欧美你懂的| 亚洲最大色网站| 国产精品一区二区三区四区| 欧美精品 国产精品| 最新日韩在线视频| 国产一区啦啦啦在线观看| 欧美在线一二三四区| 中文字幕第一页久久| 老司机精品视频一区二区三区| 色综合色综合色综合色综合色综合| 精品国产三级a在线观看| 亚洲欧美日韩国产手机在线| 国产一区二区不卡| 欧美一级电影网站| 午夜精品一区二区三区三上悠亚| 不卡的av电影在线观看| 26uuuu精品一区二区| 日韩av午夜在线观看| 欧美性猛片xxxx免费看久爱| 1区2区3区国产精品| 国产精品一线二线三线精华| 91精品国产免费| 五月天丁香久久| 欧美日韩在线观看一区二区| 一区二区三区产品免费精品久久75| 国产电影一区在线| 久久麻豆一区二区| 激情综合亚洲精品| 精品久久久久av影院| 青青草原综合久久大伊人精品优势 | 国产视频一区二区在线观看| 精品一区二区精品| 亚洲精品一区二区在线观看| 久久66热偷产精品| 久久综合九色综合97婷婷| 久久国产精品72免费观看| 精品久久国产老人久久综合| 久久er精品视频| xfplay精品久久| 国产成人免费网站| 成人欧美一区二区三区1314|