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

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

?? pcnet_cs.c

?? linux-2.4.29操作系統的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*======================================================================    A PCMCIA ethernet driver for NS8390-based cards    This driver supports the D-Link DE-650 and Linksys EthernetCard    cards, the newer D-Link and Linksys combo cards, Accton EN2212    cards, the RPTI EP400, and the PreMax PE-200 in non-shared-memory    mode, and the IBM Credit Card Adapter, the NE4100, the Thomas    Conrad ethernet card, and the Kingston KNE-PCM/x in shared-memory    mode.  It will also handle the Socket EA card in either mode.    Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net    pcnet_cs.c 1.153 2003/11/09 18:53:09        The network driver code is based on Donald Becker's NE2000 code:    Written 1992,1993 by Donald Becker.    Copyright 1993 United States Government as represented by the    Director, National Security Agency.  This software may be used and    distributed according to the terms of the GNU General Public License,    incorporated herein by reference.    Donald Becker may be reached at becker@scyld.com    Based also on Keith Moore's changes to Don Becker's code, for IBM    CCAE support.  Drivers merged back together, and shared-memory    Socket EA support added, by Ken Raeburn, September 1995.======================================================================*/#include <linux/kernel.h>#include <linux/module.h>#include <linux/init.h>#include <linux/sched.h>#include <linux/ptrace.h>#include <linux/slab.h>#include <linux/string.h>#include <linux/timer.h>#include <linux/delay.h>#include <linux/ethtool.h>#include <asm/io.h>#include <asm/system.h>#include <asm/byteorder.h>#include <asm/uaccess.h>#include <linux/netdevice.h>#include <../drivers/net/8390.h>#include <pcmcia/version.h>#include <pcmcia/cs_types.h>#include <pcmcia/cs.h>#include <pcmcia/cistpl.h>#include <pcmcia/ciscode.h>#include <pcmcia/ds.h>#include <pcmcia/cisreg.h>#define PCNET_CMD	0x00#define PCNET_DATAPORT	0x10	/* NatSemi-defined port window offset. */#define PCNET_RESET	0x1f	/* Issue a read to reset, a write to clear. */#define PCNET_MISC	0x18	/* For IBM CCAE and Socket EA cards */#define PCNET_START_PG	0x40	/* First page of TX buffer */#define PCNET_STOP_PG	0x80	/* Last page +1 of RX ring *//* Socket EA cards have a larger packet buffer */#define SOCKET_START_PG	0x01#define SOCKET_STOP_PG	0xff#define PCNET_RDC_TIMEOUT (2*HZ/100)	/* Max wait in jiffies for Tx RDC */static char *if_names[] = { "auto", "10baseT", "10base2"};#ifdef PCMCIA_DEBUGstatic int pc_debug = PCMCIA_DEBUG;MODULE_PARM(pc_debug, "i");#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)static char *version ="pcnet_cs.c 1.153 2003/11/09 18:53:09 (David Hinds)";#else#define DEBUG(n, args...)#endif/*====================================================================*//* Module parameters */MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");MODULE_DESCRIPTION("NE2000 compatible PCMCIA ethernet driver");MODULE_LICENSE("GPL");#define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")/* Bit map of interrupts to choose from */INT_MODULE_PARM(irq_mask,	0xdeb8);static int irq_list[4] = { -1 };MODULE_PARM(irq_list, "1-4i");INT_MODULE_PARM(if_port,	1);	/* Transceiver type */INT_MODULE_PARM(use_big_buf,	1);	/* use 64K packet buffer? */INT_MODULE_PARM(mem_speed,	0);	/* shared mem speed, in ns */INT_MODULE_PARM(delay_output,	0);	/* pause after xmit? */INT_MODULE_PARM(delay_time,	4);	/* in usec */INT_MODULE_PARM(use_shmem,	-1);	/* use shared memory? */INT_MODULE_PARM(full_duplex,	0);	/* full duplex? *//* Ugh!  Let the user hardwire the hardware address for queer cards */static int hw_addr[6] = { 0, /* ... */ };MODULE_PARM(hw_addr, "6i");/*====================================================================*/static void mii_phy_probe(struct net_device *dev);static void pcnet_config(dev_link_t *link);static void pcnet_release(u_long arg);static int pcnet_event(event_t event, int priority,		       event_callback_args_t *args);static int pcnet_open(struct net_device *dev);static int pcnet_close(struct net_device *dev);static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);static struct ethtool_ops netdev_ethtool_ops;static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs);static void ei_watchdog(u_long arg);static void pcnet_reset_8390(struct net_device *dev);static int set_config(struct net_device *dev, struct ifmap *map);static int setup_shmem_window(dev_link_t *link, int start_pg,			      int stop_pg, int cm_offset);static int setup_dma_config(dev_link_t *link, int start_pg,			    int stop_pg);static dev_link_t *pcnet_attach(void);static void pcnet_detach(dev_link_t *);static dev_info_t dev_info = "pcnet_cs";static dev_link_t *dev_list;/*====================================================================*/typedef struct hw_info_t {    u_int	offset;    u_char	a0, a1, a2;    u_int	flags;} hw_info_t;#define DELAY_OUTPUT	0x01#define HAS_MISC_REG	0x02#define USE_BIG_BUF	0x04#define HAS_IBM_MISC	0x08#define IS_DL10019	0x10#define IS_DL10022	0x20#define HAS_MII		0x40#define USE_SHMEM	0x80	/* autodetected */#define AM79C9XX_HOME_PHY	0x00006B90  /* HomePNA PHY */#define AM79C9XX_ETH_PHY	0x00006B70  /* 10baseT PHY */#define MII_PHYID_REV_MASK	0xfffffff0#define MII_PHYID_REG1		0x02#define MII_PHYID_REG2		0x03static hw_info_t hw_info[] = {    { /* Accton EN2212 */ 0x0ff0, 0x00, 0x00, 0xe8, DELAY_OUTPUT },     { /* Allied Telesis LA-PCM */ 0x0ff0, 0x00, 0x00, 0xf4, 0 },    { /* APEX MultiCard */ 0x03f4, 0x00, 0x20, 0xe5, 0 },    { /* ASANTE FriendlyNet */ 0x4910, 0x00, 0x00, 0x94,      DELAY_OUTPUT | HAS_IBM_MISC },    { /* Danpex EN-6200P2 */ 0x0110, 0x00, 0x40, 0xc7, 0 },    { /* DataTrek NetCard */ 0x0ff0, 0x00, 0x20, 0xe8, 0 },    { /* Dayna CommuniCard E */ 0x0110, 0x00, 0x80, 0x19, 0 },    { /* D-Link DE-650 */ 0x0040, 0x00, 0x80, 0xc8, 0 },    { /* EP-210 Ethernet */ 0x0110, 0x00, 0x40, 0x33, 0 },    { /* EP4000 Ethernet */ 0x01c0, 0x00, 0x00, 0xb4, 0 },    { /* Epson EEN10B */ 0x0ff0, 0x00, 0x00, 0x48,      HAS_MISC_REG | HAS_IBM_MISC },    { /* ELECOM Laneed LD-CDWA */ 0xb8, 0x08, 0x00, 0x42, 0 },    { /* Hypertec Ethernet */ 0x01c0, 0x00, 0x40, 0x4c, 0 },    { /* IBM CCAE */ 0x0ff0, 0x08, 0x00, 0x5a,      HAS_MISC_REG | HAS_IBM_MISC },    { /* IBM CCAE */ 0x0ff0, 0x00, 0x04, 0xac,      HAS_MISC_REG | HAS_IBM_MISC },    { /* IBM CCAE */ 0x0ff0, 0x00, 0x06, 0x29,      HAS_MISC_REG | HAS_IBM_MISC },    { /* IBM FME */ 0x0374, 0x08, 0x00, 0x5a,      HAS_MISC_REG | HAS_IBM_MISC },    { /* IBM FME */ 0x0374, 0x00, 0x04, 0xac,      HAS_MISC_REG | HAS_IBM_MISC },    { /* Kansai KLA-PCM/T */ 0x0ff0, 0x00, 0x60, 0x87,      HAS_MISC_REG | HAS_IBM_MISC },    { /* NSC DP83903 */ 0x0374, 0x08, 0x00, 0x17,      HAS_MISC_REG | HAS_IBM_MISC },    { /* NSC DP83903 */ 0x0374, 0x00, 0xc0, 0xa8,      HAS_MISC_REG | HAS_IBM_MISC },    { /* NSC DP83903 */ 0x0374, 0x00, 0xa0, 0xb0,      HAS_MISC_REG | HAS_IBM_MISC },    { /* NSC DP83903 */ 0x0198, 0x00, 0x20, 0xe0,      HAS_MISC_REG | HAS_IBM_MISC },    { /* I-O DATA PCLA/T */ 0x0ff0, 0x00, 0xa0, 0xb0, 0 },    { /* Katron PE-520 */ 0x0110, 0x00, 0x40, 0xf6, 0 },    { /* Kingston KNE-PCM/x */ 0x0ff0, 0x00, 0xc0, 0xf0,      HAS_MISC_REG | HAS_IBM_MISC },    { /* Kingston KNE-PCM/x */ 0x0ff0, 0xe2, 0x0c, 0x0f,      HAS_MISC_REG | HAS_IBM_MISC },    { /* Kingston KNE-PC2 */ 0x0180, 0x00, 0xc0, 0xf0, 0 },    { /* Maxtech PCN2000 */ 0x5000, 0x00, 0x00, 0xe8, 0 },    { /* NDC Instant-Link */ 0x003a, 0x00, 0x80, 0xc6, 0 },    { /* NE2000 Compatible */ 0x0ff0, 0x00, 0xa0, 0x0c, 0 },    { /* Network General Sniffer */ 0x0ff0, 0x00, 0x00, 0x65,      HAS_MISC_REG | HAS_IBM_MISC },    { /* Panasonic VEL211 */ 0x0ff0, 0x00, 0x80, 0x45,       HAS_MISC_REG | HAS_IBM_MISC },    { /* PreMax PE-200 */ 0x07f0, 0x00, 0x20, 0xe0, 0 },    { /* RPTI EP400 */ 0x0110, 0x00, 0x40, 0x95, 0 },    { /* SCM Ethernet */ 0x0ff0, 0x00, 0x20, 0xcb, 0 },    { /* Socket EA */ 0x4000, 0x00, 0xc0, 0x1b,      DELAY_OUTPUT | HAS_MISC_REG | USE_BIG_BUF },    { /* Socket LP-E CF+ */ 0x01c0, 0x00, 0xc0, 0x1b, 0 },    { /* SuperSocket RE450T */ 0x0110, 0x00, 0xe0, 0x98, 0 },    { /* Volktek NPL-402CT */ 0x0060, 0x00, 0x40, 0x05, 0 },    { /* NEC PC-9801N-J12 */ 0x0ff0, 0x00, 0x00, 0x4c, 0 },    { /* PCMCIA Technology OEM */ 0x01c8, 0x00, 0xa0, 0x0c, 0 }};#define NR_INFO		(sizeof(hw_info)/sizeof(hw_info_t))static hw_info_t default_info = { 0, 0, 0, 0, 0 };static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII };static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII };typedef struct pcnet_dev_t {    struct net_device	dev;	/* so &dev == &pcnet_dev_t */    dev_link_t		link;    dev_node_t		node;    u_int		flags;    caddr_t		base;    struct timer_list	watchdog;    int			stale, fast_poll;    u_char		phy_id;    u_char		eth_phy, pna_phy;    u_short		link_status;    u_long		mii_reset;} pcnet_dev_t;/*======================================================================    This bit of code is used to avoid unregistering network devices    at inappropriate times.  2.2 and later kernels are fairly picky    about when this can happen.    ======================================================================*/static void flush_stale_links(void){    dev_link_t *link, *next;    for (link = dev_list; link; link = next) {	next = link->next;	if (link->state & DEV_STALE_LINK)	    pcnet_detach(link);    }}/*====================================================================*/static void cs_error(client_handle_t handle, int func, int ret){    error_info_t err = { func, ret };    CardServices(ReportError, handle, &err);}/*======================================================================    We never need to do anything when a pcnet device is "initialized"    by the net software, because we only register already-found cards.======================================================================*/static int pcnet_init(struct net_device *dev){    return 0;}/*======================================================================    pcnet_attach() creates an "instance" of the driver, allocating    local data structures for one device.  The device is registered    with Card Services.======================================================================*/static dev_link_t *pcnet_attach(void){    pcnet_dev_t *info;    dev_link_t *link;    struct net_device *dev;    client_reg_t client_reg;    int i, ret;    DEBUG(0, "pcnet_attach()\n");    flush_stale_links();    /* Create new ethernet device */    info = kmalloc(sizeof(*info), GFP_KERNEL);    if (!info) return NULL;    memset(info, 0, sizeof(*info));    link = &info->link; dev = &info->dev;    link->priv = info;    init_timer(&link->release);    link->release.function = &pcnet_release;    link->release.data = (u_long)link;    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;    link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;    if (irq_list[0] == -1)	link->irq.IRQInfo2 = irq_mask;    else	for (i = 0; i < 4; i++)	    link->irq.IRQInfo2 |= 1 << irq_list[i];    link->conf.Attributes = CONF_ENABLE_IRQ;    link->conf.IntType = INT_MEMORY_AND_IO;    ethdev_init(dev);    dev->init = &pcnet_init;    dev->open = &pcnet_open;    dev->stop = &pcnet_close;    dev->set_config = &set_config;    /* Register with Card Services */    link->next = dev_list;    dev_list = link;    client_reg.dev_info = &dev_info;    client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;    client_reg.EventMask =	CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |	CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |	CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;    client_reg.event_handler = &pcnet_event;    client_reg.Version = 0x0210;    client_reg.event_callback_args.client_data = link;    ret = CardServices(RegisterClient, &link->handle, &client_reg);    if (ret != CS_SUCCESS) {	cs_error(link->handle, RegisterClient, ret);	pcnet_detach(link);	return NULL;    }    return link;} /* pcnet_attach *//*======================================================================    This deletes a driver "instance".  The device is de-registered    with Card Services.  If it has been released, all local data    structures are freed.  Otherwise, the structures will be freed    when the device is released.======================================================================*/static void pcnet_detach(dev_link_t *link){    pcnet_dev_t *info = link->priv;    dev_link_t **linkp;    DEBUG(0, "pcnet_detach(0x%p)\n", link);    /* Locate device structure */    for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)	if (*linkp == link) break;    if (*linkp == NULL)	return;    del_timer(&link->release);    if (link->state & DEV_CONFIG) {	pcnet_release((u_long)link);	if (link->state & DEV_STALE_CONFIG) {	    link->state |= DEV_STALE_LINK;	    return;	}    }    if (link->handle)	CardServices(DeregisterClient, link->handle);    /* Unlink device structure, free bits */    *linkp = link->next;    if (link->dev)	unregister_netdev(&info->dev);    kfree(info);} /* pcnet_detach *//*======================================================================    This probes for a card's hardware address, for card types that    encode this information in their CIS.======================================================================*/static hw_info_t *get_hwinfo(dev_link_t *link){    struct net_device *dev = link->priv;    win_req_t req;    memreq_t mem;    u_char *base, *virt;    int i, j;    /* Allocate a small memory window */    req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;    req.Base = 0; req.Size = 0;    req.AccessSpeed = 0;    link->win = (window_handle_t)link->handle;    i = CardServices(RequestWindow, &link->win, &req);    if (i != CS_SUCCESS) {	cs_error(link->handle, RequestWindow, i);	return NULL;    }    virt = ioremap(req.Base, req.Size);    mem.Page = 0;    for (i = 0; i < NR_INFO; i++) {	mem.CardOffset = hw_info[i].offset & ~(req.Size-1);	CardServices(MapMemPage, link->win, &mem);	base = &virt[hw_info[i].offset & (req.Size-1)];	if ((readb(base+0) == hw_info[i].a0) &&	    (readb(base+2) == hw_info[i].a1) &&	    (readb(base+4) == hw_info[i].a2))	    break;    }    if (i < NR_INFO) {	for (j = 0; j < 6; j++)	    dev->dev_addr[j] = readb(base + (j<<1));    }    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人啪午夜精品网站男同| 欧美日韩在线电影| 欧美日韩一区二区三区不卡| 久久精品夜色噜噜亚洲a∨| 亚洲777理论| 夫妻av一区二区| 精品美女被调教视频大全网站| 亚洲美女区一区| 成人免费视频一区二区| 精品乱人伦小说| 免费精品视频在线| 91精品国产色综合久久ai换脸| 亚洲欧美日韩人成在线播放| 成人性生交大片免费看中文| 欧美成人一区二区三区片免费 | 日本午夜一区二区| 在线欧美小视频| 亚洲精选视频在线| 成人99免费视频| 日本一区二区视频在线观看| 久久国产精品一区二区| 777亚洲妇女| 日本成人中文字幕| 日韩一区二区精品在线观看| 欧美精品色综合| 国产精品成人网| 成人黄色国产精品网站大全在线免费观看 | 亚洲欧美视频在线观看| 豆国产96在线|亚洲| 国产欧美久久久精品影院| 韩国视频一区二区| 精品国产免费一区二区三区四区| 免费的成人av| 精品国产1区二区| 极品销魂美女一区二区三区| 日韩一区二区三区电影| 久久99久久精品| 精品区一区二区| 狠狠色丁香久久婷婷综合_中 | 精品亚洲成a人在线观看| 日韩一区二区免费高清| 精品影视av免费| 中文字幕va一区二区三区| 成人一区二区三区在线观看| 国产精品久久三区| 欧美午夜理伦三级在线观看| 亚洲一区二区三区自拍| 91精品国产高清一区二区三区蜜臀 | 亚洲人吸女人奶水| 日本韩国欧美一区| 奇米影视7777精品一区二区| 26uuu成人网一区二区三区| 国产成人免费在线| 亚洲免费资源在线播放| 8v天堂国产在线一区二区| 激情图区综合网| 亚洲你懂的在线视频| 欧美精品 日韩| 成熟亚洲日本毛茸茸凸凹| 一片黄亚洲嫩模| 精品成人免费观看| 色婷婷久久久综合中文字幕| 天天综合色天天| 中文字幕不卡在线观看| 欧美肥妇bbw| 国产成人午夜视频| 亚洲国产你懂的| 国产欧美精品一区二区色综合 | 不卡一二三区首页| 日韩黄色免费电影| 日本一区二区动态图| 在线观看欧美精品| 经典三级视频一区| 亚洲国产精品久久久男人的天堂| 精品国产乱码久久久久久牛牛| 成人福利电影精品一区二区在线观看 | 麻豆91免费看| 亚洲女同一区二区| 久久嫩草精品久久久精品| 色婷婷狠狠综合| 国产麻豆视频一区二区| 亚洲成av人综合在线观看| 国产精品美女久久久久久2018| 欧美日韩精品一区视频| 成人av免费网站| 久久国产尿小便嘘嘘尿| 亚洲成在线观看| 亚洲人成7777| 国产精品久久午夜夜伦鲁鲁| 日韩欧美国产电影| 欧美日韩一区视频| 色香蕉久久蜜桃| 国产v日产∨综合v精品视频| 老司机精品视频一区二区三区| 亚洲精品va在线观看| 日本一区二区免费在线观看视频 | 蜜桃视频一区二区| 午夜电影一区二区| 亚洲精品免费在线观看| 国产精品女主播av| 日本一区二区三区四区| 精品成人一区二区| 欧美成人vr18sexvr| 欧美一区二区不卡视频| 在线不卡的av| 欧美精品tushy高清| 欧美片在线播放| 欧美日韩成人综合天天影院 | 久久久久青草大香线综合精品| 9191久久久久久久久久久| 欧美在线免费观看视频| 在线国产电影不卡| 色综合天天综合在线视频| 91视频免费观看| 一本在线高清不卡dvd| 91丨九色丨蝌蚪丨老版| 日本精品一区二区三区四区的功能| 99久久精品99国产精品| 97精品超碰一区二区三区| 91麻豆国产精品久久| 欧美特级限制片免费在线观看| 欧美午夜电影一区| 欧美麻豆精品久久久久久| 日韩一区二区电影在线| 久久五月婷婷丁香社区| 欧美激情一区二区三区全黄| 中文字幕在线观看不卡视频| 亚洲精品日产精品乱码不卡| 亚洲制服丝袜在线| 天天操天天色综合| 激情综合色播五月| 9久草视频在线视频精品| 欧美在线小视频| 欧美一级片免费看| 久久网这里都是精品| 中文字幕在线一区免费| 性感美女极品91精品| 九九精品一区二区| 91麻豆swag| 欧美一区二区三区在线观看视频 | 欧美一激情一区二区三区| 久久这里只有精品首页| 国产精品高清亚洲| 亚洲国产精品视频| 精品制服美女久久| 91美女在线观看| 精品国产乱码久久久久久免费| 亚洲欧洲日韩av| 免费观看成人鲁鲁鲁鲁鲁视频| 成人一区在线观看| 欧美片网站yy| 国产精品女主播av| 蜜桃视频在线观看一区| 99久久精品久久久久久清纯| 欧美成人bangbros| 一区二区三区四区在线免费观看 | 日本欧美在线观看| 99久久精品免费看| 欧美va亚洲va香蕉在线| 亚洲欧美日本韩国| 国产一区二区在线看| 欧美性大战久久久久久久| 国产拍欧美日韩视频二区| 午夜精品国产更新| 99久久99久久精品国产片果冻 | 国产美女主播视频一区| 在线视频一区二区三区| 国产午夜精品理论片a级大结局 | 亚洲视频综合在线| 免费欧美在线视频| 91精品办公室少妇高潮对白| 久久九九影视网| 日本欧美在线观看| 欧美日韩在线亚洲一区蜜芽| 中文字幕不卡三区| 紧缚捆绑精品一区二区| 欧美一区二区三区四区五区| 亚洲午夜激情网站| 在线免费观看日本一区| 1000部国产精品成人观看| 国产一区二区三区四| 日韩你懂的在线播放| 五月婷婷激情综合| 欧美性猛片xxxx免费看久爱| 国产精品美女久久久久aⅴ| 精品中文字幕一区二区小辣椒| 欧美久久一区二区| 亚洲午夜免费视频| 欧美在线观看禁18| 亚洲男人的天堂一区二区| av亚洲精华国产精华精| 久久久91精品国产一区二区精品| 激情小说亚洲一区| 欧美精品一区二区不卡 | 首页国产丝袜综合| 欧美在线视频不卡| 午夜精品影院在线观看| 欧美一区二区三区男人的天堂| 亚洲国产精品久久久久婷婷884 | 日本三级亚洲精品|