wireless-tools 内核驱动 前端 网卡 分析


J:\sdb1\_xfile\2013_all_iso\_xfile_2013_06\linux-3.9.3_chm\drivers\net.chm::/S/997.html

root/wireless/airo.c
3058 static int airo_thread(void *data) {



#获取当前的频率 调用树 如下:
5873 static int airo_get_freq
5882         readConfigRid(local, 1);
1804             rc = PC4500_readrid(ai, RID_ACTUALCONFIG, &cfg, sizeof(cfg), lock);
4148                     PC4500_accessrid(ai, rid, CMD_ACCESS))!=SUCCESS) {
4104                         issuecommand(ai, &cmd, &rsp);
3937                             OUT4500(ai, PARAM0, pCmd->parm0);
3548                                 outb( val >> 8, ai->dev->base_addr + reg + 1 );


    
#==========================================================================
#一个 完成的无线网卡的驱动应该如下, 注册 ioctl  常用的函数,
#下面的ioctl 内核 最新的调用的方式:
7572 static const iw_handler         airo_handler[] =
7573 {
7574         (iw_handler) airo_config_commit,        /* SIOCSIWCOMMIT */
7575         (iw_handler) airo_get_name,             /* SIOCGIWNAME */
7576         (iw_handler) NULL,                      /* SIOCSIWNWID */
7577         (iw_handler) NULL,                      /* SIOCGIWNWID */
7578         (iw_handler) airo_set_freq,             /* SIOCSIWFREQ */
7579         (iw_handler) airo_get_freq,             /* SIOCGIWFREQ */
7580         (iw_handler) airo_set_mode,             /* SIOCSIWMODE */
7581         (iw_handler) airo_get_mode,             /* SIOCGIWMODE */
7582         (iw_handler) airo_set_sens,             /* SIOCSIWSENS */
7583         (iw_handler) airo_get_sens,             /* SIOCGIWSENS */
7584         (iw_handler) NULL,                      /* SIOCSIWRANGE */
7585         (iw_handler) airo_get_range,            /* SIOCGIWRANGE */
7586         (iw_handler) NULL,                      /* SIOCSIWPRIV */
7587         (iw_handler) NULL,                      /* SIOCGIWPRIV */
7588         (iw_handler) NULL,                      /* SIOCSIWSTATS */
7589         (iw_handler) NULL,                      /* SIOCGIWSTATS */
7590         iw_handler_set_spy,                     /* SIOCSIWSPY */
7591         iw_handler_get_spy,                     /* SIOCGIWSPY */
7592         iw_handler_set_thrspy,                  /* SIOCSIWTHRSPY */
7593         iw_handler_get_thrspy,                  /* SIOCGIWTHRSPY */
7594         (iw_handler) airo_set_wap,              /* SIOCSIWAP */
7595         (iw_handler) airo_get_wap,              /* SIOCGIWAP */
7596         (iw_handler) NULL,                      /* -- hole -- */
7597         (iw_handler) airo_get_aplist,           /* SIOCGIWAPLIST */
7598         (iw_handler) airo_set_scan,             /* SIOCSIWSCAN */
7599         (iw_handler) airo_get_scan,             /* SIOCGIWSCAN */
7600         (iw_handler) airo_set_essid,            /* SIOCSIWESSID */
7601         (iw_handler) airo_get_essid,            /* SIOCGIWESSID */
7602         (iw_handler) airo_set_nick,             /* SIOCSIWNICKN */
7603         (iw_handler) airo_get_nick,             /* SIOCGIWNICKN */
7604         (iw_handler) NULL,                      /* -- hole -- */
7605         (iw_handler) NULL,                      /* -- hole -- */
7606         (iw_handler) airo_set_rate,             /* SIOCSIWRATE */
7607         (iw_handler) airo_get_rate,             /* SIOCGIWRATE */
7608         (iw_handler) airo_set_rts,              /* SIOCSIWRTS */
7609         (iw_handler) airo_get_rts,              /* SIOCGIWRTS */
7610         (iw_handler) airo_set_frag,             /* SIOCSIWFRAG */
7611         (iw_handler) airo_get_frag,             /* SIOCGIWFRAG */
7612         (iw_handler) airo_set_txpow,            /* SIOCSIWTXPOW */
7613         (iw_handler) airo_get_txpow,            /* SIOCGIWTXPOW */
7614         (iw_handler) airo_set_retry,            /* SIOCSIWRETRY */
7615         (iw_handler) airo_get_retry,            /* SIOCGIWRETRY */
7616         (iw_handler) airo_set_encode,           /* SIOCSIWENCODE */
7617         (iw_handler) airo_get_encode,           /* SIOCGIWENCODE */
7618         (iw_handler) airo_set_power,            /* SIOCSIWPOWER */
7619         (iw_handler) airo_get_power,            /* SIOCGIWPOWER */
7620         (iw_handler) NULL,                      /* -- hole -- */
7621         (iw_handler) NULL,                      /* -- hole -- */
7622         (iw_handler) NULL,                      /* SIOCSIWGENIE */
7623         (iw_handler) NULL,                      /* SIOCGIWGENIE */
7624         (iw_handler) airo_set_auth,             /* SIOCSIWAUTH */
7625         (iw_handler) airo_get_auth,             /* SIOCGIWAUTH */
7626         (iw_handler) airo_set_encodeext,        /* SIOCSIWENCODEEXT */
7627         (iw_handler) airo_get_encodeext,        /* SIOCGIWENCODEEXT */
7628         (iw_handler) NULL,                      /* SIOCSIWPMKSA */
7629 };




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值