正常的切换过程:
cmd "switch channel " -> ioctl() -> system kernal -> ieee80211_ioctl_siwfreq() : { } | | |
|
To reduce channel switch delay , modifications are made to madwifi driver code.
Iwill display what I found out according NetX's codes
1. struct ieee80211com { ...... /*在此结构体内添加一个切换函数指针*/ #ifdef CCK_NOASSOC /* No Association */ void (*ic_chan_set)(struct ieee80211com *, struct ieee80211_channel *); #endif /* CCK_NOASSOC */ ....... } 在函数 ath_attach() 中,ic_chan_set 被指向为 ath_chan_wrapper() 【见右边】 该函数很简单,如下: #ifdef CCK_NOASSOC /* No Association */ static void ath_chan_wrapper (struct ieee80211com *ic, struct ieee80211_channel *chan) { struct net_device *dev = ic->ic_dev; struct ath_softc *sc = dev->priv; (void)ath_chan_set(sc, chan); } #endif /* CCK_NOASSOC */ 只有三行,直接调用ath_chan_set()函数。 | | |
###### # # # # # # in func ath_attach(): #ifdef CCK_NOASSOC /* CCK Tx unproc */ sc->sc_txunproc = 0; sc->sc_maxtxunproc = 0; ic->ic_chan_set = ath_chan_wrapper; #endif /* CCK_NOASSOC */ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |