Ticket #1388: madwifi-0.9.3-chanswitch.diff
| File madwifi-0.9.3-chanswitch.diff, 2.0 kB (added by mtaylor, 2 years ago) |
|---|
-
net80211/ieee80211_wireless.c
old new 72 72 (_vap)->iv_ic->ic_roaming == IEEE80211_ROAMING_AUTO) 73 73 #define RESCAN 1 74 74 75 static void 76 pre_announced_chanswitch(struct net_device *dev, u_int32_t channel, u_int32_t tbtt); 77 75 78 static int 76 79 preempt_scan(struct net_device *dev, int max_grace, int max_wait) 77 80 { … … 754 757 if (vap->iv_state == IEEE80211_S_RUN) { 755 758 ic->ic_set_channel(ic); 756 759 } 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 } 757 773 } else { 758 774 /* 759 775 * Need to go through the state machine in case we need … … 4132 4148 return (error ? -EFAULT : 0); 4133 4149 } 4134 4150 4151 static void 4152 pre_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 4135 4161 static int 4136 4162 ieee80211_ioctl_chanswitch(struct net_device *dev, struct iw_request_info *info, 4137 4163 void *w, char *extra) … … 4143 4167 if (!(ic->ic_flags & IEEE80211_F_DOTH)) 4144 4168 return 0; 4145 4169 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]); 4150 4171 4151 4172 return 0; 4152 4173 }
