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

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

?? hs.c

?? TCPIP協議包
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* Interface driver for the DRSI PCPA or the Eagle 8530 boards for the IBM PC
 * connected to a WA4DSY 56kbps modem. Uses polling-loop transfers with
 * interrupts disabled for maximum speed.
 *
 * This driver is a bit of a kludge. A DMA-driven card and driver (e.g.,
 * the PI) is much better, but this is better than nothing if all you have
 * is a "dumb" 8530 card.
 *
 */
#include <stdio.h>
#include <dos.h>
#include "global.h"
#include "mbuf.h"
#include "iface.h"
#include "pktdrvr.h"
#include "netuser.h"
#include "hs.h"
#include "z8530.h"
#include "ax25.h"
#include "trace.h"
#include "nospc.h"
#include "proc.h"
#include "devparam.h"

static void flushrx(uint16 data);
static void hdlcparam(struct hdlc *hp);
static void hexint(struct hdlc *hp);
static void hrxint(struct hdlc *hp);
static int hs_stop(struct iface *iface);
static int hs_raw(struct iface *iface,struct mbuf **bpp);
static int32 hs_ctl(struct iface *,int cmd,int set,int32 val);
static void hstxoff(struct hdlc *hp);
static void hstxon(struct hdlc *hp);
static void htxint(struct hdlc *hp);
static void init_delay(void);
static void msdelay(void);

static struct hs Hs[NHS];
static INTERRUPT (*Hshandle[])() = { hs0vec };
static struct hdlc Hdlc[2*NHS];
static uint16 Nhs;

/* Master interrupt handler for the PC-100 card. All interrupts come
 * here first, then are switched out to the appropriate routine.
 */
INTERRUPT (far *(hsint)(dev))()
int dev;
{
	register char iv;
	uint16 hsbase;
	struct hs *hsp;
	register struct hdlc *hp;
	
	hsp = &Hs[dev];
	hsp->ints++;
	hsbase = hsp->addr;

#ifdef	foo
	outportb(hsbase+4,0x8+0x10);	/* HIT EAGLE INTACK */
	(void)inportb(hsbase+CHANA+CTL,R0);
	outportb(hsbase+4,0x8);		/***/
#endif

	/* Read interrupt status from channel A */
	while((iv = read_scc(hsbase+CHANA+CTL,R3)) != 0){
		if(iv & CHARxIP){
			/* Channel A Rcv Interrupt Pending */
			hp = &Hdlc[2*dev];
			hrxint(hp);
		} else if(iv & CHATxIP){
			/* Channel A Transmit Int Pending */
			hp = &Hdlc[2*dev];
			htxint(hp);
		} else if(iv & CHAEXT){
			/* Channel A External Status Int */
			hp = &Hdlc[2*dev];
			hexint(hp);
		} else if(iv & CHBRxIP){
			/* Channel B Rcv Interrupt Pending */
			hp = &Hdlc[(2*dev)+1];
			hrxint(hp);
		} else if(iv & CHBTxIP){
			/* Channel B Transmit Int Pending */
			hp = &Hdlc[(2*dev)+1];
			htxint(hp);
		} else if(iv & CHBEXT){
			/* Channel B External Status Int */
			hp = &Hdlc[(2*dev)+1];
			hexint(hp);
		}
		/* Reset interrupt pending state */
		write_scc(hp->ctl,R0,RES_H_IUS);
		outportb(hsbase+CHANA+CTL,0);	/* Restore pointer to 0 */
		outportb(hsbase+CHANB+CTL,0);	/* Restore pointer to 0 */
	}
	outportb(hsbase+CHANA+CTL,0);	/* Restore pointer to 0 */
	outportb(hsbase+CHANB+CTL,0);	/* Restore pointer to 0 */
	return hsp->chain ? hsp->save.vec : NULL;
}
/* HDLC SIO External/Status interrupts
 * The only one that can happen in this driver is a DCD change
 */
static void
hexint(hp)
register struct hdlc *hp;
{
	struct mbuf *rcvbuf;
	char *cp;
	int cnt,data;
	register int ctl;

	ctl = hp->ctl;
	data = hp->data;
	hp->exints++;

	/* Allocate a receive buffer */
	if((rcvbuf = alloc_mbuf(hp->bufsiz+sizeof(struct iface *))) == NULL){
		/* Alloc failed; refuse to proceed */
		hp->nomem++;
		write_scc(ctl,R3,ENT_HM|RxENABLE|RxCRC_ENAB|Rx8);
		write_scc(ctl,R0,RES_EXT_INT);
		return;
	}
	/* Allow space for descriptor on front */
	rcvbuf->data += sizeof(struct iface *);
	cnt = 0;

	/* Disable DCDIE bit so we can track changes in DCD */
	write_scc(ctl,R15,0);

	write_scc(ctl,R3,ENT_HM|RxENABLE|RxCRC_ENAB|Rx8);
	flushrx(data);
	while((cnt = rx8530(ctl,data,cp,hp->bufsiz)) != -1){
		if(cnt > 4){
			/* Good frame */
			hp->good++;
			/* Toss crc */
			rcvbuf->cnt = cnt - 1;
			net_route(hp->iface,&rcvbuf);
			/* Replenish buffer */
			rcvbuf = alloc_mbuf(hp->bufsiz + sizeof(struct iface *));
		}
		/* Start new buffer */
		if(rcvbuf == NULL)
			break;	/* alloc failed */
		rcvbuf->data +=  sizeof(struct iface *);
	}	
	write_scc(ctl,R0,RES_EXT_INT);
	write_scc(ctl,R15,DCDIE);	/* Re-enable DCD */
	write_scc(ctl,R3,ENT_HM|RxENABLE|RxCRC_ENAB|Rx8);

	/* Get rid of fragmentary buffer */
	free_p(&rcvbuf);
}
static void
flushrx(data)
register uint16 data;
{
	register int i = 5;
	while(i-- != 0)
		(void)inportb(data);
}
/* HDLC receiver interrupt handler.
 * Not used in this driver
 */
static void
hrxint(hp)
register struct hdlc *hp;
{
}
/* HDLC transmit interrupt service routine
 * Not used in this driver
 */
static void
htxint(hp)
register struct hdlc *hp;
{
}

/* (re)Initialize HDLC controller parameters */
static void
hdlcparam(hp)
register struct hdlc *hp;
{
	register uint16 ctl;
	int i_state;

	/* Initialize 8530 channel for SDLC operation */
	ctl = hp->ctl;
	i_state = dirps();

#ifdef	foo
	switch(ctl & 2){
	case CHANA:
		write_scc(ctl,R9,CHRA);	/* Reset channel A */
		break;
	case CHANB:
		write_scc(ctl,R9,CHRB);	/* Reset channel B */
		break;
	}
	ppause(1L);	/* Allow plenty of time for resetting */
#endif

	/* Deselect interrupts for now */
	write_scc(ctl,R1,0);
	write_scc(ctl,R15,0);

	/* X1 clock, SDLC mode, Sync modes enable, parity disable */
	write_scc(ctl,R4,X1CLK | SDLC | SYNC_ENAB);

	/* CRC preset 1, NRZ encoding, no active on poll, flag idle,
	 * flag on underrun, no loop mode, 8 bit sync
	 */
	write_scc(ctl,R10,CRCPS|NRZ);

	/* 8530 gets both tx and rx clock from modem.
	 * By default, TRxC = transmit clock, RTxC = receive clock
	 * (swapped 11 Feb 1990 to use new DRSI wiring) UNLESS
	 * the 'r' parameter is specified
	 */
	if(!hp->clkrev)
		write_scc(ctl,R11,RCRTxCP | TCTRxCP);
	else
		write_scc(ctl,R11,RCTRxCP | TCRTxCP);

	/* Note: baud rate generator not used */

	/* Null out SDLC start address */
	write_scc(ctl,R6,0);

	/* SDLC flag */
	write_scc(ctl,R7,FLAG);

	/* DTR On, 8 bit TX chars, no break, TX enable, SDLC CRC,
	 * RTS off, TxCRC enable
	 */
	write_scc(ctl,R5,DTR|Tx8|TxENAB|TxCRC_ENAB);

	/* 8 bit RX chars, auto enables off, no hunt mode, RxCRC enable,
	 * no address search, no inhibit sync chars, disable RX. Rx is
	 * started only by an actual DCD interrupt
	 */
	write_scc(ctl,R3,RxENABLE|RxCRC_ENAB|Rx8);

	/* Dummy interrupt vector
	 * (This probably isn't necessary)
	 */
	write_scc(ctl,R2,0);

	/* Enable only the external interrupts (modem interrupts) since
	 * polling is used for all actual tx/rx operations
	 */
	write_scc(ctl,R1,EXT_INT_ENAB);

	/* Enable only DCD interrupts */
	write_scc(ctl,R15,DCDIE);

	/* No reset, status low, master int enable, enable lower chain,
	 * no vector
	 */
	write_scc(ctl,R9,MIE|NV);

	restore(i_state);
}
/* Attach a high speed iterface to the system
 * argv[0]: hardware type, must be "hs"
 * argv[1]: I/O address, e.g., "0x380"
 * argv[2]: vector, e.g., "2"
 * argv[3]: mode, must be "ax25"
 * argv[4]: interface base label, e.g., "drsi0". Driver appends "a" and "b".
 * argv[5]: receiver packet buffer size in bytes
 * argv[6]: maximum transmission unit, bytes
 * argv[7]: keyup delay, milliseconds
 * argv[8]: persistence value, 0-255
 * argv[9]: "r" to reverse sense of clock leads (optional)
 */
int
hs_attach(argc,argv,p)
int argc;
char *argv[];
void *p;
{
	register struct iface *if_hsa,*if_hsb;
	struct hdlc *hp;
	int dev;
	char *cp;

	if(Nhs >= NHS){
		printf("Too many hs controllers\n");
		return -1;
	}
	if(if_lookup(argv[4]) != NULL){
		printf("Interface %s already exists\n",argv[4]);
		return -1;
	}
	if(setencap(NULL,argv[3]) == -1){
		printf("Unknown encapsulation %s\n",argv[3]);
		return -1;
	}
	if(Mycall[0] == '\0'){
		printf("set mycall first\n");
		return -1;
	}		
	dev = Nhs++;

	/* Initialize hardware-level control structure */
	Hs[dev].addr = htoi(argv[1]);
	Hs[dev].vec = atoi(argv[2]);
	if(strchr(argv[2],'c') != NULL)
		Hs[dev].chain = 1;
	else
		Hs[dev].chain = 0;

	/* Save original interrupt vector */
	Hs[dev].save.vec = getirq(Hs[dev].vec);
	/* Set new interrupt vector */
	if(setirq(Hs[dev].vec,Hshandle[dev]) == -1){
		printf("IRQ %u out of range\n",Hs[dev].vec);
		Nhs--;
		return -1;
	}
	/* Create interface structures and fill in details */
	if_hsa = (struct iface *)callocw(1,sizeof(struct iface));
	if_hsb = (struct iface *)callocw(1,sizeof(struct iface));

	if_hsa->addr = if_hsb->addr = Ip_addr;
	if_hsa->name = mallocw(strlen(argv[4])+2);
	strcpy(if_hsa->name,argv[4]);
	strcat(if_hsa->name,"a");
	if_hsb->name = mallocw(strlen(argv[4])+2);
	strcpy(if_hsb->name,argv[4]);
	strcat(if_hsb->name,"b");
	if_hsb->mtu = if_hsa->mtu = atoi(argv[6]);
	if_hsa->dev = 2*dev;
	if_hsb->dev = 2*dev + 1;
	if_hsb->stop = if_hsa->stop = hs_stop;
	if_hsb->raw = if_hsa->raw = hs_raw;
	if_hsa->ioctl = if_hsb->ioctl = hs_ctl;

	setencap(if_hsa,argv[3]);
	setencap(if_hsb,argv[3]);
	if(if_hsb->hwaddr == NULL)
		if_hsb->hwaddr = mallocw(AXALEN);
	memcpy(if_hsb->hwaddr,Mycall,AXALEN);
	if(if_hsa->hwaddr == NULL)
		if_hsa->hwaddr = mallocw(AXALEN);
	memcpy(if_hsa->hwaddr,Mycall,AXALEN);
	if_hsa->next = if_hsb;
	if_hsb->next = Ifaces;
	Ifaces = if_hsa;

	write_scc(Hs[dev].addr+CHANA+CTL,R9,FHWRES);
	hp = &Hdlc[2*dev+1];
	hp->ctl = Hs[dev].addr + CHANB + CTL;
	hp->data = Hs[dev].addr + CHANB + DATA;
	hp->bufsiz = atoi(argv[5]);
	if(argc > 7)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情欧美一区二区| 欧美一区二区三区电影| 在线成人小视频| 国产欧美日韩亚州综合| 日本麻豆一区二区三区视频| 91看片淫黄大片一级在线观看| 日韩天堂在线观看| 亚洲你懂的在线视频| 国产黄色精品视频| 日韩欧美电影在线| 五月天一区二区三区| 91尤物视频在线观看| 国产色综合久久| 激情av综合网| 欧美videofree性高清杂交| 亚洲高清中文字幕| 欧美在线高清视频| 亚洲蜜臀av乱码久久精品| 国产成人在线看| 精品电影一区二区| 蜜臀av一级做a爰片久久| 欧美色综合久久| 亚洲自拍偷拍欧美| 在线日韩av片| 亚洲一区二区三区影院| 欧美亚洲国产怡红院影院| 亚洲欧洲一区二区在线播放| 粉嫩在线一区二区三区视频| 久久久蜜臀国产一区二区| 极品美女销魂一区二区三区免费| 这里只有精品电影| 日韩主播视频在线| 欧美一级片免费看| 老鸭窝一区二区久久精品| 欧美一区中文字幕| 久久国产精品99久久人人澡| 日韩欧美精品在线| 国产又黄又大久久| 欧美激情综合在线| av网站一区二区三区| 一区二区三区中文字幕在线观看| 色欧美日韩亚洲| 一区二区三区四区在线播放| 91久久免费观看| 婷婷久久综合九色国产成人| 欧美成人精品福利| 国产盗摄女厕一区二区三区| 国产精品午夜在线观看| thepron国产精品| 樱花草国产18久久久久| 欧美美女直播网站| 激情文学综合插| 国产精品久久久久久久久动漫 | 亚洲国产成人精品视频| 欧美日韩一区二区三区在线看| 日本sm残虐另类| 国产日韩影视精品| 91官网在线观看| 久久精品国产秦先生| 国产精品久久久久久户外露出| 色婷婷av一区二区三区软件| 欧美aaa在线| 国产精品视频一二三| 欧美曰成人黄网| 国产精品亚洲一区二区三区在线 | 94-欧美-setu| 视频一区欧美日韩| 国产免费成人在线视频| 在线亚洲免费视频| 国产乱码精品一区二区三| 亚洲激情成人在线| 久久中文字幕电影| 欧美午夜一区二区三区| 国产一区二区久久| 五月天激情综合网| 国产精品久线观看视频| 欧美另类变人与禽xxxxx| 国产成人av电影在线播放| 91精品欧美综合在线观看最新| 亚洲女同ⅹxx女同tv| 日本在线不卡视频| 99精品视频在线免费观看| 亚洲成人tv网| 国产精品久久久久久福利一牛影视| 欧美色网一区二区| 成人中文字幕合集| 美腿丝袜亚洲综合| 亚洲成人激情自拍| **欧美大码日韩| 久久久午夜精品| 日韩女优制服丝袜电影| 欧美影院精品一区| 99久久99久久久精品齐齐| 久久成人精品无人区| 婷婷国产在线综合| 亚洲二区在线观看| 亚洲丝袜另类动漫二区| 国产人成亚洲第一网站在线播放| 欧美刺激脚交jootjob| 欧美日韩国产成人在线免费| 色又黄又爽网站www久久| 粉嫩一区二区三区在线看| 精品影院一区二区久久久| 日韩在线观看一区二区| 亚洲国产一区在线观看| 亚洲激情自拍视频| 亚洲欧美日韩一区| 亚洲欧美色图小说| 亚洲欧美日韩一区二区| 一区二区三区在线观看动漫| 国产精品国产馆在线真实露脸 | 丝袜美腿高跟呻吟高潮一区| 有坂深雪av一区二区精品| 亚洲另类色综合网站| 一区二区三区在线观看国产| 亚洲一区二区四区蜜桃| 一区二区视频在线| 亚洲一区二区三区精品在线| 亚洲成人精品在线观看| 五月天欧美精品| 日本三级亚洲精品| 久久99久久99小草精品免视看| 精品系列免费在线观看| 国产精品18久久久久久久久| 国产另类ts人妖一区二区| 国产**成人网毛片九色 | 另类欧美日韩国产在线| 紧缚捆绑精品一区二区| 国产乱码一区二区三区| 国产精品一区二区久久精品爱涩| 国产99久久久精品| 99视频精品全部免费在线| 色乱码一区二区三区88| 欧美少妇一区二区| 精品国产a毛片| 国产精品污网站| 一区二区三区在线观看动漫 | 欧美成人r级一区二区三区| 日韩精品一区二区三区老鸭窝| 久久免费偷拍视频| 国产精品女同互慰在线看| 中文字幕日韩欧美一区二区三区| 亚洲一区中文在线| 麻豆精品在线看| 不卡一区中文字幕| 欧美高清激情brazzers| 久久久久久一级片| 一区二区三区欧美在线观看| 蜜桃视频一区二区| 99国产精品99久久久久久| 欧美精品精品一区| 国产精品三级久久久久三级| 午夜欧美视频在线观看 | 欧美人成免费网站| www精品美女久久久tv| 亚洲人妖av一区二区| 日本少妇一区二区| 99热精品国产| 欧美成人性战久久| 亚洲妇熟xx妇色黄| eeuss鲁一区二区三区| 日韩一区二区影院| 亚洲免费高清视频在线| 国产一区二区三区在线看麻豆| 91首页免费视频| 久久久久久久久99精品| 一区二区三区丝袜| 成人少妇影院yyyy| 精品国产在天天线2019| 亚洲一区在线免费观看| www.视频一区| 久久综合给合久久狠狠狠97色69| 亚洲国产精品欧美一二99| 99免费精品视频| 久久夜色精品一区| 久久精品国产亚洲a| 欧美视频完全免费看| 亚洲啪啪综合av一区二区三区| 国产成人免费视频一区| 精品国产露脸精彩对白| 日本特黄久久久高潮| 色吊一区二区三区| 国产精品国产精品国产专区不蜜| 国产自产2019最新不卡| 7777女厕盗摄久久久| 一区二区三区在线观看国产| 99久久伊人网影院| 日本一区二区三区久久久久久久久不| 蜜桃视频在线观看一区| 91精品国产综合久久久久久| 亚洲主播在线观看| 色成人在线视频| 一级做a爱片久久| 91国偷自产一区二区开放时间 | av一区二区不卡| 国产精品国产成人国产三级| 不卡一区二区三区四区| 中文字幕亚洲在| 色综合一个色综合| 亚洲欧美日韩系列|