如何学习Linux无线驱动程序(mac80211)的结构? [英] How to learn the structure of Linux wireless drivers (mac80211)?

查看:890
本文介绍了如何学习Linux无线驱动程序(mac80211)的结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Linux无线驱动程序mac80211中有很多结构.诸如struct net_devicestruct ieee80211_hwstruct ieee80211_vifstruct ieee80211_local之类的东西.如此众多的结构使我不了解它们包含哪些信息以及何时对其进行初始化.

There is so many structures in the Linux wireless driver mac80211. Things like struct net_device, struct ieee80211_hw, struct ieee80211_vif and struct ieee80211_local and so on. So many structures that I don't understand what information they contain and when them were initialized.

我如何了解它们以及无线驱动程序的整个体系结构?

How can I learn about them and the whole architecture of wireless drivers?

推荐答案

您可能想查看Johannes Berg的(mac80211维护者)幻灯片

You may want to check out Johannes Berg's (mac80211 maintainer) slides here.

它们可能有些过时,但应该给您一个开始的地方.

They may be somewhat outdated but should give you a place to start.

Linux WiFi内核堆栈的高级描述:

A high level description of the Linux WiFi kernel stack:

  1. 重要的是要了解在谈论WiFi时用户空间与内核进行通信的2条路径:
    • 数据路径:将接收到的数据从无线驱动程序传递到netdev内核(通常使用netif_rx()).从那里,网络核心将把它传递给TCP/IP堆栈代码,并将其排队在用户空间进程将从中读取它的相关套接字上.在Tx路径上,将使用ndo_start_xmit()回调将数据包从netdev内核发送到无线驱动程序.该驱动程序通过使用struct net_device_ops来注册一组操作回调(与其他网络设备(如以太网驱动程序)一样).
    • 控制路径:此路径是用户空间控制WiFi接口/设备并执行扫描/身份验证/关联之类的操作的方式.用户空间接口基于netlink,称为nl80211(请参见include/uapi/linux/nl80211.h).您可以发送命令获取事件响应.
  1. It's important to understand there are 2 paths in which userspace communicates with the kernel when we're talking about WiFi:
    • Data path: the data being received is passed from the wireless driver to the netdev core (usually using netif_rx()). From there the net core will pass it through the TCP/IP stack code and will queue it on the relevant sockets from which the userspace process will read it. On the Tx path packets will be sent from the netdev core to the wireless driver using the ndo_start_xmit() callback. The driver registers (like other netdevices such as an ethernet driver) a set of operations callbacks by using the struct net_device_ops.
    • Control path: This path is how userspace controls the WiFi interface/device and performs operations like scan / authentication / association. The userspace interface is based on netlink and called nl80211 (see include/uapi/linux/nl80211.h). You can send commands and get events in response.

这篇关于如何学习Linux无线驱动程序(mac80211)的结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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