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

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

?? serial.c

?? 一個2.4.21版本的嵌入式linux內核
?? C
?? 第 1 頁 / 共 5 頁
字號:
		for (i = 0; i < NR_PORTS; i++) {		info = rs_table + i;		if (!info->enabled || !info->uses_dma) 			continue; 		/* check for dma_descr (don't need to check for dma_eop in output dma for serial */		if (ireg & info->irq) {  			/* we can send a new dma bunch. make it so. */			DEBUG_LOG(info->line, "tr_interrupt %i\n", i);			/* Read jiffies_usec first, 			 * we want this time to be as late as possible			 */ 			PROCSTAT(ser_stat[info->line].tx_dma_ints++);			info->last_tx_active_usec = GET_JIFFIES_USEC();			info->last_tx_active = jiffies;			transmit_chars(info);		}				/* FIXME: here we should really check for a change in the		   status lines and if so call status_handle(info) */	}}/* dma input channel interrupt handler */static void rec_interrupt(int irq, void *dev_id, struct pt_regs * regs){	struct e100_serial *info;	unsigned long ireg;	int i;#ifdef CONFIG_SVINTO_SIM	/* No receive in the simulator.  Will probably be when the rest of	 * the serial interface works, and this piece will just be removed.	 */	{		const char *s = "What? rec_interrupt in simulator??\n";		SIMCOUT(s,strlen(s));	}	return;#endif		/* find out the line that caused this irq and get it from rs_table */		ireg = *R_IRQ_MASK2_RD;  /* get the active irq bits for the dma channels */		for (i = 0; i < NR_PORTS; i++) {		info = rs_table + i;		if (!info->enabled || !info->uses_dma) 			continue; 		/* check for both dma_eop and dma_descr for the input dma channel */		if (ireg & ((info->irq << 2) | (info->irq << 3))) {			/* we have received something */			receive_chars(info);		}				/* FIXME: here we should really check for a change in the		   status lines and if so call status_handle(info) */	}}static _INLINE_ intforce_eop_if_needed(struct e100_serial *info){	/* We check data_avail bit to determine if data has 	 * arrived since last time	 */ 	unsigned char rstat = info->port[REG_STATUS];	/* error or datavail? */	if (rstat & SER_ERROR_MASK) { 		/* Some error has occurred. If there has been valid data, an		 * EOP interrupt will be made automatically. If no data, the		 * normal ser_interrupt should be enabled and handle it.		 * So do nothing!		 */		DEBUG_LOG(info->line, "timeout err: rstat 0x%03X\n",		          rstat | (info->line << 8));		return 0;	}	if (rstat & SER_DATA_AVAIL_MASK) { 		/* Ok data, no error, count it */		TIMERD(DEBUG_LOG(info->line, "timeout: rstat 0x%03X\n",		          rstat | (info->line << 8)));		/* Read data to clear status flags */		(void)info->port[REG_DATA];		info->forced_eop = 0;		START_FLUSH_FAST_TIMER(info, "magic");		return 0;	}	/* hit the timeout, force an EOP for the input	 * dma channel if we haven't already	 */	if (!info->forced_eop) {		info->forced_eop = 1;		PROCSTAT(ser_stat[info->line].timeout_flush_cnt++);		DEBUG_LOG(info->line, "timeout EOP %i\n", info->line);		FORCE_EOP(info);	}	return 1;}extern _INLINE_ voidflush_to_flip_buffer(struct e100_serial *info){	struct tty_struct *tty;	struct etrax_recv_buffer *buffer;	unsigned int length;	unsigned long flags;	if (!info->first_recv_buffer)		return;	save_flags(flags);	cli();	if (!(tty = info->tty)) {		restore_flags(flags);		return;	}	length = tty->flip.count;	while ((buffer = info->first_recv_buffer) && length < TTY_FLIPBUF_SIZE) {		unsigned int count = buffer->length;		if (length + count > TTY_FLIPBUF_SIZE)			count = TTY_FLIPBUF_SIZE - length;		memcpy(tty->flip.char_buf_ptr + length, buffer->buffer, count);		memset(tty->flip.flag_buf_ptr + length, TTY_NORMAL, count);		tty->flip.flag_buf_ptr[length] = buffer->error;		length += count;		info->recv_cnt -= count;		if (count == buffer->length) {			info->first_recv_buffer = buffer->next;			kfree(buffer);		} else {			buffer->length -= count;			memmove(buffer->buffer, buffer->buffer + count, buffer->length);			buffer->error = TTY_NORMAL;		}	}	if (!info->first_recv_buffer)		info->last_recv_buffer = NULL;	tty->flip.count = length;	restore_flags(flags);#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,66)	/* this includes a check for low-latency */	tty_flip_buffer_push(tty);#else	queue_task_irq_off(&tty->flip.tqueue, &tq_timer);#endif}static _INLINE_ voidcheck_flush_timeout(struct e100_serial *info){	force_eop_if_needed(info);	flush_to_flip_buffer(info);	if (info->first_recv_buffer)		START_FLUSH_FAST_TIMER(info, "flip");}#ifdef CONFIG_ETRAX_SERIAL_FAST_TIMERstatic void flush_timeout_function(unsigned long data){	struct e100_serial *info = (struct e100_serial *)data;	fast_timers[info->line].function = NULL;	serial_fast_timer_expired++;	TIMERD(DEBUG_LOG(info->line, "flush_timout %i ", info->line));	TIMERD(DEBUG_LOG(info->line, "num expired: %i\n", serial_fast_timer_expired));	check_flush_timeout(info);}#elif defined(CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST)static void timeout_interrupt(int irq, void *dev_id, struct pt_regs *regs){	struct e100_serial *info;	int i;	#ifdef CONFIG_SVINTO_SIM	/* No receive in the simulator.  Will probably be when the rest of	 * the serial interface works, and this piece will just be removed.	 */	{		const char *s = "What? timeout_interrupt in simulator??\n";		SIMCOUT(s,strlen(s));	}	return;#endif	/* acknowledge the timer1 irq */	*R_TIMER_CTRL = r_timer_ctrl_shadow | IO_STATE(R_TIMER_CTRL, i1, clr);	PROCSTAT(fast_timer_ints++);		for (i = 0; i < NR_PORTS; i++) {		info = rs_table + i;		if (info->enabled && info->uses_dma) 			check_flush_timeout(info);	}} /* timeout_interrupt */#else/* dma fifo/buffer timeout handler   forces an end-of-packet for the dma input channel if no chars    have been received for CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS/100 s.   If CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST is configured then this   handler is instead run at 15360 Hz.*/static struct timer_list flush_timer;static void timed_flush_handler(unsigned long ptr){	struct e100_serial *info;	int i;#ifdef CONFIG_SVINTO_SIM	return;#endif		for (i = 0; i < NR_PORTS; i++) {		info = rs_table + i;		if (info->uses_dma) 			check_flush_timeout(info);	}	/* restart flush timer */	mod_timer(&flush_timer, jiffies + CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS);}#endif#ifdef SERIAL_HANDLE_EARLY_ERRORS/* If there is an error (ie break) when the DMA is running and * there are no bytes in the fifo the DMA is stopped and we get no * eop interrupt. Thus we have to monitor the first bytes on a DMA * transfer, and if it is without error we can turn the serial * interrupts off. *//*BREAK handling on ETRAX 100:ETRAX will generate interrupt although there is no stop bit between thecharacters.Depending on how long the break sequence is, the end of the breaksequencewill look differently:| indicates start/end of a character.B= Break character (0x00) with framing error.E= Error byte with parity error received after B characters.F= "Faked" valid byte received immediatly after B characters.V= Valid byte1.    B          BL         ___________________________ V.._|__________|__________|                           |valid data |Multiple frame errors with data == 0x00 (B),the timing matches up "perfectly" so no extra ending char is detected.The RXD pin is 1 in the last interrupt, in that casewe set info->errorcode = ERRCODE_INSERT_BREAK, but we can't reallyknow if another byte will come and this really is case 2. below (e.g F=0xFF or 0xFE)If RXD pin is 0 we can expect another character (see 2. below).2.    B          B          E or F__________________..__ V.._|__________|__________|______    |                 |valid data                          "valid" or                           parity errorMultiple frame errors with data == 0x00 (B),but the part of the break trigs is interpreted as a start bit (and possiblysome 0 bits followed by a number of 1 bits and a stop bit).Depending on parity settings etc. this last character can be eithera fake "valid" char (F) or have a parity error (E).If the character is valid it will be put in the buffer,we set info->errorcode = ERRCODE_SET_BREAK so the receive interruptwill set the flags so the tty will handle it,if it's an error byte it will not be put in the bufferand we set info->errorcode = ERRCODE_INSERT_BREAK.To distinguish a V byte in 1. from an F byte in 2. we keep a timestampof the last faulty char (B) and compares it with the current time:If the time elapsed time is less then 2*char_time_usec we will assumeit's a faked F char and not a Valid char and set info->errorcode = ERRCODE_SET_BREAK. Flaws in the above solution:~~~~~~~~~~~~~~~~~~~~~~~~~~~~We use the timer to distinguish a F character from a V character,if a V character is to close after the break we might make the wrong decision.TODO: The break will be delayed until an F or V character is received.*/extern void _INLINE_ handle_ser_interrupt(struct e100_serial *info){	unsigned char rstat = info->port[REG_STATUS];#ifdef SERIAL_DEBUG_INTR	printk("Interrupt from serport %d\n", i);#endif/*	DEBUG_LOG(info->line, "ser_interrupt stat %03X\n", rstat | (i << 8)); */	if (rstat & SER_ERROR_MASK) {		unsigned char data;		info->last_rx_active_usec = GET_JIFFIES_USEC();		info->last_rx_active = jiffies;		/* If we got an error, we must reset it by reading the		 * data_in field		 */		data = info->port[REG_DATA];		if (!data && (rstat & SER_FRAMING_ERR_MASK)) {			/* Most likely a break, but we get interrupts over and			 * over again.			 */			if (!info->break_detected_cnt) {				DEBUG_LOG(info->line, "#BRK start\n", 0);			}			if (rstat & SER_RXD_MASK) {				/* The RX pin is high now, so the break				 * must be over, but....				 * we can't really know if we will get another				 * last byte ending the break or not. 				 * And we don't know if the byte (if any) will 				 * have an error or look valid.				 */				DEBUG_LOG(info->line, "# BL BRK\n", 0);				info->errorcode = ERRCODE_INSERT_BREAK;			}			info->break_detected_cnt++;		} else {			/* The error does not look like a break, but could be			 * the end of one			 */			if (info->break_detected_cnt) {				DEBUG_LOG(info->line, "EBRK %i\n", info->break_detected_cnt);				info->errorcode = ERRCODE_INSERT_BREAK;			} else {				if (info->errorcode == ERRCODE_INSERT_BREAK)					add_char_and_flag(info, '\0', TTY_BREAK);				if (rstat & SER_PAR_ERR_MASK)					add_char_and_flag(info, data, TTY_PARITY);				else if (rstat & SER_OVERRUN_MASK)					add_char_and_flag(info, data, TTY_OVERRUN);				else if (rstat & SER_FRAMING_ERR_MASK)					add_char_and_flag(info, data, TTY_FRAME);				info->errorcode = 0;			}			info->break_detected_cnt = 0;			DEBUG_LOG(info->line, "#iERR s d %04X\n",			          ((rstat & SER_ERROR_MASK) << 8) | data);		}		PROCSTAT(ser_stat[info->line].early_errors_cnt++);	} else { /* It was a valid byte, now let the DMA do the rest */		unsigned long curr_time_u = GET_JIFFIES_USEC();		unsigned long curr_time = jiffies;				if (info->break_detected_cnt) {			/* Detect if this character is a new valid char or the			 * last char in a break sequence: If LSBits are 0 and			 * MSBits are high AND the time is close to the			 * previous interrupt we should discard it.			 */			long elapsed_usec = 			  (curr_time - info->last_rx_active) * (1000000/HZ) + 			  curr_time_u - info->last_rx_active_usec;			if (elapsed_usec < 2*info->char_time_usec) {				DEBUG_LOG(info->line, "FBRK %i\n", info->line);				/* Report as BREAK (error) and let				 * receive_chars() handle it				 */				info->errorcode = ERRCODE_SET_BREAK;			} else {				DEBUG_LOG(info->line, "Not end of BRK (V)%i\n", info->line);			}			DEBUG_LOG(info->line, "num brk %i\n", info->break_detected_cnt);		}#ifdef SERIAL_DEBUG_INTR		printk("** OK, disabling ser_interupts\n");#endif		e100_disable_serial_data_irq(info);		info->break_detected_cnt = 0;		PROCSTAT(ser_stat[info->line].ser_ints_ok_cnt++);		DEBUG_LOG(info->line, "ser_int OK %d\n", info->line);	}	/* Restarting the DMA never hurts */	*info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, restart);	START_FLUSH_FAST_TIMER(info, "ser_int");} /* handle_ser_interrupt */static void ser_interrupt(int irq, void *dev_id, struct pt_regs *regs){	struct e100_serial *info;	int i;	for (i = 0; i < NR_PORTS; i++) {		info = rs_table + i;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品视频自拍| 欧美探花视频资源| 欧美电视剧在线观看完整版| 在线观看91av| 色先锋资源久久综合| 日韩和欧美一区二区| 欧美va亚洲va国产综合| 波多野结衣一区二区三区| 国产精品12区| 成人一区二区三区| 午夜欧美视频在线观看| 亚洲日本在线天堂| 不卡的av在线播放| 欧日韩精品视频| 色999日韩国产欧美一区二区| 乱一区二区av| 久久久五月婷婷| 成人ar影院免费观看视频| 成人av影视在线观看| 国产精品二区一区二区aⅴ污介绍| 久久精品欧美一区二区三区不卡| 国产专区综合网| 91蝌蚪国产九色| 成人免费视频一区| 午夜国产精品一区| 亚洲国产高清aⅴ视频| 欧美日韩精品一区二区天天拍小说 | 91小宝寻花一区二区三区| 日本欧美久久久久免费播放网| 国产在线播精品第三| 婷婷国产在线综合| 亚洲成人手机在线| 91黄视频在线观看| 欧美吞精做爰啪啪高潮| 91九色最新地址| 国产午夜亚洲精品羞羞网站| 91香蕉视频污| 精品一区二区三区不卡| 国产成人亚洲精品青草天美 | 免费观看在线综合色| 精品久久久久99| youjizz久久| 日韩一级高清毛片| 激情久久五月天| 成人自拍视频在线| 久久久精品综合| av在线免费不卡| 99精品偷自拍| 91福利国产成人精品照片| 欧美日韩国产一级二级| 成人精品鲁一区一区二区| 国产精品美女久久久久久2018| 色偷偷久久人人79超碰人人澡| 懂色av一区二区夜夜嗨| 欧美一激情一区二区三区| 色综合一个色综合| 欧美高清视频一二三区| 欧美四级电影网| 99视频精品在线| 久久久777精品电影网影网| 制服.丝袜.亚洲.另类.中文| 国产精品视频一区二区三区不卡| 色8久久人人97超碰香蕉987| 欧美一级片在线观看| 成人一区二区在线观看| 久久99久久99| 欧美在线三级电影| 成人一区二区在线观看| 一本色道久久综合亚洲aⅴ蜜桃 | 日本成人在线一区| 成人激情小说乱人伦| 精品一区二区三区免费播放| 欧美日韩美少妇| 国产米奇在线777精品观看| 在线视频中文字幕一区二区| 国产精品成人免费在线| 欧美精品在线观看一区二区| 在线中文字幕一区二区| 中文一区二区在线观看| 波波电影院一区二区三区| 日韩不卡免费视频| 6080午夜不卡| 青青草国产精品亚洲专区无| 欧美日韩亚洲丝袜制服| 亚洲人成亚洲人成在线观看图片 | 亚洲欧美日韩国产手机在线 | 国产激情精品久久久第一区二区 | 亚洲天天做日日做天天谢日日欢| 久久精品欧美日韩精品| 国产欧美日韩在线观看| 中文字幕日本乱码精品影院| 国产一区二区女| 日韩欧美黄色影院| 精品日产卡一卡二卡麻豆| 国产99久久精品| 色94色欧美sute亚洲线路一久 | 在线免费观看成人短视频| 国内精品第一页| 狠狠色丁香婷婷综合| 久久精品视频一区| 色吧成人激情小说| 国产999精品久久久久久| 老司机精品视频在线| 亚洲欧洲性图库| 欧美日韩三级视频| 国产91色综合久久免费分享| ●精品国产综合乱码久久久久| 欧美激情在线观看视频免费| 日本va欧美va精品发布| 一区二区成人在线视频| 久久色在线视频| 日韩高清不卡在线| 制服丝袜成人动漫| 亚洲精品日韩综合观看成人91| 日韩美女视频一区二区| 久久97超碰国产精品超碰| 色网综合在线观看| 久久婷婷成人综合色| 日韩视频在线观看一区二区| 欧美日韩夫妻久久| 亚洲最新视频在线观看| 精品日韩欧美一区二区| 91国产成人在线| 国产精品国产三级国产aⅴ入口| 一区二区在线观看免费视频播放 | 中文字幕精品一区二区精品绿巨人| 91美女片黄在线观看| 秋霞午夜鲁丝一区二区老狼| 懂色中文一区二区在线播放| 欧美一级黄色大片| 精品国一区二区三区| 亚洲一区二区三区小说| 国产精品乡下勾搭老头1| 日韩国产欧美三级| 日日摸夜夜添夜夜添精品视频| 91在线观看视频| 欧美亚洲国产怡红院影院| 午夜国产精品影院在线观看| 国产三级一区二区| 日韩精品中午字幕| 日日欢夜夜爽一区| 久久日韩粉嫩一区二区三区| 国产福利91精品| 播五月开心婷婷综合| 国产成人午夜片在线观看高清观看| 国产主播一区二区| 日本成人超碰在线观看| 国产色产综合色产在线视频| 激情小说亚洲一区| 欧美这里有精品| 中文字幕乱码亚洲精品一区 | 精品少妇一区二区三区日产乱码| 欧美一区三区二区| 亚州成人在线电影| 国产大陆a不卡| 欧美国产成人精品| 色域天天综合网| 日韩免费高清av| 91精品国产综合久久香蕉麻豆 | 国产不卡一区视频| 99久久精品一区二区| 国内偷窥港台综合视频在线播放| 亚洲成人777| 91精品国产综合久久小美女| 久久综合狠狠综合久久综合88| 欧美视频精品在线观看| 肉丝袜脚交视频一区二区| 精品一二线国产| 欧美日韩一区二区欧美激情| 日韩区在线观看| 国产一区啦啦啦在线观看| 老司机免费视频一区二区三区| 国产精品乱人伦| 一本大道久久a久久综合| 99久久精品国产观看| 免费看欧美女人艹b| 亚洲成在人线在线播放| 天天操天天干天天综合网| 欧美精品三级日韩久久| 国产精品夜夜嗨| 精品无人区卡一卡二卡三乱码免费卡| 337p亚洲精品色噜噜狠狠| 91黄色免费版| 久久九九影视网| 亚洲精品一二三| 欧美成人a视频| 日韩视频一区二区在线观看| 韩国精品主播一区二区在线观看| 中文字幕一区二区三区av| 国产一区二区在线观看视频| 成人av动漫网站| 精品日韩一区二区三区| 男人的j进女人的j一区| 久久久精品tv| 中文字幕不卡在线| 一区二区三区产品免费精品久久75| 免费成人在线观看| 亚洲丰满少妇videoshd| 欧美精品黑人性xxxx| 国产成人av电影在线观看|