aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/wext-compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r--net/wireless/wext-compat.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 9fbfb8536e75..d030c5315672 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -764,6 +764,8 @@ int cfg80211_wext_siwtxpower(struct net_device *dev,
764 764
765 /* only change when not disabling */ 765 /* only change when not disabling */
766 if (!data->txpower.disabled) { 766 if (!data->txpower.disabled) {
767 rfkill_set_sw_state(rdev->rfkill, false);
768
767 if (data->txpower.fixed) { 769 if (data->txpower.fixed) {
768 /* 770 /*
769 * wext doesn't support negative values, see 771 * wext doesn't support negative values, see
@@ -787,7 +789,9 @@ int cfg80211_wext_siwtxpower(struct net_device *dev,
787 } 789 }
788 } 790 }
789 } else { 791 } else {
790 type = TX_POWER_OFF; 792 rfkill_set_sw_state(rdev->rfkill, true);
793 schedule_work(&rdev->rfkill_sync);
794 return 0;
791 } 795 }
792 796
793 return rdev->ops->set_tx_power(wdev->wiphy, type, dbm);; 797 return rdev->ops->set_tx_power(wdev->wiphy, type, dbm);;
@@ -811,13 +815,12 @@ int cfg80211_wext_giwtxpower(struct net_device *dev,
811 return -EOPNOTSUPP; 815 return -EOPNOTSUPP;
812 816
813 err = rdev->ops->get_tx_power(wdev->wiphy, &val); 817 err = rdev->ops->get_tx_power(wdev->wiphy, &val);
814 /* HACK!!! */ 818 if (err)
815 if (err && err != -ENETDOWN)
816 return err; 819 return err;
817 820
818 /* well... oh well */ 821 /* well... oh well */
819 data->txpower.fixed = 1; 822 data->txpower.fixed = 1;
820 data->txpower.disabled = err == -ENETDOWN; 823 data->txpower.disabled = rfkill_blocked(rdev->rfkill);
821 data->txpower.value = val; 824 data->txpower.value = val;
822 data->txpower.flags = IW_TXPOW_DBM; 825 data->txpower.flags = IW_TXPOW_DBM;
823 826