Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #1388: madwifi-0.9.3-chanswitch.diff

File madwifi-0.9.3-chanswitch.diff, 2.0 kB (added by mtaylor, 12 years ago)

Updated logic for live channel changes for AP

  • net80211/ieee80211_wireless.c

    old new  
    7272         (_vap)->iv_ic->ic_roaming == IEEE80211_ROAMING_AUTO) 
    7373#define RESCAN  1 
    7474 
     75static void 
     76pre_announced_chanswitch(struct net_device *dev, u_int32_t channel, u_int32_t tbtt); 
     77 
    7578static int 
    7679preempt_scan(struct net_device *dev, int max_grace, int max_wait) 
    7780{ 
     
    754757                if (vap->iv_state == IEEE80211_S_RUN) { 
    755758                        ic->ic_set_channel(ic); 
    756759                } 
     760        } else if(vap->iv_opmode == IEEE80211_M_HOSTAP) { 
     761                /*  
     762                Need to use channel switch announcement on beacon if we are up and running.   
     763                We use ic_set_channel directly if we are "running" but not "up". 
     764                Otherwise iv_des_chan will take effect when we are transitioned. 
     765                */ 
     766                if(IS_UP(vap->iv_dev)) { 
     767                        pre_announced_chanswitch(dev, ieee80211_chan2ieee(ic, vap->iv_des_chan), IEEE80211_DEFAULT_CHANCHANGE_TBTT_COUNT); 
     768                } 
     769                else if (vap->iv_state == IEEE80211_S_RUN) { 
     770                        ic->ic_curchan = vap->iv_des_chan; 
     771                        ic->ic_set_channel(ic); 
     772                } 
    757773        } else { 
    758774                /* 
    759775                 * Need to go through the state machine in case we need 
     
    41324148        return (error ? -EFAULT : 0); 
    41334149} 
    41344150 
     4151static void 
     4152pre_announced_chanswitch(struct net_device *dev, u_int32_t channel, u_int32_t tbtt) { 
     4153        struct ieee80211vap *vap = dev->priv; 
     4154        struct ieee80211com *ic = vap->iv_ic; 
     4155        /* now flag the beacon update to include the channel switch IE */ 
     4156        ic->ic_flags |= IEEE80211_F_CHANSWITCH; 
     4157        ic->ic_chanchange_chan = channel; 
     4158        ic->ic_chanchange_tbtt = tbtt; 
     4159} 
     4160 
    41354161static int 
    41364162ieee80211_ioctl_chanswitch(struct net_device *dev, struct iw_request_info *info, 
    41374163        void *w, char *extra) 
     
    41434167        if (!(ic->ic_flags & IEEE80211_F_DOTH)) 
    41444168                return 0; 
    41454169 
    4146         /* now flag the beacon update to include the channel switch IE */ 
    4147         ic->ic_flags |= IEEE80211_F_CHANSWITCH; 
    4148         ic->ic_chanchange_chan = param[0]; 
    4149         ic->ic_chanchange_tbtt = param[1]; 
     4170        pre_announced_chanswitch(dev, param[0], param[1]); 
    41504171 
    41514172        return 0; 
    41524173}