aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/wext-compat.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-06-02 07:01:41 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-03 14:06:14 -0400
commit1f87f7d3a3b42b20f34cb03f0fd1a41c3d0e27f3 (patch)
tree642882153a48e910a415e6bb23bcfb79fadef6dd /net/wireless/wext-compat.c
parent6081162e2ed78dfcf149b076b047078ab1445cc2 (diff)
cfg80211: add rfkill support
To be easier on drivers and users, have cfg80211 register an rfkill structure that drivers can access. When soft-killed, simply take down all interfaces; when hard-killed the driver needs to notify us and we will take down the interfaces after the fact. While rfkilled, interfaces cannot be set UP. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
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