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

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

?? if_fxp.c

?? 國產CPU-龍芯(loongson)BIOS源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*	$OpenBSD: if_fxp.c,v 1.25 2000/03/30 02:49:35 jason Exp $	*//*	$NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $	*//* * Copyright (c) 1995, David Greenman * All rights reserved. * * Modifications to support NetBSD: * Copyright (c) 1997 Jason R. Thorpe.  All rights reserved. * * Modifications to support MIPS Arch: * Copyright (c) 1999 Opsycon AB (www.opsycon.se). All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice unmodified, this list of conditions, and the following *    disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *	Id: if_fxp.c,v 1.55 1998/08/04 08:53:12 dg Exp *//* * Intel EtherExpress Pro/100B PCI Fast Ethernet driver */#include "bpfilter.h"#include <sys/param.h>#include <sys/systm.h>#include <sys/mbuf.h>#include <sys/malloc.h>#include <sys/kernel.h>#include <sys/socket.h>#include <sys/syslog.h>#include <net/if.h>#include <net/if_dl.h>#include <net/if_media.h>#include <net/if_types.h>#ifdef INET#include <netinet/in.h>#include <netinet/in_systm.h>#include <netinet/in_var.h>#include <netinet/ip.h>#endif#ifdef IPX#include <netipx/ipx.h>#include <netipx/ipx_if.h>#endif#ifdef NS#include <netns/ns.h>#include <netns/ns_if.h>#endif#if NBPFILTER > 0#include <net/bpf.h>#include <net/bpfdesc.h>#endif#if defined(__NetBSD__) || defined(__OpenBSD__)#include <sys/ioctl.h>#include <sys/errno.h>#include <sys/device.h>#if defined(__NetBSD__)#include <net/if_ether.h>#include <netinet/if_inarp.h>#endif#if defined(__OpenBSD__)#include <netinet/if_ether.h>#endif#include <vm/vm.h>#include <machine/cpu.h>#include <machine/bus.h>#include <machine/intr.h>#include <dev/mii/miivar.h>#include <dev/pci/pcivar.h>#include <dev/pci/pcireg.h>#include <dev/pci/pcidevs.h>#include <dev/pci/if_fxpreg.h>#include <dev/pci/if_fxpvar.h>#ifdef __alpha__		/* XXX *//* XXX XXX NEED REAL DMA MAPPING SUPPORT XXX XXX */#undef vtophys#define	vtophys(va)	alpha_XXX_dmamap((vm_offset_t)(va))#endif /* __alpha__ */#else /* __FreeBSD__ */#include <sys/sockio.h>#include <netinet/if_ether.h>#include <vm/vm.h>		/* for vtophys */#include <vm/vm_param.h>	/* for vtophys */#include <vm/pmap.h>		/* for vtophys */#include <machine/clock.h>	/* for DELAY */#include <pci/pcivar.h>#include <pci/if_fxpreg.h>#include <pci/if_fxpvar.h>#endif /* __NetBSD__ || __OpenBSD__ */#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)/* * NOTE!  On the Alpha, we have an alignment constraint.  The * card DMAs the packet immediately following the RFA.  However, * the first thing in the packet is a 14-byte Ethernet header. * This means that the packet is misaligned.  To compensate, * we actually offset the RFA 2 bytes into the cluster.  This * aligns the packet after the Ethernet header at a 32-bit * boundary.  HOWEVER!  This means that the RFA is misaligned! */#ifdef BADPCIBRIDGE#define BADPCIBRIDGE#define	RFA_ALIGNMENT_FUDGE	4#else#define	RFA_ALIGNMENT_FUDGE	2#endifint fxp_debug = 0;/* * Inline function to copy a 16-bit aligned 32-bit quantity. */static __inline void fxp_lwcopy __P((volatile u_int32_t *,	volatile u_int32_t *));static __inline voidfxp_lwcopy(src, dst)	volatile u_int32_t *src, *dst;{	volatile u_int16_t *a = (u_int16_t *)src;	volatile u_int16_t *b = (u_int16_t *)dst;	b[0] = a[0];	b[1] = a[1];}/* * Template for default configuration parameters. * See struct fxp_cb_config for the bit definitions. */static u_char fxp_cb_config_template[] = {#if BYTE_ORDER == BIG_ENDIAN	0x0, 0x0,		/* cb_status */	0x2, 0x80,		/* cb_command */	0xff, 0xff, 0xff, 0xff,	/* link_addr */	0x16,	/*  0 */	0x08,	/*  1 */	0x0,	/*  2 */	0x0,	/*  3 */	0x0,	/*  4 */	0x8,	/*  5 */ /* XXX! */	0xb2,	/*  6 */	0x3,	/*  7 */	0x1,	/*  8 */	0x0,	/*  9 */	0x2e,	/* 10 */	0x0,	/* 11 */	0x60,	/* 12 */	0x0,	/* 13 */	0xf2,	/* 14 */	0x48,	/* 15 */	0x0,	/* 16 */	0x40,	/* 17 */	0xf3,	/* 18 */	0x0,	/* 19 */	0x3f,	/* 20 */	0x5	/* 21 */#else	0x0, 0x0,		/* cb_status */	0x2, 0x80,		/* cb_command */	0xff, 0xff, 0xff, 0xff,	/* link_addr */	0x16,	/*  0 */	0x8,	/*  1 */	0x0,	/*  2 */	0x0,	/*  3 */	0x0,	/*  4 */	0x80,	/*  5 */	0xb2,	/*  6 */	0x3,	/*  7 */	0x1,	/*  8 */	0x0,	/*  9 */	0x2e,	/* 10 */	0x0,	/* 11 */	0x60,	/* 12 */	0x0,	/* 13 */	0xf2,	/* 14 */	0x48,	/* 15 */	0x0,	/* 16 */	0x40,	/* 17 */	0xf3,	/* 18 */	0x0,	/* 19 */	0x3f,	/* 20 */	0x5	/* 21 */#endif};/* Supported media types. */struct fxp_supported_media {	const int	fsm_phy;	/* PHY type */	const int	*fsm_media;	/* the media array */	const int	fsm_nmedia;	/* the number of supported media */	const int	fsm_defmedia;	/* default media for this PHY */};static int fxp_mediachange	__P((struct ifnet *));static void fxp_mediastatus	__P((struct ifnet *, struct ifmediareq *));static inline void fxp_scb_wait	__P((struct fxp_softc *));FXP_INTR_TYPE fxp_intr	__P((void *));static void fxp_start		__P((struct ifnet *));static int fxp_ioctl		__P((struct ifnet *,				    FXP_IOCTLCMD_TYPE, caddr_t));static int fxp_init		__P((void *));static void fxp_stop		__P((struct fxp_softc *, int));static void fxp_watchdog	__P((struct ifnet *));static int fxp_add_rfabuf	__P((struct fxp_softc *, struct mbuf *));static int fxp_mdi_read		__P((struct device *, int, int));static void fxp_mdi_write	__P((struct device *, int, int, int));static void fxp_autosize_eeprom	__P((struct fxp_softc *));static void fxp_statchg		__P((struct device *));void fxp_read_eeprom	__P((struct fxp_softc *, u_int16_t *,				    int, int));void fxp_write_eeprom	__P((struct fxp_softc *, u_int16_t *,				    int, int));static int fxp_attach_common	__P((struct fxp_softc *, u_int8_t *));void fxp_stats_update		__P((void *));#ifdef USE_FXP_MCASTvoid fxp_mc_setup	__P((struct fxp_softc *));#endif/* * Set initial transmit threshold at 64 (512 bytes). This is * increased by 64 (512 bytes) at a time, to maximum of 192 * (1536 bytes), if an underrun occurs. */static int tx_threshold = 64;/* * Number of transmit control blocks. This determines the number * of transmit buffers that can be chained in the CB list. * This must be a power of two. */#define FXP_NTXCB	16/* * Number of completed TX commands at which point an interrupt * will be generated to garbage collect the attached buffers. * Must be at least one less than FXP_NTXCB, and should be * enough less so that the transmitter doesn't becomes idle * during the buffer rundown (which would reduce performance). */#define FXP_CXINT_THRESH 12/* * TxCB list index mask. This is used to do list wrap-around. */#define FXP_TXCB_MASK	(FXP_NTXCB - 1)/* * Number of receive frame area buffers. These are large so chose * wisely. */#define FXP_NRFABUFS	16/* * Maximum number of seconds that the receiver can be idle before we * assume it's dead and attempt to reset it by reprogramming the * multicast filter. This is part of a work-around for a bug in the * NIC. See fxp_stats_update(). */#define FXP_MAX_RX_IDLE	15/* * IPU: Maximum number of status reads before giving up in fxp_init * because of "bus congestion". */#ifndef FXP_MAX_STATUS_READS#define FXP_MAX_STATUS_READS 500#endif/* * IPU: Delay timer before trying to call fxp_init again * after a "bus congestion" failure. */#ifndef FXP_DELAY_BEFORE_REINIT#define FXP_DELAY_BEFORE_REINIT 2#endif/* * Wait for the previous command to be accepted (but not necessarily * completed). */static inline voidfxp_scb_wait(sc)	struct fxp_softc *sc;{	int i = 10000;	while (CSR_READ_1(sc, FXP_CSR_SCB_COMMAND) && --i) DELAY(2);}/************************************************************* * Operating system-specific autoconfiguration glue *************************************************************/#if defined(__BROKEN_INDIRECT_CONFIG) || defined(__OpenBSD__)static int fxp_match __P((struct device *, void *, void *));#elsestatic int fxp_match __P((struct device *, struct cfdata *, void *));#endifstatic void fxp_attach __P((struct device *, struct device *, void *));static void	fxp_shutdown __P((void *));void	fxp_power __P((int, void *));/* Compensate for lack of a generic ether_ioctl() */static int	fxp_ether_ioctl __P((struct ifnet *,				    FXP_IOCTLCMD_TYPE, caddr_t));#define	ether_ioctl	fxp_ether_ioctlstruct cfattach fxp_ca = {	sizeof(struct fxp_softc), fxp_match, fxp_attach};struct cfdriver fxp_cd = {	NULL, "fxp", DV_IFNET};/* * Check if a device is an 82557. */static intfxp_match(parent, match, aux)	struct device *parent;#if defined(__BROKEN_INDIRECT_CONFIG) || defined(__OpenBSD__)	void *match;#else	struct cfdata *match;#endif	void *aux;{	struct pci_attach_args *pa = aux;	if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_INTEL)		return (0);	switch (PCI_PRODUCT(pa->pa_id)) {	case PCI_PRODUCT_INTEL_82557:	case PCI_PRODUCT_INTEL_82559:	case PCI_PRODUCT_INTEL_82559ER:		return (1);	}	return (0);}static voidfxp_attach(parent, self, aux)	struct device *parent, *self;	void *aux;{	struct fxp_softc *sc = (struct fxp_softc *)self;	struct pci_attach_args *pa = aux;/*	struct pci_attach_args *pa = (void *)0x800785d0;*/	pci_chipset_tag_t pc = pa->pa_pc;	pci_intr_handle_t ih;	const char *intrstr = NULL;	u_int8_t enaddr[6];	struct ifnet *ifp;#ifdef __OpenBSD__	bus_space_tag_t iot = pa->pa_iot;	bus_addr_t iobase;	bus_size_t iosize;#endif#ifndef __OpenBSD__	/*	 * Map control/status registers.	 */	if (pci_mapreg_map(pa, FXP_PCI_MMBA, PCI_MAPREG_TYPE_MEM, 0,	    &sc->sc_st, &sc->sc_sh, NULL, NULL)) {		printf(": can't map registers\n");		return;	}#else	if (pci_io_find(pc, pa->pa_tag, FXP_PCI_IOBA, &iobase, &iosize)) {		printf(": can't find i/o space\n");		return;	}	if (bus_space_map(iot, iobase, iosize, 0, &sc->sc_sh)) {		printf(": can't map i/o space\n");		return;	}	sc->sc_st = iot;	sc->sc_pc = pc;#endif	/*	 * Allocate our interrupt.	 */	if (pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin,	    pa->pa_intrline, &ih)) {		printf(": couldn't map interrupt\n");		return;	}		intrstr = pci_intr_string(pc, ih);#ifdef __OpenBSD__	sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, fxp_intr, sc,	    self->dv_xname);#else	sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, fxp_intr, sc);#endif		if (sc->sc_ih == NULL) {		printf(": couldn't establish interrupt");		if (intrstr != NULL)			printf(" at %s", intrstr);		printf("\n");		return;	}		/* Do generic parts of attach. */	if (fxp_attach_common(sc, enaddr)) {		/* Failed! */		return;	}#ifdef __OpenBSD__	ifp = &sc->arpcom.ac_if;	bcopy(enaddr, sc->arpcom.ac_enaddr, sizeof(enaddr));#else	ifp = &sc->sc_ethercom.ec_if;#endif	bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);		ifp->if_softc = sc;	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;	ifp->if_ioctl = fxp_ioctl;	ifp->if_start = fxp_start;	ifp->if_watchdog = fxp_watchdog;	printf(": %s, address %s\n", intrstr,	    ether_sprintf(sc->arpcom.ac_enaddr));	/*	 * Initialize our media structures and probe the MII.	 */	sc->sc_mii.mii_ifp = ifp;	sc->sc_mii.mii_readreg = fxp_mdi_read;	sc->sc_mii.mii_writereg = fxp_mdi_write;	sc->sc_mii.mii_statchg = fxp_statchg;	ifmedia_init(&sc->sc_mii.mii_media, 0, fxp_mediachange,	    fxp_mediastatus);	mii_phy_probe(self, &sc->sc_mii, 0xffffffff);	/* If no phy found, just use auto mode */	if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {		ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_MANUAL,		    0, NULL);		printf(FXP_FORMAT ": no phy found, using manual mode\n",		    FXP_ARGS(sc));	}	if (ifmedia_match(&sc->sc_mii.mii_media, IFM_ETHER|IFM_MANUAL, 0))		ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_MANUAL);	else if (ifmedia_match(&sc->sc_mii.mii_media, IFM_ETHER|IFM_AUTO, 0))		ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_AUTO);	else		ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_10_T);	/*	 * Attach the interface.	 */	if_attach(ifp);	/*	 * Let the system queue as many packets as we have available	 * TX descriptors.	 */	ifp->if_snd.ifq_maxlen = FXP_NTXCB - 1;#ifdef __NetBSD__	ether_ifattach(ifp, enaddr);#else	ether_ifattach(ifp);#endif#if NBPFILTER > 0#ifdef __OpenBSD__	bpfattach(&sc->arpcom.ac_if.if_bpf, ifp, DLT_EN10MB,	    sizeof(struct ether_header));#else

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩综合精品一区二区| 国产精品一色哟哟哟| 国产米奇在线777精品观看| 色综合天天综合在线视频| 精品国产免费久久| 夜夜爽夜夜爽精品视频| 成人免费观看男女羞羞视频| 日韩一区二区三区视频| 亚洲午夜视频在线观看| 99久久综合精品| www激情久久| 免费人成黄页网站在线一区二区| 欧美亚洲图片小说| 亚洲欧美福利一区二区| 成人夜色视频网站在线观看| 精品国产精品一区二区夜夜嗨| 三级一区在线视频先锋| 国产亚洲精品久| 一区二区三区不卡视频| 成人免费黄色大片| 久久久久久**毛片大全| 美女www一区二区| 欧美日韩精品二区第二页| 亚洲欧美日韩一区| 成人精品电影在线观看| 国产欧美一区二区精品忘忧草| 麻豆极品一区二区三区| 日韩写真欧美这视频| 偷拍一区二区三区| 欧美日韩精品一区二区三区四区| 一区二区视频在线| 一本久久综合亚洲鲁鲁五月天| 国产精品久久久久婷婷二区次| 国产精品99久久久久久有的能看| 久久伊99综合婷婷久久伊| 麻豆成人免费电影| 欧美大片在线观看| 精品一区二区免费在线观看| 欧美成人猛片aaaaaaa| 美女精品一区二区| 精品国产一区二区亚洲人成毛片| 美女视频黄a大片欧美| 精品少妇一区二区三区免费观看 | 国产精品水嫩水嫩| 国产精品区一区二区三| 日本成人超碰在线观看| 91精品久久久久久蜜臀| 亚洲成人av中文| 欧美浪妇xxxx高跟鞋交| 日本亚洲最大的色成网站www| 欧美日韩国产电影| 另类小说综合欧美亚洲| 精品久久国产老人久久综合| 狠狠色2019综合网| 国产日韩欧美a| aaa国产一区| 亚洲综合激情另类小说区| 7777精品久久久大香线蕉| 91老司机福利 在线| 亚洲综合在线免费观看| 欧美日韩一二三区| 蜜臀av一级做a爰片久久| 久久综合久久久久88| 成人a区在线观看| 一区二区理论电影在线观看| 56国语精品自产拍在线观看| 国内精品国产成人| 中文av字幕一区| 一本色道久久综合亚洲精品按摩| 亚洲成人福利片| 精品美女一区二区三区| 成人中文字幕在线| 一区二区三区日韩欧美精品| 欧美精品在线观看播放| 亚洲视频一区二区免费在线观看| 99国产欧美另类久久久精品| 亚洲午夜电影在线观看| 日韩一区二区精品葵司在线| 国产99久久久国产精品免费看 | 色婷婷久久久久swag精品| 亚洲成人精品一区二区| 精品日韩欧美在线| a级精品国产片在线观看| 亚洲bdsm女犯bdsm网站| 久久久无码精品亚洲日韩按摩| 成人小视频在线观看| 亚洲第一搞黄网站| 久久免费精品国产久精品久久久久| 91影院在线免费观看| 日韩精品久久久久久| 国产精品婷婷午夜在线观看| 欧美色偷偷大香| 国产91在线|亚洲| 亚洲va欧美va人人爽午夜| 国产欧美视频在线观看| 制服丝袜亚洲网站| 成人午夜视频福利| 日韩精品一二三| 国产精品电影一区二区| 日韩精品自拍偷拍| 色美美综合视频| 国产一区二区三区精品视频| 亚洲一区日韩精品中文字幕| 久久久久国产精品麻豆| 欧美另类z0zxhd电影| 亚洲一二三四久久| 精品久久久久一区| 在线观看一区日韩| 国产精品自拍毛片| 午夜精品福利视频网站| 国产精品久久久久一区二区三区 | 国产电影一区在线| 日韩一区精品字幕| 亚洲日本丝袜连裤袜办公室| 精品播放一区二区| 欧美精品日韩精品| 91香蕉视频在线| 国产高清在线观看免费不卡| 美女视频免费一区| 午夜欧美在线一二页| 日韩理论片在线| 国产日韩精品一区二区三区在线| 日韩区在线观看| 欧美日韩一区国产| 色婷婷狠狠综合| 不卡一区二区在线| 国产精品77777| 精品亚洲国内自在自线福利| 亚洲一区二区三区在线看| 亚洲图片激情小说| 国产精品乱码久久久久久| 26uuu成人网一区二区三区| 制服丝袜成人动漫| 欧美视频中文字幕| 91国偷自产一区二区三区观看| 成人激情小说网站| 国产传媒久久文化传媒| 激情综合亚洲精品| 麻豆成人久久精品二区三区红 | 久久国产福利国产秒拍| 一区二区激情视频| 亚洲免费观看高清完整版在线 | 香蕉乱码成人久久天堂爱免费| 成人免费在线视频| 欧美国产97人人爽人人喊| 国产亚洲美州欧州综合国| 精品国产不卡一区二区三区| 日韩视频中午一区| 91精品国产一区二区三区蜜臀 | 91社区在线播放| caoporn国产一区二区| 成人av资源下载| 9人人澡人人爽人人精品| 99久久99精品久久久久久| yourporn久久国产精品| av电影在线不卡| 91麻豆精东视频| 91福利资源站| 欧美性受xxxx黑人xyx| 欧美三级三级三级| 欧美裸体一区二区三区| 欧美一区二区在线视频| 欧美一区二区视频在线观看2020| 555www色欧美视频| 日韩免费高清av| 久久综合九色综合97婷婷女人| 2019国产精品| 国产精品无遮挡| 亚洲欧美综合色| 一区二区三区波多野结衣在线观看| 亚洲综合久久久| 婷婷开心久久网| 久久精品国产99| 国产盗摄精品一区二区三区在线| 风间由美性色一区二区三区| 波多野结衣精品在线| 色综合视频在线观看| 欧美伊人久久久久久午夜久久久久| 欧美日韩黄色一区二区| 欧美一二三区在线| 久久亚洲一区二区三区四区| 国产精品美女久久久久av爽李琼| 亚洲天堂2014| 午夜视频一区二区三区| 久久成人羞羞网站| 成人av在线资源网| 欧美调教femdomvk| 欧美一区二区三区在线| 欧美国产精品中文字幕| 一区二区三区不卡视频| 人人爽香蕉精品| 丁香网亚洲国际| 精品污污网站免费看| 日韩欧美黄色影院| 国产精品色在线观看| 亚洲妇女屁股眼交7| 久久精工是国产品牌吗| 成人中文字幕合集| 欧美日韩在线综合| 久久精品免视看|