is_iwioctl_allowed(u8 mode, u16 cmd)
{
    if(cmd >= SIOCSIWCOMMIT && cmd <= SIOCGIWPOWER) {
        cmd -= SIOCSIWCOMMIT;
        if(sioctl_filter[cmd] == 0xFF) return 0;
        if(sioctl_filter[cmd] & mode) return 0;
    } else if(cmd >= SIOCIWFIRSTPRIV && cmd <= (SIOCIWFIRSTPRIV+30)) {
        cmd -= SIOCIWFIRSTPRIV;
        if(pioctl_filter[cmd] == 0xFF) return 0;
        if(pioctl_filter[cmd] & mode) return 0;
    } else {
        return A_ERROR;
    }
    return A_ENOTSUP;
}
is_iwioctl_allowed(u8 mode, u16 cmd)
{
    if(cmd >= SIOCSIWCOMMIT && cmd <= SIOCGIWPOWER) {
        cmd -= SIOCSIWCOMMIT;
        if(sioctl_filter[cmd] == 0xFF) return 0;
        if(sioctl_filter[cmd] & mode) return 0;
    } else if(cmd >= SIOCIWFIRSTPRIV && cmd <= (SIOCIWFIRSTPRIV+30)) {
        cmd -= SIOCIWFIRSTPRIV;
        if(pioctl_filter[cmd] == 0xFF) return 0;
        if(pioctl_filter[cmd] & mode) return 0;
    } else {
        return A_ERROR;
    }
    return A_ENOTSUP;
}