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

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

?? hc_simple_isp116x.c

?? 嵌入式USB主控制器ISP1161的驅動編程
?? C
?? 第 1 頁 / 共 2 頁
字號:
	} else if ( iso_list_map[1]!=-1 ) {		if ( iso_list_map[1]==10 ) {			if ( iso_list_map[2]!=-1 ) {				if ( iso_list_map[2]==10 ) {					return 1;				} else {					iso_list_p = hci->iso_list.prev->prev->prev;				}			} else {				return 1;			}		} else {			iso_list_p = hci->iso_list.prev->prev;		}	} else if ( iso_list_map[1]==-1 ) {		return 1;	} else { 		printk (KERN_ERR "bug , check iso_list!!, error 2\n");		itl_list_error[2]++;		return 1;	}			urb = list_entry (iso_list_p, struct urb, urb_list);	if (frame_number < urb->start_frame) {		if ( urb->start_frame > (0xffff-0x10) ) {			// do nothing..		} else {			return 1;		}	}	itl_add_packet (hci, urb);	return 1;}static int itl_add_packet (hci_t *hci, struct urb *urb) {	__u8 * data = NULL;	int len = 0;	int toggle = 0;	int type = 0;	int maxps;		if (usb_pipeisoc(urb->pipe)) {		maxps = 1023;	} else {		maxps = usb_maxpacket (urb->dev, urb->pipe, usb_pipeout (urb->pipe));	}	int endpoint = usb_pipeendpoint (urb->pipe);	int address = usb_pipedevice (urb->pipe);	int slow = usb_pipeslow (urb->pipe);	int out = usb_pipeout (urb->pipe);	int pid = 0;	int ret;	int i = 0;	int iso = 0;	if (maxps == 0) maxps = 8;	pid = out ? PID_OUT : PID_IN;	iso = 1;	if ( iso_list_map[0]<10 && iso_list_map[0]!=-1 ) {		i = iso_list_map[0];	} else {		i = iso_list_map[1];	}	if ( iso_list_map[0]<10 ) {		iso_list_map[0]++;	} else {		iso_list_map[1]++;	}	data = urb->transfer_buffer + urb->iso_frame_desc[i].offset;	len = urb->iso_frame_desc[i].length;	type = 1;	ret = hc_add_trans (hci, len, data, toggle, maxps, slow, endpoint, address, pid, iso, type);	if (ret<0) {		printk (KERN_ERR "itl_add_packet error!!\n");		return 1;	}	return 0;}static int sh_scan_urb_list (hci_t * hci, struct list_head * list_lh){	struct list_head * lh;	struct urb * urb;	list_for_each (lh, list_lh) {		urb = list_entry (lh, struct urb, urb_list);		if (!usb_pipeint (urb->pipe) || (((hci->frame_number - urb->start_frame) & 0x7ff) >= urb->interval)) {			if (!sh_add_packet (hci, urb)) {				return 0;			} else {				urb->start_frame = hci->frame_number;			}		}	}	return 1;}/*-------------------------------------------------------------------------*//* scan lists of active URBs and construct a schedule for a frame * */static int sh_schedule_trans (hci_t * hci){	int units_left;	struct list_head * lh;	hci->td_array->len = 0;	units_left = sh_scan_urb_list (hci, &hci->intr_list);	if (units_left) {  /* add CTRL transfers */		units_left = sh_scan_urb_list (hci, &hci->ctrl_list);	}	if (units_left) {  /* add BULK transfers */		sh_scan_urb_list (hci, &hci->bulk_list);	}	/* be fair to each BULK URB (move list head around) */	if (!list_empty (&hci->bulk_list)) {		lh = hci->bulk_list.next;		list_del (&hci->bulk_list);		list_add (&hci->bulk_list, lh);	}	return 0;}/*-------------------------------------------------------------------------*//* add some parts of the active URB to the schedule * */static int sh_add_packet (hci_t * hci, struct urb * urb){	__u8 * data = NULL;	int len = 0;	int toggle = 0;	int type = 0;//	int maxps = usb_maxpacket (urb->dev, urb->pipe, usb_pipeout (urb->pipe));	int maxps;		if (usb_pipeisoc(urb->pipe)) {		maxps = 1023;	} else {		maxps = usb_maxpacket (urb->dev, urb->pipe, usb_pipeout (urb->pipe));	}	int endpoint = usb_pipeendpoint (urb->pipe);	int address = usb_pipedevice (urb->pipe);	int slow = usb_pipeslow (urb->pipe);	int out = usb_pipeout (urb->pipe);	int pid = 0;	int ret;	int i = 0;	int iso = 0;	if (maxps == 0) maxps = 8;	/* calculate len, toggle bit and add the transaction */	switch (usb_pipetype (urb->pipe)) {		case PIPE_ISOCHRONOUS:			pid = out ? PID_OUT : PID_IN;			iso = 1;			if (single_itl==0) {				i = hci->frame_number - urb->start_frame;			} else {				i = global_itl;			}			hci->td_array = &hci->i_td_array [i & 1];			if (i == 1) hci->i_td_array[0].len = 1;			data = urb->transfer_buffer + urb->iso_frame_desc[i].offset;			len = urb->iso_frame_desc[i].length;			type = 1;			break;		case PIPE_BULK: /* BULK and BULK0 */		case PIPE_INTERRUPT:			pid = out ? PID_OUT : PID_IN;			len = urb->transfer_buffer_length - urb->actual_length;			data = urb->transfer_buffer + urb->actual_length;			toggle = usb_gettoggle (urb->dev, endpoint, out);			break;		case PIPE_CONTROL:			switch (qu_urbstate (urb)) {				case US_CTRL_SETUP:					len = 8;					pid = PID_SETUP;					data = urb->setup_packet;					toggle = 0;					break;				case US_CTRL_DATA:					if (urb->transfer_buffer_length != 0) {						pid = out ? PID_OUT : PID_IN;						len = urb->transfer_buffer_length - urb->actual_length;						data = urb->transfer_buffer + urb->actual_length;						toggle = (urb->actual_length & maxps) ? 0 : 1;						usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe),								usb_pipeout (urb->pipe), toggle);						break;					} else {						/* correct state and fall through */						qu_seturbstate (urb, US_CTRL_ACK);					}				case US_CTRL_ACK:					len = 0;					/* reply in opposite direction */					pid = !out ? PID_OUT : PID_IN;					toggle = 1;					usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe),								usb_pipeout (urb->pipe), toggle);					break;			}	}	ret = hc_add_trans (hci, len, data, toggle, maxps, slow, endpoint, address, pid, iso, type);        if (ret >= 0) {		hci->td_array->td [hci->td_array->len].urb = urb;		hci->td_array->td [hci->td_array->len].len = ret;		hci->td_array->td [hci->td_array->len].iso_index = i;             	hci->td_array->len = 1;		return 1;	}        return 0;	/* this indicate that we did nothing in hc_add_trans!! */}/***************************************************************************//*	parse the hci->itl_list *	return the iso urb if it has been done! * *//***************************************************************************/static int itl_done_list (hci_t* hci){	int i = 0;	int toggle;	int last = 0;	int totbytes;	int actbytes;	int pid;	int cc;	int active;	void * data = NULL;	__u8* ptd = NULL;	itl_data_t* itl_data_p = NULL;	struct list_head* done_list;	struct urb* iso_urb;	if (!list_empty(&hci->iso_list) ) {		iso_urb = list_entry (hci->iso_list.prev, struct urb, urb_list);		done_list = hci->itl_list.prev;		if ((itl_buffer_die==0 || itl_buffer_die==1) && single_itl==0) {				printk (KERN_EMERG "itl_buffer_die happens, start backup\n"); 	// call this only once immediately			while (hci->itl_list.prev!=&hci->itl_list) {			// after itl_buffer_die and setup				itl_data_p = list_entry (done_list, itl_data_t, list);				list_del (done_list);				kfree (itl_data_p->data_buf);			// we also should delete all itl_list!!				kfree (itl_data_p);			}			single_itl = 1;										force_return_flag = 1;									force_return_count++;			goto force_return;								}		if (list_empty(&hci->itl_list)) {			if (now_sequence > 0) {				global_bh_count++;			}			if (global_bh_count > 10) {//				printk (KERN_EMERG "go to force_return!\n");				force_return_flag = 1;				force_return_count++;				goto force_return;			}		}		while (!list_empty(&hci->itl_list)) {			done_list = hci->itl_list.prev;			itl_data_p = list_entry (done_list, itl_data_t, list);//			i = (itl_data_p->frame_number - iso_urb->start_frame - 2);			i = itl_data_p->sequence;			now_sequence = itl_data_p->sequence;			global_bh_count = 0;			if (i<0 || i>=10) {				printk (KERN_EMERG "error happen in iso transfer!\n");				printk (KERN_DEBUG "f_n :%d s_f :%d , urb: %p \n",itl_data_p->frame_number, iso_urb->start_frame, iso_urb);				list_del (done_list);				kfree (itl_data_p->data_buf);				kfree (itl_data_p);				//FIXME				while (1)				;			}			last_i = i;			data = iso_urb->transfer_buffer + iso_urb->iso_frame_desc [i].offset;			toggle = 0;			ptd = itl_data_p->data_buf;			if (ptd<0xc0000000) {				kernel_panic_count++;				INIT_LIST_HEAD (&hci->itl_list);				force_return_flag = 1;				force_return_count++;				goto force_return;			}			cc = (ptd [1] >> 4) & 0xf;			last = (ptd [3] >> 3) & 0x1;			actbytes = ((ptd [1] & 0x3) << 8) | ptd [0];			totbytes = ((ptd [5] & 0x3) << 8) | ptd [4];			pid = (ptd [5] >> 2) & 0x3;			if (actbytes > itl_data_p->len) {				actbytes = itl_data_p->len;			}			if (pid == PID_IN && actbytes)				memcpy (data, ptd + 8, actbytes);			toggle = (ptd [1] >> 2 & 1);			if (cc > 0 && cc < 0xE && cc != 9)				toggle = !toggle;			if (cc) { /* last packet has an error */				if (++iso_urb->error_count > 3 || cc == TD_CC_STALL) {					active = 0;//					urb_state = 0; /* return */				} else {					active = 1;				}			} else {				iso_urb->error_count = 0;			}			iso_urb->actual_length += actbytes;			usb_settoggle (iso_urb->dev, usb_pipeendpoint (iso_urb->pipe), usb_pipeout (iso_urb->pipe), toggle);			iso_urb->iso_frame_desc [i].actual_length = actbytes;			iso_urb->iso_frame_desc [i].status = cc_to_error [cc];			active = (i < iso_urb->number_of_packets - 1);			if (!active ) {force_return:				itl_reset = 0;				global_bh_count = 0;				qu_return_urb (hci, iso_urb, 1);				if ( iso_list_map[1]!=-1 ) {					iso_list_map[0] = iso_list_map[1];					iso_list_map[1] = iso_list_map[2];					iso_list_map[2] = -1;				} else {					iso_list_map[0] = -1;	// iso_list empty!!				}				if ( iso_list_map[0]==-1 && ((iso_list_map[1]!=-1)||(iso_list_map[2]!=-1)) ) {					itl_list_error[3]++;				}				if ( iso_list_map[1]==-1 && iso_list_map[2]!=-1 ) {					itl_list_error[4]++;				}				iso_urb = list_entry ( hci->iso_list.prev, struct urb, urb_list);				iso_urb->start_frame = ((hci->frame_number + 3)%0x10000);				if (force_return_flag==0) {					list_del (done_list);					kfree (itl_data_p->data_buf);					kfree (itl_data_p);				} else {					force_return_flag = 0;					global_bh_count = 0;					now_sequence = 0;				}				goto out;			}			list_del (done_list);			kfree (itl_data_p->data_buf);			kfree (itl_data_p);		}	} else {		//just debug information (^V^) 		if (hci->iso_list.prev==&hci->iso_list && hci->iso_list.next==&hci->iso_list) {//			hc_stop_sof_int (hci);		} else {			if (hci->iso_list.prev!=&hci->iso_list) {				printk (KERN_DEBUG "list in prev!!\n");			} else {				printk (KERN_DEBUG "list in next!!\n");			}		}	}out:	return 1;}						/*-------------------------------------------------------------------------*//* parse the done_list * */static int sh_done_list (hci_t * hci){	int actbytes;	int active = 0;	void * data = NULL;	int cc;	int maxps;	int toggle;	struct urb * urb;	int urb_state;	int ret = 1; /* -1 parse abbort, 1 parse ok, 0 last element */	int trans = 0;	int len;	int iso_index = 0;       for (trans = 0; ret && trans < hci->td_array->len && trans < MAX_TRANS; trans++) {		urb = hci->td_array->td [trans].urb;		len = hci->td_array->td [trans].len;		if (usb_pipeisoc (urb->pipe)) {                    iso_index = hci->td_array->td [trans].iso_index;			data = urb->transfer_buffer +					urb->iso_frame_desc [iso_index].offset;			toggle = 0;		} else {			data = urb->transfer_buffer + urb->actual_length;			toggle = usb_gettoggle (urb->dev, usb_pipeendpoint (urb->pipe),					usb_pipeout (urb->pipe));		}		urb_state = qu_urbstate (urb);		ret = hc_parse_trans (hci, &actbytes, data, &cc, &toggle, len);		maxps = usb_maxpacket (urb->dev, urb->pipe, usb_pipeout (urb->pipe));		if (maxps == 0) maxps = 8;		if (cc != TD_NOTACCESSED) {			active = (urb_state != US_CTRL_SETUP) &&					(actbytes && !(actbytes & (maxps - 1)) &&					(urb->transfer_buffer_length != urb->actual_length + actbytes));			if (!(urb->transfer_flags & USB_DISABLE_SPD) && cc == TD_DATAUNDERRUN)				cc = 0;			if (cc) { /* last packet has an error */				if (++urb->error_count > 3 || cc == TD_CC_STALL) {					active = 0;					urb_state = 0; /* return */				} else {					active = 1;				}			} else {				urb->error_count = 0;			}			if (urb_state != US_CTRL_SETUP) { /* no error */				urb->actual_length += actbytes;				usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe),					usb_pipeout (urb->pipe),					toggle);			}			if (usb_pipeisoc (urb->pipe)) {				urb->iso_frame_desc [iso_index].actual_length = actbytes;				urb->iso_frame_desc [iso_index].status = cc_to_error [cc];				active = (iso_index < urb->number_of_packets - 1);			}			if (!active) {                                 if (!(urb_state--)) {                                 urb->status = cc_to_error [cc];					qu_return_urb (hci, urb, 1);				} else {					qu_seturbstate (urb, urb_state);				}			}		} else			urb->error_count = 0;	}	hci->td_array->len = 0;	return ret;}/***************************************************************************//*	scan the delete list (qu_return_urb removes URB from list) *  * *//***************************************************************************/static void sh_del_list (hci_t * hci){	struct list_head * lh = &hci->del_list;	struct urb * urb;	if (!list_empty (lh)) {		do {			lh = lh->next;			urb = list_entry (lh, struct urb, urb_list);			qu_return_urb (hci, urb, 0);		} while (!list_empty (lh));		wake_up (&hci->waitq);	}	return;}	

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产精选| 国产亚洲污的网站| 久久蜜桃av一区二区天堂| 中文字幕视频一区| 紧缚捆绑精品一区二区| 色婷婷av一区二区| 国产女人18毛片水真多成人如厕 | 91久久精品一区二区二区| 欧美二区在线观看| 一区二区三区高清不卡| 国产成人精品免费| 精品国产一区二区精华| 日韩精品一二区| 精品视频999| 伊人婷婷欧美激情| 成人aaaa免费全部观看| 精品欧美一区二区久久| 日本成人在线不卡视频| 欧美狂野另类xxxxoooo| 亚洲欧美经典视频| 91丨九色丨黑人外教| 国产精品欧美一区喷水| 国产一区二区在线免费观看| 欧美一区二区三区在线观看| 午夜日韩在线观看| 欧美综合视频在线观看| 亚洲国产精品久久久久婷婷884| 成人av中文字幕| 中文字幕亚洲不卡| 99久久精品国产麻豆演员表| 国产精品第四页| 成人午夜电影久久影院| 国产精品第13页| 91福利在线播放| 亚洲美女视频在线观看| 在线免费观看日本欧美| 亚洲夂夂婷婷色拍ww47| 欧美日韩一级二级| 天堂一区二区在线| 精品av久久707| 国产高清久久久久| 最近中文字幕一区二区三区| 色噜噜久久综合| 婷婷成人激情在线网| 欧美老年两性高潮| 国内精品第一页| 国产精品福利一区| 欧美日韩视频专区在线播放| 美国毛片一区二区三区| 国产色婷婷亚洲99精品小说| 91在线观看视频| 午夜精品123| 精品久久久久久久久久久久包黑料| 久久99国产精品麻豆| 中文一区二区完整视频在线观看| 91免费观看视频| 日韩电影在线免费| 欧美激情在线观看视频免费| 色婷婷综合久久久久中文一区二区| 亚洲国产va精品久久久不卡综合| 欧美一区中文字幕| 成人激情午夜影院| 亚洲国产精品一区二区www| 精品卡一卡二卡三卡四在线| av电影在线观看完整版一区二区| 亚洲成人在线网站| 国产情人综合久久777777| 在线免费亚洲电影| 国产成人在线免费观看| 五月天一区二区三区| 久久色成人在线| 欧美性色黄大片| 岛国一区二区三区| 天天综合色天天| 亚洲美女视频在线观看| 久久综合九色综合欧美98 | 国产91高潮流白浆在线麻豆| 一区二区三区免费看视频| 日韩欧美第一区| 欧洲av在线精品| 99久久精品情趣| 国内精品久久久久影院薰衣草| 亚洲精品你懂的| 久久久久久久久久久电影| 欧美人狂配大交3d怪物一区| 国产福利不卡视频| 免费在线视频一区| 一区二区国产视频| 国产精品亲子乱子伦xxxx裸| 2020国产成人综合网| 欧美精品在线观看播放| 91论坛在线播放| 成人av网站免费| 国产精品99久久久久久久女警| 午夜精品久久久久久久久久| 亚洲色图制服诱惑| 国产精品麻豆99久久久久久| 久久欧美中文字幕| 日韩精品一区二区三区swag| 欧美日韩精品系列| 在线观看www91| 91亚洲精品一区二区乱码| 国产98色在线|日韩| 国模少妇一区二区三区| 美腿丝袜亚洲一区| 日日夜夜精品视频天天综合网| 亚洲三级久久久| 椎名由奈av一区二区三区| 中文字幕av一区 二区| 久久久精品一品道一区| 亚洲精品一区二区三区四区高清| 91精品婷婷国产综合久久性色| 色欧美片视频在线观看在线视频| voyeur盗摄精品| 97精品久久久午夜一区二区三区 | 亚洲视频一二三区| 中文子幕无线码一区tr| 国产精品成人一区二区艾草 | 91搞黄在线观看| 一道本成人在线| 日本高清成人免费播放| 欧洲精品中文字幕| 欧美日本一道本在线视频| 欧美日韩免费在线视频| 91精品国产全国免费观看| 91精品国产综合久久福利| 日韩视频在线永久播放| wwww国产精品欧美| 中文字幕成人网| 亚洲最新视频在线观看| 爽爽淫人综合网网站| 美国毛片一区二区三区| 大胆亚洲人体视频| 91偷拍与自偷拍精品| 欧美日韩电影一区| 精品久久久网站| 国产精品美女久久久久aⅴ| 亚洲私人黄色宅男| 五月天激情小说综合| 狠狠色综合日日| 91亚洲资源网| 日韩免费电影一区| 中文字幕乱码亚洲精品一区| 一区二区三区资源| 另类小说色综合网站| 成人一区在线观看| 欧美日韩高清一区| 国产亚洲综合性久久久影院| 亚洲色图制服诱惑| 青青草精品视频| 成人黄色网址在线观看| 欧美日韩精品久久久| 国产欧美一区二区精品忘忧草| 亚洲婷婷综合久久一本伊一区 | 国产美女视频91| 日本久久精品电影| 日韩一级片网址| 亚洲视频每日更新| 美女网站色91| 欧亚一区二区三区| 日本一区二区三区免费乱视频| 亚洲综合丁香婷婷六月香| 国产夫妻精品视频| 欧美精品777| 亚洲欧美日韩在线不卡| 国产一区二区免费在线| 欧美色大人视频| 成人免费在线视频| 狠狠色丁香婷综合久久| 色婷婷综合激情| 亚洲国产精华液网站w| 久久精品国产精品亚洲精品| 色菇凉天天综合网| 国产欧美日韩激情| 国产在线国偷精品产拍免费yy| 欧美这里有精品| 国产精品国产三级国产aⅴ中文| 狠狠色狠狠色合久久伊人| 欧美一区二区在线看| 一区二区三区美女视频| 99久久精品一区| 中文乱码免费一区二区| 国产一区二三区好的| 制服丝袜国产精品| 亚洲chinese男男1069| 91免费版pro下载短视频| 中文字幕在线一区免费| 国产不卡视频在线播放| 精品99一区二区| 美女视频黄a大片欧美| 欧美三日本三级三级在线播放| 亚洲精品日韩综合观看成人91| av中文字幕在线不卡| 国产精品嫩草影院av蜜臀| 国产馆精品极品| 中文成人av在线| 99国内精品久久| 亚洲精品伦理在线| 91久久一区二区| 亚洲mv大片欧洲mv大片精品|