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

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

?? uhci-q.c

?? host usb 主設(shè)備程序 支持sd卡 mouse keyboard 的最單單的驅(qū)動(dòng)程序 gcc編譯
?? C
?? 第 1 頁 / 共 4 頁
字號:
	/*	 * Build the new dummy TD and activate the old one	 */	td = uhci_alloc_td(uhci);	if (!td)		goto nomem;	*plink = LINK_TO_TD(td);	uhci_fill_td(td, 0, USB_PID_OUT | uhci_explen(0), 0);	wmb();	qh->dummy_td->status |= __constant_cpu_to_le32(TD_CTRL_ACTIVE);	qh->dummy_td = td;	/* Low-speed transfers get a different queue, and won't hog the bus.	 * Also, some devices enumerate better without FSBR; the easiest way	 * to do that is to put URBs on the low-speed queue while the device	 * isn't in the CONFIGURED state. */	if (urb->dev->speed == USB_SPEED_LOW ||			urb->dev->state != USB_STATE_CONFIGURED)		skel = SKEL_LS_CONTROL;	else {		skel = SKEL_FS_CONTROL;		uhci_add_fsbr(uhci, urb);	}	if (qh->state != QH_STATE_ACTIVE)		qh->skel = skel;	urb->actual_length = -8;	/* Account for the SETUP packet */	return 0;nomem:	/* Remove the dummy TD from the td_list so it doesn't get freed */	uhci_remove_td_from_urbp(qh->dummy_td);	return -ENOMEM;}/* * Common submit for bulk and interrupt */static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb,		struct uhci_qh *qh){	struct uhci_td *td;	unsigned long destination, status;	int maxsze = le16_to_cpu(qh->hep->desc.wMaxPacketSize);	int len = urb->transfer_buffer_length;	dma_addr_t data = urb->transfer_dma;	__le32 *plink;	struct urb_priv *urbp = urb->hcpriv;	unsigned int toggle;	if (len < 0)		return -EINVAL;	/* The "pipe" thing contains the destination in bits 8--18 */	destination = (urb->pipe & PIPE_DEVEP_MASK) | usb_packetid(urb->pipe);	toggle = usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),			 usb_pipeout(urb->pipe));	/* 3 errors, dummy TD remains inactive */	status = uhci_maxerr(3);	if (urb->dev->speed == USB_SPEED_LOW)		status |= TD_CTRL_LS;	if (usb_pipein(urb->pipe))		status |= TD_CTRL_SPD;	/*	 * Build the DATA TDs	 */	plink = NULL;	td = qh->dummy_td;	do {	/* Allow zero length packets */		int pktsze = maxsze;		if (len <= pktsze) {		/* The last packet */			pktsze = len;			if (!(urb->transfer_flags & URB_SHORT_NOT_OK))				status &= ~TD_CTRL_SPD;		}		if (plink) {			td = uhci_alloc_td(uhci);			if (!td)				goto nomem;			*plink = LINK_TO_TD(td);		}		uhci_add_td_to_urbp(td, urbp);		uhci_fill_td(td, status,				destination | uhci_explen(pktsze) |					(toggle << TD_TOKEN_TOGGLE_SHIFT),				data);		plink = &td->link;		status |= TD_CTRL_ACTIVE;		data += pktsze;		len -= maxsze;		toggle ^= 1;	} while (len > 0);	/*	 * URB_ZERO_PACKET means adding a 0-length packet, if direction	 * is OUT and the transfer_length was an exact multiple of maxsze,	 * hence (len = transfer_length - N * maxsze) == 0	 * however, if transfer_length == 0, the zero packet was already	 * prepared above.	 */	if ((urb->transfer_flags & URB_ZERO_PACKET) &&			usb_pipeout(urb->pipe) && len == 0 &&			urb->transfer_buffer_length > 0) {		td = uhci_alloc_td(uhci);		if (!td)			goto nomem;		*plink = LINK_TO_TD(td);		uhci_add_td_to_urbp(td, urbp);		uhci_fill_td(td, status,				destination | uhci_explen(0) |					(toggle << TD_TOKEN_TOGGLE_SHIFT),				data);		plink = &td->link;		toggle ^= 1;	}	/* Set the interrupt-on-completion flag on the last packet.	 * A more-or-less typical 4 KB URB (= size of one memory page)	 * will require about 3 ms to transfer; that's a little on the	 * fast side but not enough to justify delaying an interrupt	 * more than 2 or 3 URBs, so we will ignore the URB_NO_INTERRUPT	 * flag setting. */	td->status |= __constant_cpu_to_le32(TD_CTRL_IOC);	/*	 * Build the new dummy TD and activate the old one	 */	td = uhci_alloc_td(uhci);	if (!td)		goto nomem;	*plink = LINK_TO_TD(td);	uhci_fill_td(td, 0, USB_PID_OUT | uhci_explen(0), 0);	wmb();	qh->dummy_td->status |= __constant_cpu_to_le32(TD_CTRL_ACTIVE);	qh->dummy_td = td;	usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe),			usb_pipeout(urb->pipe), toggle);	return 0;nomem:	/* Remove the dummy TD from the td_list so it doesn't get freed */	uhci_remove_td_from_urbp(qh->dummy_td);	return -ENOMEM;}static int uhci_submit_bulk(struct uhci_hcd *uhci, struct urb *urb,		struct uhci_qh *qh){	int ret;	/* Can't have low-speed bulk transfers */	if (urb->dev->speed == USB_SPEED_LOW)		return -EINVAL;	if (qh->state != QH_STATE_ACTIVE)		qh->skel = SKEL_BULK;	ret = uhci_submit_common(uhci, urb, qh);	if (ret == 0)		uhci_add_fsbr(uhci, urb);	return ret;}static int uhci_submit_interrupt(struct uhci_hcd *uhci, struct urb *urb,		struct uhci_qh *qh){	int ret;	/* USB 1.1 interrupt transfers only involve one packet per interval.	 * Drivers can submit URBs of any length, but longer ones will need	 * multiple intervals to complete.	 */	if (!qh->bandwidth_reserved) {		int exponent;		/* Figure out which power-of-two queue to use */		for (exponent = 7; exponent >= 0; --exponent) {			if ((1 << exponent) <= urb->interval)				break;		}		if (exponent < 0)			return -EINVAL;		qh->period = 1 << exponent;		qh->skel = SKEL_INDEX(exponent);		/* For now, interrupt phase is fixed by the layout		 * of the QH lists. */		qh->phase = (qh->period / 2) & (MAX_PHASE - 1);		ret = uhci_check_bandwidth(uhci, qh);		if (ret)			return ret;	} else if (qh->period > urb->interval)		return -EINVAL;		/* Can't decrease the period */	ret = uhci_submit_common(uhci, urb, qh);	if (ret == 0) {		urb->interval = qh->period;		if (!qh->bandwidth_reserved)			uhci_reserve_bandwidth(uhci, qh);	}	return ret;}/* * Fix up the data structures following a short transfer */static int uhci_fixup_short_transfer(struct uhci_hcd *uhci,		struct uhci_qh *qh, struct urb_priv *urbp){	struct uhci_td *td;	struct list_head *tmp;	int ret;	td = list_entry(urbp->td_list.prev, struct uhci_td, list);	if (qh->type == USB_ENDPOINT_XFER_CONTROL) {		/* When a control transfer is short, we have to restart		 * the queue at the status stage transaction, which is		 * the last TD. */		WARN_ON(list_empty(&urbp->td_list));		qh->element = LINK_TO_TD(td);		tmp = td->list.prev;		ret = -EINPROGRESS;	} else {		/* When a bulk/interrupt transfer is short, we have to		 * fix up the toggles of the following URBs on the queue		 * before restarting the queue at the next URB. */		qh->initial_toggle = uhci_toggle(td_token(qh->post_td)) ^ 1;		uhci_fixup_toggles(qh, 1);		if (list_empty(&urbp->td_list))			td = qh->post_td;		qh->element = td->link;		tmp = urbp->td_list.prev;		ret = 0;	}	/* Remove all the TDs we skipped over, from tmp back to the start */	while (tmp != &urbp->td_list) {		td = list_entry(tmp, struct uhci_td, list);		tmp = tmp->prev;		uhci_remove_td_from_urbp(td);		uhci_free_td(uhci, td);	}	return ret;}/* * Common result for control, bulk, and interrupt */static int uhci_result_common(struct uhci_hcd *uhci, struct urb *urb){	struct urb_priv *urbp = urb->hcpriv;	struct uhci_qh *qh = urbp->qh;	struct uhci_td *td, *tmp;	unsigned status;	int ret = 0;	list_for_each_entry_safe(td, tmp, &urbp->td_list, list) {		unsigned int ctrlstat;		int len;		ctrlstat = td_status(td);		status = uhci_status_bits(ctrlstat);		if (status & TD_CTRL_ACTIVE)			return -EINPROGRESS;		len = uhci_actual_length(ctrlstat);		urb->actual_length += len;		if (status) {			ret = uhci_map_status(status,					uhci_packetout(td_token(td)));			if ((debug == 1 && ret != -EPIPE) || debug > 1) {				/* Some debugging code */				dev_dbg(&urb->dev->dev,						"%s: failed with status %x\n",						__FUNCTION__, status);				if (debug > 1 && errbuf) {					/* Print the chain for debugging */					uhci_show_qh(uhci, urbp->qh, errbuf,							ERRBUF_LEN, 0);					lprintk(errbuf);				}			}		} else if (len < uhci_expected_length(td_token(td))) {			/* We received a short packet */			if (urb->transfer_flags & URB_SHORT_NOT_OK)				ret = -EREMOTEIO;			/* Fixup needed only if this isn't the URB's last TD */			else if (&td->list != urbp->td_list.prev)				ret = 1;		}		uhci_remove_td_from_urbp(td);		if (qh->post_td)			uhci_free_td(uhci, qh->post_td);		qh->post_td = td;		if (ret != 0)			goto err;	}	return ret;err:	if (ret < 0) {		/* In case a control transfer gets an error		 * during the setup stage */		urb->actual_length = max(urb->actual_length, 0);		/* Note that the queue has stopped and save		 * the next toggle value */		qh->element = UHCI_PTR_TERM;		qh->is_stopped = 1;		qh->needs_fixup = (qh->type != USB_ENDPOINT_XFER_CONTROL);		qh->initial_toggle = uhci_toggle(td_token(td)) ^				(ret == -EREMOTEIO);	} else		/* Short packet received */		ret = uhci_fixup_short_transfer(uhci, qh, urbp);	return ret;}/* * Isochronous transfers */static int uhci_submit_isochronous(struct uhci_hcd *uhci, struct urb *urb,		struct uhci_qh *qh){	struct uhci_td *td = NULL;	/* Since urb->number_of_packets > 0 */	int i, frame;	unsigned long destination, status;	struct urb_priv *urbp = (struct urb_priv *) urb->hcpriv;	/* Values must not be too big (could overflow below) */	if (urb->interval >= UHCI_NUMFRAMES ||			urb->number_of_packets >= UHCI_NUMFRAMES)		return -EFBIG;	/* Check the period and figure out the starting frame number */	if (!qh->bandwidth_reserved) {		qh->period = urb->interval;		if (urb->transfer_flags & URB_ISO_ASAP) {			qh->phase = -1;		/* Find the best phase */			i = uhci_check_bandwidth(uhci, qh);			if (i)				return i;			/* Allow a little time to allocate the TDs */			uhci_get_current_frame_number(uhci);			frame = uhci->frame_number + 10;			/* Move forward to the first frame having the			 * correct phase */			urb->start_frame = frame + ((qh->phase - frame) &					(qh->period - 1));		} else {			i = urb->start_frame - uhci->last_iso_frame;			if (i <= 0 || i >= UHCI_NUMFRAMES)				return -EINVAL;			qh->phase = urb->start_frame & (qh->period - 1);			i = uhci_check_bandwidth(uhci, qh);			if (i)				return i;		}	} else if (qh->period != urb->interval) {		return -EINVAL;		/* Can't change the period */	} else {	/* Pick up where the last URB leaves off */		if (list_empty(&qh->queue)) {			frame = qh->iso_frame;		} else {			struct urb *lurb;			lurb = list_entry(qh->queue.prev,					struct urb_priv, node)->urb;			frame = lurb->start_frame +					lurb->number_of_packets *					lurb->interval;		}		if (urb->transfer_flags & URB_ISO_ASAP)			urb->start_frame = frame;		else if (urb->start_frame != frame)			return -EINVAL;	}	/* Make sure we won't have to go too far into the future */	if (uhci_frame_before_eq(uhci->last_iso_frame + UHCI_NUMFRAMES,			urb->start_frame + urb->number_of_packets *				urb->interval))		return -EFBIG;	status = TD_CTRL_ACTIVE | TD_CTRL_IOS;	destination = (urb->pipe & PIPE_DEVEP_MASK) | usb_packetid(urb->pipe);	for (i = 0; i < urb->number_of_packets; i++) {		td = uhci_alloc_td(uhci);		if (!td)			return -ENOMEM;		uhci_add_td_to_urbp(td, urbp);		uhci_fill_td(td, status, destination |				uhci_explen(urb->iso_frame_desc[i].length),				urb->transfer_dma +					urb->iso_frame_desc[i].offset);	}	/* Set the interrupt-on-completion flag on the last packet. */	td->status |= __constant_cpu_to_le32(TD_CTRL_IOC);	/* Add the TDs to the frame list */	frame = urb->start_frame;	list_for_each_entry(td, &urbp->td_list, list) {		uhci_insert_td_in_frame_list(uhci, td, frame);		frame += qh->period;	}	if (list_empty(&qh->queue)) {		qh->iso_packet_desc = &urb->iso_frame_desc[0];		qh->iso_frame = urb->start_frame;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91福利在线看| a亚洲天堂av| 欧美色图片你懂的| 日韩精品一区二区三区视频| 国产精品久久久久久久久免费樱桃| 亚洲综合色噜噜狠狠| 99视频在线精品| 成人精品国产福利| 狠狠色丁香久久婷婷综合_中| 理论电影国产精品| 亚洲影院久久精品| 日韩一区精品字幕| 成人在线视频一区二区| 久久综合av免费| 粉嫩aⅴ一区二区三区四区五区| 337p日本欧洲亚洲大胆精品| 久久99国产精品免费网站| 国产精品久久久久影院亚瑟| 色婷婷av一区二区三区之一色屋| 制服丝袜成人动漫| 日韩黄色免费网站| 不卡的电影网站| 国产午夜精品福利| 亚洲一卡二卡三卡四卡无卡久久 | 91免费在线播放| 亚洲成av人**亚洲成av**| 欧美变态口味重另类| a级高清视频欧美日韩| 夜夜精品浪潮av一区二区三区| 3d成人动漫网站| 99久久精品久久久久久清纯| 亚洲一区二区四区蜜桃| 精品国产网站在线观看| 99久久婷婷国产综合精品电影| 亚洲第一久久影院| 国产精品久久久久久妇女6080| 色噜噜狠狠色综合中国| 亚洲成a人片在线不卡一二三区| 欧美videos大乳护士334| 欧美综合一区二区| 成人美女视频在线观看18| 午夜视频一区二区三区| 日本一区二区三区免费乱视频| 宅男噜噜噜66一区二区66| 99精品久久久久久| 99亚偷拍自图区亚洲| 国产98色在线|日韩| 国产精品影视在线| 久久99精品视频| 久久aⅴ国产欧美74aaa| 日韩电影免费在线看| 亚洲动漫第一页| 爽好久久久欧美精品| 日韩主播视频在线| 亚洲成a人片在线不卡一二三区| 亚洲丝袜美腿综合| 亚洲乱码国产乱码精品精98午夜 | 成人黄色国产精品网站大全在线免费观看 | 日韩小视频在线观看专区| 欧美日韩国产高清一区| 成人精品免费看| 成人h精品动漫一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美一级高清片| 国产aⅴ精品一区二区三区色成熟| 亚洲视频免费在线观看| 亚洲精品高清在线观看| 日韩精品成人一区二区在线| 亚洲免费av高清| 亚洲成国产人片在线观看| 日本va欧美va瓶| 国产一区二区不卡老阿姨| 国产成人一区在线| 欧美三级在线看| 久久新电视剧免费观看| 亚洲欧美日韩国产综合在线| 午夜成人在线视频| 丰满亚洲少妇av| 在线电影欧美成精品| 欧美国产日韩精品免费观看| 亚洲一区二区三区四区在线免费观看 | 欧美日韩电影在线| 欧美精品一区二区三| 亚洲精品午夜久久久| 日韩av一级电影| 日韩欧美一卡二卡| 国产精品美女一区二区| 麻豆精品视频在线| 色呦呦日韩精品| 亚洲欧洲精品一区二区精品久久久| 亚洲一区二区黄色| 91在线一区二区| 日韩精品一区二区三区在线观看| 成人欧美一区二区三区黑人麻豆 | 亚洲国产精品影院| 国产一区啦啦啦在线观看| 欧美日本韩国一区| 亚洲无线码一区二区三区| 色噜噜偷拍精品综合在线| 亚洲国产岛国毛片在线| 国产伦精品一区二区三区在线观看| 在线视频欧美精品| 亚洲成人你懂的| 欧美日本韩国一区二区三区视频| 亚洲老司机在线| 欧美男人的天堂一二区| 亚洲va欧美va人人爽| 欧美另类变人与禽xxxxx| 亚洲国产精品一区二区久久| 欧美日韩在线综合| 免费观看日韩电影| 久久久久综合网| av一本久道久久综合久久鬼色| 国产精品久久久久久久久快鸭 | 91麻豆精品国产91久久久更新时间| 亚洲激情图片qvod| 91精品免费观看| 韩国欧美国产一区| 亚洲女厕所小便bbb| 在线欧美小视频| 久久疯狂做爰流白浆xx| 国产欧美日产一区| 欧美日韩成人综合| 国产成人三级在线观看| 亚洲精品大片www| 日韩免费性生活视频播放| 99国内精品久久| 蜜臀国产一区二区三区在线播放| 中文成人综合网| 在线播放国产精品二区一二区四区| 韩国av一区二区| 午夜免费欧美电影| 一区二区三区日韩欧美| 久久理论电影网| 欧美刺激脚交jootjob| 欧美午夜视频网站| 波多野洁衣一区| 国产精品亚洲一区二区三区在线 | 一本到三区不卡视频| 国产麻豆9l精品三级站| 免费成人av在线| 亚洲国产日韩a在线播放性色| 欧美国产国产综合| 久久综合丝袜日本网| 欧美一区二区三区在线观看视频| 色综合视频一区二区三区高清| 国产成人免费视频一区| 精彩视频一区二区| 美女视频黄 久久| 免费的成人av| 捆绑调教美女网站视频一区| 亚洲二区在线观看| 免费观看成人av| 国产一区二区主播在线| 蜜桃av噜噜一区二区三区小说| 一区二区成人在线观看| 亚洲综合区在线| 麻豆免费精品视频| 另类小说综合欧美亚洲| 国产精品18久久久久久vr| 国内成+人亚洲+欧美+综合在线| 久久精品理论片| 高清不卡在线观看| 91传媒视频在线播放| 欧美日韩一级二级| 26uuu亚洲综合色| 国产精品丝袜一区| 亚洲综合色在线| 国产一区二区福利视频| 成人av第一页| 欧美电影免费观看高清完整版| 久久久一区二区三区| 亚洲午夜精品在线| 国产一区二区导航在线播放| 91福利精品视频| 久久在线免费观看| 亚洲一区二区高清| 成人一区二区三区视频在线观看 | 不卡的av电影| 日韩美女天天操| 亚洲第四色夜色| 91蜜桃网址入口| 亚洲国产成人午夜在线一区 | 欧美v日韩v国产v| 亚洲国产精品久久久久秋霞影院| 国产一区二区精品久久91| 欧美日韩一区二区三区不卡| 久久综合视频网| 久久电影国产免费久久电影| 色综合天天综合在线视频| 国产欧美一区二区三区鸳鸯浴| 婷婷久久综合九色国产成人 | 久久电影网站中文字幕| 欧美日本在线播放| 亚洲成人免费影院| 欧美三级午夜理伦三级中视频| 免费人成在线不卡| 欧美一区二区三区免费观看视频 | 色婷婷综合久久久久中文一区二区 | 欧美日韩国产一区二区三区地区|