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

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

?? ehci-sched.c

?? 硬實時linux補丁rtai下usb協議棧
?? 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 rtdm_usb_device *dev1, struct rtdm_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;}/* 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 rtdm_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;}/*-------------------------------------------------------------------------*/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->regs->status, STS_PSS, 0, 9 * 125);	if (status != 0) {		ehci_to_hcd(ehci)->state = HC_STATE_HALT;		return status;	}	cmd = readl (&ehci->regs->command) | CMD_PSE;	writel (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 = readl (&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->regs->status, STS_PSS, STS_PSS, 9 * 125);	if (status != 0) {		ehci_to_hcd(ehci)->state = HC_STATE_HALT;		return status;	}	cmd = readl (&ehci->regs->command) & ~CMD_PSE;	writel (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;	rtdm_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	//   qh->hw_info1 |= __constant_cpu_to_le32 (1 << 7 /* "ignore" */);	/* high bandwidth, or otherwise part of every microframe */	if ((period = qh->period) == 0)		period = 1;	for (i = qh->start; i < ehci->periodic_size; i += period)		periodic_unlink (ehci, i, 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);	rtdm_dev_dbg(&qh->dev->dev,		"unlink qh%d-%04x/%p start %d [%d/%d us]\n",		qh->period,		le32_to_cpup (&qh->hw_info2) & (QH_CMASK | QH_SMASK),		qh, qh->start, qh->usecs, qh->c_usecs);	/* qh->qh_next still "live" to HC */	qh->qh_state = QH_STATE_UNLINK;	qh->qh_next.ptr = NULL;	qh_put (qh);	/* maybe turn off periodic schedule */	ehci->periodic_sched--;	if (!ehci->periodic_sched)		(void) disable_periodic (ehci);}static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh){	unsigned	wait;	qh_unlink_periodic (ehci, qh);	/* simple/paranoid:  always delay, expecting the HC needs to read	 * qh->hw_next or finish a writeback after SPLIT/CSPLIT ... and	 * expect khubd to clean up after any CSPLITs we won't issue.	 * active high speed queues may need bigger delays...	 */	if (list_empty (&qh->qtd_list)			|| (__constant_cpu_to_le32 (QH_CMASK)					& qh->hw_info2) != 0)		wait = 2;	else		wait = 55;	/* worst case: 3 * 1024 */	udelay (wait);	qh->qh_state = QH_STATE_IDLE;	qh->hw_next = EHCI_LIST_END;	wmb ();}/*-------------------------------------------------------------------------*/static int check_period (	struct ehci_hcd *ehci, 	unsigned	frame,	unsigned	uframe,	unsigned	period,	unsigned	usecs) {	int		claimed;	/* complete split running into next frame?	 * given FSTN support, we could sometimes check...	 */	if (uframe >= 8)		return 0;	/*	 * 80% periodic == 100 usec/uframe available	 * convert "usecs we need" to "max already claimed" 	 */	usecs = 100 - usecs;	/* we "know" 2 and 4 uframe intervals were rejected; so	 * for period 0, check _every_ microframe in the schedule.	 */	if (unlikely (period == 0)) {		do {			for (uframe = 0; uframe < 7; uframe++) {				claimed = periodic_usecs (ehci, frame, uframe);				if (claimed > usecs)					return 0;			}		} while ((frame += 1) < ehci->periodic_size);	/* just check the specified uframe, at that period */	} else {		do {			claimed = periodic_usecs (ehci, frame, uframe);			if (claimed > usecs)				return 0;		} while ((frame += period) < ehci->periodic_size);	}	// success!	return 1;}static int check_intr_schedule (	struct ehci_hcd		*ehci, 	unsigned		frame,	unsigned		uframe,	const struct ehci_qh	*qh,	__le32			*c_maskp){    	int		retval = -ENOSPC;	u8		mask;	if (qh->c_usecs && uframe >= 6)		/* FSTN territory? */		goto done;	if (!check_period (ehci, frame, uframe, qh->period, qh->usecs))		goto done;	if (!qh->c_usecs) {		retval = 0;		*c_maskp = 0;		goto done;	}	/* Make sure this tt's buffer is also available for CSPLITs.	 * We pessimize a bit; probably the typical full speed case	 * doesn't need the second CSPLIT.	 * 	 * NOTE:  both SPLIT and CSPLIT could be checked in just	 * one smart pass...	 */	mask = 0x03 << (uframe + qh->gap_uf);	*c_maskp = cpu_to_le32 (mask << 8);	mask |= 1 << uframe;	if (tt_no_collision (ehci, qh->period, qh->dev, frame, mask)) {		if (!check_period (ehci, frame, uframe + qh->gap_uf + 1,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91丝袜在线播放九色| 久久久久久久性| 亚洲精品中文在线影院| 成人18视频在线播放| 国产精品美女久久久久久久久久久 | 欧美老肥妇做.爰bbww视频| 成人欧美一区二区三区小说| 白白色 亚洲乱淫| 亚洲美女区一区| 欧美日韩一二三| 日韩一区精品视频| 欧美成人官网二区| 成人福利视频在线| 亚洲一区自拍偷拍| 日韩一区国产二区欧美三区| 国内精品免费在线观看| 国产欧美日韩三区| 91精品福利视频| 日本va欧美va精品| 国产欧美精品在线观看| 91一区二区三区在线观看| 亚洲一区二区综合| 精品久久一二三区| 不卡av电影在线播放| 亚洲国产视频a| 精品久久久久久久久久久久久久久| 国产精品亚洲第一| 亚洲一区二区在线视频| 欧美xxxx老人做受| 色婷婷综合久久久久中文一区二区| 日本aⅴ免费视频一区二区三区 | 欧美性猛交xxxx黑人交| 日韩av二区在线播放| 中文字幕av一区二区三区| 在线亚洲人成电影网站色www| 秋霞午夜鲁丝一区二区老狼| 国产欧美精品日韩区二区麻豆天美| 色狠狠av一区二区三区| 国内精品第一页| 亚洲精品视频在线观看网站| 欧美成人r级一区二区三区| 97精品超碰一区二区三区| 美女视频黄频大全不卡视频在线播放| 国产精品天天摸av网| 欧美一区二区三区在线看| 日韩欧美一区中文| 成人午夜短视频| 美女网站色91| 婷婷丁香久久五月婷婷| 国产精品污网站| 久久天堂av综合合色蜜桃网| 6080日韩午夜伦伦午夜伦| 99久久精品国产毛片| 国产精品99久久久久久久女警 | 国产精品天美传媒| 精品国一区二区三区| 欧美日韩免费一区二区三区| www.欧美.com| 国产成人在线免费| 另类小说综合欧美亚洲| 亚洲福利视频导航| 亚洲黄色在线视频| 国产精品久久久久久一区二区三区| 欧美成人精品福利| 日韩三级视频在线看| 欧美性大战久久久久久久蜜臀 | 91久久久免费一区二区| 国产91对白在线观看九色| 美女在线视频一区| 日韩精品乱码免费| 亚洲电影欧美电影有声小说| 一区二区三区欧美激情| 亚洲欧美在线aaa| 国产精品久久久久久久久晋中 | 国产精品视频你懂的| 久久只精品国产| 久久久五月婷婷| 久久久蜜桃精品| 久久亚洲综合av| 久久日一线二线三线suv| 日韩久久免费av| 精品国产一区二区国模嫣然| 欧美剧在线免费观看网站 | 97久久超碰国产精品电影| 成人h精品动漫一区二区三区| 成人一二三区视频| 91在线视频网址| 91在线观看下载| 在线观看视频一区二区欧美日韩| 日本久久电影网| 欧美日韩精品一二三区| 884aa四虎影成人精品一区| 欧美一区二区在线视频| 欧美大片在线观看| 国产三级精品在线| 日韩美女啊v在线免费观看| 亚洲女厕所小便bbb| 亚洲一区二区中文在线| 美女一区二区在线观看| 国产精品66部| 色偷偷成人一区二区三区91| 欧美色窝79yyyycom| 日韩欧美亚洲一区二区| 亚洲国产经典视频| 一区二区三区四区不卡视频| 视频在线观看一区二区三区| 黑人精品欧美一区二区蜜桃| 成人av在线资源| 欧美日韩一卡二卡| www久久精品| 亚洲欧美成人一区二区三区| 日韩和的一区二区| 国产不卡免费视频| 欧美在线一区二区| 精品第一国产综合精品aⅴ| 欧美国产一区二区在线观看 | 欧美精品亚洲一区二区在线播放| 欧美成人aa大片| 一区二区高清在线| 激情六月婷婷久久| 色94色欧美sute亚洲线路一久| 欧美一级在线观看| √…a在线天堂一区| 日本中文在线一区| 成人av在线资源网| 日韩女同互慰一区二区| 亚洲免费视频中文字幕| 精品一区二区三区视频| 91久久精品一区二区三区| 久久婷婷综合激情| 日韩电影一区二区三区| 99精品欧美一区二区三区小说 | 欧美精品久久一区二区三区| 国产日韩亚洲欧美综合| 亚洲123区在线观看| 成人高清视频免费观看| 欧美大片一区二区三区| 亚洲成人1区2区| av一区二区不卡| 精品国产欧美一区二区| 亚洲 欧美综合在线网络| 99久久精品一区二区| 久久蜜桃香蕉精品一区二区三区| 亚洲风情在线资源站| 91麻豆成人久久精品二区三区| 欧美va天堂va视频va在线| 午夜久久久久久久久| 一本色道久久综合亚洲91| 日本一二三不卡| 国产激情视频一区二区三区欧美 | 欧美日本不卡视频| 成人欧美一区二区三区在线播放| 国产成人综合视频| 精品理论电影在线| 日韩av一区二| 欧美一区二区成人6969| 天天综合网天天综合色| 欧美性生活大片视频| 亚洲美女在线一区| 91色婷婷久久久久合中文| 国产精品久久久久久久久久免费看| 国产精品一色哟哟哟| 久久综合九色综合欧美98| 韩国精品久久久| 久久夜色精品国产欧美乱极品| 免费观看一级欧美片| 欧美一区二区视频免费观看| 亚洲v中文字幕| 欧美日韩中文字幕一区| 亚洲永久免费av| 欧美三级在线播放| 五月激情综合色| 欧美人成免费网站| 日韩国产精品大片| 欧美白人最猛性xxxxx69交| 国产自产高清不卡| 国产无人区一区二区三区| 丰满白嫩尤物一区二区| 国产精品无码永久免费888| 91网站黄www| 亚洲激情中文1区| 欧美精品三级日韩久久| 日韩精品欧美成人高清一区二区| 欧美一区二区三区四区高清| 另类调教123区 | 日韩视频永久免费| 国内外成人在线| 亚洲国产岛国毛片在线| 91香蕉国产在线观看软件| 亚洲福利一区二区三区| 欧美电视剧在线观看完整版| 国精品**一区二区三区在线蜜桃| 国产日韩v精品一区二区| 99热在这里有精品免费| 亚洲在线免费播放| 欧美久久久影院| 国产大陆a不卡| 亚洲激情在线激情| 精品国产伦一区二区三区观看方式 | 91精品国产色综合久久久蜜香臀|