Fast Channel Switching on AP Mode?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fast Channel Switching on AP Mode?

Peter_Cho
Hello~! Madwifi Users~!
I have a question to modify madwifi source code for switching fast.
I tried to do Fast Channel Switching without resetting hardware on AP Mode.
But I could not find the method.
So, Just I modified 'ath_beacon_send()' in 'if_ath.c' file, and I added ath_reset() to 'ath_beacon_send()'.

static void
ath_beacon_send(struct ath_softc *sc, int *needmark, uint64_t hw_tsf)
{
    struct ath_hal *ah = sc->sc_ah;
    struct ieee80211vap *vap;
    struct ath_buf *bf;
    unsigned int slot;
    u_int32_t bfaddr = 0;
    u_int32_t n_beacon;

    /* Add by me */
    u_int                freq;
    struct ieee80211_channel *ch;
    struct ieee80211com      *ic;

    ic = &sc->sc_ic;
    isChannelChange = 0;

    /* Add by me */
    if( isRealBeaconSend == 1 ) {
        if( beacon_cnt_1st >= MAX_BCNT && beacon_cnt_2nd == 0 ) {
            freq = ieee80211_ieee2mhz( Second_CH, IEEE80211_CHAN_2GHZ );
            ch = ieee80211_find11g_channel( ic, freq );
     
            if( ch == NULL )
                ch = ieee80211_find_channel( ic, freq, 0 );
     
            ic->ic_curchan = ch;
            ath_reset( sc->sc_dev );
            ic->ic_bsschan = ch;

            printk( KERN_ERR "func %s Change [%d]->[%d]", __func__, First_CH, Second_CH );
           
            beacon_cnt_1st  = 0;
            current_channel = 2;
            isChannelChange = 1;

            TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
                struct ath_vap *avp = ATH_VAP(vap);
                if (IEEE80211_IS_MODE_DFS_MASTER(vap->iv_opmode)) {
                    int error;
                    /* re alloc beacons to update new channel info */
                    error = ath_beacon_alloc(sc, vap->iv_bss);
                    if (error < 0) {
                        printk( KERN_ERR "Beacon allocation failed: %d\n", error);
                        return;
                    }
                    sc->sc_beacons = 1;
                    avp->av_newstate(vap, IEEE80211_S_RUN, 0);
                }
            }
            ath_reset( sc->sc_dev );
        }
        else if( beacon_cnt_2nd >= MAX_BCNT && beacon_cnt_1st == 0 ) {
            freq = ieee80211_ieee2mhz( First_CH, IEEE80211_CHAN_2GHZ );
            ch = ieee80211_find11g_channel( ic, freq );
     
            if( ch == NULL )
                ch = ieee80211_find_channel( ic, freq, 0 );
            ic->ic_curchan = ch;
            ath_reset( sc->sc_dev );
            ic->ic_bsschan = ch;

            printk( KERN_ERR "func %s Change [%d]->[%d]", __func__, Second_CH, First_CH );

            beacon_cnt_2nd  = 0;
            current_channel = 1;
            isChannelChange = 1;

            TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
                struct ath_vap *avp = ATH_VAP(vap);
                if (IEEE80211_IS_MODE_DFS_MASTER(vap->iv_opmode)) {
                    int error;
                    /* re alloc beacons to update new channel info */
                    error = ath_beacon_alloc(sc, vap->iv_bss);
                    if (error < 0) {
                        printk( KERN_ERR "Beacon allocation failed: %d\n", error);
                        return;
                    }
                    sc->sc_beacons = 1;
                    avp->av_newstate(vap, IEEE80211_S_RUN, 0);
                }
            }

            ath_reset( sc->sc_dev );
        }
    }


but, this modified source is that it just do hardware reset procedure. I don't want to do hardware reset.
I want only to do channel change.
Do you have the solution which is doing channel switching without hardware reset?
Loading...