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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? scc.c

?? TCPIP協(xié)議包
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
		ifp->ioctl = kiss_ioctl;
		ifp->raw = kiss_raw;

		for(xdev = 0;xdev < SLIP_MAX;xdev++){
			if(Slip[xdev].iface == NULL)
				break;
		}
		ifp->xdev = xdev;
		Slip[xdev].iface = ifp;
		Slip[xdev].type = CL_KISS;
		Slip[xdev].send = scc_send;
		Slip[xdev].get = get_scc;
		cp = if_name(ifp," rx");
		ifp->rxproc = newproc(cp,256,slip_rx,xdev,NULL,NULL,0);
		free(cp);
		break;
#endif
#ifdef SLIP
	case 's':	/* slip */
		scc_async(scc);				/* init SCC in async mode */
		brgrate = scc_speed(scc,16,atol(argv[5]));
		scc->speed = Sccinfo.clk / (32L * (brgrate + 2));
		setencap(ifp,"SLIP");
		ifp->ioctl = scc_aioctl;
		ifp->raw = slip_raw;
		for(xdev = 0;xdev < SLIP_MAX;xdev++){
			if(Slip[xdev].iface == NULL)
				break;
		}
		ifp->xdev = xdev;
		Slip[xdev].iface = ifp;
		Slip[xdev].type = CL_SERIAL_LINE;
		Slip[xdev].send = scc_send;
		Slip[xdev].get = get_scc;
		cp = if_name(ifp," rx");

#ifdef VJCOMPRESS
		if((argc > 8) && (strchr(argv[8],'v') != NULL)) {
			Slip[xdev].escaped |= SLIP_VJCOMPR;
			Slip[xdev].slcomp = slhc_init(16,16);

		} else if((argc > 7) && (strchr(argv[7],'v') != NULL)) {
			Slip[xdev].escaped |= SLIP_VJCOMPR;
			Slip[xdev].slcomp = slhc_init(16,16);
		}
#else
		Slip[xdev].slcomp = NULL;
#endif	/* VJCOMPRESS */
		ifp->rxproc = newproc(cp,256,slip_rx,xdev,NULL,NULL,0);
		free(cp);
		break;
#endif
#ifdef NRS
	case 'n':	/* nrs */
		scc_async(scc);				/* init SCC in async mode */
		brgrate = scc_speed(scc,16,atol(argv[5]));
		scc->speed = Sccinfo.clk / (32L * (brgrate + 2));
		setencap(ifp,"AX25UI");
		scc_call(ifp,argc > 7 ? argv[7] : (char *) 0);	/* set the callsign */
		ifp->ioctl = scc_aioctl;
		ifp->raw = nrs_raw;
	
		for(xdev = 0;xdev < NRS_MAX;xdev++)
			if(Nrs[xdev].iface == NULL)
				break;

		ifp->xdev = xdev;
		Nrs[xdev].iface = ifp;
		Nrs[xdev].send = scc_send;
		Nrs[xdev].get = get_scc;
		cp = if_name(ifp," rx");
		ifp->rxproc = newproc(cp,256,nrs_recv,xdev,NULL,NULL,0);
		free(cp);
		break;
#endif
	}
	ifp->next = Ifaces;			/* link interface in list */
	Ifaces = ifp;
	cp = if_name(ifp," tx");
	ifp->txproc = newproc(cp,512,if_tx,0,ifp,NULL,0);
	free(cp);
	return 0;
}

/* SCC driver initialisation. called on "attach scc <num> init ..." */
static int
scc_init(nchips,iobase,space,aoff,boff,doff,intack,ivec,clk,pclk,hwtype,hwparam)
int nchips;			/* number of chips */
ioaddr iobase;			/* base of first chip */
int space,aoff,boff,doff;
ioaddr intack;			/* INTACK ioport or 0 for no INTACK */
int ivec;			/* interrupt vector number */
long clk;			/* clock frequency */
int pclk;			/* PCLK or RTxC for clock */
int hwtype;			/* selection of special hardware types */
int hwparam;			/* extra parameter for special hardware */
{
	int chip,chan;
	ioaddr chipbase;
	register ioaddr ctrl;
    int d;
    int dum = 1;
	int i_state;

#define z 0

	if(Sccinfo.init){
		printf("SCC driver already initialized - nothing done\n");
		return 1;
	}
	Sccinfo.init = 1;
	Sccinfo.nchips = nchips;
	Sccinfo.maxchan = (2 * nchips) - 1;
	Sccinfo.iobase = iobase;
	Sccinfo.space = space;
	Sccinfo.off[0] = aoff;
	Sccinfo.off[1] = boff;
	Sccinfo.doff = doff;
	Sccinfo.ivec = ivec;
	Sccinfo.clk = clk;
	Sccinfo.pclk = pclk;
	Sccinfo.hwtype = hwtype;
	Sccinfo.hwparam = hwparam;

	/* reset and pre-init all chips in the system */
	for(chip = 0; chip < nchips; chip++){
		chipbase = iobase + chip * space;
		ctrl = chipbase + Sccinfo.off[0];
		i_state = dirps();		/* because of 2-step accesses */
		VOID(RDREG(ctrl));		/* make sure pointer is written */
		WRSCC(ctrl,R9,FHWRES);		/* force hardware reset */
		for (d = 0; d < 1000; d++)	/* wait a while to be sure */
			dum *= 10;
		for(chan = 0; chan < 2; chan++){
			ctrl = chipbase + Sccinfo.off[chan];

			/* initialize a single channel to no-op */
			VOID(RDREG(ctrl));		/* make sure pointer is written */
			WRSCC(ctrl,R4,z);		/* no mode selected yet */
			WRSCC(ctrl,R1,z);		/* no W/REQ operation */
			WRSCC(ctrl,R2,16 * chip);	/* chip# in upper 4 bits of vector */
			WRSCC(ctrl,R3,z);		/* disable rx */
			WRSCC(ctrl,R5,z);		/* disable tx */
			WRSCC(ctrl,R9,VIS);		/* vector includes status, MIE off */
			Sccpolltab[chip][chan] = ctrl; /* store ctrl addr for polling */
		}

		if (hwtype & HWSEALEVEL)		/* if a SEALEVEL card, */
			WRREG(chipbase + 4,hwparam);	/* set control/status (DTR) */

		if(hwtype & HWEAGLE)		/* this is an EAGLE card */
			WRREG(chipbase + 4,0x08);	/* enable interrupt on the board */

		if(hwtype & HWPC100)		/* this is a PC100 card */
			WRREG(chipbase,hwparam);	/* set the MODEM mode (22H normally) */

		if(hwtype & HWPRIMUS)		/* this is a PRIMUS-PC */
			WRREG(chipbase + 4,hwparam); /* set the MODEM mode (02H normally) */

		if (hwtype & HWDRSI) {		/* this is a DRSI PC*Packet card */
			ioaddr z8536 = chipbase + 7; /* point to 8536 master ctrl reg */

			/* Initialize 8536 to perform its divide-by-32 function */
			/* This part copied from N6TTO DRSI-driver */

			/* Start by forcing chip into known state */

			VOID(RDREG(z8536));		/* make sure pointer is written */
			WRSCC(z8536,CIO_MICR,0x01); /* force hardware reset */

			for (d = 0; d < 1000; d++)	/* wait a while to be sure */
				dum *= 10;

			WRSCC(z8536,CIO_MICR,0x00); /* Clear reset and start */

			/* Wait for chip to come ready */

			while (RDSCC(z8536,CIO_MICR) != 0x02)
				dum *= 10;

			WRSCC(z8536,CIO_MICR,0x26); /* NV|CT_VIS|RJA */
			WRSCC(z8536,CIO_MCCR,0xf4); /* PBE|CT1E|CT2E|CT3E|PAE */

			WRSCC(z8536,CIO_CTMS1,0xe2);/* Continuous, EOE, ECE, Pulse output */
			WRSCC(z8536,CIO_CTMS2,0xe2);/* Continuous, EOE, ECE, Pulse output */
			
	    WRSCC(z8536,CIO_CT1MSB,0x00); /* Load time constant CTC #1 */
			WRSCC(z8536,CIO_CT1LSB,0x10);
			WRSCC(z8536,CIO_CT2MSB,0x00); /* Load time constant CTC #2 */
			WRSCC(z8536,CIO_CT2LSB,0x10);

			WRSCC(z8536,CIO_IVR,0x06);

			/* Set port direction bits in port A and B		     */
			/* Data is input on bits d1 and d5, output on d0 and d4. */
			/* The direction is set by 1 for input and 0 for output  */

			WRSCC(z8536,CIO_PDCA,0x22);
			WRSCC(z8536,CIO_PDCB,0x22);

			WRSCC(z8536,CIO_CSR1,CIO_GCB|CIO_TCB); /* Start CTC #1 running */
			WRSCC(z8536,CIO_CSR2,CIO_GCB|CIO_TCB); /* Start CTC #2 running */
		}

		restore(i_state);
	}
	Sccpolltab[chip][0] = 0;	/* terminate the polling table */
	Sccvecloc = intack;		/* location of INTACK/vector read */
	Sccmaxvec = 16 * nchips;	/* upper limit on valid vector */
	/* save original interrupt vector */
	Orgivec = getirq(ivec);

	if(intack){	/* INTACK method selected? */
		/* set interrupt vector to INTACK-generating routine  */
		setirq(ivec,sccvec);
	} else {
		/* set interrupt vector to polling routine */
		setirq(ivec,sccnovec);
	}
	/* enable the interrupt  */
	maskon(ivec);
	return 0;
}

/* initialize an SCC channel in asynchronous mode */
static int
scc_async(scc)
register struct sccchan *scc;
{
	register struct fifo *fp = &(scc->fifo);
	int i_state;
	
	if((fp->buf = malloc(scc->bufsiz)) == NULL){
		printf("scc%d: No space for rx buffer\n",scc->iface->dev);
		return -1;
	}
	fp->bufsize = scc->bufsiz;
	fp->wp = fp->rp = fp->buf;
	fp->cnt = 0;

	scc->int_transmit = scc_asytx;	/* set interrupt handlers */
	scc->int_extstat = scc_asyex;
	scc->int_receive = scc_asyrx;
	scc->int_special = scc_asysp;

	i_state = dirps();

	if (scc->extclock) {
		wr(scc,R4,X1CLK|SB1);		/* *1 clock, 1 stopbit, no parity */
		wr(scc,R11,RCRTxCP|TCTRxCP);	/* RXclk RTxC, TXclk TRxC. */
		wr(scc,R14,z);			/* No BRG options */
	wr(scc,R4,X16CLK|SB1);		/* *16 clock, 1 stopbit, no parity */
		wr(scc,R11,RCBR|TCBR);		/* clocks are BR generator */
		wr(scc,R14,Sccinfo.pclk? BRSRC:z); /* brg source = PCLK/RTxC */
	}
	wr(scc,R1,z);			/* no W/REQ operation */
	wr(scc,R3,Rx8);			/* RX 8 bits/char, disabled */
	wr(scc,R5,Tx8|DTR|RTS);		/* TX 8 bits/char, disabled, DTR RTS */
	wr(scc,R9,VIS);			/* vector includes status */
	wr(scc,R10,NRZ|z);			/* select NRZ */
	wr(scc,R15,BRKIE);			/* enable BREAK ext/status int */

	or(scc,R3,RxENABLE);		/* enable receiver */
	or(scc,R5,TxENAB);			/* enable transmitter */

	WRREG(scc->ctrl,RES_EXT_INT);	/* reset ext/status interrupts */
	WRREG(scc->ctrl,RES_EXT_INT);	/* must be done twice */
	scc->status = RDREG(scc->ctrl);	/* read initial status */

	or(scc,R1,INT_ALL_Rx|TxINT_ENAB|EXT_INT_ENAB); /* enable interrupts */
	or(scc,R9,MIE);			/* master interrupt enable */

	restore(i_state);
	return 0;
}

/* initialize an SCC channel in SDLC mode */
static void
scc_sdlc(scc)
register struct sccchan *scc;
{
	int i_state;

	scc->int_transmit = scc_sdlctx;	/* set interrupt handlers */
	scc->int_extstat = scc_sdlcex;
	scc->int_receive = scc_sdlcrx;
	scc->int_special = scc_sdlcsp;

	i_state = dirps();

	wr(scc,R4,X1CLK|SDLC);		/* *1 clock, SDLC mode */
	wr(scc,R1,z);			/* no W/REQ operation */
	wr(scc,R3,Rx8|RxCRC_ENAB);	/* RX 8 bits/char, CRC, disabled */
	wr(scc,R5,Tx8|DTR|TxCRC_ENAB);	/* TX 8 bits/char, disabled, DTR */
	wr(scc,R6,z);			/* SDLC address zero (not used) */
	wr(scc,R7,FLAG);		/* SDLC flag value */
	wr(scc,R9,VIS);			/* vector includes status */
	wr(scc,R10,CRCPS|NRZI|ABUNDER);	/* CRC preset 1, select NRZI, ABORT on underrun */

	if (scc->extclock){			/* when using external clocks */
		/* RXclk RTxC, TXclk TRxC. */
		wr(scc,R11,RCRTxCP|TCTRxCP);
		wr(scc,R14,z);			/* No BRG options */
		WRSCC(scc->ctrl,R14,DISDPLL|scc->wreg[R14]); /* No DPLL operation */
	} else {
		if(scc->fulldup){		/* when external clock divider */
			if(Sccinfo.pclk){	/* when using PCLK as clock source */
				/* RXclk DPLL, TXclk RTxC, out=BRG.	 external /32 TRxC->RTxC */
				wr(scc,R11,RCDPLL|TCRTxCP|TRxCOI|TRxCBR);
			} else {
				/* RXclk DPLL, TXclk TRxC.	external TX clock to TRxC */
				wr(scc,R11,RCDPLL|TCTRxCP);
			}
		} else {		/* only half-duplex operation */
			/* RXclk DPLL, TXclk BRG. BRG reprogrammed at every TX/RX switch */
#ifdef	notdef	/* KA9Q - for PSK modem */
			wr(scc,R11,RCDPLL|TCBR);
#else
			/* DPLL -> Rx clk, DPLL -> Tx CLK, TxCLK -> TRxC pin */
			wr(scc,R11,RCDPLL|TCDPLL|TRxCOI|TRxCDP);
#endif
		}
		wr(scc,R14,Sccinfo.pclk? BRSRC:z);	/* BRG source = PCLK/RTxC */
		WRSCC(scc->ctrl,R14,SSBR|scc->wreg[R14]); /* DPLL source = BRG */
		WRSCC(scc->ctrl,R14,SNRZI|scc->wreg[R14]); /* DPLL NRZI mode */
	}
	wr(scc,R15,BRKIE|CTSIE|DCDIE);	/* enable ABORT, CTS & DCD interrupts */

	if(RDREG(scc->ctrl) & DCD){	/* DCD is now ON */
		if (!scc->extclock)
			WRSCC(scc->ctrl,R14,SEARCH|scc->wreg[R14]); /* DPLL: enter search mode */
		or(scc,R3,ENT_HM|RxENABLE);	/* enable the receiver, hunt mode */
	}
	WRREG(scc->ctrl,RES_EXT_INT);	/* reset ext/status interrupts */
	WRREG(scc->ctrl,RES_EXT_INT);	/* must be done twice */
	scc->status = RDREG(scc->ctrl);	/* read initial status */

	or(scc,R1,INT_ALL_Rx|TxINT_ENAB|EXT_INT_ENAB); /* enable interrupts */
	or(scc,R9,MIE);			/* master interrupt enable */

	restore(i_state);
}

/* set SCC channel speed
 * clkmode specifies the division rate (1,16,32) inside the SCC
 * returns the selected brgrate for "real speed" calculation
 */
static unsigned int
scc_speed(scc,clkmode,speed)
register struct sccchan *scc;
unsigned int clkmode;
long speed;				/* the desired baudrate */
{
	unsigned int brgrate;
	long spdclkm;
	int i_state;

	/* calculate baudrate generator value */

    if ((spdclkm = speed * clkmode) == 0)
	return 65000U;			/* avoid divide-by-zero */

	brgrate = (unsigned) ((Sccinfo.clk + spdclkm) / (spdclkm * 2)) - 2;

	i_state = dirps();		/* 2-step register accesses... */

	cl(scc,R14,BRENABL);		/* disable baudrate generator */
	wr(scc,R12,brgrate);		/* brg rate LOW */
	wr(scc,R13,brgrate >> 8);		/* brg rate HIGH */
	or(scc,R14,BRENABL);		/* enable baudrate generator */

	restore(i_state);
	return brgrate;
}

/* de-activate SCC channel */
static int
scc_stop(ifp)
struct iface *ifp;
{
	struct sccchan *scc = Sccchan[ifp->dev];
	int i_state;

	i_state = dirps();

	VOID(RDREG(scc->ctrl));		/* make sure pointer is written */
	wr(scc,R9,(ifp->dev % 2)? CHRB : CHRA); /* reset the channel */

	switch(ifp->iftype->type){

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本欧美韩国一区三区| 久久精品国产亚洲a| 欧美日韩国产首页在线观看| 激情久久五月天| 怡红院av一区二区三区| 国产午夜精品在线观看| 欧美精品在线观看播放| av一区二区三区四区| 免费精品视频在线| 亚洲精品免费在线| 国产欧美一区二区三区在线老狼| 欧美三级午夜理伦三级中视频| 成人一级片在线观看| 日本色综合中文字幕| 一区二区三区鲁丝不卡| 国产精品蜜臀在线观看| 精品91自产拍在线观看一区| 欧美日韩aaa| 色综合天天综合狠狠| 国产白丝网站精品污在线入口| 美腿丝袜亚洲三区| 午夜精品久久久久久久99水蜜桃| 亚洲婷婷在线视频| 国产精品国产自产拍高清av| 国产日韩欧美激情| 免费的国产精品| 亚洲一卡二卡三卡四卡| 亚洲欧洲av在线| 国产日产欧产精品推荐色| 精品国产一区久久| 欧美一卡二卡在线| 9191成人精品久久| 欧美三级中文字| 欧美日韩精品高清| 欧美精品日韩一区| 欧美日韩精品是欧美日韩精品| 欧美影院一区二区| 欧美三日本三级三级在线播放| 在线免费观看日本欧美| 色综合久久中文综合久久97| 99精品久久只有精品| 92国产精品观看| 色婷婷综合久久久久中文一区二区 | 精品国产电影一区二区| 26uuu亚洲综合色欧美| 精品久久国产字幕高潮| 精品99999| 国产亚洲美州欧州综合国| 国产午夜精品美女毛片视频| 国产亚洲欧美日韩日本| 中文字幕中文字幕一区二区| 亚洲女同ⅹxx女同tv| 亚洲一区二区中文在线| 日韩精品1区2区3区| 精品一区二区三区免费观看| 国产成人在线免费观看| 波多野结衣一区二区三区| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 国产色婷婷亚洲99精品小说| 中文成人综合网| 亚洲美女屁股眼交3| 午夜精品福利视频网站| 久久精品免费观看| 国产一区二区在线视频| av成人免费在线| 欧美中文字幕一区二区三区亚洲| 欧美精品一卡两卡| 久久久久国产精品人| 亚洲三级电影网站| 日韩中文字幕一区二区三区| 久久99精品国产.久久久久| 国产成人一区在线| 欧美中文字幕一区| 精品成人a区在线观看| 亚洲欧美怡红院| 午夜在线电影亚洲一区| 国内精品嫩模私拍在线| 一本到不卡免费一区二区| 91精品国产入口| 国产免费久久精品| 日本道在线观看一区二区| 欧美另类一区二区三区| 国产亚洲综合在线| 亚洲午夜免费电影| 国产精品一区二区无线| 欧美午夜精品久久久久久超碰 | 麻豆免费精品视频| 91在线看国产| 欧美一区二区三区在线观看| 国产精品久久久久久久久免费相片| 亚洲一区在线电影| 国产91在线观看丝袜| 欧美日韩aaaaaa| 国产精品美女久久久久av爽李琼| 亚洲chinese男男1069| 成人深夜在线观看| 欧美一三区三区四区免费在线看| 国产精品日日摸夜夜摸av| 日韩电影在线免费看| 91麻豆免费看| 久久精品男人的天堂| 免费看日韩a级影片| 色婷婷久久综合| 久久久www免费人成精品| 日日夜夜一区二区| 91黄色免费看| 国产精品久久毛片| 国产精品影视在线观看| 日韩亚洲欧美在线| 亚洲图片欧美一区| 99在线精品视频| 国产网站一区二区三区| 美女精品一区二区| 欧美另类z0zxhd电影| 亚洲精品视频在线看| 成人午夜看片网址| 久久久久久久久久久久久女国产乱| 偷窥国产亚洲免费视频| 欧美羞羞免费网站| 亚洲视频在线一区观看| av不卡在线播放| 中文字幕免费观看一区| 国产毛片精品一区| 欧美不卡一二三| 奇米影视7777精品一区二区| 欧美精品丝袜中出| 亚洲妇女屁股眼交7| 欧美亚洲高清一区二区三区不卡| 亚洲精品综合在线| 日本韩国欧美在线| 一区二区三区精品| 色94色欧美sute亚洲线路一ni| 自拍偷拍国产亚洲| 色丁香久综合在线久综合在线观看| 中文字幕日韩av资源站| www.久久精品| 亚洲视频每日更新| 色哟哟亚洲精品| 樱花影视一区二区| 欧美日韩免费观看一区二区三区| 亚洲国产日韩精品| 欧美老肥妇做.爰bbww| 欧美日韩你懂得| 亚洲国产一区二区视频| 6080国产精品一区二区| 奇米四色…亚洲| 久久久久国产精品免费免费搜索| 国产成人在线色| 亚洲色图丝袜美腿| 欧美午夜在线一二页| 午夜电影一区二区三区| 欧美α欧美αv大片| 国内精品自线一区二区三区视频| 国产欧美日韩在线看| 不卡电影一区二区三区| 亚洲一区二区综合| 日韩欧美不卡在线观看视频| 国产精品自拍三区| 亚洲蜜桃精久久久久久久| 欧美视频精品在线| 久久成人麻豆午夜电影| 国产精品久久免费看| 欧美日韩视频在线第一区| 捆绑变态av一区二区三区| 欧美国产日韩亚洲一区| 色94色欧美sute亚洲线路二 | 欧美国产精品久久| 色综合久久综合中文综合网| 奇米精品一区二区三区四区| 久久久精品免费观看| 在线观看免费一区| 麻豆一区二区三区| 亚洲人成影院在线观看| 91精品国产一区二区三区| 国产大陆精品国产| 亚洲成人黄色影院| 久久久精品2019中文字幕之3| 色偷偷久久一区二区三区| 老司机精品视频在线| 亚洲视频一区在线| 91精品国产综合久久久久久漫画 | 色视频欧美一区二区三区| 日本视频免费一区| 国产精品成人午夜| 日韩一区二区三区免费观看 | 日韩美女一区二区三区| av在线综合网| 美国一区二区三区在线播放| 中文字幕一区二区三区不卡在线 | 国产精品色呦呦| 欧美精品日韩精品| 成人aa视频在线观看| 日韩av成人高清| 中文字幕字幕中文在线中不卡视频| 日韩亚洲欧美在线| 欧美午夜精品久久久久久超碰| 成人精品视频一区| 九九**精品视频免费播放| 亚洲成人在线免费| 亚洲免费看黄网站|