From: Zhu Yi <yi.zhu@intel.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Samuel Ortiz <samuel@sortiz.org>
Subject: Re: [RFT 5/4] iwm: port to new cfg80211 rfkill
Date: Mon, 25 May 2009 09:22:17 +0800 [thread overview]
Message-ID: <1243214537.24825.703.camel@debian> (raw)
In-Reply-To: <1243068775.4606.56.camel@johannes.local>
On Sat, 2009-05-23 at 16:52 +0800, Johannes Berg wrote:
> 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>
Looks good to me. I think we can remove the "select RFKILL" in Kconfig
also.
Thanks,
-yi
> ---
> drivers/net/wireless/iwmc3200wifi/Makefile | 2
> drivers/net/wireless/iwmc3200wifi/iwm.h | 4 -
> drivers/net/wireless/iwmc3200wifi/netdev.c | 10 ---
> drivers/net/wireless/iwmc3200wifi/rfkill.c | 83 -----------------------------
> 4 files changed, 1 insertion(+), 98 deletions(-)
>
> --- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/Makefile 2009-05-23 10:48:02.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/iwmc3200wifi/Makefile 2009-05-23 10:49:23.000000000 +0200
> @@ -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
> --- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/rfkill.c 2009-05-23 10:48:02.000000000 +0200
> +++ /dev/null 1970-01-01 00:00:00.000000000 +0000
> @@ -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;
> -}
> --- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/iwm.h 2009-05-23 10:51:09.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/iwmc3200wifi/iwm.h 2009-05-23 10:51:12.000000000 +0200
> @@ -343,8 +343,4 @@ int iwm_rx_handle_resp(struct iwm_priv *
> 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
> --- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/netdev.c 2009-05-23 10:51:18.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/iwmc3200wifi/netdev.c 2009-05-23 10:51:29.000000000 +0200
> @@ -136,17 +136,8 @@ void *iwm_if_alloc(int sizeof_bus, struc
>
> 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);
>
>
next prev parent reply other threads:[~2009-05-25 1:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-21 21:59 [RFT 0/4] rfkill improvements Johannes Berg
2009-05-21 21:59 ` [RFT 1/4] net: introduce pre-up netdev notifier Johannes Berg
2009-05-21 21:59 ` [RFT 2/4] rfkill: add function to query state Johannes Berg
2009-05-21 21:59 ` [RFT 3/4] cfg80211: add rfkill support Johannes Berg
2009-05-23 9:52 ` [RFT 3/4 v2] " Johannes Berg
2009-05-24 13:32 ` [RFT 3/4] " Dan Williams
2009-05-24 17:24 ` Johannes Berg
2009-05-26 16:38 ` Marcel Holtmann
2009-05-21 21:59 ` [RFT 4/4] iwlwifi: port to cfg80211 rfkill Johannes Berg
2009-05-23 8:49 ` [RFT 4/4 v2] " Johannes Berg
2009-05-23 8:52 ` [RFT 5/4] iwm: port to new " Johannes Berg
2009-05-25 1:22 ` Zhu Yi [this message]
2009-05-25 5:13 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1243214537.24825.703.camel@debian \
--to=yi.zhu@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=samuel@sortiz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).