Ticket #966: 005-state_machine_sta_init-run_fix.diff

File 005-state_machine_sta_init-run_fix.diff, 2.8 kB (added by xmxwx@asn.pl, 6 years ago)
  • madwifi/net80211/ieee80211_proto.c

    old new  
    15801580                        nrunning = nscanning = 0; 
    15811581                        TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) { 
    15821582                                if (vap != tmpvap) { 
     1583                                        if (tmpvap->iv_opmode == IEEE80211_M_MONITOR) 
     1584                                                /* skip monitor vaps as their 
     1585                                                 * S_RUN shouldn't have any 
     1586                                                 * influence on modifying state 
     1587                                                 * transition */ 
     1588                                                continue; 
    15831589                                        if (tmpvap->iv_state == IEEE80211_S_RUN) 
    15841590                                                nrunning++; 
    15851591                                        else if (tmpvap->iv_state == IEEE80211_S_SCAN || 
     
    15941594                        } else if (!nscanning && nrunning) { 
    15951595                                /* when no one is scanning but someone is running, bypass 
    15961596                                 * scan and go to run state immediately */ 
    1597                                 __ieee80211_newstate(vap, IEEE80211_S_RUN, arg); 
     1597                                if (vap->iv_opmode == IEEE80211_M_MONITOR || 
     1598                                    vap->iv_opmode == IEEE80211_M_WDS || 
     1599                                    vap->iv_opmode == IEEE80211_M_HOSTAP) { 
     1600                                        __ieee80211_newstate(vap, IEEE80211_S_RUN, arg); 
     1601                                } else { 
     1602                                        /* MW: avoid invalid S_INIT -> S_RUN transition */ 
     1603                                        __ieee80211_newstate(vap, nstate, arg); 
     1604                                } 
    15981605                        } else if (nscanning && !nrunning) { 
    15991606                                /* when someone is scanning and no one is running, set 
    16001607                                 * the scan pending flag. Don't go through state machine */