如何 nl80211 库 &cfg80211 工作吗? [英] How nl80211 library & cfg80211 work?

查看:33
本文介绍了如何 nl80211 库 &cfg80211 工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想详细了解 nl80211cfg80211 的工作原理.函数流,nl80211 如何与wpa_supplicantiw 等网络工具交互.

I want to learn about how nl80211 and cfg80211 works in detail. Function flow, how nl80211 interact with network tools like wpa_supplicant, iw.

请给我推荐一些有用的链接或书籍以供参考.

Plz suggest me some useful links or books to refer.

推荐答案

为了能够从用户空间控制无线驱动程序,使用了内核和用户空间之间的一些 IPC 通信进程.

To be able to control wireless drivers from userspace, some IPC communication processes between kernel and userspace are used.

  • 最初使用了带有供应商相关 API 的 ioctl.
  • 1996 年,Jean Tourrilhes 创建了无线扩展(我们或 WEXT).
  • At first ioctl with vendor dependent APIs was used.
  • In 1996, Jean Tourrilhes creates wireless extensions (WE or WEXT).

无线扩展 (WE) 是一个通用 API,允许驱动程序向用户空间配置和特定于的统计信息公开常见的无线局域网.

The Wireless Extension (WE) is a generic API allowing a driver to expose to the user space configuration and statistics specific to common Wireless LANs.

  • 2006 年,John Linville 创建了 mac80211 和 JohannesBerg 创建了 cfg80211nl80211.它旨在共同取代无线扩展.

    • In 2006, John Linville creates mac80211 and Johannes Berg creates cfg80211 and nl80211. Together it is intended to replace wireless extensions.

      +-------------+
      |             |
      |  Userspace  |
      |             |
      +-------------+
            ^
      - - - | - - - - 
            | nl80211
            v
      +-------------+
      |             |
      |  cfg80211   |
      |             |
      +-------------+
      +-------------+
      |             |
      |  mac80211   |
      |   driver    |
      |             |
      +-------------+
      

    • 重要的一点是 nl80211/cfg80211/mac80211 不再使用 ioctl,他们使用 netlink.

      An important point is that nl80211/cfg80211/mac80211 no longer use ioctl, they use netlink.

      所以,像 iwhostapdwpa_supplicanta> 使用一些 netlink 库(例如 libnllibnl-tiny) 和 netlink 接口公共头文件课程 nl80211.h.

      So, tools like iw, hostapd or the wpa_supplicant use some netlink libraries (like libnl or libnl-tiny) and the netlink interface public header which is of course nl80211.h.

      没有太多文档,但我建议您阅读 libnl 文档然后是 iw 源代码(因为 iw 使用 libnl).

      There is not so much documentations, but I advise you to read the libnl documentation and then the iw source code (because iw use libnl).

      这篇关于如何 nl80211 库 &cfg80211 工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆