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

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

?? hc_simple_isp116x.c

?? 嵌入式USB主控制器ISP1161的驅動編程
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------* * simple generic USB HCD frontend Version 0.9.5 (10/28/2001) * for embedded HCs (eg. isp1161, MPC850, ...) *                              Version Tango (05/11/2004) * * USB URB handling, hci_ hcs_ * URB queueing, qu_ * Transfer scheduling, sh_ * * Roman Weissgaerber weissg@vienna.at (C) 2001* * adsynori 2004 *-------------------------------------------------------------------------* * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *-------------------------------------------------------------------------*//* * V Tango 05/11/2004 ISOC transmission may not stop.(DATA IN)  * V0.9.5 (10/28/2001) start_int()/stop_int() enable interrupt processing on demand *        ISOC processing * V0.9.2 (10/10/2001) sh_done_list: on error just reject last packet * V0.9.1 (10/8/2001)  unlink_urb check also for USB_ST_URB_PENDING * V0.9 (9/23/2001) * * * * * * * */void remove_urb (hci_t * , struct urb *);static int itl_add_packet (hci_t *, struct urb *); /* main lock for urb access */static spinlock_t usb_urb_lock = SPIN_LOCK_UNLOCKED;/*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*//* URB HCD API function layer * * * *//*-------------------------------------------------------------------------*//* set actual length to 0 and set status * queue URB * */static inline int hcs_urb_queue (hci_t * hci, struct urb * urb){	int i;	if (usb_pipeisoc (urb->pipe)) {		hc_start_sof_int (hci);		for (i = 0; i < urb->number_of_packets; i++) {  			urb->iso_frame_desc[i].actual_length = 0;  			urb->iso_frame_desc[i].status = -EXDEV;  		}  		/* urb->next hack : 1 .. resub, 0 .. single shot */  		urb->interval = urb->next ? 1 : 0;        }	urb->status = USB_ST_URB_PENDING;	urb->actual_length = 0;	urb->error_count = 0;	if (usb_pipecontrol (urb->pipe))		hc_flush_data_cache (hci, urb->setup_packet, 8);	if (usb_pipeout (urb->pipe))		hc_flush_data_cache (hci, urb->transfer_buffer,			urb->transfer_buffer_length);	qu_queue_urb (hci, urb);	return 0;}/*-------------------------------------------------------------------------*//* return path (complete - callback) of URB API * also handles resubmition of intr URBs * */static int hcs_return_urb (hci_t * hci, struct urb * urb, int resub_ok){	struct usb_device * dev = urb->dev;	int resubmit = 0;  	resubmit = urb->interval && resub_ok;	urb->dev = urb->hcpriv = NULL;	if (urb->complete) {		urb->complete (urb); /* call complete */	}	if (resubmit) { /* requeue the URB */		urb->dev = dev;		hcs_urb_queue (hci, urb);	}	return 0;}/*-------------------------------------------------------------------------*//* got a transfer request * */static int hci_submit_urb (struct urb * urb){	hci_t * hci;	unsigned int pipe = urb->pipe;	unsigned long flags;	int ret;	if (!urb->dev || !urb->dev->bus || urb->hcpriv)		return -EINVAL;	if (usb_endpoint_halted (urb->dev,				usb_pipeendpoint (pipe), usb_pipeout (pipe)))		return -EPIPE;	hci = (hci_t *) urb->dev->bus->hcpriv;	/* a request to the virtual root hub */	if (usb_pipedevice (pipe) == hci->rh.devnum) {		return rh_submit_urb (urb);	}       if (usb_pipeisoc (urb->pipe)) {       		remove_urb(hci,urb);       }	/* queue the URB to its endpoint-queue */	spin_lock_irqsave (&usb_urb_lock, flags);	ret = hcs_urb_queue (hci, urb);	spin_unlock_irqrestore (&usb_urb_lock, flags);	return ret;}/*-------------------------------------------------------------------------*//* unlink URB: mark the URB to unlink * */static int hci_unlink_urb (struct urb * urb){	unsigned long flags;	hci_t * hci;	DECLARE_WAITQUEUE (wait, current);	void * comp = NULL;	if (!urb) /* just to be sure */		return -EINVAL;	if (!urb->dev || !urb->dev->bus)		return -ENODEV;	hci = (hci_t *) urb->dev->bus->hcpriv;	/* a request to the virtual root hub */	if (usb_pipedevice (urb->pipe) == hci->rh.devnum) {		return rh_unlink_urb (urb);	}			spin_lock_irqsave (&usb_urb_lock, flags);	if (!list_empty (&urb->urb_list) && urb->status == USB_ST_URB_PENDING) { /* URB active? */			if (urb->transfer_flags & (USB_ASYNC_UNLINK | USB_TIMEOUT_KILLED)) {			/* asynchron with callback */			list_del (&urb->urb_list); /* relink the urb to the del list */			list_add (&urb->urb_list, &hci->del_list);			spin_unlock_irqrestore (&usb_urb_lock, flags);		} else { /* synchron without callback */			add_wait_queue (&hci->waitq, &wait);	  			set_current_state (TASK_UNINTERRUPTIBLE);			comp = urb->complete;			urb->complete = NULL;			list_del (&urb->urb_list); /* relink the urb to the del list */			list_add (&urb->urb_list, &hci->del_list);			spin_unlock_irqrestore (&usb_urb_lock, flags);						schedule_timeout(HZ/50);			if (!list_empty (&urb->urb_list))				list_del (&urb->urb_list);			urb->complete = comp;			urb->hcpriv = NULL;			remove_wait_queue (&hci->waitq, &wait); 		}	} else { /* hcd does not own URB but we keep the driver happy anyway */		spin_unlock_irqrestore (&usb_urb_lock, flags);		if (urb->complete && (urb->transfer_flags & USB_ASYNC_UNLINK)) {			urb->status = -ENOENT;			urb->actual_length = 0;			urb->complete (urb);			urb->status = 0;		} else {			urb->status = -ENOENT;		}	}	return 0;}/*-------------------------------------------------------------------------*//* allocate private data space for a usb device * */static int hci_alloc_dev (struct usb_device * usb_dev){	struct hci_device * dev;	int i;	dev = kmalloc (sizeof (*dev), GFP_ATOMIC);	if (!dev)		return -ENOMEM;	memset (dev, 0, sizeof (*dev));	for (i = 0; i < 32; i++) {		INIT_LIST_HEAD (&(dev->ed [i].urb_queue));		dev->ed [i].pipe_head = NULL;	}	usb_dev->hcpriv = dev;	if (hc_verbose)		printk ("USB HC dev alloc %d bytes\n", sizeof (*dev));	return 0;}/*-------------------------------------------------------------------------*//* free private data space of usb device * */static int hci_free_dev (struct usb_device * usb_dev){	if (hc_verbose)		printk ("USB HC dev free\n");	if (usb_dev->hcpriv)		kfree (usb_dev->hcpriv);	usb_dev->hcpriv = NULL;	return 0;}/*-------------------------------------------------------------------------*//* tell us the current USB frame number * */static int hci_get_current_frame_number (struct usb_device *usb_dev){	hci_t * hci = usb_dev->bus->hcpriv;	return GET_FRAME_NUMBER (hci);}/*-------------------------------------------------------------------------*//* make a list of all io-functions  * */static struct usb_operations hci_device_operations = {	hci_alloc_dev,	hci_free_dev,	hci_get_current_frame_number,	hci_submit_urb,	hci_unlink_urb};/*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*//* URB queueing: * * For each type of transfer (INTR, BULK, ISO, CTRL) there is a list of * active URBs. * (hci->intr_list, hci->bulk_list, hci->iso_list, hci->ctrl_list) * For every endpoint the head URB of the queued URBs is linked to one of * those lists. * * The rest of the queued URBs of an endpoint are linked into a * private URB list for each endpoint. (hci_dev->ed [endpoint_io].urb_queue) * hci_dev->ed [endpoint_io].pipe_head .. points to the head URB which is * in one of the active URB lists. * * The index of an endpoint consists of its number and its direction. * * The state of an intr and iso URB is 0.  * For ctrl URBs the states are US_CTRL_SETUP, US_CTRL_DATA, US_CTRL_ACK * Bulk URBs states are US_BULK and US_BULK0 (with 0-len packet) * * * * */#ifdef HC_URB_TIMEOUTstatic void qu_urb_timeout (unsigned long lurb) {	struct urb * urb = (struct urb *) lurb;	urb->transfer_flags |= USB_TIMEOUT_KILLED;	hci_unlink_urb (urb);}#endif/*-------------------------------------------------------------------------*/static inline int qu_pipeindex (__u32 pipe) {	return (usb_pipeendpoint (pipe) << 1) | (usb_pipecontrol (pipe) ?				0 : usb_pipeout (pipe));}static inline void qu_seturbstate (struct urb * urb, int state){	urb->pipe &= ~0x1f;	urb->pipe |= state & 0x1f;}static inline int qu_urbstate (struct urb * urb) {	return urb->pipe & 0x1f;}/*-------------------------------------------------------------------------*/static inline void qu_queue_active_urb (hci_t * hci, struct urb * urb, epd_t * ed){	int urb_state = 0;	switch (usb_pipetype (urb->pipe)) {		case PIPE_CONTROL:			list_add (&urb->urb_list, &hci->ctrl_list);			urb_state = US_CTRL_SETUP;			break;		case PIPE_BULK:			list_add (&urb->urb_list, &hci->bulk_list);			if ((urb->transfer_flags & USB_ZERO_PACKET) &&				urb->transfer_buffer_length > 0 &&				((urb->transfer_buffer_length %					usb_maxpacket (urb->dev, urb->pipe,						usb_pipeout (urb->pipe))) == 0)) {				urb_state = US_BULK0;			}			break;		case PIPE_INTERRUPT:			urb->start_frame = hci->frame_number;			list_add (&urb->urb_list, &hci->intr_list);			break;		case PIPE_ISOCHRONOUS:			list_add (&urb->urb_list, &hci->iso_list);			if ( iso_list_map[0]==-1 ) {				iso_list_map[0] = 0;			} else if ( iso_list_map[1]==-1 ) {				iso_list_map[1] = 0;			} else if ( iso_list_map[2]==-1 ) {				iso_list_map[2] = 0;			} else {				// bug!!				itl_list_error[0]++;				printk (KERN_ERR "iso_urb list full?, error 0\n");			}			break;	}#ifdef HC_URB_TIMEOUT	if (urb->timeout) {		ed->timeout.data = (unsigned long) urb;		ed->timeout.expires = urb->timeout + jiffies;		ed->timeout.function = qu_urb_timeout;		add_timer (&ed->timeout);	}#endif	qu_seturbstate (urb, urb_state);}static int qu_queue_urb (hci_t * hci, struct urb * urb){	struct hci_device * hci_dev = usb_to_hci (urb->dev);	epd_t * ed = &hci_dev->ed [qu_pipeindex (urb->pipe)];	/* for ISOC transfers calculate start frame index */	if (usb_pipeisoc (urb->pipe) && urb->transfer_flags & USB_ISO_ASAP) {                urb->start_frame = ((ed->pipe_head)? (ed->last_iso + 1):				hci_get_current_frame_number (urb->dev) + 3) & 0xffff;              if (!(ed->pipe_head)){                 ed->last_iso = urb->start_frame;              }        }	if (ed->pipe_head) {		__list_add (&urb->urb_list, ed->urb_queue.prev, &(ed->urb_queue));	 } else {	 	ed->pipe_head = urb;		qu_queue_active_urb (hci, urb, ed);		if (++hci->active_urbs == 1)			hc_start_int (hci);	}	return 0;}/*-------------------------------------------------------------------------*//* return path (after transfer) * remove URB from queue and return it to the api layer * */void remove_urb (hci_t * hci, struct urb * urb){       int i;	struct hci_device * hci_dev = usb_to_hci (urb->dev);       for (i = 0; i < 32; i++) {		INIT_LIST_HEAD (&(hci_dev->ed [i].urb_queue));		hci_dev->ed [i].pipe_head = NULL;	}}static struct urb * qu_next_urb (hci_t * hci, struct urb * urb, int resub_ok){	struct hci_device * hci_dev = usb_to_hci (urb->dev);	epd_t * ed = &hci_dev->ed [qu_pipeindex (urb->pipe)];	list_del (&urb->urb_list);	INIT_LIST_HEAD (&urb->urb_list);	if (ed->pipe_head == urb) {#ifdef HC_URB_TIMEOUT		if (urb->timeout)			del_timer (&ed->timeout);#endif		if (!--hci->active_urbs)			hc_stop_int (hci);		if (!list_empty (&ed->urb_queue)) {                    urb = list_entry (ed->urb_queue.next, struct urb, urb_list);			list_del (&urb->urb_list);			INIT_LIST_HEAD (&urb->urb_list);			ed->pipe_head = urb;			qu_queue_active_urb (hci, urb, ed);		} else {			ed->pipe_head = NULL;			urb = NULL;		}	}	return urb;}static struct urb * qu_return_urb (hci_t * hci, struct urb * urb, int resub_ok){	struct urb * next_urb;       	next_urb = qu_next_urb (hci, urb, resub_ok);	hcs_return_urb (hci, urb, resub_ok);	return next_urb;}/****************************************************************************************//*	SCHEDULE operations, especially the iso transfer!! *	we will use list rutines to find pending urb packets on list heads!! * *//****************************************************************************************/static int sh_scan_iso_urb_list (hci_t * hci, struct list_head * iso_list, int frame_number){	struct list_head * iso_list_p;	struct urb * urb;	if ( iso_list_map[0]==-1 && iso_list_map[1]==-1 && iso_list_map[2]==-1 ) {		return 1;	}	if ( iso_list_map[0]==-1 && iso_list_map[1]!=-1 ) {		// report bug		printk (KERN_ERR "bug in sh_scan_iso_urb_list, check iso_list!!, error 1\n");		itl_list_error[1]++;		return 1;	}	if ( iso_list_map[0]<10 ) {		iso_list_p = hci->iso_list.prev;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品一区二区三区不卡 | 国产成人综合在线观看| 国产精品一区二区久激情瑜伽| 91蜜桃网址入口| 日韩你懂的在线观看| 亚洲精品国产成人久久av盗摄| 麻豆精品久久精品色综合| 99精品一区二区| 久久九九久精品国产免费直播| 亚洲一区二区视频| 99久久久久免费精品国产| 欧美精品一区二区三区蜜臀| 亚洲国产aⅴ成人精品无吗| 成人免费va视频| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲国产精品久久久久婷婷884| 国产成人免费av在线| 精品免费日韩av| 日本vs亚洲vs韩国一区三区二区| 91福利资源站| 亚洲人午夜精品天堂一二香蕉| 国产一区 二区 三区一级| 88在线观看91蜜桃国自产| 亚洲综合清纯丝袜自拍| 91蜜桃网址入口| 亚洲欧美电影院| 成人av免费网站| 国产精品久久久久久久岛一牛影视| 久久激情五月激情| 日韩免费视频线观看| 久久99久久99小草精品免视看| 日韩欧美中文字幕制服| 奇米四色…亚洲| 日韩欧美国产一区在线观看| 日韩精品一区第一页| 91麻豆精品国产91久久久久久| 亚洲高清视频的网址| 欧美精选一区二区| 日本伊人精品一区二区三区观看方式| 欧美日韩在线精品一区二区三区激情| 亚洲激情成人在线| 欧美在线免费观看视频| 日韩专区中文字幕一区二区| 3d动漫精品啪啪| 久久99国产精品成人| 久久影视一区二区| 成人在线视频一区二区| 亚洲欧美韩国综合色| 欧美午夜在线观看| 美日韩一区二区| 久久精品夜夜夜夜久久| 播五月开心婷婷综合| 亚洲精品成人少妇| 6080午夜不卡| 国产精品一区不卡| 亚洲精品国产无天堂网2021| 欧美日韩卡一卡二| 久久99久久99| 国产精品伦理在线| 欧美日韩国产美女| 久88久久88久久久| 国产精品久久久久久亚洲伦| 欧美视频在线观看一区二区| 久久精品理论片| 天天色综合成人网| 久久精品视频免费| 在线观看av一区| 国产在线不卡一卡二卡三卡四卡| 国产精品久久久久一区二区三区| 欧美性一区二区| 国内精品伊人久久久久av影院| 亚洲色图19p| 欧美电视剧免费观看| 91在线小视频| 韩国av一区二区三区| 亚洲v精品v日韩v欧美v专区| 久久精品无码一区二区三区| 欧美性大战久久久久久久| 国产一区二区不卡老阿姨| 亚洲国产日产av| 国产欧美日韩亚州综合| 欧美一区二区三区性视频| 91久久国产最好的精华液| 久久久久久9999| 色婷婷精品大在线视频 | 久久久久久电影| 欧美人伦禁忌dvd放荡欲情| 成人午夜激情片| 日韩成人午夜精品| 亚洲激情第一区| 久久精品视频免费观看| 日韩欧美一区二区不卡| 在线视频国内一区二区| 成人av高清在线| 国产一区二区三区黄视频| 奇米精品一区二区三区在线观看| 亚洲天堂网中文字| 中文无字幕一区二区三区| 欧美大片在线观看| 日韩三级视频在线看| 欧美性大战久久| 在线免费不卡视频| 99国产精品久| www..com久久爱| 成人免费av在线| 高清av一区二区| 国产精品一区三区| 精品一区二区三区在线播放视频| 日韩在线卡一卡二| 午夜国产精品影院在线观看| 亚洲午夜私人影院| 亚洲综合视频在线观看| 樱桃视频在线观看一区| 一区二区三区日韩精品视频| 最新久久zyz资源站| 中文字幕一区二区三区在线不卡 | 在线中文字幕不卡| 91小宝寻花一区二区三区| 97aⅴ精品视频一二三区| 97se亚洲国产综合自在线观| 色综合久久久久网| 色综合婷婷久久| 欧美在线综合视频| 欧美精品xxxxbbbb| 日韩欧美国产成人一区二区| 欧美v亚洲v综合ⅴ国产v| 一区二区在线看| 偷拍日韩校园综合在线| 免费观看一级特黄欧美大片| 久久国产欧美日韩精品| 国产成人超碰人人澡人人澡| 成人毛片视频在线观看| 99精品视频在线免费观看| 在线免费精品视频| 91精品国产综合久久久蜜臀粉嫩| 91精品国产一区二区| 久久综合久久综合久久综合| 国产精品三级电影| 亚洲永久免费av| 免费成人在线观看| 国产成人免费视频网站 | 美女诱惑一区二区| 国产精品资源在线看| 91麻豆免费看| 91精品国产91久久久久久最新毛片| 精品久久久久久久久久久久包黑料| 国产偷国产偷精品高清尤物| 亚洲精品精品亚洲| 九九热在线视频观看这里只有精品| 成人一区在线看| 欧美精品黑人性xxxx| 国产女人aaa级久久久级| 一区二区三区成人在线视频| 久久国产三级精品| 一本色道久久加勒比精品| 欧美tickling挠脚心丨vk| 亚洲天堂中文字幕| 久久av老司机精品网站导航| 91热门视频在线观看| 日韩精品一区二区三区四区| 自拍偷拍国产精品| 精品在线观看视频| 欧美在线观看视频在线| 国产清纯白嫩初高生在线观看91 | 首页欧美精品中文字幕| 丁香五精品蜜臀久久久久99网站| 欧美三级电影在线看| 欧美国产精品v| 看国产成人h片视频| 日本国产一区二区| 国产欧美一区二区精品仙草咪| 视频一区欧美精品| 色悠悠亚洲一区二区| 国产喷白浆一区二区三区| 欧美bbbbb| 欧美色图第一页| 一区在线中文字幕| 国产传媒久久文化传媒| 欧美tickling网站挠脚心| 性做久久久久久免费观看欧美| 成人永久看片免费视频天堂| 精品成人a区在线观看| 日韩福利视频网| 欧美伊人精品成人久久综合97| 亚洲国产成人一区二区三区| 激情文学综合网| 日韩小视频在线观看专区| 午夜精品久久久久久久99水蜜桃| 日韩av电影天堂| 成人av免费在线观看| 欧美国产日韩在线观看| 激情五月激情综合网| 精品国产精品一区二区夜夜嗨| 亚洲bt欧美bt精品| 欧美日本在线看| 亚洲高清视频中文字幕| 欧美日韩亚洲综合一区二区三区| 亚洲综合色成人| 欧美视频完全免费看| 一区二区在线看|