+ /* This is weird: WLC_SET_RADIO with 1 as argument disables the radio */
+ int radio = wrqu->txpower.disabled;
+
+ wl_ioctl(dev, WLC_SET_RADIO, &radio, sizeof(int));
+
+ if (!wrqu->txpower.disabled && (wrqu->txpower.value > 0)) {
+ int value;
+
+ if (wl_get_val(dev, "qtxpower", &value, sizeof(int)) < 0)
+ return -EINVAL;
+
+ value &= WL_TXPWR_OVERRIDE;
+ wrqu->txpower.value *= 4;
+ wrqu->txpower.value |= value;
+
+ if (wrqu->txpower.flags != IW_TXPOW_DBM)
+ return -EINVAL;
+
+ if (wrqu->txpower.value > 0)
+ if (wl_set_val(dev, "qtxpower", &(wrqu->txpower.value), sizeof(int)) < 0)
+ return -EINVAL;
+ }
+ break;
+ }
+ case SIOCSIWENCODE:
+ {
+ int val = 0, wep = 1, wrestrict = 1;
+ int index = (wrqu->data.flags & IW_ENCODE_INDEX) - 1;
+
+ if (index < 0)
+ index = get_primary_key(dev);