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

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

?? if_fxp.c

?? 國產(chǎn)CPU-龍芯(loongson)BIOS源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
	bpfattach(&sc->sc_ethercom.ec_if.if_bpf, ifp, DLT_EN10MB,	    sizeof(struct ether_header));#endif#endif	/*	 * Add shutdown hook so that DMA is disabled prior to reboot. Not	 * doing do could allow DMA to corrupt kernel memory during the	 * reboot before the driver initializes.	 */	shutdownhook_establish(fxp_shutdown, sc);#ifndef PMON	/*	 * Add suspend hook, for similiar reasons..	 */	powerhook_establish(fxp_power, sc);#endif}/* * Device shutdown routine. Called at system shutdown after sync. The * main purpose of this routine is to shut off receiver DMA so that * kernel memory doesn't get clobbered during warmboot. */static voidfxp_shutdown(sc)	void *sc;{	fxp_stop((struct fxp_softc *) sc, 0);}#ifndef PMON/* * Power handler routine. Called when the system is transitioning * into/out of power save modes.  As with fxp_shutdown, the main * purpose of this routine is to shut off receiver DMA so it doesn't * clobber kernel memory at the wrong time. */voidfxp_power(why, arg)	int why;	void *arg;{	struct fxp_softc *sc = arg;	struct ifnet *ifp;	int s;	s = splnet();	if (why != PWR_RESUME)		fxp_stop(sc, 0);	else {		ifp = &sc->arpcom.ac_if;		if (ifp->if_flags & IFF_UP)			fxp_init(sc);	}	splx(s);}#endifstatic intfxp_ether_ioctl(ifp, cmd, data)	struct ifnet *ifp;	FXP_IOCTLCMD_TYPE cmd;	caddr_t data;{	struct ifaddr *ifa = (struct ifaddr *) data;	struct fxp_softc *sc = ifp->if_softc;	int error = 0;	switch (cmd) {#ifdef PMON	case SIOCPOLL:		break;#endif	case SIOCSIFADDR:		ifp->if_flags |= IFF_UP;		switch (ifa->ifa_addr->sa_family) {#ifdef INET		case AF_INET:			error = fxp_init(sc);			if(error == -1)				return(error);#ifdef __OpenBSD__			arp_ifinit(&sc->arpcom, ifa);#else			arp_ifinit(ifp, ifa);#endif			break;#endif#ifdef NS		case AF_NS:		    {			 register struct ns_addr *ina = &IA_SNS(ifa)->sns_addr;			 if (ns_nullhost(*ina))				ina->x_host = *(union ns_host *)				    LLADDR(ifp->if_sadl);			 else				bcopy(ina->x_host.c_host, LLADDR(ifp->if_sadl),				    ifp->if_addrlen);			 /* Set new address. */			 fxp_init(sc);			 break;		    }#endif		default:			fxp_init(sc);			break;		}		break;	default:		return (EINVAL);	}	return (error);}/************************************************************* * End of operating system-specific autoconfiguration glue *************************************************************//* * Do generic parts of attach. */static intfxp_attach_common(sc, enaddr)	struct fxp_softc *sc;	u_int8_t *enaddr;{	u_int16_t data;	int i;	/*	 * Reset to a stable state.	 */	CSR_WRITE_4(sc, FXP_CSR_PORT, FXP_PORT_SELECTIVE_RESET);	DELAY(100);	sc->cbl_base = malloc(sizeof(struct fxp_cb_tx) * FXP_NTXCB,	    M_DEVBUF, M_NOWAIT);	if (sc->cbl_base == NULL)		goto fail;#if defined(__mips__)	/*	 *  Due to MIPS processor cache behaviour we change to uncached	 *  addresses to access control structure areas.	 */	pci_sync_cache(sc->sc_pc, (vm_offset_t)sc->cbl_base,				sizeof(struct fxp_cb_tx) * FXP_NTXCB, SYNC_W);	sc->cbl_base = (void *)PHYS_TO_UNCACHED(vtophys(sc->cbl_base));#endif /*__mips__*/	sc->fxp_stats = malloc(sizeof(struct fxp_stats), M_DEVBUF, M_NOWAIT);	if (sc->fxp_stats == NULL)		goto fail;	bzero(sc->fxp_stats, sizeof(struct fxp_stats));#if defined(__mips__)	pci_sync_cache(sc->sc_pc, (vm_offset_t)sc->fxp_stats,				sizeof(struct fxp_stats), SYNC_W);	sc->fxp_stats = (void *)PHYS_TO_UNCACHED(vtophys(sc->fxp_stats));#endif /*__mips__*/		sc->mcsp = malloc(sizeof(struct fxp_cb_mcs), M_DEVBUF, M_NOWAIT);	if (sc->mcsp == NULL)		goto fail;#if defined(__mips__)	pci_sync_cache(sc->sc_pc, (vm_offset_t)sc->mcsp,				sizeof(struct fxp_cb_mcs), SYNC_W);	sc->mcsp = (void *)PHYS_TO_UNCACHED(vtophys(sc->mcsp));#endif /*__mips__*/	/*	 * Pre-allocate our receive buffers.	 */	for (i = 0; i < FXP_NRFABUFS; i++) {		if (fxp_add_rfabuf(sc, NULL) != 0) {			goto fail;		}	}	/*	 * Find out how large of an SEEPROM we have.	 */	fxp_autosize_eeprom(sc);	/*	 * Get info about the primary PHY	 */#if   defined(GODSONEV1)	data=0x4701;#else		fxp_read_eeprom(sc, (u_int16_t *)&data, 6, 1);#endif	sc->phy_primary_addr = data & 0xff;	sc->phy_primary_device = (data >> 8) & 0x3f;	sc->phy_10Mbps_only = data >> 15;	/*	 * Read MAC address.	 */#if defined(GODSONEV1)	enaddr[0]=0x12;	enaddr[1]=0x34;	enaddr[2]=0x56;	enaddr[3]=0x78;	enaddr[4]=0x9a;	enaddr[5]=0xbc;#else	fxp_read_eeprom(sc, (u_int16_t *)enaddr, 0, 3);#endif	return (0); fail:	printf(FXP_FORMAT ": Failed to malloc memory\n", FXP_ARGS(sc));	if (sc->cbl_base)		free(sc->cbl_base, M_DEVBUF);	if (sc->fxp_stats)		free(sc->fxp_stats, M_DEVBUF);	if (sc->mcsp)		free(sc->mcsp, M_DEVBUF);	/* frees entire chain */	if (sc->rfa_headm)		m_freem(sc->rfa_headm);	return (ENOMEM);}/* * From NetBSD: * * Figure out EEPROM size. * * 559's can have either 64-word or 256-word EEPROMs, the 558 * datasheet only talks about 64-word EEPROMs, and the 557 datasheet * talks about the existance of 16 to 256 word EEPROMs. * * The only known sizes are 64 and 256, where the 256 version is used * by CardBus cards to store CIS information. * * The address is shifted in msb-to-lsb, and after the last * address-bit the EEPROM is supposed to output a `dummy zero' bit, * after which follows the actual data. We try to detect this zero, by * probing the data-out bit in the EEPROM control register just after * having shifted in a bit. If the bit is zero, we assume we've * shifted enough address bits. The data-out should be tri-state, * before this, which should translate to a logical one. * * Other ways to do this would be to try to read a register with known * contents with a varying number of address bits, but no such * register seem to be available. The high bits of register 10 are 01 * on the 558 and 559, but apparently not on the 557. *  * The Linux driver computes a checksum on the EEPROM data, but the * value of this checksum is not very well documented. */static voidfxp_autosize_eeprom(sc)	struct fxp_softc *sc;{	u_int16_t reg;	int x;	CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EECS);	/*	 * Shift in read opcode.	 */	for (x = 3; x > 0; x--) {		if (FXP_EEPROM_OPC_READ & (1 << (x - 1))) {			reg = FXP_EEPROM_EECS | FXP_EEPROM_EEDI;		} else {			reg = FXP_EEPROM_EECS;		}		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL,		    reg | FXP_EEPROM_EESK);		DELAY(1);		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);		DELAY(1);	}	/*	 * Shift in address.	 * Wait for the dummy zero following a correct address shift.	 */	for (x = 1; x <= 8; x++) {		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EECS);		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL,			FXP_EEPROM_EECS | FXP_EEPROM_EESK);		DELAY(1);		if ((CSR_READ_2(sc, FXP_CSR_EEPROMCONTROL) & FXP_EEPROM_EEDO) == 0)			break;		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EECS);		DELAY(1);	}	CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, 0);	DELAY(1);	sc->eeprom_size = x;}/* * Read from the serial EEPROM. Basically, you manually shift in * the read opcode (one bit at a time) and then shift in the address, * and then you shift out the data (all of this one bit at a time). * The word size is 16 bits, so you have to provide the address for * every 16 bits of data. */voidfxp_read_eeprom(sc, data, offset, words)	struct fxp_softc *sc;	u_short *data;	int offset;	int words;{	u_int16_t reg;	int i, x;	for (i = 0; i < words; i++) {		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EECS);		/*		 * Shift in read opcode.		 */		for (x = 3; x > 0; x--) {			if (FXP_EEPROM_OPC_READ & (1 << (x - 1))) {				reg = FXP_EEPROM_EECS | FXP_EEPROM_EEDI;			} else {				reg = FXP_EEPROM_EECS;			}			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL,			    reg | FXP_EEPROM_EESK);			DELAY(1);			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);			DELAY(1);		}		/*		 * Shift in address.		 */		for (x = sc->eeprom_size; x > 0; x--) {			if ((i + offset) & (1 << (x - 1))) {				reg = FXP_EEPROM_EECS | FXP_EEPROM_EEDI;			} else {				reg = FXP_EEPROM_EECS;			}			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL,			    reg | FXP_EEPROM_EESK);			DELAY(1);			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);			DELAY(1);		}		reg = FXP_EEPROM_EECS;		data[i] = 0;		/*		 * Shift out data.		 */		for (x = 16; x > 0; x--) {			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL,			    reg | FXP_EEPROM_EESK);			DELAY(1);			if (CSR_READ_2(sc, FXP_CSR_EEPROMCONTROL) &			    FXP_EEPROM_EEDO)				data[i] |= (1 << (x - 1));			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);			DELAY(1);		}#if BYTE_ORDER == BIG_ENDIAN		data[i] = swap16(data[i]);#endif		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, 0);		DELAY(1);	}}#if 0/* * Write to the serial EEPROM. This is not intended to be used * uncautiosly(?). The main intention is to privide a means to * initiate an uninitialized EEPROM during production test. */voidfxp_write_eeprom(sc, data, offset, words)	struct fxp_softc *sc;	u_short *data;	int offset;	int words;{	u_int16_t reg;	int i, x;	int d;	/*	 * Enable writing.	 */	d = (FXP_EEPROM_OPC_WRITENB << 4);	x = 0x100;	while (x != 0) {		if (d & x) {			reg = FXP_EEPROM_EECS | FXP_EEPROM_EEDI;		} else {			reg = FXP_EEPROM_EECS;		}		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL,		    reg | FXP_EEPROM_EESK);		DELAY(1);		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);		DELAY(1);		x >>= 1;	}/* XXXX Need data sheet to verify if raise CS is enough! (pefo) */	CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, 0);	DELAY(1);	CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EESK);	DELAY(1);	CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, 0);	DELAY(1);	/*	 * Now write the data words.	 */	for (i = 0; i < words; i++) {#if BYTE_ORDER == BIG_ENDIAN                data[i] = swap16(data[i]);#endif		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EECS);		/*		 * Shift in write command, address and data.		 */		d = (FXP_EEPROM_OPC_WRITE << 6) | ((i + offset) & 0x3f);		d = d << 16 | data[i];		x = 0x1000000;		while (x != 0) {			if (d & x) {				reg = FXP_EEPROM_EECS | FXP_EEPROM_EEDI;			} else {				reg = FXP_EEPROM_EECS;			}			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL,			    reg | FXP_EEPROM_EESK);			DELAY(1);			CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);			DELAY(1);			x >>= 1;		}		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, 0);		DELAY(1);		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EESK);		DELAY(1);		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, 0);		DELAY(1);		DELAY(200000);  /* Let write settle */	}	/*	 * Disable writing.	 */	d = (FXP_EEPROM_OPC_WRITDIS << 4);	x = 0x100;	while (x != 0) {		if (d & x) {			reg = FXP_EEPROM_EECS | FXP_EEPROM_EEDI;		} else {			reg = FXP_EEPROM_EECS;		}		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL,		    reg | FXP_EEPROM_EESK);		DELAY(1);		CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, reg);		DELAY(1);		x >>= 1;	}	CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, 0);	DELAY(1);	CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, FXP_EEPROM_EESK);	DELAY(1);	CSR_WRITE_2(sc, FXP_CSR_EEPROMCONTROL, 0);	DELAY(1);}#endif/* * Start packet transmission on the interface. */static voidfxp_start(ifp)	struct ifnet *ifp;{	struct fxp_softc *sc = ifp->if_softc;	struct fxp_cb_tx *txp;#ifdef USE_FXP_MCAST	/*	 * See if we need to suspend xmit until the multicast filter	 * has been reprogrammed (which can only be done at the head	 * of the command chain).	 */	if (sc->need_mcsetup)		return;#endif	txp = NULL;	/*	 * We're finished if there is nothing more to add to the list or if	 * we're all filled up with buffers to transmit.	 * NOTE: One TxCB is reserved to guarantee that fxp_mc_setup() can add	 *       a NOP command when needed.	 */	while (ifp->if_snd.ifq_head != NULL && sc->tx_queued < FXP_NTXCB - 1) {		struct mbuf *m, *mb_head;		int segment;		/*		 * Grab a packet to transmit.		 */		IF_DEQUEUE(&ifp->if_snd, mb_head);		/*		 * Get pointer to next available tx desc.		 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕巨乱亚洲| 国产在线一区二区| 一区二区三区在线观看欧美| 国产精品妹子av| 欧美国产精品中文字幕| 欧美激情一区在线观看| 2019国产精品| 欧美成人精品1314www| 日韩免费看的电影| 欧美成人一区二区三区片免费 | 久久久午夜电影| 久久久久久久久久久99999| 久久青草欧美一区二区三区| 精品对白一区国产伦| 久久久国产一区二区三区四区小说| 久久综合给合久久狠狠狠97色69| 国产色综合一区| 国产精品五月天| 成人免费在线观看入口| 亚洲欧美另类久久久精品2019| 亚洲愉拍自拍另类高清精品| 午夜av电影一区| 精品一区二区三区在线观看| 国产·精品毛片| 91免费精品国自产拍在线不卡| 欧美三级电影网| 精品剧情v国产在线观看在线| 久久综合久久综合久久| 亚洲日韩欧美一区二区在线| 午夜精品久久久久久久久久| 久99久精品视频免费观看| 国产在线精品一区在线观看麻豆| 成人永久看片免费视频天堂| 日本道免费精品一区二区三区| 欧美日韩在线播放三区| 久久免费国产精品| 日韩一区欧美一区| 三级久久三级久久久| 国产一本一道久久香蕉| 91色九色蝌蚪| 日韩久久久精品| 国产精品无遮挡| 日韩二区在线观看| 成人在线一区二区三区| 666欧美在线视频| 中文字幕不卡的av| 午夜精品影院在线观看| 国产成人aaaa| 8v天堂国产在线一区二区| 国产调教视频一区| 亚洲444eee在线观看| 色综合久久久网| 欧美日韩精品一区视频| 欧美国产精品专区| 奇米四色…亚洲| 99久久er热在这里只有精品66| 51精品秘密在线观看| 日本一区二区高清| 奇米影视在线99精品| 99久久精品免费看国产| 日韩欧美第一区| 亚洲午夜一区二区| 成人美女视频在线观看| 日韩一区二区三区精品视频| 亚洲免费av网站| 粉嫩av一区二区三区| 欧美一区二区视频在线观看2022| 中文一区一区三区高中清不卡| 日韩av电影天堂| 一本色道久久加勒比精品| 久久久精品免费免费| 日本aⅴ免费视频一区二区三区| 91浏览器在线视频| 国产三级精品三级在线专区| 蜜臀a∨国产成人精品| 欧美在线综合视频| 国产精品嫩草99a| 精品一区二区三区av| 91精品国产综合久久福利| 亚洲卡通欧美制服中文| 北条麻妃一区二区三区| 久久久久九九视频| 激情av综合网| 日韩欧美电影在线| 蜜臀av性久久久久av蜜臀妖精| 欧美视频一二三区| 亚洲乱码国产乱码精品精小说| 国产69精品久久777的优势| 久久午夜电影网| 久久99久久99小草精品免视看| 8x福利精品第一导航| 婷婷国产在线综合| 欧美三级午夜理伦三级中视频| 亚洲欧美另类图片小说| 91免费视频大全| 亚洲视频一区在线| 不卡的av网站| 国产精品久久久久一区二区三区| 国产精品自拍三区| 久久午夜电影网| 国产91高潮流白浆在线麻豆| 国产三级欧美三级| 成人三级在线视频| 国产精品午夜电影| k8久久久一区二区三区 | 亚洲精品欧美专区| 91视频在线观看| 亚洲精品网站在线观看| 成人国产精品免费观看动漫| 国产精品―色哟哟| 99久久伊人网影院| 亚洲精品视频在线| 欧美自拍丝袜亚洲| 一区二区三区美女| 欧美色综合影院| 日韩电影网1区2区| 精品理论电影在线观看| 国产91在线观看丝袜| 中文字幕亚洲欧美在线不卡| 色综合久久中文综合久久牛| 亚洲综合色在线| 欧美一区三区四区| 国产一区二区三区免费在线观看 | 日本不卡一二三区黄网| 精品国产区一区| 国产91精品露脸国语对白| 国产精品福利av| 在线观看视频一区二区| 日韩一区欧美二区| 国产日产欧美一区二区视频| 91啪九色porn原创视频在线观看| 图片区小说区区亚洲影院| 日韩欧美区一区二| 成人a区在线观看| 亚洲午夜电影网| 色94色欧美sute亚洲13| 在线观看欧美精品| 色天天综合久久久久综合片| 亚洲国产成人高清精品| 欧美一区二区三区成人| 国产.精品.日韩.另类.中文.在线.播放 | 色美美综合视频| 日韩av成人高清| 国产精品嫩草99a| 欧美日韩一本到| 国产成人av电影| 午夜精品福利一区二区蜜股av | 精品国产免费人成电影在线观看四季| 国产一区 二区| 精品一区二区三区视频在线观看| 日本一区二区三区免费乱视频| 一道本成人在线| 精品亚洲porn| 一区二区三区在线观看国产 | 欧美韩日一区二区三区| 成人一区在线观看| 香蕉影视欧美成人| 国产欧美日韩久久| 欧美日韩精品福利| 大白屁股一区二区视频| 日韩国产精品久久久久久亚洲| 久久在线免费观看| 国产精品乱码人人做人人爱 | 亚洲人精品一区| 日韩欧美第一区| 欧美在线free| 成人免费视频视频| 日本欧美一区二区| 亚洲人快播电影网| 国产欧美视频在线观看| 91精品免费在线观看| 99久久精品免费看国产| 激情综合色播五月| 天天操天天色综合| 亚洲精品乱码久久久久久 | 亚洲成人第一页| 综合激情成人伊人| 久久亚洲私人国产精品va媚药| 欧美区一区二区三区| 91在线看国产| 国产成人精品免费视频网站| 男人的j进女人的j一区| 亚洲亚洲人成综合网络| 亚洲男同性恋视频| 中文字幕av资源一区| 久久久综合精品| 精品免费视频一区二区| 91精品国产欧美日韩| 欧美日韩免费不卡视频一区二区三区| 成人亚洲精品久久久久软件| 国产综合色产在线精品| 极品美女销魂一区二区三区| 青青草国产精品97视觉盛宴| 午夜欧美一区二区三区在线播放| 一区二区三区中文免费| 有码一区二区三区| 亚洲日本va午夜在线影院| 国产精品嫩草久久久久| 国产精品麻豆久久久| 国产精品亲子乱子伦xxxx裸|