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

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

?? serial.c

?? linux平臺上的開放源代碼的網絡攝像機程序.實現視頻捕捉,傳輸以及云臺控制等.非常具有參考價值.
?? C
?? 第 1 頁 / 共 5 頁
字號:
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.*/static 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;		if (!info->uses_dma) 			continue; 		/* Which line caused the irq? */		if (*R_IRQ_MASK1_RD & (1U << (8+2*info->line))) { 			handle_ser_interrupt(info);		}	}} /* ser_interrupt */#endif/* * ------------------------------------------------------------------- * Here ends the serial interrupt routines. * ------------------------------------------------------------------- *//* * This routine is used to handle the "bottom half" processing for the * serial driver, known also the "software interrupt" processing. * This processing is done at the kernel interrupt level, after the * rs_interrupt() has returned, BUT WITH INTERRUPTS TURNED ON.  This * is where time-consuming activities which can not be done in the * interrupt driver proper are done; the interrupt driver schedules * them using rs_sched_event(), and they get done here. */static void do_serial_bh(void){	run_task_queue(&tq_serial);}static void do_softint(void *private_){	struct e100_serial	*info = (struct e100_serial *) private_;	struct tty_struct	*tty;		tty = info->tty;	if (!tty)		return;		if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) {		if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&		    tty->ldisc.write_wakeup)			(tty->ldisc.write_wakeup)(tty);		wake_up_interruptible(&tty->write_wait);	}}/* * This routine is called from the scheduler tqueue when the interrupt * routine has signalled that a hangup has occurred.  The path of * hangup processing is: * * 	serial interrupt routine -> (scheduler tqueue) -> * 	do_serial_hangup() -> tty->hangup() -> rs_hangup() *  */static void do_serial_hangup(void *private_){	struct e100_serial	*info = (struct e100_serial *) private_;	struct tty_struct	*tty;	tty = info->tty;	if (!tty)		return;		tty_hangup(tty);}static int startup(struct e100_serial * info){	unsigned long flags;	unsigned long xmit_page;	unsigned char *recv_page;	xmit_page = get_zeroed_page(GFP_KERNEL);	if (!xmit_page)		return -ENOMEM;	recv_page = kmalloc(2 * SERIAL_RECV_SIZE + SERIAL_RECV_DESCRIPTORS * SERIAL_DESCR_BUF_SIZE, GFP_KERNEL);	if (!recv_page) {		free_page(xmit_page);		return -ENOMEM;	}	save_flags(flags); cli();	/* if it was already initialized, skip this */	if (info->flags & ASYNC_INITIALIZED) {		restore_flags(flags);		free_page(xmit_page);		kfree(recv_page);		return 0;	}	if (info->xmit.buf)		free_page(xmit_page);	else		info->xmit.buf = (unsigned char *) xmit_page;	if (info->recv.buf)		kfree(recv_page);	else {		info->recv.buf = (unsigned char *) recv_page;		info->flag_buf = info->recv.buf + SERIAL_RECV_SIZE;	}#ifdef SERIAL_DEBUG_OPEN	printk("starting up ttyS%d (xmit_buf 0x%p, recv_buf 0x%p)...\n", info->line, info->xmit.buf, info->recv.buf);#endif#ifdef CONFIG_SVINTO_SIM	/* Bits and pieces collected from below.  Better to have them	   in one ifdef:ed clause than to mix in a lot of ifdefs,	   right? */	if (info->tty)		clear_bit(TTY_IO_ERROR, &info->tty->flags);	info->xmit.head = info->xmit.tail = 0;	info->recv.head = info->recv.tail = 0;	/* No real action in the simulator, but may set info important	   to ioctl. */	change_speed(info);#else	/*	 * Clear the FIFO buffers and disable them	 * (they will be reenabled in change_speed())	 */	/*	 * Reset the DMA channels and make sure their interrupts are cleared	 */	info->uses_dma = 1;	*info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);	*info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);	/* Wait until reset cycle is complete */	while (IO_EXTRACT(R_DMA_CH6_CMD, cmd, *info->icmdadr) ==	       IO_STATE_VALUE(R_DMA_CH6_CMD, cmd, reset));	while (IO_EXTRACT(R_DMA_CH6_CMD, cmd, *info->ocmdadr) ==	       IO_STATE_VALUE(R_DMA_CH6_CMD, cmd, reset));	/* Make sure the irqs are cleared */	*info->iclrintradr =		IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) |		IO_STATE(R_DMA_CH6_CLR_INTR, clr_eop, do);	*info->oclrintradr =		IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) |		IO_STATE(R_DMA_CH6_CLR_INTR, clr_eop, do);	if (info->tty)		clear_bit(TTY_IO_ERROR, &info->tty->flags);	info->xmit.head = info->xmit.tail = 0;	info->recv.head = info->recv.tail = 0;		/*	 * and set the speed and other flags of the serial port	 * this will start the rx/tx as well	 */#ifdef SERIAL_HANDLE_EARLY_ERRORS	e100_enable_serial_data_irq(info);#endif		change_speed(info);	/* dummy read to reset any serial errors */	(void)info->port[REG_DATA];	/* enable the interrupts */	e100_enable_txdma_irq(info);	e100_enable_rxdma_irq(info);	info->tr_running = 0; /* to be sure we don't lock up the transmitter */	/* setup the dma input descriptor and start dma */		start_receive(info);		/* for safety, make sure the descriptors last result is 0 bytes written */		info->tr_descr.sw_len = 0;	info->tr_descr.hw_len = 0;	info->tr_descr.status = 0;	/* enable RTS/DTR last */	e100_rts(info, 1);	e100_dtr(info, 1);		#endif /* CONFIG_SVINTO_SIM */		info->flags |= ASYNC_INITIALIZED;		restore_flags(flags);	return 0;}/* * This routine will shutdown a serial port; interrupts are disabled, and * DTR is dropped if the hangup on close termio flag is on. */static void shutdown(struct e100_serial * info){	unsigned long flags;#ifndef CONFIG_SVINTO_SIM		/* shut down the transmitter and receiver */	e100_disable_rx(info);	info->port[REG_TR_CTRL] = (info->tx_ctrl &= ~0x40);	e100_disable_rxdma_irq(info);	e100_disable_txdma_irq(info);	info->tr_running = 0;	/* reset both dma channels */	*info->icmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);	*info->ocmdadr = IO_STATE(R_DMA_CH6_CMD, cmd, reset);	info->uses_dma = 0;#endif /* CONFIG_SVINTO_SIM */	if (!(info->flags & ASYNC_INITIALIZED))		return;	#ifdef SERIAL_DEBUG_OPEN	printk("Shutting down serial port %d (irq %d)....\n", info->line,	       info->irq);#endif		save_flags(flags);	cli(); /* Disable interrupts */		if (info->xmit.buf) {		free_page((unsigned long)info->xmit.buf);		info->xmit.buf = NULL;	}	if (info->recv.buf) {		kfree(info->recv.buf);		info->recv.buf = NULL;		info->flag_buf = NULL;	}	if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) {		/* hang up DTR and RTS if HUPCL is enabled */		e100_dtr(info, 0);		e100_rts(info, 0); /* could check CRTSCTS before doing this */	}	if (info->tty)		set_bit(TTY_IO_ERROR, &info->tty->flags);		info->flags &= ~ASYNC_INITIALIZED;	restore_flags(flags);}/* change baud rate and other assorted parameters */static void change_speed(struct e100_serial *info){	unsigned int cflag;	/* first some safety checks */		if (!info->tty || !info->tty->termios)		return;	if (!info->port)		return;		cflag = info->tty->termios->c_cflag;		/* possibly, the tx/rx should be disabled first to do this safely */		/* change baud-rate and write it to the hardware */		info->baud = cflag_to_baud(cflag);	#ifndef CONFIG_SVINTO_SIM	info->port[REG_BAUD] = cflag_to_etrax_baud(cflag);	/* start with default settings and then fill in changes */	/* 8 bit, no/even parity */	info->rx_ctrl &= ~(IO_MASK(R_SERIAL0_REC_CTRL, rec_bitnr) |			   IO_MASK(R_SERIAL0_REC_CTRL, rec_par_en) |			   IO_MASK(R_SERIAL0_R

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
韩国女主播一区二区三区| 91麻豆6部合集magnet| 色婷婷av一区二区三区大白胸| 日韩精品自拍偷拍| 亚洲成人激情社区| 91精品免费观看| 丝瓜av网站精品一区二区| 91老司机福利 在线| 国产精品热久久久久夜色精品三区| 精品亚洲国内自在自线福利| 欧美一级生活片| 免费成人你懂的| 久久久99免费| 成人av在线资源| 亚洲欧美日韩成人高清在线一区| 成人免费毛片aaaaa**| 亚洲天堂成人网| 欧美女孩性生活视频| 国产制服丝袜一区| 中文字幕在线一区| 欧美色男人天堂| 国产一区二区在线免费观看| 一色桃子久久精品亚洲| 在线观看欧美精品| 国内精品久久久久影院色| 国产欧美日韩另类一区| 91久久线看在观草草青青| 亚洲成av人**亚洲成av**| www一区二区| 91激情在线视频| 激情小说亚洲一区| 一区二区三区波多野结衣在线观看| 91精品久久久久久久99蜜桃| 粉嫩av一区二区三区| 日韩一区精品视频| 亚洲欧洲国产专区| 久久久高清一区二区三区| 色域天天综合网| 丰满亚洲少妇av| 亚洲成a人在线观看| 欧美激情中文不卡| 日韩午夜电影在线观看| 欧美精品三级日韩久久| aaa欧美色吧激情视频| 激情综合五月天| 蜜臀久久久久久久| 亚洲综合免费观看高清在线观看| 久久精品人人做人人爽人人| 欧美日韩色综合| 欧美日本一区二区三区四区| 91国偷自产一区二区开放时间| 成人一区二区三区| 99九九99九九九视频精品| 国产福利视频一区二区三区| 国产麻豆9l精品三级站| 国产精品一区二区免费不卡 | 成人激情小说乱人伦| 国产伦精品一区二区三区视频青涩| 卡一卡二国产精品| 国产资源在线一区| 国产91高潮流白浆在线麻豆| 成人h动漫精品| 在线观看亚洲a| 精品少妇一区二区三区在线视频 | 在线免费精品视频| 69av一区二区三区| 欧美不卡视频一区| 国产精品麻豆网站| 亚洲一区二区3| 精品一区二区三区不卡 | 日韩高清在线电影| 国产精品一区二区视频| 一本大道av一区二区在线播放| 欧美在线免费观看视频| 欧美一区午夜精品| 青娱乐精品视频| 欧美精品一区二区三区蜜桃视频 | 午夜精品在线视频一区| 久久99精品国产麻豆婷婷洗澡| 成人av在线影院| 日韩一区二区免费视频| 成人欧美一区二区三区小说 | 国产日产欧美一区二区视频| 亚洲柠檬福利资源导航| 精品无码三级在线观看视频| 色天天综合久久久久综合片| 日韩情涩欧美日韩视频| 最新高清无码专区| 粉嫩av亚洲一区二区图片| 91精品国产入口| 亚州成人在线电影| 欧美在线观看视频在线| 国产精品视频一区二区三区不卡| 日韩av电影天堂| 在线播放一区二区三区| 亚洲小少妇裸体bbw| 欧美在线视频全部完| 中文字幕一区免费在线观看| 精品一区二区三区视频| 日韩一级视频免费观看在线| 日韩国产欧美在线视频| 欧美久久一二区| 日本伊人午夜精品| 欧美一区午夜视频在线观看 | 三级欧美在线一区| 欧美精品成人一区二区三区四区| 亚洲免费在线观看| 欧美在线观看禁18| 亚洲综合免费观看高清完整版在线 | 久久精品一区二区三区不卡牛牛| 国精产品一区一区三区mba桃花 | 精品在线播放午夜| 国产午夜亚洲精品午夜鲁丝片 | 91麻豆精品久久久久蜜臀| 日韩精品亚洲专区| 精品国产一区二区三区久久久蜜月| 日本美女视频一区二区| 久久午夜老司机| 91欧美一区二区| 日韩专区欧美专区| 久久久夜色精品亚洲| 在线亚洲人成电影网站色www| 亚洲欧美电影院| 日韩欧美在线网站| 91影院在线免费观看| 免费在线观看精品| 日韩理论在线观看| 欧美一区二区三区婷婷月色| 国产不卡免费视频| 亚洲国产欧美在线人成| 欧美国产精品久久| 日韩女优毛片在线| 91高清在线观看| 成人午夜又粗又硬又大| 日韩电影在线免费观看| 亚洲精品国久久99热| 中文乱码免费一区二区| 日韩天堂在线观看| 欧美日韩你懂得| 91官网在线观看| 99麻豆久久久国产精品免费| 国产综合色视频| 国产在线一区二区综合免费视频| 亚洲成人av一区| 亚洲成在人线免费| 亚洲影视在线播放| 亚洲最大的成人av| 亚洲黄色尤物视频| 亚洲视频免费观看| 亚洲日本一区二区三区| 国产精品久久久久久久久动漫| 精品国产百合女同互慰| 精品国产乱码久久久久久夜甘婷婷 | 经典一区二区三区| 极品少妇一区二区三区精品视频 | 91麻豆精品国产91久久久久久| 香蕉久久夜色精品国产使用方法| 在线中文字幕一区| 欧美亚洲一区二区在线| 欧美天堂一区二区三区| 91精品国产综合久久国产大片| 91.麻豆视频| 国产亚洲欧美中文| 亚洲视频免费观看| 奇米在线7777在线精品| 国产乱码字幕精品高清av| 成人毛片老司机大片| 91国偷自产一区二区开放时间 | 99精品热视频| 欧美日韩国产三级| 精品国产电影一区二区 | 欧美一区二区视频免费观看| 精品久久久久久久久久久久久久久| 国产午夜三级一区二区三| 亚洲乱码国产乱码精品精98午夜 | 欧美一级日韩一级| 国产精品久久久久aaaa樱花| 亚洲午夜免费电影| 国产美女精品一区二区三区| 在线影院国内精品| 久久久久久久电影| 乱一区二区av| 欧美日韩大陆一区二区| 久久精品视频一区二区三区| 日韩黄色一级片| 91久久一区二区| 国产精品视频免费看| 韩国女主播成人在线| 欧美三级日韩三级国产三级| 亚洲三级久久久| a级高清视频欧美日韩| 欧美精品一区二区三区高清aⅴ| 一区二区三区小说| 99久久精品免费看| 国产精品网站在线| 国产伦精一区二区三区| 久久亚洲免费视频| 久久精品国产99国产| 欧美成人一级视频| 国产在线视频一区二区三区|