iwm: port to new cfg80211 rfkill
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 2 Jun 2009 11:01:42 +0000 (13:01 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 3 Jun 2009 18:06:14 +0000 (14:06 -0400)
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>
drivers/net/wireless/iwmc3200wifi/Kconfig
drivers/net/wireless/iwmc3200wifi/Makefile
drivers/net/wireless/iwmc3200wifi/iwm.h
drivers/net/wireless/iwmc3200wifi/netdev.c
drivers/net/wireless/iwmc3200wifi/rfkill.c [deleted file]

index 41bd4b2b5411a917d43c39d77d7c8e5d8a7cb21b..a907aa9eff6231216d81de6516cf431a7fa05d27 100644 (file)
@@ -4,7 +4,6 @@ config IWM
        select WIRELESS_EXT
        select CFG80211
        select FW_LOADER
-       select RFKILL
 
 config IWM_DEBUG
        bool "Enable full debugging output in iwmc3200wifi"
index 7cb415e5c11b286fb3b4335ce1581e06dcaad50e..927f022545c126bee71c35262a5b9d7852c0179b 100644 (file)
@@ -1,5 +1,5 @@
 obj-$(CONFIG_IWM) := iwmc3200wifi.o
 iwmc3200wifi-objs += main.o netdev.o rx.o tx.o sdio.o hal.o fw.o
-iwmc3200wifi-objs += commands.o wext.o cfg80211.o eeprom.o rfkill.o
+iwmc3200wifi-objs += commands.o wext.o cfg80211.o eeprom.o
 
 iwmc3200wifi-$(CONFIG_IWM_DEBUG) += debugfs.o
index 3b29681792bb3c07cccd3567360985b70124b407..635c16ee618654ea55621cf6b28479a6c655c7d1 100644 (file)
@@ -343,8 +343,4 @@ int iwm_rx_handle_resp(struct iwm_priv *iwm, u8 *buf, unsigned long buf_size,
                       struct iwm_wifi_cmd *cmd);
 void iwm_rx_free(struct iwm_priv *iwm);
 
-/* RF Kill API */
-int iwm_rfkill_init(struct iwm_priv *iwm);
-void iwm_rfkill_exit(struct iwm_priv *iwm);
-
 #endif
index eec7201e91a878c06f34a49d4979f23a2eab91c6..68e2c3b6c7a1a69a84534adaaa15302a80b022e9 100644 (file)
@@ -136,17 +136,8 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
 
        wdev->netdev = ndev;
 
-       ret = iwm_rfkill_init(iwm);
-       if (ret) {
-               dev_err(dev, "Failed to init rfkill\n");
-               goto out_rfkill;
-       }
-
        return iwm;
 
- out_rfkill:
-       unregister_netdev(ndev);
-
  out_ndev:
        free_netdev(ndev);
 
@@ -162,7 +153,6 @@ void iwm_if_free(struct iwm_priv *iwm)
        if (!iwm_to_ndev(iwm))
                return;
 
-       iwm_rfkill_exit(iwm);
        unregister_netdev(iwm_to_ndev(iwm));
        free_netdev(iwm_to_ndev(iwm));
        iwm_wdev_free(iwm);
diff --git a/drivers/net/wireless/iwmc3200wifi/rfkill.c b/drivers/net/wireless/iwmc3200wifi/rfkill.c
deleted file mode 100644 (file)
index 8ee2c3c..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Intel Wireless Multicomm 3200 WiFi driver
- *
- * Copyright (C) 2009 Intel Corporation <ilw@linux.intel.com>
- * Samuel Ortiz <samuel.ortiz@intel.com>
- * Zhu Yi <yi.zhu@intel.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version
- * 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- *
- */
-
-#include <linux/rfkill.h>
-
-#include "iwm.h"
-
-static int iwm_rfkill_set_block(void *data, bool blocked)
-{
-       struct iwm_priv *iwm = data;
-
-       if (!blocked) {
-               if (test_bit(IWM_RADIO_RFKILL_HW, &iwm->radio))
-                       return -EBUSY;
-
-               if (test_and_clear_bit(IWM_RADIO_RFKILL_SW, &iwm->radio) &&
-                   (iwm_to_ndev(iwm)->flags & IFF_UP))
-                       return iwm_up(iwm);
-       } else {
-               if (!test_and_set_bit(IWM_RADIO_RFKILL_SW, &iwm->radio))
-                       return iwm_down(iwm);
-       }
-
-       return 0;
-}
-
-static const struct rfkill_ops iwm_rfkill_ops = {
-       .set_block = iwm_rfkill_set_block,
-};
-
-int iwm_rfkill_init(struct iwm_priv *iwm)
-{
-       int ret;
-
-       iwm->rfkill = rfkill_alloc(KBUILD_MODNAME,
-                                  iwm_to_dev(iwm),
-                                  RFKILL_TYPE_WLAN,
-                                  &iwm_rfkill_ops, iwm);
-       if (!iwm->rfkill) {
-               IWM_ERR(iwm, "Unable to allocate rfkill device\n");
-               return -ENOMEM;
-       }
-
-       ret = rfkill_register(iwm->rfkill);
-       if (ret) {
-               IWM_ERR(iwm, "Failed to register rfkill device\n");
-               goto fail;
-       }
-
-       return 0;
- fail:
-       rfkill_destroy(iwm->rfkill);
-       return ret;
-}
-
-void iwm_rfkill_exit(struct iwm_priv *iwm)
-{
-       if (iwm->rfkill) {
-               rfkill_unregister(iwm->rfkill);
-               rfkill_destroy(iwm->rfkill);
-       }
-       iwm->rfkill = NULL;
-}