Ticket #228: setmode-delay-with-timeout2.diff
| File setmode-delay-with-timeout2.diff, 1.2 kB (added by scottraynel@gmail.com, 3 years ago) |
|---|
-
net80211/ieee80211_wireless.c
old new 48 48 #include <linux/utsname.h> 49 49 #include <linux/if_arp.h> /* XXX for ARPHRD_ETHER */ 50 50 #include <net/iw_handler.h> 51 #include <linux/delay.h> 51 52 52 53 #if WIRELESS_EXT < 14 53 54 #error "Wireless extensions v14 or better is needed." … … 1537 1538 struct ieee80211com *ic = vap->iv_ic; 1538 1539 struct ifreq ifr; 1539 1540 char s[6]; /* big enough for ``11adt'' */ 1540 int retv, mode, ifr_mode ;1541 int retv, mode, ifr_mode, itr_count; 1541 1542 1542 1543 if (ic->ic_media.ifm_cur == NULL) 1543 1544 return -EINVAL; … … 1573 1574 vap->iv_des_mode = mode; 1574 1575 if (IS_UP_AUTO(vap)) { 1575 1576 ieee80211_cancel_scan(vap); 1577 itr_count = 0; 1578 while((ic->ic_flags & IEEE80211_F_SCAN) != 0) { 1579 mdelay(1); 1580 if (itr_count < 100) { 1581 itr_count++; 1582 continue; 1583 } 1584 IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, 1585 "%s: Timeout cancelling current scan.\n", 1586 __func__); 1587 return -ETIMEDOUT; 1588 } 1576 1589 ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); 1577 1590 } 1578 1591 retv = 0;
