Ok, I have learned something about helper functions… and rewrote the script /etc/init.d/iwmf

#!/bin/sh /etc/rc.common                                                                                                           
                                                                                                                                   
START=99                                                                                                                           
USE_PROCD=1                                                                                                                        
                                                                                                                                   
service_triggers()                                                                                                                 
{                                                                                                                                  
        procd_add_reload_trigger wireless                                                                                          
}                                                                                                                                  
                                                                                                                                   
start_service()                                                                                                                    
{                                                                                                                                  
        config_load wireless                                                                                                       
        # Trying to catch all ifaces                                                                                               
        for vif in $(uci -q -X show wireless | grep "ifname" | cut -d'.' -f2); do                                                  
        # Ignring disabled ifaces for $i                                                                                           
        local disabled                                                                                                             
        config_get_bool disabled "$vif" disabled                                                                                   
        if [ "$disabled" = "0" ]; then                                                                                             
                # Setting up variables for check for $vif                                                                          
                config_get maclist "$vif" maclist                                                                                  
                #If there were configured the maclist for the iface, we proceed                                                    
                if [ -n "$maclist" ]; then                                                                                         
                        # Get ifname                                                                                               
                        config_get ifname "$vif" ifname                                                                            
                        # flush MAC list                                                                                           
                        iwpriv "$ifname" maccmd 3                                                                                  
                        # Send the MACs to the card                                                                                
                        for mac in $maclist; do                                                                                    
                                iwpriv "$ifname" addmac "$mac"                                                                     
                        done                                                                                                       
                        # Get the policy                                                                                           
                        config_get macfilter "$vif" macfilter                                                                      
                        # Set up the policy on the card                                                                            
                        case "$macfilter" in                                                                                       
                                allow)                                                                                             
                                        iwpriv "$ifname" maccmd 1                                                                  
                                ;;                                                                                                 
                                deny)                                                                                              
                                        iwpriv "$ifname" maccmd 2                                                                  
                                ;;                                                                                                 
                                *)                                                                                                 
                                        # So, there policy is not setted, but there is maclist... Why?..                           
                                        # May be the user turned off the policy, but keep the maclist?..                           
                                        # If that is true, we should flush the maclist on the iface                                
                                        iwpriv "$ifname" maccmd 3                                                                  
                                        return 0                                                                                   
                                ;;                                                                                                 
                        esac                                                                                                       
                fi                                                                                                                 
        fi                                                                                                                         
        done                                                                                                                       
}                                                                                                                                  
                                                                                                                                   
stop_service()                                                                                                                     
{                                                                                                                                  
        return 0                                                                                                                   
}                                                                                                                                  
                                                                                                                                   
restart_service()                                                                                                                  
{                                                                                                                                  
        start_service                                                                                                              
}

For debugging purposes I replaced the iwpriv and cfg80211tool with wrappers to discover how and by whom they are run on the entire system.

In the first it turned out that the cfg80211tool ath# blockdfschan 1 wipes out all macs from the card…

Ok, I have moved the maclist and macfilter blocks to the bottom of the configuring function in the /lib/wifi/qcawificfg80211.sh So they are executed last in the queue.

But it didn’t helped.
There is still something other, that mess with maclist without executing cfg80211tool or iwpriv.
I can’t figure out what’s going on…

Another problem is the init-script with procd_add_reload_trigger wireless doesn’t reload on the wireless config changes. It certainly should, but doesn’t