atheros无线网卡数据包接收流程

来源:互联网 发布:python 画图 编辑:程序博客网 时间:2024/05/17 06:48

本文主要分析atheros无线网卡数据包接收的流程,主要分析函数调用框架

以atheros的UMAC_SUPPORT_APONLY编译选项的开和关两种模式来分析

1. APONLY模式情况下:

从中断开始:

ath_isr

do_ath_isr

ath_isr_aponly

ath_intr_aponly

ath_common_intr_aponly

ath_rx_edma_intr_aponly

ath_rx_intr_aponly //比较重要的函数

ATH_SCHEDULE_TQUEUE(tasklet_schedule)

接下来分析软中断tasklet

ath_tasklet

do_ath_handle_intr

ath_handle_intr_aponly

ath_rx_handler_aponly //比较重要的函数

ATH_TX_EDMA_TASK(ath_tx_edma_tasklet_aponly)

接下来单独分析ath_rx_handler_aponly

ath_rx_handler_aponly

ath_rx_process_aponly

ath_rx_indicate_aponly

ath_net80211_rx_aponly

ni = ieee80211_find_rxnode

ni为NULL,调用ieee80211_input_all

ni不为NULL,并且是AMPDU,调用ath_ampdu_input_aponly

ni不为NULL,并且不是AMPDU,调用ath_net80211_input

ieee80211_input_all和ath_net80211_input最终都会调用ieee80211_input

ieee80211_input

DATA帧,调用ieee80211_input_data

控制帧,调用ieee80211_recv_ctrl

管理帧,调用ieee80211_recv_mgmt


2. GENERIC模式

ath_isr

ath_isr

ath_isr_generic

scn->sc_ops->isr(对应ath_intr)//位于lmac/ath_dev/ath_main.c

ath_common_intr

ath_rx_proc_descfast

ATH_SCHEDULE_TQUEUE(ath_tasklet)

接下来分析软中断部分

ath_tasklet

do_ath_handle_intr

ath_handle_intr_generic

scn->sc_ops->handle_intr(对应ath_handle_intr)

ath_handle_rx_intr

scn->sc_ops->rx_proc(对应ath_rx_tasklet)

ath_rx_process

ath_rx_indicate

sc->sc_ieee_ops->rx_indicate(对应ath_net80211_rx)

scn->sc_ops->rx_proc_frame(对应ath_rx_input)

sc->sc_ieee_ops在初始化时被赋值为net80211_ops的地址,定义在umac/if_lmac/if_ath.c文件中


总结:两种模式,函数名字相差aponly,其实到最后都是要调用到UMAC层的ieee80211_input。无线的驱动是比较复杂的,涉及到好多的东西,需要反复看代码,使用omnipeek抓包工具抓包分析。




1 0
原创粉丝点击