发送模块
struct sk_buff *ieee80211_encap(struct ieee80211com *ic, struct sk_buff *skb, struct ieee80211_node *ni)函数负责组装帧,在If_ath.c之中进行调用
skb = ieee80211_encap(ic, skb, ni);从而来进行帧的组装以及发送,在这里面要先进行802.3格式的以太帧头的剔除(skb_pull),但是头的信息还是要保留来复制得到后面的802.11格式的帧头.后面又会有一些复制地址得到4地址格式的802.11帧头的操作(skb_push)
ieee80211_encap 是由ath_start(if_ath.c)来调用.ath_start是ath_attach(if_ath.c)来进行调用将其做为网络设备的发送函数.而ath_start是由ath_pci_probe(if_ath_pci.c)来调用
ieee80211_mgmt_output函数是由ieee80211_send_mgmt来调用发送encap封装好的数据帧(已经完成了头转换的数据帧),而ieee80211_send_mgmt是由ieee80211_proto_attach函数(ieee80211_proto.c)来将其绑定在ieee80211com类型的结构体ic上(ic->ic_send_mgmt = ieee80211_send_mgmt),而ieee80211_proto_attach函数是由ieee80211_ifattach(ieee80211.c)来调用.而ieee80211_ifattach是由ath_attach(if_ath.c)来调用,而ath_attach(if_ath.c)是由ath_pci_probe(if_ath_pci.c)来调用