resync with kamikaze
[openwrt.git] / target / linux / package / wlcompat / wlcompat.c
index d86a9bd..1540a21 100644 (file)
@@ -494,14 +494,17 @@ static int wlcompat_ioctl(struct net_device *dev,
                }
                case SIOCGIWTXPOW:
                {
                }
                case SIOCGIWTXPOW:
                {
-                       int radio;
+                       int radio, override;
 
                        wl_ioctl(dev, WLC_GET_RADIO, &radio, sizeof(int));
                        
                        if (wl_get_val(dev, "qtxpower", &(wrqu->txpower.value), sizeof(int)) < 0)
                                return -EINVAL;
                        
 
                        wl_ioctl(dev, WLC_GET_RADIO, &radio, sizeof(int));
                        
                        if (wl_get_val(dev, "qtxpower", &(wrqu->txpower.value), sizeof(int)) < 0)
                                return -EINVAL;
                        
+                       override = (wrqu->txpower.value & WL_TXPWR_OVERRIDE) == WL_TXPWR_OVERRIDE;
                        wrqu->txpower.value &= ~WL_TXPWR_OVERRIDE;
                        wrqu->txpower.value &= ~WL_TXPWR_OVERRIDE;
+                       if (!override && (wrqu->txpower.value > 76))
+                               wrqu->txpower.value = 76;
                        wrqu->txpower.value /= 4;
                                
                        wrqu->txpower.fixed = 0;
                        wrqu->txpower.value /= 4;
                                
                        wrqu->txpower.fixed = 0;
@@ -977,13 +980,13 @@ static int new_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) {
 static int __init wlcompat_init()
 {
        int found = 0, i;
 static int __init wlcompat_init()
 {
        int found = 0, i;
-       char *devname = "eth0";
+       char devname[4] = "wl0";
        bss_force = 0;
        
        while (!found && (dev = dev_get_by_name(devname))) {
                if ((dev->wireless_handlers == NULL) && ((wl_ioctl(dev, WLC_GET_MAGIC, &i, sizeof(i)) == 0) && i == WLC_IOCTL_MAGIC))
                        found = 1;
        bss_force = 0;
        
        while (!found && (dev = dev_get_by_name(devname))) {
                if ((dev->wireless_handlers == NULL) && ((wl_ioctl(dev, WLC_GET_MAGIC, &i, sizeof(i)) == 0) && i == WLC_IOCTL_MAGIC))
                        found = 1;
-               devname[3]++;
+               devname[2]++;
        }
        
        if (!found) {
        }
        
        if (!found) {
This page took 0.02731 seconds and 4 git commands to generate.