亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2820 | 回復(fù): 1
打印 上一主題 下一主題

[求助]cs8900a網(wǎng)卡驅(qū)動中的io的初始化問題? [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2008-09-04 20:04 |只看該作者 |倒序瀏覽
請教下面的io和irq是怎樣賦值的,在哪兒賦值?謝謝哈!
#ifdef MODULE
static struct net_device *dev_cs89x0;
/*
* Support the 'debug' module parm even if we're compiled for non-debug to
* avoid breaking someone's startup scripts
*/
static int io;
static int irq;

static int debug;
static char media[8];
static int duplex=-1;
static int use_dma;   /* These generate unused var warnings if ALLOW_DMA = 0 */
static int dma;
static int dmasize=16;   /* or 64 */
module_param(io, int, 0);
module_param(irq, int, 0);

module_param(debug, int, 0);
module_param_string(media, media, sizeof(media), 0);
module_param(duplex, int, 0);
module_param(dma , int, 0);
module_param(dmasize , int, 0);
module_param(use_dma , int, 0);
MODULE_PARM_DESC(io, "cs89x0 I/O base address");
MODULE_PARM_DESC(irq, "cs89x0 IRQ number");

#if DEBUGGING
MODULE_PARM_DESC(debug, "cs89x0 debug level (0-6)");
#else
MODULE_PARM_DESC(debug, "(ignored)");
#endif
MODULE_PARM_DESC(media, "Set cs89x0 adapter(s) media type(s) (rj45,bnc,aui)");
/* No other value than -1 for duplex seems to be currently interpreted */
MODULE_PARM_DESC(duplex, "(ignored)");
#if ALLOW_DMA
MODULE_PARM_DESC(dma , "cs89x0 ISA DMA channel; ignored if use_dma=0");
MODULE_PARM_DESC(dmasize , "cs89x0 DMA size in kB (16,64); ignored if use_dma=0");
MODULE_PARM_DESC(use_dma , "cs89x0 using DMA (0-1)");
#else
MODULE_PARM_DESC(dma , "(ignored)");
MODULE_PARM_DESC(dmasize , "(ignored)");
MODULE_PARM_DESC(use_dma , "(ignored)");
#endif
MODULE_AUTHOR("Mike Cruse, Russwll Nelson <nelson@crynwr.com>, Andrew Morton <andrewm@uow.edu.au>");
MODULE_LICENSE("GPL");

/*
* media=t             - specify media type
   or media=2
   or media=aui
   or medai=auto
* duplex=0            - specify forced half/full/autonegotiate duplex
* debug=#             - debug level

* Default Chip Configuration:
  * DMA Burst = enabled
  * IOCHRDY Enabled = enabled
    * UseSA = enabled
    * CS8900 defaults to half-duplex if not specified on command-line
    * CS8920 defaults to autoneg if not specified on command-line
    * Use reset defaults for other config parameters
* Assumptions:
  * media type specified is supported (circuitry is present)
  * if memory address is > 1MB, then required mem decode hw is present
  * if 10B-2, then agent other than driver will enable DC/DC converter
    (hw or software util)

*/
int
init_module(void)
{
struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
struct net_local *lp;
int ret = 0;
#if DEBUGGING
net_debug = debug;
#else
debug = 0;
#endif
if (!dev)
  return -ENOMEM;
dev->irq = irq;
dev->base_addr = io;

lp = netdev_priv(dev);
#if ALLOW_DMA
if (use_dma) {
  lp->use_dma = use_dma;
  lp->dma = dma;
  lp->dmasize = dmasize;
}
#endif
spin_lock_init(&lp->lock);
        /* boy, they'd better get these right */
        if (!strcmp(media, "rj45"))
  lp->adapter_cnf = A_CNF_MEDIA_10B_T | A_CNF_10B_T;
else if (!strcmp(media, "aui"))
  lp->adapter_cnf = A_CNF_MEDIA_AUI   | A_CNF_AUI;
else if (!strcmp(media, "bnc"))
  lp->adapter_cnf = A_CNF_MEDIA_10B_2 | A_CNF_10B_2;
else
  lp->adapter_cnf = A_CNF_MEDIA_10B_T | A_CNF_10B_T;
        if (duplex==-1)
  lp->auto_neg_cnf = AUTO_NEG_ENABLE;
       if (io == 0) {
                printk(KERN_ERR "cs89x0.c: Module autoprobing not allowed.\n");
                printk(KERN_ERR "cs89x0.c: Append io=0xNNN\n");
                ret = -EPERM;
  goto out;
        } else if (io <= 0x1ff) {
  ret = -ENXIO;
  goto out;
}

#if ALLOW_DMA
if (use_dma && dmasize != 16 && dmasize != 64) {
  printk(KERN_ERR "cs89x0.c: dma size must be either 16K or 64K, not %dK\n", dmasize);
  ret = -EPERM;
  goto out;
}
#endif
ret = cs89x0_probe1(dev, io, 1);
if (ret)
  goto out;
dev_cs89x0 = dev;
return 0;
out:
free_netdev(dev);
return ret;
}

論壇徽章:
0
2 [報告]
發(fā)表于 2008-09-12 09:54 |只看該作者
我覺得應(yīng)該是加在模塊的時候傳進來的吧
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP