没有合适的资源?快使用搜索试试~ 我知道了~
Linux Wireless架构总结.pdf
需积分: 48 53 下载量 14 浏览量
2019-11-17
00:05:26
上传
评论 2
收藏 1.08MB PDF 举报
温馨提示
试读
17页
Linux Wireless架构总结,无线网络开发所需要资料,有兴趣可以下载,主要是无线驱动方面的资料
资源推荐
资源详情
资源评论
1. 无线网络驱动(ath9k_htc)
ath9k_htc 是一个基于 USB 接口的 SoftMAC 无线网络适配器。为了其驱动能正常工作,首先必
须调用 usb_register 来注册驱动定义的 usb_driver,以借助 USB Core 的力量来处理与 USB 协议相
关的事件。其代码如下:
[cpp] view plain copy
1. staticstructusb_driverath9k_hif_usb_driver={
2. .name=KBUILD_MODNAME,
3. .probe=ath9k_hif_usb_probe,
4. .disconnect=ath9k_hif_usb_disconnect,
5. #ifdefCONFIG_PM
6. .suspend=ath9k_hif_usb_suspend,
7. .resume=ath9k_hif_usb_resume,
8. .reset_resume=ath9k_hif_usb_resume,
9. #endif
10. .id_table=ath9k_hif_usb_ids,
11. .soft_unbind=1,
12. };
2. 关键数据结构
1) struct ieee80211_hw: 它包含 802.11 PHY 的配置和硬件信息。
2.1 各层间关键数据接口
3. USB 无线适配器枚举过程
当此基于 USB 接口的无线网络适配器被枚举时,ath9k_hif_usb_probe 将被调用。其调用流程如
下图所示:
3.1 struct ieee80211_ops 实例 ath9k_htc_ops(驱动实现)
ath9k_htc_ops: mac80211 通过这些回调函数回调 driver 的处理函数。ath9k_htc 为了接受
mac80211 的管理,它必须首先向 mac80211 注册,以申明自己的存在,从而可以接受 mac80211
的调用。
[cpp] view plain copy
1. structieee80211_opsath9k_htc_ops={
2. .tx=ath9k_htc_tx,//发送 mac80211 要求发送的帧
3. .start=ath9k_htc_start,//第一个被 attach 到此硬件的 net_device 被 enable 之前被调用,之后,可以接
收帧数据
4. .stop=ath9k_htc_stop,//最后一个被 attach 到此硬件的 net_device 被 disable 之后被调用,之后,不可
以接收帧数据
5. .add_interface=ath9k_htc_add_interface,//当一个被 attach 到此硬件的 net_device 被 enable 时被调用
6. .remove_interface=ath9k_htc_remove_interface,//通知 driver 一个接口将要 goingdown
7. .config=ath9k_htc_config,//mac802.11 调用它修改硬件配置
8. .configure_filter=ath9k_htc_configure_filter,//配置设备的接收过滤器
9. .sta_add=ath9k_htc_sta_add,
10. .sta_remove=ath9k_htc_sta_remove,
11. .conf_tx=ath9k_htc_conf_tx,
12. .bss_info_changed=ath9k_htc_bss_info_changed,
13. .set_key=ath9k_htc_set_key,
14. .get_tsf=ath9k_htc_get_tsf,
15. .set_tsf=ath9k_htc_set_tsf,
16. .reset_tsf=ath9k_htc_reset_tsf,
17. .ampdu_action=ath9k_htc_ampdu_action,
18. .sw_scan_start=ath9k_htc_sw_scan_start,
19. .sw_scan_complete=ath9k_htc_sw_scan_complete,
20. .set_rts_threshold=ath9k_htc_set_rts_threshold,
21. .rfkill_poll=ath9k_htc_rfkill_poll_state,
22. .set_coverage_class=ath9k_htc_set_coverage_class,
23. .set_bitrate_mask=ath9k_htc_set_bitrate_mask,
24. };
3.2 struct cfg80211_ops 实例 mac80211_config_ops(mac80211 实现)
cfg80211_ops 定义了无线配置的操作,在它的增加虚拟接口(ieee80211_add_iface)中,它将创建
并注册 net_device。在 mac80211 中,其定义如下所示:
[cpp] view plain copy
1. structcfg80211_opsmac80211_config_ops={
2. .add_virtual_intf=ieee80211_add_iface,//使用给定的名字创建一个"虚拟接口",在 wiphy 的命名空间中创建 net_device
并返回
3. .del_virtual_intf=ieee80211_del_iface,//删除由 ifindex 指定的"虚拟接口"
4. .change_virtual_intf=ieee80211_change_iface,
5. .add_key=ieee80211_add_key,
6. .del_key=ieee80211_del_key,
7. .get_key=ieee80211_get_key,
8. .set_default_key=ieee80211_config_default_key,
9. .set_default_mgmt_key=ieee80211_config_default_mgmt_key,
10. .add_beacon=ieee80211_add_beacon,
11. .set_beacon=ieee80211_set_beacon,
12. .del_beacon=ieee80211_del_beacon,
13. .add_station=ieee80211_add_station,
14. .del_station=ieee80211_del_station,
15. .change_station=ieee80211_change_station,
16. .get_station=ieee80211_get_station,
17. .dump_station=ieee80211_dump_st ation,
18. .dump_survey=ieee80211_dump_survey,
19. #ifdefCONFIG_MAC80211_MESH
20. .add_mpath=ieee80211_add_mpath,
21. .del_mpath=ieee80211_del_mpath,
22. .change_mpath=ieee80211_change_ mpath,
23. .get_mpath=ieee80211_get_mpath,
24. .dump_mpath=ieee80211_dump_mpath,
25. .update_mesh_config=ieee80211_update_mesh_config,
26. .get_mesh_config=ieee80211_get_mesh_config,
剩余16页未读,继续阅读
资源评论
Wi-Fi研习者
- 粉丝: 2253
- 资源: 173
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功