aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwmc3200wifi
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-06-02 07:01:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-03 14:06:14 -0400
commit76963bb602ba91927130a0140d5757a5969e08ac (patch)
tree252f94d59839933a7301148c21d616aa6bfeac92 /drivers/net/wireless/iwmc3200wifi
parent1f87f7d3a3b42b20f34cb03f0fd1a41c3d0e27f3 (diff)
iwm: port to new cfg80211 rfkill
Which means removing all rfkill code since it only does soft-kill which cfg80211 will now handle in exactly the same way the driver did. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi')
-rw-r--r--drivers/net/wireless/iwmc3200wifi/Kconfig1
-rw-r--r--drivers/net/wireless/iwmc3200wifi/Makefile2
-rw-r--r--drivers/net/wireless/iwmc3200wifi/iwm.h4
-rw-r--r--drivers/net/wireless/iwmc3200wifi/netdev.c10
-rw-r--r--drivers/net/wireless/iwmc3200wifi/rfkill.c83
5 files changed, 1 insertions, 99 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/Kconfig b/drivers/net/wireless/iwmc3200wifi/Kconfig
index 41bd4b2b5411..a907aa9eff62 100644
--- a/drivers/net/wireless/iwmc3200wifi/Kconfig
+++ b/drivers/net/wireless/iwmc3200wifi/Kconfig
@@ -4,7 +4,6 @@ config IWM
4 select WIRELESS_EXT 4 select WIRELESS_EXT
5 select CFG80211 5 select CFG80211
6 select FW_LOADER 6 select FW_LOADER
7 select RFKILL
8 7
9config IWM_DEBUG 8config IWM_DEBUG
10 bool "Enable full debugging output in iwmc3200wifi" 9 bool "Enable full debugging output in iwmc3200wifi"
diff --git a/drivers/net/wireless/iwmc3200wifi/Makefile b/drivers/net/wireless/iwmc3200wifi/Makefile
index 7cb415e5c11b..927f022545c1 100644
--- a/drivers/net/wireless/iwmc3200wifi/Makefile
+++ b/drivers/net/wireless/iwmc3200wifi/Makefile
@@ -1,5 +1,5 @@
1obj-$(CONFIG_IWM) := iwmc3200wifi.o 1obj-$(CONFIG_IWM) := iwmc3200wifi.o
2iwmc3200wifi-objs += main.o netdev.o rx.o tx.o sdio.o hal.o fw.o 2iwmc3200wifi-objs += main.o netdev.o rx.o tx.o sdio.o hal.o fw.o
3iwmc3200wifi-objs += commands.o wext.o cfg80211.o eeprom.o rfkill.o 3iwmc3200wifi-objs += commands.o wext.o cfg80211.o eeprom.o
4 4
5iwmc3200wifi-$(CONFIG_IWM_DEBUG) += debugfs.o 5iwmc3200wifi-$(CONFIG_IWM_DEBUG) += debugfs.o
diff --git a/drivers/net/wireless/iwmc3200wifi/iwm.h b/drivers/net/wireless/iwmc3200wifi/iwm.h
index 3b29681792bb..635c16ee6186 100644
--- a/drivers/net/wireless/iwmc3200wifi/iwm.h
+++ b/drivers/net/wireless/iwmc3200wifi/iwm.h
@@ -343,8 +343,4 @@ int iwm_rx_handle_resp(struct iwm_priv *iwm, u8 *buf, unsigned long buf_size,
343 struct iwm_wifi_cmd *cmd); 343 struct iwm_wifi_cmd *cmd);
344void iwm_rx_free(struct iwm_priv *iwm); 344void iwm_rx_free(struct iwm_priv *iwm);
345 345
346/* RF Kill API */
347int iwm_rfkill_init(struct iwm_priv *iwm);
348void iwm_rfkill_exit(struct iwm_priv *iwm);
349
350#endif 346#endif
diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c
index eec7201e91a8..68e2c3b6c7a1 100644
--- a/drivers/net/wireless/iwmc3200wifi/netdev.c
+++ b/drivers/net/wireless/iwmc3200wifi/netdev.c
@@ -136,17 +136,8 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
136 136
137 wdev->netdev = ndev; 137 wdev->netdev = ndev;
138 138
139 ret = iwm_rfkill_init(iwm);
140 if (ret) {
141 dev_err(dev, "Failed to init rfkill\n");
142 goto out_rfkill;
143 }
144
145 return iwm; 139 return iwm;
146 140
147 out_rfkill:
148 unregister_netdev(ndev);
149
150 out_ndev: 141 out_ndev:
151 free_netdev(ndev); 142 free_netdev(ndev);
152 143
@@ -162,7 +153,6 @@ void iwm_if_free(struct iwm_priv *iwm)
162 if (!iwm_to_ndev(iwm)) 153 if (!iwm_to_ndev(iwm))
163 return; 154 return;
164 155
165 iwm_rfkill_exit(iwm);
166 unregister_netdev(iwm_to_ndev(iwm)); 156 unregister_netdev(iwm_to_ndev(iwm));
167 free_netdev(iwm_to_ndev(iwm)); 157 free_netdev(iwm_to_ndev(iwm));
168 iwm_wdev_free(iwm); 158 iwm_wdev_free(iwm);
diff --git a/drivers/net/wireless/iwmc3200wifi/rfkill.c b/drivers/net/wireless/iwmc3200wifi/rfkill.c
deleted file mode 100644
index 8ee2c3c09a02..000000000000
--- a/drivers/net/wireless/iwmc3200wifi/rfkill.c
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * Intel Wireless Multicomm 3200 WiFi driver
3 *
4 * Copyright (C) 2009 Intel Corporation <ilw@linux.intel.com>
5 * Samuel Ortiz <samuel.ortiz@intel.com>
6 * Zhu Yi <yi.zhu@intel.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version
10 * 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 *
22 */
23
24#include <linux/rfkill.h>
25
26#include "iwm.h"
27
28static int iwm_rfkill_set_block(void *data, bool blocked)
29{
30 struct iwm_priv *iwm = data;
31
32 if (!blocked) {
33 if (test_bit(IWM_RADIO_RFKILL_HW, &iwm->radio))
34 return -EBUSY;
35
36 if (test_and_clear_bit(IWM_RADIO_RFKILL_SW, &iwm->radio) &&
37 (iwm_to_ndev(iwm)->flags & IFF_UP))
38 return iwm_up(iwm);
39 } else {
40 if (!test_and_set_bit(IWM_RADIO_RFKILL_SW, &iwm->radio))
41 return iwm_down(iwm);
42 }
43
44 return 0;
45}
46
47static const struct rfkill_ops iwm_rfkill_ops = {
48 .set_block = iwm_rfkill_set_block,
49};
50
51int iwm_rfkill_init(struct iwm_priv *iwm)
52{
53 int ret;
54
55 iwm->rfkill = rfkill_alloc(KBUILD_MODNAME,
56 iwm_to_dev(iwm),
57 RFKILL_TYPE_WLAN,
58 &iwm_rfkill_ops, iwm);
59 if (!iwm->rfkill) {
60 IWM_ERR(iwm, "Unable to allocate rfkill device\n");
61 return -ENOMEM;
62 }
63
64 ret = rfkill_register(iwm->rfkill);
65 if (ret) {
66 IWM_ERR(iwm, "Failed to register rfkill device\n");
67 goto fail;
68 }
69
70 return 0;
71 fail:
72 rfkill_destroy(iwm->rfkill);
73 return ret;
74}
75
76void iwm_rfkill_exit(struct iwm_priv *iwm)
77{
78 if (iwm->rfkill) {
79 rfkill_unregister(iwm->rfkill);
80 rfkill_destroy(iwm->rfkill);
81 }
82 iwm->rfkill = NULL;
83}